All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] i2c: Relax mandatory I2C ID table passing
@ 2014-06-04 12:09 ` Lee Jones
  0 siblings, 0 replies; 111+ messages in thread
From: Lee Jones @ 2014-06-04 12:09 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: wsa, grant.likely, linux-i2c, devicetree, linus.walleij

Hi Wolfram,

As previously discussed I believe it should be okay for an I2C device
driver _not_ supply an I2C ID table to match to.  The I2C subsystem
should be able to match via other means, such as via OF and/or ACPI
tables.  The blocking factor during our previous conversation was
to keep registering via sysfs up and running.  This set does that.

After thinking more deeply about the problem, it occurred to me that
any I2C device driver which issues an {of,acpi}_match)_device()
would also fail their probe().  Bolted on to this set is a new, more
generic way for these devices to match against any of the tables
which are present in the kernel today i.e. OF, ACPI and I2C.

NB: ACPI is not fully supported, but OF is.

I hope this ticks all of your boxes.

Kind regards,
Lee

 drivers/i2c/i2c-core.c          | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
 drivers/of/device.c             | 16 +++++++++++++++-
 include/acpi/platform/aclinux.h |  5 +++--
 include/linux/i2c.h             | 19 +++++++++++++++++++
 include/linux/match.h           | 40 ++++++++++++++++++++++++++++++++++++++++
 5 files changed, 135 insertions(+), 10 deletions(-)


^ permalink raw reply	[flat|nested] 111+ messages in thread
* Re: [Devel] [PATCH 1/7] ACPICA: Only include ACPI asm files if ACPI is enabled
@ 2014-06-05  1:01 ` Zheng, Lv
  0 siblings, 0 replies; 111+ messages in thread
From: Zheng, Lv @ 2014-06-05  0:59 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 2179 bytes --]

Hi,

> From: linux-i2c-owner(a)vger.kernel.org [mailto:linux-i2c-owner(a)vger.kernel.org] On Behalf Of Rafael J. Wysocki
> Sent: Thursday, June 05, 2014 5:30 AM
> 
> On Wednesday, June 04, 2014 01:51:37 PM Lee Jones wrote:
> > On Wed, 04 Jun 2014, Rafael J. Wysocki wrote:
> >
> > > On Wednesday, June 04, 2014 01:09:50 PM Lee Jones wrote:
> > > > Any drivers which support ACPI and Device Tree probing need to include
> > > > both respective header files.  Without this patch, if a driver is being
> > > > used on a platform which does not support ACPI and subsequently does not
> > > > have the config option enabled, but includes linux/acpi.h the build
> > > > breaks with:
> > > >
> > > >   In file included from ../include/acpi/platform/acenv.h:150:0,
> > > >                    from ../include/acpi/acpi.h:56,
> > > >                    from ../include/linux/match.h:2,
> > > >                    from ../drivers/i2c/i2c-core.c:43:
> > > >   ../include/acpi/platform/aclinux.h:73:23:
> > > >    fatal error: asm/acenv.h: No such file or directory
> > > >    #include <asm/acenv.h>
> > > >                        ^
> > >
> > > Which kernel does this happen with?
> >
> > a0a962d (tag: refs/tags/next-20140602, refs/remotes/next/master)
> >   Add linux-next specific files for 20140602
> 
> It looks like the problem is with include/linux/match.h that should not
> include acpi/acpi.h directly.

This is another example that many mis-ordered inclusions are caused by the mis-ordered <asm/acpi.h> inclusion.

> 
> But I can't find this file in the Linus' next branch even, so I guess it's
> on its way to that branch?
> 

I guess,
In their tree, they have CONFIG_ACPI enabled for ARM, but we've changed to make:
1. <asm/acenv.h> the architecture specific layer for ACPICA, and
2. <asm/acpi.h> is now the architecture specific layer for Linux ACPI.
So they need to follow this.

Thanks and best regards
-Lv

> Rafael
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
> the body of a message to majordomo(a)vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 111+ messages in thread
* Re: [Devel] [PATCH 1/7] ACPICA: Only include ACPI asm files if ACPI is enabled
  2014-06-05  4:11                 ` Hanjun Guo
  (?)
  (?)
@ 2014-06-05  4:46 ` Zheng, Lv
  -1 siblings, 0 replies; 111+ messages in thread
From: Zheng, Lv @ 2014-06-05  4:44 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 2672 bytes --]

Hi, 

