linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: pci tree build warning
@ 2009-05-06  4:30 Stephen Rothwell
  2009-05-06  7:21 ` Yinghai Lu
  0 siblings, 1 reply; 9+ messages in thread
From: Stephen Rothwell @ 2009-05-06  4:30 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: linux-next, Yinghai Lu

[-- Attachment #1: Type: text/plain, Size: 471 bytes --]

Hi Jesse,

Today's linux-next build (powerpc ppc64_defconfig) produced this warning:

drivers/pci/probe.c: In function '__pci_read_base':
drivers/pci/probe.c:196: warning: large integer implicitly truncated to unsigned type

Probably introduced by commit 82160fd142cdf6956a677120426bf5baefcc7cf9
("PCI/x86: don't assume prefetchable ranges are 64bit").

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: linux-next: pci tree build warning
  2009-05-06  4:30 linux-next: pci tree build warning Stephen Rothwell
@ 2009-05-06  7:21 ` Yinghai Lu
  2009-05-06 16:24   ` linux-next: IO BAR sizing warning Jesse Barnes
  0 siblings, 1 reply; 9+ messages in thread
From: Yinghai Lu @ 2009-05-06  7:21 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Jesse Barnes, linux-next

Stephen Rothwell wrote:
> Hi Jesse,
> 
> Today's linux-next build (powerpc ppc64_defconfig) produced this warning:
> 
> drivers/pci/probe.c: In function '__pci_read_base':
> drivers/pci/probe.c:196: warning: large integer implicitly truncated to unsigned type
> 
> Probably introduced by commit 82160fd142cdf6956a677120426bf5baefcc7cf9
> ("PCI/x86: don't assume prefetchable ranges are 64bit").
> 

--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -193,7 +193,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
                res->flags |= pci_calc_resource_flags(l) | IORESOURCE_SIZEALIGN;
                if (type == pci_bar_io) {
                        l &= PCI_BASE_ADDRESS_IO_MASK;
-                       mask = PCI_BASE_ADDRESS_IO_MASK & 0xffff;
+                       mask = PCI_BASE_ADDRESS_IO_MASK & IO_SPACE_LIMIT;


and

for x86:
#define IO_SPACE_LIMIT 0xffff

for powerpc
arch/powerpc/include/asm/io.h:#define IO_SPACE_LIMIT ~(0UL)

maybe we need to change back that line...

YH

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: linux-next: IO BAR sizing warning
  2009-05-06  7:21 ` Yinghai Lu
@ 2009-05-06 16:24   ` Jesse Barnes
  2009-05-06 17:41     ` Wilcox, Matthew R
  0 siblings, 1 reply; 9+ messages in thread
From: Jesse Barnes @ 2009-05-06 16:24 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Stephen Rothwell, linux-next, Wilcox, Matthew R, Benjamin Herrenschmidt

On Wed, 06 May 2009 00:21:20 -0700
Yinghai Lu <yinghai@kernel.org> wrote:

