* [PATCH 01/10] PCI: Make pcim_request_all_regions() a public function
2024-08-01 17:45 [PATCH 00/10] Remove pcim_iomap_regions_request_all() Philipp Stanner
@ 2024-08-01 17:45 ` Philipp Stanner
2024-08-02 0:42 ` Damien Le Moal
2024-08-01 17:46 ` [PATCH 02/10] ata: ahci: Replace deprecated PCI functions Philipp Stanner
` (8 subsequent siblings)
9 siblings, 1 reply; 20+ messages in thread
From: Philipp Stanner @ 2024-08-01 17:45 UTC (permalink / raw)
To: Jonathan Corbet, Damien Le Moal, Niklas Cassel, Giovanni Cabiddu,
Herbert Xu, David S. Miller, Boris Brezillon, Arnaud Ebalard,
Srujana Challa, Alexander Shishkin, Miri Korenblit, Kalle Valo,
Serge Semin, Jon Mason, Dave Jiang, Allen Hubbe, Bjorn Helgaas,
Kevin Cernekee, Greg Kroah-Hartman, Jiri Slaby, Jaroslav Kysela,
Takashi Iwai, Mark Brown, David Lechner, Uwe Kleine-König,
Jonathan Cameron, Andy Shevchenko, Philipp Stanner, Jie Wang,
Adam Guerin, Shashank Gupta, Damian Muszynski, Nithin Dabilpuram,
Bharat Bhushan, Johannes Berg, Gregory Greenman,
Emmanuel Grumbach, Yedidya Benshimol, Breno Leitao,
Ilpo Järvinen, John Ogness, Thomas Gleixner
Cc: linux-doc, linux-kernel, linux-ide, qat-linux, linux-crypto,
linux-wireless, ntb, linux-pci, linux-serial, linux-sound
In order to remove the deprecated function
pcim_iomap_regions_request_all(), a few drivers need an interface to
request all BARs a PCI-Device offers.
Make pcim_request_all_regions() a public interface.
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
---
drivers/pci/devres.c | 3 ++-
include/linux/pci.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c
index 3780a9f9ec00..0ec2b23e6cac 100644
--- a/drivers/pci/devres.c
+++ b/drivers/pci/devres.c
@@ -932,7 +932,7 @@ static void pcim_release_all_regions(struct pci_dev *pdev)
* desired, release individual regions with pcim_release_region() or all of
* them at once with pcim_release_all_regions().
*/
-static int pcim_request_all_regions(struct pci_dev *pdev, const char *name)
+int pcim_request_all_regions(struct pci_dev *pdev, const char *name)
{
int ret;
int bar;
@@ -950,6 +950,7 @@ static int pcim_request_all_regions(struct pci_dev *pdev, const char *name)
return ret;
}
+EXPORT_SYMBOL(pcim_request_all_regions);
/**
* pcim_iomap_regions_request_all - Request all BARs and iomap specified ones
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 4cf89a4b4cbc..5b5856ba63e1 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -2289,6 +2289,7 @@ static inline void pci_fixup_device(enum pci_fixup_pass pass,
struct pci_dev *dev) { }
#endif
+int pcim_request_all_regions(struct pci_dev *pdev, const char *name);
void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen);
void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr);
void __iomem * const *pcim_iomap_table(struct pci_dev *pdev);
--
2.45.2
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [PATCH 01/10] PCI: Make pcim_request_all_regions() a public function
2024-08-01 17:45 ` [PATCH 01/10] PCI: Make pcim_request_all_regions() a public function Philipp Stanner
@ 2024-08-02 0:42 ` Damien Le Moal
0 siblings, 0 replies; 20+ messages in thread
From: Damien Le Moal @ 2024-08-02 0:42 UTC (permalink / raw)
To: Philipp Stanner, Jonathan Corbet, Niklas Cassel, Giovanni Cabiddu,
Herbert Xu, David S. Miller, Boris Brezillon, Arnaud Ebalard,
Srujana Challa, Alexander Shishkin, Miri Korenblit, Kalle Valo,
Serge Semin, Jon Mason, Dave Jiang, Allen Hubbe, Bjorn Helgaas,
Kevin Cernekee, Greg Kroah-Hartman, Jiri Slaby, Jaroslav Kysela,
Takashi Iwai, Mark Brown, David Lechner, Uwe Kleine-König,
Jonathan Cameron, Andy Shevchenko, Jie Wang, Adam Guerin,
Shashank Gupta, Damian Muszynski, Nithin Dabilpuram,
Bharat Bhushan, Johannes Berg, Gregory Greenman,
Emmanuel Grumbach, Yedidya Benshimol, Breno Leitao,
Ilpo Järvinen, John Ogness, Thomas Gleixner
Cc: linux-doc, linux-kernel, linux-ide, qat-linux, linux-crypto,
linux-wireless, ntb, linux-pci, linux-serial, linux-sound
On 8/2/24 02:45, Philipp Stanner wrote:
> In order to remove the deprecated function
> pcim_iomap_regions_request_all(), a few drivers need an interface to
> request all BARs a PCI-Device offers.
>
> Make pcim_request_all_regions() a public interface.
>
> Signed-off-by: Philipp Stanner <pstanner@redhat.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 02/10] ata: ahci: Replace deprecated PCI functions
2024-08-01 17:45 [PATCH 00/10] Remove pcim_iomap_regions_request_all() Philipp Stanner
2024-08-01 17:45 ` [PATCH 01/10] PCI: Make pcim_request_all_regions() a public function Philipp Stanner
@ 2024-08-01 17:46 ` Philipp Stanner
2024-08-02 0:43 ` Damien Le Moal
2024-08-01 17:46 ` [PATCH 03/10] crypto: qat - replace " Philipp Stanner
` (7 subsequent siblings)
9 siblings, 1 reply; 20+ messages in thread
From: Philipp Stanner @ 2024-08-01 17:46 UTC (permalink / raw)
To: Jonathan Corbet, Damien Le Moal, Niklas Cassel, Giovanni Cabiddu,
Herbert Xu, David S. Miller, Boris Brezillon, Arnaud Ebalard,
Srujana Challa, Alexander Shishkin, Miri Korenblit, Kalle Valo,
Serge Semin, Jon Mason, Dave Jiang, Allen Hubbe, Bjorn Helgaas,
Kevin Cernekee, Greg Kroah-Hartman, Jiri Slaby, Jaroslav Kysela,
Takashi Iwai, Mark Brown, David Lechner, Uwe Kleine-König,
Jonathan Cameron, Andy Shevchenko, Philipp Stanner, Jie Wang,
Adam Guerin, Shashank Gupta, Damian Muszynski, Nithin Dabilpuram,
Bharat Bhushan, Johannes Berg, Gregory Greenman,
Emmanuel Grumbach, Yedidya Benshimol, Breno Leitao,
Ilpo Järvinen, John Ogness, Thomas Gleixner
Cc: linux-doc, linux-kernel, linux-ide, qat-linux, linux-crypto,
linux-wireless, ntb, linux-pci, linux-serial, linux-sound
pcim_iomap_regions_request_all() and pcim_iomap_table() have been
deprecated by the PCI subsystem in commit e354bb84a4c1 ("PCI: Deprecate
pcim_iomap_table(), pcim_iomap_regions_request_all()").
Replace these functions with their successors, pcim_iomap() and
pcim_request_all_regions()
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
---
drivers/ata/acard-ahci.c | 6 ++++--
drivers/ata/ahci.c | 6 ++++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/ata/acard-ahci.c b/drivers/ata/acard-ahci.c
index 547f56341705..3999305b5356 100644
--- a/drivers/ata/acard-ahci.c
+++ b/drivers/ata/acard-ahci.c
@@ -370,7 +370,7 @@ static int acard_ahci_init_one(struct pci_dev *pdev, const struct pci_device_id
/* AHCI controllers often implement SFF compatible interface.
* Grab all PCI BARs just in case.
*/
- rc = pcim_iomap_regions_request_all(pdev, 1 << AHCI_PCI_BAR, DRV_NAME);
+ rc = pcim_request_all_regions(pdev, DRV_NAME);
if (rc == -EBUSY)
pcim_pin_device(pdev);
if (rc)
@@ -386,7 +386,9 @@ static int acard_ahci_init_one(struct pci_dev *pdev, const struct pci_device_id
if (!(hpriv->flags & AHCI_HFLAG_NO_MSI))
pci_enable_msi(pdev);
- hpriv->mmio = pcim_iomap_table(pdev)[AHCI_PCI_BAR];
+ hpriv->mmio = pcim_iomap(pdev, AHCI_PCI_BAR, 0);
+ if (!hpriv->mmio)
+ return -ENOMEM;
/* save initial config */
ahci_save_initial_config(&pdev->dev, hpriv);
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index a05c17249448..905af6b68d80 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1869,7 +1869,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
/* AHCI controllers often implement SFF compatible interface.
* Grab all PCI BARs just in case.
*/
- rc = pcim_iomap_regions_request_all(pdev, 1 << ahci_pci_bar, DRV_NAME);
+ rc = pcim_request_all_regions(pdev, DRV_NAME);
if (rc == -EBUSY)
pcim_pin_device(pdev);
if (rc)
@@ -1893,7 +1893,9 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (ahci_sb600_enable_64bit(pdev))
hpriv->flags &= ~AHCI_HFLAG_32BIT_ONLY;
- hpriv->mmio = pcim_iomap_table(pdev)[ahci_pci_bar];
+ hpriv->mmio = pcim_iomap(pdev, ahci_pci_bar, 0);
+ if (!hpriv->mmio)
+ return -ENOMEM;
/* detect remapped nvme devices */
ahci_remap_check(pdev, ahci_pci_bar, hpriv);
--
2.45.2
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [PATCH 02/10] ata: ahci: Replace deprecated PCI functions
2024-08-01 17:46 ` [PATCH 02/10] ata: ahci: Replace deprecated PCI functions Philipp Stanner
@ 2024-08-02 0:43 ` Damien Le Moal
0 siblings, 0 replies; 20+ messages in thread
From: Damien Le Moal @ 2024-08-02 0:43 UTC (permalink / raw)
To: Philipp Stanner, Jonathan Corbet, Niklas Cassel, Giovanni Cabiddu,
Herbert Xu, David S. Miller, Boris Brezillon, Arnaud Ebalard,
Srujana Challa, Alexander Shishkin, Miri Korenblit, Kalle Valo,
Serge Semin, Jon Mason, Dave Jiang, Allen Hubbe, Bjorn Helgaas,
Kevin Cernekee, Greg Kroah-Hartman, Jiri Slaby, Jaroslav Kysela,
Takashi Iwai, Mark Brown, David Lechner, Uwe Kleine-König,
Jonathan Cameron, Andy Shevchenko, Jie Wang, Adam Guerin,
Shashank Gupta, Damian Muszynski, Nithin Dabilpuram,
Bharat Bhushan, Johannes Berg, Gregory Greenman,
Emmanuel Grumbach, Yedidya Benshimol, Breno Leitao,
Ilpo Järvinen, John Ogness, Thomas Gleixner
Cc: linux-doc, linux-kernel, linux-ide, qat-linux, linux-crypto,
linux-wireless, ntb, linux-pci, linux-serial, linux-sound
On 8/2/24 02:46, Philipp Stanner wrote:
> pcim_iomap_regions_request_all() and pcim_iomap_table() have been
> deprecated by the PCI subsystem in commit e354bb84a4c1 ("PCI: Deprecate
> pcim_iomap_table(), pcim_iomap_regions_request_all()").
>
> Replace these functions with their successors, pcim_iomap() and
> pcim_request_all_regions()
>
> Signed-off-by: Philipp Stanner <pstanner@redhat.com>
Acked-by: Damien Le Moal <dlemoal@kernel.org>
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 03/10] crypto: qat - replace deprecated PCI functions
2024-08-01 17:45 [PATCH 00/10] Remove pcim_iomap_regions_request_all() Philipp Stanner
2024-08-01 17:45 ` [PATCH 01/10] PCI: Make pcim_request_all_regions() a public function Philipp Stanner
2024-08-01 17:46 ` [PATCH 02/10] ata: ahci: Replace deprecated PCI functions Philipp Stanner
@ 2024-08-01 17:46 ` Philipp Stanner
2024-08-01 17:46 ` [PATCH 04/10] crypto: marvell " Philipp Stanner
` (6 subsequent siblings)
9 siblings, 0 replies; 20+ messages in thread
From: Philipp Stanner @ 2024-08-01 17:46 UTC (permalink / raw)
To: Jonathan Corbet, Damien Le Moal, Niklas Cassel, Giovanni Cabiddu,
Herbert Xu, David S. Miller, Boris Brezillon, Arnaud Ebalard,
Srujana Challa, Alexander Shishkin, Miri Korenblit, Kalle Valo,
Serge Semin, Jon Mason, Dave Jiang, Allen Hubbe, Bjorn Helgaas,
Kevin Cernekee, Greg Kroah-Hartman, Jiri Slaby, Jaroslav Kysela,
Takashi Iwai, Mark Brown, David Lechner, Uwe Kleine-König,
Jonathan Cameron, Andy Shevchenko, Philipp Stanner, Jie Wang,
Adam Guerin, Shashank Gupta, Damian Muszynski, Nithin Dabilpuram,
Bharat Bhushan, Johannes Berg, Gregory Greenman,
Emmanuel Grumbach, Yedidya Benshimol, Breno Leitao,
Ilpo Järvinen, John Ogness, Thomas Gleixner
Cc: linux-doc, linux-kernel, linux-ide, qat-linux, linux-crypto,
linux-wireless, ntb, linux-pci, linux-serial, linux-sound
pcim_iomap_table() and pcim_iomap_regions_request_all() have been
deprecated by the PCI subsystem in commit e354bb84a4c1 ("PCI: Deprecate
pcim_iomap_table(), pcim_iomap_regions_request_all()").
Replace these functions with their successors, pcim_iomap() and
pcim_request_all_regions()
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
---
drivers/crypto/intel/qat/qat_420xx/adf_drv.c | 11 ++++++++---
drivers/crypto/intel/qat/qat_4xxx/adf_drv.c | 11 ++++++++---
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/drivers/crypto/intel/qat/qat_420xx/adf_drv.c b/drivers/crypto/intel/qat/qat_420xx/adf_drv.c
index 2a3598409eeb..c9edae8fdb04 100644
--- a/drivers/crypto/intel/qat/qat_420xx/adf_drv.c
+++ b/drivers/crypto/intel/qat/qat_420xx/adf_drv.c
@@ -129,16 +129,21 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/* Find and map all the device's BARS */
bar_mask = pci_select_bars(pdev, IORESOURCE_MEM) & ADF_GEN4_BAR_MASK;
- ret = pcim_iomap_regions_request_all(pdev, bar_mask, pci_name(pdev));
+ ret = pcim_request_all_regions(pdev, pci_name(pdev));
if (ret) {
- dev_err(&pdev->dev, "Failed to map pci regions.\n");
+ dev_err(&pdev->dev, "Failed to request PCI regions.\n");
goto out_err;
}
i = 0;
for_each_set_bit(bar_nr, &bar_mask, PCI_STD_NUM_BARS) {
bar = &accel_pci_dev->pci_bars[i++];
- bar->virt_addr = pcim_iomap_table(pdev)[bar_nr];
+ bar->virt_addr = pcim_iomap(pdev, bar_nr, 0);
+ if (!bar->virt_addr) {
+ dev_err(&pdev->dev, "Failed to ioremap PCI region.\n");
+ ret = -ENOMEM;
+ goto out_err;
+ }
}
pci_set_master(pdev);
diff --git a/drivers/crypto/intel/qat/qat_4xxx/adf_drv.c b/drivers/crypto/intel/qat/qat_4xxx/adf_drv.c
index d26564cebdec..18d8819f1795 100644
--- a/drivers/crypto/intel/qat/qat_4xxx/adf_drv.c
+++ b/drivers/crypto/intel/qat/qat_4xxx/adf_drv.c
@@ -131,16 +131,21 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/* Find and map all the device's BARS */
bar_mask = pci_select_bars(pdev, IORESOURCE_MEM) & ADF_GEN4_BAR_MASK;
- ret = pcim_iomap_regions_request_all(pdev, bar_mask, pci_name(pdev));
+ ret = pcim_request_all_regions(pdev, pci_name(pdev));
if (ret) {
- dev_err(&pdev->dev, "Failed to map pci regions.\n");
+ dev_err(&pdev->dev, "Failed to request PCI regions.\n");
goto out_err;
}
i = 0;
for_each_set_bit(bar_nr, &bar_mask, PCI_STD_NUM_BARS) {
bar = &accel_pci_dev->pci_bars[i++];
- bar->virt_addr = pcim_iomap_table(pdev)[bar_nr];
+ bar->virt_addr = pcim_iomap(pdev, bar_nr, 0);
+ if (!bar->virt_addr) {
+ dev_err(&pdev->dev, "Failed to ioremap PCI region.\n");
+ ret = -ENOMEM;
+ goto out_err;
+ }
}
pci_set_master(pdev);
--
2.45.2
^ permalink raw reply related [flat|nested] 20+ messages in thread* [PATCH 04/10] crypto: marvell - replace deprecated PCI functions
2024-08-01 17:45 [PATCH 00/10] Remove pcim_iomap_regions_request_all() Philipp Stanner
` (2 preceding siblings ...)
2024-08-01 17:46 ` [PATCH 03/10] crypto: qat - replace " Philipp Stanner
@ 2024-08-01 17:46 ` Philipp Stanner
2024-08-02 7:29 ` Philipp Stanner
2024-08-01 17:46 ` [PATCH 05/10] intel_th: pci: Replace " Philipp Stanner
` (5 subsequent siblings)
9 siblings, 1 reply; 20+ messages in thread
From: Philipp Stanner @ 2024-08-01 17:46 UTC (permalink / raw)
To: Jonathan Corbet, Damien Le Moal, Niklas Cassel, Giovanni Cabiddu,
Herbert Xu, David S. Miller, Boris Brezillon, Arnaud Ebalard,
Srujana Challa, Alexander Shishkin, Miri Korenblit, Kalle Valo,
Serge Semin, Jon Mason, Dave Jiang, Allen Hubbe, Bjorn Helgaas,
Kevin Cernekee, Greg Kroah-Hartman, Jiri Slaby, Jaroslav Kysela,
Takashi Iwai, Mark Brown, David Lechner, Uwe Kleine-König,
Jonathan Cameron, Andy Shevchenko, Philipp Stanner, Jie Wang,
Adam Guerin, Shashank Gupta, Damian Muszynski, Nithin Dabilpuram,
Bharat Bhushan, Johannes Berg, Gregory Greenman,
Emmanuel Grumbach, Yedidya Benshimol, Breno Leitao,
Ilpo Järvinen, John Ogness, Thomas Gleixner
Cc: linux-doc, linux-kernel, linux-ide, qat-linux, linux-crypto,
linux-wireless, ntb, linux-pci, linux-serial, linux-sound
pcim_iomap_table() and pcim_iomap_regions_request_all() have been
deprecated by the PCI subsystem in commit e354bb84a4c1 ("PCI: Deprecate
pcim_iomap_table(), pcim_iomap_regions_request_all()").
Replace these functions with their successors, pcim_iomap() and
pcim_request_all_regions()
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
---
drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c | 14 +++++++++-----
drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c | 13 +++++++++----
2 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c b/drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c
index 400e36d9908f..ace39b2f2627 100644
--- a/drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c
+++ b/drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c
@@ -739,18 +739,22 @@ static int otx2_cptpf_probe(struct pci_dev *pdev,
dev_err(dev, "Unable to get usable DMA configuration\n");
goto clear_drvdata;
}
- /* Map PF's configuration registers */
- err = pcim_iomap_regions_request_all(pdev, 1 << PCI_PF_REG_BAR_NUM,
- OTX2_CPT_DRV_NAME);
+ err = pcim_request_all_regions(pdev, OTX2_CPT_DRV_NAME);
if (err) {
- dev_err(dev, "Couldn't get PCI resources 0x%x\n", err);
+ dev_err(dev, "Couldn't request PCI resources 0x%x\n", err);
goto clear_drvdata;
}
pci_set_master(pdev);
pci_set_drvdata(pdev, cptpf);
cptpf->pdev = pdev;
- cptpf->reg_base = pcim_iomap_table(pdev)[PCI_PF_REG_BAR_NUM];
+ /* Map PF's configuration registers */
+ cptpf->reg_base = pcim_iomap(pdev, PCI_PF_REG_BAR_NUM, 0);
+ if (!cptpf->reg_base) {
+ dev_err(dev, "Couldn't ioremap PCI resource 0x%x\n", err);
+ err = -ENOMEM;
+ goto clear_drvdata;
+ }
/* Check if AF driver is up, otherwise defer probe */
err = cpt_is_pf_usable(cptpf);
diff --git a/drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c b/drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c
index 527d34cc258b..e2210bf9605a 100644
--- a/drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c
+++ b/drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c
@@ -358,9 +358,8 @@ static int otx2_cptvf_probe(struct pci_dev *pdev,
dev_err(dev, "Unable to get usable DMA configuration\n");
goto clear_drvdata;
}
- /* Map VF's configuration registers */
- ret = pcim_iomap_regions_request_all(pdev, 1 << PCI_PF_REG_BAR_NUM,
- OTX2_CPTVF_DRV_NAME);
+
+ ret = pcim_request_all_regions(pdev, OTX2_CPTVF_DRV_NAME);
if (ret) {
dev_err(dev, "Couldn't get PCI resources 0x%x\n", ret);
goto clear_drvdata;
@@ -369,7 +368,13 @@ static int otx2_cptvf_probe(struct pci_dev *pdev,
pci_set_drvdata(pdev, cptvf);
cptvf->pdev = pdev;
- cptvf->reg_base = pcim_iomap_table(pdev)[PCI_PF_REG_BAR_NUM];
+ /* Map VF's configuration registers */
+ cptvf->reg_base = pcim_iomap(pdev, PCI_PF_REG_BAR_NUM, 0);
+ if (!cptvf->reg_base) {
+ dev_err(dev, "Couldn't ioremap PCI resource 0x%x\n", ret);
+ ret = -ENOMEM;
+ goto clear_drvdata;
+ }
otx2_cpt_set_hw_caps(pdev, &cptvf->cap_flag);
--
2.45.2
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [PATCH 04/10] crypto: marvell - replace deprecated PCI functions
2024-08-01 17:46 ` [PATCH 04/10] crypto: marvell " Philipp Stanner
@ 2024-08-02 7:29 ` Philipp Stanner
0 siblings, 0 replies; 20+ messages in thread
From: Philipp Stanner @ 2024-08-02 7:29 UTC (permalink / raw)
To: Jonathan Corbet, Damien Le Moal, Niklas Cassel, Giovanni Cabiddu,
Herbert Xu, David S. Miller, Boris Brezillon, Arnaud Ebalard,
Srujana Challa, Alexander Shishkin, Miri Korenblit, Kalle Valo,
Serge Semin, Jon Mason, Dave Jiang, Allen Hubbe, Bjorn Helgaas,
Kevin Cernekee, Greg Kroah-Hartman, Jiri Slaby, Jaroslav Kysela,
Takashi Iwai, Mark Brown, David Lechner, Uwe Kleine-König,
Jonathan Cameron, Andy Shevchenko, Jie Wang, Adam Guerin,
Shashank Gupta, Damian Muszynski, Nithin Dabilpuram,
Bharat Bhushan, Johannes Berg, Gregory Greenman,
Emmanuel Grumbach, Yedidya Benshimol, Breno Leitao,
Ilpo Järvinen, John Ogness, Thomas Gleixner
Cc: linux-doc, linux-kernel, linux-ide, qat-linux, linux-crypto,
linux-wireless, ntb, linux-pci, linux-serial, linux-sound
On Thu, 2024-08-01 at 19:46 +0200, Philipp Stanner wrote:
> pcim_iomap_table() and pcim_iomap_regions_request_all() have been
> deprecated by the PCI subsystem in commit e354bb84a4c1 ("PCI:
> Deprecate
> pcim_iomap_table(), pcim_iomap_regions_request_all()").
>
> Replace these functions with their successors, pcim_iomap() and
> pcim_request_all_regions()
>
> Signed-off-by: Philipp Stanner <pstanner@redhat.com>
> ---
> drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c | 14 +++++++++---
> --
> drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c | 13 +++++++++---
> -
> 2 files changed, 18 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c
> b/drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c
> index 400e36d9908f..ace39b2f2627 100644
> --- a/drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c
> +++ b/drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c
> @@ -739,18 +739,22 @@ static int otx2_cptpf_probe(struct pci_dev
> *pdev,
> dev_err(dev, "Unable to get usable DMA
> configuration\n");
> goto clear_drvdata;
> }
> - /* Map PF's configuration registers */
> - err = pcim_iomap_regions_request_all(pdev, 1 <<
> PCI_PF_REG_BAR_NUM,
> - OTX2_CPT_DRV_NAME);
> + err = pcim_request_all_regions(pdev, OTX2_CPT_DRV_NAME);
> if (err) {
> - dev_err(dev, "Couldn't get PCI resources 0x%x\n",
> err);
> + dev_err(dev, "Couldn't request PCI resources
> 0x%x\n", err);
> goto clear_drvdata;
> }
> pci_set_master(pdev);
> pci_set_drvdata(pdev, cptpf);
> cptpf->pdev = pdev;
>
> - cptpf->reg_base =
> pcim_iomap_table(pdev)[PCI_PF_REG_BAR_NUM];
> + /* Map PF's configuration registers */
> + cptpf->reg_base = pcim_iomap(pdev, PCI_PF_REG_BAR_NUM, 0);
> + if (!cptpf->reg_base) {
> + dev_err(dev, "Couldn't ioremap PCI resource 0x%x\n",
> err);
> + err = -ENOMEM;
Just saw I messed that one up. err has to be set before printing it, of
course. Will fix that in a v2.
> + goto clear_drvdata;
> + }
>
> /* Check if AF driver is up, otherwise defer probe */
> err = cpt_is_pf_usable(cptpf);
> diff --git a/drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c
> b/drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c
> index 527d34cc258b..e2210bf9605a 100644
> --- a/drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c
> +++ b/drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c
> @@ -358,9 +358,8 @@ static int otx2_cptvf_probe(struct pci_dev *pdev,
> dev_err(dev, "Unable to get usable DMA
> configuration\n");
> goto clear_drvdata;
> }
> - /* Map VF's configuration registers */
> - ret = pcim_iomap_regions_request_all(pdev, 1 <<
> PCI_PF_REG_BAR_NUM,
> - OTX2_CPTVF_DRV_NAME);
> +
> + ret = pcim_request_all_regions(pdev, OTX2_CPTVF_DRV_NAME);
> if (ret) {
> dev_err(dev, "Couldn't get PCI resources 0x%x\n",
> ret);
> goto clear_drvdata;
> @@ -369,7 +368,13 @@ static int otx2_cptvf_probe(struct pci_dev
> *pdev,
> pci_set_drvdata(pdev, cptvf);
> cptvf->pdev = pdev;
>
> - cptvf->reg_base =
> pcim_iomap_table(pdev)[PCI_PF_REG_BAR_NUM];
> + /* Map VF's configuration registers */
> + cptvf->reg_base = pcim_iomap(pdev, PCI_PF_REG_BAR_NUM, 0);
> + if (!cptvf->reg_base) {
> + dev_err(dev, "Couldn't ioremap PCI resource 0x%x\n",
> ret);
> + ret = -ENOMEM;
Same here.
P.
> + goto clear_drvdata;
> + }
>
> otx2_cpt_set_hw_caps(pdev, &cptvf->cap_flag);
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 05/10] intel_th: pci: Replace deprecated PCI functions
2024-08-01 17:45 [PATCH 00/10] Remove pcim_iomap_regions_request_all() Philipp Stanner
` (3 preceding siblings ...)
2024-08-01 17:46 ` [PATCH 04/10] crypto: marvell " Philipp Stanner
@ 2024-08-01 17:46 ` Philipp Stanner
2024-08-01 17:46 ` [PATCH 06/10] wifi: iwlwifi: replace " Philipp Stanner
` (4 subsequent siblings)
9 siblings, 0 replies; 20+ messages in thread
From: Philipp Stanner @ 2024-08-01 17:46 UTC (permalink / raw)
To: Jonathan Corbet, Damien Le Moal, Niklas Cassel, Giovanni Cabiddu,
Herbert Xu, David S. Miller, Boris Brezillon, Arnaud Ebalard,
Srujana Challa, Alexander Shishkin, Miri Korenblit, Kalle Valo,
Serge Semin, Jon Mason, Dave Jiang, Allen Hubbe, Bjorn Helgaas,
Kevin Cernekee, Greg Kroah-Hartman, Jiri Slaby, Jaroslav Kysela,
Takashi Iwai, Mark Brown, David Lechner, Uwe Kleine-König,
Jonathan Cameron, Andy Shevchenko, Philipp Stanner, Jie Wang,
Adam Guerin, Shashank Gupta, Damian Muszynski, Nithin Dabilpuram,
Bharat Bhushan, Johannes Berg, Gregory Greenman,
Emmanuel Grumbach, Yedidya Benshimol, Breno Leitao,
Ilpo Järvinen, John Ogness, Thomas Gleixner
Cc: linux-doc, linux-kernel, linux-ide, qat-linux, linux-crypto,
linux-wireless, ntb, linux-pci, linux-serial, linux-sound
pcim_iomap_table() and pcim_iomap_regions_request_all() have been
deprecated by the PCI subsystem in commit e354bb84a4c1 ("PCI: Deprecate
pcim_iomap_table(), pcim_iomap_regions_request_all()").
Replace these functions with their successors, pcim_iomap() and
pcim_request_all_regions()
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
---
drivers/hwtracing/intel_th/pci.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/hwtracing/intel_th/pci.c b/drivers/hwtracing/intel_th/pci.c
index 0d7b9839e5b6..e9d8d28e055f 100644
--- a/drivers/hwtracing/intel_th/pci.c
+++ b/drivers/hwtracing/intel_th/pci.c
@@ -23,7 +23,6 @@ enum {
TH_PCI_RTIT_BAR = 4,
};
-#define BAR_MASK (BIT(TH_PCI_CONFIG_BAR) | BIT(TH_PCI_STH_SW_BAR))
#define PCI_REG_NPKDSC 0x80
#define NPKDSC_TSACT BIT(5)
@@ -83,10 +82,16 @@ static int intel_th_pci_probe(struct pci_dev *pdev,
if (err)
return err;
- err = pcim_iomap_regions_request_all(pdev, BAR_MASK, DRIVER_NAME);
+ err = pcim_request_all_regions(pdev, DRIVER_NAME);
if (err)
return err;
+ if (!pcim_iomap(pdev, TH_PCI_CONFIG_BAR, 0))
+ return -ENOMEM;
+
+ if (!pcim_iomap(pdev, TH_PCI_STH_SW_BAR, 0))
+ return -ENOMEM;
+
if (pdev->resource[TH_PCI_RTIT_BAR].start) {
resource[TH_MMIO_RTIT] = pdev->resource[TH_PCI_RTIT_BAR];
r++;
--
2.45.2
^ permalink raw reply related [flat|nested] 20+ messages in thread* [PATCH 06/10] wifi: iwlwifi: replace deprecated PCI functions
2024-08-01 17:45 [PATCH 00/10] Remove pcim_iomap_regions_request_all() Philipp Stanner
` (4 preceding siblings ...)
2024-08-01 17:46 ` [PATCH 05/10] intel_th: pci: Replace " Philipp Stanner
@ 2024-08-01 17:46 ` Philipp Stanner
2024-08-01 17:46 ` [PATCH 07/10] ntb: idt: Replace " Philipp Stanner
` (3 subsequent siblings)
9 siblings, 0 replies; 20+ messages in thread
From: Philipp Stanner @ 2024-08-01 17:46 UTC (permalink / raw)
To: Jonathan Corbet, Damien Le Moal, Niklas Cassel, Giovanni Cabiddu,
Herbert Xu, David S. Miller, Boris Brezillon, Arnaud Ebalard,
Srujana Challa, Alexander Shishkin, Miri Korenblit, Kalle Valo,
Serge Semin, Jon Mason, Dave Jiang, Allen Hubbe, Bjorn Helgaas,
Kevin Cernekee, Greg Kroah-Hartman, Jiri Slaby, Jaroslav Kysela,
Takashi Iwai, Mark Brown, David Lechner, Uwe Kleine-König,
Jonathan Cameron, Andy Shevchenko, Philipp Stanner, Jie Wang,
Adam Guerin, Shashank Gupta, Damian Muszynski, Nithin Dabilpuram,
Bharat Bhushan, Johannes Berg, Gregory Greenman,
Emmanuel Grumbach, Yedidya Benshimol, Breno Leitao,
Ilpo Järvinen, John Ogness, Thomas Gleixner
Cc: linux-doc, linux-kernel, linux-ide, qat-linux, linux-crypto,
linux-wireless, ntb, linux-pci, linux-serial, linux-sound
pcim_iomap_table() and pcim_iomap_regions_request_all() have been
deprecated by the PCI subsystem in commit e354bb84a4c1 ("PCI: Deprecate
pcim_iomap_table(), pcim_iomap_regions_request_all()").
Replace these functions with their successors, pcim_iomap() and
pcim_request_all_regions()
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
---
drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
index 719ddc4b72c5..6b282276e7b5 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
@@ -3534,7 +3534,6 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
struct iwl_trans_pcie *trans_pcie, **priv;
struct iwl_trans *trans;
int ret, addr_size;
- void __iomem * const *table;
u32 bar0;
/* reassign our BAR 0 if invalid due to possible runtime PM races */
@@ -3657,22 +3656,15 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
}
}
- ret = pcim_iomap_regions_request_all(pdev, BIT(0), DRV_NAME);
+ ret = pcim_request_all_regions(pdev, DRV_NAME);
if (ret) {
- dev_err(&pdev->dev, "pcim_iomap_regions_request_all failed\n");
+ dev_err(&pdev->dev, "pcim_request_all_regions failed\n");
goto out_no_pci;
}
- table = pcim_iomap_table(pdev);
- if (!table) {
- dev_err(&pdev->dev, "pcim_iomap_table failed\n");
- ret = -ENOMEM;
- goto out_no_pci;
- }
-
- trans_pcie->hw_base = table[0];
+ trans_pcie->hw_base = pcim_iomap(pdev, 0, 0);
if (!trans_pcie->hw_base) {
- dev_err(&pdev->dev, "couldn't find IO mem in first BAR\n");
+ dev_err(&pdev->dev, "pcim_iomap failed\n");
ret = -ENODEV;
goto out_no_pci;
}
--
2.45.2
^ permalink raw reply related [flat|nested] 20+ messages in thread* [PATCH 07/10] ntb: idt: Replace deprecated PCI functions
2024-08-01 17:45 [PATCH 00/10] Remove pcim_iomap_regions_request_all() Philipp Stanner
` (5 preceding siblings ...)
2024-08-01 17:46 ` [PATCH 06/10] wifi: iwlwifi: replace " Philipp Stanner
@ 2024-08-01 17:46 ` Philipp Stanner
2024-08-01 17:56 ` Serge Semin
2024-08-01 17:46 ` [PATCH 08/10] serial: rp2: Remove " Philipp Stanner
` (2 subsequent siblings)
9 siblings, 1 reply; 20+ messages in thread
From: Philipp Stanner @ 2024-08-01 17:46 UTC (permalink / raw)
To: Jonathan Corbet, Damien Le Moal, Niklas Cassel, Giovanni Cabiddu,
Herbert Xu, David S. Miller, Boris Brezillon, Arnaud Ebalard,
Srujana Challa, Alexander Shishkin, Miri Korenblit, Kalle Valo,
Serge Semin, Jon Mason, Dave Jiang, Allen Hubbe, Bjorn Helgaas,
Kevin Cernekee, Greg Kroah-Hartman, Jiri Slaby, Jaroslav Kysela,
Takashi Iwai, Mark Brown, David Lechner, Uwe Kleine-König,
Jonathan Cameron, Andy Shevchenko, Philipp Stanner, Jie Wang,
Adam Guerin, Shashank Gupta, Damian Muszynski, Nithin Dabilpuram,
Bharat Bhushan, Johannes Berg, Gregory Greenman,
Emmanuel Grumbach, Yedidya Benshimol, Breno Leitao,
Ilpo Järvinen, John Ogness, Thomas Gleixner
Cc: linux-doc, linux-kernel, linux-ide, qat-linux, linux-crypto,
linux-wireless, ntb, linux-pci, linux-serial, linux-sound
pcim_iomap_table() and pcim_iomap_regions_request_all() have been
deprecated by the PCI subsystem in commit e354bb84a4c1 ("PCI: Deprecate
pcim_iomap_table(), pcim_iomap_regions_request_all()").
Replace these functions with their successors, pcim_iomap() and
pcim_request_all_regions()
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
---
drivers/ntb/hw/idt/ntb_hw_idt.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/ntb/hw/idt/ntb_hw_idt.c b/drivers/ntb/hw/idt/ntb_hw_idt.c
index 48dfb1a69a77..f1b57d51a814 100644
--- a/drivers/ntb/hw/idt/ntb_hw_idt.c
+++ b/drivers/ntb/hw/idt/ntb_hw_idt.c
@@ -2671,15 +2671,20 @@ static int idt_init_pci(struct idt_ntb_dev *ndev)
*/
pci_set_master(pdev);
- /* Request all BARs resources and map BAR0 only */
- ret = pcim_iomap_regions_request_all(pdev, 1, NTB_NAME);
+ /* Request all BARs resources */
+ ret = pcim_request_all_regions(pdev, NTB_NAME);
if (ret != 0) {
dev_err(&pdev->dev, "Failed to request resources\n");
goto err_clear_master;
}
- /* Retrieve virtual address of BAR0 - PCI configuration space */
- ndev->cfgspc = pcim_iomap_table(pdev)[0];
+ /* ioremap BAR0 - PCI configuration space */
+ ndev->cfgspc = pcim_iomap(pdev, 0, 0);
+ if (!ndev->cfgspc) {
+ dev_err(&pdev->dev, "Failed to ioremap BAR 0\n");
+ ret = -ENOMEM;
+ goto err_clear_master;
+ }
/* Put the IDT driver data pointer to the PCI-device private pointer */
pci_set_drvdata(pdev, ndev);
--
2.45.2
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [PATCH 07/10] ntb: idt: Replace deprecated PCI functions
2024-08-01 17:46 ` [PATCH 07/10] ntb: idt: Replace " Philipp Stanner
@ 2024-08-01 17:56 ` Serge Semin
0 siblings, 0 replies; 20+ messages in thread
From: Serge Semin @ 2024-08-01 17:56 UTC (permalink / raw)
To: Philipp Stanner
Cc: Jonathan Corbet, Damien Le Moal, Niklas Cassel, Giovanni Cabiddu,
Herbert Xu, David S. Miller, Boris Brezillon, Arnaud Ebalard,
Srujana Challa, Alexander Shishkin, Miri Korenblit, Kalle Valo,
Jon Mason, Dave Jiang, Allen Hubbe, Bjorn Helgaas, Kevin Cernekee,
Greg Kroah-Hartman, Jiri Slaby, Jaroslav Kysela, Takashi Iwai,
Mark Brown, David Lechner, Uwe Kleine-König,
Jonathan Cameron, Andy Shevchenko, Jie Wang, Adam Guerin,
Shashank Gupta, Damian Muszynski, Nithin Dabilpuram,
Bharat Bhushan, Johannes Berg, Gregory Greenman,
Emmanuel Grumbach, Yedidya Benshimol, Breno Leitao,
Ilpo Järvinen, John Ogness, Thomas Gleixner, linux-doc,
linux-kernel, linux-ide, qat-linux, linux-crypto, linux-wireless,
ntb, linux-pci, linux-serial, linux-sound
Hi Philipp
On Thu, Aug 01, 2024 at 07:46:05PM +0200, Philipp Stanner wrote:
> pcim_iomap_table() and pcim_iomap_regions_request_all() have been
> deprecated by the PCI subsystem in commit e354bb84a4c1 ("PCI: Deprecate
> pcim_iomap_table(), pcim_iomap_regions_request_all()").
>
> Replace these functions with their successors, pcim_iomap() and
> pcim_request_all_regions()
>
> Signed-off-by: Philipp Stanner <pstanner@redhat.com>
Looking good to me. Thanks.
Acked-by: Serge Semin <fancer.lancer@gmail.com>
-Serge(y)
> ---
> drivers/ntb/hw/idt/ntb_hw_idt.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/ntb/hw/idt/ntb_hw_idt.c b/drivers/ntb/hw/idt/ntb_hw_idt.c
> index 48dfb1a69a77..f1b57d51a814 100644
> --- a/drivers/ntb/hw/idt/ntb_hw_idt.c
> +++ b/drivers/ntb/hw/idt/ntb_hw_idt.c
> @@ -2671,15 +2671,20 @@ static int idt_init_pci(struct idt_ntb_dev *ndev)
> */
> pci_set_master(pdev);
>
> - /* Request all BARs resources and map BAR0 only */
> - ret = pcim_iomap_regions_request_all(pdev, 1, NTB_NAME);
> + /* Request all BARs resources */
> + ret = pcim_request_all_regions(pdev, NTB_NAME);
> if (ret != 0) {
> dev_err(&pdev->dev, "Failed to request resources\n");
> goto err_clear_master;
> }
>
> - /* Retrieve virtual address of BAR0 - PCI configuration space */
> - ndev->cfgspc = pcim_iomap_table(pdev)[0];
> + /* ioremap BAR0 - PCI configuration space */
> + ndev->cfgspc = pcim_iomap(pdev, 0, 0);
> + if (!ndev->cfgspc) {
> + dev_err(&pdev->dev, "Failed to ioremap BAR 0\n");
> + ret = -ENOMEM;
> + goto err_clear_master;
> + }
>
> /* Put the IDT driver data pointer to the PCI-device private pointer */
> pci_set_drvdata(pdev, ndev);
> --
> 2.45.2
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 08/10] serial: rp2: Remove deprecated PCI functions
2024-08-01 17:45 [PATCH 00/10] Remove pcim_iomap_regions_request_all() Philipp Stanner
` (6 preceding siblings ...)
2024-08-01 17:46 ` [PATCH 07/10] ntb: idt: Replace " Philipp Stanner
@ 2024-08-01 17:46 ` Philipp Stanner
2024-08-02 5:18 ` Jiri Slaby
2024-08-01 17:46 ` [PATCH 09/10] ALSA: korg1212: Replace " Philipp Stanner
2024-08-01 17:46 ` [PATCH 10/10] PCI: Remove pcim_iomap_regions_request_all() Philipp Stanner
9 siblings, 1 reply; 20+ messages in thread
From: Philipp Stanner @ 2024-08-01 17:46 UTC (permalink / raw)
To: Jonathan Corbet, Damien Le Moal, Niklas Cassel, Giovanni Cabiddu,
Herbert Xu, David S. Miller, Boris Brezillon, Arnaud Ebalard,
Srujana Challa, Alexander Shishkin, Miri Korenblit, Kalle Valo,
Serge Semin, Jon Mason, Dave Jiang, Allen Hubbe, Bjorn Helgaas,
Kevin Cernekee, Greg Kroah-Hartman, Jiri Slaby, Jaroslav Kysela,
Takashi Iwai, Mark Brown, David Lechner, Uwe Kleine-König,
Jonathan Cameron, Andy Shevchenko, Philipp Stanner, Jie Wang,
Adam Guerin, Shashank Gupta, Damian Muszynski, Nithin Dabilpuram,
Bharat Bhushan, Johannes Berg, Gregory Greenman,
Emmanuel Grumbach, Yedidya Benshimol, Breno Leitao,
Ilpo Järvinen, John Ogness, Thomas Gleixner
Cc: linux-doc, linux-kernel, linux-ide, qat-linux, linux-crypto,
linux-wireless, ntb, linux-pci, linux-serial, linux-sound
pcim_iomap_table() and pcim_iomap_regions_request_all() have been
deprecated by the PCI subsystem in commit e354bb84a4c1 ("PCI: Deprecate
pcim_iomap_table(), pcim_iomap_regions_request_all()").
Replace these functions with their successors, pcim_iomap() and
pcim_request_all_regions()
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
---
drivers/tty/serial/rp2.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/tty/serial/rp2.c b/drivers/tty/serial/rp2.c
index 4132fcff7d4e..b6b30bb956fa 100644
--- a/drivers/tty/serial/rp2.c
+++ b/drivers/tty/serial/rp2.c
@@ -698,7 +698,6 @@ static int rp2_probe(struct pci_dev *pdev,
const struct firmware *fw;
struct rp2_card *card;
struct rp2_uart_port *ports;
- void __iomem * const *bars;
int rc;
card = devm_kzalloc(&pdev->dev, sizeof(*card), GFP_KERNEL);
@@ -711,13 +710,16 @@ static int rp2_probe(struct pci_dev *pdev,
if (rc)
return rc;
- rc = pcim_iomap_regions_request_all(pdev, 0x03, DRV_NAME);
+ rc = pcim_request_all_regions(pdev, DRV_NAME);
if (rc)
return rc;
- bars = pcim_iomap_table(pdev);
- card->bar0 = bars[0];
- card->bar1 = bars[1];
+ card->bar0 = pcim_iomap(pdev, 0, 0);
+ if (!card->bar0)
+ return -ENOMEM;
+ card->bar1 = pcim_iomap(pdev, 1, 0);
+ if (!card->bar1)
+ return -ENOMEM;
card->pdev = pdev;
rp2_decode_cap(id, &card->n_ports, &card->smpte);
--
2.45.2
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [PATCH 08/10] serial: rp2: Remove deprecated PCI functions
2024-08-01 17:46 ` [PATCH 08/10] serial: rp2: Remove " Philipp Stanner
@ 2024-08-02 5:18 ` Jiri Slaby
2024-08-02 7:39 ` Philipp Stanner
0 siblings, 1 reply; 20+ messages in thread
From: Jiri Slaby @ 2024-08-02 5:18 UTC (permalink / raw)
To: Philipp Stanner, Jonathan Corbet, Damien Le Moal, Niklas Cassel,
Giovanni Cabiddu, Herbert Xu, David S. Miller, Boris Brezillon,
Arnaud Ebalard, Srujana Challa, Alexander Shishkin,
Miri Korenblit, Kalle Valo, Serge Semin, Jon Mason, Dave Jiang,
Allen Hubbe, Bjorn Helgaas, Kevin Cernekee, Greg Kroah-Hartman,
Jaroslav Kysela, Takashi Iwai, Mark Brown, David Lechner,
Uwe Kleine-König, Jonathan Cameron, Andy Shevchenko,
Jie Wang, Adam Guerin, Shashank Gupta, Damian Muszynski,
Nithin Dabilpuram, Bharat Bhushan, Johannes Berg,
Gregory Greenman, Emmanuel Grumbach, Yedidya Benshimol,
Breno Leitao, Ilpo Järvinen, John Ogness, Thomas Gleixner
Cc: linux-doc, linux-kernel, linux-ide, qat-linux, linux-crypto,
linux-wireless, ntb, linux-pci, linux-serial, linux-sound
On 01. 08. 24, 19:46, Philipp Stanner wrote:
> pcim_iomap_table() and pcim_iomap_regions_request_all() have been
> deprecated by the PCI subsystem in commit e354bb84a4c1 ("PCI: Deprecate
> pcim_iomap_table(), pcim_iomap_regions_request_all()").
>
> Replace these functions with their successors, pcim_iomap() and
> pcim_request_all_regions()
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
> Signed-off-by: Philipp Stanner <pstanner@redhat.com>
> ---
> drivers/tty/serial/rp2.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
thanks,
--
js
suse labs
^ permalink raw reply [flat|nested] 20+ messages in thread* Re: [PATCH 08/10] serial: rp2: Remove deprecated PCI functions
2024-08-02 5:18 ` Jiri Slaby
@ 2024-08-02 7:39 ` Philipp Stanner
0 siblings, 0 replies; 20+ messages in thread
From: Philipp Stanner @ 2024-08-02 7:39 UTC (permalink / raw)
To: Jiri Slaby, Jonathan Corbet, Damien Le Moal, Niklas Cassel,
Giovanni Cabiddu, Herbert Xu, David S. Miller, Boris Brezillon,
Arnaud Ebalard, Srujana Challa, Alexander Shishkin,
Miri Korenblit, Kalle Valo, Serge Semin, Jon Mason, Dave Jiang,
Allen Hubbe, Bjorn Helgaas, Kevin Cernekee, Greg Kroah-Hartman,
Jaroslav Kysela, Takashi Iwai, Mark Brown, David Lechner,
Uwe Kleine-König, Jonathan Cameron, Andy Shevchenko,
Jie Wang, Adam Guerin, Shashank Gupta, Damian Muszynski,
Nithin Dabilpuram, Bharat Bhushan, Johannes Berg,
Gregory Greenman, Emmanuel Grumbach, Yedidya Benshimol,
Breno Leitao, Ilpo Järvinen, John Ogness, Thomas Gleixner
Cc: linux-doc, linux-kernel, linux-ide, qat-linux, linux-crypto,
linux-wireless, ntb, linux-pci, linux-serial, linux-sound
On Fri, 2024-08-02 at 07:18 +0200, Jiri Slaby wrote:
> On 01. 08. 24, 19:46, Philipp Stanner wrote:
> > pcim_iomap_table() and pcim_iomap_regions_request_all() have been
> > deprecated by the PCI subsystem in commit e354bb84a4c1 ("PCI:
> > Deprecate
> > pcim_iomap_table(), pcim_iomap_regions_request_all()").
> >
> > Replace these functions with their successors, pcim_iomap() and
> > pcim_request_all_regions()
>
> Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Thank you for the review.
I have to provide a v2 for a small bug in one of the other patches.
While I'm at it, I would rename the title of this patch №8 here so that
it's "Replace" instead of "Remove", making it consistent with the other
ones.
I'd assume that keeping your RB then would be alright. Please tell me
if not.
Cheers,
P.
>
> > Signed-off-by: Philipp Stanner <pstanner@redhat.com>
> > ---
> > drivers/tty/serial/rp2.c | 12 +++++++-----
> > 1 file changed, 7 insertions(+), 5 deletions(-)
>
> thanks,
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 09/10] ALSA: korg1212: Replace deprecated PCI functions
2024-08-01 17:45 [PATCH 00/10] Remove pcim_iomap_regions_request_all() Philipp Stanner
` (7 preceding siblings ...)
2024-08-01 17:46 ` [PATCH 08/10] serial: rp2: Remove " Philipp Stanner
@ 2024-08-01 17:46 ` Philipp Stanner
2024-08-02 8:02 ` Takashi Iwai
2024-08-01 17:46 ` [PATCH 10/10] PCI: Remove pcim_iomap_regions_request_all() Philipp Stanner
9 siblings, 1 reply; 20+ messages in thread
From: Philipp Stanner @ 2024-08-01 17:46 UTC (permalink / raw)
To: Jonathan Corbet, Damien Le Moal, Niklas Cassel, Giovanni Cabiddu,
Herbert Xu, David S. Miller, Boris Brezillon, Arnaud Ebalard,
Srujana Challa, Alexander Shishkin, Miri Korenblit, Kalle Valo,
Serge Semin, Jon Mason, Dave Jiang, Allen Hubbe, Bjorn Helgaas,
Kevin Cernekee, Greg Kroah-Hartman, Jiri Slaby, Jaroslav Kysela,
Takashi Iwai, Mark Brown, David Lechner, Uwe Kleine-König,
Jonathan Cameron, Andy Shevchenko, Philipp Stanner, Jie Wang,
Adam Guerin, Shashank Gupta, Damian Muszynski, Nithin Dabilpuram,
Bharat Bhushan, Johannes Berg, Gregory Greenman,
Emmanuel Grumbach, Yedidya Benshimol, Breno Leitao,
Ilpo Järvinen, John Ogness, Thomas Gleixner
Cc: linux-doc, linux-kernel, linux-ide, qat-linux, linux-crypto,
linux-wireless, ntb, linux-pci, linux-serial, linux-sound
pcim_iomap_table() and pcim_iomap_regions_request_all() have been
deprecated by the PCI subsystem in commit e354bb84a4c1 ("PCI: Deprecate
pcim_iomap_table(), pcim_iomap_regions_request_all()").
Replace these functions with their successors, pcim_iomap() and
pcim_request_all_regions()
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
---
sound/pci/korg1212/korg1212.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c
index 5c2cac201a28..b5428ac34d3b 100644
--- a/sound/pci/korg1212/korg1212.c
+++ b/sound/pci/korg1212/korg1212.c
@@ -2106,7 +2106,7 @@ static int snd_korg1212_create(struct snd_card *card, struct pci_dev *pci)
for (i=0; i<kAudioChannels; i++)
korg1212->volumePhase[i] = 0;
- err = pcim_iomap_regions_request_all(pci, 1 << 0, "korg1212");
+ err = pcim_request_all_regions(pci, "korg1212");
if (err < 0)
return err;
@@ -2128,7 +2128,9 @@ static int snd_korg1212_create(struct snd_card *card, struct pci_dev *pci)
korg1212->iomem2, iomem2_size,
stateName[korg1212->cardState]);
- korg1212->iobase = pcim_iomap_table(pci)[0];
+ korg1212->iobase = pcim_iomap(pci, 0, 0);
+ if (!korg1212->iobase)
+ return -ENOMEM;
err = devm_request_irq(&pci->dev, pci->irq, snd_korg1212_interrupt,
IRQF_SHARED,
--
2.45.2
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [PATCH 09/10] ALSA: korg1212: Replace deprecated PCI functions
2024-08-01 17:46 ` [PATCH 09/10] ALSA: korg1212: Replace " Philipp Stanner
@ 2024-08-02 8:02 ` Takashi Iwai
0 siblings, 0 replies; 20+ messages in thread
From: Takashi Iwai @ 2024-08-02 8:02 UTC (permalink / raw)
To: Philipp Stanner
Cc: Jonathan Corbet, Damien Le Moal, Niklas Cassel, Giovanni Cabiddu,
Herbert Xu, David S. Miller, Boris Brezillon, Arnaud Ebalard,
Srujana Challa, Alexander Shishkin, Miri Korenblit, Kalle Valo,
Serge Semin, Jon Mason, Dave Jiang, Allen Hubbe, Bjorn Helgaas,
Kevin Cernekee, Greg Kroah-Hartman, Jiri Slaby, Jaroslav Kysela,
Takashi Iwai, Mark Brown, David Lechner, Uwe Kleine-König,
Jonathan Cameron, Andy Shevchenko, Jie Wang, Adam Guerin,
Shashank Gupta, Damian Muszynski, Nithin Dabilpuram,
Bharat Bhushan, Johannes Berg, Gregory Greenman,
Emmanuel Grumbach, Yedidya Benshimol, Breno Leitao,
Ilpo Järvinen, John Ogness, Thomas Gleixner, linux-doc,
linux-kernel, linux-ide, qat-linux, linux-crypto, linux-wireless,
ntb, linux-pci, linux-serial, linux-sound
On Thu, 01 Aug 2024 19:46:07 +0200,
Philipp Stanner wrote:
>
> pcim_iomap_table() and pcim_iomap_regions_request_all() have been
> deprecated by the PCI subsystem in commit e354bb84a4c1 ("PCI: Deprecate
> pcim_iomap_table(), pcim_iomap_regions_request_all()").
>
> Replace these functions with their successors, pcim_iomap() and
> pcim_request_all_regions()
>
> Signed-off-by: Philipp Stanner <pstanner@redhat.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
And feel free to take my ack to v2 if the further change will be only
about the description, too :)
thanks,
Takashi
> ---
> sound/pci/korg1212/korg1212.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c
> index 5c2cac201a28..b5428ac34d3b 100644
> --- a/sound/pci/korg1212/korg1212.c
> +++ b/sound/pci/korg1212/korg1212.c
> @@ -2106,7 +2106,7 @@ static int snd_korg1212_create(struct snd_card *card, struct pci_dev *pci)
> for (i=0; i<kAudioChannels; i++)
> korg1212->volumePhase[i] = 0;
>
> - err = pcim_iomap_regions_request_all(pci, 1 << 0, "korg1212");
> + err = pcim_request_all_regions(pci, "korg1212");
> if (err < 0)
> return err;
>
> @@ -2128,7 +2128,9 @@ static int snd_korg1212_create(struct snd_card *card, struct pci_dev *pci)
> korg1212->iomem2, iomem2_size,
> stateName[korg1212->cardState]);
>
> - korg1212->iobase = pcim_iomap_table(pci)[0];
> + korg1212->iobase = pcim_iomap(pci, 0, 0);
> + if (!korg1212->iobase)
> + return -ENOMEM;
>
> err = devm_request_irq(&pci->dev, pci->irq, snd_korg1212_interrupt,
> IRQF_SHARED,
> --
> 2.45.2
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 10/10] PCI: Remove pcim_iomap_regions_request_all()
2024-08-01 17:45 [PATCH 00/10] Remove pcim_iomap_regions_request_all() Philipp Stanner
` (8 preceding siblings ...)
2024-08-01 17:46 ` [PATCH 09/10] ALSA: korg1212: Replace " Philipp Stanner
@ 2024-08-01 17:46 ` Philipp Stanner
2024-08-02 0:44 ` Damien Le Moal
9 siblings, 1 reply; 20+ messages in thread
From: Philipp Stanner @ 2024-08-01 17:46 UTC (permalink / raw)
To: Jonathan Corbet, Damien Le Moal, Niklas Cassel, Giovanni Cabiddu,
Herbert Xu, David S. Miller, Boris Brezillon, Arnaud Ebalard,
Srujana Challa, Alexander Shishkin, Miri Korenblit, Kalle Valo,
Serge Semin, Jon Mason, Dave Jiang, Allen Hubbe, Bjorn Helgaas,
Kevin Cernekee, Greg Kroah-Hartman, Jiri Slaby, Jaroslav Kysela,
Takashi Iwai, Mark Brown, David Lechner, Uwe Kleine-König,
Jonathan Cameron, Andy Shevchenko, Philipp Stanner, Jie Wang,
Adam Guerin, Shashank Gupta, Damian Muszynski, Nithin Dabilpuram,
Bharat Bhushan, Johannes Berg, Gregory Greenman,
Emmanuel Grumbach, Yedidya Benshimol, Breno Leitao,
Ilpo Järvinen, John Ogness, Thomas Gleixner
Cc: linux-doc, linux-kernel, linux-ide, qat-linux, linux-crypto,
linux-wireless, ntb, linux-pci, linux-serial, linux-sound
pcim_iomap_regions_request_all() had been deprecated in
commit e354bb84a4c1 ("PCI: Deprecate pcim_iomap_table(),
pcim_iomap_regions_request_all()").
All users of this function have been ported to other interfaces by now.
Remove pcim_iomap_regions_request_all().
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
---
.../driver-api/driver-model/devres.rst | 1 -
drivers/pci/devres.c | 56 -------------------
include/linux/pci.h | 2 -
3 files changed, 59 deletions(-)
diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
index ac9ee7441887..895eef433e07 100644
--- a/Documentation/driver-api/driver-model/devres.rst
+++ b/Documentation/driver-api/driver-model/devres.rst
@@ -394,7 +394,6 @@ PCI
pcim_enable_device() : after success, all PCI ops become managed
pcim_iomap() : do iomap() on a single BAR
pcim_iomap_regions() : do request_region() and iomap() on multiple BARs
- pcim_iomap_regions_request_all() : do request_region() on all and iomap() on multiple BARs
pcim_iomap_table() : array of mapped addresses indexed by BAR
pcim_iounmap() : do iounmap() on a single BAR
pcim_iounmap_regions() : do iounmap() and release_region() on multiple BARs
diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c
index 0ec2b23e6cac..eef3ffbd5b74 100644
--- a/drivers/pci/devres.c
+++ b/drivers/pci/devres.c
@@ -952,62 +952,6 @@ int pcim_request_all_regions(struct pci_dev *pdev, const char *name)
}
EXPORT_SYMBOL(pcim_request_all_regions);
-/**
- * pcim_iomap_regions_request_all - Request all BARs and iomap specified ones
- * (DEPRECATED)
- * @pdev: PCI device to map IO resources for
- * @mask: Mask of BARs to iomap
- * @name: Name associated with the requests
- *
- * Returns: 0 on success, negative error code on failure.
- *
- * Request all PCI BARs and iomap regions specified by @mask.
- *
- * To release these resources manually, call pcim_release_region() for the
- * regions and pcim_iounmap() for the mappings.
- *
- * This function is DEPRECATED. Don't use it in new code. Instead, use one
- * of the pcim_* region request functions in combination with a pcim_*
- * mapping function.
- */
-int pcim_iomap_regions_request_all(struct pci_dev *pdev, int mask,
- const char *name)
-{
- int bar;
- int ret;
- void __iomem **legacy_iomap_table;
-
- ret = pcim_request_all_regions(pdev, name);
- if (ret != 0)
- return ret;
-
- for (bar = 0; bar < PCI_STD_NUM_BARS; bar++) {
- if (!mask_contains_bar(mask, bar))
- continue;
- if (!pcim_iomap(pdev, bar, 0))
- goto err;
- }
-
- return 0;
-
-err:
- /*
- * If bar is larger than 0, then pcim_iomap() above has most likely
- * failed because of -EINVAL. If it is equal 0, most likely the table
- * couldn't be created, indicating -ENOMEM.
- */
- ret = bar > 0 ? -EINVAL : -ENOMEM;
- legacy_iomap_table = (void __iomem **)pcim_iomap_table(pdev);
-
- while (--bar >= 0)
- pcim_iounmap(pdev, legacy_iomap_table[bar]);
-
- pcim_release_all_regions(pdev);
-
- return ret;
-}
-EXPORT_SYMBOL(pcim_iomap_regions_request_all);
-
/**
* pcim_iounmap_regions - Unmap and release PCI BARs
* @pdev: PCI device to map IO resources for
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 5b5856ba63e1..8fe5d03cdac4 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -2294,8 +2294,6 @@ void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen);
void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr);
void __iomem * const *pcim_iomap_table(struct pci_dev *pdev);
int pcim_iomap_regions(struct pci_dev *pdev, int mask, const char *name);
-int pcim_iomap_regions_request_all(struct pci_dev *pdev, int mask,
- const char *name);
void pcim_iounmap_regions(struct pci_dev *pdev, int mask);
void __iomem *pcim_iomap_range(struct pci_dev *pdev, int bar,
unsigned long offset, unsigned long len);
--
2.45.2
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [PATCH 10/10] PCI: Remove pcim_iomap_regions_request_all()
2024-08-01 17:46 ` [PATCH 10/10] PCI: Remove pcim_iomap_regions_request_all() Philipp Stanner
@ 2024-08-02 0:44 ` Damien Le Moal
0 siblings, 0 replies; 20+ messages in thread
From: Damien Le Moal @ 2024-08-02 0:44 UTC (permalink / raw)
To: Philipp Stanner, Jonathan Corbet, Niklas Cassel, Giovanni Cabiddu,
Herbert Xu, David S. Miller, Boris Brezillon, Arnaud Ebalard,
Srujana Challa, Alexander Shishkin, Miri Korenblit, Kalle Valo,
Serge Semin, Jon Mason, Dave Jiang, Allen Hubbe, Bjorn Helgaas,
Kevin Cernekee, Greg Kroah-Hartman, Jiri Slaby, Jaroslav Kysela,
Takashi Iwai, Mark Brown, David Lechner, Uwe Kleine-König,
Jonathan Cameron, Andy Shevchenko, Jie Wang, Adam Guerin,
Shashank Gupta, Damian Muszynski, Nithin Dabilpuram,
Bharat Bhushan, Johannes Berg, Gregory Greenman,
Emmanuel Grumbach, Yedidya Benshimol, Breno Leitao,
Ilpo Järvinen, John Ogness, Thomas Gleixner
Cc: linux-doc, linux-kernel, linux-ide, qat-linux, linux-crypto,
linux-wireless, ntb, linux-pci, linux-serial, linux-sound
On 8/2/24 02:46, Philipp Stanner wrote:
> pcim_iomap_regions_request_all() had been deprecated in
> commit e354bb84a4c1 ("PCI: Deprecate pcim_iomap_table(),
> pcim_iomap_regions_request_all()").
>
> All users of this function have been ported to other interfaces by now.
>
> Remove pcim_iomap_regions_request_all().
>
> Signed-off-by: Philipp Stanner <pstanner@redhat.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 20+ messages in thread