sd-device: add support for second modalias#18163
Conversation
ACPI device can have two modaliases if it has DT namespace [1]. They are created by kernel function __acpi_device_uevent_modalias(): $ cat /sys/bus/platform/devices/AHC1EC0\:00/uevent MODALIAS=acpi:AHC1EC0: MODALIAS=of:NadecTCadvantech,ahc1ec0 Because of the nature of hashmap, the second modalias always replaces the first modalias, preventing driver loading for first modalias. So use a different key, MODALIAS1, for the second modalias to solve the issue. [1] https://www.kernel.org/doc/html/latest/firmware-guide/acpi/enumeration.html#device-tree-namespace-link-device-id
ff3f4a7 to
30e283c
Compare
|
I am sorry but the event env block from the kernel is no longer suitable as env block? Thats just broken. Is there any other kernel subsystem that passes uevent blocks to userspace with non-unique keys? This is a corruption of the kernel interface and should be fixed in kernel space, not worked around in userspace |
|
Hmm, @gregkh you are the Linux device model maintainer, any chance you can weigh in? are uevent env blocks no longer supposed to contain only unique keys? People generally assume they consist of unique keys only. If they aren#t this would break a ton of userspace. @khfeng why doesn't the kernel expose the second modalias line under a unique key name? i.e. |
Seems like only ACPI subsystem can have non-unique keys.
I can't find any guarantee in the kernel doc or API states that the key in uevent file is and has to be unique. So while I do understand it's not desirable, I don't think this is a workaround. |
|
I'm sorry, but I don't understand the problem here. What does not have "unique keys"? What is a "key" here? Drivers can have loads of MODALIAS entries, always have, what has changed to cause a problem here? |
|
@gregkh some ACPI device can have DT compatible ID [1]. Kernel exposes them as two The problem is, systemd-udevd first stores key When executing rule This PR is an attempt to make sure the |
The problem is that there are now Maybe it never was declared that keys in |
|
@khfeng the offending devices in sysfs, what do they actually export in the |
|
Ah, a modalias of a device, not a driver, sorry, was confused here. Odd, but as drivers can handle multiple MODALIAS values today, I don't see why a device can't do the same thing so userspace should handle this. And yes @poettering , I don't think we ever declared that keys in uevent files had to be unique, sorry. If we had done that, then yes, this would be a kernel bug. But they really aren't "keys" but rather, "attributes", or some other term that is being used to describe something that you might have multiple of. |
|
@gregkh well, but no userspace app is prepared for that... given it's not documented you might not break documented API with that, but certainly assumed API all over the place. If you allow this suddenly, then you basically have to go through all userspace and fix that up. And what for? Why not just make official what everybody so far assumed, and say that @gregkh what is the |
@poettering yes, two lines for two modaliases: |
|
also, this means old udev and userspace won't work correctly on new kernels anymore. We'd have to make a public announcement about that again, and that people need to update. I mean, I am not actually opposed to breaking API if the old logic was really broken. But I don't see thta here. The assumption that keys in How do you thin udev rules should work if they aren't unique btw? i.e. if someone has I mean, by insisting that uevent keys don't have to be unique you are not just breaking udev code, but actually udev semantics in a quite drastic way. |
|
While I would like to say this is a "bug", it has been this way for ACPI devices since 2007, when the ACPI bus first got support for MODALIAS entries. So nothing has "changed" in the kernel related to this, sorry. |
|
And if you all want to change this, and really, I think it should be changed, please contact the ACPI kernel developers and work with them to figure out how to properly support their multiple lists of aliases for devices. Feel free to cc: me on the emails, thanks! |
|
It was introduced by commit 8765c5ba1949 ("ACPI / scan: Rework modalias creation when "compatible" is present"), which was included in Linux v4.0. |
|
Anyway, let me start a discussion on mailing list. |
|
Oops, good catch, yes, that's the right commit. from 2015, a bit newer :) |
|
i am irritated they did the change without checking whether it actually works, and noone noticed... |
|
To be fair, these kind of devices (supports both ACPI and Device Tree) are more likely to be used on embedded systems. AFAIK most embedded systems don't use systemd. So if we are to change the kernel side of thing, we need to be extra careful. |
Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in uevent file if conditions are met. This breaks systemd-udevd, which assumes each "key" in uevent file is unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load driver for the first MODALIAS. Right now it doesn't seem to have any user relies on the second MODALIAS, so change it to OF_MODALIAS to workaround the issue. Reference: systemd/systemd#18163 Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]>
Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in uevent file if conditions are met. This breaks systemd-udevd, which assumes each "key" in uevent file is unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load driver for the first MODALIAS. Right now it doesn't seem to have any user relies on the second MODALIAS, so change it to OF_MODALIAS to workaround the issue. Reference: systemd/systemd#18163 Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Cc: AceLan Kao <[email protected]> Cc: "Rafael J. Wysocki" <[email protected]> Cc: Greg Kroah-Hartman <[email protected]>, Cc: Mika Westerberg <[email protected]>, Cc: Andy Shevchenko <[email protected]> Signed-off-by: Kai-Heng Feng <[email protected]>
|
End up stripping away the ACPI modalias and at kernel side. Still, thanks for reviewing! |
|
That's great news, thanks for following up! |
commit 36af2d5 upstream. Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in one uevent file if specific conditions are met. This breaks systemd-udevd, which assumes each "key" in one uevent file to be unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load the driver for the first MODALIAS. So if both the ACPI modalias and the OF modalias are present, use the latter to ensure that there will be only one MODALIAS. Link: systemd/systemd#18163 Suggested-by: Mika Westerberg <[email protected]> Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: 4.1+ <[email protected]> # 4.1+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 36af2d5 upstream. Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in one uevent file if specific conditions are met. This breaks systemd-udevd, which assumes each "key" in one uevent file to be unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load the driver for the first MODALIAS. So if both the ACPI modalias and the OF modalias are present, use the latter to ensure that there will be only one MODALIAS. Link: systemd/systemd#18163 Suggested-by: Mika Westerberg <[email protected]> Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: 4.1+ <[email protected]> # 4.1+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 36af2d5 upstream. Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in one uevent file if specific conditions are met. This breaks systemd-udevd, which assumes each "key" in one uevent file to be unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load the driver for the first MODALIAS. So if both the ACPI modalias and the OF modalias are present, use the latter to ensure that there will be only one MODALIAS. Link: systemd/systemd#18163 Suggested-by: Mika Westerberg <[email protected]> Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: 4.1+ <[email protected]> # 4.1+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 36af2d5 upstream. Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in one uevent file if specific conditions are met. This breaks systemd-udevd, which assumes each "key" in one uevent file to be unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load the driver for the first MODALIAS. So if both the ACPI modalias and the OF modalias are present, use the latter to ensure that there will be only one MODALIAS. Link: systemd/systemd#18163 Suggested-by: Mika Westerberg <[email protected]> Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: 4.1+ <[email protected]> # 4.1+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in one uevent file if specific conditions are met. This breaks systemd-udevd, which assumes each "key" in one uevent file to be unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load the driver for the first MODALIAS. So if both the ACPI modalias and the OF modalias are present, use the latter to ensure that there will be only one MODALIAS. Link: systemd/systemd#18163 Suggested-by: Mika Westerberg <[email protected]> Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: 4.1+ <[email protected]> # 4.1+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
commit 36af2d5c4433fb40ee2af912c4ac0a30991aecfc upstream. Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in one uevent file if specific conditions are met. This breaks systemd-udevd, which assumes each "key" in one uevent file to be unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load the driver for the first MODALIAS. So if both the ACPI modalias and the OF modalias are present, use the latter to ensure that there will be only one MODALIAS. Link: systemd/systemd#18163 Suggested-by: Mika Westerberg <[email protected]> Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: 4.1+ <[email protected]> # 4.1+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 36af2d5c4433fb40ee2af912c4ac0a30991aecfc upstream.
Commit 8765c5ba1949 ("ACPI / scan: Rework modalias creation when
"compatible" is present") may create two "MODALIAS=" in one uevent
file if specific conditions are met.
This breaks systemd-udevd, which assumes each "key" in one uevent file
to be unique. The internal implementation of systemd-udevd overwrites
the first MODALIAS with the second one, so its kmod rule doesn't load
the driver for the first MODALIAS.
So if both the ACPI modalias and the OF modalias are present, use the
latter to ensure that there will be only one MODALIAS.
Link: systemd/systemd#18163
Suggested-by: Mika Westerberg <[email protected]>
Fixes: 8765c5ba1949 ("ACPI / scan: Rework modalias creation when "compatible" is present")
Signed-off-by: Kai-Heng Feng <[email protected]>
Reviewed-by: Mika Westerberg <[email protected]>
Reviewed-by: Greg Kroah-Hartman <[email protected]>
Cc: 4.1+ <[email protected]> # 4.1+
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 36af2d5c4433fb40ee2af912c4ac0a30991aecfc upstream. Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in one uevent file if specific conditions are met. This breaks systemd-udevd, which assumes each "key" in one uevent file to be unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load the driver for the first MODALIAS. So if both the ACPI modalias and the OF modalias are present, use the latter to ensure that there will be only one MODALIAS. Link: systemd/systemd#18163 Suggested-by: Mika Westerberg <[email protected]> Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: 4.1+ <[email protected]> # 4.1+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 36af2d5c4433fb40ee2af912c4ac0a30991aecfc upstream. Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in one uevent file if specific conditions are met. This breaks systemd-udevd, which assumes each "key" in one uevent file to be unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load the driver for the first MODALIAS. So if both the ACPI modalias and the OF modalias are present, use the latter to ensure that there will be only one MODALIAS. Link: systemd/systemd#18163 Suggested-by: Mika Westerberg <[email protected]> Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: 4.1+ <[email protected]> # 4.1+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 36af2d5c4433fb40ee2af912c4ac0a30991aecfc upstream.
Commit 8765c5ba1949 ("ACPI / scan: Rework modalias creation when
"compatible" is present") may create two "MODALIAS=" in one uevent
file if specific conditions are met.
This breaks systemd-udevd, which assumes each "key" in one uevent file
to be unique. The internal implementation of systemd-udevd overwrites
the first MODALIAS with the second one, so its kmod rule doesn't load
the driver for the first MODALIAS.
So if both the ACPI modalias and the OF modalias are present, use the
latter to ensure that there will be only one MODALIAS.
Link: systemd/systemd#18163
Suggested-by: Mika Westerberg <[email protected]>
Fixes: 8765c5ba1949 ("ACPI / scan: Rework modalias creation when "compatible" is present")
Signed-off-by: Kai-Heng Feng <[email protected]>
Reviewed-by: Mika Westerberg <[email protected]>
Reviewed-by: Greg Kroah-Hartman <[email protected]>
Cc: 4.1+ <[email protected]> # 4.1+
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 36af2d5c4433fb40ee2af912c4ac0a30991aecfc upstream. Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in one uevent file if specific conditions are met. This breaks systemd-udevd, which assumes each "key" in one uevent file to be unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load the driver for the first MODALIAS. So if both the ACPI modalias and the OF modalias are present, use the latter to ensure that there will be only one MODALIAS. Link: systemd/systemd#18163 Suggested-by: Mika Westerberg <[email protected]> Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: 4.1+ <[email protected]> # 4.1+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 36af2d5c4433fb40ee2af912c4ac0a30991aecfc upstream. Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in one uevent file if specific conditions are met. This breaks systemd-udevd, which assumes each "key" in one uevent file to be unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load the driver for the first MODALIAS. So if both the ACPI modalias and the OF modalias are present, use the latter to ensure that there will be only one MODALIAS. Link: systemd/systemd#18163 Suggested-by: Mika Westerberg <[email protected]> Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: 4.1+ <[email protected]> # 4.1+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 36af2d5c4433fb40ee2af912c4ac0a30991aecfc upstream. Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in one uevent file if specific conditions are met. This breaks systemd-udevd, which assumes each "key" in one uevent file to be unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load the driver for the first MODALIAS. So if both the ACPI modalias and the OF modalias are present, use the latter to ensure that there will be only one MODALIAS. Link: systemd/systemd#18163 Suggested-by: Mika Westerberg <[email protected]> Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: 4.1+ <[email protected]> # 4.1+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 36af2d5c4433fb40ee2af912c4ac0a30991aecfc upstream. Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in one uevent file if specific conditions are met. This breaks systemd-udevd, which assumes each "key" in one uevent file to be unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load the driver for the first MODALIAS. So if both the ACPI modalias and the OF modalias are present, use the latter to ensure that there will be only one MODALIAS. Link: systemd/systemd#18163 Suggested-by: Mika Westerberg <[email protected]> Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: 4.1+ <[email protected]> # 4.1+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 36af2d5 upstream. Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in one uevent file if specific conditions are met. This breaks systemd-udevd, which assumes each "key" in one uevent file to be unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load the driver for the first MODALIAS. So if both the ACPI modalias and the OF modalias are present, use the latter to ensure that there will be only one MODALIAS. Link: systemd/systemd#18163 Suggested-by: Mika Westerberg <[email protected]> Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: 4.1+ <[email protected]> # 4.1+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 36af2d5 upstream. Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in one uevent file if specific conditions are met. This breaks systemd-udevd, which assumes each "key" in one uevent file to be unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load the driver for the first MODALIAS. So if both the ACPI modalias and the OF modalias are present, use the latter to ensure that there will be only one MODALIAS. Link: systemd/systemd#18163 Suggested-by: Mika Westerberg <[email protected]> Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: 4.1+ <[email protected]> # 4.1+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 36af2d5c4433fb40ee2af912c4ac0a30991aecfc upstream. Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in one uevent file if specific conditions are met. This breaks systemd-udevd, which assumes each "key" in one uevent file to be unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load the driver for the first MODALIAS. So if both the ACPI modalias and the OF modalias are present, use the latter to ensure that there will be only one MODALIAS. Link: systemd/systemd#18163 Suggested-by: Mika Westerberg <[email protected]> Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: 4.1+ <[email protected]> # 4.1+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 36af2d5c4433fb40ee2af912c4ac0a30991aecfc upstream. Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in one uevent file if specific conditions are met. This breaks systemd-udevd, which assumes each "key" in one uevent file to be unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load the driver for the first MODALIAS. So if both the ACPI modalias and the OF modalias are present, use the latter to ensure that there will be only one MODALIAS. Link: systemd/systemd#18163 Suggested-by: Mika Westerberg <[email protected]> Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: 4.1+ <[email protected]> # 4.1+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 36af2d5c4433fb40ee2af912c4ac0a30991aecfc upstream. Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in one uevent file if specific conditions are met. This breaks systemd-udevd, which assumes each "key" in one uevent file to be unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load the driver for the first MODALIAS. So if both the ACPI modalias and the OF modalias are present, use the latter to ensure that there will be only one MODALIAS. Link: systemd/systemd#18163 Suggested-by: Mika Westerberg <[email protected]> Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: 4.1+ <[email protected]> # 4.1+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 36af2d5c4433fb40ee2af912c4ac0a30991aecfc upstream. Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in one uevent file if specific conditions are met. This breaks systemd-udevd, which assumes each "key" in one uevent file to be unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load the driver for the first MODALIAS. So if both the ACPI modalias and the OF modalias are present, use the latter to ensure that there will be only one MODALIAS. Link: systemd/systemd#18163 Suggested-by: Mika Westerberg <[email protected]> Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: 4.1+ <[email protected]> # 4.1+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 36af2d5 upstream. Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in one uevent file if specific conditions are met. This breaks systemd-udevd, which assumes each "key" in one uevent file to be unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load the driver for the first MODALIAS. So if both the ACPI modalias and the OF modalias are present, use the latter to ensure that there will be only one MODALIAS. Link: systemd/systemd#18163 Suggested-by: Mika Westerberg <[email protected]> Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: 4.1+ <[email protected]> # 4.1+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Yang Yingliang <[email protected]>
commit 36af2d5c4433fb40ee2af912c4ac0a30991aecfc upstream. Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in one uevent file if specific conditions are met. This breaks systemd-udevd, which assumes each "key" in one uevent file to be unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load the driver for the first MODALIAS. So if both the ACPI modalias and the OF modalias are present, use the latter to ensure that there will be only one MODALIAS. Link: systemd/systemd#18163 Suggested-by: Mika Westerberg <[email protected]> Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: 4.1+ <[email protected]> # 4.1+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 36af2d5c4433fb40ee2af912c4ac0a30991aecfc upstream. Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in one uevent file if specific conditions are met. This breaks systemd-udevd, which assumes each "key" in one uevent file to be unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load the driver for the first MODALIAS. So if both the ACPI modalias and the OF modalias are present, use the latter to ensure that there will be only one MODALIAS. Link: systemd/systemd#18163 Suggested-by: Mika Westerberg <[email protected]> Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: 4.1+ <[email protected]> # 4.1+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 36af2d5c4433fb40ee2af912c4ac0a30991aecfc upstream. Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in one uevent file if specific conditions are met. This breaks systemd-udevd, which assumes each "key" in one uevent file to be unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load the driver for the first MODALIAS. So if both the ACPI modalias and the OF modalias are present, use the latter to ensure that there will be only one MODALIAS. Link: systemd/systemd#18163 Suggested-by: Mika Westerberg <[email protected]> Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: 4.1+ <[email protected]> # 4.1+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 36af2d5c4433fb40ee2af912c4ac0a30991aecfc upstream. Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in one uevent file if specific conditions are met. This breaks systemd-udevd, which assumes each "key" in one uevent file to be unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load the driver for the first MODALIAS. So if both the ACPI modalias and the OF modalias are present, use the latter to ensure that there will be only one MODALIAS. Link: systemd/systemd#18163 Suggested-by: Mika Westerberg <[email protected]> Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: 4.1+ <[email protected]> # 4.1+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 36af2d5c4433fb40ee2af912c4ac0a30991aecfc upstream. Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in one uevent file if specific conditions are met. This breaks systemd-udevd, which assumes each "key" in one uevent file to be unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load the driver for the first MODALIAS. So if both the ACPI modalias and the OF modalias are present, use the latter to ensure that there will be only one MODALIAS. Link: systemd/systemd#18163 Suggested-by: Mika Westerberg <[email protected]> Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: 4.1+ <[email protected]> # 4.1+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
Source: Kernel.org MR: 108725 Type: Integration Disposition: Backport from git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable linux-5.4.y ChangeID: 93603a27fc31f3161bfe30c867c07b407e187e35 Description: commit 36af2d5 upstream. Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in one uevent file if specific conditions are met. This breaks systemd-udevd, which assumes each "key" in one uevent file to be unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load the driver for the first MODALIAS. So if both the ACPI modalias and the OF modalias are present, use the latter to ensure that there will be only one MODALIAS. Link: systemd/systemd#18163 Suggested-by: Mika Westerberg <[email protected]> Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: 4.1+ <[email protected]> # 4.1+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Armin Kuster <[email protected]>
commit 36af2d5c4433fb40ee2af912c4ac0a30991aecfc upstream. Commit 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") may create two "MODALIAS=" in one uevent file if specific conditions are met. This breaks systemd-udevd, which assumes each "key" in one uevent file to be unique. The internal implementation of systemd-udevd overwrites the first MODALIAS with the second one, so its kmod rule doesn't load the driver for the first MODALIAS. So if both the ACPI modalias and the OF modalias are present, use the latter to ensure that there will be only one MODALIAS. Link: systemd/systemd#18163 Suggested-by: Mika Westerberg <[email protected]> Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: 4.1+ <[email protected]> # 4.1+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: rzlamrr <[email protected]>
commit 36af2d5c4433fb40ee2af912c4ac0a30991aecfc upstream.
Commit 8765c5ba1949 ("ACPI / scan: Rework modalias creation when
"compatible" is present") may create two "MODALIAS=" in one uevent
file if specific conditions are met.
This breaks systemd-udevd, which assumes each "key" in one uevent file
to be unique. The internal implementation of systemd-udevd overwrites
the first MODALIAS with the second one, so its kmod rule doesn't load
the driver for the first MODALIAS.
So if both the ACPI modalias and the OF modalias are present, use the
latter to ensure that there will be only one MODALIAS.
Link: systemd/systemd#18163
Suggested-by: Mika Westerberg <[email protected]>
Fixes: 8765c5ba1949 ("ACPI / scan: Rework modalias creation when "compatible" is present")
Signed-off-by: Kai-Heng Feng <[email protected]>
Reviewed-by: Mika Westerberg <[email protected]>
Reviewed-by: Greg Kroah-Hartman <[email protected]>
Cc: 4.1+ <[email protected]> # 4.1+
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Arsh Anwar <[email protected]>
commit 36af2d5c4433fb40ee2af912c4ac0a30991aecfc upstream.
Commit 8765c5ba1949 ("ACPI / scan: Rework modalias creation when
"compatible" is present") may create two "MODALIAS=" in one uevent
file if specific conditions are met.
This breaks systemd-udevd, which assumes each "key" in one uevent file
to be unique. The internal implementation of systemd-udevd overwrites
the first MODALIAS with the second one, so its kmod rule doesn't load
the driver for the first MODALIAS.
So if both the ACPI modalias and the OF modalias are present, use the
latter to ensure that there will be only one MODALIAS.
Link: systemd/systemd#18163
Suggested-by: Mika Westerberg <[email protected]>
Fixes: 8765c5ba1949 ("ACPI / scan: Rework modalias creation when "compatible" is present")
Signed-off-by: Kai-Heng Feng <[email protected]>
Reviewed-by: Mika Westerberg <[email protected]>
Reviewed-by: Greg Kroah-Hartman <[email protected]>
Cc: 4.1+ <[email protected]> # 4.1+
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Arsh Anwar <[email protected]>
ACPI device can have two modaliases if it has DT namespace [1]. They are
created by kernel function __acpi_device_uevent_modalias():
$ cat /sys/bus/platform/devices/AHC1EC0:00/uevent
MODALIAS=acpi:AHC1EC0:
MODALIAS=of:NadecTCadvantech,ahc1ec0
Because of the nature of hashmap, the second modalias always replaces
the first modalias, preventing driver loading for first modalias.
So use a different key, MODALIAS1, for the second modalias to solve
the issue.
[1] https://www.kernel.org/doc/html/latest/firmware-guide/acpi/enumeration.html#device-tree-namespace-link-device-id