From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Christoph Hellwig <hch@lst.de>, Konrad Dybcio <konradybcio@kernel.org>
Cc: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
Sagi Grimberg <sagi@grimberg.me>,
Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>,
Marijn Suijten <marijn.suijten@somainline.org>,
linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nvme-pci: Force NVME_QUIRK_SIMPLE_SUSPEND on Qualcomm hosts
Date: Fri, 25 Oct 2024 17:30:05 +0200 [thread overview]
Message-ID: <0fac5de3-3f35-4fc2-bbdc-411dc1018a85@oss.qualcomm.com> (raw)
In-Reply-To: <20241025113520.GA19521@lst.de>
On 25.10.2024 1:35 PM, Christoph Hellwig wrote:
> On Thu, Oct 24, 2024 at 07:33:07PM +0200, Konrad Dybcio wrote:
>> From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
>>
>> The Qualcomm SC8280XP SoC requires that all PCIe hosts are powered down
>> before the platform can reach S3-like sleep states. This is very much
>> similar in nature to the issue described in [1].
>>
>> Other Qualcomm platforms we support upstream require more complex code
>> additions across both the PCIe RC driver and other platform-specific
>> ones, before the link can be sustained in suspend. Hence, they
>> effectively need the same treatment for now.
>>
>> Force NVME_QUIRK_SIMPLE_SUSPEND on all Qualcomm platforms (as
>> identified by the upstream bridge having a Qualcomm VID) to address
>> that. Once the aforementioned issues on non-SC8280XP platforms are
>> addressed, the condition will be made more specific, with a PID check
>> limiting it to only the platform(s) that require it due to HW design.
>
> The NVMe driver is the wrong place for this, it needs to happen in the
> core by making acpi_storage_d3() evaluate to true. Preferably by
> actually setting the right ACPI attributes because a check for
> PCI vendor ID absolutely will never do the right thing in the long run.
(Un?)fortunately, said platforms use FDT, so we can't fix that in ACPI.
We also considered a DT property to indicate this, but:
a) PCIe devices are discoverable and it's really really really
discouraged to hardcode devices that are likely to be present
on the bus (and this wouldn't work if a NVMe device showed up
on a different-than-usual RC)
b) Adding such a property to the PCIe host node sounds a bit
saner, but the NVMe code isn't aware of the RC. We could add
something like:
struct pci_bus *pbus = pdev->bus;
while (!(pci_is_root_bus(pbus)))
pbus = pbus->parent;
if (of_property_present(pbus->dev.of_node, "broken-sleep-foo-bar"))
return NVME_QUIRK_SIMPLE_SUSPEND;
..but that implies we have to set that quirk in DT on all platforms
which only require an equivalent workaround temporarily. That in turn
is later much harder to undo than a simple driver change (e.g. if your
FDT is provided by the firmware).
In general, I don't think we can at all rely on firmware updates for
devices that are already on the market.
Konrad
next prev parent reply other threads:[~2024-10-25 15:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-24 17:33 [PATCH] nvme-pci: Force NVME_QUIRK_SIMPLE_SUSPEND on Qualcomm hosts Konrad Dybcio
2024-10-25 11:35 ` Christoph Hellwig
2024-10-25 15:30 ` Konrad Dybcio [this message]
2024-10-28 9:19 ` Christoph Hellwig
2024-10-28 13:15 ` Konrad Dybcio
2024-10-25 16:12 ` Keith Busch
2024-10-25 16:40 ` Konrad Dybcio
2024-10-25 16:57 ` Keith Busch
2024-10-25 17:20 ` Konrad Dybcio
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=0fac5de3-3f35-4fc2-bbdc-411dc1018a85@oss.qualcomm.com \
--to=konrad.dybcio@oss.qualcomm.com \
--cc=axboe@kernel.dk \
--cc=bjorn.andersson@oss.qualcomm.com \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=konradybcio@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=marijn.suijten@somainline.org \
--cc=sagi@grimberg.me \
/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