All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] PCI: Remove pci_enable_device_io()
@ 2024-03-23 17:13 Heiner Kallweit
  2024-03-23 17:14 ` [PATCH 1/2] ata: pata_cs5520: Remove not needed call to pci_enable_device_io Heiner Kallweit
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Heiner Kallweit @ 2024-03-23 17:13 UTC (permalink / raw)
  To: Sergey Shtylyov, Damien Le Moal, Niklas Cassel, Bjorn Helgaas
  Cc: linux-ide, linux-pci

The call to pci_enable_device_io() in cs5520 isn't needed and can be
removed. This was the last user, so the function itself can be removed
afterwards.

I'd propose to apply the series through the PCI tree.

Heiner Kallweit (2):
  ata: pata_cs5520: Remove not needed call to pci_enable_device_io
  PCI: Remove pci_enable_device_io()

 drivers/ata/pata_cs5520.c |  6 ------
 drivers/pci/pci.c         | 14 --------------
 include/linux/pci.h       |  1 -
 3 files changed, 21 deletions(-)

-- 
2.44.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] ata: pata_cs5520: Remove not needed call to pci_enable_device_io
  2024-03-23 17:13 [PATCH 0/2] PCI: Remove pci_enable_device_io() Heiner Kallweit
@ 2024-03-23 17:14 ` Heiner Kallweit
  2024-03-23 17:43   ` Sergey Shtylyov
  2024-03-25  7:57   ` Damien Le Moal
  2024-03-23 17:16 ` [PATCH 2/2] PCI: Remove pci_enable_device_io() Heiner Kallweit
  2024-03-28 22:13 ` [PATCH 0/2] " Bjorn Helgaas
  2 siblings, 2 replies; 7+ messages in thread
From: Heiner Kallweit @ 2024-03-23 17:14 UTC (permalink / raw)
  To: Sergey Shtylyov, Damien Le Moal, Niklas Cassel, Bjorn Helgaas
  Cc: linux-ide, linux-pci

A few lines earlier pcim_enable_device() is called, which includes
the functionality of pci_enable_device_io(). Therefore we can safely
remove the call to pci_enable_device_io().

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/ata/pata_cs5520.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/ata/pata_cs5520.c b/drivers/ata/pata_cs5520.c
index 38795508c..027cf6710 100644
--- a/drivers/ata/pata_cs5520.c
+++ b/drivers/ata/pata_cs5520.c
@@ -151,12 +151,6 @@ static int cs5520_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
 	if (!host)
 		return -ENOMEM;
 
-	/* Perform set up for DMA */
-	if (pci_enable_device_io(pdev)) {
-		dev_err(&pdev->dev, "unable to configure BAR2.\n");
-		return -ENODEV;
-	}
-
 	if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
 		dev_err(&pdev->dev, "unable to configure DMA mask.\n");
 		return -ENODEV;
-- 
2.44.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] PCI: Remove pci_enable_device_io()
  2024-03-23 17:13 [PATCH 0/2] PCI: Remove pci_enable_device_io() Heiner Kallweit
  2024-03-23 17:14 ` [PATCH 1/2] ata: pata_cs5520: Remove not needed call to pci_enable_device_io Heiner Kallweit
@ 2024-03-23 17:16 ` Heiner Kallweit
  2024-03-25  7:58   ` Damien Le Moal
  2024-03-28 22:13 ` [PATCH 0/2] " Bjorn Helgaas
  2 siblings, 1 reply; 7+ messages in thread
From: Heiner Kallweit @ 2024-03-23 17:16 UTC (permalink / raw)
  To: Sergey Shtylyov, Damien Le Moal, Niklas Cassel, Bjorn Helgaas
  Cc: linux-ide, linux-pci

After the last user was removed, remove this PCI core function.
It's very unlikely that we'll see a new device requiring
io space access, even though memory space access is supported.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/pci/pci.c   | 14 --------------
 include/linux/pci.h |  1 -
 2 files changed, 15 deletions(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index e5f243dd4..a26d00bf1 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -2110,20 +2110,6 @@ static int pci_enable_device_flags(struct pci_dev *dev, unsigned long flags)
 	return err;
 }
 
