PCI: Increase resource array mask bit size in pcim_iomap_regions()
Subsystems (2)
PATCH 1/1 PCI: Increase resource array mask bit size in pcim_iomap_regions()
DEVICE_COUNT_RESOURCE will be bigger than 16 when SRIOV supported is enabled.
Let them pass with int just like pci_enable_resources().
--- include/linux/pci.h | 6 +++--- lib/devres.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)
include/linux/pci.h +3 -3
@@ -1433,10 +1433,10 @@ static inline void pci_fixup_device(enumvoid __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,u16 mask,const char *name); -int pcim_iomap_regions_request_all (struct pci_dev *pdev,u16 mask, +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,u16 mask); +void pcim_iounmap_regions (struct pci_dev *pdev,int mask);extern int pci_pci_problems;#define PCIPCI_FAIL 1/* No PCI PCI DMA */
lib/devres.c +3 -3
@@ -253,7 +253,7 @@ EXPORT_SYMBOL(pcim_iounmap);* * Request and iomap regions specified by @mask. */ -int pcim_iomap_regions (struct pci_dev *pdev,u16 mask,const char *name) +int pcim_iomap_regions (struct pci_dev *pdev,int mask,const char *name) {void __iomem *const *iomap;int i, rc;
@@ -306,7 +306,7 @@ EXPORT_SYMBOL(pcim_iomap_regions);* * Request all PCI BARs and iomap regions specified by @mask. */ -int pcim_iomap_regions_request_all (struct pci_dev *pdev,u16 mask, +int pcim_iomap_regions_request_all (struct pci_dev *pdev,int mask,const char *name) {int request_mask = ((1 <<6 ) -1 ) & ~mask;
@@ -330,7 +330,7 @@ EXPORT_SYMBOL(pcim_iomap_regions_request* * Unmap and release regions specified by @mask. */ -void pcim_iounmap_regions (struct pci_dev *pdev,u16 mask) +void pcim_iounmap_regions (struct pci_dev *pdev,int mask) {void __iomem *const *iomap;int i;
Quoted 17 lines
DEVICE_COUNT_RESOURCEwill be bigger than 16 when SRIOV supported is enabled.Let them pass with int just like
pci_enable_resources().Signed-off-by Yinghai Lu <[email protected]>--- include/linux/pci.h | 6 +++--- lib/devres.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)Index:
linux-2.6/include/linux/pci.h
===================================================================
include/linux/pci.h static inline void pci_fixup_device(enum · line 1439
Quoted 9 lines
include/linux/pci.h +2
-2@@ -1433,10 +1433,10 @@ static inline void pci_fixup_device(enumvoid __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,u16 mask,const char *name); -int pcim_iomap_regions_request_all (struct pci_dev *pdev,u16 mask, +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);
[...]
You are switching from unsigned to signed here, is this intentional? In my feeling such masks should end up in an unsigned int, no?
Eike
Bjorn Helgaas
maintainerQuoted 28 lines · Rolf Eike Beer
Quoted 26 lines
DEVICE_COUNT_RESOURCEwill be bigger than 16 when SRIOV supported is enabled.Let them pass with int just like
pci_enable_resources().Signed-off-by Yinghai Lu <[email protected]>---
include/linux/pci.h | 6 +++---
lib/devres.c | 6 +++---2 files changed, 6 insertions(+), 6 deletions(-)Index:
linux-2.6/include/linux/pci.h
===================================================================include/linux/pci.h +0
-0@@ -1433,10 +1433,10 @@ static inline void pci_fixup_device(enumvoid
__iomem*pcim_iomap(structpci_dev*pdev, int bar, unsigned long maxlen);
voidpcim_iounmap(struct pci_dev *pdev, void __iomem *addr); void__iomem* const *pcim_iomap_table(structpci_dev*pdev);include/linux/pci.h +2
-2-int pcim_iomap_regions (struct pci_dev *pdev,u16 mask,const char *name); -int pcim_iomap_regions_request_all(struct pci_dev *pdev, u16 mask, +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);
[...]
Quoted 2 lines
You are switching from unsigned to signed here, is this intentional? In my feeling such masks should end up in an unsigned int, no?
I agree masks should generally be unsigned, but I think it makes sense to first follow pci_enable_resources() (which uses "int") , and maybe in the future, convert both to being unsigned.
Bjorn
Quoted 18 lines · Yinghai Lu
DEVICE_COUNT_RESOURCEwill be bigger than 16 when SRIOV supported is enabled.Let them pass with int just like
pci_enable_resources().Signed-off-by Yinghai Lu<[email protected]>--- include/linux/pci.h | 6 +++--- lib/devres.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)Index:
linux-2.6/include/linux/pci.h
===================================================================include/linux/pci.h +0
-0@@ -1433,10 +1433,10 @@ static inline void pci_fixup_device(enumvoid __iomem *pcim_iomap (struct pci_dev *pdev,int bar,unsigned long maxlen);void pcim_iounmap (struct pci_dev *pdev,void __iomem *addr);
include/linux/pci.h static inline void pci_fixup_device(enum · line 1440
Quoted 10 lines
include/linux/pci.h +3
-3void __iomem *const *pcim_iomap_table (struct pci_dev *pdev); -int pcim_iomap_regions (struct pci_dev *pdev,u16 mask,const char *name); -int pcim_iomap_regions_request_all (struct pci_dev *pdev,u16 mask, +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,u16 mask); +void pcim_iounmap_regions (struct pci_dev *pdev,int mask);
I'd recommend u32 since it was u16 initially.
Jesse Barnes
AppliedQuoted 6 lines · On Wed, 4 Jan 2012 15:50:02 -0800 Yinghai Lu <[email protected]> wrote:
DEVICE_COUNT_RESOURCEwill be bigger than 16 when SRIOV supported is enabled.Let them pass with int just like
pci_enable_resources().Signed-off-by Yinghai Lu <[email protected]>
Applied, thanks.
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center