* [PATCH] net: dsa: mv88e6xxx: add an error code check in mv88e6352_tai_event_work
@ 2023-10-20 9:00 Su Hui
2023-10-20 10:07 ` Vladimir Oltean
2023-10-21 11:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Su Hui @ 2023-10-20 9:00 UTC (permalink / raw)
To: andrew, f.fainelli, olteanv, davem, edumazet, kuba, pabeni,
richardcochran
Cc: Su Hui, netdev, linux-kernel, kernel-janitors
mv88e6xxx_tai_write() can return error code (-EOPNOTSUPP ...) if failed.
So check the value of 'ret' after calling mv88e6xxx_tai_write().
Signed-off-by: Su Hui <suhui@nfschina.com>
---
drivers/net/dsa/mv88e6xxx/ptp.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/dsa/mv88e6xxx/ptp.c b/drivers/net/dsa/mv88e6xxx/ptp.c
index ea17231dc34e..56391e09b325 100644
--- a/drivers/net/dsa/mv88e6xxx/ptp.c
+++ b/drivers/net/dsa/mv88e6xxx/ptp.c
@@ -182,6 +182,10 @@ static void mv88e6352_tai_event_work(struct work_struct *ugly)
mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_tai_write(chip, MV88E6XXX_TAI_EVENT_STATUS, status[0]);
mv88e6xxx_reg_unlock(chip);
+ if (err) {
+ dev_err(chip->dev, "failed to write TAI status register\n");
+ return;
+ }
/* This is an external timestamp */
ev.type = PTP_CLOCK_EXTTS;
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] net: dsa: mv88e6xxx: add an error code check in mv88e6352_tai_event_work
2023-10-20 9:00 [PATCH] net: dsa: mv88e6xxx: add an error code check in mv88e6352_tai_event_work Su Hui
@ 2023-10-20 10:07 ` Vladimir Oltean
2023-10-21 11:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Vladimir Oltean @ 2023-10-20 10:07 UTC (permalink / raw)
To: Su Hui
Cc: andrew, f.fainelli, davem, edumazet, kuba, pabeni, richardcochran,
netdev, linux-kernel, kernel-janitors
On Fri, Oct 20, 2023 at 05:00:04PM +0800, Su Hui wrote:
> mv88e6xxx_tai_write() can return error code (-EOPNOTSUPP ...) if failed.
> So check the value of 'ret' after calling mv88e6xxx_tai_write().
>
> Signed-off-by: Su Hui <suhui@nfschina.com>
> ---
mv88e6xxx_avb_ops :: tai_read() and tai_write() come in pairs for the
existing implementations. So, a missing tai_write() method also implies
a missing tai_read() and would have been caught by the previous call to
mv88e6xxx_tai_read() in this function.
But, ok.
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
This is a patch for net-next, as it doesn't fix any user-visible issue
and is just an improvement. For future changes, please note your
expectation regarding the target tree yourself, by formatting the patch
as "[PATCH net-next]".
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: dsa: mv88e6xxx: add an error code check in mv88e6352_tai_event_work
2023-10-20 9:00 [PATCH] net: dsa: mv88e6xxx: add an error code check in mv88e6352_tai_event_work Su Hui
2023-10-20 10:07 ` Vladimir Oltean
@ 2023-10-21 11:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-10-21 11:00 UTC (permalink / raw)
To: Su Hui
Cc: andrew, f.fainelli, olteanv, davem, edumazet, kuba, pabeni,
richardcochran, netdev, linux-kernel, kernel-janitors
Hello:
This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:
On Fri, 20 Oct 2023 17:00:04 +0800 you wrote:
> mv88e6xxx_tai_write() can return error code (-EOPNOTSUPP ...) if failed.
> So check the value of 'ret' after calling mv88e6xxx_tai_write().
>
> Signed-off-by: Su Hui <suhui@nfschina.com>
> ---
> drivers/net/dsa/mv88e6xxx/ptp.c | 4 ++++
> 1 file changed, 4 insertions(+)
Here is the summary with links:
- net: dsa: mv88e6xxx: add an error code check in mv88e6352_tai_event_work
https://git.kernel.org/netdev/net-next/c/a792197f5070
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-10-21 11:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-20 9:00 [PATCH] net: dsa: mv88e6xxx: add an error code check in mv88e6352_tai_event_work Su Hui
2023-10-20 10:07 ` Vladimir Oltean
2023-10-21 11:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox