mbox series

[v5,0/2] Fix lockdep issues seen in CoreSight configfs interface

Message ID 20220628173004.30002-1-mike.leach@linaro.org (mailing list archive)
Headers show
Series Fix lockdep issues seen in CoreSight configfs interface | expand

Message

Mike Leach June 28, 2022, 5:30 p.m. UTC
Issues with lockdep possible deadlock scenarios have been reported when using the
coresight configfs interface handling complex configuration, when unloading modules.

These are due to holding the main configuration mutex during configfs register, but
taking it later when accessing configfs files.

The patches improve the clean up of configurations and update load and unload of
configurations and initialisation of configfs to fix the locking mechanisms.

Applies to coresight/next (5.19-rc2)
Tested on DB410c (with patch [0] also applied to fix separate console boot issue). 

Fixes: eb2ec49606c2 ("coresight: syscfg: Update load API for config loadable modules")
Reported-by: Suzuki Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mike Leach <mike.leach@linaro.org>

[0] https://lkml.kernel.org/r/20220614124618.2830569-1-suzuki.poulose@arm.com

Changes since v4:
No functional change - fixed comment in patch header 1/2 and error string format to
remove checkpatch warning as requested by Mathieu.

Changes since v3:
Addressed minor issues raised by Suzuki.

Changes since v2:
Added additional work to fix load and unload ops after issue recurred
due to file access.

Mike Leach (2):
  coresight: configfs: Fix unload of configurations on module exit
  coresight: syscfg: Update load and unload operations

 .../hwtracing/coresight/coresight-config.h    |   2 +
 .../hwtracing/coresight/coresight-syscfg.c    | 298 +++++++++++++++---
 .../hwtracing/coresight/coresight-syscfg.h    |  13 +
 3 files changed, 261 insertions(+), 52 deletions(-)

Comments

Mathieu Poirier June 29, 2022, 3:42 p.m. UTC | #1
On Tue, Jun 28, 2022 at 06:30:02PM +0100, Mike Leach wrote:
> Issues with lockdep possible deadlock scenarios have been reported when using the
> coresight configfs interface handling complex configuration, when unloading modules.
> 
> These are due to holding the main configuration mutex during configfs register, but
> taking it later when accessing configfs files.
> 
> The patches improve the clean up of configurations and update load and unload of
> configurations and initialisation of configfs to fix the locking mechanisms.
> 
> Applies to coresight/next (5.19-rc2)
> Tested on DB410c (with patch [0] also applied to fix separate console boot issue). 
> 
> Fixes: eb2ec49606c2 ("coresight: syscfg: Update load API for config loadable modules")
> Reported-by: Suzuki Poulose <suzuki.poulose@arm.com>
> Signed-off-by: Mike Leach <mike.leach@linaro.org>
>

Applied.

Thanks,
Mathieu

> [0] https://lkml.kernel.org/r/20220614124618.2830569-1-suzuki.poulose@arm.com
> 
> Changes since v4:
> No functional change - fixed comment in patch header 1/2 and error string format to
> remove checkpatch warning as requested by Mathieu.
> 
> Changes since v3:
> Addressed minor issues raised by Suzuki.
> 
> Changes since v2:
> Added additional work to fix load and unload ops after issue recurred
> due to file access.
> 
> Mike Leach (2):
>   coresight: configfs: Fix unload of configurations on module exit
>   coresight: syscfg: Update load and unload operations
> 
>  .../hwtracing/coresight/coresight-config.h    |   2 +
>  .../hwtracing/coresight/coresight-syscfg.c    | 298 +++++++++++++++---
>  .../hwtracing/coresight/coresight-syscfg.h    |  13 +
>  3 files changed, 261 insertions(+), 52 deletions(-)
> 
> -- 
> 2.17.1
>