[dpdk-dev] [PATCH] eal: bus scan and probe never fail

Shreyansh Jain shreyansh.jain at nxp.com
Fri Oct 6 15:12:33 CEST 2017

On Friday 06 October 2017 04:51 AM, Thomas Monjalon wrote:
> 19/09/2017 20:51, Jan Blunck:
>> On Mon, Sep 18, 2017 at 1:36 PM, Hemant Agrawal <hemant.agrawal at nxp.com> wrote:
>>> Tested-by: Hemant Agrawal <hemant.agrawal at nxp.com>
>>> On 8/12/2017 3:52 PM, Shreyansh Jain wrote:
>>>> Bus scan is responsible for finding devices over *all* buses.
>>>> Some of these buses might not be able to scan but that should
>>>> not prevent other buses to be scanned.
>> If scanning the bus fails this is signaling an error. In that case we
>> might even want to unregister the bus.
> A scan error seems important enough to be reported to the caller.
> OK to continue scanning other buses, but an error code should be returned.

Isn't that counter intuitive if the scanning continues after error and 
an error is expected to be returned from it?
What if there are more than one error? Which one is reported.

As for cleanup, bus un-registration is not correct. Scan has failed, 
which might mean some assumption that bus took for scanning for devices 
doesn't exist for time being or present platform. Either way, I think 
whatever rollback needs to be done for scan failure, would be done by 
the bus->scan() implementation.

Let me know what you think - I will make changes to the patch and push 

>>>> Same is the case for probing. It is possible that some devices which
>>>> were scanned didn't have a specific driver. That should not prevent
>>>> other buses from being probed.
>> Absolutely correct.
> Yes
> When we will have a probe notification, we will be able
> to notify the upper layer that a device probing has failed.

More information about the dev mailing list