Re: [patch 2.6.24-rc1] resource_len() utility function

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: David Brownell
Date: Wednesday, October 24, 2007 - 7:39 pm

On Wednesday 24 October 2007, Alan Cox wrote:

This was intended to be a minor band-aid.  ;)

We already have request_resource(), which does something
different than the request_*region() calls.  I think calls
with those names would complicate an already-too-strange
interface, adding oddball siblings to request_resource().

I'd hope that when those resource calls were defined they
made sense ... but to me, they don't do so today.  Consider
that the *typical* caller is given a "struct resource", and
then to claim the specified address space it must convert
it into a "start + length" representation before getting
back a *NEW* "struct resource" ... with identical contents,
other than the value of one all-but-undocumented flag bit.
Then, if it's I/O space the address is usable already; but
for memory space, it still needs an ioremap()...

Oh, and PCI has its own resource structs ("BAR") that don't
look or act the same as other resources.


So while I like the notion of starting to abolish that
conversion step, this wasn't an attempt to fix all the
bizarre behaviors of the resource API.

I could imagine a call taking a resource and returning
a "void __iomem *" to use for IO, which implicitly claims
the region (in either memory or i/o space) and does any
ioremap needed for memory space.  With a sibling call to
undo all that.  If that's the answer, someone else should
develop the patch and update drivers...

- Dave
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 2.6.24-rc1] resource_len() utility function, David Brownell, (Wed Oct 24, 6:20 pm)
Re: [patch 2.6.24-rc1] resource_len() utility function, Jeff Garzik, (Wed Oct 24, 7:08 pm)
Re: [patch 2.6.24-rc1] resource_len() utility function, David Brownell, (Wed Oct 24, 7:39 pm)
Re: [patch 2.6.24-rc1] resource_len() utility function, David Brownell, (Wed Oct 24, 7:47 pm)
Re: [patch 2.6.24-rc1] resource_len() utility function, Jeff Garzik, (Wed Oct 24, 8:46 pm)
Re: [patch 2.6.24-rc1] resource_len() utility function, David Brownell, (Wed Oct 24, 9:38 pm)
Re: [patch 2.6.24-rc1] resource_len() utility function, David Brownell, (Thu Oct 25, 9:31 am)