2013-08-19 11:21:09

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 0/7] replace devm_request_and_ioremap by devm_ioremap_resource

devm_request_and_ioremap has been replaced by devm_ioremap_resource, which
gives more informative error return code information. This patch series
removes the remaining uses of devm_request_and_ioremap.

This patch series was generated using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci from the Linux kernel
source tree. Manual modifications have been made to move associated calls
to platform_get_resource closer to the resulting call to
devm_ioremap_resource and to remove the associated error handling code.


2013-08-19 11:21:11

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 5/7] bcm63xx_enet: replace devm_request_and_ioremap by devm_ioremap_resource

From: Julia Lawall <[email protected]>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci

The relevant call to platform_get_resource was manually moved down to the
call to devm_ioremap_resource.

Signed-off-by: Julia Lawall <[email protected]>

---
drivers/net/ethernet/broadcom/bcm63xx_enet.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index b1bcd4b..89ff09e 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -1747,11 +1747,10 @@ static int bcm_enet_probe(struct platform_device *pdev)
if (!bcm_enet_shared_base[0])
return -ENODEV;

- res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
res_irq_rx = platform_get_resource(pdev, IORESOURCE_IRQ, 1);
res_irq_tx = platform_get_resource(pdev, IORESOURCE_IRQ, 2);
- if (!res_mem || !res_irq || !res_irq_rx || !res_irq_tx)
+ if (!res_irq || !res_irq_rx || !res_irq_tx)
return -ENODEV;

ret = 0;
@@ -1767,9 +1766,10 @@ static int bcm_enet_probe(struct platform_device *pdev)
if (ret)
goto out;

- priv->base = devm_request_and_ioremap(&pdev->dev, res_mem);
- if (priv->base == NULL) {
- ret = -ENOMEM;
+ res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ priv->base = devm_ioremap_resource(&pdev->dev, res_mem);
+ if (IS_ERR(priv->base)) {
+ ret = PTR_ERR(priv->base);
goto out;
}

2013-08-19 11:21:08

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 6/7] video: xilinxfb: replace devm_request_and_ioremap by devm_ioremap_resource

From: Julia Lawall <[email protected]>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci

The initialization of drvdata->regs_phys was manually moved lower, to take
advantage of the NULL test on res performed by devm_ioremap_resource.

Signed-off-by: Julia Lawall <[email protected]>

---
drivers/video/xilinxfb.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index 6629b29..84c664e 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -259,12 +259,12 @@ static int xilinxfb_assign(struct platform_device *pdev,
struct resource *res;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- drvdata->regs_phys = res->start;
- drvdata->regs = devm_request_and_ioremap(&pdev->dev, res);
- if (!drvdata->regs) {
- rc = -EADDRNOTAVAIL;
+ drvdata->regs = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(drvdata->regs)) {
+ rc = PTR_ERR(drvdata->regs);
goto err_region;
}
+ drvdata->regs_phys = res->start;
}

/* Allocate the framebuffer memory */

2013-08-19 11:21:07

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 7/7] mmc: mvsdio: replace devm_request_and_ioremap by devm_ioremap_resource

From: Julia Lawall <[email protected]>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci

The relevant call to platform_get_resource was manually moved down to the
call to devm_ioremap_resource.

Signed-off-by: Julia Lawall <[email protected]>

---
drivers/mmc/host/mvsdio.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
index 4ddd83f..2ac7d3a 100644
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -687,9 +687,8 @@ static int __init mvsd_probe(struct platform_device *pdev)
int ret, irq;
struct pinctrl *pinctrl;

- r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
irq = platform_get_irq(pdev, 0);
- if (!r || irq < 0)
+ if (irq < 0)
return -ENXIO;

mmc = mmc_alloc_host(sizeof(struct mvsd_host), &pdev->dev);
@@ -774,9 +773,10 @@ static int __init mvsd_probe(struct platform_device *pdev)

spin_lock_init(&host->lock);

- host->base = devm_request_and_ioremap(&pdev->dev, r);
- if (!host->base) {
- ret = -ENOMEM;
+ r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ host->base = devm_ioremap_resource(&pdev->dev, r);
+ if (IS_ERR(host->base)) {
+ ret = PTR_ERR(host->base);
goto out;
}

2013-08-19 11:21:03

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource

From: Julia Lawall <[email protected]>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci

Error-handling code was manually removed from the associated calls to
platform_get_resource.

Signed-off-by: Julia Lawall <[email protected]>

---
The first block of modified code is followed by a call to
devm_request_mem_region for pcie->cs with no associated ioremap. Should
ioremap be used in this case as well?

drivers/pci/host/pci-tegra.c | 29 +++++++++--------------------
1 file changed, 9 insertions(+), 20 deletions(-)

diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index 7356741..db2ddc5 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -1031,28 +1031,17 @@ static int tegra_pcie_get_resources(struct tegra_pcie *pcie)
return err;
}

- /* request and remap controller registers */
pads = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pads");
- if (!pads) {
- err = -EADDRNOTAVAIL;
+ pcie->pads = devm_ioremap_resource(&pdev->dev, pads);
+ if (IS_ERR(pcie->pads)) {
+ err = PTR_ERR(pcie->pads);
goto poweroff;
}

afi = platform_get_resource_byname(pdev, IORESOURCE_MEM, "afi");
- if (!afi) {
- err = -EADDRNOTAVAIL;
- goto poweroff;
- }
-
- pcie->pads = devm_request_and_ioremap(&pdev->dev, pads);
- if (!pcie->pads) {
- err = -EADDRNOTAVAIL;
- goto poweroff;
- }
-
- pcie->afi = devm_request_and_ioremap(&pdev->dev, afi);
- if (!pcie->afi) {
- err = -EADDRNOTAVAIL;
+ pcie->afi = devm_ioremap_resource(&pdev->dev, afi);
+ if (IS_ERR(pcie->afi)) {
+ err = PTR_ERR(pcie->afi);
goto poweroff;
}

@@ -1492,9 +1481,9 @@ static int tegra_pcie_parse_dt(struct tegra_pcie *pcie)
rp->lanes = value;
rp->pcie = pcie;

- rp->base = devm_request_and_ioremap(pcie->dev, &rp->regs);
- if (!rp->base)
- return -EADDRNOTAVAIL;
+ rp->base = devm_ioremap_resource(pcie->dev, &rp->regs);
+ if (IS_ERR(rp->base))
+ return PTR_ERR(rp->base);

list_add_tail(&rp->list, &pcie->ports);
}

2013-08-19 11:22:39

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 4/7] dma: replace devm_request_and_ioremap by devm_ioremap_resource

