diff mbox

[v5,1/5] ARM/PCI: remove align_resource in pci_sys_data

Message ID 1437794486-21134-2-git-send-email-wangzhou1@hisilicon.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Zhou Wang July 25, 2015, 3:21 a.m. UTC
From: Gabriele Paoloni <gabriele.paoloni@huawei.com>

This patch is needed in order to unify the PCIe designware framework for ARM and
ARM64 architectures. In the PCIe designware unification process we are calling
pci_create_root_bus() passing a "sysdata" parameter that is the same for both
ARM and ARM64 and is of type "struct pcie_port*". In the ARM case this will
cause a problem with the function pcibios_align_resource(); in fact this will
cast "dev->sysdata" to "struct pci_sys_data*", whereas designware had passed a
"struct pcie_port*" pointer.

This patch solves the issue by removing "align_resource" from "pci_sys_data"
struct and defining a static global function pointer in "bios32.c"

Signed-off-by: Gabriele Paoloni <gabriele.paoloni@huawei.com>
---
 arch/arm/include/asm/mach/pci.h |  5 -----
 arch/arm/kernel/bios32.c        | 12 ++++++++----
 2 files changed, 8 insertions(+), 9 deletions(-)

Comments

Zhou Wang July 28, 2015, 7:17 a.m. UTC | #1
On 2015/7/25 11:21, Zhou Wang wrote:
> From: Gabriele Paoloni <gabriele.paoloni@huawei.com>
> 
> This patch is needed in order to unify the PCIe designware framework for ARM and
> ARM64 architectures. In the PCIe designware unification process we are calling
> pci_create_root_bus() passing a "sysdata" parameter that is the same for both
> ARM and ARM64 and is of type "struct pcie_port*". In the ARM case this will
> cause a problem with the function pcibios_align_resource(); in fact this will
> cast "dev->sysdata" to "struct pci_sys_data*", whereas designware had passed a
> "struct pcie_port*" pointer.
> 
> This patch solves the issue by removing "align_resource" from "pci_sys_data"
> struct and defining a static global function pointer in "bios32.c"
> 
> Signed-off-by: Gabriele Paoloni <gabriele.paoloni@huawei.com>

Hi Arnd and Rob,

What is your opinion about this patch? Gabriele adds a global pointer in bios32.c
to store align_resource, so we could remove sys->align_resource in pcibios_align_resource.

As Lorenzo mentioned in v4 series, this is a temporary solution before moving
align_resource to host bridge structure.

Any comments welcome.

Thanks,
Zhou

