2.6.18 unaligned acccess in ehci_hub_control
I upgraded from 2.6.17.7 to 2.6.18 today, and in dmesg I have 5 of these messages in a row:
Kernel unaligned access at TPC[100be8c8] ehci_hub_control+0x350/0x680 [ehci_hcd]
This message wasn't there before... I suppose it is pretty harmless as the kernel is supposed to handle unaligned accesses (right?) but this is the first time it's happened.
According to gdb (my first time using it...),drivers/usb/host/ehci-hub.c:280 is to blame:
(gdb) list *ehci_hub_control+0x3500x8d0 is in ehci_hub_control (drivers/usb/host/ehci-hub.c:280).
275 struct usb_hub_descriptor *desc
276 ) {
277 int ports = HCS_N_PORTS (ehci->hcs_params); 278 u16 temp; 279 280 desc->bDescriptorType = 0x29; 281 desc->bPwrOn2PwrGood = 10; /* ehci 1.0, 2.3.9 says 20ms max */ 282 desc->bHubContrCurrent = 0;
283
284 desc->bNbrPorts = ports;
System is a Sun U80 4x450 with 2.5G and a USB2 PCI card. GCC for the kernel is 4.1.1 (with gentoo patchset). The only USB2 device is an external Sony dual layer DVD writer.
From: Will Simoneau <[email protected]>
Date: Wed, 20 Sep 2006 13:21:23 -0400
Quoted 8 lines
I upgraded from 2.6.17.7 to 2.6.18 today, and in dmesg I have 5 of these messages in a row:
Kernel unaligned access at TPC[100be8c8]
ehci_hub_control+0x350/0x680[ehci_hcd]This message wasn't there before... I suppose it is pretty harmless as the kernel is supposed to handle unaligned accesses (right?) but this is the first time it's happened.
Yes, I've been meaning to send Greg KH patches to fix these cases, thanks for reminding me about it.
Quoted 6 lines · David Miller
From: Will Simoneau <[email protected]>
Date: Wed, 20 Sep 2006 13:21:23 -0400Quoted 3 lines
I upgraded from 2.6.17.7 to 2.6.18 today, and in dmesg I have 5 of these messages in a row:
Quoted 8 lines
Quoted 5 lines
Kernel unaligned access at TPC[100be8c8]
ehci_hub_control+0x350/0x680[ehci_hcd]This message wasn't there before... I suppose it is pretty harmless as the kernel is supposed to handle unaligned accesses (right?) but this is the first time it's happened.
Yes, I've been meaning to send Greg KH patches to fix these cases, thanks for reminding me about it.
I don't think it's harmless. My Ultra5 has an add-on PCI USB controller card (Belkin). A 2.6.18-rc kernel compiled with gcc-4.1.1 will throw a few unaligned accesses when I initialise USB by inserting a USB memory stick. Removing the memory stick then results in PCI errors and other breakage.
The same kernel compiled with gcc-3.4.6 has no problems at all, so I've been assuming it's a gcc-4 issue and not a kernel issue.
/Mikael
From: Mikael Pettersson <[email protected]>
Date: Thu, 21 Sep 2006 12:37:09 +0200
Quoted 7 lines
I don't think it's harmless. My Ultra5 has an add-on PCI USB controller card (Belkin). A 2.6.18-rc kernel compiled with gcc-4.1.1 will throw a few unaligned accesses when I initialise USB by inserting a USB memory stick. Removing the memory stick then results in PCI errors and other breakage.
The same kernel compiled with gcc-3.4.6 has no problems at all, so I've been assuming it's a gcc-4 issue and not a kernel issue.
Compiled with gcc-4.0.x I get the same ehci_hub_control unaligned accesses, and putting the correct {get,put}_unaligned() in that function makes them go away.
It's a pure mystery if gcc-3.4.x somehow avoids those, as by the way the code is written those unaligned accesses are to be expected.