From: Julia Lawall <[email protected]>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci

The relevant call to platform_get_resource was manually moved down to the
call to devm_ioremap_resource.

Signed-off-by: Julia Lawall <[email protected]>

---
drivers/dma/sh/sudmac.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/dma/sh/sudmac.c b/drivers/dma/sh/sudmac.c
index c494417..8369c6f 100644
--- a/drivers/dma/sh/sudmac.c
+++ b/drivers/dma/sh/sudmac.c
@@ -345,9 +345,8 @@ static int sudmac_probe(struct platform_device *pdev)
if (!pdata)
return -ENODEV;

- chan = platform_get_resource(pdev, IORESOURCE_MEM, 0);
irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
- if (!chan || !irq_res)
+ if (!irq_res)
return -ENODEV;

err = -ENOMEM;
@@ -360,9 +359,10 @@ static int sudmac_probe(struct platform_device *pdev)

dma_dev = &su_dev->shdma_dev.dma_dev;

- su_dev->chan_reg = devm_request_and_ioremap(&pdev->dev, chan);
- if (!su_dev->chan_reg)
- return err;
+ chan = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ su_dev->chan_reg = devm_ioremap_resource(&pdev->dev, chan);
+ if (IS_ERR(su_dev->chan_reg))
+ return PTR_ERR(su_dev->chan_reg);

dma_cap_set(DMA_SLAVE, dma_dev->cap_mask);

2013-08-19 11:22:57

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 2/7] serial: st-asc: replace devm_request_and_ioremap by devm_ioremap_resource

From: Julia Lawall <[email protected]>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci
and various manual modifications to move associated calls to
platform_get_resource closer to the resulting call to devm_ioremap_resource
and to remove the associated error handling code.

The initialization of port->mapbase is also moved lower, to take advantage
of the NULL test on res performed by devm_ioremap_resource.

Signed-off-by: Julia Lawall <[email protected]>

---
drivers/tty/serial/st-asc.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
index 2ff4b1b..e0ec11d 100644
--- a/drivers/tty/serial/st-asc.c
+++ b/drivers/tty/serial/st-asc.c
@@ -665,26 +665,20 @@ static int asc_init_port(struct asc_port *ascport,
struct platform_device *pdev)
{
struct uart_port *port = &ascport->port;
- struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-
- if (!res) {
- dev_err(&pdev->dev, "Unable to get io resource\n");
- return -ENODEV;
- }
+ struct resource *res;

port->iotype = UPIO_MEM;
port->flags = UPF_BOOT_AUTOCONF;
port->ops = &asc_uart_ops;
port->fifosize = ASC_FIFO_SIZE;
port->dev = &pdev->dev;
- port->mapbase = res->start;
port->irq = platform_get_irq(pdev, 0);

- port->membase = devm_request_and_ioremap(&pdev->dev, res);
- if (!port->membase) {
- dev_err(&pdev->dev, "Unable to request io memory\n");
- return -ENODEV;
- }
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ port->membase = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(port->membase))
+ return PTR_ERR(port->membase);
+ port->mapbase = res->start;

spin_lock_init(&port->lock);

2013-08-19 11:23:36

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 3/7] iommu/arm: replace devm_request_and_ioremap by devm_ioremap_resource

From: Julia Lawall <[email protected]>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was partly done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci

The error-handling code on the call to platform_get_resource was removed
manually, and the initialization of smmu->size was manually moved lower, to
take advantage of the NULL test on res performed by devm_ioremap_resource.

Signed-off-by: Julia Lawall <[email protected]>

---
drivers/iommu/arm-smmu.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index ebd0a4c..dd91465 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -1761,15 +1761,10 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev)
smmu->dev = dev;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res) {
- dev_err(dev, "missing base address/size\n");
- return -ENODEV;
- }
-
+ smmu->base = devm_ioremap_resource(dev, res);
+ if (IS_ERR(smmu->base))
+ return PTR_ERR(smmu->base);
smmu->size = resource_size(res);
- smmu->base = devm_request_and_ioremap(dev, res);
- if (!smmu->base)
- return -EADDRNOTAVAIL;

if (of_property_read_u32(dev->of_node, "#global-interrupts",
&smmu->num_global_irqs)) {

2013-08-19 12:03:10

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource

On Mon, Aug 19, 2013 at 01:20:35PM +0200, Julia Lawall wrote:
> From: Julia Lawall <[email protected]>
>
> Use devm_ioremap_resource instead of devm_request_and_ioremap.
>
> This was done using the semantic patch
> scripts/coccinelle/api/devm_ioremap_resource.cocci
>
> Error-handling code was manually removed from the associated calls to
> platform_get_resource.
>
> Signed-off-by: Julia Lawall <[email protected]>
>
> ---
> The first block of modified code is followed by a call to
> devm_request_mem_region for pcie->cs with no associated ioremap. Should
> ioremap be used in this case as well?

No. The pcie->cs resource is 256 MiB so it's challenging to map it at
once. Furthermore it requires a non-linear mapping so we do it on
demand.

> drivers/pci/host/pci-tegra.c | 29 +++++++++--------------------
> 1 file changed, 9 insertions(+), 20 deletions(-)

Tested-by: Thierry Reding <[email protected]>
Acked-by: Thierry Reding <[email protected]>

Bjorn, how do you want to handle patches to the Tegra PCIe driver in the
future? Do you want me to prepare a branch and pull from that or would
you rather just take simple patches?

Thierry


Attachments:
(No filename) (1.14 kB)
(No filename) (836.00 B)
Download all attachments

2013-08-19 12:08:18

by Julia Lawall

[permalink] [raw]
Subject: Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource



On Mon, 19 Aug 2013, Thierry Reding wrote:

> On Mon, Aug 19, 2013 at 01:20:35PM +0200, Julia Lawall wrote:
> > From: Julia Lawall <[email protected]>
> >
> > Use devm_ioremap_resource instead of devm_request_and_ioremap.
> >
> > This was done using the semantic patch
> > scripts/coccinelle/api/devm_ioremap_resource.cocci
> >
> > Error-handling code was manually removed from the associated calls to
> > platform_get_resource.
> >
> > Signed-off-by: Julia Lawall <[email protected]>
> >
> > ---
> > The first block of modified code is followed by a call to
> > devm_request_mem_region for pcie->cs with no associated ioremap. Should
> > ioremap be used in this case as well?
>
> No. The pcie->cs resource is 256 MiB so it's challenging to map it at
> once. Furthermore it requires a non-linear mapping so we do it on
> demand.

OK, thanks for the explanation. Is the comment, though, a little
misleading, since the mapping is not done here?

/* request and remap configuration space */

julia

2013-08-19 12:12:57

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource

On Mon, Aug 19, 2013 at 02:07:54PM +0200, Julia Lawall wrote:
>
>
> On Mon, 19 Aug 2013, Thierry Reding wrote:
>
> > On Mon, Aug 19, 2013 at 01:20:35PM +0200, Julia Lawall wrote:
> > > From: Julia Lawall <[email protected]>
> > >
> > > Use devm_ioremap_resource instead of devm_request_and_ioremap.
> > >
> > > This was done using the semantic patch
> > > scripts/coccinelle/api/devm_ioremap_resource.cocci
> > >
> > > Error-handling code was manually removed from the associated calls to
> > > platform_get_resource.
> > >
> > > Signed-off-by: Julia Lawall <[email protected]>
> > >
> > > ---
> > > The first block of modified code is followed by a call to
> > > devm_request_mem_region for pcie->cs with no associated ioremap. Should
> > > ioremap be used in this case as well?
> >
> > No. The pcie->cs resource is 256 MiB so it's challenging to map it at
> > once. Furthermore it requires a non-linear mapping so we do it on
> > demand.
>
> OK, thanks for the explanation. Is the comment, though, a little
> misleading, since the mapping is not done here?
>
> /* request and remap configuration space */

Yes, that's misleading. Given that it doesn't really add anything useful
information either, perhaps I should just remove it.

Thanks,
Thierry


Attachments:
(No filename) (1.23 kB)
(No filename) (836.00 B)
Download all attachments

2013-08-19 12:16:18

by Julia Lawall

[permalink] [raw]
Subject: Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource



On Mon, 19 Aug 2013, Thierry Reding wrote:

> On Mon, Aug 19, 2013 at 02:07:54PM +0200, Julia Lawall wrote:
> >
> >
> > On Mon, 19 Aug 2013, Thierry Reding wrote:
> >
> > > On Mon, Aug 19, 2013 at 01:20:35PM +0200, Julia Lawall wrote:
> > > > From: Julia Lawall <[email protected]>
> > > >
> > > > Use devm_ioremap_resource instead of devm_request_and_ioremap.
> > > >
> > > > This was done using the semantic patch
> > > > scripts/coccinelle/api/devm_ioremap_resource.cocci
> > > >
> > > > Error-handling code was manually removed from the associated calls to
> > > > platform_get_resource.
> > > >
> > > > Signed-off-by: Julia Lawall <[email protected]>
> > > >
> > > > ---
> > > > The first block of modified code is followed by a call to
> > > > devm_request_mem_region for pcie->cs with no associated ioremap. Should
> > > > ioremap be used in this case as well?
> > >
> > > No. The pcie->cs resource is 256 MiB so it's challenging to map it at
> > > once. Furthermore it requires a non-linear mapping so we do it on
> > > demand.
> >
> > OK, thanks for the explanation. Is the comment, though, a little
> > misleading, since the mapping is not done here?
> >
> > /* request and remap configuration space */
>
> Yes, that's misleading. Given that it doesn't really add anything useful
> information either, perhaps I should just remove it.

OK, or maybe something like

/* request configuration space, but remap later, on demand */

To make it clear that something different is intended than the
devm_ioremap_resources that come just before..

julia

2013-08-19 19:33:46

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource

On Mon, Aug 19, 2013 at 02:15:39PM +0200, Julia Lawall wrote:
>
>
> On Mon, 19 Aug 2013, Thierry Reding wrote:
>
> > On Mon, Aug 19, 2013 at 02:07:54PM +0200, Julia Lawall wrote:
> > >
> > >
> > > On Mon, 19 Aug 2013, Thierry Reding wrote:
> > >
> > > > On Mon, Aug 19, 2013 at 01:20:35PM +0200, Julia Lawall wrote:
> > > > > From: Julia Lawall <[email protected]>
> > > > >
> > > > > Use devm_ioremap_resource instead of devm_request_and_ioremap.
> > > > >
> > > > > This was done using the semantic patch
> > > > > scripts/coccinelle/api/devm_ioremap_resource.cocci
> > > > >
> > > > > Error-handling code was manually removed from the associated calls to
> > > > > platform_get_resource.
> > > > >
> > > > > Signed-off-by: Julia Lawall <[email protected]>
> > > > >
> > > > > ---
> > > > > The first block of modified code is followed by a call to
> > > > > devm_request_mem_region for pcie->cs with no associated ioremap. Should
> > > > > ioremap be used in this case as well?
> > > >
> > > > No. The pcie->cs resource is 256 MiB so it's challenging to map it at
> > > > once. Furthermore it requires a non-linear mapping so we do it on
> > > > demand.
> > >
> > > OK, thanks for the explanation. Is the comment, though, a little
> > > misleading, since the mapping is not done here?
> > >
> > > /* request and remap configuration space */
> >
> > Yes, that's misleading. Given that it doesn't really add anything useful
> > information either, perhaps I should just remove it.
>
> OK, or maybe something like
>
> /* request configuration space, but remap later, on demand */
>
> To make it clear that something different is intended than the
> devm_ioremap_resources that come just before..

Yes, that works for me too. Can you respin the patch with the comment
updated and my Acked-by and Tested-by so Bjorn can pick it up?

Thierry


Attachments:
(No filename) (1.81 kB)
(No filename) (836.00 B)
Download all attachments

2013-08-19 20:05:00

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource

On Mon, Aug 19, 2013 at 6:02 AM, Thierry Reding
<[email protected]> wrote:

> Bjorn, how do you want to handle patches to the Tegra PCIe driver in the
> future? Do you want me to prepare a branch and pull from that or would
> you rather just take simple patches?

I'm in the habit of applying patches from email, so that's easy for
me. But a branch would be OK, too.

Bjorn

2013-08-19 20:12:32

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource

On Mon, Aug 19, 2013 at 02:04:24PM -0600, Bjorn Helgaas wrote:
> On Mon, Aug 19, 2013 at 6:02 AM, Thierry Reding
> <[email protected]> wrote:
>
> > Bjorn, how do you want to handle patches to the Tegra PCIe driver in the
> > future? Do you want me to prepare a branch and pull from that or would
> > you rather just take simple patches?
>
> I'm in the habit of applying patches from email, so that's easy for
> me. But a branch would be OK, too.

Patches work for me too. Is this cleanup patch something that you'd be
comfortable with applying after 3.12-rc1 or would you rather defer it to
3.13?

Thierry


Attachments:
(No filename) (616.00 B)
(No filename) (836.00 B)
Download all attachments

2013-08-19 20:49:32

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource

On Mon, Aug 19, 2013 at 2:12 PM, Thierry Reding
<[email protected]> wrote:
> On Mon, Aug 19, 2013 at 02:04:24PM -0600, Bjorn Helgaas wrote:
>> On Mon, Aug 19, 2013 at 6:02 AM, Thierry Reding
>> <[email protected]> wrote:
>>
>> > Bjorn, how do you want to handle patches to the Tegra PCIe driver in the
>> > future? Do you want me to prepare a branch and pull from that or would
>> > you rather just take simple patches?
>>
>> I'm in the habit of applying patches from email, so that's easy for
>> me. But a branch would be OK, too.
>
> Patches work for me too. Is this cleanup patch something that you'd be
> comfortable with applying after 3.12-rc1 or would you rather defer it to
> 3.13?

I'm not really sure how we should manage drivers/pci/host/*. Those
files are mostly arch code, and I'm not sure it's useful for me to be
in the middle of managing them.

I assume Stephen or somebody has a tree with the pci-tegra.c stuff
that's in -next right now; it seems like it'd be simplest to just add
this patch there and merge in during the v3.12 merge window.

Bjorn

2013-08-19 20:56:50

by Stephen Warren

[permalink] [raw]
Subject: Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource

On 08/19/2013 01:33 PM, Thierry Reding wrote:
> On Mon, Aug 19, 2013 at 02:15:39PM +0200, Julia Lawall wrote:
>>
>>
>> On Mon, 19 Aug 2013, Thierry Reding wrote:
>>
>>> On Mon, Aug 19, 2013 at 02:07:54PM +0200, Julia Lawall wrote:
>>>>
>>>>
>>>> On Mon, 19 Aug 2013, Thierry Reding wrote:
>>>>
>>>>> On Mon, Aug 19, 2013 at 01:20:35PM +0200, Julia Lawall
>>>>> wrote:
>>>>>> From: Julia Lawall <[email protected]>
>>>>>>
>>>>>> Use devm_ioremap_resource instead of
>>>>>> devm_request_and_ioremap.
>>>>>>
>>>>>> This was done using the semantic patch
>>>>>> scripts/coccinelle/api/devm_ioremap_resource.cocci
>>>>>>
>>>>>> Error-handling code was manually removed from the
>>>>>> associated calls to platform_get_resource.
>>>>>>
>>>>>> Signed-off-by: Julia Lawall <[email protected]>
>>>>>>
>>>>>> --- The first block of modified code is followed by a
>>>>>> call to devm_request_mem_region for pcie->cs with no
>>>>>> associated ioremap. Should ioremap be used in this case
>>>>>> as well?
>>>>>
>>>>> No. The pcie->cs resource is 256 MiB so it's challenging to
>>>>> map it at once. Furthermore it requires a non-linear
>>>>> mapping so we do it on demand.
>>>>
>>>> OK, thanks for the explanation. Is the comment, though, a
>>>> little misleading, since the mapping is not done here?
>>>>
>>>> /* request and remap configuration space */
>>>
>>> Yes, that's misleading. Given that it doesn't really add
>>> anything useful information either, perhaps I should just
>>> remove it.
>>
>> OK, or maybe something like
>>
>> /* request configuration space, but remap later, on demand */
>>
>> To make it clear that something different is intended than the
>> devm_ioremap_resources that come just before..
>
> Yes, that works for me too. Can you respin the patch with the
> comment updated and my Acked-by and Tested-by so Bjorn can pick it
> up?

Just a note though: Since the Tegra PCIe driver is only being added in
v3.12-rc1, and that add is happening in the Tegra/arm-soc tree, Bjorn
won't be able to accept the patch until after v3.12-rc1. Perhaps the
arm-soc tree could take the patch before then though...

2013-08-20 09:13:38

by Julia Lawall

[permalink] [raw]
Subject: Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource

From: Julia Lawall <[email protected]>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci

Error-handling code was manually removed from the associated calls to
platform_get_resource.

Adjust the comment at the third platform_get_resource_byname to make clear
why ioremap is not done at this point.

Signed-off-by: Julia Lawall <[email protected]>
Acked-by: Thierry Reding <[email protected]>
Tested-by: Thierry Reding <[email protected]>

---
v2: add the change to the comment

drivers/pci/host/pci-tegra.c | 31 ++++++++++---------------------
1 file changed, 10 insertions(+), 21 deletions(-)

diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index 7356741..2e9888a 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -1031,32 +1031,21 @@ static int tegra_pcie_get_resources(struct tegra_pcie *pcie)
return err;
}

- /* request and remap controller registers */
pads = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pads");
- if (!pads) {
- err = -EADDRNOTAVAIL;
+ pcie->pads = devm_ioremap_resource(&pdev->dev, pads);
+ if (IS_ERR(pcie->pads)) {
+ err = PTR_ERR(pcie->pads);
goto poweroff;
}

afi = platform_get_resource_byname(pdev, IORESOURCE_MEM, "afi");
- if (!afi) {
- err = -EADDRNOTAVAIL;
- goto poweroff;
- }
-
- pcie->pads = devm_request_and_ioremap(&pdev->dev, pads);
- if (!pcie->pads) {
- err = -EADDRNOTAVAIL;
- goto poweroff;
- }
-
- pcie->afi = devm_request_and_ioremap(&pdev->dev, afi);
- if (!pcie->afi) {
- err = -EADDRNOTAVAIL;
+ pcie->afi = devm_ioremap_resource(&pdev->dev, afi);
+ if (IS_ERR(pcie->afi)) {
+ err = PTR_ERR(pcie->afi);
goto poweroff;
}

- /* request and remap configuration space */
+ /* request configuration space, but remap later, on demand */
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cs");
if (!res) {
err = -EADDRNOTAVAIL;
@@ -1492,9 +1481,9 @@ static int tegra_pcie_parse_dt(struct tegra_pcie *pcie)
rp->lanes = value;
rp->pcie = pcie;

- rp->base = devm_request_and_ioremap(pcie->dev, &rp->regs);
- if (!rp->base)
- return -EADDRNOTAVAIL;
+ rp->base = devm_ioremap_resource(pcie->dev, &rp->regs);
+ if (IS_ERR(rp->base))
+ return PTR_ERR(rp->base);

list_add_tail(&rp->list, &pcie->ports);
}

2013-08-20 11:35:38

by Will Deacon

[permalink] [raw]
Subject: Re: [PATCH 3/7] iommu/arm: replace devm_request_and_ioremap by devm_ioremap_resource

Hi Julia,

On Mon, Aug 19, 2013 at 12:20:37PM +0100, Julia Lawall wrote:
> From: Julia Lawall <[email protected]>
>
> Use devm_ioremap_resource instead of devm_request_and_ioremap.
>
> This was partly done using the semantic patch
> scripts/coccinelle/api/devm_ioremap_resource.cocci
>
> The error-handling code on the call to platform_get_resource was removed
> manually, and the initialization of smmu->size was manually moved lower, to
> take advantage of the NULL test on res performed by devm_ioremap_resource.
>
> Signed-off-by: Julia Lawall <[email protected]>
>
> ---
> drivers/iommu/arm-smmu.c | 11 +++--------
> 1 file changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
> index ebd0a4c..dd91465 100644
> --- a/drivers/iommu/arm-smmu.c
> +++ b/drivers/iommu/arm-smmu.c
> @@ -1761,15 +1761,10 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev)
> smmu->dev = dev;
>
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - if (!res) {
> - dev_err(dev, "missing base address/size\n");
> - return -ENODEV;
> - }
> -
> + smmu->base = devm_ioremap_resource(dev, res);
> + if (IS_ERR(smmu->base))
> + return PTR_ERR(smmu->base);
> smmu->size = resource_size(res);
> - smmu->base = devm_request_and_ioremap(dev, res);
> - if (!smmu->base)
> - return -EADDRNOTAVAIL;

This does mean we trade arguably more useful error codes for the catch-all
-EINVAL, but the code ends up looking neater so I can be swayed either way.

Is this part of a series you're dealing with, or would you like me to take
this (I already sent my SMMU patches for 3.12)?

Cheers,

Will

2013-08-20 11:49:48

by Julia Lawall

[permalink] [raw]
Subject: Re: [PATCH 3/7] iommu/arm: replace devm_request_and_ioremap by devm_ioremap_resource



On Tue, 20 Aug 2013, Will Deacon wrote:

> Hi Julia,
>
> On Mon, Aug 19, 2013 at 12:20:37PM +0100, Julia Lawall wrote:
> > From: Julia Lawall <[email protected]>
> >
> > Use devm_ioremap_resource instead of devm_request_and_ioremap.
> >
> > This was partly done using the semantic patch
> > scripts/coccinelle/api/devm_ioremap_resource.cocci
> >
> > The error-handling code on the call to platform_get_resource was removed
> > manually, and the initialization of smmu->size was manually moved lower, to
> > take advantage of the NULL test on res performed by devm_ioremap_resource.
> >
> > Signed-off-by: Julia Lawall <[email protected]>
> >
> > ---
> > drivers/iommu/arm-smmu.c | 11 +++--------
> > 1 file changed, 3 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
> > index ebd0a4c..dd91465 100644
> > --- a/drivers/iommu/arm-smmu.c
> > +++ b/drivers/iommu/arm-smmu.c
> > @@ -1761,15 +1761,10 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev)
> > smmu->dev = dev;
> >
> > res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > - if (!res) {
> > - dev_err(dev, "missing base address/size\n");
> > - return -ENODEV;
> > - }
> > -
> > + smmu->base = devm_ioremap_resource(dev, res);
> > + if (IS_ERR(smmu->base))
> > + return PTR_ERR(smmu->base);
> > smmu->size = resource_size(res);
> > - smmu->base = devm_request_and_ioremap(dev, res);
> > - if (!smmu->base)
> > - return -EADDRNOTAVAIL;
>
> This does mean we trade arguably more useful error codes for the catch-all
> -EINVAL, but the code ends up looking neater so I can be swayed either way.
>
> Is this part of a series you're dealing with, or would you like me to take
> this (I already sent my SMMU patches for 3.12)?