> ---
>  arch/arm/include/asm/mach/pci.h |  5 -----
>  arch/arm/kernel/bios32.c        | 12 ++++++++----
>  2 files changed, 8 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/arm/include/asm/mach/pci.h b/arch/arm/include/asm/mach/pci.h
> index 28b9bb3..8a4e4de 100644
> --- a/arch/arm/include/asm/mach/pci.h
> +++ b/arch/arm/include/asm/mach/pci.h
> @@ -58,11 +58,6 @@ struct pci_sys_data {
>  					/* IRQ mapping				*/
>  	int		(*map_irq)(const struct pci_dev *, u8, u8);
>  					/* Resource alignement requirements	*/
> -	resource_size_t (*align_resource)(struct pci_dev *dev,
> -					  const struct resource *res,
> -					  resource_size_t start,
> -					  resource_size_t size,
> -					  resource_size_t align);
>  	void		*private_data;	/* platform controller private data	*/
>  };
>  
> diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
> index fcbbbb1..4cdc64d 100644
> --- a/arch/arm/kernel/bios32.c
> +++ b/arch/arm/kernel/bios32.c
> @@ -17,6 +17,11 @@
>  #include <asm/mach/pci.h>
>  
>  static int debug_pci;
> +static resource_size_t (*align_resource)(struct pci_dev *dev,
> +		  const struct resource *res,
> +		  resource_size_t start,
> +		  resource_size_t size,
> +		  resource_size_t align) = NULL;
>  
>  #ifdef CONFIG_PCI_MSI
>  struct msi_controller *pcibios_msi_controller(struct pci_dev *dev)
> @@ -468,7 +473,7 @@ static void pcibios_init_hw(struct device *parent, struct hw_pci *hw,
>  		sys->busnr   = busnr;
>  		sys->swizzle = hw->swizzle;
>  		sys->map_irq = hw->map_irq;
> -		sys->align_resource = hw->align_resource;
> +		align_resource = hw->align_resource;
>  		INIT_LIST_HEAD(&sys->resources);
>  
>  		if (hw->private_data)
> @@ -589,7 +594,6 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res,
>  				resource_size_t size, resource_size_t align)
>  {
>  	struct pci_dev *dev = data;
> -	struct pci_sys_data *sys = dev->sysdata;
>  	resource_size_t start = res->start;
>  
>  	if (res->flags & IORESOURCE_IO && start & 0x300)
> @@ -597,8 +601,8 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res,
>  
>  	start = (start + align - 1) & ~(align - 1);
>  
> -	if (sys->align_resource)
> -		return sys->align_resource(dev, res, start, size, align);
> +	if (align_resource)
> +		return align_resource(dev, res, start, size, align);
>  
>  	return start;
>  }
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Lorenzo Pieralisi July 28, 2015, 5:44 p.m. UTC | #2
[CC'ing RMK]

On Tue, Jul 28, 2015 at 08:17:18AM +0100, Zhou Wang wrote:
> On 2015/7/25 11:21, Zhou Wang wrote:
> > From: Gabriele Paoloni <gabriele.paoloni@huawei.com>
> > 
> > This patch is needed in order to unify the PCIe designware framework for ARM and
> > ARM64 architectures. In the PCIe designware unification process we are calling
> > pci_create_root_bus() passing a "sysdata" parameter that is the same for both
> > ARM and ARM64 and is of type "struct pcie_port*". In the ARM case this will
> > cause a problem with the function pcibios_align_resource(); in fact this will
> > cast "dev->sysdata" to "struct pci_sys_data*", whereas designware had passed a
> > "struct pcie_port*" pointer.
> > 
> > This patch solves the issue by removing "align_resource" from "pci_sys_data"
> > struct and defining a static global function pointer in "bios32.c"
> > 
> > Signed-off-by: Gabriele Paoloni <gabriele.paoloni@huawei.com>
> 
> Hi Arnd and Rob,
> 
> What is your opinion about this patch? Gabriele adds a global pointer in bios32.c
> to store align_resource, so we could remove sys->align_resource in pcibios_align_resource.
> 
> As Lorenzo mentioned in v4 series, this is a temporary solution before moving
> align_resource to host bridge structure.
> 
> Any comments welcome.

The align_resource() pointer is just used in drivers/pci/host/pci-mvebu.c,
I would like the pci-mvebu.c maintainers to comment on this and test it, I
do not expect it to create any issue and might be a temporary solution to
make progress on ARM/ARM64 consolidation, it is a blocking point.

It would be good if Russell can have a look too, I do not see what
issue this can trigger given that is just used in:

drivers/pci/host/pci-mvebu.c

and a global pointer (not saying it is elegant, but it should work)
might be ok.

So yes, comments very welcome.

Thanks,
Lorenzo

> 
> Thanks,
> Zhou
> 
> > ---
> >  arch/arm/include/asm/mach/pci.h |  5 -----
> >  arch/arm/kernel/bios32.c        | 12 ++++++++----
> >  2 files changed, 8 insertions(+), 9 deletions(-)
> > 
> > diff --git a/arch/arm/include/asm/mach/pci.h b/arch/arm/include/asm/mach/pci.h
> > index 28b9bb3..8a4e4de 100644
> > --- a/arch/arm/include/asm/mach/pci.h
> > +++ b/arch/arm/include/asm/mach/pci.h
> > @@ -58,11 +58,6 @@ struct pci_sys_data {
> >  					/* IRQ mapping				*/
> >  	int		(*map_irq)(const struct pci_dev *, u8, u8);
> >  					/* Resource alignement requirements	*/
> > -	resource_size_t (*align_resource)(struct pci_dev *dev,
> > -					  const struct resource *res,
> > -					  resource_size_t start,
> > -					  resource_size_t size,
> > -					  resource_size_t align);
> >  	void		*private_data;	/* platform controller private data	*/
> >  };
> >  
> > diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
> > index fcbbbb1..4cdc64d 100644
> > --- a/arch/arm/kernel/bios32.c
> > +++ b/arch/arm/kernel/bios32.c
> > @@ -17,6 +17,11 @@
> >  #include <asm/mach/pci.h>
> >  
> >  static int debug_pci;
> > +static resource_size_t (*align_resource)(struct pci_dev *dev,
> > +		  const struct resource *res,
> > +		  resource_size_t start,
> > +		  resource_size_t size,
> > +		  resource_size_t align) = NULL;
> >  
> >  #ifdef CONFIG_PCI_MSI
> >  struct msi_controller *pcibios_msi_controller(struct pci_dev *dev)
> > @@ -468,7 +473,7 @@ static void pcibios_init_hw(struct device *parent, struct hw_pci *hw,
> >  		sys->busnr   = busnr;
> >  		sys->swizzle = hw->swizzle;
> >  		sys->map_irq = hw->map_irq;
> > -		sys->align_resource = hw->align_resource;
> > +		align_resource = hw->align_resource;
> >  		INIT_LIST_HEAD(&sys->resources);
> >  
> >  		if (hw->private_data)
> > @@ -589,7 +594,6 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res,
> >  				resource_size_t size, resource_size_t align)
> >  {
> >  	struct pci_dev *dev = data;
> > -	struct pci_sys_data *sys = dev->sysdata;
> >  	resource_size_t start = res->start;
> >  
> >  	if (res->flags & IORESOURCE_IO && start & 0x300)
> > @@ -597,8 +601,8 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res,
> >  
> >  	start = (start + align - 1) & ~(align - 1);
> >  
> > -	if (sys->align_resource)
> > -		return sys->align_resource(dev, res, start, size, align);
> > +	if (align_resource)
> > +		return align_resource(dev, res, start, size, align);
> >  
> >  	return start;
> >  }
> > 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rob Herring (Arm) July 30, 2015, 10:48 p.m. UTC | #3
On Tue, Jul 28, 2015 at 12:44 PM, Lorenzo Pieralisi
<lorenzo.pieralisi@arm.com> wrote:
> [CC'ing RMK]
>
> On Tue, Jul 28, 2015 at 08:17:18AM +0100, Zhou Wang wrote:
>> On 2015/7/25 11:21, Zhou Wang wrote:
>> > From: Gabriele Paoloni <gabriele.paoloni@huawei.com>
>> >
>> > This patch is needed in order to unify the PCIe designware framework for ARM and
>> > ARM64 architectures. In the PCIe designware unification process we are calling
>> > pci_create_root_bus() passing a "sysdata" parameter that is the same for both
>> > ARM and ARM64 and is of type "struct pcie_port*". In the ARM case this will
>> > cause a problem with the function pcibios_align_resource(); in fact this will
>> > cast "dev->sysdata" to "struct pci_sys_data*", whereas designware had passed a
>> > "struct pcie_port*" pointer.
>> >
>> > This patch solves the issue by removing "align_resource" from "pci_sys_data"
>> > struct and defining a static global function pointer in "bios32.c"
>> >
>> > Signed-off-by: Gabriele Paoloni <gabriele.paoloni@huawei.com>
>>
>> Hi Arnd and Rob,
>>
>> What is your opinion about this patch? Gabriele adds a global pointer in bios32.c
>> to store align_resource, so we could remove sys->align_resource in pcibios_align_resource.
>>
>> As Lorenzo mentioned in v4 series, this is a temporary solution before moving
>> align_resource to host bridge structure.
>>
>> Any comments welcome.
>
> The align_resource() pointer is just used in drivers/pci/host/pci-mvebu.c,
> I would like the pci-mvebu.c maintainers to comment on this and test it, I
> do not expect it to create any issue and might be a temporary solution to
> make progress on ARM/ARM64 consolidation, it is a blocking point.
>
> It would be good if Russell can have a look too, I do not see what
> issue this can trigger given that is just used in:

It's Russell's call on this if you want to touch bios32.c...

>
> drivers/pci/host/pci-mvebu.c
>
> and a global pointer (not saying it is elegant, but it should work)
> might be ok.
>
> So yes, comments very welcome.

I may be wrong, but I don't think even mvebu needs this as part of
pcibios_align_resource. pcibios_align_resource is called for every
device, but all mvebu should care about is the alignment of the root
bus BARs (and corresponding MBus windows) which can be handled in
probe. I can't see how regions within there matter. But that is just
my 10 minute look at it.

If not, then I think align_resource should be a common per host
function ptr. In other words, think about how to provide a default
implementation of pcibios_align_resource. They almost all look the
same to me with the same I/O 0x3xx address handling.

Rob
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Gabriele Paoloni July 31, 2015, 7:57 a.m. UTC | #4
SGkgUm9iLCBUaGFua3MgZm9yIHJldmlld2luZw0KDQo+IC0tLS0tT3JpZ2luYWwgTWVzc2FnZS0t
LS0tDQo+IEZyb206IHJvYmhlcnJpbmcyQGdtYWlsLmNvbSBbbWFpbHRvOnJvYmhlcnJpbmcyQGdt
YWlsLmNvbV0gT24gQmVoYWxmIE9mIFJvYg0KPiBIZXJyaW5nDQo+IFNlbnQ6IDMwIEp1bHkgMjAx
NSAyMzo0OA0KPiBUbzogTG9yZW56byBQaWVyYWxpc2k7IFJ1c3NlbGwgS2luZyAtIEFSTSBMaW51
eDsgV2FuZ3pob3UgKEI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Elm
IG5vdCwgdGhlbiBJIHRoaW5rIGFsaWduX3Jlc291cmNlIHNob3VsZCBiZSBhIGNvbW1vbiBwZXIg
aG9zdA0KPiBmdW5jdGlvbiBwdHIuIEluIG90aGVyIHdvcmRzLCB0aGluayBhYm91dCBob3cgdG8g
cHJvdmlkZSBhIGRlZmF1bHQNCj4gaW1wbGVtZW50YXRpb24gb2YgcGNpYmlvc19hbGlnbl9yZXNv
dXJjZS4gVGhleSBhbG1vc3QgYWxsIGxvb2sgdGhlDQo+IHNhbWUgdG8gbWUgd2l0aCB0aGUgc2Ft
ZSBJL08gMHgzeHggYWRkcmVzcyBoYW5kbGluZy4NCg0KcGNpYmlvc19hbGlnbl9yZXNvdXJjZSBh
bHJlYWR5IHByb3ZpZGVzIHRoZSBkZWZhdWx0IGFsaWdubWVudCBqb2IuDQpBcmUgeW91IHN1Z2dl
c3RpbmcgdG8gcmVwbGFjZSBwY2liaW9zX2FsaWduX3Jlc291cmNlcyBpbXBsZW1lbnRhdGlvbg0K
d2l0aCBhIHN0dWIgYW5kIG1vdmUgdGhlIGFsaWdubWVudCBqb2Igc29tZXdoZXJlIGVsc2UuLi4/
DQoNCj4gDQo+IFJvYg0K
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/include/asm/mach/pci.h b/arch/arm/include/asm/mach/pci.h
index 28b9bb3..8a4e4de 100644
--- a/arch/arm/include/asm/mach/pci.h
+++ b/arch/arm/include/asm/mach/pci.h
@@ -58,11 +58,6 @@  struct pci_sys_data {
 					/* IRQ mapping				*/
 	int		(*map_irq)(const struct pci_dev *, u8, u8);
 					/* Resource alignement requirements	*/
-	resource_size_t (*align_resource)(struct pci_dev *dev,
-					  const struct resource *res,
-					  resource_size_t start,
-					  resource_size_t size,
-					  resource_size_t align);
 	void		*private_data;	/* platform controller private data	*/
 };
 
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index fcbbbb1..4cdc64d 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -17,6 +17,11 @@ 
 #include <asm/mach/pci.h>
 
 static int debug_pci;
+static resource_size_t (*align_resource)(struct pci_dev *dev,
+		  const struct resource *res,
+		  resource_size_t start,
+		  resource_size_t size,
+		  resource_size_t align) = NULL;
 
 #ifdef CONFIG_PCI_MSI
 struct msi_controller *pcibios_msi_controller(struct pci_dev *dev)
@@ -468,7 +473,7 @@  static void pcibios_init_hw(struct device *parent, struct hw_pci *hw,
 		sys->busnr   = busnr;
 		sys->swizzle = hw->swizzle;
 		sys->map_irq = hw->map_irq;
-		sys->align_resource = hw->align_resource;
+		align_resource = hw->align_resource;
 		INIT_LIST_HEAD(&sys->resources);
 
 		if (hw->private_data)
@@ -589,7 +594,6 @@  resource_size_t pcibios_align_resource(void *data, const struct resource *res,
 				resource_size_t size, resource_size_t align)
 {
 	struct pci_dev *dev = data;
-	struct pci_sys_data *sys = dev->sysdata;
 	resource_size_t start = res->start;
 
 	if (res->flags & IORESOURCE_IO && start & 0x300)
@@ -597,8 +601,8 @@  resource_size_t pcibios_align_resource(void *data, const struct resource *res,
 
 	start = (start + align - 1) & ~(align - 1);
 
-	if (sys->align_resource)
-		return sys->align_resource(dev, res, start, size, align);
+	if (align_resource)
+		return align_resource(dev, res, start, size, align);
 
 	return start;
 }