From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: "Jacob Keller" <jacob.e.keller@intel.com>,
"Tony Nguyen" <anthony.l.nguyen@intel.com>,
"Przemek Kitszel" <przemyslaw.kitszel@intel.com>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Richard Cochran" <richardcochran@gmail.com>,
"Ruud Bos" <kernel.hbk@gmail.com>,
"Paul Barker" <paul.barker.ct@bp.renesas.com>,
"Niklas Söderlund" <niklas.soderlund@ragnatech.se>,
"Bryan Whitehead" <bryan.whitehead@microchip.com>,
UNGLinuxDriver@microchip.com,
"Raju Lakkaraju" <Raju.Lakkaraju@microchip.com>,
"Florian Fainelli" <florian.fainelli@broadcom.com>,
"Broadcom internal kernel review list"
<bcm-kernel-feedback-list@broadcom.com>,
"Andrew Lunn" <andrew@lunn.ch>,
"Heiner Kallweit" <hkallweit1@gmail.com>,
"Russell King" <linux@armlinux.org.uk>,
"Jonathan Lemon" <jonathan.lemon@gmail.com>,
"Lasse Johnsen" <l@ssejohnsen.me>
Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH net 5/5] ptp: ocp: reject unsupported periodic output flags
Date: Mon, 10 Mar 2025 23:35:11 +0000 [thread overview]
Message-ID: <7272e5c8-4205-40fd-a70a-02fa04d52fbe@linux.dev> (raw)
In-Reply-To: <20250310-jk-net-fixes-supported-extts-flags-v1-5-854ffb5f3a96@intel.com>
On 10/03/2025 22:16, Jacob Keller wrote:
> The ptp_ocp_signal_from_perout() function supports PTP_PEROUT_DUTY_CYCLE
> and PTP_PEROUT_PHASE. It does not support PTP_PEROUT_ONE_SHOT, but does not
> reject a request with such an unsupported flag.
>
> Add the appropriate check to ensure that unsupported requests are rejected
> both for PTP_PEROUT_ONE_SHOT as well as any future flags.
>
> Fixes: 1aa66a3a135a ("ptp: ocp: Program the signal generators via PTP_CLK_REQ_PEROUT")
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> ---
> drivers/ptp/ptp_ocp.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
> index b651087f426f50a73229ca57634fc5d6912e0a87..4a87af0980d695a9ab1b23e2544f620759ccb892 100644
> --- a/drivers/ptp/ptp_ocp.c
> +++ b/drivers/ptp/ptp_ocp.c
> @@ -2090,6 +2090,10 @@ ptp_ocp_signal_from_perout(struct ptp_ocp *bp, int gen,
> {
> struct ptp_ocp_signal s = { };
>
> + if (req->flags & ~(PTP_PEROUT_DUTY_CYCLE |
> + PTP_PEROUT_PHASE))
> + return -EOPNOTSUPP;
> +
> s.polarity = bp->signal[gen].polarity;
> s.period = ktime_set(req->period.sec, req->period.nsec);
> if (!s.period)
>
Thanks,
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
prev parent reply other threads:[~2025-03-10 23:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-10 22:16 [PATCH net 0/5] net: ptp: fix egregious supported flag checks Jacob Keller
2025-03-10 22:16 ` [PATCH net 1/5] igb: reject invalid external timestamp requests for 82580-based HW Jacob Keller
2025-03-11 6:03 ` Michal Swiatkowski
2025-03-12 5:03 ` Keller, Jacob E
2025-03-12 20:58 ` Keller, Jacob E
2025-03-10 22:16 ` [PATCH net 2/5] renesas: reject PTP_STRICT_FLAGS as unsupported Jacob Keller
2025-03-18 13:59 ` Simon Horman
2025-03-18 14:03 ` Simon Horman
2025-03-10 22:16 ` [PATCH net 3/5] net: lan743x: reject unsupported external timestamp requests Jacob Keller
2025-03-18 14:00 ` Simon Horman
2025-03-10 22:16 ` [PATCH net 4/5] broadcom: fix supported flag check in periodic output function Jacob Keller
2025-03-18 14:01 ` Simon Horman
2025-03-10 22:16 ` [PATCH net 5/5] ptp: ocp: reject unsupported periodic output flags Jacob Keller
2025-03-10 23:35 ` Vadim Fedorenko [this message]
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=7272e5c8-4205-40fd-a70a-02fa04d52fbe@linux.dev \
--to=vadim.fedorenko@linux.dev \
--cc=Raju.Lakkaraju@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=bryan.whitehead@microchip.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=florian.fainelli@broadcom.com \
--cc=hkallweit1@gmail.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jacob.e.keller@intel.com \
--cc=jonathan.lemon@gmail.com \
--cc=kernel.hbk@gmail.com \
--cc=kuba@kernel.org \
--cc=l@ssejohnsen.me \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=niklas.soderlund@ragnatech.se \
--cc=pabeni@redhat.com \
--cc=paul.barker.ct@bp.renesas.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=richardcochran@gmail.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;
as well as URLs for NNTP newsgroup(s).