Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp256455lqp; Wed, 22 May 2024 03:52:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVs5FCl7Yzt/ZekRFnzyWvP+rWexKlgERZcgGDG/Ryp2lTHnLP8nrzc+zu5TfUHzouDboBsbIo9fG1W1Sb/OstzgR7w/WYI8gSLG1jUUg== X-Google-Smtp-Source: AGHT+IGsGuBxmeXrCG20wkcZ5526A+ISTv8MUyVYMZJzsAWomCTWFRa3cgLD7wI4AqfF8thaa6i9 X-Received: by 2002:ad4:5049:0:b0:6ab:8329:346a with SMTP id 6a1803df08f44-6ab8329373fmr17111246d6.9.1716375158085; Wed, 22 May 2024 03:52:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716375158; cv=pass; d=google.com; s=arc-20160816; b=QFvkZYVd0A43dE+Yp6EMlV9R6ScPGHXXw0V3KoRjVomauuFzb60z9OS7IIJ1RhlzDe tX41YdsFlLxxXeHxLg33Y3HkxWiRIiDCBoUbh9qAHk0skdnS8BpZFyS3pd1Jc7NvM+j/ b6oqAhQ70QS65wOmV3a1sSowxDFprdb9QcgJkmYOosmdyLERfIu0EFtanh3PzzYzVaES //x4ZuOCA1EnZExyCWcNofBUh7/tGTS1Ouh8ZtqcwXEeeTpp3uzMUsIOuuZ5T9CBIQ3v KlNQMoUjo9isq2trN7ZxfqYHJiWDFbIQv81JC1GlbsD8diF4lyayZc2woy57Xkulv1ZI J/tg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=r6GgwKTdsZwJRv3Ukk7SFtFzEc2aaRxTR76EeCWgZKA=; fh=xc+d4oo+1SXXVt0EdqBd0A2MEzWSgLOczpgX1/g/5wo=; b=Tyud6oSupzzFo+/WZ6E+s3fgF6qebjHTIRj4N+hyXAU+7ROJ+FYaTLJRsmoRWv2irR kv2RAbIQmTWD62DYllgstIGcFHCz2mTBYKqe5ljHaIEHB5pDZtTrAD690L4x2kpyz2CQ yPJcP+K8fFZlxhqdtNu1NPlrjSfImzD2LBHxxVCXLzNutwfEtoqsAr8ZRbfm1qMzTBE7 K2pp+WYzxo8iJWcHE1SBu3gG9efFmzrkzfJ2G1tWiakYGD+eKP8QMnYmY97p0xM4zrCa kgfZ94tME4psRdRJUac2R08TdYFPwVhDeRG7GTx0Z6B9LhK55+6b9mJ6b6cEj67YfzGv MIDg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="J+DkYB/g"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-186079-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186079-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6ab74de3ef0si35047966d6.579.2024.05.22.03.52.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 03:52:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-186079-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="J+DkYB/g"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-186079-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186079-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id CDD7D1C211FC for ; Wed, 22 May 2024 10:52:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D68A384A5A; Wed, 22 May 2024 10:51:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="J+DkYB/g" Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (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 1DC1682D68 for ; Wed, 22 May 2024 10:51:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716375067; cv=none; b=G5T6Ey/6sayx8B4VSZ0uRMAtDME7rX7WcAT9Eb0So1Bnc5S59uWQocM4pjQ/62T2ZvNYnxLVuqQElgk3kP2TCyhZh90d3uwHt+8jYA7eRj7kvF5bazl4N3Bp91q6pItqcAXwC4ZD39AtjkM7SSBNgJfYvQhUKnQ0A1poaZA9SCI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716375067; c=relaxed/simple; bh=Jgttl5H44Vld14qWMns1jroXWg5YOpL1Dc2oQSS9ypw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VReAJ408O/lc2xzmIgp7X6EtH5+3fhlqhA7vxyB0rWnxREIYmdh+kw67PSGIjyBQJKS+Q2RtuOn0zjEw0C4xxbrvKUdO4Yr3znEC6X/BFY+6zEm3ZUu0AP0ctOVj2Nj6c8WDjhULEgnjpgN1ziY3ERBDBwO9ROeSF1MgN/tJnt4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=J+DkYB/g; arc=none smtp.client-ip=209.85.167.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-51f57713684so7843733e87.1 for ; Wed, 22 May 2024 03:51:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716375064; x=1716979864; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=r6GgwKTdsZwJRv3Ukk7SFtFzEc2aaRxTR76EeCWgZKA=; b=J+DkYB/gslx7TMhjgQCCJh3/Ltmu/25tbMFf0DXtl2i7IoamLjjtvvu55HmdxBexTN O0OYeyscnvgIDLaGNgm0+f7X/zcSGHsDBR3I4GQWjkFPa1LLwO7jk+NdocoyRAxfYWhU KxTpQBTmfX450e1dKTrTRjrqVJEKuOOr8lMyCVFrF73z1XNiHY1StAu4mG2jdfhIr24I 0iojeGJS1ZUAzgGwzvSWiwL9zmzvq+F6af/TAgifgsxBpcQGbYQJQNiH3S3IzrFTNXrT oNQ8WtnlCyhrBcY9sFDCQdeHT3kMuhQaiflX1S/FrVNdQmlG9UT5Wn/Nb3FdDqBhhRWn q2xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716375064; x=1716979864; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r6GgwKTdsZwJRv3Ukk7SFtFzEc2aaRxTR76EeCWgZKA=; b=au4dH6YfRLh9qmz2lIEOK05Cbwl1QP4TrNKLvrhjpM+JFQRF6rxbUkmTeKXuK0G6xP DUqce1kggZOPbtI/K4JPJG3+xNhxPBz0Pxc2O2oOvUQmD015LB5Uep36FId9W63GnltG OAMT0uM8Z/PoeFWtWhESKBrsouYZW+nHE55k1UtDudhci8FDCwmzCNwK7b/4w2dqpEov ZCauPI6p+eQvXiuhUqoXaMUcM0sJHDjVjyyCSaz979Cr/xDL6dDd9DWsNIXYa+KEk3cc Ry1ZCxcyyYBq0mgTIW96SQ1dWXEOEqsHfEkkP2d6slguFpLfbAfvi8knHVEJ9qcB57J7 k60g== X-Forwarded-Encrypted: i=1; AJvYcCXw4x+pDgkj3S/1Nq7HagJD1UurhCi8Mx9LgCJE8UZ2S3KCkIodFlNHd/showsZepuHDcl3jmFE79ZndaFGppcHwm2eBOpKrZEK5pPK X-Gm-Message-State: AOJu0YwL3Aig2zSZ53y69xduP6jYig+Zq+qfBiSdUTJkTEjz757qJUgy lPyj3rpjICaq2TnZlBvVCH+ftqHX0mmhE/qlGGOKfSHEcg/cVoU/Hf6AyQXkS5E= X-Received: by 2002:ac2:47e8:0:b0:521:7846:69d1 with SMTP id 2adb3069b0e04-526be6ea784mr995436e87.6.1716375064461; Wed, 22 May 2024 03:51:04 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52431778ec8sm1279126e87.194.2024.05.22.03.51.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 03:51:04 -0700 (PDT) From: Dmitry Baryshkov Date: Wed, 22 May 2024 13:51:00 +0300 Subject: [PATCH v2 08/14] drm/msm/hdmi: add runtime PM calls to DDC transfer function Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240522-fd-hdmi-hpd-v2-8-c30bdb7c5c7e@linaro.org> References: <20240522-fd-hdmi-hpd-v2-0-c30bdb7c5c7e@linaro.org> In-Reply-To: <20240522-fd-hdmi-hpd-v2-0-c30bdb7c5c7e@linaro.org> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1518; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=Jgttl5H44Vld14qWMns1jroXWg5YOpL1Dc2oQSS9ypw=; b=owGbwMvMwMXYbdNlx6SpcZXxtFoSQ5rvOYH/AvxRXG5PuivCtgZbTDkzq5nVPWvqSuvbF7bJ9 rk0FuZ2MhqzMDByMciKKbL4FLRMjdmUHPZhx9R6mEGsTCBTGLg4BWAik8U4GBpOrL91US2S2SFV 9ZCs0o4mLsaQ+M5Xpdm66VVdr8SybSZkrV92JVMh3kPGLmgR67tHLIlF57/r1jWJRc/4UDnxY+m eeTJx0/alXEoTqJaWKljNnD9vmuILxjDFKMP8sMMFJ0svhu7uyJeqCn45Q3lKZMEFZq9JrYpvfy y7FHL66gttO929211S1l5RmLlJsmeSBLf7boZrZzszPBmMFyzbI5fVJGMSfdl5+4nyf9t1vyXP/ PukZV1B4yyra3/OSLzOcK6Z+CnSfLVGYfnVbwyO/6VbMg801y/ROpJzgLss7q1uTcbtjao+B2Tf 7zvHoJK1ZYrOpKDmdXeWHam/tVr6j4H+YcHFqf7lBVKnAQ== X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A We must be sure that the HDMI controller is powered on, while performing the DDC transfer. Add corresponding runtime PM calls to msm_hdmi_i2c_xfer(). Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/hdmi/hdmi_i2c.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c b/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c index 7aa500d24240..ebefea4fb408 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c @@ -107,11 +107,15 @@ static int msm_hdmi_i2c_xfer(struct i2c_adapter *i2c, if (num == 0) return num; + ret = pm_runtime_resume_and_get(&hdmi->pdev->dev); + if (ret) + return ret; + init_ddc(hdmi_i2c); ret = ddc_clear_irq(hdmi_i2c); if (ret) - return ret; + goto fail; for (i = 0; i < num; i++) { struct i2c_msg *p = &msgs[i]; @@ -169,7 +173,7 @@ static int msm_hdmi_i2c_xfer(struct i2c_adapter *i2c, hdmi_read(hdmi, REG_HDMI_DDC_SW_STATUS), hdmi_read(hdmi, REG_HDMI_DDC_HW_STATUS), hdmi_read(hdmi, REG_HDMI_DDC_INT_CTRL)); - return ret; + goto fail; } ddc_status = hdmi_read(hdmi, REG_HDMI_DDC_SW_STATUS); @@ -202,7 +206,13 @@ static int msm_hdmi_i2c_xfer(struct i2c_adapter *i2c, } } + pm_runtime_put(&hdmi->pdev->dev); + return i; + +fail: + pm_runtime_put(&hdmi->pdev->dev); + return ret; } static u32 msm_hdmi_i2c_func(struct i2c_adapter *adapter) -- 2.39.2