]> git.baikalelectronics.ru Git - kernel.git/commit
net: ks8851-ml: Fix IO operations, again
authorMarek Vasut <marex@denx.de>
Wed, 25 Mar 2020 14:25:47 +0000 (15:25 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Mar 2020 03:20:19 +0000 (20:20 -0700)
commit322ec1b7b28c6a3ab0731407e7a8b69937814c30
treecd2c6952c4fc0a9d1177254c687fd12ed8678a25
parent935890d6b308df8c085b7c190c52fcf89564c5e6
net: ks8851-ml: Fix IO operations, again

This patch reverts e6aaf03eebc0 ("net: ks8851-ml: Fix 16-bit IO operation")
and 517742d72c91 ("net: ks8851-ml: Fix 16-bit data access"), because it
turns out these were only necessary due to buggy hardware. This patch adds
a check for such a buggy hardware to prevent any such mistakes again.

While working further on the KS8851 driver, it came to light that the
KS8851-16MLL is capable of switching bus endianness by a hardware strap,
EESK pin. If this strap is incorrect, the IO accesses require such endian
swapping as is being reverted by this patch. Such swapping also impacts
the performance significantly.

Hence, in addition to removing it, detect that the hardware is broken,
report to user, and fail to bind with such hardware.

Fixes: e6aaf03eebc0 ("net: ks8851-ml: Fix 16-bit IO operation")
Fixes: 517742d72c91 ("net: ks8851-ml: Fix 16-bit data access")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: David S. Miller <davem@davemloft.net>
Cc: Lukas Wunner <lukas@wunner.de>
Cc: Petr Stetiar <ynezz@true.cz>
Cc: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/micrel/ks8851_mll.c