From: Simon Horman <horms@kernel.org>
To: anthony.l.nguyen@intel.com
Cc: Simon Horman <horms@kernel.org>,
davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
edumazet@google.com, andrew+netdev@lunn.ch,
netdev@vger.kernel.org, larysa.zaremba@intel.com,
przemyslaw.kitszel@intel.com, aleksander.lobakin@intel.com,
sridhar.samudrala@intel.com, michal.swiatkowski@linux.intel.com,
maciej.fijalkowski@intel.com, emil.s.tantilov@intel.com,
madhu.chittim@intel.com, joshua.a.hay@intel.com,
jacob.e.keller@intel.com, jayaprakash.shanmugam@intel.com,
jiri@resnulli.us, corbet@lwn.net, richardcochran@gmail.com,
skhan@linuxfoundation.org, linux-doc@vger.kernel.org,
Bharath.r@intel.com
Subject: Re: [PATCH net-next v5 13/15] ixd: add reset checks and initialize the mailbox
Date: Wed, 22 Jul 2026 17:17:47 +0100 [thread overview]
Message-ID: <20260722161747.544002-1-horms@kernel.org> (raw)
In-Reply-To: <20260715180042.1972010-14-anthony.l.nguyen@intel.com>
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
https://sashiko.dev/#/patchset/20260715180042.1972010-2-anthony.l.nguyen@intel.com?part=13
---
--- Patch [13]: [PATCH net-next v5 13/15] ixd: add reset checks and initialize the mailbox ---
commit 9019dd0f9c2d33f542f42c411b53c595e9c03614
Author: Larysa Zaremba <larysa.zaremba@intel.com>
Subject: ixd: add reset checks and initialize the mailbox
This commit introduces the reset and mailbox initialization sequence for the
Intel CPF device driver. It adds functions to trigger and verify hardware
resets, initializes default control queues, and sets up a delayed work task to
handle the post-reset initialization flow. It also adds cleanup logic to the
device removal path.
> diff --git a/drivers/net/ethernet/intel/ixd/ixd_dev.c b/drivers/net/ethernet/intel/ixd/ixd_dev.c
> new file mode 100644
> index 0000000000000..cdd5477cc1f4d
> --- /dev/null
> +++ b/drivers/net/ethernet/intel/ixd/ixd_dev.c
[ ... ]
> +void ixd_trigger_reset(struct ixd_adapter *adapter)
> +{
> + void __iomem *addr;
> + u32 reg_val;
> +
> + addr = libie_pci_get_mmio_addr(&adapter->cp_ctx.mmio_info,
> + ixd_reset_reg.rtrigger);
> + reg_val = readl(addr);
> + writel(reg_val | ixd_reset_reg.rtrigger_m, addr);
[Severity: Medium]
If the device has been hot-removed or is experiencing a PCIe link error,
could readl() return 0xFFFFFFFF?
If reg_val is not checked for 0xFFFFFFFF, this will write all 1s back to
the PFGEN_CTRL register. Could this trigger unintended hardware actions or
test modes if the link recovers or the write completes?
> +}
[ ... ]
> diff --git a/drivers/net/ethernet/intel/ixd/ixd_main.c b/drivers/net/ethernet/intel/ixd/ixd_main.c
> index 75ee53152e614..35d0ff5c8d983 100644
> --- a/drivers/net/ethernet/intel/ixd/ixd_main.c
> +++ b/drivers/net/ethernet/intel/ixd/ixd_main.c
[ ... ]
> @@ -16,7 +17,15 @@ static void ixd_remove(struct pci_dev *pdev)
> {
> struct ixd_adapter *adapter = pci_get_drvdata(pdev);
>
> - libie_pci_unmap_all_mmio_regions(&adapter->hw);
> + /* Do not mix removal with (re)initialization */
> + cancel_delayed_work_sync(&adapter->init_task.init_work);
> + /* Leave the device clean on exit */
> + if (adapter->xnm)
> + libie_ctlq_xn_shutdown(adapter->xnm);
> + ixd_trigger_reset(adapter);
> + ixd_deinit_dflt_mbx(adapter);
[Severity: High]
Since ixd_trigger_reset() uses a posted write (writel) without a following
readl() to flush it, could the reset fail to reach the hardware before the
PCI subsystem disables Memory Space Enable?
Additionally, ixd_deinit_dflt_mbx() is called immediately after triggering
the reset. Does this free the control queue DMA memory before the hardware
is guaranteed to have halted? If the reset hasn't taken effect yet, could
the device continue to master DMA to the freed memory and cause IOMMU DMAR
faults or memory corruption?
> +
> + libie_pci_unmap_all_mmio_regions(&adapter->cp_ctx.mmio_info);
> }
next prev parent reply other threads:[~2026-07-22 16:17 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-15 18:00 [PATCH net-next v5 00/15][pull request] Introduce iXD driver Tony Nguyen
2026-07-15 18:00 ` [PATCH net-next v5 01/15] virtchnl: move virtchnl and virtchnl2 headers to 'include/linux/net/intel' Tony Nguyen
2026-07-15 18:00 ` [PATCH net-next v5 02/15] libie: add PCI device initialization helpers to libie Tony Nguyen
2026-07-15 18:00 ` [PATCH net-next v5 03/15] libeth: allow to create fill queues without NAPI Tony Nguyen
2026-07-15 18:00 ` [PATCH net-next v5 04/15] libie: add control queue support Tony Nguyen
2026-07-20 16:17 ` Larysa Zaremba
2026-07-22 15:54 ` Simon Horman
2026-07-15 18:00 ` [PATCH net-next v5 05/15] libie: add bookkeeping support for control queue messages Tony Nguyen
2026-07-20 16:07 ` Larysa Zaremba
2026-07-22 15:55 ` Simon Horman
2026-07-15 18:00 ` [PATCH net-next v5 06/15] idpf: remove 'vport_params_reqd' field Tony Nguyen
2026-07-15 18:00 ` [PATCH net-next v5 07/15] idpf: remove unused code for getting RSS info from device Tony Nguyen
2026-07-15 18:00 ` [PATCH net-next v5 08/15] idpf: refactor idpf to use libie_pci APIs Tony Nguyen
2026-07-20 16:09 ` Larysa Zaremba
2026-07-22 16:13 ` Simon Horman
2026-07-15 18:00 ` [PATCH net-next v5 09/15] idpf: refactor idpf to use libie control queues Tony Nguyen
2026-07-20 16:11 ` Larysa Zaremba
2026-07-22 16:16 ` Simon Horman
2026-07-15 18:00 ` [PATCH net-next v5 10/15] idpf: make mbx_task queueing and cancelling more consistent Tony Nguyen
2026-07-15 18:00 ` [PATCH net-next v5 11/15] idpf: print a debug message and bail in case of non-event ctlq message Tony Nguyen
2026-07-15 18:00 ` [PATCH net-next v5 12/15] ixd: add basic driver framework for Intel(R) Control Plane Function Tony Nguyen
2026-07-15 18:00 ` [PATCH net-next v5 13/15] ixd: add reset checks and initialize the mailbox Tony Nguyen
2026-07-22 16:17 ` Simon Horman [this message]
2026-07-15 18:00 ` [PATCH net-next v5 14/15] ixd: add the core initialization Tony Nguyen
2026-07-20 16:14 ` Larysa Zaremba
2026-07-22 16:18 ` Simon Horman
2026-07-15 18:00 ` [PATCH net-next v5 15/15] ixd: add devlink support Tony Nguyen
2026-07-20 16:24 ` [PATCH net-next v5 00/15][pull request] Introduce iXD driver Larysa Zaremba
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=20260722161747.544002-1-horms@kernel.org \
--to=horms@kernel.org \
--cc=Bharath.r@intel.com \
--cc=aleksander.lobakin@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=emil.s.tantilov@intel.com \
--cc=jacob.e.keller@intel.com \
--cc=jayaprakash.shanmugam@intel.com \
--cc=jiri@resnulli.us \
--cc=joshua.a.hay@intel.com \
--cc=kuba@kernel.org \
--cc=larysa.zaremba@intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=madhu.chittim@intel.com \
--cc=michal.swiatkowski@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=richardcochran@gmail.com \
--cc=skhan@linuxfoundation.org \
--cc=sridhar.samudrala@intel.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