Re: [PATCH v2 01/14] NTB: ntb_transport: Remove the device debugfs directory

From: Logan Gunthorpe

Date: Tue Sep 15 2026 - 14:40:33 EST




On 2026-09-09 22:08, Koichiro Den wrote:
> ntb_transport_free() removes QP debugfs directories but leaves the
> device directory. On rebind, debugfs_create_dir() fails with -EEXIST
> and QP statistics files are not recreated. Module unload masks this
> by removing the entire debugfs tree.
>
> To reproduce:
>
> # ls /sys/kernel/debug/ntb_transport/0001:10:00.0/
> qp0
> # echo 0001:10:00.0 > /sys/bus/ntb/drivers/ntb_transport/unbind
> # ls /sys/kernel/debug/ntb_transport/
> 0001:10:00.0 <-- should not remain
> # echo 0001:10:00.0 > /sys/bus/ntb/drivers/ntb_transport/bind
>
> .. and then dmesg shows:
> debugfs: '0001:10:00.0' already exists in 'ntb_transport'
>
> # ls /sys/kernel/debug/ntb_transport/0001:10:00.0/
> (nothing) <-- should be 'qp0'
>
> Remove the device debugfs tree on teardown and probe failure.
>
> Verified that unbind removes the directory and rebind recreates qp0.
>
> Fixes: c8650fd03d32 ("NTB: Fix transport stats for multiple devices")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Koichiro Den <den@xxxxxxxxxxxxx>

Looks good to me:

Reviewed-by: Logan Gunthorpe <logang@xxxxxxxxxxxx>