]> git.baikalelectronics.ru Git - kernel.git/commit
mac8390: Fix mmio access size probe
authorFinn Thain <fthain@telegraphics.com.au>
Sat, 16 Mar 2019 03:21:19 +0000 (14:21 +1100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Mar 2019 23:56:57 +0000 (16:56 -0700)
commit543d674af3e30a1891483dca9be0471f6ab68083
tree14ad28530cd21c714a0ba951677611dab8861009
parentd1bba2cc07f2a0ff4d7b5cd9c2a0278270622a3f
mac8390: Fix mmio access size probe

The bug that Stan reported is as follows. After a restart, a 16-bit NIC
may be incorrectly identified as a 32-bit NIC and stop working.

mac8390 slot.E: Memory length resource not found, probing
mac8390 slot.E: Farallon EtherMac II-C (type farallon)
mac8390 slot.E: MAC 00:00:c5:30:c2:99, IRQ 61, 32 KB shared memory at 0xfeed0000, 32-bit access.

The bug never arises after a cold start and only intermittently after a
warm start. (I didn't investigate why the bug is intermittent.)

It turns out that memcpy_toio() is deprecated and memcmp_withio() also
has issues. Replacing these calls with mmio accessors fixes the problem.

Reported-and-tested-by: Stan Johnson <userm57@yahoo.com>
Fixes: 8b9e6d80e253 ("m68k: Mac DP8390 update")
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/8390/mac8390.c