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 BA7E1C3065C for ; Tue, 2 Jul 2024 19:47:41 +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:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7Y/kIBa4MocqL5VsX4pa8YlTzbYsFHxrleMVSoRGylU=; b=w0Pwnz2tvD0EOZh327zOjlIige YlclUkI1zavaEi31rxwhmuuE1jsHgQISJgvLsykHZ1Sl1cAMNTGpwP/W21KfglWn1uMLJV3CaZHBt SciSiAHyAJswLknz9cZyXrXWNZZwdQubRCOkDOOO/7OE/lGD9NeK8Mt9nR7+GpfDHi4dj9L45e9Re Mk+yixR+ts2nqwNb7K4Gl+CLp6nfVFVKaskty+zHIOZCASmpVJYActgA9rKxs/bQtI9Aq8Kj7NArS cu517ZOnSf3GHdq2zvZapIB7/S9sl8YDcPG+A4rl8qQBLnyc7EQ0cZNbF4BJPLm2t7+JtuWe1cz03 bkkWLILw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOjTK-00000007oz8-097Z; Tue, 02 Jul 2024 19:47:26 +0000 Received: from fanzine.igalia.com ([178.60.130.6] helo=fanzine2.igalia.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOjT8-00000007ovG-10oH for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2024 19:47:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=7Y/kIBa4MocqL5VsX4pa8YlTzbYsFHxrleMVSoRGylU=; b=Gn3N4xBdm+qM8pwbIk7A5brYm7 LexsVZJ2whsJBS+iv3Ia2IW+LxgYzbSkz3gi0Zbtip7pmL3yAxQRAJ8Pe/ejdn3AKXwITEsy4NYUX C2vKGo/5jifhIwFVu8HuXl3D0UgDBdW1wfnCHj46j0lEF9YJQldF5U06WiRH7tw5N3KuziY6PI0dt HqE6LXEPstM4BUYS6lLqWwjMLoemkOMRlrpL324EFjEJ8fV10h7KuS2l/VnIFJ+XOLxkyizifp5oC Njsy0wi0DMtb2QkxqkX1bWiRj1DAEaVdJQn9qZdKZCU6rt/YzLC4Vb3E2v1mQeIkOewXf+gVdAj5y NjzTm7tQ==; Received: from [187.36.213.55] (helo=[192.168.1.212]) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim) id 1sOjSK-00ARCD-DC; Tue, 02 Jul 2024 21:46:24 +0200 Message-ID: <1e8b7043-b92f-4a91-8b71-48117a2da0c0@igalia.com> Date: Tue, 2 Jul 2024 16:46:12 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 06/11] drm/vc4: hdmi: Handle error case of pm_runtime_resume_and_get To: Stefan Wahren , Greg Kroah-Hartman , Florian Fainelli , Ray Jui , Scott Branden , Maxime Ripard , Thomas Gleixner , Jassi Brar , Ulf Hansson , Jiri Slaby , Minas Harutyunyan Cc: 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 References: <20240630153652.318882-1-wahrenst@gmx.net> <20240630153652.318882-7-wahrenst@gmx.net> Content-Language: en-US From: =?UTF-8?Q?Ma=C3=ADra_Canal?= Autocrypt: addr=mcanal@igalia.com; keydata= xjMEZIsaeRYJKwYBBAHaRw8BAQdAGU6aY8oojw61KS5rGGMrlcilFqR6p6ID45IZ6ovX0h3N H01haXJhIENhbmFsIDxtY2FuYWxAaWdhbGlhLmNvbT7CjwQTFggANxYhBDMCqFtIvFKVRJZQ hDSPnHLaGFVuBQJkixp5BQkFo5qAAhsDBAsJCAcFFQgJCgsFFgIDAQAACgkQNI+cctoYVW5u GAEAwpaC5rI3wD8zqETKwGVoXd6+AbmGfZuVD40xepy7z/8BAM5w95/oyPsHUqOsg/xUTlNp rlbhA+WWoaOXA3XgR+wCzjgEZIsaeRIKKwYBBAGXVQEFAQEHQGoOK0jgh0IorMAacx6WUUWb s3RLiJYWUU6iNrk5wWUbAwEIB8J+BBgWCAAmFiEEMwKoW0i8UpVEllCENI+cctoYVW4FAmSL GnkFCQWjmoACGwwACgkQNI+cctoYVW6cqwD/Q9R98msvkhgRvi18fzUPFDwwogn+F+gQJJ6o pwpgFkAA/R2zOfla3IT6G3SBoV5ucdpdCpnIXFpQLbmfHK7dXsAC In-Reply-To: <20240630153652.318882-7-wahrenst@gmx.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240702_124714_290621_CCF62485 X-CRM114-Status: GOOD ( 22.09 ) 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 On 6/30/24 12:36, 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. > > This could happen during suspend to idle. So we must assume it is unsafe > to access the HDMI register. So bail out properly. > > Fixes: 0f5251339eda ("drm/vc4: hdmi: Make sure the controller is powered in detect") > Signed-off-by: Stefan Wahren From the docs, I see that `DRM_ERROR` was deprecated in favor of `pr_err()` (although I'm seeing some drivers using `dev_err()`). So, after this change, this is: Reviewed-by: Maíra Canal It would be nice to have a follow-up patch changing other vc4 files, as they are using `DRM_ERROR` when returning the error from `pm_runtime_resume_and_get()`. Best Regards, - Maíra > --- > drivers/gpu/drm/vc4/vc4_hdmi.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.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_connector *connector, > { > struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector); > enum drm_connector_status status = connector_status_disconnected; > + int ret; > > /* > * 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. > */ > > - WARN_ON(pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev)); > + ret = pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev); > + if (ret) { > + DRM_ERROR("Failed to retain HDMI power domain: %d\n", ret); > + return status; > + } > > if (vc4_hdmi->hpd_gpio) { > if (gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio)) > -- > 2.34.1 >