From: Wei Fang <wei.fang@nxp.com>
To: "Vladimir Oltean" <vladimir.oltean@nxp.com>,
"Köry Maincent" <kory.maincent@bootlin.com>
Cc: Claudiu Manoil <claudiu.manoil@nxp.com>,
Clark Wang <xiaoning.wang@nxp.com>, "Y.B. Lu" <yangbo.lu@nxp.com>,
"richardcochran@gmail.com" <richardcochran@gmail.com>,
"andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
"davem@davemloft.net" <davem@davemloft.net>,
"edumazet@google.com" <edumazet@google.com>,
"kuba@kernel.org" <kuba@kernel.org>,
"pabeni@redhat.com" <pabeni@redhat.com>,
Frank Li <frank.li@nxp.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-next] net: enetc: use generic interfaces to get phc_index for ENETC v1
Date: Fri, 19 Sep 2025 02:02:23 +0000 [thread overview]
Message-ID: <PAXPR04MB851055F069DF8C17C9B367628811A@PAXPR04MB8510.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20250918124823.t3xlzn7w2glzkhnx@skbuf>
> On Thu, Sep 18, 2025 at 03:44:54PM +0800, Wei Fang wrote:
> > @@ -954,17 +957,9 @@ static int enetc_get_ts_info(struct net_device
> *ndev,
> > if (!enetc_ptp_clock_is_enabled(si))
> > goto timestamp_tx_sw;
> >
> > - if (is_enetc_rev1(si)) {
> > - phc_idx = symbol_get(enetc_phc_index);
> > - if (phc_idx) {
> > - info->phc_index = *phc_idx;
>
> phc_idx remains unused in enetc_get_ts_info() after this change, and it
> produces a build warning.
Oh, I missed the build warning, sorry.
>
> > - symbol_put(enetc_phc_index);
> > - }
> > - } else {
> > - info->phc_index = enetc4_get_phc_index(si);
> > - if (info->phc_index < 0)
> > - goto timestamp_tx_sw;
> > - }
> > + info->phc_index = enetc_get_phc_index(si);
> > + if (info->phc_index < 0)
> > + goto timestamp_tx_sw;
> >
> > enetc_get_ts_generic_info(ndev, info);
> >
>
> It looks like we have a problem and can't call pci_get_slot(), which
> sleeps on down_read(&pci_bus_sem), from ethtool_ops :: get_ts_info(),
> which can't sleep, as of commit 4c61d809cf60 ("net: ethtool: Fix
> suspicious rcu_dereference usage").
>
Thanks for catching this issue. CONFIG_DEBUG_ATOMIC_SLEEP was not
enabled in my config file, so I did not see this issue on both i.MX95 and
LS1028A. :(
The introduction of rcu_read_lock() in __ethtool_get_ts_info() makes
the device drivers cannot use any functions which might sleep, I do not
have an idea to fix this issue in the upper layer. Currently, I can use
pci_get_domain_bus_and_slot() to instead of pci_get_slot() to fix this
issue in the enetc driver.
> pw-bot: cr
next prev parent reply other threads:[~2025-09-19 2:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-18 7:44 Wei Fang
2025-09-18 12:48 ` Vladimir Oltean
2025-09-19 2:02 ` Wei Fang [this message]
2025-09-19 8:32 ` Kory Maincent
2025-09-19 8:48 ` Wei Fang
2025-09-22 23:33 ` Kory Maincent
2025-09-19 2:14 ` kernel test robot
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=PAXPR04MB851055F069DF8C17C9B367628811A@PAXPR04MB8510.eurprd04.prod.outlook.com \
--to=wei.fang@nxp.com \
--cc=andrew+netdev@lunn.ch \
--cc=claudiu.manoil@nxp.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=frank.li@nxp.com \
--cc=imx@lists.linux.dev \
--cc=kory.maincent@bootlin.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=vladimir.oltean@nxp.com \
--cc=xiaoning.wang@nxp.com \
--cc=yangbo.lu@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
all inboxes | Powered by JetHome®