Skip to content

sd-device: add support for second modalias#18163

Closed
khfeng wants to merge 1 commit intosystemd:mainfrom
khfeng:second-modalias
Closed

sd-device: add support for second modalias#18163
khfeng wants to merge 1 commit intosystemd:mainfrom
khfeng:second-modalias

Conversation

@khfeng
Copy link
Copy Markdown
Contributor

@khfeng khfeng commented Jan 8, 2021

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

Comment thread src/libsystemd/sd-device/sd-device.c Outdated
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
@poettering
Copy link
Copy Markdown
Member

poettering commented Jan 8, 2021

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

@poettering
Copy link
Copy Markdown
Member

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. COMPAT_MODALIAS= or so?

@khfeng
Copy link
Copy Markdown
Contributor Author

khfeng commented Jan 8, 2021

I am sorry but the event env block from the kernel is no longer suitable bas env block? Thats just broken. Is there any other kernel subsystem that passes uevent blocks to userspace with non-unique keys?

Seems like only ACPI subsystem can have non-unique keys.

This os a corruption of the kernel interface and should be fixed in kernel space, not worked around in userspace

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.

@khfeng
Copy link
Copy Markdown
Contributor Author

khfeng commented Jan 8, 2021

@khfeng why doesn't the kernel expose the second modalias line under a unique key name? i.e. COMPAT_MODALIAS= or so?

This can be another plausible approach. Let's see what @gregkh thinks first.

@gregkh
Copy link
Copy Markdown
Contributor

gregkh commented Jan 8, 2021

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?

@khfeng
Copy link
Copy Markdown
Contributor Author

khfeng commented Jan 8, 2021

@gregkh some ACPI device can have DT compatible ID [1]. Kernel exposes them as two MODALIAS:

$ cat /sys/bus/platform/devices/AHC1EC0:00/uevent
MODALIAS=acpi:AHC1EC0:
MODALIAS=of:NadecTCadvantech,ahc1ec0

The problem is, systemd-udevd first stores key MODALIAS and value acpi:AHC1EC0: to its internal hashmap. Then it stores key MODALIAS with value of:NadecTCadvantech,ahc1ec0, replaces acpi:AHC1EC0:.

When executing rule ENV{MODALIAS}=="?*", RUN{builtin}+="kmod load $env{MODALIAS}", systemd-udevd only gets the second modalias, of:NadecTCadvantech,ahc1ec0.

This PR is an attempt to make sure the systemd-udevd also load driver for first modalias.

[1] https://www.kernel.org/doc/html/latest/firmware-guide/acpi/enumeration.html#device-tree-namespace-link-device-id

@poettering
Copy link
Copy Markdown
Member

Drivers can have loads of MODALIAS entries, always have, what has changed to cause a problem here?

The problem is that there are now uevent files in sysfs that list the same key twice, with different values. i.e. if you cat them you see two distinct lines beginning with MODALIAS=. udev doesn't expect that, and apps generally don#t either. udev and apps geerally stuff the uevent fields into a hashtable/dictionary of sorts, and don't expect key collisions there. In some implementations this might result in errors, in others silently all but the last assignment of MODALIAS will be ignored, in others silenelty all but the first. It's a mess.

Maybe it never was declared that keys in uevent files have to be unique, but it's what everyone consuming these files assume. Moreover, udev assumes it can pass these keys to processes it forks off as env blocks, and that suddenly isn't possible anymore.

@poettering
Copy link
Copy Markdown
Member

@khfeng the offending devices in sysfs, what do they actually export in the modalias sysfs attribute file? Multiple lines?

@gregkh
Copy link
Copy Markdown
Contributor

gregkh commented Jan 8, 2021

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.

@poettering
Copy link
Copy Markdown
Member

@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 uevent keys have to be unique, and then fix up the one case where people apparntly so far tried to make them non-unique?

@gregkh what is the modalias sysfs attribute file supposed to contain if you a device suddenly can have multiple modalias strings?

@khfeng
Copy link
Copy Markdown
Contributor Author

khfeng commented Jan 8, 2021

@khfeng the offending devices in sysfs, what do they actually export in the modalias sysfs attribute file? Multiple lines?

@poettering yes, two lines for two modaliases:

$ cat /sys/bus/platform/devices/AHC1EC0\:00/modalias 
acpi:AHC1EC0:
of:NadecTCadvantech,ahc1ec0

@poettering
Copy link
Copy Markdown
Member

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 uevent are unique was a reasonable one. And the change to make them non-unique is quite surprising.

How do you thin udev rules should work if they aren't unique btw? i.e. if someone has $env{MODALIAS} in their udev rules, then suddenly what is that supposed to resolve to? previously it was clear what is referenced there, and now suddenly it's not clear anymore. Should it resolve to a list of values? only the first? only the last? randomzed ones?

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.

@gregkh
Copy link
Copy Markdown
Contributor

gregkh commented Jan 8, 2021

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.

@gregkh
Copy link
Copy Markdown
Contributor

gregkh commented Jan 8, 2021

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!

@khfeng
Copy link
Copy Markdown
Contributor Author

khfeng commented Jan 8, 2021

It was introduced by commit 8765c5ba1949 ("ACPI / scan: Rework modalias creation when "compatible" is present"), which was included in Linux v4.0.

