From: Buday Csaba <Buday.Csaba@prolan.hu>
To: "Wei Fang" <wei.fang@nxp.com>,
"Shenwei Wang" <shenwei.wang@nxp.com>,
"Clark Wang" <xiaoning.wang@nxp.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>,
"Csókás Bence" <Csokas.Bence@prolan.hu>,
"Frank Li" <frank.li@nxp.com>,
"Francesco Dolcini" <francesco.dolcini@toradex.com>,
"imx@lists.linux.dev" <imx@lists.linux.dev>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH net 1/1] net: fec: fix the PTP periodic output sysfs interface
Date: Thu, 19 Mar 2026 08:04:36 +0000 [thread overview]
Message-ID: <2894050ee58d428cba909b705b7684a2@prolan.hu> (raw)
In-Reply-To: <PAXPR04MB8510E8145481F667DD769F23884FA@PAXPR04MB8510.eurprd04.prod.outlook.com>
>> Fixes: bf8ca67e2167 ("net: fec: refactor PPS channel configuration")
>>
>> Signed-off-by: Buday Csaba <buday.csaba@prolan.hu>
>> ---
>> drivers/net/ethernet/freescale/fec_ptp.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/freescale/fec_ptp.c
>> b/drivers/net/ethernet/freescale/fec_ptp.c
>> index 7f6b574320716..c1af81002b8fa 100644
>> --- a/drivers/net/ethernet/freescale/fec_ptp.c
>> +++ b/drivers/net/ethernet/freescale/fec_ptp.c
>> @@ -534,7 +534,7 @@ static int fec_ptp_enable(struct ptp_clock_info *ptp,
>> if (rq->perout.flags)
>> return -EOPNOTSUPP;
>>
>> - if (rq->perout.index != fep->pps_channel)
>> + if (rq->perout.index != 0)
>> return -EOPNOTSUPP;
>>
>> period.tv_sec = rq->perout.period.sec;
>> --
>> 2.39.5
>>
>
> I think the correct fix should update the n_per_out value like below.
>
> @@ -756,7 +756,7 @@ void fec_ptp_init(struct platform_device *pdev, int irq_idx)
> fep->ptp_caps.max_adj = 250000000;
> fep->ptp_caps.n_alarm = 0;
> fep->ptp_caps.n_ext_ts = 0;
> - fep->ptp_caps.n_per_out = 1;
> + fep->ptp_caps.n_per_out = 4;
>
> The commit 566c2d83887f ("net: fec: make PPS channel configurable") added
> the property "fsl,pps-channel" to indicate which pulse channel is available.
> So we should not fix the pulse output channel to 0.
>
But is it wise to expose four channels, when only one is usable by this
driver?
This patch does not affect the channel selection. That can be still made
through the DT. The driver uses `fep->pps_channel` everywhere else, while
rq->perout.index is only checked in this single line, and never used
anywhere else.
So the question is whether userspace is supposed to reference the hardware
channel number directly, or the mapping is meant to be left to the devicetree
and the driver internally.
I hope the netdev maintainers and/or Richard Cochran can clarify the
intended purpose of `n_per_out` and the expected channel indexing.
next prev parent reply other threads:[~2026-03-19 8:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-18 15:56 [PATCH net 1/1] net: fec: fix the PTP periodic output sysfs interface Buday Csaba
2026-03-18 22:52 ` Frank Li
2026-03-18 23:32 ` Jakub Kicinski
2026-03-19 3:35 ` Wei Fang
2026-03-19 8:04 ` Buday Csaba [this message]
2026-03-19 8:40 ` Wei Fang
2026-03-19 8:09 ` Francesco Dolcini
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=2894050ee58d428cba909b705b7684a2@prolan.hu \
--to=buday.csaba@prolan.hu \
--cc=Csokas.Bence@prolan.hu \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=francesco.dolcini@toradex.com \
--cc=frank.li@nxp.com \
--cc=imx@lists.linux.dev \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=shenwei.wang@nxp.com \
--cc=wei.fang@nxp.com \
--cc=xiaoning.wang@nxp.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