linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Wilcox, Matthew R" <matthew.r.wilcox@intel.com>
To: Jesse Barnes <jbarnes@virtuousgeek.org>, Yinghai Lu <yinghai@kernel.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
	"linux-next@vger.kernel.org" <linux-next@vger.kernel.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: RE: linux-next: IO BAR sizing warning
Date: Wed, 6 May 2009 11:41:12 -0600	[thread overview]
Message-ID: <CAC4B8726E86A142B27A9E9A2F2F1247AB7A8255@rrsmsx505.amr.corp.intel.com> (raw)
In-Reply-To: <20090506092418.3fffab6b@hobbes>

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

  reply	other threads:[~2009-05-06 17:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAC4B8726E86A142B27A9E9A2F2F1247AB7A8255@rrsmsx505.amr.corp.intel.com \
    --to=matthew.r.wilcox@intel.com \
    --cc=benh@kernel.crashing.org \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).