-/**
- * pci_enable_device_io - Initialize a device for use with IO space
- * @dev: PCI device to be initialized
- *
- * Initialize device before it's used by a driver. Ask low-level code
- * to enable I/O resources. Wake up the device if it was suspended.
- * Beware, this function can fail.
- */
-int pci_enable_device_io(struct pci_dev *dev)
-{
-	return pci_enable_device_flags(dev, IORESOURCE_IO);
-}
-EXPORT_SYMBOL(pci_enable_device_io);
-
 /**
  * pci_enable_device_mem - Initialize a device for use with Memory space
  * @dev: PCI device to be initialized
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 16493426a..ba1275778 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1315,7 +1315,6 @@ int pci_user_write_config_word(struct pci_dev *dev, int where, u16 val);
 int pci_user_write_config_dword(struct pci_dev *dev, int where, u32 val);
 
 int __must_check pci_enable_device(struct pci_dev *dev);
-int __must_check pci_enable_device_io(struct pci_dev *dev);
 int __must_check pci_enable_device_mem(struct pci_dev *dev);
 int __must_check pci_reenable_device(struct pci_dev *);
 int __must_check pcim_enable_device(struct pci_dev *pdev);
-- 
2.44.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] ata: pata_cs5520: Remove not needed call to pci_enable_device_io
  2024-03-23 17:14 ` [PATCH 1/2] ata: pata_cs5520: Remove not needed call to pci_enable_device_io Heiner Kallweit
@ 2024-03-23 17:43   ` Sergey Shtylyov
  2024-03-25  7:57   ` Damien Le Moal
  1 sibling, 0 replies; 7+ messages in thread
From: Sergey Shtylyov @ 2024-03-23 17:43 UTC (permalink / raw)
  To: Heiner Kallweit, Damien Le Moal, Niklas Cassel, Bjorn Helgaas
  Cc: linux-ide, linux-pci

Hello!

On 3/23/24 8:14 PM, Heiner Kallweit wrote:

> A few lines earlier pcim_enable_device() is called, which includes
> the functionality of pci_enable_device_io(). Therefore we can safely
> remove the call to pci_enable_device_io().
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>

[...]

MBR, Sergey

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] ata: pata_cs5520: Remove not needed call to pci_enable_device_io
  2024-03-23 17:14 ` [PATCH 1/2] ata: pata_cs5520: Remove not needed call to pci_enable_device_io Heiner Kallweit
  2024-03-23 17:43   ` Sergey Shtylyov
@ 2024-03-25  7:57   ` Damien Le Moal
  1 sibling, 0 replies; 7+ messages in thread
From: Damien Le Moal @ 2024-03-25  7:57 UTC (permalink / raw)
  To: Heiner Kallweit, Sergey Shtylyov, Niklas Cassel, Bjorn Helgaas
  Cc: linux-ide, linux-pci

On 3/24/24 02:14, Heiner Kallweit wrote:
> A few lines earlier pcim_enable_device() is called, which includes
> the functionality of pci_enable_device_io(). Therefore we can safely
> remove the call to pci_enable_device_io().
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Looks OK to me.

Acked-by: Damien Le Moal <dlemoal@kernel.org>

-- 
Damien Le Moal
Western Digital Research


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] PCI: Remove pci_enable_device_io()
  2024-03-23 17:16 ` [PATCH 2/2] PCI: Remove pci_enable_device_io() Heiner Kallweit
@ 2024-03-25  7:58   ` Damien Le Moal
  0 siblings, 0 replies; 7+ messages in thread
From: Damien Le Moal @ 2024-03-25  7:58 UTC (permalink / raw)
  To: Heiner Kallweit, Sergey Shtylyov, Niklas Cassel, Bjorn Helgaas
  Cc: linux-ide, linux-pci

On 3/24/24 02:16, Heiner Kallweit wrote:
> After the last user was removed, remove this PCI core function.
> It's very unlikely that we'll see a new device requiring
> io space access, even though memory space access is supported.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Looks OK to me.

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>


-- 
Damien Le Moal
Western Digital Research


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] PCI: Remove pci_enable_device_io()
  2024-03-23 17:13 [PATCH 0/2] PCI: Remove pci_enable_device_io() Heiner Kallweit
  2024-03-23 17:14 ` [PATCH 1/2] ata: pata_cs5520: Remove not needed call to pci_enable_device_io Heiner Kallweit
  2024-03-23 17:16 ` [PATCH 2/2] PCI: Remove pci_enable_device_io() Heiner Kallweit
@ 2024-03-28 22:13 ` Bjorn Helgaas
  2 siblings, 0 replies; 7+ messages in thread
From: Bjorn Helgaas @ 2024-03-28 22:13 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: Sergey Shtylyov, Damien Le Moal, Niklas Cassel, Bjorn Helgaas,
	linux-ide, linux-pci

On Sat, Mar 23, 2024 at 06:13:41PM +0100, Heiner Kallweit wrote:
> The call to pci_enable_device_io() in cs5520 isn't needed and can be
> removed. This was the last user, so the function itself can be removed
> afterwards.
> 
> I'd propose to apply the series through the PCI tree.
> 
> Heiner Kallweit (2):
>   ata: pata_cs5520: Remove not needed call to pci_enable_device_io
>   PCI: Remove pci_enable_device_io()
> 
>  drivers/ata/pata_cs5520.c |  6 ------
>  drivers/pci/pci.c         | 14 --------------
>  include/linux/pci.h       |  1 -
>  3 files changed, 21 deletions(-)

Applied to pci/enumeration with acks/reviewed-by from Damien and
Sergey, thank you!

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-03-28 22:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-23 17:13 [PATCH 0/2] PCI: Remove pci_enable_device_io() Heiner Kallweit
2024-03-23 17:14 ` [PATCH 1/2] ata: pata_cs5520: Remove not needed call to pci_enable_device_io Heiner Kallweit
2024-03-23 17:43   ` Sergey Shtylyov
2024-03-25  7:57   ` Damien Le Moal
2024-03-23 17:16 ` [PATCH 2/2] PCI: Remove pci_enable_device_io() Heiner Kallweit
2024-03-25  7:58   ` Damien Le Moal
2024-03-28 22:13 ` [PATCH 0/2] " Bjorn Helgaas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.