Re: [PATCH 02/30] IB/core: Add kref to IB devices

Haggai Eran
2015-02-19T10:57:51Z

On 20/02/2015 00:02, Somnath Kotur wrote:
> From: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>
> Previously. we used device_mutex lock in order to protect
> the device's list. That means that in order to guarantee a
> device isn't freed while we use it, we had to lock all
> devices.
>
> Adding a kref per IB device. Before an IB device
> is unregistered, we wait before its not held anymore.

Maybe I'm missing something, but IB device already has a struct device
embedded in it, which has a kobject with a kref. Wouldn't it be better
to simply move the operations that need to wait to the ib_device_release
function?

Regards,
Haggai