Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1626526 > unrolled thread

[PATCH v4 14/21] PCI: designware: update PCI config space remap function

Started byLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
First post2017-04-19 18:50 +0200
Last post2017-04-22 00:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v4 14/21] PCI: designware: update PCI config space remap function Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2017-04-19 18:50 +0200
    Re: [PATCH v4 14/21] PCI: designware: update PCI config space remap function "Jingoo Han" <jingoohan1@gmail.com> - 2017-04-22 00:10 +0200

#1626526 — [PATCH v4 14/21] PCI: designware: update PCI config space remap function

FromLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Date2017-04-19 18:50 +0200
Subject[PATCH v4 14/21] PCI: designware: update PCI config space remap function
Message-ID<ty0XN-5M7-55@gated-at.bofh.it>
PCI configuration space should be mapped with a memory region type that
generates on the CPU host bus non-posted write transations. Update the
driver to use the devm_pci_remap_cfg* interface to make sure the correct
memory mappings for PCI configuration space are used.

Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Jingoo Han <jingoohan1@gmail.com>
Cc: Joao Pinto <Joao.Pinto@synopsys.com>
---
 drivers/pci/dwc/pcie-designware-host.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/pci/dwc/pcie-designware-host.c b/drivers/pci/dwc/pcie-designware-host.c
index 5ba3349..2b789af 100644
--- a/drivers/pci/dwc/pcie-designware-host.c
+++ b/drivers/pci/dwc/pcie-designware-host.c
@@ -338,8 +338,9 @@ int dw_pcie_host_init(struct pcie_port *pp)
 	}
 
 	if (!pci->dbi_base) {
-		pci->dbi_base = devm_ioremap(dev, pp->cfg->start,
-					resource_size(pp->cfg));
+		pci->dbi_base = devm_pci_remap_cfgspace(dev,
+						pp->cfg->start,
+						resource_size(pp->cfg));
 		if (!pci->dbi_base) {
 			dev_err(dev, "error with ioremap\n");
 			ret = -ENOMEM;
@@ -350,8 +351,8 @@ int dw_pcie_host_init(struct pcie_port *pp)
 	pp->mem_base = pp->mem->start;
 
 	if (!pp->va_cfg0_base) {
-		pp->va_cfg0_base = devm_ioremap(dev, pp->cfg0_base,
-						pp->cfg0_size);
+		pp->va_cfg0_base = devm_pci_remap_cfgspace(dev,
+					pp->cfg0_base, pp->cfg0_size);
 		if (!pp->va_cfg0_base) {
 			dev_err(dev, "error with ioremap in function\n");
 			ret = -ENOMEM;
@@ -360,7 +361,8 @@ int dw_pcie_host_init(struct pcie_port *pp)
 	}
 
 	if (!pp->va_cfg1_base) {
-		pp->va_cfg1_base = devm_ioremap(dev, pp->cfg1_base,
+		pp->va_cfg1_base = devm_pci_remap_cfgspace(dev,
+						pp->cfg1_base,
 						pp->cfg1_size);
 		if (!pp->va_cfg1_base) {
 			dev_err(dev, "error with ioremap\n");
-- 
2.10.0

[toc] | [next] | [standalone]


#1628639

From"Jingoo Han" <jingoohan1@gmail.com>
Date2017-04-22 00:10 +0200
Message-ID<tyOUx-2RV-3@gated-at.bofh.it>
In reply to#1626526
On Wednesday, April 19, 2017 12:49 PM, Lorenzo Pieralisi wrote:
> 
> PCI configuration space should be mapped with a memory region type that
> generates on the CPU host bus non-posted write transations. Update the
> driver to use the devm_pci_remap_cfg* interface to make sure the correct
> memory mappings for PCI configuration space are used.
> 
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Jingoo Han <jingoohan1@gmail.com>

Acked-by: Jingoo Han <jingoohan1@gmail.com>

Best regards,
Jingoo Han


> Cc: Joao Pinto <Joao.Pinto@synopsys.com>
> ---
>  drivers/pci/dwc/pcie-designware-host.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/pci/dwc/pcie-designware-host.c
> b/drivers/pci/dwc/pcie-designware-host.c
> index 5ba3349..2b789af 100644
> --- a/drivers/pci/dwc/pcie-designware-host.c
> +++ b/drivers/pci/dwc/pcie-designware-host.c
> @@ -338,8 +338,9 @@ int dw_pcie_host_init(struct pcie_port *pp)
>  	}
> 
>  	if (!pci->dbi_base) {
> -		pci->dbi_base = devm_ioremap(dev, pp->cfg->start,
> -					resource_size(pp->cfg));
> +		pci->dbi_base = devm_pci_remap_cfgspace(dev,
> +						pp->cfg->start,
> +						resource_size(pp->cfg));
>  		if (!pci->dbi_base) {
>  			dev_err(dev, "error with ioremap\n");
>  			ret = -ENOMEM;
> @@ -350,8 +351,8 @@ int dw_pcie_host_init(struct pcie_port *pp)
>  	pp->mem_base = pp->mem->start;
> 
>  	if (!pp->va_cfg0_base) {
> -		pp->va_cfg0_base = devm_ioremap(dev, pp->cfg0_base,
> -						pp->cfg0_size);
> +		pp->va_cfg0_base = devm_pci_remap_cfgspace(dev,
> +					pp->cfg0_base, pp->cfg0_size);
>  		if (!pp->va_cfg0_base) {
>  			dev_err(dev, "error with ioremap in function\n");
>  			ret = -ENOMEM;
> @@ -360,7 +361,8 @@ int dw_pcie_host_init(struct pcie_port *pp)
>  	}
> 
>  	if (!pp->va_cfg1_base) {
> -		pp->va_cfg1_base = devm_ioremap(dev, pp->cfg1_base,
> +		pp->va_cfg1_base = devm_pci_remap_cfgspace(dev,
> +						pp->cfg1_base,
>  						pp->cfg1_size);
>  		if (!pp->va_cfg1_base) {
>  			dev_err(dev, "error with ioremap\n");
> --
> 2.10.0

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web