linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] Introduce pci_(request|release)_(mem|io)_regions
@ 2016-06-02  7:30 Johannes Thumshirn
  2016-06-02  7:30 ` [PATCH v2 1/6] PCI: Add helpers to request/release memory and I/O regions Johannes Thumshirn
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Johannes Thumshirn @ 2016-06-02  7:30 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: linux-pci, linux-kernel, Christoph Hellwig, Johannes Thumshirn,
	Keith Busch, Jens Axboe, linux-nvme, James Smart, Dick Kennedy,
	James E.J. Bottomley, Martin K. Petersen, linux-scsi,
	Frank Haverkamp, Greg Kroah-Hartman, Jay Cliburn, Chris Snook,
	Jeff Kirsher, David S. Miller, netdev, intel-wired-lan

The first patch in this series introduces the following 4 helper functions to
the PCI core:

* pci_request_mem_regions()
* pci_request_io_regions()
* pci_release_mem_regions()
* pci_release_io_regions()

which encapsulate the request and release of a PCI device's memory or I/O
bars.

The subsequent patches convert the drivers, which use the
pci_request_selected_regions(pdev, 
	pci_select_bars(pdev, IORESOURCE_MEM), name); 
and similar pattern to use the new interface.

This was suggested by Christoph Hellwig in
http://lists.infradead.org/pipermail/linux-nvme/2016-May/004570.html and
tested on kernel v4.6 with NVMe.

The conversion of the drivers has been performed by the following coccinelle
spatch:
// IORESOURCE_MEM
@@
expression err, pdev, name;
@@

- err = pci_request_selected_regions(pdev, pci_select_bars(pdev, IORESOURCE_MEM), name);
+ err = pci_request_mem_regions(pdev, name);

@@
expression pdev;
@@
- pci_release_selected_regions(pdev, pci_select_bars(pdev, IORESOURCE_MEM));
+ pci_release_mem_regions(pdev);

@@
expression err, pdev, name;
identifier bars;
@@
- bars = pci_select_bars(pdev, IORESOURCE_MEM);
...
- err = pci_request_selected_regions(pdev, bars, name);
+ err = pci_request_mem_regions(pdev, name);

@@
expression pdev;
identifier bars;
@@
- bars = pci_select_bars(pdev, IORESOURCE_MEM);
...
- pci_release_selected_regions(pdev, bars);
+ pci_release_mem_regions(pdev);

// IORESOURCE_IO
@@
expression err, pdev, name;
@@

- err = pci_request_selected_regions(pdev, pci_select_bars(pdev,
IORESOURCE_IO), name);
+ err = pci_request_io_regions(pdev, name);

@@
expression pdev;
@@
- pci_release_selected_regions(pdev, pci_select_bars(pdev, IORESOURCE_IO));
+ pci_release_io_regions(pdev);

@@
expression err, pdev, name;
identifier bars;
@@
- bars = pci_select_bars(pdev, IORESOURCE_IO);
...
- err = pci_request_selected_regions(pdev, bars, name);
+ err = pci_request_io_regions(pdev, name);

@@
expression pdev;
identifier bars;
@@
- bars = pci_select_bars(pdev, IORESOURCE_IO);
...
- pci_release_selected_regions(pdev, bars);
+ pci_release_io_regions(pdev);

Changes since v1:
* Fixed indendatoin in pci.h patch to not cross the 80 chars boundary.
* Split Ethernet patches into two, one for Atheros and one for Intel drivers.
* Correctly named lpfc patch.
* Converted init-path of lpfc driver as well.
* Added Reviewed-by tags were appropriate.

Johannes Thumshirn (6):
  PCI: Add helpers to request/release memory and I/O regions
  NVMe: Use pci_(request|release)_mem_regions
  lpfc: Use pci_(request|release)_mem_regions
  GenWQE: Use pci_(request|release)_mem_regions
  ethernet/intel: Use pci_(request|release)_mem_regions
  alx: Use pci_(request|release)_mem_regions

 drivers/misc/genwqe/card_base.c               | 13 +++++--------
 drivers/net/ethernet/atheros/alx/main.c       | 12 +++++-------
 drivers/net/ethernet/intel/e1000e/netdev.c    |  6 ++----
 drivers/net/ethernet/intel/fm10k/fm10k_pci.c  | 11 +++--------
 drivers/net/ethernet/intel/i40e/i40e_main.c   |  9 +++------
 drivers/net/ethernet/intel/igb/igb_main.c     | 10 +++-------
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |  9 +++------
 drivers/nvme/host/pci.c                       | 10 +++-------
 drivers/scsi/lpfc/lpfc_init.c                 | 15 ++++----------
 include/linux/pci.h                           | 28 +++++++++++++++++++++++++++
 10 files changed, 59 insertions(+), 64 deletions(-)

Cc: Christoph Hellwig <hch@infradead.org>
Cc: Keith Busch <keith.busch@intel.com>
Cc: Jens Axboe <axboe@fb.com>
Cc: linux-nvme@lists.infradead.org
Cc: James Smart <james.smart@avagotech.com>
Cc: Dick Kennedy <dick.kennedy@avagotech.com>
Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: Frank Haverkamp <haver@linux.vnet.ibm.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jay Cliburn <jcliburn@gmail.com>
Cc: Chris Snook <chris.snook@gmail.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: intel-wired-lan@lists.osuosl.org
-- 
1.8.5.6

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

* [PATCH v2 1/6] PCI: Add helpers to request/release memory and I/O regions
  2016-06-02  7:30 [PATCH v2 0/6] Introduce pci_(request|release)_(mem|io)_regions Johannes Thumshirn
@ 2016-06-02  7:30 ` Johannes Thumshirn
  2016-06-04 23:11   ` kbuild test robot
  2016-06-04 23:32   ` kbuild test robot
  2016-06-02  7:30 ` [PATCH v2 2/6] NVMe: Use pci_(request|release)_mem_regions Johannes Thumshirn
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 12+ messages in thread
From: Johannes Thumshirn @ 2016-06-02  7:30 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: linux-pci, linux-kernel, Christoph Hellwig, Johannes Thumshirn

Add helpers to request and release a device's memory or I/O regions.

With these helpers in place, one does not need to select a device's memory or
I/O regions with pci_select_bars() prior to requesting or releasing them.

Suggested-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Christoph Hellwig <hch@infradead.org>
---
 include/linux/pci.h | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/include/linux/pci.h b/include/linux/pci.h
index 932ec74..565c38e 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -2007,6 +2007,34 @@ static inline bool pci_is_dev_assigned(struct pci_dev *pdev)
 	return (pdev->dev_flags & PCI_DEV_FLAGS_ASSIGNED) == PCI_DEV_FLAGS_ASSIGNED;
 }
 
+static inline int
+pci_request_io_regions(struct pci_dev *pdev, const char *name)
+{
+	return pci_request_selected_regions(pdev,
+			    pci_select_bars(pdev, IORESOURCE_IO), name);
+}
+
+static inline void
+pci_release_io_regions(struct pci_dev *pdev)
+{
+	return pci_release_selected_regions(pdev,
+			    pci_select_bars(pdev, IORESOURCE_IO));
+}
+
+static inline int
+pci_request_mem_regions(struct pci_dev *pdev, const char *name)
+{
+	return pci_request_selected_regions(pdev,
+			    pci_select_bars(pdev, IORESOURCE_MEM), name);
+}
+
+static inline void
+pci_release_mem_regions(struct pci_dev *pdev)
+{
+	return pci_release_selected_regions(pdev,
+			    pci_select_bars(pdev, IORESOURCE_MEM));
+}
+
 /**
  * pci_ari_enabled - query ARI forwarding status
  * @bus: the PCI bus
-- 
1.8.5.6

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

* [PATCH v2 2/6] NVMe: Use pci_(request|release)_mem_regions
  2016-06-02  7:30 [PATCH v2 0/6] Introduce pci_(request|release)_(mem|io)_regions Johannes Thumshirn
  2016-06-02  7:30 ` [PATCH v2 1/6] PCI: Add helpers to request/release memory and I/O regions Johannes Thumshirn
