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 A091A8827; Thu, 6 Jun 2024 14:15:15 +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=1717683315; cv=none; b=K9ip5orpxI1HxEsCSuri6lKavGySpm24EvHNIhNBIpFelnCEHrQ7IuaYMZFU6bH7wEfPoQMxItcuxdbOBCpat9UNvIaYVOSrhJV9el73mk+6t3B4Hz11kRJ9VI7dCoLAlLCYTMySfDV3Jl1a4NExcwCTq8byO6Rm7LTU/tOCnJg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717683315; c=relaxed/simple; bh=JAp+PGZZg2Ze+KTEXkkc4riVSWj/oUgt3++K6gjRboU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dc7z1461wCzt7/l0a1zNg3nDK3i6XheAibUqfDOSt4Sq/UvDVTEVTswepzWHCuFIuyoUWKlfp7GcTwYT9Og1k86tfktxdz41/6tDMsD+rGwbOxzyafPv0dIrbEhV+SlZHj5E7bYiq8wd8+XbN/ahLjjSyrzx00JAxDgK7daHFik= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SFgF9wuh; 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="SFgF9wuh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80A41C2BD10; Thu, 6 Jun 2024 14:15:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1717683315; bh=JAp+PGZZg2Ze+KTEXkkc4riVSWj/oUgt3++K6gjRboU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SFgF9wuh5QJN99Pfig2XOF+Q3oOlMyV/iwJC35WvyiRNKXDezy6lpUUwbEU9CyZo5 83yAgevh6HEPcY2JadGqmE6y6NKpXO2287HnNjiHdYptYb93nRNDdpqWZZFr4mZP+w ndqxrGSGTlOxumM0Z3TkmTo6lKjA9M4JCLeBMQhY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jessica Zhang , Douglas Anderson , Sasha Levin Subject: [PATCH 6.1 195/473] drm/panel: atna33xc20: Fix unbalanced regulator in the case HPD doesnt assert Date: Thu, 6 Jun 2024 16:02:04 +0200 Message-ID: <20240606131706.395841959@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240606131659.786180261@linuxfoundation.org> References: <20240606131659.786180261@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Douglas Anderson [ Upstream commit 5e842d55bad7794823a50f24fd645b58f2ef93ab ] When the atna33xc20 driver was first written the resume code never returned an error. If there was a problem waiting for HPD it just printed a warning and moved on. This changed in response to review feedback [1] on a future patch but I accidentally didn't account for rolling back the regulator enable in the error cases. Do so now. [1] https://lore.kernel.org/all/5f3cf3a6-1cc2-63e4-f76b-4ee686764705@linaro.org/ Fixes: 3b5765df375c ("drm/panel: atna33xc20: Take advantage of wait_hpd_asserted() in struct drm_dp_aux") Acked-by: Jessica Zhang Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20240313-homestarpanel-regulator-v1-1-b8e3a336da12@chromium.org Signed-off-by: Sasha Levin --- .../gpu/drm/panel/panel-samsung-atna33xc20.c | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-samsung-atna33xc20.c b/drivers/gpu/drm/panel/panel-samsung-atna33xc20.c index 8fa15321c22f4..5b698514957cf 100644 --- a/drivers/gpu/drm/panel/panel-samsung-atna33xc20.c +++ b/drivers/gpu/drm/panel/panel-samsung-atna33xc20.c @@ -109,19 +109,17 @@ static int atana33xc20_resume(struct device *dev) if (hpd_asserted < 0) ret = hpd_asserted; - if (ret) + if (ret) { dev_warn(dev, "Error waiting for HPD GPIO: %d\n", ret); - - return ret; - } - - if (p->aux->wait_hpd_asserted) { + goto error; + } + } else if (p->aux->wait_hpd_asserted) { ret = p->aux->wait_hpd_asserted(p->aux, HPD_MAX_US); - if (ret) + if (ret) { dev_warn(dev, "Controller error waiting for HPD: %d\n", ret); - - return ret; + goto error; + } } /* @@ -133,6 +131,12 @@ static int atana33xc20_resume(struct device *dev) * right times. */ return 0; + +error: + drm_dp_dpcd_set_powered(p->aux, false); + regulator_disable(p->supply); + + return ret; } static int atana33xc20_disable(struct drm_panel *panel) -- 2.43.0