Thread: [Linux1394-cvslog] rev 693 - branches/linux-2.4
Brought to you by:
aeb,
bencollins
From: SVN U. <ben...@li...> - 2002-11-18 18:48:38
|
Author: bencollins Date: 2002-11-18 13:48:05 -0500 (Mon, 18 Nov 2002) New Revision: 693 Modified: branches/linux-2.4/ohci1394.c Log: Pull in selfID bus interrupt handler fix for busReset storms, from trunk. Modified: branches/linux-2.4/ohci1394.c ============================================================================== --- branches/linux-2.4/ohci1394.c (original) +++ branches/linux-2.4/ohci1394.c 2002-11-18 13:48:05.000000000 -0500 @@ -1173,74 +1173,60 @@ } if (event & OHCI1394_selfIDComplete) { if (host->in_bus_reset) { - node_id = reg_read(ohci, OHCI1394_NodeID); + 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); + PRINT(KERN_ERR, ohci->id, + "SelfID received, but NodeID invalid " + "(probably new bus reset occured): %08X", + node_id); + goto selfid_not_valid; } - if (node_id & 0x80000000) { /* NodeID valid */ - phyid = node_id & 0x0000003f; - isroot = (node_id & 0x40000000) != 0; - - DBGMSG(ohci->id, - "SelfID interrupt received " - "(phyid %d, %s)", phyid, - (isroot ? "root" : "not root")); + phyid = node_id & 0x0000003f; + isroot = (node_id & 0x40000000) != 0; + + DBGMSG(ohci->id, + "SelfID interrupt received " + "(phyid %d, %s)", phyid, + (isroot ? "root" : "not root")); + + handle_selfid(ohci, host, phyid, isroot); + + /* 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); - handle_selfid(ohci, host, - phyid, isroot); + /* 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 { - PRINT(KERN_ERR, ohci->id, - "SelfID interrupt received, but " - "NodeID is not valid: %08X", - node_id); + 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)); - /* Accept Physical requests from all nodes. */ - reg_write(ohci,OHCI1394_AsReqFilterHiSet, - 0xffffffff); - reg_write(ohci,OHCI1394_AsReqFilterLoSet, - 0xffffffff); + hpsb_selfid_complete(host, phyid, isroot); } else - PRINT(KERN_ERR, ohci->id, + 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)); + event &= ~OHCI1394_selfIDComplete; +selfid_not_valid: } /* Make sure we handle everything, just in case we accidentally |