[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <460664b1-df24-4f15-a9b9-6ff2e6a20227@linux.intel.com>
Date: Tue, 10 Jun 2025 07:18:29 -0700
From: Sathyanarayanan Kuppuswamy <sathyanarayanan.kuppuswamy@...ux.intel.com>
To: Philipp Stanner <phasta@...nel.org>, Damien Le Moal <dlemoal@...nel.org>,
Niklas Cassel <cassel@...nel.org>,
Krzysztof WilczyĆski <kwilczynski@...nel.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: linux-ide@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] ata: pata_macio: Fix PCI region leak
On 6/10/25 6:54 AM, Philipp Stanner wrote:
> pci_request_regions() became a managed devres functions if the PCI
> device was enabled with pcim_enable_device(), which is the case for
> pata_macio.
>
> The PCI subsystem recently removed this hybrid feature from
> pci_request_region(). When doing so, pata_macio was forgotten to be
> ported to use pcim_request_all_regions(). If that function is not used,
> pata_macio will fail on driver-reload because the PCI regions will
> remain blocked.
>
> Fix the region leak by replacing pci_request_regions() with its managed
> counterpart, pcim_request_all_regions().
>
> Fixes: 51f6aec99cb0 ("PCI: Remove hybrid devres nature from request functions")
> Signed-off-by: Philipp Stanner <phasta@...nel.org>
> ---
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@...ux.intel.com>
> Changes in v2:
> - Add Fixes: tag and rephrase commit message, since the merge window
> closed already. (Niklas)
> ---
> drivers/ata/pata_macio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/ata/pata_macio.c b/drivers/ata/pata_macio.c
> index fbf5f07ea357..f7a933eefe05 100644
> --- a/drivers/ata/pata_macio.c
> +++ b/drivers/ata/pata_macio.c
> @@ -1298,7 +1298,7 @@ static int pata_macio_pci_attach(struct pci_dev *pdev,
> priv->dev = &pdev->dev;
>
> /* Get MMIO regions */
> - if (pci_request_regions(pdev, "pata-macio")) {
> + if (pcim_request_all_regions(pdev, "pata-macio")) {
> dev_err(&pdev->dev,
> "Cannot obtain PCI resources\n");
> return -EBUSY;
--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer
Powered by blists - more mailing lists