From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f180.google.com (mail-yw1-f180.google.com [209.85.128.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D91E175D53 for ; Mon, 20 Apr 2026 06:11:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776665520; cv=none; b=c1wMfNQY8tpG+Q+9VcFNACkblT1A1ze/oto3cLFK95MdSvV9YuiYBzHAxVhnClKSoJ4dV2UJIpAb8mob15VdWROzVjSof2GisJePUbv6nFihb3HT5ht0exNIOl+Atxq/EwbsFbOSK0XSakbjIFSGIVqEX3Oc+fCwCZmW0txXLWA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776665520; c=relaxed/simple; bh=/TCPWbhYgy1QrzBrAce/kNZ6xNY12c29If1AEOzWWT8=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=Zfso9DALWsRTv8+vseZcNrg35EE+/c0yuRZCqE08DdVAD0aMt3s4P8oYlc3o9lw6is4yTtG6iKfk6oaMTlJCEC2AebdutpQQ1PGxTz25kivJ/e3U2T8HouB1gzT0c//rYO5S0wWtCdovZ+ikBuvZ/d0GONJIAizh0bYT3biYrGU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=CUoahSW/; arc=none smtp.client-ip=209.85.128.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CUoahSW/" Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-7b178633e35so1781617b3.0 for ; Sun, 19 Apr 2026 23:11:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776665517; x=1777270317; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=f8Nyf4cpJRKorO7rgUUCbDBAbZjdSUwn4aYVqe/Bdmk=; b=CUoahSW/3lYZDBBaXolbjxsH25OyL0bUv8OdS8nSyYONCFT5deTn6U4HkGok404PCz 3BJ0KNq0bQKzDZ770o2gkE3ahVabQbFZr/yMuAn/cEY+pI/QYNqEhv0VSn+T6cWwajCX Uz8p4oMKea6OLt+bo5dYH8TKDTwdFISEKGPcfOnM0Z7O1f8f1SbqWmFzeS0Qwik3Wvgq cJ+6UOBAQq1lUIewIT9U9+Lhx3+YAtuwZL1pmRU0pRdqX5WvMS/EFAR9uviQyORgeLTX 7uBEU/YwjmQsRVpRMyeukR9WkFAPo9joA9vB2eJAMZk9JavdKR61abtNcFUtudBDMU8E qj0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776665517; x=1777270317; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=f8Nyf4cpJRKorO7rgUUCbDBAbZjdSUwn4aYVqe/Bdmk=; b=E143utTlqxP8COggw2WLPhicapygeSVWl1THh0zRZZVn09WGVw7YPmYIlgJV/cvRp2 aAAE26/3dtkirf+B0ipW2QybaHYkaEhdjzbY6L6Sm4srpLSViIEhr4uHNq6pSW53Bd7T bitQ/RscUEpujogm0zPfXhV72ZNLYOebxeaGniNP/atggtn/3ncjExPO4j87Kz9X+urg xzMaiDJAYaKVwnP1E0SNAgkV5OAV/c6WoL49tjRTiMr5f/Fe2CtRKpRYUQSVv1mNVI/Q ftRLO/w5MwvsXEmhZNjc+dgKfD/sIqohMuq0Bezzj+/eUu9VwnqER2wkIsppVhpj5kX0 1Q8g== X-Forwarded-Encrypted: i=1; AFNElJ+NeXpuYyJQkUymdLP16bR0SNL7DMpoansUPXHVXE2acmn7J4x1e6BeB0RA+ro4StJBMsporNHSEVR3w0c=@vger.kernel.org X-Gm-Message-State: AOJu0YwqR377uYoDN90dONxVwZm3n2uZQf5RYjBWh1/MAcJvWB2JarIs FlJGIPtTWPcLew6h9Knc5xJUlG2vIKJvKt0yKdFsDCYk3iLNu+biVX3DxRrFbMDA X-Gm-Gg: AeBDievbwO0jjt/noqXqtLCIyOwpsXcL7lIfK7K4U6HRIuCVAAg9l6ToYLeFXNSQOas nL5c3EAQUnRqiuaS1nqnV4WnEKntlW81a9MEhCNnLpAjsPo4+pUI9tftdpSbcbrKIe7DWRpYR1j jF7AMuqSKjbnlqVBfsTgxgB15cM6x7k80NQYtt0kWNmSUT2xlTVu5keQQ1RTWhMfd75U4Odr6xu arAUIdwbZwWj4RTPyiTmJ4mDDFkwM11g7C32FtWi9vhQqTjXUI1JHKjqy3NNWrvuMApE3DyhfUi dluMQDq7axjP3YhHdYLUxmhPA9prKldQKHhpOBa1c3iLXBZLoPJ3Vw3s5JpsVdNit6zJT/5hdvP QwCRGTptQ0q84XrqpOHZ9ts2/DOC2fn8WnecdJSqhhZ25/ZyIpLqLIhuQHigy3qVTM5ntyyy4CE EM6q+87aAsKk5JHLV3fo9KKmAFiK6JOKm+mppozgZPGSKlzREUTNF81YDEHox2AFe6bMXJHrIjt QGS X-Received: by 2002:a05:690c:4485:b0:7b6:db48:2f1d with SMTP id 00721157ae682-7b9eccea04amr83767167b3.0.1776665517197; Sun, 19 Apr 2026 23:11:57 -0700 (PDT) Received: from [192.168.11.79] (2607-8700-5500-a805-0000-0000-0000-0002.16clouds.com. [2607:8700:5500:a805::2]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-65314e3510esm4693954d50.10.2026.04.19.23.11.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 19 Apr 2026 23:11:56 -0700 (PDT) Message-ID: <9c198d0e-a675-4d7e-a485-5a8ee4d97f88@gmail.com> Date: Mon, 20 Apr 2026 14:11:28 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Frank Zhang Subject: Re: [PATCH v2] drm/bridge: dw-hdmi-qp: Guard clear_audio_infoframe when PHY is down To: Dmitry Baryshkov Cc: andrzej.hajda@intel.com, neil.armstrong@linaro.org, rfoss@kernel.org, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, detlev.casanova@collabora.com, cristian.ciocaltea@collabora.com, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20260418101936.7731-1-rmxpzlb@gmail.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/19/26 08:40, Dmitry Baryshkov wrote: > On Sat, Apr 18, 2026 at 06:19:36PM +0800, Frank Zhang wrote: >> The following panic was observed during system reboot: >> >> Kernel panic - not syncing: Asynchronous SError Interrupt >> CPU: 7 UID: 1000 PID: 2637 Comm: pipewire ... 6.19.10-300.fc44.aarch64 >> Call trace: >> ... >> regmap_update_bits_base+0x5c/0x90 >> dw_hdmi_qp_bridge_clear_infoframe+0xb0/0x120 [dw_hdmi_qp] >> drm_bridge_connector_clear_infoframe+0x28/0x48 [drm_display_helper] >> ... >> dw_hdmi_qp_audio_disable+0x24/0xb8 [dw_hdmi_qp] >> drm_bridge_connector_audio_shutdown+0x30/0x60 [drm_display_helper] >> drm_connector_hdmi_audio_shutdown+0x24/0x38 [drm_display_helper] >> hdmi_codec_shutdown+0x60/0x90 [snd_soc_hdmi_codec] >> ... >> snd_pcm_release_substream.part.0+0x44/0xd8 [snd_pcm] >> snd_pcm_release+0x60/0xe8 [snd_pcm] >> ... >> >> The root cause is pipewire tries to close the HDMI audio device after >> atomic_disable(), which sets tmds_char_rate to 0 and disable the PHY. >> >> In this case, dw_hdmi_qp_audio_disable() will call >> drm_atomic_helper_connector_hdmi_clear_audio_infoframe() directly, >> accessing registers without checking tmds_char_rate. >> >> Move drm_atomic_helper_connector_hdmi_clear_audio_infoframe() inside the >> if (hdmi->tmds_char_rate) of dw_hdmi_qp_audio_disable(). >> >> Fixes: fd0141d1a8a2 ("drm/bridge: synopsys: Add audio support for dw-hdmi-qp") >> Signed-off-by: Frank Zhang >> >> --- >> Changes in v2: >> - Move drm_atomic_helper_connector_hdmi_clear_audio_infoframe() inside >> the if (hdmi->tmds_char_rate) of dw_hdmi_qp_audio_disable(). >> - Link to v1: https://lore.kernel.org/all/20260416093150.13853-1-rmxpzlb@gmail.com/ >> >> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c >> index d649a1cf07f5..7760527484c8 100644 >> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c >> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c >> @@ -526,10 +526,10 @@ static void dw_hdmi_qp_audio_disable(struct drm_bridge *bridge, >> { >> struct dw_hdmi_qp *hdmi = dw_hdmi_qp_from_bridge(bridge); >> >> - drm_atomic_helper_connector_hdmi_clear_audio_infoframe(connector); >> - >> - if (hdmi->tmds_char_rate) >> + if (hdmi->tmds_char_rate) { >> + drm_atomic_helper_connector_hdmi_clear_audio_infoframe(connector); >> dw_hdmi_qp_audio_disable_regs(hdmi); >> + } > > Will audio and audio infoframe remain disabled after consequetive > atomic_enable() call? > >> } >> >> static int dw_hdmi_qp_i2c_read(struct dw_hdmi_qp *hdmi, >> -- >> 2.53.0 >> > Sorry, I missed clearing the audio infoframe when the PHY is down. The next atomic_enable() will write the stale audio infoframe. My mistake. To clear the stale audio infoframe, dw_hdmi_qp_audio_disable() can handle it in the else branch directly, but this seems like a layering violation for a bridge driver I think the better approach is to add a 'reset_audio_infoframe' interface in drm_hdmi_state_helper.c that does basically the same as drm_atomic_helper_connector_hdmi_clear_audio_infoframe(), but only clearing the software state without calling clear_infoframe(). It's also a bit odd since it would only be used by dw-hdmi-qp. I'd like to get the maintainers' opinion about adding such an interface. Thanks, Frank Zhang