From patchwork Tue Jun 20 11:29:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 110437 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3600281vqr; Tue, 20 Jun 2023 04:44:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ68gkgWsSLDqhBbTscPClFJ+uqPnFN6I7ZbyD0cL0HD9ZdIKUb2ILu6XxdvQusjKjON/Nmm X-Received: by 2002:a05:6359:b95:b0:128:528a:4bfa with SMTP id gf21-20020a0563590b9500b00128528a4bfamr6527750rwb.2.1687261440553; Tue, 20 Jun 2023 04:44:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687261440; cv=none; d=google.com; s=arc-20160816; b=aEWzDs41T5/5UXomNTdQSD8TLyEMnKzsFHk3VJgPgCqAIjDxvImCKV/1Ryeu1VC2wm qb+9yVxR/LpcuiOhAtOpy9eTWRVMlrKQU4F9de3vJZDVi1xzq9rQxXBDNfKK71vMg88w DicXw+u4VvfTp+niqDu2ephWWKnKRSG7JzF1y3vW989XjptCtrlukBZXOggGXqpCDPJP ywgPdBssUKfZuc6IGL3CPCQc/tSmNLtj/wqfhmhoPXjdh4NLV0r0sGPxtmHyJNDQUrMR rNq9HGSSVAtKn0foPXSzczO+cxc/m/f4E0YpjU8MT70HTeWNfKZgzHmpu2wVePGRBKXM LY0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=mvj4Ws5lfpRkepZDTp/39wphy6EdJ013fn+mBz94DMg=; b=SWVlhbMh7dzc03DehVeqiBL8CkAtP1xahCrDw1JuWUgwyHJZZ3zibhBiSKgSV9WgnG ISPLoTjVetI/cHUDFp3w2IW65TbnJGyVxLTDDJ6JZvlU1N/Z2Uoc115wBIRnoimbEfqB 99i17aZ20hIQS0YDIYQjL5trHlkRuFL+oGg/3y8vvitrTwlHwlEealI+mlx9oIzUr1u1 mjGY2Trfn4AltasvLSulpMOczBzog/HPMG8llhb7pnZwZDzuGLPbFMBlSpULsj/4poaF nf3buW+gK4sm139YXV7Bl6E7jF+1kQnHn0anql9BBj2p6yFoREF45yBmtHXV/rCTtD3J OOHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MbGQYduF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i190-20020a6387c7000000b0052c2904e37dsi1492272pge.362.2023.06.20.04.43.44; Tue, 20 Jun 2023 04:44:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MbGQYduF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232279AbjFTLaK (ORCPT + 99 others); Tue, 20 Jun 2023 07:30:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232274AbjFTLaH (ORCPT ); Tue, 20 Jun 2023 07:30:07 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3AB51BB for ; Tue, 20 Jun 2023 04:30:05 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-4f883420152so1231663e87.1 for ; Tue, 20 Jun 2023 04:30:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687260603; x=1689852603; 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=mvj4Ws5lfpRkepZDTp/39wphy6EdJ013fn+mBz94DMg=; b=MbGQYduFNJMlpq71oNbfIylCEuMuMKZ2l0XzU8mFm+OFEGcP3WDjjh67j0j1jC87C8 pYTHIQ/yvYrTj2pV4dMUjTJ6UTZXnbiWSQ8Bcqd5BEDSrCkiXMSYAGlCH9JFLDwe2Q7Y mFCRwPSLgLb5cvi1gzHZgJ+N4txzBsG/JA5MZbQ+3z6ZLyd9KK3U4BOT+yMswRus/yR3 rsqZMTMW3mA+7fLlIRTcYW+jhhL8ZNAl9/zAZDWhWD7YgcIAm5rWZ+XC1P5AZvvYcyyU 2uIaTnnDWx8PtkZFzMshkywp4fa254N2NrXrHNJNMC5bCB9I0vwDSuLrBYweWNSdDVKl fmSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687260603; x=1689852603; 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=mvj4Ws5lfpRkepZDTp/39wphy6EdJ013fn+mBz94DMg=; b=RsZHOvItZ5G3/lSXLiknfMG+nzb9hdaABECg7bhp1S1uyBUSI8CRMcUUO2u7gEhDkH i6rAzTGH75ZKnukKueQS9Kz+a3/1f8KHvSwvb+t18CdlQExY1VufhOhUW64bESzjhaUo GrEmh4oUPBkhna7XZtyU7uvwtfHZ5HuFONuYs4t7scfL2qL+Y3RDI4SuGWvBlshVg3/i 6B0uXg/4As6pCVUMd9kU40iGK132Yfj2QfxMnCNZRP4P5afI9Quax9bA0xBu8yefjqcm 1R0kB15eV+ogHT5F3fNTBmW0yKEODVlbLAlQx1c3eVGBrkeOJPa2r1nzmKgLpDOeDoU1 ZzUw== X-Gm-Message-State: AC+VfDzHTkOA8umv+CkexrfwmD7DuBSZ1T81VwkeLx+pL0cbbi5tmf96 qOB1fIDmDtxTeCNsMA0yElrbyw== X-Received: by 2002:a05:6512:b0e:b0:4f8:54f3:a6c0 with SMTP id w14-20020a0565120b0e00b004f854f3a6c0mr7225414lfu.11.1687260603553; Tue, 20 Jun 2023 04:30:03 -0700 (PDT) Received: from [192.168.1.101] (abxj193.neoplus.adsl.tpnet.pl. [83.9.3.193]) by smtp.gmail.com with ESMTPSA id 8-20020ac24828000000b004eed8de597csm335709lft.32.2023.06.20.04.30.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 04:30:03 -0700 (PDT) From: Konrad Dybcio Date: Tue, 20 Jun 2023 13:29:58 +0200 Subject: [PATCH 1/2] drm/msm/dsi: Use pm_runtime_resume_and_get to prevent refcnt leaks MIME-Version: 1.0 Message-Id: <20230620-topic-dsiphy_rpm-v1-1-446a7fd0ce43@linaro.org> References: <20230620-topic-dsiphy_rpm-v1-0-446a7fd0ce43@linaro.org> In-Reply-To: <20230620-topic-dsiphy_rpm-v1-0-446a7fd0ce43@linaro.org> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , David Airlie , Daniel Vetter Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1687260601; l=756; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=p+WuOmdprSDjusI/rvtFLxmtLwQxfj48jFs663vX5YQ=; b=FXvuUQg/5YWokhed8hsEyalTU7MwztoQeLbEK29H7mFag8FeR7dCHiJpMDyZtqenlstrvvDDB So/552dSW3VCVmtxh0gCXhw3vbmoCQ+QGVZWY9PrHc42lkTyes+CkvM X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769221851755520806?= X-GMAIL-MSGID: =?utf-8?q?1769221851755520806?= This helper has been introduced to avoid programmer errors when using pm_runtime_get, use it. Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/dsi/phy/dsi_phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c index 9d5795c58a98..0a8e1dd4509e 100644 --- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c +++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c @@ -516,7 +516,7 @@ static int dsi_phy_enable_resource(struct msm_dsi_phy *phy) struct device *dev = &phy->pdev->dev; int ret; - pm_runtime_get_sync(dev); + pm_runtime_resume_and_get(dev); ret = clk_prepare_enable(phy->ahb_clk); if (ret) { From patchwork Tue Jun 20 11:29:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 110438 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3600309vqr; Tue, 20 Jun 2023 04:44:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5TC36kFxda9HjGhkAseNChxfWBSdAxLIHiA9yz09mmxnfNiHJ3OaJ2yN+fIrnlTO4XnMKt X-Received: by 2002:a17:90b:1188:b0:24e:59d2:6f with SMTP id gk8-20020a17090b118800b0024e59d2006fmr2696969pjb.11.1687261444507; Tue, 20 Jun 2023 04:44:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687261444; cv=none; d=google.com; s=arc-20160816; b=GVP6kDbcxJ/LI31BZgZ78Ggj2YPpgowhc21KMTvVhf3REv5O9cFWue/hKD9D9E8ddc VDbhYPInRfV7zRl0IRCjjRGQrd377LFrlOudyRYcj9edCcaRHkkFP7aQE4PBFcasd7KU 7IKot9RUcWiSrcwpcRPQgyYS6kFXFCJi5OAGyVassqLeSbRr/XA4KUYHHZGF5ZP4UDQb q53LwGRdhZ+c7YdbQZuRz0dtLjj5VV+0H67OEv8ogtKW9Cm6wfjYCwEOAJC1uXnuiM5z Yt976fZ4NsygxLVCyzwZyUovwGKHN/Tgq9kf3CtoY9NOA/ctOrRH2rCuiENmINmDywhp Q8bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=IWQwth2ZmkJYuqsTZ6NO6uB8o+eUJ5P2P1gJl8kPmvY=; b=jMmISjkkzWh8HYq55cq+GxusPVx9DwEqO+9yEdUhawWuhOg+aHB8UxaJ/ABeck2Ntk Rxor+u+s4xV9wzzRJLSVFjVZv2wJe6Wh2bmhF4Nd3OOks/CG9Vo+Vs/+qCngPjHIvIyO sIjADix2saDOtPNOdPf+IBkIlOjJTGhMMKMOilgfblbNvaG3/o95VzFt19FksnX2vUBy zzDTAg3WZ6biNPTXFg69H9GbIMeVhUacDxUNUPWKxH3roqpGUGyDrFRoio771HfMbyM4 2ecPTWItGP3xKBOuqxNUru1usgByeO/7ExV9N9/nnWfuBcbaRP2Dqb365sFzbY45yAWZ 8Kdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XlMVVpRa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r20-20020a17090b051400b002597c3244c5si1685231pjz.80.2023.06.20.04.43.46; Tue, 20 Jun 2023 04:44:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XlMVVpRa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232681AbjFTLaN (ORCPT + 99 others); Tue, 20 Jun 2023 07:30:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232568AbjFTLaI (ORCPT ); Tue, 20 Jun 2023 07:30:08 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A62C7E41 for ; Tue, 20 Jun 2023 04:30:06 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4f866a3d8e4so4048501e87.0 for ; Tue, 20 Jun 2023 04:30:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687260604; x=1689852604; 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=IWQwth2ZmkJYuqsTZ6NO6uB8o+eUJ5P2P1gJl8kPmvY=; b=XlMVVpRa4u3fhb4RQs+wh+2Y7tMaaHJBAsv4tTGoU2N7ig1FAkCYXYn4A+k5Iyu4Sq 9KGZXgAbs/GnZco6r8C3P0toXcJPX/0LqJ827XvzeiKRh31Rc/nZP90yknzlBmZjO/bV TtmyDaMZESSJRgXHfEKqBpWz2JdZS9dnM2XQnJ8pJI8EW9bPwcv5X6kkO8N4Uvl2nlwO /gNnZPjnZIkz4FNRZ+C9JdVFx6pOqswU2URrNR+W7hPok2ek8Sug89dX62uaUhY4ANT6 KA6jy5tKXwdbLrhWXsQqfOlDNVhJAX3eDEevkjgp9OeDAs8SvIHVijL3q66duaFii9g2 Qw3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687260604; x=1689852604; 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=IWQwth2ZmkJYuqsTZ6NO6uB8o+eUJ5P2P1gJl8kPmvY=; b=WYbgDeHiSJ88s6bufRQZxsKEhcK53IcGT/A633U/nzve+GMCg61O4d9DxupBG5Dh7c eKdNg/MsH84y9wAdVbo6LkQvsDV5j4/q2RmQjvV2i2H8zPjGlechnSkbNfcF3rUwbFhf yIM1MG+nairUTo2vf2IjATELZ5w9i2ghRMCkvUtQXN6CtotQ7rmE/Wyn3veWPpLSZoVr Xg8k58NYCv/T3Ep0NGS+bfUBOZsqQatqA0BLzzw/B44iUClYApDrbMHlJ9zE9S5pWLlt mtoluwZescfaad+5INNX6c+ma9YJt/NS2+DN1QX3Kk6e+9lokGTHJZNyx7+un2VASF5T EFEA== X-Gm-Message-State: AC+VfDxS4QeS8yELudDpt/PTOjWaYYns1/brgt9WFM+Ew34ilxLHaKrm uXiXxjdZrTQPOpuZsrgHSyGbnQ== X-Received: by 2002:a05:6512:3c4:b0:4f6:140b:743 with SMTP id w4-20020a05651203c400b004f6140b0743mr6962300lfp.25.1687260604748; Tue, 20 Jun 2023 04:30:04 -0700 (PDT) Received: from [192.168.1.101] (abxj193.neoplus.adsl.tpnet.pl. [83.9.3.193]) by smtp.gmail.com with ESMTPSA id 8-20020ac24828000000b004eed8de597csm335709lft.32.2023.06.20.04.30.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 04:30:04 -0700 (PDT) From: Konrad Dybcio Date: Tue, 20 Jun 2023 13:29:59 +0200 Subject: [PATCH 2/2] drm/msm/dsi: Enable runtime PM MIME-Version: 1.0 Message-Id: <20230620-topic-dsiphy_rpm-v1-2-446a7fd0ce43@linaro.org> References: <20230620-topic-dsiphy_rpm-v1-0-446a7fd0ce43@linaro.org> In-Reply-To: <20230620-topic-dsiphy_rpm-v1-0-446a7fd0ce43@linaro.org> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , David Airlie , Daniel Vetter Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1687260601; l=898; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=1cWWrhlZ0Hiex7ffMzQSl8xGBl+Dmf8ZnYPKI8QvzmU=; b=Rxf/R7lwV/VjnaZUBbyleX/36anDB/8YdzqjLCTn+vLf9T4VCV1JNySe1o/sOmyE/k4Ji5ClS YtUktVaBtcuDIdwFCQSc+bxJ+0LyhfAGpALqAfUulinnaE6EVrOs42Q X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769221856129048956?= X-GMAIL-MSGID: =?utf-8?q?1769221856129048956?= Some devices power the DSI PHY/PLL through a power rail that we model as a GENPD. Enable runtime PM to make it suspendable. Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/dsi/phy/dsi_phy.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c index 0a8e1dd4509e..323498237ef4 100644 --- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c +++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c @@ -687,6 +687,10 @@ static int dsi_phy_driver_probe(struct platform_device *pdev) return dev_err_probe(dev, PTR_ERR(phy->ahb_clk), "Unable to get ahb clk\n"); + ret = devm_pm_runtime_enable(&pdev->dev); + if (ret) + return ret; + /* PLL init will call into clk_register which requires * register access, so we need to enable power and ahb clock. */