drm: zynqmp_dp: Add locking
authorSean Anderson <sean.anderson@linux.dev>
Fri, 9 Aug 2024 19:35:54 +0000 (15:35 -0400)
committerTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Wed, 30 Oct 2024 12:17:34 +0000 (14:17 +0200)
commita7d5eeaa57d7a0d3d6a1da82b350d9661c8559a1
tree023ca9b72b2bc3090c88048fd94f9cc0e88e475f
parent2e07c88914fc5289c21820b1aa94f058feb38197
drm: zynqmp_dp: Add locking

Add some locking to prevent the IRQ/workers/bridge API calls from stepping
on each other's toes. This lock protects:

- Non-atomic registers configuring the link. That is, everything but the
  IRQ registers (since these are accessed in an atomic fashion), and the DP
  AUX registers (since these don't affect the link). We also access AUX
  while holding this lock, so it would be very tricky to support.
- Link configuration. This is effectively everything in zynqmp_dp which
  isn't read-only after probe time. So from next_bridge onward.

This lock is designed to protect configuration changes so we don't have to
do anything tricky. Configuration should never be in the hot path, so I'm
not worried about performance.

Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240809193600.3360015-3-sean.anderson@linux.dev
drivers/gpu/drm/xlnx/zynqmp_dp.c