Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

firewire: fw-ohci: check for misconfigured bus (phyID == 63)

Check NodeID.nodeNumber as per OHCI 1.1 clause 7.2.3.2. See also IEEE
1394a table 5B-1.

Also, demote the "node ID not valid" message from error to notification
as it is not an error condition.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>

+9 -2
+7 -2
drivers/firewire/fw-ohci.c
··· 917 917 918 918 reg = reg_read(ohci, OHCI1394_NodeID); 919 919 if (!(reg & OHCI1394_NodeID_idValid)) { 920 - fw_error("node ID not valid, new bus reset in progress\n"); 920 + fw_notify("node ID not valid, new bus reset in progress\n"); 921 921 return; 922 922 } 923 - ohci->node_id = reg & 0xffff; 923 + if ((reg & OHCI1394_NodeID_nodeNumber) == 63) { 924 + fw_notify("malconfigured bus\n"); 925 + return; 926 + } 927 + ohci->node_id = reg & (OHCI1394_NodeID_busNumber | 928 + OHCI1394_NodeID_nodeNumber); 924 929 925 930 /* 926 931 * The count in the SelfIDCount register is the number of
+2
drivers/firewire/fw-ohci.h
··· 59 59 #define OHCI1394_LinkControl_cycleSource (1 << 22) 60 60 #define OHCI1394_NodeID 0x0E8 61 61 #define OHCI1394_NodeID_idValid 0x80000000 62 + #define OHCI1394_NodeID_nodeNumber 0x0000003f 63 + #define OHCI1394_NodeID_busNumber 0x0000ffc0 62 64 #define OHCI1394_PhyControl 0x0EC 63 65 #define OHCI1394_PhyControl_Read(addr) (((addr) << 8) | 0x00008000) 64 66 #define OHCI1394_PhyControl_ReadDone 0x80000000