Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] PCI: mvebu: Reset Root Ports with PERST#
@ 2026-12-06  9:40 Rosen Penev
  2026-12-06  9:40 ` [PATCH v2 1/3] PCI: Save Root Port state before resetting it with reset_root_port() Rosen Penev
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rosen Penev @ 2026-12-06  9:40 UTC (permalink / raw)
  To: Thomas Petazzoni, Pali Rohár, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Manivannan Sadhasivam, Bjorn Helgaas,
	Frank Li
  Cc: Rob Herring, Manivannan Sadhasivam, linux-pci, linux-arm-kernel

Some devices don't reset fully on the in-band hot reset that a bus reset
of a Root Port triggers: the Marvell 88W8864 and 88W8964 Wi-Fi chips
only return to their boot ROM on PERST# or power-on, so once their
firmware has run the driver can't be bound to them again until the board
is rebooted. Patch 3 implements reset_root_port() in pci-mvebu to pulse
PERST# on ports that have a reset GPIO, and keeps the hot reset on the
others.

Patch 1 fixes the core side: pcibios_reset_secondary_bus() restores the
Root Port's config space after reset_root_port() without saving it
first, so it restores the state saved at enumeration, with memory
decoding and bus mastering off. Patch 2 exports
pci_reset_secondary_bus() for pci-mvebu's fallback, as the driver can be
a module.

Patches 1 and 3 were sent separately as v1. They are a series now
because patch 3 depends on patch 1.

Tested on a Linksys WRT3200ACM (two 88W8964 radios): unbinding and
binding mwlwifi again reloads the firmware of either radio. That test
was on v1; the changes since are compile-tested only (arm,
mvebu_v7_defconfig with PCI_MVEBU=m, W=1).

Changes in v2:
- Patch 1: don't save the Root Port's state again after a failed
  reset_root_port(), so a retry restores the state from before the
  failure instead of reset defaults, and doesn't read the config space
  of a controller left with its clocks off (review).
- New patch 2: export pci_reset_secondary_bus(), which pci-mvebu calls
  and which broke the PCI_MVEBU=m build (review).
- Patch 3: explain the state save/restore in the commit message.
- v1 of patch 1: https://lore.kernel.org/linux-pci/20261204060150.1239223-1-rosenp@gmail.com/
- v1 of patch 3: https://lore.kernel.org/linux-pci/20261204060752.1243189-1-rosenp@gmail.com/

Rosen Penev (3):
  PCI: Save Root Port state before resetting it with reset_root_port()
  PCI: Export pci_reset_secondary_bus()
  PCI: mvebu: Reset Root Ports with PERST#

 drivers/pci/controller/pci-mvebu.c | 56 ++++++++++++++++++++++++++----
 drivers/pci/pci.c                  | 17 +++++++--
 drivers/pci/pci.h                  |  1 +
 3 files changed, 66 insertions(+), 8 deletions(-)


base-commit: 29beb21c21ada7207692b2d69fc58dcd15dab6e9
-- 
2.56.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-12-06  9:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-06  9:40 [PATCH v2 0/3] PCI: mvebu: Reset Root Ports with PERST# Rosen Penev
2026-12-06  9:40 ` [PATCH v2 1/3] PCI: Save Root Port state before resetting it with reset_root_port() Rosen Penev
2026-12-06  9:40 ` [PATCH v2 2/3] PCI: Export pci_reset_secondary_bus() Rosen Penev
2026-12-06  9:40 ` [PATCH v2 3/3] PCI: mvebu: Reset Root Ports with PERST# Rosen Penev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox