[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d42582f2-28c0-4a77-b4bc-1e5b31d9eedb@lunn.ch>
Date: Tue, 13 Aug 2024 21:55:02 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Martin Whitaker <foss@...tin-whitaker.me.uk>
Cc: netdev@...r.kernel.org, woojung.huh@...rochip.com,
UNGLinuxDriver@...rochip.com, ceggers@...i.de,
arun.ramadoss@...rochip.com
Subject: Re: net: dsa: microchip: issues when using PTP between KSZ9567
devices
> Issue 3
> -------
> When performing the port_hwtstamp_set operation, ptp_schedule_worker()
> will be called if hardware timestamoing is enabled on any of the ports.
> When using multiple ports for PTP, port_hwtstamp_set is executed for
> each port. When called for the first time ptp_schedule_worker() returns
> 0. On subsequent calls it returns 1, indicating the worker is already
> scheduled. Currently the ksz_ptp module treats 1 as an error and fails
> to complete the port_hwtstamp_set operation, thus leaving the
> timestamping configuration for those ports unchanged.
>
> (note that the documentation of ptp_schedule_worker refers you to
> kthread_queue_delayed_work rather than documenting the return values,
> but kthread_queue_delayed_work returns a bool, not an int)
>
> I fixed this issue by
>
> diff --git a/drivers/net/dsa/microchip/ksz_ptp.c
> b/drivers/net/dsa/microchip/ksz_ptp.c
> index 4e22a695a64c..7ef5fac69657 100644
> --- a/drivers/net/dsa/microchip/ksz_ptp.c
> +++ b/drivers/net/dsa/microchip/ksz_ptp.c
> @@ -266,7 +266,6 @@ static int ksz_ptp_enable_mode(struct ksz_device *dev)
> struct ksz_port *prt;
> struct dsa_port *dp;
> bool tag_en = false;
> - int ret;
>
> dsa_switch_for_each_user_port(dp, dev->ds) {
> prt = &dev->ports[dp->index];
> @@ -277,9 +276,7 @@ static int ksz_ptp_enable_mode(struct ksz_device *dev)
> }
>
> if (tag_en) {
> - ret = ptp_schedule_worker(ptp_data->clock, 0);
> - if (ret)
> - return ret;
> + ptp_schedule_worker(ptp_data->clock, 0);
This looks correct. Please could you submit a formal patch?
https://docs.kernel.org/process/submitting-patches.html
https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html#netdev-faq
Andrew
Powered by blists - more mailing lists