From: Kay Sievers <kay.sievers@vrfy.org>
To: Jean Delvare <khali@linux-fr.org>
Cc: linuxppc-dev list <linuxppc-dev@ozlabs.org>,
Paul Mundt <lethal@linux-sh.org>,
Scott Wood <scottwood@freescale.com>,
Linux I2C <i2c@lm-sensors.org>
Subject: Re: [PATCH 1/2] i2c: Add support for device alias names
Date: Mon, 28 Apr 2008 18:16:17 +0200 [thread overview]
Message-ID: <1209399377.3666.30.camel@linux.site> (raw)
In-Reply-To: <20080428174010.5a40c2c0@hyperion.delvare>
On Mon, 2008-04-28 at 17:40 +0200, Jean Delvare wrote:
> On Mon, 28 Apr 2008 17:07:25 +0200, Kay Sievers wrote:
> > On Mon, 2008-04-28 at 11:39 +0200, Jean Delvare wrote:
> > > One thing I am still not happy with is that the aliases created have a
> > > trailing "*":
> > >
> > > $ /sbin/modinfo lm90
> > > filename: /lib/modules/2.6.25-git11/kernel/drivers/hwmon/lm90.ko
> > > author: Jean Delvare <khali@linux-fr.org>
> > > description: LM90/ADM1032 driver
> > > license: GPL
> > > vermagic: 2.6.25-git11 mod_unload
> > > depends: hwmon
> > > alias: i2c:lm90*
> > > alias: i2c:adm1032*
> > > alias: i2c:lm99*
> > > alias: i2c:lm86*
> > > alias: i2c:max6657*
> > > alias: i2c:adt7461*
> > > alias: i2c:max6680*
> > > $
> > >
> > > This would cause trouble if one I2C chip name matches the beginning of
> > > another I2C chip name and both chips are supported by different
> > > drivers. This has yet to be seen, but still, I'd like to see this
> > > problem fixed quickly.
> >
> > Right, the trailing "*" is not nice.
> >
> > We should terminate the string, so the trailing "*" will not match
> > longer strings. The usual thing is to add a ":" to the end, which would
> > then show up as
> > alias: i2c:max6680:*
> >
> > See DMI and ACPI:
> > alias dmi:*:svnFUJITSU:pnLifeBook*:pvr*:rvnFUJITSU:* apanel
> > alias acpi*:ASIM0000:* atlas_btns
>
> I didn't know about these cases, thanks for the hint.
>
> >
> > If i2c device modaliases could ever contain multiple strings, it should
> > be:
> > alias: i2c*:max6680:*
> > to match the module, regardless of the order of the strings in the
> > modalias:
>
> Why would i2c device modaliases ever contain multiple strings? A device
> can't have multiple names, can it?
Like ACPI/PNP devices, which can have several compat id's, which means
that a single device can have "multiple names":
$ cat /sys/bus/pnp/devices/00:09/id
IBM0057
PNP0f13
> Adding a ":" at the end of the i2c device names solves the problem I
> was mentioning, sure, but why don't we simply remove the trailing "*",
> instead of trying to work around it? A trailing "*" simply makes no
> sense for aliases which are simple device names.
Sure, if there is only one single string, it's not useful.
> This is not only i2c
> devices, but also platform devices, acpi, dmi, pnp...
ACPI, DMI, PNP (PNP does not do modalias) needs to be able to match only
one string in a given list, so the trailing "*" is needed.
> Looking at the
> various device types handled by file2alias.c, it seems that most of
> them don't need the trailing "*", and many of them have the problem I
> was mentioning.
>
> Can't we just stop handle_moddevtable() from adding a tailing "*"
> automatically, and just let the device types which need it, add it on
> their own?
For a lot subsystems it's fine to have it appended, as there is a
defined list of identifiers, which must appear in the same order, and
new identifiers are appended to the end. So the "*" still matches
modules with possibly extended modalias strings.
We would also need to review all buses which export modalias, if they
need the "*" or not, and add them by hand, if needed.
I guess, it's easier to introduce an additional parameter to
file2alias::do_table() and suppress the trailing "*" for i2c?
Thanks,
Kay
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev
WARNING: multiple messages have this Message-ID (diff)
From: Kay Sievers <kay.sievers@vrfy.org>
To: Jean Delvare <khali@linux-fr.org>
Cc: linuxppc-dev list <linuxppc-dev@ozlabs.org>,
Paul Mundt <lethal@linux-sh.org>,
Scott Wood <scottwood@freescale.com>,
Linux I2C <i2c@lm-sensors.org>
Subject: Re: [PATCH 1/2] i2c: Add support for device alias names
Date: Mon, 28 Apr 2008 18:16:17 +0200 [thread overview]
Message-ID: <1209399377.3666.30.camel@linux.site> (raw)
In-Reply-To: <20080428174010.5a40c2c0@hyperion.delvare>
On Mon, 2008-04-28 at 17:40 +0200, Jean Delvare wrote:
> On Mon, 28 Apr 2008 17:07:25 +0200, Kay Sievers wrote:
> > On Mon, 2008-04-28 at 11:39 +0200, Jean Delvare wrote:
> > > One thing I am still not happy with is that the aliases created have =
a
> > > trailing "*":
> > >=20
> > > $ /sbin/modinfo lm90
> > > filename: /lib/modules/2.6.25-git11/kernel/drivers/hwmon/lm90.k=
o
> > > author: Jean Delvare <khali@linux-fr.org>
> > > description: LM90/ADM1032 driver
> > > license: GPL
> > > vermagic: 2.6.25-git11 mod_unload
> > > depends: hwmon
> > > alias: i2c:lm90*
> > > alias: i2c:adm1032*
> > > alias: i2c:lm99*
> > > alias: i2c:lm86*
> > > alias: i2c:max6657*
> > > alias: i2c:adt7461*
> > > alias: i2c:max6680*
> > > $
> > >=20
> > > This would cause trouble if one I2C chip name matches the beginning o=
f
> > > another I2C chip name and both chips are supported by different
> > > drivers. This has yet to be seen, but still, I'd like to see this
> > > problem fixed quickly.
> >=20
> > =EF=BB=BFRight, the trailing "*" is not nice.
> >=20
> > We should terminate the string, so the trailing "*" will not match
> > longer strings. The usual thing is to add a ":" to the end, which would
> > then show up as
> > alias: i2c:max6680:*
> >=20
> > See DMI and ACPI:
> > alias dmi:*:svnFUJITSU:pnLifeBook*:pvr*:rvnFUJITSU:* apanel
> > alias acpi*:ASIM0000:* atlas_btns
>=20
> I didn't know about these cases, thanks for the hint.
>=20
> >=20
> > If i2c device modaliases could ever contain multiple strings, it should
> > be:
> > alias: i2c*:max6680:*
> > =EF=BB=BFto match the module, regardless of the order of the strings in=
the
> > modalias:
>=20
> Why would i2c device modaliases ever contain multiple strings? A device
> can't have multiple names, can it?
Like ACPI/PNP devices, which can have several compat id's, which means
that a single device can have "multiple names":
$ cat /sys/bus/pnp/devices/00:09/id
IBM0057
PNP0f13
> Adding a ":" at the end of the i2c device names solves the problem I
> was mentioning, sure, but why don't we simply remove the trailing "*",
> instead of trying to work around it? A trailing "*" simply makes no
> sense for aliases which are simple device names.
Sure, if there is only one single string, it's not useful.
> This is not only i2c
> devices, but also platform devices, acpi, dmi, pnp...
ACPI, DMI, PNP (PNP does not do modalias) needs to be able to match only
one string in a given list, so the trailing "*" is needed.
> Looking at the
> various device types handled by file2alias.c, it seems that most of
> them don't need the trailing "*", and many of them have the problem I
> was mentioning.
>=20
> Can't we just stop handle_moddevtable() from adding a tailing "*"
> automatically, and just let the device types which need it, add it on
> their own?
For a lot subsystems it's fine to have it appended, as there is a
defined list of identifiers, which must appear in the same order, and
new identifiers are appended to the end. So the "*" still matches
modules with possibly extended modalias strings.
We would also need to review all buses which export modalias, if they
need the "*" or not, and add them by hand, if needed.
I guess, it's easier to introduce an additional parameter to
file2alias::do_table() and suppress the trailing "*" for i2c?
Thanks,
Kay
next prev parent reply other threads:[~2008-04-28 16:16 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-28 9:30 [PATCH 0/2] i2c: Add support for device alias names Jean Delvare
2008-04-28 9:30 ` Jean Delvare
2008-04-28 9:39 ` [PATCH 1/2] " Jean Delvare
2008-04-28 9:39 ` Jean Delvare
2008-04-28 14:43 ` Jon Smirl
[not found] ` <9e4733910804280743q2de1da62m120c607b200cafa0-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-04-28 15:42 ` Jean Delvare
2008-04-28 15:42 ` Jean Delvare
2008-04-28 15:07 ` Kay Sievers
2008-04-28 15:07 ` Kay Sievers
[not found] ` <1209395245.3666.9.camel-YbU/o29LwNHN0uC3ymp8PA@public.gmane.org>
2008-04-28 15:40 ` Jean Delvare
2008-04-28 15:40 ` Jean Delvare
2008-04-28 16:16 ` Kay Sievers [this message]
2008-04-28 16:16 ` Kay Sievers
2008-05-01 8:04 ` Jean Delvare
2008-05-01 8:04 ` Jean Delvare
[not found] ` <20080501100409.1b04fdb7-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-05-01 15:51 ` Kay Sievers
2008-05-01 15:51 ` Kay Sievers
2008-04-28 9:53 ` [PATCH 2/2] i2c: Convert most new-style drivers to use module aliasing Jean Delvare
2008-04-28 9:53 ` Jean Delvare
[not found] ` <20080428113052.6d024bda-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-04-28 15:35 ` [PATCH 0/2] i2c: Add support for device alias names Wolfram Sang
2008-04-28 15:35 ` [i2c] " Wolfram Sang
[not found] ` <20080428153543.GB4353-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2008-04-28 20:24 ` Jochen Friedrich
2008-04-28 20:24 ` [i2c] " Jochen Friedrich
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=1209399377.3666.30.camel@linux.site \
--to=kay.sievers@vrfy.org \
--cc=i2c@lm-sensors.org \
--cc=khali@linux-fr.org \
--cc=lethal@linux-sh.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=scottwood@freescale.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.