Re: [PATCH 2/8] bus/fslmc: fix bus cleanup

Kevin Traynor
2026-03-26T08:49:50Z

On 3/26/26 8:22 AM, David Marchand wrote:
> On Mon, 23 Mar 2026 at 17:59, Kevin Traynor <ktraynor@redhat.com> wrote:
>>
>> On 3/23/26 10:52 AM, David Marchand wrote:
>>> The close operation was never closing probed devices.
>>>
>>> Taking a step back, reevaluating the devargs makes no sense during the
>>> close step, as a probed device must have passed the allow/block list
>>> evaluation initially.
>>>
>>> Since the device contains a reference to the driver that probed it,
>>> simply call this driver remove op.
>>>
>>> Fixes: 274fd921ff7f ("bus/fslmc: support close operation")
>>> Cc: stable@dpdk.org
>>>
>>> Signed-off-by: David Marchand <david.marchand@redhat.com>
>>> ---
>>> drivers/bus/fslmc/fslmc_vfio.c | 21 ++++-----------------
>>> 1 file changed, 4 insertions(+), 17 deletions(-)
>>>
>>> diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
>>> index 550d4e0e8d..7daa18d850 100644
>>> --- a/drivers/bus/fslmc/fslmc_vfio.c
>>> +++ b/drivers/bus/fslmc/fslmc_vfio.c
>>> @@ -1393,7 +1393,7 @@ fslmc_close_iodevices(struct rte_dpaa2_device *dev,
>>> {
>>> struct rte_dpaa2_object *object = NULL;
>>> struct rte_dpaa2_driver *drv;
>>> - int ret, probe_all;
>>> + int ret;
>>>
>>> switch (dev->dev_type) {
>>> case DPAA2_IO:
>>> @@ -1411,22 +1411,9 @@ fslmc_close_iodevices(struct rte_dpaa2_device *dev,
>>> case DPAA2_ETH:
>>> case DPAA2_CRYPTO:
>>> case DPAA2_QDMA:
>>> - probe_all = rte_fslmc_bus.bus.conf.scan_mode !=
>>> - RTE_BUS_SCAN_ALLOWLIST;
>>> - TAILQ_FOREACH(drv, &rte_fslmc_bus.driver_list, next) {
>>> - if (drv->drv_type != dev->dev_type)
>>> - continue;
>>> - if (rte_dev_is_probed(&dev->device))
>>> - continue;
>>> - if (probe_all ||
>>> - (dev->device.devargs &&
>>> - dev->device.devargs->policy ==
>>> - RTE_DEV_ALLOWED)) {
>>> - ret = drv->remove(dev);
>>> - if (ret)
>>> - DPAA2_BUS_ERR("Unable to remove");
>>> - }
>>> - }
>>> + drv = dev->driver;
>>> + if (drv && drv->remove && drv->remove(dev))
>>
>> Not new but dpaa2_qdma_remove doesn't return an error which seems like a
>> bug, but it has it's own log and it's just a log here anyway, so not
>> critical.
>>
>>> + DPAA2_BUS_ERR("Unable to remove");
>
> Indeed, the dma/dpaa2 driver does not report errors.
> And there is probably more to fix in the fslmc bus, as I see that the
> bus .unplug() does not check the driver .remove() return value either.
>
> I did not dig deeper in this bus for now as I was focusing on the
> devargs evaluation.
>
> Could you open a bugzilla for tracking this issue?
>

Sure, I will do that

> Thanks.
>
>