From: Andrew Lunn <andrew@lunn.ch>
To: Martin Whitaker <foss@martin-whitaker.me.uk>
Cc: netdev@vger.kernel.org, woojung.huh@microchip.com,
UNGLinuxDriver@microchip.com, ceggers@arri.de,
arun.ramadoss@microchip.com
Subject: Re: net: dsa: microchip: issues when using PTP between KSZ9567 devices
Date: Tue, 13 Aug 2024 21:55:02 +0200 [thread overview]
Message-ID: <d42582f2-28c0-4a77-b4bc-1e5b31d9eedb@lunn.ch> (raw)
In-Reply-To: <7aae307a-35ca-4209-a850-7b2749d40f90@martin-whitaker.me.uk>
> 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
next prev parent reply other threads:[~2024-08-13 20:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-13 10:04 net: dsa: microchip: issues when using PTP between KSZ9567 devices Martin Whitaker
2024-08-13 19:55 ` Andrew Lunn [this message]
2024-08-20 15:19 ` Christian Eggers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d42582f2-28c0-4a77-b4bc-1e5b31d9eedb@lunn.ch \
--to=andrew@lunn.ch \
--cc=UNGLinuxDriver@microchip.com \
--cc=arun.ramadoss@microchip.com \
--cc=ceggers@arri.de \
--cc=foss@martin-whitaker.me.uk \
--cc=netdev@vger.kernel.org \
--cc=woojung.huh@microchip.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox