From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4F5B3C30658 for ; Tue, 2 Jul 2024 13:49:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=mx4KUZd9MpCUVB/g+vAXH9B6Ewie68da5o9Nh41Q5jk=; b=1lqrYGNZUe9sk9zhXDYCZkT5iS qJtTLt7eUXIDLmIa3NCReooE6q51ybzbuAX1noZtGiUSK+nZQHgpj/1xDE+kPVGuAWCuF07+sc5Oy dPc2mZGIvka4XK0yGkN8anE+bkOJXfHuqj7abujofWlz1Uu9LQZ9ZieKMlCvZHd+LIHrCwAikN0XP uO9ROEeiv/B+JKaAkIeaPMG2tR+2o0szeO8Y0OsCYgq/K374R1FCh5/PbyE1GMu8UY1uuwcA8chPv ITbWTcYeRNiocYhaYaUNZRqiQ9nmpO55jMjFJ0WvSnVSzxdnHDE/2s4ETRc8GT1FN6BkwIaiCe5r5 yioMPLBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOdsg-00000006v3T-2hwx; Tue, 02 Jul 2024 13:49:14 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOdsT-00000006v0J-0L75 for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2024 13:49:04 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 807D761D3B; Tue, 2 Jul 2024 13:49:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7D32C116B1; Tue, 2 Jul 2024 13:48:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719928140; bh=VCPpptoX1lcwq96YppGpSXnQWpM75LfIS4wYd/aLFic=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YuHPUAcOv0zJ88c4w282ikL5+HjfDYySsZqWzZ6z4k8bucULdTOueiT8Xt39ZZsSy FckqcvS8VSOY8AoToQB0wbAFVBCVrYULGeHHHRZb9TKivukD9/05lqDeRYoJTj2a3c O6qwOWl/iStS9qA74fMtQppXoYNuW54FKVMi3IhSX+IHKMwNNQ13UH4jwxsA+8Y3MB L6V7Amly/uTRECMB4TQpjCWMHtWt7DXgCf9If/tcQ9Tuaxi9UiJY9o++fTpsYn8M1C JCtZt3EbrnWiT/+jSZgFaKzeFaaUvf3qa9rhHcZ9hAKRkYuUo7Z/VpvBZQmTGnOJ6S dILkiHwJ99P1A== Date: Tue, 2 Jul 2024 15:48:57 +0200 From: Maxime Ripard To: Stefan Wahren Cc: Greg Kroah-Hartman , Florian Fainelli , Ray Jui , Scott Branden , Thomas Gleixner , Jassi Brar , Ulf Hansson , Jiri Slaby , Minas Harutyunyan , Dave Stevenson , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Lukas Wunner , Peter Robinson , dri-devel@lists.freedesktop.org, bcm-kernel-feedback-list@broadcom.com, linux-pm@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-list@raspberrypi.com Subject: Re: [PATCH 06/11] drm/vc4: hdmi: Handle error case of pm_runtime_resume_and_get Message-ID: <20240702-mysterious-excellent-hyena-0ff24f@houat> References: <20240630153652.318882-1-wahrenst@gmx.net> <20240630153652.318882-7-wahrenst@gmx.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2tl7zqzcymelkodz" Content-Disposition: inline In-Reply-To: <20240630153652.318882-7-wahrenst@gmx.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240702_064901_225533_75A295BC X-CRM114-Status: GOOD ( 22.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --2tl7zqzcymelkodz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 30, 2024 at 05:36:47PM GMT, Stefan Wahren wrote: > The commit 0f5251339eda ("drm/vc4: hdmi: Make sure the controller is > powered in detect") introduced the necessary power management handling > to avoid register access while controller is powered down. > Unfortunately it just print a warning if pm_runtime_resume_and_get() > fails and proceed anyway. >=20 > This could happen during suspend to idle. So we must assume it is unsafe > to access the HDMI register. So bail out properly. >=20 > Fixes: 0f5251339eda ("drm/vc4: hdmi: Make sure the controller is powered = in detect") > Signed-off-by: Stefan Wahren > --- > drivers/gpu/drm/vc4/vc4_hdmi.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdm= i.c > index d57c4a5948c8..b3a42b709718 100644 > --- a/drivers/gpu/drm/vc4/vc4_hdmi.c > +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c > @@ -429,6 +429,7 @@ static int vc4_hdmi_connector_detect_ctx(struct drm_c= onnector *connector, > { > struct vc4_hdmi *vc4_hdmi =3D connector_to_vc4_hdmi(connector); > enum drm_connector_status status =3D connector_status_disconnected; > + int ret; >=20 > /* > * NOTE: This function should really take vc4_hdmi->mutex, but > @@ -441,7 +442,11 @@ static int vc4_hdmi_connector_detect_ctx(struct drm_= connector *connector, > * the lock for now. > */ >=20 > - WARN_ON(pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev)); > + ret =3D pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev); > + if (ret) { > + DRM_ERROR("Failed to retain HDMI power domain: %d\n", ret); We need to use drm_err here Maxime --2tl7zqzcymelkodz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZoQFSAAKCRDj7w1vZxhR xR4/AQDlMoVj1zwSuHz/bCYLp1ELUmStN8Gur4k7nkQPa0OGXwEAwA9Q9GmP0gCm VfIDlBnxh2bhtPw45TXbzLBN26P30w8= =U+hE -----END PGP SIGNATURE----- --2tl7zqzcymelkodz--