@ 2016-06-02  7:30 ` Johannes Thumshirn
  2016-06-02  7:30 ` [PATCH v2 3/6] lpfc: " Johannes Thumshirn
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Johannes Thumshirn @ 2016-06-02  7:30 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: linux-pci, linux-kernel, Christoph Hellwig, Johannes Thumshirn,
	Keith Busch, Jens Axboe, linux-nvme

Now that we do have pci_request_mem_regions() and pci_release_mem_regions() at
hand, use it in the NVMe driver.

Suggested-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Keith Busch <keith.busch@intel.com>
Cc: Jens Axboe <axboe@fb.com>
Cc: linux-nvme@lists.infradead.org
---
 drivers/nvme/host/pci.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 4fd733f..e7d17ae 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -1756,7 +1756,7 @@ static void nvme_dev_unmap(struct nvme_dev *dev)
 {
 	if (dev->bar)
 		iounmap(dev->bar);
-	pci_release_regions(to_pci_dev(dev->dev));
+	pci_release_mem_regions(to_pci_dev(dev->dev));
 }
 
 static void nvme_pci_disable(struct nvme_dev *dev)
@@ -1979,13 +1979,9 @@ static const struct nvme_ctrl_ops nvme_pci_ctrl_ops = {
 
 static int nvme_dev_map(struct nvme_dev *dev)
 {
-	int bars;
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
 
-	bars = pci_select_bars(pdev, IORESOURCE_MEM);
-	if (!bars)
-		return -ENODEV;
-	if (pci_request_selected_regions(pdev, bars, "nvme"))
+	if (pci_request_mem_regions(pdev, "nvme"))
 		return -ENODEV;
 
 	dev->bar = ioremap(pci_resource_start(pdev, 0), 8192);
@@ -1994,7 +1990,7 @@ static int nvme_dev_map(struct nvme_dev *dev)
 
        return 0;
   release:
-       pci_release_regions(pdev);
+       pci_release_mem_regions(pdev);
        return -ENODEV;
 }
 
-- 
1.8.5.6

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

* [PATCH v2 3/6] lpfc: Use pci_(request|release)_mem_regions
  2016-06-02  7:30 [PATCH v2 0/6] Introduce pci_(request|release)_(mem|io)_regions Johannes Thumshirn
  2016-06-02  7:30 ` [PATCH v2 1/6] PCI: Add helpers to request/release memory and I/O regions Johannes Thumshirn
  2016-06-02  7:30 ` [PATCH v2 2/6] NVMe: Use pci_(request|release)_mem_regions Johannes Thumshirn
@ 2016-06-02  7:30 ` Johannes Thumshirn
       [not found]   ` <CAGx+d6eHPKvOM_aYgv9qJvA1siJ89PzwHtK07U9tKs3yG7=O9w@mail.gmail.com>
  2016-06-02  7:30 ` [PATCH v2 4/6] GenWQE: " Johannes Thumshirn
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Johannes Thumshirn @ 2016-06-02  7:30 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: linux-pci, linux-kernel, Christoph Hellwig, Johannes Thumshirn,
	James Smart, Dick Kennedy, James E.J. Bottomley,
	Martin K. Petersen, linux-scsi

Now that we do have pci_request_mem_regions() and pci_release_mem_regions() at
hand, use it in the lpfc driver.

Suggested-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Cc: James Smart <james.smart@avagotech.com>
Cc: Dick Kennedy <dick.kennedy@avagotech.com>
Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/scsi/lpfc/lpfc_init.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index f57d02c..a8735f7 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -4775,20 +4775,17 @@ static int
 lpfc_enable_pci_dev(struct lpfc_hba *phba)
 {
 	struct pci_dev *pdev;
-	int bars = 0;
 
 	/* Obtain PCI device reference */
 	if (!phba->pcidev)
 		goto out_error;
 	else
 		pdev = phba->pcidev;
-	/* Select PCI BARs */
-	bars = pci_select_bars(pdev, IORESOURCE_MEM);
 	/* Enable PCI device */
 	if (pci_enable_device_mem(pdev))
 		goto out_error;
 	/* Request PCI resource for the device */
-	if (pci_request_selected_regions(pdev, bars, LPFC_DRIVER_NAME))
+	if (pci_request_mem_regions(pdev, LPFC_DRIVER_NAME))
 		goto out_disable_device;
 	/* Set up device as PCI master and save state for EEH */
 	pci_set_master(pdev);
@@ -4805,7 +4802,7 @@ out_disable_device:
 	pci_disable_device(pdev);
 out_error:
 	lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
-			"1401 Failed to enable pci device, bars:x%x\n", bars);
+			"1401 Failed to enable pci device\n");
 	return -ENODEV;
 }
 
@@ -4820,17 +4817,14 @@ static void
 lpfc_disable_pci_dev(struct lpfc_hba *phba)
 {
 	struct pci_dev *pdev;
-	int bars;
 
 	/* Obtain PCI device reference */
 	if (!phba->pcidev)
 		return;
 	else
 		pdev = phba->pcidev;
-	/* Select PCI BARs */
-	bars = pci_select_bars(pdev, IORESOURCE_MEM);
 	/* Release PCI resource and disable PCI device */
-	pci_release_selected_regions(pdev, bars);
+	pci_release_mem_regions(pdev);
 	pci_disable_device(pdev);
 
 	return;
@@ -9705,7 +9699,6 @@ lpfc_pci_remove_one_s3(struct pci_dev *pdev)
 	struct lpfc_vport **vports;
 	struct lpfc_hba   *phba = vport->phba;
 	int i;
-	int bars = pci_select_bars(pdev, IORESOURCE_MEM);
 
 	spin_lock_irq(&phba->hbalock);
 	vport->load_flag |= FC_UNLOADING;
@@ -9780,7 +9773,7 @@ lpfc_pci_remove_one_s3(struct pci_dev *pdev)
 
 	lpfc_hba_free(phba);
 
-	pci_release_selected_regions(pdev, bars);
+	pci_release_mem_regions(pdev);
 	pci_disable_device(pdev);
 }
 
-- 
1.8.5.6

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

* [PATCH v2 4/6] GenWQE: Use pci_(request|release)_mem_regions
  2016-06-02  7:30 [PATCH v2 0/6] Introduce pci_(request|release)_(mem|io)_regions Johannes Thumshirn
                   ` (2 preceding siblings ...)
  2016-06-02  7:30 ` [PATCH v2 3/6] lpfc: " Johannes Thumshirn
@ 2016-06-02  7:30 ` Johannes Thumshirn
  2016-06-02  7:30 ` [PATCH v2 5/6] ethernet/intel: " Johannes Thumshirn
  2016-06-02  7:30 ` [PATCH v2 6/6] alx: " Johannes Thumshirn
  5 siblings, 0 replies; 12+ messages in thread
From: Johannes Thumshirn @ 2016-06-02  7:30 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: linux-pci, linux-kernel, Christoph Hellwig, Johannes Thumshirn,
	Frank Haverkamp, Greg Kroah-Hartman

Now that we do have pci_request_mem_regions() and pci_release_mem_regions() at
hand, use it in the genwqe driver.

Suggested-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Cc: Frank Haverkamp <haver@linux.vnet.ibm.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/misc/genwqe/card_base.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/misc/genwqe/card_base.c b/drivers/misc/genwqe/card_base.c
index 4cf8f82..cb398be 100644
--- a/drivers/misc/genwqe/card_base.c
+++ b/drivers/misc/genwqe/card_base.c
@@ -182,7 +182,7 @@ static void genwqe_dev_free(struct genwqe_dev *cd)
  */
 static int genwqe_bus_reset(struct genwqe_dev *cd)
 {
-	int bars, rc = 0;
+	int rc = 0;
 	struct pci_dev *pci_dev = cd->pci_dev;
 	void __iomem *mmio;
 
@@ -193,8 +193,7 @@ static int genwqe_bus_reset(struct genwqe_dev *cd)
 	cd->mmio = NULL;
 	pci_iounmap(pci_dev, mmio);
 
-	bars = pci_select_bars(pci_dev, IORESOURCE_MEM);
-	pci_release_selected_regions(pci_dev, bars);
+	pci_release_mem_regions(pci_dev);
 
 	/*
 	 * Firmware/BIOS might change memory mapping during bus reset.
@@ -218,7 +217,7 @@ static int genwqe_bus_reset(struct genwqe_dev *cd)
 			    GENWQE_INJECT_GFIR_FATAL |
 			    GENWQE_INJECT_GFIR_INFO);
 
-	rc = pci_request_selected_regions(pci_dev, bars, genwqe_driver_name);
+	rc = pci_request_mem_regions(pci_dev, genwqe_driver_name);
 	if (rc) {
 		dev_err(&pci_dev->dev,
 			"[%s] err: request bars failed (%d)\n", __func__, rc);
@@ -1071,7 +1070,6 @@ static int genwqe_pci_setup(struct genwqe_dev *cd)
 	int err, bars;
 	struct pci_dev *pci_dev = cd->pci_dev;
 
-	bars = pci_select_bars(pci_dev, IORESOURCE_MEM);
 	err = pci_enable_device_mem(pci_dev);
 	if (err) {
 		dev_err(&pci_dev->dev,
@@ -1080,7 +1078,7 @@ static int genwqe_pci_setup(struct genwqe_dev *cd)
 	}
 
 	/* Reserve PCI I/O and memory resources */
-	err = pci_request_selected_regions(pci_dev, bars, genwqe_driver_name);
+	err = pci_request_mem_regions(pci_dev, genwqe_driver_name);
 	if (err) {
 		dev_err(&pci_dev->dev,
 			"[%s] err: request bars failed (%d)\n", __func__, err);
@@ -1160,8 +1158,7 @@ static void genwqe_pci_remove(struct genwqe_dev *cd)
 	if (cd->mmio)
 		pci_iounmap(pci_dev, cd->mmio);
 
-	bars = pci_select_bars(pci_dev, IORESOURCE_MEM);
-	pci_release_selected_regions(pci_dev, bars);
+	pci_release_mem_regions(pci_dev);
 	pci_disable_device(pci_dev);
 }
 
-- 
1.8.5.6

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

* [PATCH v2 5/6] ethernet/intel: Use pci_(request|release)_mem_regions
  2016-06-02  7:30 [PATCH v2 0/6] Introduce pci_(request|release)_(mem|io)_regions Johannes Thumshirn
                   ` (3 preceding siblings ...)
  2016-06-02  7:30 ` [PATCH v2 4/6] GenWQE: " Johannes Thumshirn
@ 2016-06-02  7:30 ` Johannes Thumshirn
  2016-06-02 21:01   ` Jeff Kirsher
  2016-06-02  7:30 ` [PATCH v2 6/6] alx: " Johannes Thumshirn
  5 siblings, 1 reply; 12+ messages in thread
From: Johannes Thumshirn @ 2016-06-02  7:30 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: linux-pci, linux-kernel, Christoph Hellwig, Johannes Thumshirn,
	Jeff Kirsher, David S. Miller, netdev, intel-wired-lan

Now that we do have pci_request_mem_regions() and pci_release_mem_regions() at
hand, use it in the Intel ethernet drivers.

Suggested-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: intel-wired-lan@lists.osuosl.org
---
 drivers/net/ethernet/intel/e1000e/netdev.c    |  6 ++----
 drivers/net/ethernet/intel/fm10k/fm10k_pci.c  | 11 +++--------
 drivers/net/ethernet/intel/i40e/i40e_main.c   |  9 +++------
 drivers/net/ethernet/intel/igb/igb_main.c     | 10 +++-------
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |  9 +++------
 5 files changed, 14 insertions(+), 31 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 9b4ec13..ecd8d15 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -7284,8 +7284,7 @@ err_flashmap:
 err_ioremap:
 	free_netdev(netdev);
 err_alloc_etherdev:
-	pci_release_selected_regions(pdev,
-				     pci_select_bars(pdev, IORESOURCE_MEM));
+	pci_release_mem_regions(pdev);
 err_pci_reg:
 err_dma:
 	pci_disable_device(pdev);
@@ -7352,8 +7351,7 @@ static void e1000_remove(struct pci_dev *pdev)
 	if ((adapter->hw.flash_address) &&
 	    (adapter->hw.mac.type < e1000_pch_spt))
 		iounmap(adapter->hw.flash_address);
-	pci_release_selected_regions(pdev,
-				     pci_select_bars(pdev, IORESOURCE_MEM));
+	pci_release_mem_regions(pdev);
 
 	free_netdev(netdev);
 
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
index 4eb7a6f..ad28e87 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
@@ -1940,10 +1940,7 @@ static int fm10k_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		goto err_dma;
 	}
 
-	err = pci_request_selected_regions(pdev,
-					   pci_select_bars(pdev,
-							   IORESOURCE_MEM),
-					   fm10k_driver_name);
+	err = pci_request_mem_regions(pdev, fm10k_driver_name);
 	if (err) {
 		dev_err(&pdev->dev,
 			"pci_request_selected_regions failed: %d\n", err);
@@ -2034,8 +2031,7 @@ err_sw_init:
 err_ioremap:
 	free_netdev(netdev);
 err_alloc_netdev:
-	pci_release_selected_regions(pdev,
-				     pci_select_bars(pdev, IORESOURCE_MEM));
+	pci_release_mem_regions(pdev);
 err_pci_reg:
 err_dma:
 	pci_disable_device(pdev);
@@ -2086,8 +2082,7 @@ static void fm10k_remove(struct pci_dev *pdev)
 
 	free_netdev(netdev);
 
-	pci_release_selected_regions(pdev,
-				     pci_select_bars(pdev, IORESOURCE_MEM));
+	pci_release_mem_regions(pdev);
 
 	pci_disable_pcie_error_reporting(pdev);
 
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 3449129..37592b1 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -10779,8 +10779,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	}
 
 	/* set up pci connections */
-	err = pci_request_selected_regions(pdev, pci_select_bars(pdev,
-					   IORESOURCE_MEM), i40e_driver_name);
+	err = pci_request_mem_regions(pdev, i40e_driver_name);
 	if (err) {
 		dev_info(&pdev->dev,
 			 "pci_request_selected_regions failed %d\n", err);
@@ -11277,8 +11276,7 @@ err_ioremap:
 	kfree(pf);
 err_pf_alloc:
 	pci_disable_pcie_error_reporting(pdev);
-	pci_release_selected_regions(pdev,
-				     pci_select_bars(pdev, IORESOURCE_MEM));
+	pci_release_mem_regions(pdev);
 err_pci_reg:
 err_dma:
 	pci_disable_device(pdev);
@@ -11387,8 +11385,7 @@ static void i40e_remove(struct pci_dev *pdev)
 
 	iounmap(hw->hw_addr);
 	kfree(pf);
-	pci_release_selected_regions(pdev,
-				     pci_select_bars(pdev, IORESOURCE_MEM));
+	pci_release_mem_regions(pdev);
 
 	pci_disable_pcie_error_reporting(pdev);
 	pci_disable_device(pdev);
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 55a1405c..466087f 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -2288,9 +2288,7 @@ static int igb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		}
 	}
 
-	err = pci_request_selected_regions(pdev, pci_select_bars(pdev,
-					   IORESOURCE_MEM),
-					   igb_driver_name);
+	err = pci_request_mem_regions(pdev, igb_driver_name);
 	if (err)
 		goto err_pci_reg;
 
@@ -2707,8 +2705,7 @@ err_sw_init:
 err_ioremap:
 	free_netdev(netdev);
 err_alloc_etherdev:
-	pci_release_selected_regions(pdev,
-				     pci_select_bars(pdev, IORESOURCE_MEM));
+	pci_release_mem_regions(pdev);
 err_pci_reg:
 err_dma:
 	pci_disable_device(pdev);
@@ -2873,8 +2870,7 @@ static void igb_remove(struct pci_dev *pdev)
 	pci_iounmap(pdev, adapter->io_addr);
 	if (hw->flash_address)
 		iounmap(hw->flash_address);
-	pci_release_selected_regions(pdev,
-				     pci_select_bars(pdev, IORESOURCE_MEM));
+	pci_release_mem_regions(pdev);
 
 	kfree(adapter->shadow_vfta);
 	free_netdev(netdev);
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 7df3fe2..1357dd2 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -9084,8 +9084,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		pci_using_dac = 0;
 	}
 
-	err = pci_request_selected_regions(pdev, pci_select_bars(pdev,
-					   IORESOURCE_MEM), ixgbe_driver_name);
+	err = pci_request_mem_regions(pdev, ixgbe_driver_name);
 	if (err) {
 		dev_err(&pdev->dev,
 			"pci_request_selected_regions failed 0x%x\n", err);
@@ -9460,8 +9459,7 @@ err_ioremap:
 	disable_dev = !test_and_set_bit(__IXGBE_DISABLED, &adapter->state);
 	free_netdev(netdev);
 err_alloc_etherdev:
-	pci_release_selected_regions(pdev,
-				     pci_select_bars(pdev, IORESOURCE_MEM));
+	pci_release_mem_regions(pdev);
 err_pci_reg:
 err_dma:
 	if (!adapter || disable_dev)
@@ -9527,8 +9525,7 @@ static void ixgbe_remove(struct pci_dev *pdev)
 
 #endif
 	iounmap(adapter->io_addr);
-	pci_release_selected_regions(pdev, pci_select_bars(pdev,
-				     IORESOURCE_MEM));
+	pci_release_mem_regions(pdev);
 
 	e_dev_info("complete\n");
 
-- 
1.8.5.6

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

* [PATCH v2 6/6] alx: Use pci_(request|release)_mem_regions
  2016-06-02  7:30 [PATCH v2 0/6] Introduce pci_(request|release)_(mem|io)_regions Johannes Thumshirn
                   ` (4 preceding siblings ...)
  2016-06-02  7:30 ` [PATCH v2 5/6] ethernet/intel: " Johannes Thumshirn
@ 2016-06-02  7:30 ` Johannes Thumshirn
  5 siblings, 0 replies; 12+ messages in thread
From: Johannes Thumshirn @ 2016-06-02  7:30 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: linux-pci, linux-kernel, Christoph Hellwig, Johannes Thumshirn,
	Jay Cliburn, Chris Snook, David S. Miller, netdev,
	intel-wired-lan

Now that we do have pci_request_mem_regions() and pci_release_mem_regions() at
hand, use it in the ethernet drivers.

Suggested-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Cc: Jay Cliburn <jcliburn@gmail.com>
Cc: Chris Snook <chris.snook@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: intel-wired-lan@lists.osuosl.org
---
 drivers/net/ethernet/atheros/alx/main.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c
index 55b118e..d2363de 100644
--- a/drivers/net/ethernet/atheros/alx/main.c
+++ b/drivers/net/ethernet/atheros/alx/main.c
@@ -1238,7 +1238,7 @@ static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	struct alx_priv *alx;
 	struct alx_hw *hw;
 	bool phy_configured;
-	int bars, err;
+	int err;
 
 	err = pci_enable_device_mem(pdev);
 	if (err)
@@ -1258,11 +1258,10 @@ static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		}
 	}
 
