linux/drivers/net/dsa
Vladimir Oltean df405910ab net: dsa: sja1105: wait for dynamic config command completion on writes too
The hardware manual says that software should attempt a new dynamic
config access (be it a a write or a read-back) only while the VALID bit
is cleared. The VALID bit is set by software to 1, and it remains set as
long as the hardware is still processing the request.

Currently the driver only polls for the command completion only for
reads, because that's when we need the actual data read back. Writes
have been more or less "asynchronous", although this has never been an
observable issue.

This change makes sja1105_dynamic_config_write poll the VALID bit as
well, to absolutely ensure that a follow-up access to the static config
finds the VALID bit cleared.

So VALID means "work in progress", while VALIDENT means "entry being
read is valid". On reads we check the VALIDENT bit too, while on writes
that bit is not always defined. So we need to factor it out of the loop,
and make the loop provide back the unpacked command structure, so that
sja1105_dynamic_config_read can check the VALIDENT bit.

The change also attempts to convert the open-coded loop to use the
read_poll_timeout macro, since I know this will come up during review.
It's more code, but hey, it uses read_poll_timeout!

Tested on SJA1105T, SJA1105S, SJA1110A.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-10-25 12:59:41 +01:00
..
b53 Revert "Merge branch 'dsa-rtnl'" 2021-10-25 12:59:25 +01:00
hirschmann net: convert users of bitmap_foo() to linkmode_foo() 2021-10-24 13:58:52 +01:00
microchip net: convert users of bitmap_foo() to linkmode_foo() 2021-10-24 13:58:52 +01:00
mv88e6xxx net: convert users of bitmap_foo() to linkmode_foo() 2021-10-24 13:58:52 +01:00
ocelot net: convert users of bitmap_foo() to linkmode_foo() 2021-10-24 13:58:52 +01:00
qca net: convert users of bitmap_foo() to linkmode_foo() 2021-10-24 13:58:52 +01:00
sja1105 net: dsa: sja1105: wait for dynamic config command completion on writes too 2021-10-25 12:59:41 +01:00
xrs700x net: convert users of bitmap_foo() to linkmode_foo() 2021-10-24 13:58:52 +01:00
bcm_sf2.c net: convert users of bitmap_foo() to linkmode_foo() 2021-10-24 13:58:52 +01:00
bcm_sf2.h net: dsa: bcm_sf2: setup BCM4908 internal crossbar 2021-03-12 17:06:37 -08:00
bcm_sf2_cfp.c net: dsa: propagate extack to .port_vlan_add 2021-02-14 17:38:11 -08:00
bcm_sf2_regs.h net: dsa: bcm_sf2: fix BCM4908 RGMII reg(s) 2021-03-18 14:44:05 -07:00
dsa_loop.c net: dsa: be compatible with masters which unregister on shutdown 2021-09-19 12:08:37 +01:00
dsa_loop.h
dsa_loop_bdinfo.c
Kconfig net: dsa: realtek-smi: add rtl8365mb subdriver for RTL8365MB-VC 2021-10-18 14:02:56 +01:00
lan9303-core.c net: dsa: be compatible with masters which unregister on shutdown 2021-09-19 12:08:37 +01:00
lan9303.h net: dsa: be compatible with masters which unregister on shutdown 2021-09-19 12:08:37 +01:00
lan9303_i2c.c net: dsa: be compatible with masters which unregister on shutdown 2021-09-19 12:08:37 +01:00
lan9303_mdio.c net: dsa: be compatible with masters which unregister on shutdown 2021-09-19 12:08:37 +01:00
lantiq_gswip.c Revert "Merge branch 'dsa-rtnl'" 2021-10-25 12:59:25 +01:00
lantiq_pce.h net: dsa: Use the correct style for SPDX License Identifier 2019-09-22 15:25:08 -07:00
Makefile net: dsa: realtek-smi: add rtl8365mb subdriver for RTL8365MB-VC 2021-10-18 14:02:56 +01:00
mt7530.c net: dsa: mt7530: correct ds->num_ports 2021-10-18 13:22:21 +01:00
mt7530.h net: dsa: mt7530: manually set up VLAN ID 0 2021-08-25 11:09:31 +01:00
mv88e6060.c net: dsa: be compatible with masters which unregister on shutdown 2021-09-19 12:08:37 +01:00
mv88e6060.h
qca8k.c net: dsa: qca8k: tidy for loop in setup and add cpu port check 2021-10-20 14:16:37 +01:00
qca8k.h net: dsa: qca8k: move port config to dedicated struct 2021-10-15 11:06:38 +01:00
realtek-smi-core.c net: dsa: realtek-smi: add rtl8365mb subdriver for RTL8365MB-VC 2021-10-18 14:02:56 +01:00
realtek-smi-core.h net: dsa: realtek-smi: add rtl8365mb subdriver for RTL8365MB-VC 2021-10-18 14:02:56 +01:00
rtl8365mb.c net: dsa: realtek-smi: add rtl8365mb subdriver for RTL8365MB-VC 2021-10-18 14:02:56 +01:00
rtl8366.c net: dsa: rtl8366: Drop and depromote pointless prints 2021-09-27 16:33:46 +01:00
rtl8366rb.c net: dsa: rtl8366rb: remove unneeded semicolon 2021-10-08 15:08:49 +01:00
vitesse-vsc73xx-core.c net: dsa: be compatible with masters which unregister on shutdown 2021-09-19 12:08:37 +01:00
vitesse-vsc73xx-platform.c net: dsa: be compatible with masters which unregister on shutdown 2021-09-19 12:08:37 +01:00
vitesse-vsc73xx-spi.c net: dsa: be compatible with masters which unregister on shutdown 2021-09-19 12:08:37 +01:00
vitesse-vsc73xx.h net: dsa: be compatible with masters which unregister on shutdown 2021-09-19 12:08:37 +01:00