From: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
To: sashiko-bot@kernel.org
Cc: jtornosm@redhat.com, linux-pci@vger.kernel.org,
sashiko-reviews@lists.linux.dev
Subject: Re: [PATCH v14 1/2] PCI: Add device-specific reset for Qualcomm SDX62/SDX65 modems
Date: Thu, 17 Sep 2026 14:45:44 +0200 [thread overview]
Message-ID: <20260917124544.9030-1-jtornosm@redhat.com> (raw)
In-Reply-To: <20260917073528.A47E61F000FF@smtp.kernel.org>
> [Severity: High]
> Does this unsafely enable memory decoding on a hardware-reset device with
> zeroed BARs?
>
> If the caller did not explicitly clear PCI_COMMAND_MEMORY before the reset,
> cmd will have PCI_COMMAND_MEMORY set.
>
> The hardware reset zeroes the device's PCI configuration space, including all
> BARs. Restoring cmd with PCI_COMMAND_MEMORY set will immediately enable memory
> decoding while the BARs are still 0, potentially causing severe PCIe bus
> conflicts, IOMMU faults, or kernel panics since the device will intercept
> memory accesses to physical address 0.
>
> Should we clear PCI_COMMAND_MEMORY before returning (e.g.,
> cmd & ~PCI_COMMAND_MEMORY), relying on the caller's subsequent
> pci_restore_state() to safely reprogram the BARs before memory decoding is
> formally re-enabled?
The MHI SoC reset is a device-internal firmware/SoC reset, not a PCI-level
reset. It does not zero the PCI configuration space or BARs, the PCIe link
stays alive during this reset and BARs are maintained by the host PCI
subsystem.
Additionally, the PCI reset framework calls pci_dev_save_and_disable()
before and pci_dev_restore() after the reset method, so config space is
properly managed by the caller.
The reset sequence replicates the existing MHI driver code (mhi_soc_reset(),
mhi_pci_reset_prepare()) which works in production.
next prev parent reply other threads:[~2026-09-17 12:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 7:16 [PATCH v14 0/2] PCI: Add device-specific reset for Qualcomm devices Jose Ignacio Tornos Martinez
2026-09-17 7:16 ` [PATCH v14 1/2] PCI: Add device-specific reset for Qualcomm SDX62/SDX65 modems Jose Ignacio Tornos Martinez
2026-09-17 7:35 ` sashiko-bot
2026-09-17 12:45 ` Jose Ignacio Tornos Martinez [this message]
2026-09-17 7:16 ` [PATCH v14 2/2] PCI: Add device-specific reset for Qualcomm WCN6855/WCN7850 WLAN Jose Ignacio Tornos Martinez
2026-09-17 7:26 ` sashiko-bot
2026-10-02 21:40 ` [PATCH v14 0/2] PCI: Add device-specific reset for Qualcomm devices Bjorn Helgaas
2026-10-02 23:09 ` Alex Williamson
2026-10-02 23:47 ` Bjorn Helgaas
2026-10-05 10:48 ` Jose Ignacio Tornos Martinez
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=20260917124544.9030-1-jtornosm@redhat.com \
--to=jtornosm@redhat.com \
--cc=linux-pci@vger.kernel.org \
--cc=sashiko-bot@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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