lkml.org 
[lkml]   [2012]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[13/22] Cyclades PC300 driver: alignment fix for portability
This fixes an unaligned memory access to one of the device registers which was
causing a kernel panic on sparc64.

Signed-off-by: Andrea Shepard <andrea@persephoneslair.org>

diff --git a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c
index 14500eb..8249038 100644
--- a/drivers/net/wan/pc300_drv.c
+++ b/drivers/net/wan/pc300_drv.c
@@ -3277,8 +3277,10 @@ static int ch_config(pc300dev_t * d)
IR0_DTX(IR0_EFT | IR0_DMIA | IR0_DMIB, ch));
cpc_writeb(scabase + M_REG(IE0, ch),
cpc_readl(scabase + M_REG(IE0, ch)) | IE0_RXINTA);
+
+ /* Was cpc_readl(), changed for unaligned access */
cpc_writeb(scabase + M_REG(IE1, ch),
- cpc_readl(scabase + M_REG(IE1, ch)) | IE1_CDCD);
+ cpc_readb(scabase + M_REG(IE1, ch)) | IE1_CDCD);

return 0;
}

\
 
 \ /
  Last update: 2012-01-30 03:57    [from the cache]
©2003-2011 Jasper Spaans