[PATCH v3 19/20] coresight: add try_get_module() in coresight_grab_device()

tingwei at codeaurora.org tingwei at codeaurora.org
Wed Jul 22 20:19:40 EDT 2020


On 2020-07-22 18:51, Suzuki K Poulose wrote:
> On 07/22/2020 11:49 AM, Suzuki K Poulose wrote:
>> Hi Tingwei,
>> 
>> On 07/17/2020 06:45 AM, Tingwei Zhang wrote:
>>> When coresight device is in an active session, driver module of
>>> that device should not be removed. Use try_get_module() in
>>> coresight_grab_device() to prevent module to be unloaded.
>>> 
>> 
>> Is this really sufficient ? AFAIU, a device could be removed, but the
>> module may still be alive due to the refcount on the module. This
>> could imply that we have stale pointers in the _path_, which could
>> lead to corruption elsewhere. Should we do a get/put_device() instead 
>> ?
> 
> Also, logically this refcount solution patch must be applied before
> the drivers are made modules to prevent breaking bisection failures.
> So, please re-order the patches in the series to take that into
> consideration.
> 
> Suzuki

That's good point.  I'll reorder them in next revision.

Thanks,
Tingwei



More information about the linux-arm-kernel mailing list