[Linux1394-cvslog] rev 667 - trunk
Brought to you by:
aeb,
bencollins
From: SVN U. <ben...@li...> - 2002-11-16 04:49:46
|
Author: bencollins Date: 2002-11-15 23:49:12 -0500 (Fri, 15 Nov 2002) New Revision: 667 Modified: trunk/ohci1394.c Log: For self-id interrupt: Do not mdelay for invalid nodeid. Instead accept it and hope that this means another bus reset occured and will follow us. To help this along, we move the clearing of the clearing of the bus reset and enabling of the bus reset interrupt into the valid node-id block. We don't want to be enabling all of this underneath of a self-id phase in another interrupt. Moved setting of phys-dma filters into same block, and shifted things around so that hopefully the mdelay there wont be needed aswell. Based on Manfred's patch. Modified: trunk/ohci1394.c ============================================================================== --- trunk/ohci1394.c (original) +++ trunk/ohci1394.c 2002-11-15 23:49:13.000000000 -0500 @@ -1873,16 +1873,11 @@ event &= ~OHCI1394_isochTx; } if (event & OHCI1394_selfIDComplete) { + event &= ~OHCI1394_selfIDComplete; + if (host->in_bus_reset) { node_id = reg_read(ohci, OHCI1394_NodeID); - /* If our nodeid is not valid, give a msec delay - * to let it settle in and try again. */ - if (!(node_id & 0x80000000)) { - mdelay(1); - node_id = reg_read(ohci, OHCI1394_NodeID); - } - if (node_id & 0x80000000) { /* NodeID valid */ phyid = node_id & 0x0000003f; isroot = (node_id & 0x40000000) != 0; @@ -1896,52 +1891,41 @@ phyid, isroot); } else { PRINT(KERN_ERR, ohci->id, - "SelfID interrupt received, but " - "NodeID is not valid: %08X", + "SelfID received, but NodeID invalid " + "(probably new bus reset occured): %08X", node_id); } + /* Clear the bus reset event and re-enable the + * busReset interrupt. */ + spin_lock_irqsave(&ohci->event_lock, flags); + reg_write(ohci, OHCI1394_IntEventClear, OHCI1394_busReset); + reg_write(ohci, OHCI1394_IntMaskSet, OHCI1394_busReset); + spin_unlock_irqrestore(&ohci->event_lock, flags); + /* Accept Physical requests from all nodes. */ - reg_write(ohci,OHCI1394_AsReqFilterHiSet, - 0xffffffff); - reg_write(ohci,OHCI1394_AsReqFilterLoSet, - 0xffffffff); + reg_write(ohci,OHCI1394_AsReqFilterHiSet, 0xffffffff); + reg_write(ohci,OHCI1394_AsReqFilterLoSet, 0xffffffff); + + /* Turn on phys dma reception. + * + * TODO: Enable some sort of filtering management. + */ + if (phys_dma) { + reg_write(ohci,OHCI1394_PhyReqFilterHiSet, 0xffffffff); + reg_write(ohci,OHCI1394_PhyReqFilterLoSet, 0xffffffff); + reg_write(ohci,OHCI1394_PhyUpperBound, 0xffff0000); + } else { + reg_write(ohci,OHCI1394_PhyReqFilterHiSet, 0x00000000); + reg_write(ohci,OHCI1394_PhyReqFilterLoSet, 0x00000000); + } + + DBGMSG(ohci->id, "PhyReqFilter=%08x%08x\n", + reg_read(ohci,OHCI1394_PhyReqFilterHiSet), + reg_read(ohci,OHCI1394_PhyReqFilterLoSet)); } else PRINT(KERN_ERR, ohci->id, "SelfID received outside of bus reset sequence"); - - /* Finally, we clear the busReset event and reenable - * the busReset interrupt. */ - spin_lock_irqsave(&ohci->event_lock, flags); - reg_write(ohci, OHCI1394_IntEventClear, OHCI1394_busReset); - reg_write(ohci, OHCI1394_IntMaskSet, OHCI1394_busReset); - spin_unlock_irqrestore(&ohci->event_lock, flags); - event &= ~OHCI1394_selfIDComplete; - - /* Turn on phys dma reception. We should - * probably manage the filtering somehow, - * instead of blindly turning it on. */ - - /* - * CAUTION! - * Some chips (TI TSB43AB22) won't take a value in - * the PhyReqFilter register until after the IntEvent - * is cleared for bus reset, and even then a short - * delay is required. - */ - if (phys_dma) { - mdelay(1); - reg_write(ohci,OHCI1394_PhyReqFilterHiSet, - 0xffffffff); - reg_write(ohci,OHCI1394_PhyReqFilterLoSet, - 0xffffffff); - reg_write(ohci,OHCI1394_PhyUpperBound, - 0xffff0000); - } - - DBGMSG(ohci->id, "PhyReqFilter=%08x%08x\n", - reg_read(ohci,OHCI1394_PhyReqFilterHiSet), - reg_read(ohci,OHCI1394_PhyReqFilterLoSet)); } /* Make sure we handle everything, just in case we accidentally |