-	bars = pci_select_bars(pdev, IORESOURCE_MEM);
-	err = pci_request_selected_regions(pdev, bars, alx_drv_name);
+	err = pci_request_mem_regions(pdev, alx_drv_name);
 	if (err) {
 		dev_err(&pdev->dev,
-			"pci_request_selected_regions failed(bars:%d)\n", bars);
+			"pci_request_mem_regions failed\n");
 		goto out_pci_disable;
 	}
 
@@ -1388,7 +1387,7 @@ out_unmap:
 out_free_netdev:
 	free_netdev(netdev);
 out_pci_release:
-	pci_release_selected_regions(pdev, bars);
+	pci_release_mem_regions(pdev);
 out_pci_disable:
 	pci_disable_device(pdev);
 	return err;
@@ -1407,8 +1406,7 @@ static void alx_remove(struct pci_dev *pdev)
 
 	unregister_netdev(alx->dev);
 	iounmap(hw->hw_addr);
-	pci_release_selected_regions(pdev,
-				     pci_select_bars(pdev, IORESOURCE_MEM));
+	pci_release_mem_regions(pdev);
 
 	pci_disable_pcie_error_reporting(pdev);
 	pci_disable_device(pdev);
-- 
1.8.5.6

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

* Re: [PATCH v2 5/6] ethernet/intel: Use pci_(request|release)_mem_regions
  2016-06-02  7:30 ` [PATCH v2 5/6] ethernet/intel: " Johannes Thumshirn
@ 2016-06-02 21:01   ` Jeff Kirsher
  0 siblings, 0 replies; 12+ messages in thread
