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

USB: isp116x: fix enumeration on boot

This patch removes the buffering of the status register.
USB core behavior has changed a bit and this buffering was not refreshed
at the right time. The core got buffered old value of HCRHPORT and it
did not detect any devices on boot.

Signed-off-by: Anti Sullin <anti.sullin@artecdesign.ee>
Acked by: Olav Kongas <ok@artecdesign.ee>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Anti Sullin and committed by
Greg Kroah-Hartman
0ed930bf b5f7a0ec

+6 -10
+6 -9
drivers/usb/host/isp116x-hcd.c
··· 911 911 buf[0] = 0; 912 912 913 913 for (i = 0; i < ports; i++) { 914 - u32 status = isp116x->rhport[i] = 915 - isp116x_read_reg32(isp116x, i ? HCRHPORT2 : HCRHPORT1); 914 + u32 status = isp116x_read_reg32(isp116x, i ? HCRHPORT2 : HCRHPORT1); 916 915 917 916 if (status & (RH_PS_CSC | RH_PS_PESC | RH_PS_PSSC 918 917 | RH_PS_OCIC | RH_PS_PRSC)) { ··· 1030 1031 DBG("GetPortStatus\n"); 1031 1032 if (!wIndex || wIndex > ports) 1032 1033 goto error; 1033 - tmp = isp116x->rhport[--wIndex]; 1034 + spin_lock_irqsave(&isp116x->lock, flags); 1035 + tmp = isp116x_read_reg32(isp116x, (--wIndex) ? HCRHPORT2 : HCRHPORT1); 1036 + spin_unlock_irqrestore(&isp116x->lock, flags); 1034 1037 *(__le32 *) buf = cpu_to_le32(tmp); 1035 1038 DBG("GetPortStatus: port[%d] %08x\n", wIndex + 1, tmp); 1036 1039 break; ··· 1081 1080 spin_lock_irqsave(&isp116x->lock, flags); 1082 1081 isp116x_write_reg32(isp116x, wIndex 1083 1082 ? HCRHPORT2 : HCRHPORT1, tmp); 1084 - isp116x->rhport[wIndex] = 1085 - isp116x_read_reg32(isp116x, wIndex ? HCRHPORT2 : HCRHPORT1); 1086 1083 spin_unlock_irqrestore(&isp116x->lock, flags); 1087 1084 break; 1088 1085 case SetPortFeature: ··· 1094 1095 spin_lock_irqsave(&isp116x->lock, flags); 1095 1096 isp116x_write_reg32(isp116x, wIndex 1096 1097 ? HCRHPORT2 : HCRHPORT1, RH_PS_PSS); 1098 + spin_unlock_irqrestore(&isp116x->lock, flags); 1097 1099 break; 1098 1100 case USB_PORT_FEAT_POWER: 1099 1101 DBG("USB_PORT_FEAT_POWER\n"); 1100 1102 spin_lock_irqsave(&isp116x->lock, flags); 1101 1103 isp116x_write_reg32(isp116x, wIndex 1102 1104 ? HCRHPORT2 : HCRHPORT1, RH_PS_PPS); 1105 + spin_unlock_irqrestore(&isp116x->lock, flags); 1103 1106 break; 1104 1107 case USB_PORT_FEAT_RESET: 1105 1108 DBG("USB_PORT_FEAT_RESET\n"); 1106 1109 root_port_reset(isp116x, wIndex); 1107 - spin_lock_irqsave(&isp116x->lock, flags); 1108 1110 break; 1109 1111 default: 1110 1112 goto error; 1111 1113 } 1112 - isp116x->rhport[wIndex] = 1113 - isp116x_read_reg32(isp116x, wIndex ? HCRHPORT2 : HCRHPORT1); 1114 - spin_unlock_irqrestore(&isp116x->lock, flags); 1115 1114 break; 1116 1115 1117 1116 default:
-1
drivers/usb/host/isp116x.h
··· 270 270 u32 rhdesca; 271 271 u32 rhdescb; 272 272 u32 rhstatus; 273 - u32 rhport[2]; 274 273 275 274 /* async schedule: control, bulk */ 276 275 struct list_head async;