From: Niklas Cassel <cassel@kernel.org>
To: Weidong Wang <weidongw@illinois.edu>
Cc: "pstanner@redhat.com" <pstanner@redhat.com>,
"Damien Le Moal" <dlemoal@kernel.org>,
linux-ide@vger.kernel.org, "Bjorn Helgaas" <bhelgaas@google.com>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] ata: libata-core: Do not use pcim_enable_device() on PCI resume
Date: Thu, 3 Dec 2026 14:27:48 +0100 [thread overview]
Message-ID: <axFuVO4jACEk5HT3@ryzen> (raw)
In-Reply-To: <20261201201504.1308278-1-weidongw@illinois.edu>
Hello Weidong,
On Tue, Dec 01, 2026 at 02:15:04PM -0600, Weidong Wang wrote:
> On Mon, 2026-11-30 at 14:00 +0100, Philipp Stanner wrote:
>
> Most of them suspend through ata_pci_device_suspend(), which disables
> the device, so the enable on resume matches it. The exceptions are
> drivers whose suspend leaves the device enabled: pata_cs5520,
> pata_triflex, and the broken-suspend path of ata_piix. ata_piix already
> skips ata_pci_device_do_resume() there and uses pci_reenable_device().
> I missed pata_triflex (sashiko pointed it out); v2 will handle it the
> same way as pata_cs5520.
>
> > That change looks suspicious. I would expect it to be unnecessary if
> > all that were changed in ATA were replacing the pcim_ functions with
> > the pci_ ones.
>
> pata_cs5520 does not disable the device on suspend, so any resume path
> that calls pci_enable_device() raises the enable count without a
> matching disable, whether probe used pcim_ or pci_. That is why its
> resume must not go through ata_pci_device_do_resume().
>
> Moving all of libata to the unmanaged API would touch the probe and
> remove paths of every PCI ATA driver, so I kept the fix to the resume
> path. Damien, Niklas, let me know if you would prefer that instead.
Philipp is the author of f748a07a0b64 ("PCI: Remove legacy pcim_release()"),
so I trust his judgement.
But to me it makes sense to make libata consistent, either fully use the
pci_* APIs or fully use the pcim_* APIs.
Without looking at the patches, it is hard to know if it is more wise to
convert everything to pci_* or to convert everything to pcim_*.
(I assume that there was some weird corner case that caused someone to mix
the APIs in the first place... So personally I would prefer the solution
which untangles this mess with the most logical/beautiful end result.)
Kind regards,
Niklas
next prev parent reply other threads:[~2026-12-03 13:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-29 3:11 Weidong Wang via B4 Relay
2026-11-30 13:00 ` pstanner
2026-12-01 20:15 ` Weidong Wang
2026-12-03 13:27 ` Niklas Cassel [this message]
2026-12-03 13:39 ` Niklas Cassel
2026-12-03 13:48 ` Niklas Cassel
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=axFuVO4jACEk5HT3@ryzen \
--to=cassel@kernel.org \
--cc=bhelgaas@google.com \
--cc=dlemoal@kernel.org \
--cc=kwilczynski@kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pstanner@redhat.com \
--cc=stable@vger.kernel.org \
--cc=weidongw@illinois.edu \
/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
all inboxes | Powered by JetHome®