mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
To: Frank Zhang <rmxpzlb@gmail.com>,
	hjc@rock-chips.com, heiko@sntech.de, andyshrk@163.com,
	andrzej.hajda@intel.com, neil.armstrong@linaro.org,
	rfoss@kernel.org, Laurent.pinchart@ideasonboard.com,
	jonas@kwiboo.se, jernej.skrabec@gmail.com,
	luca.ceresoli@bootlin.com, maarten.lankhorst@linux.intel.com,
	mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com,
	simona@ffwll.ch, royalnet026@gmail.com, me@timsurber.de
Cc: dri-devel@lists.freedesktop.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH v7] drm/bridge: dw-hdmi-qp: serialize HDMI audio callbacks with PHY enable/disable
Date: Wed, 2 Dec 2026 15:08:11 +0200	[thread overview]
Message-ID: <3d4d1b07-9a8f-4f7b-aadd-d846b60683ca@collabora.com> (raw)
In-Reply-To: <c15ccd98-78b1-4bf3-a9e9-f8bd00935088@gmail.com>

Hi Frank,

On 12/2/26 11:56 AM, Frank Zhang wrote:
> Regarding `hdmi->mutex`, this mutex is not only used in atomic enable/disable,
> but also used in dw_hdmi_qp_hpd_notify(). Although the lock scope is very
> small, it still introduces lock condition for audio callbacks, or am I missing
> something?
> 
> To keep the lock scope cleaner, we can use a dedicated mutex (e.g.,
> `hdmi->audio_mutex`) for tmds_char_rate. Does this sound reasonable to you?

I'd still prefer to reuse hdmi->mutex.  In dw_hdmi_qp_hpd_notify() it only
covers taking a reference on curr_conn, both read_hpd() and the hotplug
event handling run outside of it.  Any contention with the audio callbacks
is therefore negligible, and those are slow-path operations anyway.

Moreover, curr_conn and tmds_char_rate describe the same thing, i.e. the
currently active output, and both are published by the atomic enable/disable
hooks, so keeping them under a single lock ensures they're always seen in a
consistent state.  A second mutex adds unnecessary complexity and could
potentially open a window where the two get out of sync.

So please just update the comment above the mutex to mention it also guards
tmds_char_rate.

> This commit(247695b19afc) is on branch: drm-misc-next, right? I will rebase
> onto this branch in the next version.

Yes.

Cristian

      reply	other threads:[~2026-12-02 13:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12 10:11 Frank Zhang
2026-11-26 18:02 ` Luca Ceresoli
2026-12-01  2:17 ` Cristian Ciocaltea
2026-12-02  9:56   ` Frank Zhang
2026-12-02 13:08     ` Cristian Ciocaltea [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3d4d1b07-9a8f-4f7b-aadd-d846b60683ca@collabora.com \
    --to=cristian.ciocaltea@collabora.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=andyshrk@163.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=hjc@rock-chips.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=me@timsurber.de \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=rmxpzlb@gmail.com \
    --cc=royalnet026@gmail.com \
    --cc=simona@ffwll.ch \
    --cc=stable@vger.kernel.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®