* [PATCH] PCI: Increase resource array mask bit size in pcim_iomap_regions()
@ 2012-01-04 23:50 Yinghai Lu
2012-01-05 8:43 ` Rolf Eike Beer
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Yinghai Lu @ 2012-01-04 23:50 UTC (permalink / raw)
To: Jesse Barnes; +Cc: linux-kernel, linux-pci, Yinghai Lu
DEVICE_COUNT_RESOURCE will be bigger than 16 when SRIOV supported is enabled.
Let them pass with int just like pci_enable_resources().
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
include/linux/pci.h | 6 +++---
lib/devres.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
Index: linux-2.6/include/linux/pci.h
===================================================================
--- linux-2.6.orig/include/linux/pci.h
+++ linux-2.6/include/linux/pci.h
@@ -1433,10 +1433,10 @@ static inline void pci_fixup_device(enum
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, 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 */
Index: linux-2.6/lib/devres.c
===================================================================
--- linux-2.6.orig/lib/devres.c
+++ linux-2.6/lib/devres.c
@@ -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;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] PCI: Increase resource array mask bit size in pcim_iomap_regions()
2012-01-04 23:50 [PATCH] PCI: Increase resource array mask bit size in pcim_iomap_regions() Yinghai Lu
@ 2012-01-05 8:43 ` Rolf Eike Beer
2012-01-05 17:10 ` Bjorn Helgaas
2012-01-05 18:50 ` Don Dutile
2012-01-06 21:05 ` Jesse Barnes
2 siblings, 1 reply; 5+ messages in thread
From: Rolf Eike Beer @ 2012-01-05 8:43 UTC (permalink / raw)
To: Yinghai Lu; +Cc: Jesse Barnes, linux-kernel, linux-pci, Yinghai Lu
> DEVICE_COUNT_RESOURCE will be bigger than 16 when SRIOV supported is
> enabled.
>
> Let them pass with int just like pci_enable_resources().
>
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
>
> ---
> include/linux/pci.h | 6 +++---
> lib/devres.c | 6 +++---
> 2 files changed, 6 insertions(+), 6 deletions(-)
>
> Index: linux-2.6/include/linux/pci.h
> ===================================================================
> --- linux-2.6.orig/include/linux/pci.h
> +++ linux-2.6/include/linux/pci.h
> @@ -1433,10 +1433,10 @@ static inline void pci_fixup_device(enum
> 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, 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] PCI: Increase resource array mask bit size in pcim_iomap_regions()
2012-01-05 8:43 ` Rolf Eike Beer
@ 2012-01-05 17:10 ` Bjorn Helgaas
0 siblings, 0 replies; 5+ messages in thread
From: Bjorn Helgaas @ 2012-01-05 17:10 UTC (permalink / raw)
To: Rolf Eike Beer; +Cc: Yinghai Lu, Jesse Barnes, linux-kernel, linux-pci
On Thu, Jan 5, 2012 at 1:43 AM, Rolf Eike Beer <eike-kernel@sf-tec.de> wrote:
>> DEVICE_COUNT_RESOURCE will be bigger than 16 when SRIOV supported is
>> enabled.
>>
>> Let them pass with int just like pci_enable_resources().
>>
>> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
>>
>> ---
>> include/linux/pci.h | 6 +++---
>> lib/devres.c | 6 +++---
>> 2 files changed, 6 insertions(+), 6 deletions(-)
>>
>> Index: linux-2.6/include/linux/pci.h
>> ===================================================================
>> --- linux-2.6.orig/include/linux/pci.h
>> +++ linux-2.6/include/linux/pci.h
>> @@ -1433,10 +1433,10 @@ static inline void pci_fixup_device(enum
>> 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, 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?
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] PCI: Increase resource array mask bit size in pcim_iomap_regions()
2012-01-04 23:50 [PATCH] PCI: Increase resource array mask bit size in pcim_iomap_regions() Yinghai Lu
2012-01-05 8:43 ` Rolf Eike Beer
@ 2012-01-05 18:50 ` Don Dutile
2012-01-06 21:05 ` Jesse Barnes
2 siblings, 0 replies; 5+ messages in thread
From: Don Dutile @ 2012-01-05 18:50 UTC (permalink / raw)
To: Yinghai Lu; +Cc: Jesse Barnes, linux-kernel, linux-pci
On 01/04/2012 06:50 PM, Yinghai Lu wrote:
> DEVICE_COUNT_RESOURCE will be bigger than 16 when SRIOV supported is enabled.
>
> Let them pass with int just like pci_enable_resources().
>
> Signed-off-by: Yinghai Lu<yinghai@kernel.org>
>
> ---
> include/linux/pci.h | 6 +++---
> lib/devres.c | 6 +++---
> 2 files changed, 6 insertions(+), 6 deletions(-)
>
> Index: linux-2.6/include/linux/pci.h
> ===================================================================
> --- linux-2.6.orig/include/linux/pci.h
> +++ linux-2.6/include/linux/pci.h
> @@ -1433,10 +1433,10 @@ static inline void pci_fixup_device(enum
> 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, 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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] PCI: Increase resource array mask bit size in pcim_iomap_regions()
2012-01-04 23:50 [PATCH] PCI: Increase resource array mask bit size in pcim_iomap_regions() Yinghai Lu
2012-01-05 8:43 ` Rolf Eike Beer
2012-01-05 18:50 ` Don Dutile
@ 2012-01-06 21:05 ` Jesse Barnes
2 siblings, 0 replies; 5+ messages in thread
From: Jesse Barnes @ 2012-01-06 21:05 UTC (permalink / raw)
To: Yinghai Lu; +Cc: linux-kernel, linux-pci
[-- Attachment #1: Type: text/plain, Size: 359 bytes --]
On Wed, 4 Jan 2012 15:50:02 -0800
Yinghai Lu <yinghai@kernel.org> wrote:
> DEVICE_COUNT_RESOURCE will be bigger than 16 when SRIOV supported is enabled.
>
> Let them pass with int just like pci_enable_resources().
>
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
>
Applied, thanks.
--
Jesse Barnes, Intel Open Source Technology Center
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-01-06 21:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-04 23:50 [PATCH] PCI: Increase resource array mask bit size in pcim_iomap_regions() Yinghai Lu
2012-01-05 8:43 ` Rolf Eike Beer
2012-01-05 17:10 ` Bjorn Helgaas
2012-01-05 18:50 ` Don Dutile
2012-01-06 21:05 ` Jesse Barnes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).