From: sashiko-bot@kernel.org
To: wei.fang@oss.nxp.com
Cc: imx@lists.linux.dev, Frank.Li@kernel.org
Subject: Re: [PATCH v2 net-next 2/7] ptp: netc: remove unnecessary pcie_flr() call in probe
Date: Sun, 09 Aug 2026 03:19:07 +0000 [thread overview]
Message-ID: <20260809031908.46EBF1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260808032146.2335723-4-wei.fang@oss.nxp.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Disabling a PEROUT channel that is already disabled incorrectly frees alarm ID 0.
--
--- Patch [2]: [PATCH v2 net-next 2/7] ptp: netc: remove unnecessary pcie_flr() call in probe ---
commit e70feff8e69f873b89699e822c09a88a2517534c
Author: Wei Fang <wei.fang@nxp.com>
ptp: netc: remove unnecessary pcie_flr() call in probe
According to the NETC reference manual, function level reset is not
applicable to the timer as a supporting function. Remove the pcie_flr()
call from netc_timer_pci_probe() as it has no effect.
> diff --git a/drivers/ptp/ptp_netc.c b/drivers/ptp/ptp_netc.c
> index 0e0972596d880..d33c49c86ac44 100644
> --- a/drivers/ptp/ptp_netc.c
> +++ b/drivers/ptp/ptp_netc.c
> @@ -774,7 +774,6 @@ static int netc_timer_pci_probe(struct pci_dev *pdev)
> if (!priv)
> return -ENOMEM;
>
> - pcie_flr(pdev);
> err = pci_enable_device_mem(pdev);
> if (err)
> return dev_err_probe(dev, err, "Failed to enable device\n");
[Severity: High]
This is a pre-existing issue, but does disabling a PEROUT channel that is
already disabled incorrectly free alarm ID 0?
drivers/ptp/ptp_netc.c:net_timer_enable_perout() {
...
} else {
netc_timer_disable_periodic_pulse(priv, channel);
priv->fs_alarm_bitmap &= ~BIT(pp->alarm_id);
memset(pp, 0, sizeof(*pp));
}
...
}
If a userspace process calls ioctl(PTP_PEROUT_REQUEST) with a channel index but
period = 0 (which implies on = 0), and the channel is already disabled, the code
proceeds to this else block without verifying its state.
Since the channel's struct netc_pp was previously zeroed, pp->alarm_id evaluates
to 0. The driver then executes priv->fs_alarm_bitmap &= ~BIT(0), silently
revoking the allocation of alarm 0 from whichever channel is actively using it.
Could this cause two channels to conflict over the same hardware alarm
configuration and corrupt their output signals?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260808032146.2335723-1-wei.fang@oss.nxp.com?part=2
next prev parent reply other threads:[~2026-08-09 3:19 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-08 3:21 [PATCH v2 net-next 0/7] net: dsa: netc: add PTP support for NETC switch wei.fang
2026-08-08 3:21 ` [PATCH] net: dsa: netc: add PTP one-step timestamping support wei.fang
2026-08-08 3:26 ` Wei Fang
2026-08-08 3:21 ` [PATCH v2 net-next 1/7] ptp: netc: use ioread64_lo_hi/iowrite64_lo_hi for 64-bit register access wei.fang
2026-08-09 3:19 ` sashiko-bot
2026-08-08 3:21 ` [PATCH v2 net-next 2/7] ptp: netc: remove unnecessary pcie_flr() call in probe wei.fang
2026-08-09 3:19 ` sashiko-bot [this message]
2026-08-08 3:21 ` [PATCH v2 net-next 3/7] ptp: netc: export netc_timer_get_current_time() for cross-driver use wei.fang
2026-08-09 3:19 ` sashiko-bot
2026-08-10 1:30 ` Wei Fang (OSS)
2026-08-08 3:21 ` [PATCH v2 net-next 4/7] net: dsa: netc: use entry ID instead of pointer to track host flood rule wei.fang
2026-08-08 3:21 ` [PATCH v2 net-next 5/7] net: dsa: netc: enable ingress port filtering lookup by default wei.fang
2026-08-09 3:19 ` sashiko-bot
2026-08-10 2:40 ` Wei Fang (OSS)
2026-08-08 3:21 ` [PATCH v2 net-next 6/7] net: dsa: netc: add PTP two-step timestamping support wei.fang
2026-08-09 3:19 ` sashiko-bot
2026-08-10 3:33 ` Wei Fang (OSS)
2026-08-08 3:21 ` [PATCH v2 net-next 7/7] net: dsa: netc: add PTP one-step " wei.fang
2026-08-09 3:19 ` sashiko-bot
2026-08-10 7:31 ` Wei Fang (OSS)
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=20260809031908.46EBF1F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=imx@lists.linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
--cc=wei.fang@oss.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