From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 416E91F130D; Tue, 3 Dec 2024 15:04:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733238261; cv=none; b=aiwaA1EuWoOhL6Qwukfd8bkOxJxDIu0ZymdYoUp6uc46i0nXTOIIX0TRWKm1CsYu/6td6ck2CYtjbm3O7/2y/rLAvGmkf1QDvbo65m3GdWyk4lD6fZUca0Zm1lJoYEBpgyopV/UugF9WkJfzSDiY8TDuPI61Z3MDWQ4EqnL4zbM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733238261; c=relaxed/simple; bh=a870j+eDfwDa3g1OloCtI0gbhWX9wpqTo35djqV8K6s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=p5PtU5uM1/77a3GxqF/NN1KMf2guB0dn9zZbPGvoKh2AjR1cnLKrG6vdT8e/b+FrlqRgzpNi7VobAc88RidkofmDVNEWcJQslIoIv9XZ+KRMILMqC/aHogMxafGG0Pv7uq1tLsVpI9olyterAgeL+Sv8H9WXsFHZeeL9r/2vZdM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=lpSDf5WM; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="lpSDf5WM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B45CDC4CECF; Tue, 3 Dec 2024 15:04:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1733238261; bh=a870j+eDfwDa3g1OloCtI0gbhWX9wpqTo35djqV8K6s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lpSDf5WMPt7sXXOPqUsqp6x3uc9KLMsokkRs3Qa44xDlJ6Im1SQnrzgqYTt38lUIC 42SJfbaUW2/ZAunplUBzHNaVfgiZSFiFDyi/HqtPd0igJIMnNy3NHIfCOJUiO5O4qV jAk9uDmAuRNoVWCcNDORFFy9q3lXMxYqI/O6Hvqc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dom Cobley , Maxime Ripard , Dave Stevenson , Sasha Levin Subject: [PATCH 6.11 218/817] drm/vc4: hdmi: Avoid hang with debug registers when suspended Date: Tue, 3 Dec 2024 15:36:30 +0100 Message-ID: <20241203144004.260282428@linuxfoundation.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241203143955.605130076@linuxfoundation.org> References: <20241203143955.605130076@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.11-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dom Cobley [ Upstream commit 223ee2567a55e4f80315c768d2969e6a3b9fb23d ] Trying to read /sys/kernel/debug/dri/1/hdmi1_regs when the hdmi is disconnected results in a fatal system hang. This is due to the pm suspend code disabling the dvp clock. That is just a gate of the 108MHz clock in DVP_HT_RPI_MISC_CONFIG, which results in accesses hanging AXI bus. Protect against this. Fixes: 25eb441d55d4 ("drm/vc4: hdmi: Add all the vc5 HDMI registers into the debugfs dumps") Signed-off-by: Dom Cobley Reviewed-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20240621152055.4180873-17-dave.stevenson@raspberrypi.com Signed-off-by: Dave Stevenson Signed-off-by: Sasha Levin --- drivers/gpu/drm/vc4/vc4_hdmi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index cb424604484f1..9b2b07104a7ac 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -147,6 +147,8 @@ static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused) if (!drm_dev_enter(drm, &idx)) return -ENODEV; + WARN_ON(pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev)); + drm_print_regset32(&p, &vc4_hdmi->hdmi_regset); drm_print_regset32(&p, &vc4_hdmi->hd_regset); drm_print_regset32(&p, &vc4_hdmi->cec_regset); @@ -156,6 +158,8 @@ static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused) drm_print_regset32(&p, &vc4_hdmi->ram_regset); drm_print_regset32(&p, &vc4_hdmi->rm_regset); + pm_runtime_put(&vc4_hdmi->pdev->dev); + drm_dev_exit(idx); return 0; -- 2.43.0