From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
linux-next@vger.kernel.org,
ppc-dev <linuxppc-dev@lists.ozlabs.org>,
linux-kernel@vger.kernel.org,
Jesse Barnes <jbarnes@virtuousgeek.org>
Subject: Re: linux-next: build failure after merge of the final tree
Date: Tue, 28 Feb 2012 10:30:24 +1100 [thread overview]
Message-ID: <1330385424.11728.7.camel@pasglop> (raw)
In-Reply-To: <1330334360.11728.3.camel@pasglop>
On Mon, 2012-02-27 at 20:19 +1100, Benjamin Herrenschmidt wrote:
> On Mon, 2012-02-27 at 17:37 +1100, Stephen Rothwell wrote:
> > pci_add_resource_offset(resources, res,
> > - (resource_size_t) hose->io_base_virt - _IO_BASE);
> > + (resource_size_t)(unsigned long)hose->io_base_virt - _IO_BASE);
>
> We have to be careful here as we do want sign extension to happen (yeah
> it's odd, but it's the way we do IOs on ppc32 :-) Maybe I should change
> it one day).
>
> So we probably want to do:
>
> (resource_size_t)(long long)(hose->io_base_virt - _IO_BASE)
Oops ... that was meant to read (long) not (long long)... Any ways, I
more or less convinced myself that even without the sign extension it
would still work, since the IO port number is eventually cast to an
unsigned int by the accessors, so as long as the low 32-bits are correct
(and they'll be with or without the sign extension), we should be fine.
It's just that something trying to print the resource might end up
displaying garbage in the top bits.
Cheers,
Ben.
> Basically, IO resources are relative to _IO_BASE which on ppc32 is
> basically the virtual address where we map the first PHB IO space.
>
> Subsequent PHB mappings can end up below _IO_BASE, leading to negative
> resource values for IO BARs on those busses. It all works fine because
> even an unsigned addition will do the right thing as long as the value
> is fully sign extended.
>
> Cheers,
> Ben.
next prev parent reply other threads:[~2012-02-27 23:30 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-27 6:37 linux-next: build failure after merge of the final tree Stephen Rothwell
2012-02-27 9:19 ` Benjamin Herrenschmidt
2012-02-27 23:30 ` Benjamin Herrenschmidt [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-01-06 9:28 Stephen Rothwell
2014-01-06 23:12 ` Benjamin Herrenschmidt
2013-08-20 7:20 Stephen Rothwell
2013-08-20 16:07 ` Dwight Engen
2013-08-20 19:28 ` Ben Myers
2013-08-21 0:22 ` Stephen Rothwell
2013-08-21 15:54 ` Ben Myers
2013-08-20 20:46 ` Arnd Bergmann
2013-08-21 5:08 ` Dwight Engen
2013-08-21 6:30 ` Jeremy Kerr
2013-08-21 15:56 ` Ben Myers
2012-07-05 8:33 Stephen Rothwell
2012-07-05 9:43 ` Alan Modra
2012-07-06 0:21 ` Stephen Rothwell
2012-07-06 0:57 ` Alan Modra
2012-07-06 3:01 ` Stephen Rothwell
2012-07-06 6:08 ` Alan Modra
2012-01-20 7:21 Stephen Rothwell
2012-01-20 9:08 ` Deepthi Dharwar
2011-07-18 9:35 Stephen Rothwell
2011-01-31 6:26 Stephen Rothwell
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=1330385424.11728.7.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=bhelgaas@google.com \
--cc=jbarnes@virtuousgeek.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=sfr@canb.auug.org.au \
/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).