From patchwork Wed Mar 2 17:27:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akhil P Oommen X-Patchwork-Id: 12766386 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 0EDCCC433F5 for ; Wed, 2 Mar 2022 17:28:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2CC0310EEF8; Wed, 2 Mar 2022 17:28:32 +0000 (UTC) Received: from m43-7.mailgun.net (m43-7.mailgun.net [69.72.43.7]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8D96010EEF7 for ; Wed, 2 Mar 2022 17:28:30 +0000 (UTC) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1646242110; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=9IwJD0ho4XLFneomGpeCLkp9yYmW0+WPE/5HI1ZoIcY=; b=xhnNe9I/LG0Twng8bsAvvthrRcme+4vFJ3siWRMnhY4GpBrYzyAceIqaJj/LeoocRDOPhUjT LaC+qxOGpGdm3r7bxIZEE5b2XIlU9aTACzh+g2dy6IAEqhDwv7IFUYiFm86L0IrSlQ978Jl8 swrN3j6EV+89xSPl0RRGIVE2s2A= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyJkOTU5ZSIsICJkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n03.prod.us-west-2.postgun.com with SMTP id 621fa93eea5f8dddb548967c (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 02 Mar 2022 17:28:30 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 18B19C43616; Wed, 2 Mar 2022 17:28:29 +0000 (UTC) Received: from hyd-lnxbld559.qualcomm.com (unknown [202.46.22.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: akhilpo) by smtp.codeaurora.org (Postfix) with ESMTPSA id E0DAAC4361A; Wed, 2 Mar 2022 17:28:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.codeaurora.org E0DAAC4361A Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=fail (p=none dis=none) header.from=quicinc.com Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=quicinc.com From: Akhil P Oommen To: freedreno , dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Rob Clark , Dmitry Baryshkov , Bjorn Andersson Subject: [PATCH v1 07/10] drm/msm/adreno: Retry on gpu resume failure Date: Wed, 2 Mar 2022 22:57:33 +0530 Message-Id: <20220302225551.v1.7.I55e39e28375b64455d1605f67453d5e91b0c2710@changeid> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1646242056-2456-1-git-send-email-quic_akhilpo@quicinc.com> References: <1646242056-2456-1-git-send-email-quic_akhilpo@quicinc.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jonathan Marek , David Airlie , Vladimir Lypak , Abhinav Kumar , linux-kernel@vger.kernel.org, Sean Paul , AngeloGioacchino Del Regno Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Retry infinitely on resume failure because there is nothing much we can do if GPU is not ON. Also, this helps us to avoid checking for the return value of pm_runtime_get() to see if GPU is ON. Signed-off-by: Akhil P Oommen --- drivers/gpu/drm/msm/adreno/adreno_device.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/drm/msm/adreno/adreno_device.c index 89cfd84..abcc553 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_device.c +++ b/drivers/gpu/drm/msm/adreno/adreno_device.c @@ -603,8 +603,16 @@ static const struct of_device_id dt_match[] = { static int adreno_resume(struct device *dev) { struct msm_gpu *gpu = dev_to_gpu(dev); + int ret; + + /* What hope do we have for the future if we can't turn ON gpu */ + while (true) { + ret = gpu->funcs->pm_resume(gpu); + if (!ret) + break; + } - return gpu->funcs->pm_resume(gpu); + return 0; } static int active_submits(struct msm_gpu *gpu)