Skip to contentSkip to conversation

fix ehci alignment error

PATCH In review Harro Haan 5 participants 8 messages Oct 10, 2011

lore
Share & tools
lore
#1 lore raw
Quoted 3 lines · Harro Haan

The Kirkwood gave an unaligned memory access error on line 742 of drivers/usb/host/echi-hcd.c:
"ehci->last_periodic_enable = ktime_get_real();"

What is "The Kirkwood"? What size processor is this?

#2 lore raw
Quoted 6 lines · Greg KH
Quoted 3 lines · Harro Haan

The Kirkwood gave an unaligned memory access error on line 742 of drivers/usb/host/echi-hcd.c:
"ehci->last_periodic_enable = ktime_get_real();"

What is "The Kirkwood"? What size processor is this?

It's an ARM926-like CPU from Marvell.

Signature · 2 lines
M?ns Rullg?rd
mans at mansr.com
#3 lore raw
Quoted 10 lines · M?ns Rullg?rd
Quoted 6 lines · Greg KH
Quoted 3 lines · Harro Haan

The Kirkwood gave an unaligned memory access error on line 742 of drivers/usb/host/echi-hcd.c:
"ehci->last_periodic_enable = ktime_get_real();"

What is "The Kirkwood"? What size processor is this?

It's an ARM926-like CPU from Marvell.

32 or 64bit?

#4 lore raw
Quoted 8 lines · Greg KH
Quoted 7 lines · M?ns Rullg?rd
Quoted 5 lines · Greg KH
Quoted 3 lines · Harro Haan

The Kirkwood gave an unaligned memory access error on line 742 of drivers/usb/host/echi-hcd.c:
"ehci->last_periodic_enable = ktime_get_real();"

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

What is "The Kirkwood"? What size processor is this?

It's an ARM926-like CPU from Marvell.

32 or 64bit?

All ARMs are 32-bit, but some have instructions for loading or storing 2 x 32 bits at a time, but also require the corresponding memory address to be 64-bit aligned.

#5 lore raw
Quoted 11 lines · Mikael Pettersson
Quoted 10 lines · Greg KH
Quoted 9 lines · M?ns Rullg?rd
Quoted 6 lines · Greg KH
Quoted 3 lines · Harro Haan

The Kirkwood gave an unaligned memory access error on line 742 of drivers/usb/host/echi-hcd.c:
"ehci->last_periodic_enable = ktime_get_real();"

What is "The Kirkwood"? What size processor is this?

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

It's an ARM926-like CPU from Marvell.

32 or 64bit?

All ARMs are 32-bit, but some have instructions for loading or storing 2 x 32 bits at a time, but also require the corresponding memory address to be 64-bit aligned.

Ah, ok, that makes more sense here. I'll go queue it up.

greg k-h

#6 lore raw
Quoted 12 lines · Greg KH
Quoted 11 lines · Mikael Pettersson
Quoted 10 lines · Greg KH
Quoted 9 lines · M?ns Rullg?rd
Quoted 6 lines · Greg KH
Quoted 3 lines · Harro Haan

The Kirkwood gave an unaligned memory access error on line 742 of drivers/usb/host/echi-hcd.c:
"ehci->last_periodic_enable = ktime_get_real();"

What is "The Kirkwood"? What size processor is this?

Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
Quoted 1 line

It's an ARM926-like CPU from Marvell.

32 or 64bit?

All ARMs are 32-bit, but some have instructions for loading or storing 2 x 32 bits at a time, but also require the corresponding memory address to be 64-bit aligned.

To be perfectly accurate, all ARMs have the dual load/store instructions, but only some (ARMv5 and earlier) require a 64-bit aligned address for these. The Kirkwood is an ARMv5 so it does need this alignment.

Furthermore, the standard ARM ABI requires 8-byte alignment for 64-bit data types regardless of CPU version, which is perhaps a bit unusual for a 32-bit architecture.

Signature · 2 lines
M?ns Rullg?rd
mans at mansr.com
Acked-by on v1 1/1
#7 lore raw
In reply to Harro Haan
Quoted 14 lines · Harro Haan

The Kirkwood gave an unaligned memory access error on line 742 of drivers/usb/host/echi-hcd.c:
"ehci->last_periodic_enable = ktime_get_real();"

---
 include/linux/usb/hcd.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/usb/hcd.h +0 -0
index 0097136..c0ecc5a 100644

include/linux/usb/hcd.h struct usb_hcd { · line 184

Quoted 8 lines
include/linux/usb/hcd.h +1 -1
@@ -178,7 +178,7 @@ struct usb_hcd {
 	 * this structure.
 	 */
 	unsigned long hcd_priv[0]
-			__attribute__ ((aligned(sizeof(unsigned long))));
+			__attribute__ ((aligned(sizeof(s64))));
 };
 
 /* 2.4 does this a bit differently ... */