Hi Shofiqul,
On Sat, May 16, 2026 at 11:20 AM Md Shofiqul Islam <[email protected]> wrote:
>
> fslmc_bus_unplug() called drv->remove() and discarded the return value,
> unconditionally clearing driver references and reporting success even
> when the remove callback signalled failure. As a result, callers had
> no way to detect or react to removal errors.
>
> Capture the return value and propagate it to the caller. Only clear
> the driver references and log successful unplug when the callback
> returns zero.
>
> Fixes: b5721f271cbf ("bus/fslmc: support DPNI hotplug")
> Bugzilla ID: 1914
> Cc: [email protected]
> Cc: [email protected]
>
> Signed-off-by: Md Shofiqul Islam <[email protected]>
> ---
> drivers/bus/fslmc/fslmc_bus.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
> index cf881b3eec..9cfd8b10ba 100644
> --- a/drivers/bus/fslmc/fslmc_bus.c
> +++ b/drivers/bus/fslmc/fslmc_bus.c
> @@ -620,7 +620,9 @@ fslmc_bus_unplug(struct rte_device *rte_dev)
> struct rte_dpaa2_driver *drv = dev->driver;
>
> if (drv && drv->remove) {
> - drv->remove(dev);
> + int ret = drv->remove(dev);
> + if (ret)
We log when the function successfully unplugs the driver, but there is
no log for error. Adding one could help here.
> + return ret;
Could you please declare ret at the top of the function to match the
existing style in this file (fslmc_bus_plug() just above, plus
scan_one_fslmc_device, rte_fslmc_parse, rte_fslmc_scan,
rte_fslmc_close all declare int ret in the local-variable block) ?
> dev->driver = NULL;
> dev->device.driver = NULL;
> DPAA2_BUS_INFO("%s Un-Plugged", dev->device.name);
Regards,
Maxime