Please take it onwards. Thanks.

julia

2013-08-20 16:26:38

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource

On Tue, Aug 20, 2013 at 3:13 AM, Julia Lawall <[email protected]> wrote:
> From: Julia Lawall <[email protected]>
>
> Use devm_ioremap_resource instead of devm_request_and_ioremap.
>
> This was done using the semantic patch
> scripts/coccinelle/api/devm_ioremap_resource.cocci
>
> Error-handling code was manually removed from the associated calls to
> platform_get_resource.
>
> Adjust the comment at the third platform_get_resource_byname to make clear
> why ioremap is not done at this point.
>
> Signed-off-by: Julia Lawall <[email protected]>
> Acked-by: Thierry Reding <[email protected]>
> Tested-by: Thierry Reding <[email protected]>

I'm hoping this goes via arm-soc. Let me know if you need me to do
something. If you need it:

Acked-by: Bjorn Helgaas <[email protected]>

> ---
> v2: add the change to the comment
>
> drivers/pci/host/pci-tegra.c | 31 ++++++++++---------------------
> 1 file changed, 10 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
> index 7356741..2e9888a 100644
> --- a/drivers/pci/host/pci-tegra.c
> +++ b/drivers/pci/host/pci-tegra.c
> @@ -1031,32 +1031,21 @@ static int tegra_pcie_get_resources(struct tegra_pcie *pcie)
> return err;
> }
>
> - /* request and remap controller registers */
> pads = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pads");
> - if (!pads) {
> - err = -EADDRNOTAVAIL;
> + pcie->pads = devm_ioremap_resource(&pdev->dev, pads);
> + if (IS_ERR(pcie->pads)) {
> + err = PTR_ERR(pcie->pads);
> goto poweroff;
> }
>
> afi = platform_get_resource_byname(pdev, IORESOURCE_MEM, "afi");
> - if (!afi) {
> - err = -EADDRNOTAVAIL;
> - goto poweroff;
> - }
> -
> - pcie->pads = devm_request_and_ioremap(&pdev->dev, pads);
> - if (!pcie->pads) {
> - err = -EADDRNOTAVAIL;
> - goto poweroff;
> - }
> -
> - pcie->afi = devm_request_and_ioremap(&pdev->dev, afi);
> - if (!pcie->afi) {
> - err = -EADDRNOTAVAIL;
> + pcie->afi = devm_ioremap_resource(&pdev->dev, afi);
> + if (IS_ERR(pcie->afi)) {
> + err = PTR_ERR(pcie->afi);
> goto poweroff;
> }
>
> - /* request and remap configuration space */
> + /* request configuration space, but remap later, on demand */
> res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cs");
> if (!res) {
> err = -EADDRNOTAVAIL;
> @@ -1492,9 +1481,9 @@ static int tegra_pcie_parse_dt(struct tegra_pcie *pcie)
> rp->lanes = value;
> rp->pcie = pcie;
>
> - rp->base = devm_request_and_ioremap(pcie->dev, &rp->regs);
> - if (!rp->base)
> - return -EADDRNOTAVAIL;
> + rp->base = devm_ioremap_resource(pcie->dev, &rp->regs);
> + if (IS_ERR(rp->base))
> + return PTR_ERR(rp->base);
>
> list_add_tail(&rp->list, &pcie->ports);
> }

2013-08-20 18:53:38

by Stephen Warren

[permalink] [raw]
Subject: Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource

On 08/20/2013 10:26 AM, Bjorn Helgaas wrote:
> On Tue, Aug 20, 2013 at 3:13 AM, Julia Lawall <[email protected]> wrote:
>> From: Julia Lawall <[email protected]>
>>
>> Use devm_ioremap_resource instead of devm_request_and_ioremap.
>>
>> This was done using the semantic patch
>> scripts/coccinelle/api/devm_ioremap_resource.cocci
>>
>> Error-handling code was manually removed from the associated calls to
>> platform_get_resource.
>>
>> Adjust the comment at the third platform_get_resource_byname to make clear
>> why ioremap is not done at this point.
>>
>> Signed-off-by: Julia Lawall <[email protected]>
>> Acked-by: Thierry Reding <[email protected]>
>> Tested-by: Thierry Reding <[email protected]>
>
> I'm hoping this goes via arm-soc. Let me know if you need me to do
> something. If you need it:
>
> Acked-by: Bjorn Helgaas <[email protected]>

In that case, Thierry, can you please bounce it to [email protected] to be
applied on top of wherever Tegra's for-3.12/soc branch was merged.

Acked-by: Stephen Warren <[email protected]>

2013-08-20 19:31:37

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource

On Tue, Aug 20, 2013 at 12:53:32PM -0600, Stephen Warren wrote:
> On 08/20/2013 10:26 AM, Bjorn Helgaas wrote:
> > On Tue, Aug 20, 2013 at 3:13 AM, Julia Lawall <[email protected]> wrote:
> >> From: Julia Lawall <[email protected]>
> >>
> >> Use devm_ioremap_resource instead of devm_request_and_ioremap.
> >>
> >> This was done using the semantic patch
> >> scripts/coccinelle/api/devm_ioremap_resource.cocci
> >>
> >> Error-handling code was manually removed from the associated calls to
> >> platform_get_resource.
> >>
> >> Adjust the comment at the third platform_get_resource_byname to make clear
> >> why ioremap is not done at this point.
> >>
> >> Signed-off-by: Julia Lawall <[email protected]>
> >> Acked-by: Thierry Reding <[email protected]>
> >> Tested-by: Thierry Reding <[email protected]>
> >
> > I'm hoping this goes via arm-soc. Let me know if you need me to do
> > something. If you need it:
> >
> > Acked-by: Bjorn Helgaas <[email protected]>
>
> In that case, Thierry, can you please bounce it to [email protected] to be
> applied on top of wherever Tegra's for-3.12/soc branch was merged.
>
> Acked-by: Stephen Warren <[email protected]>

Yes, I can do that. Thanks everyone.

Thierry


Attachments:
(No filename) (1.21 kB)
(No filename) (836.00 B)
Download all attachments

2013-08-21 06:22:43

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 5/7] bcm63xx_enet: replace devm_request_and_ioremap by devm_ioremap_resource

From: Julia Lawall <[email protected]>
Date: Mon, 19 Aug 2013 13:20:39 +0200

> From: Julia Lawall <[email protected]>
>
> Use devm_ioremap_resource instead of devm_request_and_ioremap.
>
> This was done using the semantic patch
> scripts/coccinelle/api/devm_ioremap_resource.cocci
>
> The relevant call to platform_get_resource was manually moved down to the
> call to devm_ioremap_resource.
>
> Signed-off-by: Julia Lawall <[email protected]>

Applied to net-next, thanks.

2013-08-27 08:15:23

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource

On Mon, Aug 19, 2013 at 02:49:07PM -0600, Bjorn Helgaas wrote:
> On Mon, Aug 19, 2013 at 2:12 PM, Thierry Reding
> <[email protected]> wrote:
> > On Mon, Aug 19, 2013 at 02:04:24PM -0600, Bjorn Helgaas wrote:
> >> On Mon, Aug 19, 2013 at 6:02 AM, Thierry Reding
> >> <[email protected]> wrote:
> >>
> >> > Bjorn, how do you want to handle patches to the Tegra PCIe driver in the
> >> > future? Do you want me to prepare a branch and pull from that or would
> >> > you rather just take simple patches?
> >>
> >> I'm in the habit of applying patches from email, so that's easy for
> >> me. But a branch would be OK, too.
> >
> > Patches work for me too. Is this cleanup patch something that you'd be
> > comfortable with applying after 3.12-rc1 or would you rather defer it to
> > 3.13?
>
> I'm not really sure how we should manage drivers/pci/host/*. Those
> files are mostly arch code, and I'm not sure it's useful for me to be
> in the middle of managing them.
>
> I assume Stephen or somebody has a tree with the pci-tegra.c stuff
> that's in -next right now; it seems like it'd be simplest to just add
> this patch there and merge in during the v3.12 merge window.

If Stephen's fine with it I suppose we could take pci-tegra.c driver
changes through the Tegra tree. But I think it'd be good if we could
still Cc you on patches so you're aware of what we're doing (that is
the same for all drivers drivers/pci/host/*). And we're going to need
your Acked-by on the patches as well.

Thierry


Attachments:
(No filename) (1.48 kB)
(No filename) (836.00 B)
Download all attachments

2013-08-27 16:11:12

by Stephen Warren

[permalink] [raw]
Subject: Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource

On 08/27/2013 02:14 AM, Thierry Reding wrote:
> On Mon, Aug 19, 2013 at 02:49:07PM -0600, Bjorn Helgaas wrote:
>> On Mon, Aug 19, 2013 at 2:12 PM, Thierry Reding
>> <[email protected]> wrote:
>>> On Mon, Aug 19, 2013 at 02:04:24PM -0600, Bjorn Helgaas wrote:
>>>> On Mon, Aug 19, 2013 at 6:02 AM, Thierry Reding
>>>> <[email protected]> wrote:
>>>>
>>>>> Bjorn, how do you want to handle patches to the Tegra PCIe
>>>>> driver in the future? Do you want me to prepare a branch
>>>>> and pull from that or would you rather just take simple
>>>>> patches?
>>>>
>>>> I'm in the habit of applying patches from email, so that's
>>>> easy for me. But a branch would be OK, too.
>>>
>>> Patches work for me too. Is this cleanup patch something that
>>> you'd be comfortable with applying after 3.12-rc1 or would you
>>> rather defer it to 3.13?
>>
>> I'm not really sure how we should manage drivers/pci/host/*.
>> Those files are mostly arch code, and I'm not sure it's useful
>> for me to be in the middle of managing them.
>>
>> I assume Stephen or somebody has a tree with the pci-tegra.c
>> stuff that's in -next right now; it seems like it'd be simplest
>> to just add this patch there and merge in during the v3.12 merge
>> window.
>
> If Stephen's fine with it I suppose we could take pci-tegra.c
> driver changes through the Tegra tree. But I think it'd be good if
> we could still Cc you on patches so you're aware of what we're
> doing (that is the same for all drivers drivers/pci/host/*). And
> we're going to need your Acked-by on the patches as well.

I can push Tegra PCIe patches through the arm-soc tree before
3.12-rc1, but after that point, I think it's best if they go through
the PCIe tree, unless there's some cross-subsystem dependency for a
specific patch, and with the new PCIe driver, that's less likely.

2013-08-27 18:03:25

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource

On Tue, Aug 27, 2013 at 10:11 AM, Stephen Warren <[email protected]> wrote:
> On 08/27/2013 02:14 AM, Thierry Reding wrote:
>> On Mon, Aug 19, 2013 at 02:49:07PM -0600, Bjorn Helgaas wrote:
>>> On Mon, Aug 19, 2013 at 2:12 PM, Thierry Reding
>>> <[email protected]> wrote:
>>>> On Mon, Aug 19, 2013 at 02:04:24PM -0600, Bjorn Helgaas wrote:
>>>>> On Mon, Aug 19, 2013 at 6:02 AM, Thierry Reding
>>>>> <[email protected]> wrote:
>>>>>
>>>>>> Bjorn, how do you want to handle patches to the Tegra PCIe
>>>>>> driver in the future? Do you want me to prepare a branch
>>>>>> and pull from that or would you rather just take simple
>>>>>> patches?
>>>>>
>>>>> I'm in the habit of applying patches from email, so that's
>>>>> easy for me. But a branch would be OK, too.
>>>>
>>>> Patches work for me too. Is this cleanup patch something that
>>>> you'd be comfortable with applying after 3.12-rc1 or would you
>>>> rather defer it to 3.13?
>>>
>>> I'm not really sure how we should manage drivers/pci/host/*.
>>> Those files are mostly arch code, and I'm not sure it's useful
>>> for me to be in the middle of managing them.
>>>
>>> I assume Stephen or somebody has a tree with the pci-tegra.c
>>> stuff that's in -next right now; it seems like it'd be simplest
>>> to just add this patch there and merge in during the v3.12 merge
>>> window.
>>
>> If Stephen's fine with it I suppose we could take pci-tegra.c
>> driver changes through the Tegra tree. But I think it'd be good if
>> we could still Cc you on patches so you're aware of what we're
>> doing (that is the same for all drivers drivers/pci/host/*). And
>> we're going to need your Acked-by on the patches as well.

I think you have my Acked-by for this case already (from Aug 20). And
feel free to copy me on anything you like; my delete key works well :)

> I can push Tegra PCIe patches through the arm-soc tree before
> 3.12-rc1, but after that point, I think it's best if they go through
> the PCIe tree, unless there's some cross-subsystem dependency for a
> specific patch, and with the new PCIe driver, that's less likely.

I'm OK with merging things through my tree. It just seemed like there
was a lot of recent Tegra activity that included a few Tegra PCI
changes, and no benefit to trying to split the PCI stuff from the
non-PCI stuff. Hopefully it will calm down, because I don't have time
to be in the middle of major Tegra stuff.

Bjorn

2013-08-28 13:02:40

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource

On Tue, Aug 27, 2013 at 12:03 PM, Bjorn Helgaas <[email protected]> wrote:
>> On 08/27/2013 02:14 AM, Thierry Reding wrote:

>>> If Stephen's fine with it I suppose we could take pci-tegra.c
>>> driver changes through the Tegra tree. But I think it'd be good if
>>> we could still Cc you on patches so you're aware of what we're
>>> doing (that is the same for all drivers drivers/pci/host/*). And
>>> we're going to need your Acked-by on the patches as well.
>
> I think you have my Acked-by for this case already (from Aug 20). And
> feel free to copy me on anything you like; my delete key works well :)

I didn't mean for this to sound like "I'll just delete any email you
send me"; I intended more like "feel free to copy me and if it's
something I'm interested or knowledgeable about, I'll try to help and
if not, it's easy for me to ignore it."

Bjorn

2013-08-28 13:28:09

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource

On Wed, Aug 28, 2013 at 07:02:16AM -0600, Bjorn Helgaas wrote:
> On Tue, Aug 27, 2013 at 12:03 PM, Bjorn Helgaas <[email protected]> wrote:
> >> On 08/27/2013 02:14 AM, Thierry Reding wrote:
>
> >>> If Stephen's fine with it I suppose we could take pci-tegra.c
> >>> driver changes through the Tegra tree. But I think it'd be good if
> >>> we could still Cc you on patches so you're aware of what we're
> >>> doing (that is the same for all drivers drivers/pci/host/*). And
> >>> we're going to need your Acked-by on the patches as well.
> >
> > I think you have my Acked-by for this case already (from Aug 20). And
> > feel free to copy me on anything you like; my delete key works well :)
>
> I didn't mean for this to sound like "I'll just delete any email you
> send me"; I intended more like "feel free to copy me and if it's
> something I'm interested or knowledgeable about, I'll try to help and
> if not, it's easy for me to ignore it."

That's exactly the way I understood it. =)

Thierry


Attachments:
(No filename) (0.98 kB)
(No filename) (836.00 B)
Download all attachments

2013-08-28 13:32:07

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH 1/7] PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource

On Tue, Aug 27, 2013 at 12:03:01PM -0600, Bjorn Helgaas wrote:
> On Tue, Aug 27, 2013 at 10:11 AM, Stephen Warren <[email protected]> wrote:
> > On 08/27/2013 02:14 AM, Thierry Reding wrote:
> >> On Mon, Aug 19, 2013 at 02:49:07PM -0600, Bjorn Helgaas wrote:
> >>> On Mon, Aug 19, 2013 at 2:12 PM, Thierry Reding
> >>> <[email protected]> wrote:
> >>>> On Mon, Aug 19, 2013 at 02:04:24PM -0600, Bjorn Helgaas wrote:
> >>>>> On Mon, Aug 19, 2013 at 6:02 AM, Thierry Reding
> >>>>> <[email protected]> wrote:
> >>>>>
> >>>>>> Bjorn, how do you want to handle patches to the Tegra PCIe
> >>>>>> driver in the future? Do you want me to prepare a branch
> >>>>>> and pull from that or would you rather just take simple
> >>>>>> patches?
> >>>>>
> >>>>> I'm in the habit of applying patches from email, so that's
> >>>>> easy for me. But a branch would be OK, too.
> >>>>
> >>>> Patches work for me too. Is this cleanup patch something that
> >>>> you'd be comfortable with applying after 3.12-rc1 or would you
> >>>> rather defer it to 3.13?
> >>>
> >>> I'm not really sure how we should manage drivers/pci/host/*.
> >>> Those files are mostly arch code, and I'm not sure it's useful
> >>> for me to be in the middle of managing them.
> >>>
> >>> I assume Stephen or somebody has a tree with the pci-tegra.c
> >>> stuff that's in -next right now; it seems like it'd be simplest
> >>> to just add this patch there and merge in during the v3.12 merge
> >>> window.
> >>
> >> If Stephen's fine with it I suppose we could take pci-tegra.c
> >> driver changes through the Tegra tree. But I think it'd be good if
> >> we could still Cc you on patches so you're aware of what we're
> >> doing (that is the same for all drivers drivers/pci/host/*). And
> >> we're going to need your Acked-by on the patches as well.
>
> I think you have my Acked-by for this case already (from Aug 20). And
> feel free to copy me on anything you like; my delete key works well :)
>
> > I can push Tegra PCIe patches through the arm-soc tree before
> > 3.12-rc1, but after that point, I think it's best if they go through
> > the PCIe tree, unless there's some cross-subsystem dependency for a
> > specific patch, and with the new PCIe driver, that's less likely.
>
> I'm OK with merging things through my tree. It just seemed like there
> was a lot of recent Tegra activity that included a few Tegra PCI
> changes, and no benefit to trying to split the PCI stuff from the
> non-PCI stuff. Hopefully it will calm down, because I don't have time
> to be in the middle of major Tegra stuff.

Yes, I think it will calm down. The difficulty this time around was that
there were various dependencies across multiple trees that needed to be
coordinated. As Stephen already mentioned, part of the reason to move
the driver out of arch/arm/mach-tegra was to make it stand on its own.

Thierry


Attachments:
(No filename) (2.81 kB)
(No filename) (836.00 B)
Download all attachments

2013-08-30 09:42:37

by Tomi Valkeinen

[permalink] [raw]
Subject: Re: [PATCH 6/7] video: xilinxfb: replace devm_request_and_ioremap by devm_ioremap_resource

On 19/08/13 14:20, Julia Lawall wrote:
> From: Julia Lawall <[email protected]>
>
> Use devm_ioremap_resource instead of devm_request_and_ioremap.
>
> This was done using the semantic patch
> scripts/coccinelle/api/devm_ioremap_resource.cocci
>
> The initialization of drvdata->regs_phys was manually moved lower, to take
> advantage of the NULL test on res performed by devm_ioremap_resource.
>
> Signed-off-by: Julia Lawall <[email protected]>
>
> ---
> drivers/video/xilinxfb.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
> index 6629b29..84c664e 100644
> --- a/drivers/video/xilinxfb.c
> +++ b/drivers/video/xilinxfb.c
> @@ -259,12 +259,12 @@ static int xilinxfb_assign(struct platform_device *pdev,
> struct resource *res;
>
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - drvdata->regs_phys = res->start;
> - drvdata->regs = devm_request_and_ioremap(&pdev->dev, res);
> - if (!drvdata->regs) {
> - rc = -EADDRNOTAVAIL;
> + drvdata->regs = devm_ioremap_resource(&pdev->dev, res);
> + if (IS_ERR(drvdata->regs)) {
> + rc = PTR_ERR(drvdata->regs);
> goto err_region;
> }
> + drvdata->regs_phys = res->start;
> }
>
> /* Allocate the framebuffer memory */

Thanks, queued for 3.12.

Tomi




Attachments:
signature.asc (901.00 B)
OpenPGP digital signature

2013-09-02 12:53:49

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH 4/7] dma: replace devm_request_and_ioremap by devm_ioremap_resource

On Mon, Aug 19, 2013 at 01:20:38PM +0200, Julia Lawall wrote:
> From: Julia Lawall <[email protected]>
>
> Use devm_ioremap_resource instead of devm_request_and_ioremap.
>
> This was done using the semantic patch
> scripts/coccinelle/api/devm_ioremap_resource.cocci
>
> The relevant call to platform_get_resource was manually moved down to the
> call to devm_ioremap_resource.
Applied, thanks

~Vinod