* [PATCH net] net: dsa: sja1105: Really make the PTP command read-write
@ 2019-12-27 1:01 Vladimir Oltean
2019-12-31 4:12 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Oltean @ 2019-12-27 1:01 UTC (permalink / raw)
To: davem, jakub.kicinski
Cc: richardcochran, f.fainelli, vivien.didelot, andrew, netdev,
Vladimir Oltean
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: 41603d78b362 ("net: dsa: sja1105: Make the PTP command read-write")
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
---
drivers/net/dsa/sja1105/sja1105_ptp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/sja1105/sja1105_ptp.c b/drivers/net/dsa/sja1105/sja1105_ptp.c
index 56f18ff60a41..c373513127d3 100644
--- a/drivers/net/dsa/sja1105/sja1105_ptp.c
+++ b/drivers/net/dsa/sja1105/sja1105_ptp.c
@@ -237,7 +237,7 @@ int sja1105_ptp_commit(struct dsa_switch *ds, struct sja1105_ptp_cmd *cmd,
if (rw == SPI_WRITE)
priv->info->ptp_cmd_packing(buf, cmd, PACK);
- rc = sja1105_xfer_buf(priv, SPI_WRITE, regs->ptp_control, buf,
+ rc = sja1105_xfer_buf(priv, rw, regs->ptp_control, buf,
SJA1105_SIZE_PTP_CMD);
if (rw == SPI_READ)
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] net: dsa: sja1105: Really make the PTP command read-write
2019-12-27 1:01 [PATCH net] net: dsa: sja1105: Really make the PTP command read-write Vladimir Oltean
@ 2019-12-31 4:12 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-12-31 4:12 UTC (permalink / raw)
To: olteanv
Cc: jakub.kicinski, richardcochran, f.fainelli, vivien.didelot,
andrew, netdev
From: Vladimir Oltean <olteanv@gmail.com>
Date: Fri, 27 Dec 2019 03:01:50 +0200
> 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: 41603d78b362 ("net: dsa: sja1105: Make the PTP command read-write")
> Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-12-31 4:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-27 1:01 [PATCH net] net: dsa: sja1105: Really make the PTP command read-write Vladimir Oltean
2019-12-31 4:12 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).