The bridge teardown cancelled work after the controller resources were released, and the atomic hooks were not excluded from re-queuing it. This RFC uses the current bridge unplug critical section for the whole resource-facing hooks and work callbacks, keeps a reference for the asynchronous firmware callback, and drains the IRQ and all work items before the controller and PHY are stopped.
Patch 1 extends the HPD helpers so unplug also covers their mutexes and clears the registered callback while the mutexes still exist. Patch 2 applies the driver-side lifetime repair. Hongyan Xu (2): drm/bridge: protect complete HPD helpers during unplug drm/bridge: cdns-mhdp8546: exclude producers before teardown .../drm/bridge/cadence/cdns-mhdp8546-core.c | 333 ++++++++++++++---- .../drm/bridge/cadence/cdns-mhdp8546-core.h | 2 +- .../drm/bridge/cadence/cdns-mhdp8546-hdcp.c | 76 +++- drivers/gpu/drm/drm_bridge.c | 41 +++ 4 files changed, 365 insertions(+), 87 deletions(-) -- 2.50.1.windows.1 Discovery: found by the author's in-house static analysis tool.
