[PATCH 1/2] mfd: max8925: request resource region

Russell King - ARM Linux linux at arm.linux.org.uk
Mon May 7 05:08:58 EDT 2012


On Mon, May 07, 2012 at 10:01:28AM +0100, Mark Brown wrote:
> On Mon, May 07, 2012 at 08:58:00AM +0100, Russell King - ARM Linux wrote:
> > On Mon, May 07, 2012 at 11:10:48AM +0800, Haojian Zhuang wrote:
> > > If resource region isn't requested, component devices will fail to request
> > > their resources.
> 
> > > Signed-off-by: Haojian Zhuang <haojian.zhuang at gmail.com>
> 
> > This looks wrong.
> 
> > This driver looks broken.  IO regions are for PC IO stuff, not for I2C
> > buses.  There is no resource reservation system in the kernel for
> > registers on I2C devices.
> 
> They've commonly been used for this, it's a fairly sane way for an MFD
> to communicate with its subdevices.  The fix in this series isn't good,
> though - providing a parent resource with a suitable range for all the
> device resources should do the job much more sensibly.  This isn't great
> but the infrastructure seems to do the right thing with it for now and
> it only requires a bit of reinterpretation of what IORESOURCE_IO means.

It's an abuse.  And it won't work unless PCMCIA, PCI or ISA is enabled.
This abuse must stop, and it must stop right now.  And I really don't
care about "it's commonly been used for XYZ" because it's a totally fucked
idea.

What if you have two devices both claiming IO regions at 0?  Hint: it
fails.

It's buggered beyond belief and it needs to die right now, no questions
about it.  And anyone who supports this idea needs to be...



More information about the linux-arm-kernel mailing list