> From: Hanjun Guo [mailto:hanjun.guo(a)linaro.org]
> Sent: Thursday, June 05, 2014 12:11 PM
> To: Zheng, Lv; Lee Jones; Rafael J. Wysocki
> 
> On 2014-6-5 9:14, Zheng, Lv wrote:
> > Hi, Lee
> >
> >> From: Lee Jones [mailto:lee.jones(a)linaro.org]
> >> Sent: Wednesday, June 04, 2014 8:52 PM
> >> To: Rafael J. Wysocki
> >>
> >> On Wed, 04 Jun 2014, Rafael J. Wysocki wrote:
> >>
> >>> On Wednesday, June 04, 2014 01:09:50 PM Lee Jones wrote:
> >>>> Any drivers which support ACPI and Device Tree probing need to include
> >>>> both respective header files.  Without this patch, if a driver is being
> >>>> used on a platform which does not support ACPI and subsequently does not
> >>>> have the config option enabled, but includes linux/acpi.h the build
> >>>> breaks with:
> >>>>
> >>>>   In file included from ../include/acpi/platform/acenv.h:150:0,
> >>>>                    from ../include/acpi/acpi.h:56,
> >>>>                    from ../include/linux/match.h:2,
> >>>>                    from ../drivers/i2c/i2c-core.c:43:
> >>>>   ../include/acpi/platform/aclinux.h:73:23:
> >>>>    fatal error: asm/acenv.h: No such file or directory
> >>>>    #include <asm/acenv.h>
> >>>>                        ^
> >
> > Note that:
> > In our tree:
> > <asm/acenv.h> is only included by <acpi/acpi.h>.
> > And <acpi/acpi.h> is only included by
> > 1. <linux/acpi.h> when CONFIG_ACPI enabled
> > 2. <linux/sfi_acpi.h> - this is x86 specific, we'll clean it up by implementing stubs for all ACPI external interfaces.
> > So there is no case we need to exclude <asm/acenv.h> when CONFIG_ACPI is not enabled.
> >
> > I cannot find linux/match.h here.
> > If <linux/match.h> want to include ACPI features, it shouldn't include <acpi/acpi.h>, but should include <linux/acpi.h>.
> > Please refer to:
> > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=8b48463f
> > And stop including <acpi/acpi.h> directly in any cases.
> 
> Ah, I agree, please ignore my previous email,
> sorry for the noise.
> 
> Since it is very important to include <linux/acpi.h> but not <acpi/acpi.h>,
> can we document it somewhere as the guidance? Then people will not
> make such mistake :)

After I test the ACPICA stubs and remove the only abnormal direct <acpi/acpi.h> inclusion from <linux/sfi_acpi.h>.
We could have a commit to add something like:

#ifndef _LINUX_ACPI_H
#error ....
#endif
To the <acpi/platform/aclinux.h> (the Linux OSL for ACPICA headers, it is included by <acpi/acpi.h>).
Hope this can be the hint to prevent future mistakes.

Thanks and best regards
-Lv


> 
> Thanks
> Hanjun


^ permalink raw reply	[flat|nested] 111+ messages in thread

end of thread, other threads:[~2014-06-07  9:31 UTC | newest]

Thread overview: 111+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-04 12:09 [PATCH 0/7] i2c: Relax mandatory I2C ID table passing Lee Jones
2014-06-04 12:09 ` Lee Jones
2014-06-04 12:09 ` Lee Jones
2014-06-04 12:09 ` [PATCH 1/7] ACPICA: Only include ACPI asm files if ACPI is enabled Lee Jones
2014-06-04 12:09   ` Lee Jones
     [not found]   ` <1401883796-17841-2-git-send-email-lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-06-04 12:35     ` Rafael J. Wysocki
