linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Nate Case <ncase@xes-inc.com>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] POWERPC: Support ISA legacy addresses in of_address_to_resource()
Date: Fri, 09 May 2008 14:31:20 +1000	[thread overview]
Message-ID: <1210307480.1421.132.camel@pasglop> (raw)
In-Reply-To: <1210289192.13845.281.camel@localhost.localdomain>


On Thu, 2008-05-08 at 18:26 -0500, Nate Case wrote:
> When mapping an open firmware device tree node to a resource,
> check if the device is on the "isa" legacy bus.  In this case,
> pci_address_to_pio() should not be used since that function is only
> for addresses above the 64KB reserved region.
> 
> This was necessary to get IPMI working on a board that accesses
> the IPMI controller via the legacy I/O region.

I don't understand that fix. Can you tell us more about the exact
failure mode ? Especially, show us the device-tree bits and the
addresses returned.

I suspect the bug is in your device-tree that is forwarding IO addresses
all the way without converting them to memory or something like that.

> Signed-off-by: Nate Case <ncase@xes-inc.com>
> ---
>  arch/powerpc/kernel/prom_parse.c |   10 +++++++++-
>  1 files changed, 9 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c
> index 90eb3a3..28d354d 100644
> --- a/arch/powerpc/kernel/prom_parse.c
> +++ b/arch/powerpc/kernel/prom_parse.c
> @@ -622,7 +622,15 @@ static int __of_address_to_resource(struct device_node *dev, const u32 *addrp,
>  	memset(r, 0, sizeof(struct resource));
>  	if (flags & IORESOURCE_IO) {
>  		unsigned long port;
> -		port = pci_address_to_pio(taddr);
> +		struct device_node *parent;
> +
> +		parent = of_get_parent(dev);
> +		if (of_bus_isa_match(parent))
> +			port = (unsigned long) taddr;
> +		else
> +			port = pci_address_to_pio(taddr);
> +		of_node_put(parent);
> +
>  		if (port == (unsigned long)-1)
>  			return -EINVAL;
>  		r->start = port;

  reply	other threads:[~2008-05-09  4:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-08 23:26 [PATCH] POWERPC: Support ISA legacy addresses in of_address_to_resource() Nate Case
2008-05-09  4:31 ` Benjamin Herrenschmidt [this message]
2008-05-09 21:31   ` Nate Case
2008-05-09 22:27     ` 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=1210307480.1421.132.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=ncase@xes-inc.com \
    /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).