From: Matt Porter <mporter@kernel.crashing.org>
To: Karl Lessard <klessard@sunrisetelecom.com>
Cc: linux-mips <linux-mips@linux-mips.org>
Subject: Re: Duplicated allocation in AU1xxx OHCI driver
Date: Fri, 15 Oct 2004 09:54:38 -0700 [thread overview]
Message-ID: <20041015095437.A1500@home.com> (raw)
In-Reply-To: <416ED763.2090501@sunrisetelecom.com>; from klessard@sunrisetelecom.com on Thu, Oct 14, 2004 at 03:45:39PM -0400
On Thu, Oct 14, 2004 at 03:45:39PM -0400, Karl Lessard wrote:
> Hello,
>
> I was looking at the code of the new ohci-au1xxx, and I've figured out
> that operationnal regiters resource
> is allocated two times: once when registering the OHCI platform device
> (check in drivers/base/platform.c),
> and once in OHCI driver probe.
> Is that ok?? I'm kind of surprised that the second allocation doesn't
> failed. Removing it seems to works
> well for me.
These are two different calls. request_resource() versus
request_region() (this is wrappered by request_mem_region()).
The request_resource() call is used by the bus driver to show
allocatable resources.
The request_region() call allocates new busy regions and checks
that the requested regions are not already busy.
The request_mem_region() call is correct and does not fail because
no other call has requested the same region.
If you look at a complex /proc/iomem like on a PCI-equipped system
with many devices, you can see how the bus driver shows allocatable
resources and then some drivers have claimed portions of those
resources as regions (because they are tagged with a driver name).
Here's a dump from such a system:
...
cde00000-cfefffff : PCI Bus #01
ce000000-ceffffff : 0000:01:00.0
ce000000-ceffffff : nvidia
cffdd000-cffddfff : 0000:00:03.0
cffdd000-cffddfff : sis900
cfffdf00-cfffdfff : 0000:00:13.2
cfffdf00-cfffdfff : ehci_hcd
cfffe000-cfffefff : 0000:00:02.2
cfffe000-cfffefff : ohci_hcd
cffff000-cfffffff : 0000:00:02.3
cffff000-cfffffff : ohci_hcd
...
Note that the platform bus code requests the bus allocatable resources
in generic code, whereas for something like PCI it's done in
arch-specific pci code since each arch requires a lot of fixup to
those resources due to the nature of PCI. The platform bus code
doesn't have any inherent knowledge of bus resources beyond what
it gains from a platform_add_device() call.
-Matt
prev parent reply other threads:[~2004-10-15 16:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-14 19:45 Duplicated allocation in AU1xxx OHCI driver Karl Lessard
2004-10-15 16:54 ` Matt Porter [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=20041015095437.A1500@home.com \
--to=mporter@kernel.crashing.org \
--cc=klessard@sunrisetelecom.com \
--cc=linux-mips@linux-mips.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.