From: Jeff Kirsher @ 2016-06-02 21:01 UTC (permalink / raw)
  To: Johannes Thumshirn, Bjorn Helgaas
  Cc: linux-pci, linux-kernel, Christoph Hellwig, David S. Miller,
	netdev, intel-wired-lan

[-- Attachment #1: Type: text/plain, Size: 976 bytes --]

On Thu, 2016-06-02 at 09:30 +0200, Johannes Thumshirn wrote:
> Now that we do have pci_request_mem_regions() and
> pci_release_mem_regions() at
> hand, use it in the Intel ethernet drivers.
> 
> Suggested-by: Christoph Hellwig <hch@infradead.org>
> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
> Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: netdev@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Cc: intel-wired-lan@lists.osuosl.org

Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

> ---
>  drivers/net/ethernet/intel/e1000e/netdev.c    |  6 ++----
>  drivers/net/ethernet/intel/fm10k/fm10k_pci.c  | 11 +++--------
>  drivers/net/ethernet/intel/i40e/i40e_main.c   |  9 +++------
>  drivers/net/ethernet/intel/igb/igb_main.c     | 10 +++-------
>  drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |  9 +++------
>  5 files changed, 14 insertions(+), 31 deletions(-)

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH v2 1/6] PCI: Add helpers to request/release memory and I/O regions
  2016-06-02  7:30 ` [PATCH v2 1/6] PCI: Add helpers to request/release memory and I/O regions Johannes Thumshirn
@ 2016-06-04 23:11   ` kbuild test robot
  2016-06-04 23:32   ` kbuild test robot
  1 sibling, 0 replies; 12+ messages in thread
From: kbuild test robot @ 2016-06-04 23:11 UTC (permalink / raw)
  To: Johannes Thumshirn
  Cc: kbuild-all, Bjorn Helgaas, linux-pci, linux-kernel,
	Christoph Hellwig, Johannes Thumshirn

[-- Attachment #1: Type: text/plain, Size: 2734 bytes --]

Hi,

[auto build test ERROR on jkirsher-next-queue/dev-queue]
[also build test ERROR on v4.7-rc1 next-20160603]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Johannes-Thumshirn/Introduce-pci_-request-release-_-mem-io-_regions/20160602-153400
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue.git dev-queue
config: arm-trizeps4_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 5.3.1-8) 5.3.1 20160205
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=arm 

All errors (new ones prefixed by >>):

   In file included from drivers/hwmon/hwmon.c:24:0:
   include/linux/pci.h: In function 'pci_request_io_regions':
   include/linux/pci.h:2021:9: error: implicit declaration of function 'pci_request_selected_regions' [-Werror=implicit-function-declaration]
     return pci_request_selected_regions(pdev,
            ^
   include/linux/pci.h:2022:8: error: implicit declaration of function 'pci_select_bars' [-Werror=implicit-function-declaration]
           pci_select_bars(pdev, IORESOURCE_IO), name);
           ^
   include/linux/pci.h: In function 'pci_release_io_regions':
>> include/linux/pci.h:2028:9: error: implicit declaration of function 'pci_release_selected_regions' [-Werror=implicit-function-declaration]
     return pci_release_selected_regions(pdev,
            ^
   include/linux/pci.h:2028:9: warning: 'return' with a value, in function returning void
   include/linux/pci.h: In function 'pci_release_mem_regions':
   include/linux/pci.h:2042:9: warning: 'return' with a value, in function returning void
     return pci_release_selected_regions(pdev,
            ^
   cc1: some warnings being treated as errors

vim +/pci_release_selected_regions +2028 include/linux/pci.h

  2015		return (pdev->dev_flags & PCI_DEV_FLAGS_ASSIGNED) == PCI_DEV_FLAGS_ASSIGNED;
  2016	}
  2017	
  2018	static inline int
  2019	pci_request_io_regions(struct pci_dev *pdev, const char *name)
  2020	{
> 2021		return pci_request_selected_regions(pdev,
  2022				    pci_select_bars(pdev, IORESOURCE_IO), name);
  2023	}
  2024	
  2025	static inline void
  2026	pci_release_io_regions(struct pci_dev *pdev)
  2027	{
> 2028		return pci_release_selected_regions(pdev,
  2029				    pci_select_bars(pdev, IORESOURCE_IO));
  2030	}
  2031	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 19358 bytes --]

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

* Re: [PATCH v2 1/6] PCI: Add helpers to request/release memory and I/O regions
  2016-06-02  7:30 ` [PATCH v2 1/6] PCI: Add helpers to request/release memory and I/O regions Johannes Thumshirn
  2016-06-04 23:11   ` kbuild test robot
@ 2016-06-04 23:32   ` kbuild test robot
  2016-06-06  8:14     ` Johannes Thumshirn
  1 sibling, 1 reply; 12+ messages in thread
From: kbuild test robot @ 2016-06-04 23:32 UTC (permalink / raw)
  To: Johannes Thumshirn
  Cc: kbuild-all, Bjorn Helgaas, linux-pci, linux-kernel,
	Christoph Hellwig, Johannes Thumshirn

[-- Attachment #1: Type: text/plain, Size: 2543 bytes --]

Hi,

[auto build test ERROR on jkirsher-next-queue/dev-queue]
[also build test ERROR on v4.7-rc1 next-20160603]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Johannes-Thumshirn/Introduce-pci_-request-release-_-mem-io-_regions/20160602-153400
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue.git dev-queue
config: mips-rt305x_defconfig (attached as .config)
compiler: mips-linux-gnu-gcc (Debian 5.3.1-8) 5.3.1 20160205
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=mips 

All errors (new ones prefixed by >>):

   In file included from lib/pci_iomap.c:6:0:
   include/linux/pci.h: In function 'pci_request_io_regions':
>> include/linux/pci.h:2021:9: error: implicit declaration of function 'pci_request_selected_regions' [-Werror=implicit-function-declaration]
     return pci_request_selected_regions(pdev,
            ^
>> include/linux/pci.h:2022:8: error: implicit declaration of function 'pci_select_bars' [-Werror=implicit-function-declaration]
           pci_select_bars(pdev, IORESOURCE_IO), name);
           ^
   include/linux/pci.h: In function 'pci_release_io_regions':
   include/linux/pci.h:2028:9: error: implicit declaration of function 'pci_release_selected_regions' [-Werror=implicit-function-declaration]
     return pci_release_selected_regions(pdev,
            ^
   include/linux/pci.h:2028:9: warning: 'return' with a value, in function returning void
   include/linux/pci.h: In function 'pci_release_mem_regions':
   include/linux/pci.h:2042:9: warning: 'return' with a value, in function returning void
     return pci_release_selected_regions(pdev,
            ^
   cc1: some warnings being treated as errors

vim +/pci_request_selected_regions +2021 include/linux/pci.h

  2015		return (pdev->dev_flags & PCI_DEV_FLAGS_ASSIGNED) == PCI_DEV_FLAGS_ASSIGNED;
  2016	}
  2017	
  2018	static inline int
  2019	pci_request_io_regions(struct pci_dev *pdev, const char *name)
  2020	{
> 2021		return pci_request_selected_regions(pdev,
> 2022				    pci_select_bars(pdev, IORESOURCE_IO), name);
  2023	}
  2024	
  2025	static inline void

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 7189 bytes --]

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

* Re: [PATCH v2 3/6] lpfc: Use pci_(request|release)_mem_regions
       [not found]   ` <CAGx+d6eHPKvOM_aYgv9qJvA1siJ89PzwHtK07U9tKs3yG7=O9w@mail.gmail.com>
