Re: [PATCH] ata: pata_macio: Do not disable the PCI device on suspend
From: Damien Le Moal
Date: Wed Dec 02 2026 - 02:05:52 EST
On 12/2/26 04:17, Arina Kharlamova via B4 Relay wrote:
> From: Arina Kharlamova <arina.kharlamova@xxxxxxxxxxxx>
>
> pata_macio_suspend() disables the PCI device with pci_disable_device(),
> and pata_macio_reset_hw() enables it again on resume with
> pcim_enable_device(). Since commit f748a07a0b64 ("PCI: Remove legacy
> pcim_release()") every pcim_enable_device() call adds a
> pcim_disable_device() devres action, so each suspend and resume leaves
> one more action behind. On unbind they all run, and every one after
> the first warns about disabling an already disabled device.
>
> The device is enabled with pcim_enable_device() in probe and stays
> managed until unbind, so the driver should not disable and enable it by
> hand. On suspend, clear only the bus master bit, which is all that
> pci_disable_device() did on this hardware, and set it again on resume
> without enabling the device.
>
> Fixes: f748a07a0b64 ("PCI: Remove legacy pcim_release()")
> Signed-off-by: Arina Kharlamova <arina.kharlamova@xxxxxxxxxxxx>
This needs testing.
--
Damien Le Moal
Western Digital Research