2014-06-04 12:35       ` Rafael J. Wysocki
2014-06-04 12:35       ` Rafael J. Wysocki
     [not found]       ` <3061297.feg5DGUjIt-sKB8Sp2ER+y1GS7QM15AGw@public.gmane.org>
2014-06-04 12:51         ` Lee Jones
2014-06-04 12:51           ` Lee Jones
2014-06-04 12:51           ` Lee Jones
2014-06-04 21:29           ` Rafael J. Wysocki
2014-06-04 21:29             ` Rafael J. Wysocki
2014-06-04 21:29             ` Rafael J. Wysocki
2014-06-05  1:12           ` [Devel] " Zheng, Lv
2014-06-05  1:14             ` Zheng, Lv
2014-06-05  1:14             ` Zheng, Lv
2014-06-05  1:14             ` Zheng, Lv
     [not found]             ` <1AE640813FDE7649BE1B193DEA596E880262042C-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-06-05  4:11               ` Hanjun Guo
2014-06-05  4:11                 ` Hanjun Guo
2014-06-05  4:11                 ` Hanjun Guo
2014-06-05  0:54   ` [Devel] " Zheng, Lv
2014-06-05  0:56     ` Zheng, Lv
2014-06-05  0:56     ` Zheng, Lv
2014-06-05  0:56     ` Zheng, Lv
2014-06-05  4:06     ` Hanjun Guo
2014-06-05  4:06       ` Hanjun Guo
2014-06-05  4:06       ` Hanjun Guo
2014-06-04 12:09 ` [PATCH 2/7] i2c: Add pointer dereference protection to i2c_match_id() Lee Jones
2014-06-04 12:09   ` Lee Jones
2014-06-04 12:09   ` Lee Jones
2014-06-04 12:09 ` [PATCH 3/7] i2c: Add the ability to match device to compatible string without an of_node Lee Jones
2014-06-04 12:09   ` Lee Jones
2014-06-04 17:29   ` Rob Herring
2014-06-04 17:29     ` Rob Herring
2014-06-04 17:29     ` Rob Herring
2014-06-04 17:55     ` Lee Jones
2014-06-04 17:55       ` Lee Jones
2014-06-04 17:55       ` Lee Jones
2014-06-05 17:36   ` Grant Likely
2014-06-05 17:36     ` Grant Likely
2014-06-05 17:36     ` Grant Likely
2014-06-06  8:10     ` Lee Jones
2014-06-06  8:10       ` Lee Jones
2014-06-06  8:10       ` Lee Jones
2014-06-06 23:39       ` Grant Likely
2014-06-06 23:39         ` Grant Likely
2014-06-06 23:39         ` Grant Likely
2014-06-04 12:09 ` [PATCH 4/7] i2c: Match using traditional OF methods, then by vendor-less compatible strings Lee Jones
2014-06-04 12:09   ` Lee Jones
2014-06-04 12:09   ` Lee Jones
2014-06-04 12:09 ` [PATCH 5/7] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices Lee Jones
2014-06-04 12:09   ` Lee Jones
2014-06-05 10:27   ` Grant Likely
2014-06-05 10:27     ` Grant Likely
2014-06-05 10:27     ` Grant Likely
2014-06-04 12:09 ` [PATCH 6/7] of/device: Allow I2C devices to OF match without supplying an OF node Lee Jones
2014-06-04 12:09   ` Lee Jones
2014-06-04 12:09 ` [PATCH 7/7] OF/ACPI/I2C: Add generic match function for the aforementioned systems Lee Jones
2014-06-04 12:09   ` Lee Jones
2014-06-04 12:37   ` Rafael J. Wysocki
2014-06-04 12:37     ` Rafael J. Wysocki
2014-06-04 12:51     ` Mika Westerberg
2014-06-04 12:51       ` Mika Westerberg
2014-06-04 13:28       ` Lee Jones
2014-06-04 13:28         ` Lee Jones
2014-06-04 13:28         ` Lee Jones
2014-06-05  8:00         ` Mika Westerberg
2014-06-05  8:00           ` Mika Westerberg
2014-06-05  8:00           ` Mika Westerberg
2014-06-05  8:20           ` Lee Jones
2014-06-05  8:20             ` Lee Jones
2014-06-05  8:20             ` Lee Jones
2014-06-05 10:32             ` Grant Likely
2014-06-05 10:32               ` Grant Likely
2014-06-05 10:32               ` Grant Likely
2014-06-05 10:30   ` Grant Likely
2014-06-05 10:30     ` Grant Likely
2014-06-05 10:30     ` Grant Likely
2014-06-05 10:37     ` Lee Jones
2014-06-05 10:37       ` Lee Jones
2014-06-05 10:37       ` Lee Jones
2014-06-05 15:41       ` Grant Likely
2014-06-05 15:41         ` Grant Likely
2014-06-05 15:41         ` Grant Likely
2014-06-05 15:55         ` Lee Jones
2014-06-05 15:55           ` Lee Jones
2014-06-05 15:55           ` Lee Jones
2014-06-05 17:37           ` Grant Likely
2014-06-05 17:37             ` Grant Likely
2014-06-05 17:37             ` Grant Likely
2014-06-06 10:24           ` Mark Brown
2014-06-06 10:24             ` Mark Brown
2014-06-06 10:24             ` Mark Brown
2014-06-06 12:36             ` Lee Jones
2014-06-06 12:36               ` Lee Jones
2014-06-06 12:36               ` Lee Jones
2014-06-06 23:42               ` Grant Likely
2014-06-06 23:42                 ` Grant Likely
2014-06-06 23:42                 ` Grant Likely
2014-06-07  9:31                 ` Mark Brown
2014-06-07  9:31                   ` Mark Brown
2014-06-07  9:31                   ` Mark Brown
2014-06-05  0:59 [Devel] [PATCH 1/7] ACPICA: Only include ACPI asm files if ACPI is enabled Zheng, Lv
2014-06-05  1:01 ` Zheng, Lv
2014-06-05  1:01 ` Zheng, Lv
2014-06-05  1:01 ` Zheng, Lv
2014-06-05  4:44 [Devel] " Zheng, Lv
2014-06-05  4:46 ` Zheng, Lv
2014-06-05  4:46 ` Zheng, Lv
2014-06-05  4:46 ` Zheng, Lv

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.