mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Russell King <rmk@arm.linux.org.uk>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>,
	sameo@linux.intel.com, rpurdie@rpsys.net, bryan.wu@canonical.com,
	linux-kernel@vger.kernel.org, Bergmann Arnd <arnd@arndb.de>
Subject: Re: [PATCH 0/5] mfd: replace IORESOURCE_IO by IORESOURCE_MEM
Date: Mon, 6 Aug 2012 22:31:24 +0100	[thread overview]
Message-ID: <20120806213124.GB14594@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20120806195352.GC16199@opensource.wolfsonmicro.com>

On Mon, Aug 06, 2012 at 08:53:52PM +0100, Mark Brown wrote:
> On Mon, Aug 06, 2012 at 08:22:09PM +0100, Russell King wrote:
> > On Mon, Aug 06, 2012 at 04:58:06PM +0100, Mark Brown wrote:
> 
> > > That's one reason why I've not attacked this problem myself, but frankly
> > > I'm totally happy with using _IO here so I've not looked particularly
> > > closely.
> 
> > NO.  This is stupid.  We've been here before, and I've said what I'm
> > saying below before too.
> 
> > IORESOURCE_IO is for PCI/ISA IO resources.
> > IORESOURCE_MEM is for _memory mapped_ IO resources.
> 
> > On ARM, we only have memory mapped IO resources, with the exception that
> > if we have a real PCI/ISA bus, we give them IORESOURCE_IO resources.
> 
> > Never use IORESOURCE_IO for anything but PCI/ISA bus IO resources. Ever.
> 
> *sigh*  You must be aware that this isn't getting us anywhere.  As you
> know the issues here aren't practical ones if we make sure the resource
> trees are split (which is what Haojian should really be doing if he's
> not done so already) and that the resource code is sadly difficult to
> modify to support new resource types due to the full bitmask that
> Haojian mentioned.  
> 
> Clearly nobody has the combination of time and interest to add a new
> resource type and we do have actual systems running now (and for the
> past several years) relying on this.
> 
> To be perfectly frank I have a hard time convincing myself that there's
> any real problem with the current solution; obviously it's not what _IO
> was originally intended for but having several different trees of
> resources seems like a reasonable extension here and the effort involved
> in any other changes seems disproportionately high.  I guess we could
> formalise it by making an alias for _IO but I doubt that'd address the
> concerns you have.

So, the fact that platform devices will get any resource marked
IORESOURCE_IO registered against ioport_resource isn't a problem
then...

Anyway, given that this thread is broken, there's no way for me to find
out what the _original_ issue is that you're talking about.  So I'm going
to guess that it's come up because we're out of IORESOURCE bits.

Let's look a little closer:

#define IORESOURCE_TYPE_BITS    0x00001f00      /* Resource type */
#define IORESOURCE_IO           0x00000100
#define IORESOURCE_MEM          0x00000200
#define IORESOURCE_IRQ          0x00000400
#define IORESOURCE_DMA          0x00000800
#define IORESOURCE_BUS          0x00001000

So, if we made this a numeric index, then we have 32 resource types
to deal with, and no need to bugger around with re-using an existing
type for something else.

This makes sense, MEM, IRQ and DMA are all mutually exclusive, as
should be MEM and IO (because they can't coexist in two resource trees
at the same time.)  BUS only gets used in a hand-full of places and
not with any other flags.

So, looks like we can have 27 new resource types fairly easily.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:

  reply	other threads:[~2012-08-06 21:31 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-05 16:32 Haojian Zhuang
2012-08-05 16:32 ` [PATCH 1/5] mfd: use IORESOURCE_MEM in 88pm860x backlight Haojian Zhuang
2012-08-05 16:32 ` [PATCH 2/5] mfd: use IORESOUCE_MEM in 88pm860x leds driver Haojian Zhuang
2012-08-05 16:32 ` [PATCH 3/5] mfd: use IORESOURCE_MEM in 88pm860x regulator Haojian Zhuang
2012-08-05 16:32 ` [PATCH 4/5] mfd: avoid to return failure in 88pm860x Haojian Zhuang
2012-08-05 16:32 ` [PATCH 5/5] ARM: mmp: enable 88pm860x in ttc dkb Haojian Zhuang
2012-08-06 14:30 ` [PATCH 0/5] mfd: replace IORESOURCE_IO by IORESOURCE_MEM Mark Brown
2012-08-06 14:42   ` Haojian Zhuang
2012-08-06 15:46     ` Mark Brown
2012-08-06 15:56       ` Haojian Zhuang
2012-08-06 15:58         ` Mark Brown
2012-08-06 19:22           ` Russell King
2012-08-06 19:53             ` Mark Brown
2012-08-06 21:31               ` Russell King [this message]
2012-08-06 22:00                 ` Mark Brown
2012-08-07  1:47                   ` Haojian Zhuang
2012-08-07  7:58                     ` Russell King
2012-08-07  8:24                     ` Benjamin Herrenschmidt
2012-08-07 10:38                     ` Mark Brown
2012-08-07 11:13                       ` Russell King
2012-08-07 11:28                         ` Mark Brown
2012-08-07 11:31                           ` Russell King
2012-08-07 11:36                             ` Russell King
2012-08-07 11:45                               ` Mark Brown
2012-08-07 11:51                                 ` Russell King
2012-08-07 12:58                                   ` Mark Brown
2012-08-07 13:47                                     ` Russell King
2012-08-07 15:54                                       ` Mark Brown
2012-08-07 15:22                                   ` Geert Uytterhoeven
2012-08-07 15:44                                     ` Russell King
2012-08-07 16:48                                       ` Mark Brown
2012-08-07 20:51                                     ` Arnd Bergmann
2012-08-07 11:38                             ` Mark Brown
2012-08-07 11:44                               ` Russell King
2012-08-07 12:11                                 ` Russell King
2012-08-07 13:25                                   ` Mark Brown
2012-08-07 14:28                                     ` Arnd Bergmann
2012-08-07 14:41                                       ` Russell King
2012-08-07 16:36                                       ` Mark Brown
2012-08-07  8:22                 ` Benjamin Herrenschmidt
2012-08-07  8:28                   ` Russell King
2012-08-07 11:28                     ` Arnd Bergmann
2012-08-07 11:32                       ` Russell King
2012-08-07 11:34                         ` Arnd Bergmann
2012-08-07 11:35                       ` Mark Brown
2012-08-07 11:41                         ` Russell King
2012-08-07 15:45                           ` Alan Cox
2012-08-07 15:50                             ` Russell King

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=20120806213124.GB14594@flint.arm.linux.org.uk \
    --to=rmk@arm.linux.org.uk \
    --cc=arnd@arndb.de \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=bryan.wu@canonical.com \
    --cc=haojian.zhuang@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rpurdie@rpsys.net \
    --cc=sameo@linux.intel.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

all inboxes | Powered by JetHome®