Subject: Re: [not-yet-signed PATCH] RDMA/core: flush gid_cache_wq WQ from disable_device()

From: Jason Gunthorpe <[email-masked]>
Date: Tue, 16 Dec 2025 10:05:12 -0400

On Tue, Dec 16, 2025 at 10:29:29PM +0900, Tetsuo Handa wrote:
> Hmm, I misinterpreted that commit. Since ib_register_device() was doing
> 
> 	down_write(&lists_rwsem);
> 	list_add_tail(&device->core_list, &device_list);
> 	up_write(&lists_rwsem);
> 
> , it was
> 
> 	down_write(&lists_rwsem);
> 	list_del(&device->core_list);
> 
> in ib_unregister_device() that makes ib_enum_all_roce_netdevs() no longer
> call ib_enum_roce_netdev().
> 
> Then, calling ib_enum_all_roce_netdevs() asynchronously was always racy
> since commit 03db3a2d81e6 ("IB/core: Add RoCE GID table management") was added?

Yes, probably, it may need to grab the registration lock in the WQ.

Jason