]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: sja1105: Really make the PTP command read-write
authorVladimir Oltean <olteanv@gmail.com>
Fri, 27 Dec 2019 01:01:50 +0000 (03:01 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 31 Dec 2019 04:11:28 +0000 (20:11 -0800)
commit0665f8a46c8956e01ff1a70691605a81c95715eb
tree44bed5c9b62fbd4cee70f8414a0e323a816286a6
parent2a7674137e238533b5f79ee1674e9023adca5216
net: dsa: sja1105: Really make the PTP command read-write

When activating tc-taprio offload on the switch ports, the TAS state
machine will try to check whether it is running or not, but will find
both the STARTED and STOPPED bits as false in the
sja1105_tas_check_running function. So the function will return -EINVAL
(an abnormal situation) and the kernel will keep printing this from the
TAS FSM workqueue:

[   37.691971] sja1105 spi0.1: An operation returned -22

The reason is that the underlying function that gets called,
sja1105_ptp_commit, does not actually do a SPI_READ, but a SPI_WRITE. So
the command buffer remains initialized with zeroes instead of retrieving
the hardware state. Fix that.

Fixes: e536c9d2d4e8 ("net: dsa: sja1105: Make the PTP command read-write")
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/sja1105/sja1105_ptp.c