@khfeng
Copy link
Copy Markdown
Contributor Author

khfeng commented Jan 8, 2021

Anyway, let me start a discussion on mailing list.

@gregkh
Copy link
Copy Markdown
Contributor

gregkh commented Jan 8, 2021

Oops, good catch, yes, that's the right commit. from 2015, a bit newer :)

@poettering
Copy link
Copy Markdown
Member

i am irritated they did the change without checking whether it actually works, and noone noticed...

@khfeng
Copy link
Copy Markdown
Contributor Author

khfeng commented Jan 8, 2021

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.

fengguang pushed a commit to 0day-ci/linux that referenced this pull request Jan 20, 2021
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]>
fengguang pushed a commit to 0day-ci/linux that referenced this pull request Jan 20, 2021
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]>
Base automatically changed from master to main January 21, 2021 11:55
@khfeng
Copy link
Copy Markdown
Contributor Author

khfeng commented Jan 22, 2021

End up stripping away the ACPI modalias and at kernel side.

Still, thanks for reviewing!

@khfeng khfeng closed this Jan 22, 2021
@bluca
Copy link
Copy Markdown
Member

bluca commented Jan 22, 2021

That's great news, thanks for following up!

woodsts pushed a commit to woodsts/linux-stable that referenced this pull request Feb 3, 2021
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]>
woodsts pushed a commit to woodsts/linux-stable that referenced this pull request Feb 3, 2021
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]>
Whissi pushed a commit to Whissi/linux-stable that referenced this pull request Feb 3, 2021
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]>
Whissi pushed a commit to Whissi/linux-stable that referenced this pull request Feb 3, 2021
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]>
evdenis pushed a commit to evdenis/linux-floppy that referenced this pull request Feb 4, 2021
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]>
Claymore1297 pushed a commit to Claymore1297/kernel_oneplus_sm8150 that referenced this pull request Feb 4, 2021
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]>
miraclestars pushed a commit to miraclestars/android_kernel_samsung_sm8250 that referenced this pull request Feb 4, 2021
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]>
whyredfire pushed a commit to whyredfire/android_kernel_xiaomi_ginkgo that referenced this pull request Feb 4, 2021
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]>
melles1991 pushed a commit to CraftRom/Chidori-Kernel_onclite that referenced this pull request Feb 4, 2021
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]>
freeza-inc pushed a commit to freeza-inc/bm-galaxy-s20-ultra-snap-r that referenced this pull request Feb 4, 2021
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]>
Blacksuan19 pushed a commit to Blacksuan19/kernel_dark_ages_phoenix that referenced this pull request Feb 4, 2021
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]>
Blacksuan19 pushed a commit to Blacksuan19/kernel_dark_ages_vince that referenced this pull request Feb 4, 2021
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]>
DillerOFire pushed a commit to Project-Fluid-Devices/kernel_xiaomi_sdm660 that referenced this pull request Feb 5, 2021
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]>
SudhakarJha pushed a commit to SudhakarJha/android_kernel_xiaomi_msm8953 that referenced this pull request Feb 5, 2021
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]>
kimocoder pushed a commit to kimocoder/android_kernel_oneplus_oneplus6 that referenced this pull request Feb 6, 2021
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]>
kimocoder pushed a commit to kimocoder/android_kernel_oneplus_oneplus6 that referenced this pull request Feb 6, 2021
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]>
Claymore1297 pushed a commit to Claymore1297/kernel_oneplus_sdm845 that referenced this pull request Feb 7, 2021
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]>
SGCMarkus pushed a commit to SGCMarkus/android_kernel_lge_sm8150 that referenced this pull request Feb 7, 2021
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]>
3EleVen pushed a commit to 3EleVen/kernel_xiaomi_mido that referenced this pull request Feb 7, 2021
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]>
krazey pushed a commit to krazey/android_kernel_samsung_universal9810 that referenced this pull request Feb 10, 2021
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]>
it-is-a-robot pushed a commit to openeuler-mirror/kernel that referenced this pull request Feb 11, 2021
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]>
Jimbo77 pushed a commit to Jimbo77/Jimbok_common_sm8250-R that referenced this pull request Feb 11, 2021
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]>
bananafunction pushed a commit to bananafunction/android_kernel_sony_msm8998 that referenced this pull request Feb 11, 2021
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]>
bananafunction pushed a commit to bananafunction/android_kernel_sony_msm8998 that referenced this pull request Feb 11, 2021
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]>
javashin pushed a commit to javashin/android_kernel_motorola_sdm632 that referenced this pull request Feb 11, 2021
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]>
Jimbo77 pushed a commit to Jimbo77/Jimbok_common_sm8250-R that referenced this pull request Feb 11, 2021
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]>
jpuhlman pushed a commit to MontaVista-OpenSourceTechnology/linux-mvista that referenced this pull request Feb 13, 2021
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]>
rzlamrr pushed a commit to silont-project/kernel_xiaomi_ginkgo that referenced this pull request Feb 13, 2021
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]>
d4rk-lucif3r pushed a commit to d4rk-lucif3r/LuciferKernel that referenced this pull request Feb 16, 2021
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]>
d4rk-lucif3r pushed a commit to d4rk-lucif3r/LuciferKernel that referenced this pull request Feb 16, 2021
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

5 participants