Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rosen Penev <rosenp@gmail.com>
To: "Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Pali Rohár" <pali@kernel.org>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
	"Manivannan Sadhasivam" <mani@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Frank Li" <Frank.Li@nxp.com>
Cc: Rob Herring <robh@kernel.org>,
	Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>,
	linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 0/3] PCI: mvebu: Reset Root Ports with PERST#
Date: Sun,  6 Dec 2026 01:40:30 -0800	[thread overview]
Message-ID: <20261206094043.971494-1-rosenp@gmail.com> (raw)

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



             reply	other threads:[~2026-12-06  9:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-06  9:40 Rosen Penev [this message]
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

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=20261206094043.971494-1-rosenp@gmail.com \
    --to=rosenp@gmail.com \
    --cc=Frank.Li@nxp.com \
    --cc=bhelgaas@google.com \
    --cc=kwilczynski@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mani@kernel.org \
    --cc=manivannan.sadhasivam@oss.qualcomm.com \
    --cc=pali@kernel.org \
    --cc=robh@kernel.org \
    --cc=thomas.petazzoni@bootlin.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