> Stephen Rothwell wrote:
> > Hi Jesse,
> > 
> > Today's linux-next build (powerpc ppc64_defconfig) produced this
> > warning:
> > 
> > drivers/pci/probe.c: In function '__pci_read_base':
> > drivers/pci/probe.c:196: warning: large integer implicitly
> > truncated to unsigned type
> > 
> > Probably introduced by commit
> > 82160fd142cdf6956a677120426bf5baefcc7cf9 ("PCI/x86: don't assume
> > prefetchable ranges are 64bit").
> > 
> 
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -193,7 +193,7 @@ int __pci_read_base(struct pci_dev *dev, enum
> pci_bar_type type, res->flags |= pci_calc_resource_flags(l) |
> IORESOURCE_SIZEALIGN; if (type == pci_bar_io) {
>                         l &= PCI_BASE_ADDRESS_IO_MASK;
> -                       mask = PCI_BASE_ADDRESS_IO_MASK & 0xffff;
> +                       mask = PCI_BASE_ADDRESS_IO_MASK &
> IO_SPACE_LIMIT;
> 
> 
> and
> 
> for x86:
> #define IO_SPACE_LIMIT 0xffff
> 
> for powerpc
> arch/powerpc/include/asm/io.h:#define IO_SPACE_LIMIT ~(0UL)
> 
> maybe we need to change back that line...

Yeah that would be easy enough.  Though really it seems like
IO_SPACE_LIMIT should be applied, with an appropriate cast.  Looks like
this code has been there for a long time, and maybe there are devices
that allow the upper 16 bits of their IO BARs to be set even though
they don't honor them (they should hardwire them to 0 in that case),
but spec-wise allowing the full size should be fine...

Matthew & Ben, any comments?

-- 
Jesse Barnes, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: linux-next: IO BAR sizing warning
  2009-05-06 16:24   ` linux-next: IO BAR sizing warning Jesse Barnes
@ 2009-05-06 17:41     ` Wilcox, Matthew R
  2009-05-06 18:00       ` Jesse Barnes
  0 siblings, 1 reply; 9+ messages in thread
From: Wilcox, Matthew R @ 2009-05-06 17:41 UTC (permalink / raw)
  To: Jesse Barnes, Yinghai Lu
  Cc: Stephen Rothwell, linux-next, Benjamin Herrenschmidt

I think PowerPC's IO_SPACE_LIMIT is defined incorrectly.

On 64-bit, it's currently set to 0xffff'ffff'ffff'ffff.  This can't possibly work, there's no way for the PCI bus to transmit 64-bit IO-port addresses.  It should probably be defined to

0xffffffffU

> -----Original Message-----
> From: Jesse Barnes [mailto:jbarnes@virtuousgeek.org]
> Sent: Wednesday, May 06, 2009 9:24 AM
> To: Yinghai Lu
> Cc: Stephen Rothwell; linux-next@vger.kernel.org; Wilcox, Matthew R;
> Benjamin Herrenschmidt
> Subject: Re: linux-next: IO BAR sizing warning
> 
> On Wed, 06 May 2009 00:21:20 -0700
> Yinghai Lu <yinghai@kernel.org> wrote:
> 
> > Stephen Rothwell wrote:
> > > Hi Jesse,
> > >
> > > Today's linux-next build (powerpc ppc64_defconfig) produced this
> > > warning:
> > >
> > > drivers/pci/probe.c: In function '__pci_read_base':
> > > drivers/pci/probe.c:196: warning: large integer implicitly
> > > truncated to unsigned type
> > >
> > > Probably introduced by commit
> > > 82160fd142cdf6956a677120426bf5baefcc7cf9 ("PCI/x86: don't assume
> > > prefetchable ranges are 64bit").
> > >
> >
> > --- a/drivers/pci/probe.c
> > +++ b/drivers/pci/probe.c
> > @@ -193,7 +193,7 @@ int __pci_read_base(struct pci_dev *dev, enum
> > pci_bar_type type, res->flags |= pci_calc_resource_flags(l) |
> > IORESOURCE_SIZEALIGN; if (type == pci_bar_io) {
> >                         l &= PCI_BASE_ADDRESS_IO_MASK;
> > -                       mask = PCI_BASE_ADDRESS_IO_MASK & 0xffff;
> > +                       mask = PCI_BASE_ADDRESS_IO_MASK &
> > IO_SPACE_LIMIT;
> >
> >
> > and
> >
> > for x86:
> > #define IO_SPACE_LIMIT 0xffff
> >
> > for powerpc
> > arch/powerpc/include/asm/io.h:#define IO_SPACE_LIMIT ~(0UL)
> >
> > maybe we need to change back that line...
> 
> Yeah that would be easy enough.  Though really it seems like
> IO_SPACE_LIMIT should be applied, with an appropriate cast.  Looks like
> this code has been there for a long time, and maybe there are devices
> that allow the upper 16 bits of their IO BARs to be set even though
> they don't honor them (they should hardwire them to 0 in that case),
> but spec-wise allowing the full size should be fine...
> 
> Matthew & Ben, any comments?
> 
> --
> Jesse Barnes, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: linux-next: IO BAR sizing warning
  2009-05-06 17:41     ` Wilcox, Matthew R
@ 2009-05-06 18:00       ` Jesse Barnes
  2009-05-06 18:03         ` Wilcox, Matthew R
  2009-06-03  6:49         ` Stephen Rothwell
  0 siblings, 2 replies; 9+ messages in thread
From: Jesse Barnes @ 2009-05-06 18:00 UTC (permalink / raw)
  To: Wilcox, Matthew R
  Cc: Yinghai Lu, Stephen Rothwell, linux-next, Benjamin Herrenschmidt

On Wed, 6 May 2009 11:41:12 -0600
"Wilcox, Matthew R" <matthew.r.wilcox@intel.com> wrote:

> I think PowerPC's IO_SPACE_LIMIT is defined incorrectly.
> 
> On 64-bit, it's currently set to 0xffff'ffff'ffff'ffff.  This can't
> possibly work, there's no way for the PCI bus to transmit 64-bit
> IO-port addresses.  It should probably be defined to
> 
> 0xffffffffU

TOP POSTER!

But yeah on a bus level it clearly needs to be limited to 32 bits, but
ISTR that some arches use the high resource bits for tracking I/O
resources on a systemwide basis (too lazy to look atm).

So either we need to split the definition between bus & resource usage,
or add a cast here...
-- 
Jesse Barnes, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: linux-next: IO BAR sizing warning
  2009-05-06 18:00       ` Jesse Barnes
@ 2009-05-06 18:03         ` Wilcox, Matthew R
  2009-06-03  6:49         ` Stephen Rothwell
  1 sibling, 0 replies; 9+ messages in thread
From: Wilcox, Matthew R @ 2009-05-06 18:03 UTC (permalink / raw)
  To: Jesse Barnes
  Cc: Yinghai Lu, Stephen Rothwell, linux-next, Benjamin Herrenschmidt

If you're going to send email to my exchange account, you'll get top posting.  Send email to one of my real accounts if you want proper email etiquette.

> -----Original Message-----
> From: Jesse Barnes [mailto:jbarnes@virtuousgeek.org]
> Sent: Wednesday, May 06, 2009 11:01 AM
> To: Wilcox, Matthew R
> Cc: Yinghai Lu; Stephen Rothwell; linux-next@vger.kernel.org; Benjamin
> Herrenschmidt
> Subject: Re: linux-next: IO BAR sizing warning
> 
> On Wed, 6 May 2009 11:41:12 -0600
> "Wilcox, Matthew R" <matthew.r.wilcox@intel.com> wrote:
> 
> > I think PowerPC's IO_SPACE_LIMIT is defined incorrectly.
> >
> > On 64-bit, it's currently set to 0xffff'ffff'ffff'ffff.  This can't
> > possibly work, there's no way for the PCI bus to transmit 64-bit
> > IO-port addresses.  It should probably be defined to
> >
> > 0xffffffffU
> 
> TOP POSTER!
> 
> But yeah on a bus level it clearly needs to be limited to 32 bits, but
> ISTR that some arches use the high resource bits for tracking I/O
> resources on a systemwide basis (too lazy to look atm).
> 
> So either we need to split the definition between bus & resource usage,
> or add a cast here...
> --
> Jesse Barnes, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: linux-next: IO BAR sizing warning
  2009-05-06 18:00       ` Jesse Barnes
  2009-05-06 18:03         ` Wilcox, Matthew R
@ 2009-06-03  6:49         ` Stephen Rothwell
  2009-06-11 19:07           ` Jesse Barnes
  1 sibling, 1 reply; 9+ messages in thread
From: Stephen Rothwell @ 2009-06-03  6:49 UTC (permalink / raw)
  To: Jesse Barnes
  Cc: Wilcox, Matthew R, Yinghai Lu, linux-next, Benjamin Herrenschmidt

[-- Attachment #1: Type: text/plain, Size: 1100 bytes --]

Hi all,

On Wed, 6 May 2009 11:00:34 -0700 Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
>
> On Wed, 6 May 2009 11:41:12 -0600
> "Wilcox, Matthew R" <matthew.r.wilcox@intel.com> wrote:
> 
> > I think PowerPC's IO_SPACE_LIMIT is defined incorrectly.
> > 
> > On 64-bit, it's currently set to 0xffff'ffff'ffff'ffff.  This can't
> > possibly work, there's no way for the PCI bus to transmit 64-bit
> > IO-port addresses.  It should probably be defined to
> > 
> > 0xffffffffU
> 
> But yeah on a bus level it clearly needs to be limited to 32 bits, but
> ISTR that some arches use the high resource bits for tracking I/O
> resources on a systemwide basis (too lazy to look atm).
> 
> So either we need to split the definition between bus & resource usage,
> or add a cast here...

I am still getting the original warning.  For reference, the following
architectures will probably have the same:

ia64:		0xffffffffffffff
powerpc:	~(0UL)
sparc64:	0xffffffffffffffffUL

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: linux-next: IO BAR sizing warning
  2009-06-03  6:49         ` Stephen Rothwell
@ 2009-06-11 19:07           ` Jesse Barnes
  2009-06-11 21:39             ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 9+ messages in thread
From: Jesse Barnes @ 2009-06-11 19:07 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Wilcox, Matthew R, Yinghai Lu, linux-next, Benjamin Herrenschmidt

On Wed, 3 Jun 2009 16:49:54 +1000
Stephen Rothwell <sfr@canb.auug.org.au> wrote:

> Hi all,
> 
> On Wed, 6 May 2009 11:00:34 -0700 Jesse Barnes
> <jbarnes@virtuousgeek.org> wrote:
> >
> > On Wed, 6 May 2009 11:41:12 -0600
> > "Wilcox, Matthew R" <matthew.r.wilcox@intel.com> wrote:
> > 
> > > I think PowerPC's IO_SPACE_LIMIT is defined incorrectly.
> > > 
> > > On 64-bit, it's currently set to 0xffff'ffff'ffff'ffff.  This
> > > can't possibly work, there's no way for the PCI bus to transmit
> > > 64-bit IO-port addresses.  It should probably be defined to
> > > 
> > > 0xffffffffU
> > 
> > But yeah on a bus level it clearly needs to be limited to 32 bits,
> > but ISTR that some arches use the high resource bits for tracking
> > I/O resources on a systemwide basis (too lazy to look atm).
> > 
> > So either we need to split the definition between bus & resource
> > usage, or add a cast here...
> 
> I am still getting the original warning.  For reference, the following
> architectures will probably have the same:
> 
> ia64:		0xffffffffffffff
> powerpc:	~(0UL)
> sparc64:	0xffffffffffffffffUL

Any comments here Ben?  Seems this define is overloaded...

-- 
Jesse Barnes, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: linux-next: IO BAR sizing warning
  2009-06-11 19:07           ` Jesse Barnes
@ 2009-06-11 21:39             ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 9+ messages in thread
From: Benjamin Herrenschmidt @ 2009-06-11 21:39 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: Stephen Rothwell, Wilcox, Matthew R, Yinghai Lu, linux-next

On Thu, 2009-06-11 at 12:07 -0700, Jesse Barnes wrote:

> > I am still getting the original warning.  For reference, the following
> > architectures will probably have the same:
> > 
> > ia64:		0xffffffffffffff
> > powerpc:	~(0UL)
> > sparc64:	0xffffffffffffffffUL
> 
> Any comments here Ben?  Seems this define is overloaded...

Ah, forgot to look at that. Will do ASAP.

Cheers,
Ben.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-06-11 21:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-06  4:30 linux-next: pci tree build warning Stephen Rothwell
2009-05-06  7:21 ` Yinghai Lu
2009-05-06 16:24   ` linux-next: IO BAR sizing warning Jesse Barnes
2009-05-06 17:41     ` Wilcox, Matthew R
2009-05-06 18:00       ` Jesse Barnes
2009-05-06 18:03         ` Wilcox, Matthew R
2009-06-03  6:49         ` Stephen Rothwell
2009-06-11 19:07           ` Jesse Barnes
2009-06-11 21:39             ` Benjamin Herrenschmidt

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).