[PATCH 0/3] driver core: bus: Fix issues related to bus_rescan_devices_helper()

From: Zijun Hu
Date: Wed Sep 04 2024 - 08:58:40 EST


This patch series is to fix issues related to bus_rescan_devices_helper().

The function is currently used to scan drivers for both single and
all devices, but its return value can not cover expectations for both
scenarios as explained below:

for single device, user may care about precise scanning result, so
should not collapse error codes.

for all devices, user may want to scan drivers for devices as many as
possible, so need to ignore inconsequential error codes for a device to
continue to scan drivers for remaining devices.

Fixed by implementing bus_rescan_single_device() for single device and
correcting bus_rescan_devices_helper() for all devices.

Signed-off-by: Zijun Hu <quic_zijuhu@xxxxxxxxxxx>
---
Zijun Hu (3):
driver core: Mark impossible return values of bus_type's match() with unlikely()
driver core: bus: Give error prompt for storing bus attribute drivers_probe failure
driver core: bus: Correct API bus_rescan_devices() behavior

drivers/base/bus.c | 64 ++++++++++++++++++++++++++++++++++++----------
drivers/base/dd.c | 16 +++++++++---
include/linux/device/bus.h | 9 +++----
3 files changed, 67 insertions(+), 22 deletions(-)
---
base-commit: 888f67e621dda5c2804a696524e28d0ca4cf0a80
change-id: 20240830-bus_match_unlikely-abe9334bcfd2

Best regards,
--
Zijun Hu <quic_zijuhu@xxxxxxxxxxx>