Date: Mon, 28 May 2012 14:38:31 +0200 From: Stefan Richter Subject: firewire: ohci: write BIBimageValid before linkEnable OHCI 1.1 says: "Software may only set [HCControl.BIBimageValid] when HCControl.linkEnable is zero." This let's me wonder whether setting these two bits simultaneously could confuse some controllers. To be safe, maybe set them in separate MMIOs? Should we even read HCControl back to check that BIBimageValid has become 1 before we set linkEnable? Observations: - The reported cases of "device not detected if plugged into O2Micro controller after controller was enabled" are about SBP-2 devices, and the devices are actually detected but the SBP-2 login procedure is not completed. One of the login steps that could have gone wrong is when the target tries to read the initiator's EUI-64 in its bus info block. On the other hand, SBP-2 and -3 require this to be done in two quadlet read requests; per OHCI spec these are served by the OHCI physical response unit based on the GlobalUniqueID register rather than the BIB image. - BIBimageValid was added in OHCI 1.1; the bit is reserved in OHCI 1.0. The old ohci1394 driver in kernel 2.6.36 and older never set this bit but also did not use the atomic config ROM image update protocol of OHCI 1.1. Signed-off-by: Stefan Richter --- drivers/firewire/ohci.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -2384,10 +2384,8 @@ static int ohci_enable(struct fw_card *c irqs |= OHCI1394_busReset; reg_write(ohci, OHCI1394_IntMaskSet, irqs); - reg_write(ohci, OHCI1394_HCControlSet, - OHCI1394_HCControl_linkEnable | - OHCI1394_HCControl_BIBimageValid); - + reg_write(ohci, OHCI1394_HCControlSet, OHCI1394_HCControl_BIBimageValid); + reg_write(ohci, OHCI1394_HCControlSet, OHCI1394_HCControl_linkEnable); reg_write(ohci, OHCI1394_LinkControlSet, OHCI1394_LinkControl_rcvSelfID | OHCI1394_LinkControl_rcvPhyPkt);