diff options
| author | Daniel Machon <daniel.machon@microchip.com> | 2026-09-28 21:32:58 +0200 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-10-02 13:08:55 -0700 |
| commit | ab6268b958f04b9e6fda69ceb5c95dbc9b8141da (patch) | |
| tree | 247d7c2b0ab0800fbaec55fd057c0a0941d8b607 /tools/lib/python/kdoc/python_version.py | |
| parent | 58e73ef6a1e50b1516560ea981a18606633add26 (diff) | |
net: lan966x: add shutdown callback to stop the FDMA on reboot
As a PCIe endpoint, lan966x is not reset by a host reboot: its FDMA
channels and interrupt sources stay armed, and the OIC ORs every
source into the shared PCIe INTx, asserted before the driver has
re-probed. A still-active channel also keeps write access to host
memory the next kernel will reuse.
Add a shutdown callback that:
- frees the ana, xtr and FDMA irqs, masking and unmapping them at
the OIC (disable_irq() would leave both set - the OIC has no
irq_disable())
- masks the analyzer source, armed unconditionally by lan966x_init()
and re-armed by the MAC table's age timer
- stops and detaches the netdevs, draining in-flight xmit and
clearing netif_device_present() so ndo_open/ndo_change_mtu cannot
re-enter the FDMA against a disabled NAPI
- disables both FDMA channels and masks their interrupts
- unmaps the outbound ATU windows, leaving none armed (the windows
are mapped by the PCIe FDMA backend added later in this series)
NAPI is skipped when fdma_ndev is unset (a probed switch with no
usable port never adds one), and XDP attach cannot re-enter the FDMA
either: on PCIe, lan966x_xdp_setup() returns before the page pool
reload, which is the only point where it touches the FDMA.
Only the PCIe instantiation needs this - the SoC one resets with the
chip - so the callback returns early on a platform device; the check
is at runtime since .shutdown belongs to the driver, and a
PCIe-enabled kernel binds both.
FDMA_INTR_ENA persists across a warm reboot, so also restore the
full enable in lan966x_fdma_rx_start(), run after both rings are
allocated. The PCIe FDMA backend added later in this series starts
RX through the same function, so both backends are re-armed from
one site.
Tested-by: Herve Codina <herve.codina@bootlin.com>
Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260928-lan966x-pci-fdma-v9-10-a17caf60f89a@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/lib/python/kdoc/python_version.py')
0 files changed, 0 insertions, 0 deletions
