Skip to contentSkip to conversation

via-velocity: don't annotate MAC registers as packed

PATCH Applied Ulrich Hecht 2 participants 2 messages May 25, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 via-velocity: don't annotate MAC registers as packed

On ARM, memory accesses through packed pointers behave in unexpected ways in GCC releases 4.3 and higher; see https://lkml.org/lkml/2011/2/2/163
for discussion.

In this particular case, 32-bit I/O registers are accessed bytewise, causing incorrect setting of the DMA address registers which in turn leads to an error interrupt storm that brings the system to a halt.

Since the mac_regs structure does not need any packing anyway, this patch simply removes the attribute to fix the issue.

---
 drivers/net/via-velocity.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/via-velocity.h +1 -1
index 70da79d..659b211 100644
@@ -1096,7 +1096,7 @@ struct mac_regs {
 
 	volatile __le16 PatternCRC[8];	/* 0xB0 */
 	volatile __le32 ByteMask[4][4];	/* 0xC0 */
-} __packed;
+};
 
 
 enum hw_mib {
Signature · 1 line
1.7.1
maintainer Applied
#1 lore raw

From: Ulrich Hecht <[email protected]>
Date: Wed, 25 May 2011 13:07:22 +0200

Quoted 4 lines

On ARM, memory accesses through packed pointers behave in unexpected ways in GCC releases 4.3 and higher; see https://lkml.org/lkml/2011/2/2/163
for discussion.

Quoted 8 lines

In this particular case, 32-bit I/O registers are accessed bytewise, causing incorrect setting of the DMA address registers which in turn leads to an error interrupt storm that brings the system to a halt.

Since the mac_regs structure does not need any packing anyway, this patch simply removes the attribute to fix the issue.

Applied.