@ 2016-06-06  8:12     ` Johannes Thumshirn
  0 siblings, 0 replies; 12+ messages in thread
From: Johannes Thumshirn @ 2016-06-06  8:12 UTC (permalink / raw)
  To: Dick Kennedy
  Cc: Bjorn Helgaas, linux-pci, linux-kernel, Christoph Hellwig,
	James Smart, Dick Kennedy, James E.J. Bottomley,
	Martin K. Petersen, linux-scsi

On Thu, Jun 02, 2016 at 07:57:43AM -0400, Dick Kennedy wrote:
> Thanks Johannes, it looks good.
Hi Dick, 

Can I use this as an Acked-by in the next submission?

Thanks,
	Johannes

> 
> On Thu, Jun 2, 2016 at 3:30 AM, Johannes Thumshirn <jthumshirn@suse.de>
> wrote:
> 
> > Now that we do have pci_request_mem_regions() and
> > pci_release_mem_regions() at
> > hand, use it in the lpfc driver.
> >
> > Suggested-by: Christoph Hellwig <hch@infradead.org>
> > Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
> > Cc: James Smart <james.smart@avagotech.com>
> > Cc: Dick Kennedy <dick.kennedy@avagotech.com>
> > Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>
> > Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
> > Cc: linux-scsi@vger.kernel.org
> > Cc: linux-kernel@vger.kernel.org
> > ---
> >  drivers/scsi/lpfc/lpfc_init.c | 15 ++++-----------
> >  1 file changed, 4 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
> > index f57d02c..a8735f7 100644
> > --- a/drivers/scsi/lpfc/lpfc_init.c
> > +++ b/drivers/scsi/lpfc/lpfc_init.c
> > @@ -4775,20 +4775,17 @@ static int
> >  lpfc_enable_pci_dev(struct lpfc_hba *phba)
> >  {
> >         struct pci_dev *pdev;
> > -       int bars = 0;
> >
> >         /* Obtain PCI device reference */
> >         if (!phba->pcidev)
> >                 goto out_error;
> >         else
> >                 pdev = phba->pcidev;
> > -       /* Select PCI BARs */
> > -       bars = pci_select_bars(pdev, IORESOURCE_MEM);
> >         /* Enable PCI device */
> >         if (pci_enable_device_mem(pdev))
> >                 goto out_error;
> >         /* Request PCI resource for the device */
> > -       if (pci_request_selected_regions(pdev, bars, LPFC_DRIVER_NAME))
> > +       if (pci_request_mem_regions(pdev, LPFC_DRIVER_NAME))
> >                 goto out_disable_device;
> >         /* Set up device as PCI master and save state for EEH */
> >         pci_set_master(pdev);
> > @@ -4805,7 +4802,7 @@ out_disable_device:
> >         pci_disable_device(pdev);
> >  out_error:
> >         lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
> > -                       "1401 Failed to enable pci device, bars:x%x\n",
> > bars);
> > +                       "1401 Failed to enable pci device\n");
> >         return -ENODEV;
> >  }
> >
> > @@ -4820,17 +4817,14 @@ static void
> >  lpfc_disable_pci_dev(struct lpfc_hba *phba)
> >  {
> >         struct pci_dev *pdev;
> > -       int bars;
> >
> >         /* Obtain PCI device reference */
> >         if (!phba->pcidev)
> >                 return;
> >         else
> >                 pdev = phba->pcidev;
> > -       /* Select PCI BARs */
> > -       bars = pci_select_bars(pdev, IORESOURCE_MEM);
> >         /* Release PCI resource and disable PCI device */
> > -       pci_release_selected_regions(pdev, bars);
> > +       pci_release_mem_regions(pdev);
> >         pci_disable_device(pdev);
> >
> >         return;
> > @@ -9705,7 +9699,6 @@ lpfc_pci_remove_one_s3(struct pci_dev *pdev)
> >         struct lpfc_vport **vports;
> >         struct lpfc_hba   *phba = vport->phba;
> >         int i;
> > -       int bars = pci_select_bars(pdev, IORESOURCE_MEM);
> >
> >         spin_lock_irq(&phba->hbalock);
> >         vport->load_flag |= FC_UNLOADING;
> > @@ -9780,7 +9773,7 @@ lpfc_pci_remove_one_s3(struct pci_dev *pdev)
> >
> >         lpfc_hba_free(phba);
> >
> > -       pci_release_selected_regions(pdev, bars);
> > +       pci_release_mem_regions(pdev);
> >         pci_disable_device(pdev);
> >  }
> >
> > --
> > 1.8.5.6
> >
> >

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

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

* Re: [PATCH v2 1/6] PCI: Add helpers to request/release memory and I/O regions
  2016-06-04 23:32   ` kbuild test robot
