From: Zijun Hu <zijun_hu@icloud.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
linux-kernel@vger.kernel.org, Zijun Hu <quic_zijuhu@quicinc.com>
Subject: Re: [PATCH RESEND v2 0/2] driver core: bus: Fix issues related to bus_rescan_devices_helper()
Date: Wed, 13 Nov 2024 21:42:50 +0800 [thread overview]
Message-ID: <e35bb0d3-6628-4cab-910c-cf4e437be939@icloud.com> (raw)
In-Reply-To: <2024111228-snowcap-counting-b833@gregkh>
On 2024/11/12 19:48, Greg Kroah-Hartman wrote:
> On Tue, Oct 22, 2024 at 07:18:00PM +0800, Zijun Hu wrote:
>> This patch series is to fix issues related to bus_rescan_devices_helper().
>>
>> The function is improperly used for 2 incompatible scenarios as
>> explained below:
>>
>> Scenario A: scan drivers for a single device user specify
>> - user may care about precise synchronous scanning result, so the
>> function can not collapse error codes.
>
> I do not understand this, what is wrong that this is fixing?
>
for scanning drivers for single device, it gives user wrong scanning
result(success or failure).
patch 1/2 is a concrete example.
>> Scenario B: scan drivers for all devices of a bus
>> - user may need to scan drivers for a bus's devices as many as
>> possible, so the function needs to ignore inconsequential error
>> codes for a device in order to continue to scan for next device.
>
> How often is that needed? And why can't that still work with the
> existing code?
>
1) API bus_rescan_devices() invokes it and can't achieve its design
purpose due to error described above.
2) as shown by recent mainlined commit, usage of API
bus_rescan_devices() have been dropped due to some bugs.
Commit: 3d6ebf16438d ("cxl/port: Fix cxl_bus_rescan() vs
bus_rescan_devices()")
3) there are only 2 usages for the API now.
// does not do what the comments say
https://elixir.bootlin.com/linux/v6.11/source/drivers/pcmcia/ds.c#L725
// do multi repeated iterating, can be simplified if fix the API bugs
https://elixir.bootlin.com/linux/v6.11/source/drivers/hid/hid-core.c#L2967
4) i have more reply in below link about the API's bugs.
https://lore.kernel.org/all/20240913-bus_match_unlikely-v2-2-5c0c3bfda2f6@quicinc.com/
> thanks,
>
> greg k-h
next prev parent reply other threads:[~2024-11-13 13:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-22 11:18 [PATCH RESEND v2 0/2] driver core: bus: Fix issues related to bus_rescan_devices_helper() Zijun Hu
2024-10-22 11:18 ` [PATCH RESEND v2 1/2] driver core: bus: Fix drivers_probe_store() giving user wrong scanning result Zijun Hu
2024-10-22 11:18 ` [PATCH RESEND v2 2/2] driver core: bus: Correct API bus_rescan_devices() behavior Zijun Hu
2024-11-12 11:48 ` [PATCH RESEND v2 0/2] driver core: bus: Fix issues related to bus_rescan_devices_helper() Greg Kroah-Hartman
2024-11-13 13:42 ` Zijun Hu [this message]
2024-11-13 13:43 ` Zijun Hu
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=e35bb0d3-6628-4cab-910c-cf4e437be939@icloud.com \
--to=zijun_hu@icloud.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_zijuhu@quicinc.com \
--cc=rafael@kernel.org \
/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.