linux/drivers/net
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
..
appletalk net: remove single-byte netdev->dev_addr writes 2021-10-13 10:03:59 -07:00
arcnet net: remove single-byte netdev->dev_addr writes 2021-10-13 10:03:59 -07:00
bonding net: bonding: constify and use dev_addr_set() 2021-10-24 13:59:44 +01:00
caif
can can: xilinx_can: xcan_remove(): remove redundant netif_napi_del() 2021-10-24 16:26:05 +02:00
dsa net: dsa: sja1105: wait for dynamic config command completion on writes too 2021-10-25 12:59:41 +01:00
ethernet Revert "Merge branch 'dsa-rtnl'" 2021-10-25 12:59:25 +01:00
fddi fddi: skfp: constify and use dev_addr_set() 2021-10-22 10:16:05 -07:00
fjes net: fjes: constify and use eth_hw_addr_set() 2021-10-22 10:16:07 -07:00
hamradio Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-10-22 11:41:16 +01:00
hippi net: hippi: use dev_addr_set() 2021-10-22 10:16:09 -07:00
hyperv hv_netvsc: Add comment of netvsc_xdp_xmit() 2021-10-14 19:17:57 -07:00
ieee802154 ieee802154: Remove redundant 'flush_workqueue()' calls 2021-10-19 13:23:38 +01:00
ipa asm-generic: build fixes for v5.15 2021-10-08 11:57:54 -07:00
ipvlan net: ipvtap: fix template string argument of device_create() call 2021-10-16 08:51:22 +01:00
mctp
mdio net: mdio-ipq4019: Fix the error for an optional regs resource 2021-09-28 17:28:54 -07:00
netdevsim devlink: Delete reload enable/disable interface 2021-10-12 16:29:17 -07:00
pcs net: convert users of bitmap_foo() to linkmode_foo() 2021-10-24 13:58:52 +01:00
phy net: phy: constify netdev->dev_addr references 2021-10-24 13:59:44 +01:00
plip net: plip: use eth_hw_addr_set() 2021-10-22 10:16:14 -07:00
ppp ppp: use the correct function to check if a netdev name is in use 2021-10-08 17:02:35 +01:00
slip
team net: use dev_addr_set() 2021-10-09 11:55:01 +01:00
usb net: usb: don't write directly to netdev->dev_addr 2021-10-22 10:16:01 -07:00
vmxnet3 net: drivers: get ready for const netdev->dev_addr 2021-10-24 13:59:45 +01:00
wan net: hldc_fr: use dev_addr_set() 2021-10-22 10:16:18 -07:00
wireguard
wireless wireless-drivers-next patches for v5.16 2021-10-22 10:22:07 -07:00
wwan net: wwan: iosm: correct devlink extra params 2021-10-02 16:05:20 +01:00
xen-netback net: xen: use eth_hw_addr_set() 2021-10-22 10:15:54 -07:00
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c gtp: use skb_dst_update_pmtu_no_confirm() instead of direct call 2021-10-06 15:19:37 +01:00
ifb.c netfilter: Introduce egress hook 2021-10-14 23:06:28 +02:00
Kconfig
LICENSE.SRC
loopback.c
macsec.c net: drivers: get ready for const netdev->dev_addr 2021-10-24 13:59:45 +01:00
macvlan.c net: drivers: get ready for const netdev->dev_addr 2021-10-24 13:59:45 +01:00
macvtap.c net: macvtap: fix template string argument of device_create() call 2021-10-16 08:51:21 +01:00
Makefile
mdio.c
mhi_net.c drivers: net: mhi: fix error path in mhi_net_newlink 2021-09-24 14:25:05 +01:00
mii.c
net_failover.c net: use dev_addr_set() 2021-10-09 11:55:01 +01:00
netconsole.c
nlmon.c
ntb_netdev.c net: use dev_addr_set() 2021-10-09 11:55:01 +01:00
rionet.c net: sb1000,rionet: use eth_hw_addr_set() 2021-10-22 10:16:16 -07:00
sb1000.c net: sb1000,rionet: use eth_hw_addr_set() 2021-10-22 10:16:16 -07:00
Space.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c
veth.c
virtio_net.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-10-14 16:50:14 -07:00
vrf.c vrf: Revert "Reset skb conntrack connection..." 2021-10-20 11:27:19 +01:00
vsockmon.c
vxlan.c nexthop: Fix memory leaks in nexthop notification chain listeners 2021-09-23 12:33:22 +01:00
xen-netfront.c net: xen: use eth_hw_addr_set() 2021-10-22 10:15:54 -07:00