[Linux1394-cvslog] rev 739 - trunk
Brought to you by:
aeb,
bencollins
From: SVN U. <dde...@li...> - 2003-02-01 13:59:47
|
Author: ddennedy Date: 2003-01-07 21:22:18 -0500 (Tue, 07 Jan 2003) New Revision: 739 Modified: trunk/dv1394.c Log: fix oops on mod reload, fix integrity of frame buffer overflow handling Modified: trunk/dv1394.c ============================================================================== --- trunk/dv1394.c (original) +++ trunk/dv1394.c 2003-02-01 08:59:15.000000000 -0500 @@ -909,6 +909,7 @@ u64 chan_mask; int retval = -EINVAL; + debug_printk( "dv1394: initialising %d\n", video->id ); if(init->api_version != DV1394_API_VERSION) goto err; @@ -1177,6 +1178,7 @@ if( (reg_read(video->ohci, video->ohci_IsoXmitContextControlClear) & (1 << 10)) || (reg_read(video->ohci, video->ohci_IsoRcvContextControlClear) & (1 << 10)) ) { /* still active */ + debug_printk("dv1394: stop_dma: DMA not stopped yet\n" ); mb(); } else { debug_printk("dv1394: stop_dma: DMA stopped safely after %d ms\n", i/10); @@ -1190,7 +1192,9 @@ printk(KERN_ERR "dv1394: stop_dma: DMA still going after %d ms!\n", i/10); } } - + else + debug_printk("dv1394: stop_dma: already stopped.\n"); + spin_unlock_irqrestore(&video->spinlock, flags); } @@ -1217,7 +1221,8 @@ /* disable interrupts for IT context */ reg_write(video->ohci, OHCI1394_IsoXmitIntMaskClear, (1 << video->ohci_it_ctx)); - clear_bit(video->ohci_it_ctx, &video->ohci->it_ctx_usage); + /* remove tasklet */ + ohci1394_unregister_iso_tasklet(video->ohci, &video->it_tasklet); debug_printk("dv1394: IT context %d released\n", video->ohci_it_ctx); video->ohci_it_ctx = -1; } @@ -1231,23 +1236,14 @@ /* disable interrupts for IR context */ reg_write(video->ohci, OHCI1394_IsoRecvIntMaskClear, (1 << video->ohci_ir_ctx)); - clear_bit(video->ohci_ir_ctx, &video->ohci->ir_ctx_usage); + /* remove tasklet */ + ohci1394_unregister_iso_tasklet(video->ohci, &video->ir_tasklet); debug_printk("dv1394: IR context %d released\n", video->ohci_ir_ctx); video->ohci_ir_ctx = -1; } spin_unlock_irqrestore(&video->spinlock, flags); - /* remove tasklets */ - if(video->ohci_it_ctx != -1) { - ohci1394_unregister_iso_tasklet(video->ohci, &video->it_tasklet); - video->ohci_it_ctx = -1; - } - if(video->ohci_ir_ctx != -1) { - ohci1394_unregister_iso_tasklet(video->ohci, &video->ir_tasklet); - video->ohci_ir_ctx = -1; - } - /* release the ISO channel */ if(video->channel != -1) { u64 chan_mask; @@ -2337,6 +2333,7 @@ dbc = (int) (p->cip_h1 >> 24); if ( video->continuity_counter != -1 && dbc > ((video->continuity_counter + 1) % 256) ) { + printk(KERN_WARNING "dv1394: discontinuity detected, dropping all frames\n" ); video->dropped_frames += video->n_clear_frames + 1; video->first_frame = 0; video->n_clear_frames = 0; @@ -2355,9 +2352,8 @@ video->n_clear_frames++; if (video->n_clear_frames > video->n_frames) { video->dropped_frames++; - video->n_clear_frames--; - if (video->n_clear_frames < 0) - video->n_clear_frames = 0; + printk(KERN_WARNING "dv1394: dropped a frame during reception\n" ); + video->n_clear_frames = video->n_frames-1; video->first_clear_frame = (video->first_clear_frame + 1) % video->n_frames; } if (video->first_clear_frame == -1) @@ -2366,7 +2362,6 @@ /* get the next frame */ video->active_frame = (video->active_frame + 1) % video->n_frames; f = video->frames[video->active_frame]; - irq_printk(" frame received, active_frame = %d, n_clear_frames = %d, first_clear_frame = %d\n", video->active_frame, video->n_clear_frames, video->first_clear_frame); } |