@ 2016-06-06  8:14     ` Johannes Thumshirn
  0 siblings, 0 replies; 12+ messages in thread
From: Johannes Thumshirn @ 2016-06-06  8:14 UTC (permalink / raw)
  To: kbuild test robot
  Cc: kbuild-all, Bjorn Helgaas, linux-pci, linux-kernel, Christoph Hellwig

On Sun, Jun 05, 2016 at 07:32:13AM +0800, kbuild test robot wrote:
> Hi,
> 
> [auto build test ERROR on jkirsher-next-queue/dev-queue]
> [also build test ERROR on v4.7-rc1 next-20160603]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
> 
> url:    https://github.com/0day-ci/linux/commits/Johannes-Thumshirn/Introduce-pci_-request-release-_-mem-io-_regions/20160602-153400
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue.git dev-queue
> config: mips-rt305x_defconfig (attached as .config)
> compiler: mips-linux-gnu-gcc (Debian 5.3.1-8) 5.3.1 20160205
> reproduce:
>         wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # save the attached .config to linux build tree
>         make.cross ARCH=mips 
> 
> All errors (new ones prefixed by >>):
> 
>    In file included from lib/pci_iomap.c:6:0:
>    include/linux/pci.h: In function 'pci_request_io_regions':
> >> include/linux/pci.h:2021:9: error: implicit declaration of function 'pci_request_selected_regions' [-Werror=implicit-function-declaration]
>      return pci_request_selected_regions(pdev,
>             ^
> >> include/linux/pci.h:2022:8: error: implicit declaration of function 'pci_select_bars' [-Werror=implicit-function-declaration]
>            pci_select_bars(pdev, IORESOURCE_IO), name);
>            ^
>    include/linux/pci.h: In function 'pci_release_io_regions':
>    include/linux/pci.h:2028:9: error: implicit declaration of function 'pci_release_selected_regions' [-Werror=implicit-function-declaration]
>      return pci_release_selected_regions(pdev,
>             ^
>    include/linux/pci.h:2028:9: warning: 'return' with a value, in function returning void
>    include/linux/pci.h: In function 'pci_release_mem_regions':
>    include/linux/pci.h:2042:9: warning: 'return' with a value, in function returning void
>      return pci_release_selected_regions(pdev,
>             ^
>    cc1: some warnings being treated as errors
> 
> vim +/pci_request_selected_regions +2021 include/linux/pci.h
> 
>   2015		return (pdev->dev_flags & PCI_DEV_FLAGS_ASSIGNED) == PCI_DEV_FLAGS_ASSIGNED;
>   2016	}
>   2017	
>   2018	static inline int
>   2019	pci_request_io_regions(struct pci_dev *pdev, const char *name)
>   2020	{
> > 2021		return pci_request_selected_regions(pdev,
> > 2022				    pci_select_bars(pdev, IORESOURCE_IO), name);
>   2023	}
>   2024	
>   2025	static inline void
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Problem got addressed, waiting for an reply from Dick Kenedy on the lpfc patch
before re-submission,

Thanks for reporting,
	Johannes
-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

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

end of thread, other threads:[~2016-06-06  8:14 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-02  7:30 [PATCH v2 0/6] Introduce pci_(request|release)_(mem|io)_regions Johannes Thumshirn
2016-06-02  7:30 ` [PATCH v2 1/6] PCI: Add helpers to request/release memory and I/O regions Johannes Thumshirn
2016-06-04 23:11   ` kbuild test robot
2016-06-04 23:32   ` kbuild test robot
2016-06-06  8:14     ` Johannes Thumshirn
2016-06-02  7:30 ` [PATCH v2 2/6] NVMe: Use pci_(request|release)_mem_regions Johannes Thumshirn
2016-06-02  7:30 ` [PATCH v2 3/6] lpfc: " Johannes Thumshirn
     [not found]   ` <CAGx+d6eHPKvOM_aYgv9qJvA1siJ89PzwHtK07U9tKs3yG7=O9w@mail.gmail.com>
2016-06-06  8:12     ` Johannes Thumshirn
2016-06-02  7:30 ` [PATCH v2 4/6] GenWQE: " Johannes Thumshirn
2016-06-02  7:30 ` [PATCH v2 5/6] ethernet/intel: " Johannes Thumshirn
2016-06-02 21:01   ` Jeff Kirsher
2016-06-02  7:30 ` [PATCH v2 6/6] alx: " Johannes Thumshirn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).