]> git.baikalelectronics.ru Git - kernel.git/commit
driver core: Prevent overriding async driver of a device before it probe
authorMark-PK Tsai <mark-pk.tsai@mediatek.com>
Wed, 16 Mar 2022 07:43:28 +0000 (15:43 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Apr 2022 07:51:56 +0000 (09:51 +0200)
commit6f4ea38ee10a2c22fbae1061a46100048fa8b1f6
treef1d8f56662b1328672eb3939b0124e4d970949c1
parent9dd27b7c9594cbb0ecd4f8e61e24a169a0d22c31
driver core: Prevent overriding async driver of a device before it probe

When there are 2 matched drivers for a device using
async probe mechanism, the dev->p->async_driver might
be overridden by the last attached driver.
So just skip the later one if the previous matched driver
was not handled by async thread yet.

Below is my use case which having this problem.

Make both driver mmcblk and mmc_test allow async probe,
the dev->p->async_driver will be overridden by the later driver
mmc_test and bind to the device then claim it for testing.
When it happen, mmcblk will never do probe again.

Signed-off-by: Mark-PK Tsai <mark-pk.tsai@mediatek.com>
Link: https://lore.kernel.org/r/20220316074328.1801-1-mark-pk.tsai@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/dd.c