linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Mark A. Greer" <mgreer@mvista.com>
To: Kumar Gala <kumar.gala@freescale.com>
Cc: akpm <akpm@osdl.org>,
	linuxppc-dev@ozlabs.org, lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH][PPC32] Add setup_indirect_pci_nomap() routine
Date: Mon, 08 Nov 2004 16:55:57 -0700	[thread overview]
Message-ID: <4190078D.106@mvista.com> (raw)
In-Reply-To: <32E32A44-31DA-11D9-9BE7-000393DBC2E8@freescale.com>

Kumar Gala wrote:

> Mark,
>
> Out of interest, why would we not want to ioremap the cfg addr/data 
> registers?
>
> - kumar
>
> On Nov 8, 2004, at 4:56 PM, Mark A. Greer wrote:
>
>> This patch adds a routine that sets up indirect pci config space access
>> but doesn't ioremap the config space addr/data registers.
>

You do need them mapped, of course, but:

a) It so happens that on the marvell host bridges those regs are in the 
middle of a larger block that is already ioremapp'd.

b) [Warning: Long story...]  To determine the type of bridge, the code 
has to access a pci cfg register on the bridge so access to those regs 
are necessary no matter what.  However, some platforms that use the 
marvell bridges don't use one or both of the hoses.  We've seen cases 
where if you try to access the pci bus that isn't wired properly, the 
bridge hangs so I can't always use pcibios_alloc_controller() to alloc 
the hose struct (or the pci infrastructure will try to scan the bus & 
hang the bridge).  Instead, in the one routine that gets the bridge 
type, I temporarily use a hose struct alloc'd on the stack and call 
setup_indirect_pci[_nomap]() with it.  Once I've read the bridge type, I 
no longer need that mapping but there is no "remove_indirect_pci()" 
routine to undo the previous setup.  So, worst case, when a platform 
uses both hoses, those regs are mapped once when all the bridge's regs 
are mapped, a second time when the temporary mapping is used, and a 
third time when using a hose struct alloc'd by 
pcibios_alloc_controller().  I end up with two unused mappings.

With some work & ugly code, I could get rid of one extra mapping but not 
both, and making a "nomap" routine just seemed cleaner.  There are 
probably other ppc platforms that could use this as well.

Mark

      reply	other threads:[~2004-11-08 23:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-08 22:56 [PATCH][PPC32] Add setup_indirect_pci_nomap() routine Mark A. Greer
2004-11-08 23:02 ` Kumar Gala
2004-11-08 23:55   ` Mark A. Greer [this message]

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=4190078D.106@mvista.com \
    --to=mgreer@mvista.com \
    --cc=akpm@osdl.org \
    --cc=kumar.gala@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.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).