Skip to content

Commit e9e4ea7

Browse files
wildea01davem330
authored andcommitted
net: smc91x: dont't use SMC_outw for fixing up halfword-aligned data
SMC_outw invokes an endian-aware I/O accessor, which may change the data endianness before writing to the device. This is not suitable for data transfers where the memory buffer is simply a string of bytes that does not require any byte-swapping. This patches fixes the smc91x SMC_PUSH_DATA macro so that it uses the string I/O accessor for outputting the leading or trailing halfwords on halfword-aligned buffers. Cc: <netdev@vger.kernel.org> Cc: Nicolas Pitre <nico@fluxnic.net> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Will Deacon <will.deacon@arm.com> Acked-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 96b3404 commit e9e4ea7

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/net/ethernet/smsc/smc91x.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,17 +1124,15 @@ static const char * chip_ids[ 16 ] = {
11241124
void __iomem *__ioaddr = ioaddr; \
11251125
if (__len >= 2 && (unsigned long)__ptr & 2) { \
11261126
__len -= 2; \
1127-
SMC_outw(*(u16 *)__ptr, ioaddr, \
1128-
DATA_REG(lp)); \
1127+
SMC_outsw(ioaddr, DATA_REG(lp), __ptr, 1); \
11291128
__ptr += 2; \
11301129
} \
11311130
if (SMC_CAN_USE_DATACS && lp->datacs) \
11321131
__ioaddr = lp->datacs; \
11331132
SMC_outsl(__ioaddr, DATA_REG(lp), __ptr, __len>>2); \
11341133
if (__len & 2) { \
11351134
__ptr += (__len & ~3); \
1136-
SMC_outw(*((u16 *)__ptr), ioaddr, \
1137-
DATA_REG(lp)); \
1135+
SMC_outsw(ioaddr, DATA_REG(lp), __ptr, 1); \
11381136
} \
11391137
} else if (SMC_16BIT(lp)) \
11401138
SMC_outsw(ioaddr, DATA_REG(lp), p, (l) >> 1); \

0 commit comments

Comments
 (0)