1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/dsa/microchip
Tobias Jakobi (Compleo) b7fb7729c9 net: dsa: microchip: fix register write order in ksz8_ind_write8()
This bug was noticed while re-implementing parts of the kernel
driver in userspace using spidev. The goal was to enable some
of the errata workarounds that Microchip describes in their
errata sheet [1].

Both the errata sheet and the regular datasheet of e.g. the KSZ8795
imply that you need to do this for indirect register accesses:
- write a 16-bit value to a control register pair (this value
  consists of the indirect register table, and the offset inside
  the table)
- either read or write an 8-bit value from the data storage
  register (indicated by REG_IND_BYTE in the kernel)

The current implementation has the order swapped. It can be
proven, by reading back some indirect register with known content
(the EEE register modified in ksz8_handle_global_errata() is one of
these), that this implementation does not work.

Private discussion with Oleksij Rempel of Pengutronix has revealed
that the workaround was apparantly never tested on actual hardware.

[1] https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/Errata/KSZ87xx-Errata-DS80000687C.pdf

Signed-off-by: Tobias Jakobi (Compleo) <tobias.jakobi.compleo@gmail.com>
Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de>
Fixes: 7b6e6235b6 ("net: dsa: microchip: ksz8795: handle eee specif erratum")
Link: https://lore.kernel.org/r/20240304154135.161332-1-tobias.jakobi.compleo@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-03-05 19:10:49 -08:00
..
Kconfig net: dsa: microchip: ptp: fix up PTP dependency 2023-01-31 13:21:38 +01:00
ksz8.h net: dsa: microchip: ksz8: Make flow control, speed, and duplex on CPU port configurable 2023-11-29 08:38:34 -08:00
ksz8795.c net: dsa: microchip: fix register write order in ksz8_ind_write8() 2024-03-05 19:10:49 -08:00
ksz8795_reg.h net: dsa: microchip: add property to select internal RMII reference clock 2023-12-07 10:22:09 +00:00
ksz8863_smi.c net: dsa: Explicitly include correct DT includes 2023-07-26 21:54:16 -07:00
ksz9477.c net: dsa: microchip: ksz9477: Fix spelling mistake "Enery" -> "Energy" 2023-10-27 14:45:50 -07:00
ksz9477.h net: dsa: microchip: Ensure Stable PME Pin State for Wake-on-LAN 2023-10-27 14:43:53 -07:00
ksz9477_acl.c net: dsa: microchip: Fix uninitialized var in ksz9477_acl_move_entries() 2023-10-10 11:12:01 +02:00
ksz9477_i2c.c net: dsa: microchip: Refactor switch shutdown routine for WoL preparation 2023-10-27 14:43:53 -07:00
ksz9477_reg.h net: dsa: microchip: move REG_SW_MAC_ADDR to dev->info->regs[] 2023-10-03 13:51:02 +02:00
ksz9477_tc_flower.c net: dsa: microchip: Add partial ACL support for ksz9477 switches 2023-09-17 14:28:34 +01:00
ksz_common.c net: dsa: microchip: use DSA_TAG_PROTO without _VALUE define 2023-12-08 11:01:21 -08:00
ksz_common.h net: dsa: microchip: move ksz_chip_id enum to platform include 2023-12-07 12:00:20 +00:00
ksz_ptp.c net: dsa: Use conduit and user terms 2023-10-24 13:08:14 -07:00
ksz_ptp.h net: dsa: microchip: ptp: add support for perout programmable pins 2023-01-13 08:40:41 +00:00
ksz_ptp_reg.h net: dsa: microchip: ptp: lan937x: Enable periodic output in LED pins 2023-01-13 08:40:41 +00:00
ksz_spi.c net: dsa: microchip: Refactor switch shutdown routine for WoL preparation 2023-10-27 14:43:53 -07:00
lan937x.h net: dsa: microchip: add support for credit based shaper 2023-01-23 22:12:35 -08:00
lan937x_main.c net: dsa: microchip: add an enum for regmap widths 2023-05-30 09:48:17 +02:00
lan937x_reg.h net: dsa: microchip: add support for credit based shaper 2023-01-23 22:12:35 -08:00
Makefile net: dsa: microchip: Add partial ACL support for ksz9477 switches 2023-09-17 14:28:34 +01:00