All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Russell King <rmk@arm.linux.org.uk>,
	Haojian Zhuang <haojian.zhuang@gmail.com>,
	sameo@linux.intel.com, rpurdie@rpsys.net, bryan.wu@canonical.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/5] mfd: replace IORESOURCE_IO by IORESOURCE_MEM
Date: Tue, 7 Aug 2012 14:28:15 +0000	[thread overview]
Message-ID: <201208071428.15739.arnd@arndb.de> (raw)
In-Reply-To: <20120807132510.GE16861@opensource.wolfsonmicro.com>

On Tuesday 07 August 2012, Mark Brown wrote:
> On Tue, Aug 07, 2012 at 01:11:57PM +0100, Russell King wrote:
> 
> > The only open questions on this are:
> > 1. Is there another driver you are concerned about.
> 
> As I said elsewhere 88pm* needs this as a stable bugfix and wm831x
> should be converted over too.

I've looked through the remaining MFD drivers and found one more,
max8925-core, which is using IORESOURCE_IO for something that is
not ISA/PCI IO-space.

> > 2. Choosing a better name.
> 
> I'm not sure we need one, _REG seems perfectly fine here unless we want
> to go with Arnd's suggestion of _OTHER.  Do you have any concerns with
> the use of reg?

BenH actually suggested _OTHER. I think either one is fine.

> > But I won't put question marks at the end of those because you never seem
> > to answer questions.  You will just produce yet more justifications why
> > this approach is not one you're willing to accept.  So I really don't know
> > why I wasted my time to produce this patch.
> 
> As I mentioned in my mail a few moments ago I had not replied to your
> mails asking these question about which drivers are affected because
> those mails have been arriving so quickly since the first one I saw with
> the question in that there has not been a chance to do so.
> 
> > index 589e0e7..bfee885 100644
> > --- a/include/linux/ioport.h
> > +++ b/include/linux/ioport.h
> > @@ -31,6 +31,7 @@ struct resource {
> >  #define IORESOURCE_TYPE_BITS 0x00001f00      /* Resource type */
> >  #define IORESOURCE_IO                0x00000100
> >  #define IORESOURCE_MEM               0x00000200
> > +#define IORESOURCE_REG               0x00000300      /* Register offsets */
> >  #define IORESOURCE_IRQ               0x00000400
> >  #define IORESOURCE_DMA               0x00000800
> >  #define IORESOURCE_BUS               0x00001000
> 
> As I've said before I'm fine with the driver changes.  I do feel that it
> would be better to also renumber all the existing resource types while
> we're at it in order to make it clear that these are just plain numbers,
> that's the reason nobody wrote this patch previously.  This will avoid
> any future confusion.

This gets into a lot more tricky territory: We have a bunch of drivers
doing their own bitmask operations on these, like drivers/video/offb.c
testing

        if ((flags & (IORESOURCE_IO | IORESOURCE_MEM)) == 0)
                return NULL;

or drivers/scsi/gdth.c doing

            if (!(base0 & IORESOURCE_MEM) ||
                !(base2 & IORESOURCE_MEM) ||
                !(base1 & IORESOURCE_IO)) 
                return -ENODEV;

Now I've looked at the three drivers with the immediate problem of
IORESOURCE_IO abuse (max8925, wm831x, 88pm860x) and none of them are
doing such bitmask operations, so I'm reasonably sure we are fine
for those drivers. I also agree that renumbering the resources in a
way that makes it impossible to use bitmasks is a good idea, but
that would actually be pretty invasive because then we have to rewrite
all the functions that currently do it.

	Arnd

  reply	other threads:[~2012-08-07 14:28 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-05 16:32 [PATCH 0/5] mfd: replace IORESOURCE_IO by IORESOURCE_MEM 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
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 [this message]
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=201208071428.15739.arnd@arndb.de \
    --to=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=rmk@arm.linux.org.uk \
    --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 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.