Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp276868pxm; Wed, 2 Mar 2022 15:13:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJwmOp6HmPeG7ZQWURYQFnx6wB+1hriG6veqpc7XAr+pKof4ttSjCQGLwWEx/3/y0ZCIrtu8 X-Received: by 2002:a17:90a:588c:b0:1b9:d80e:e397 with SMTP id j12-20020a17090a588c00b001b9d80ee397mr2149657pji.237.1646262781803; Wed, 02 Mar 2022 15:13:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646262781; cv=none; d=google.com; s=arc-20160816; b=YvUWUDwTShyUxHyMNJQwSSqkT4VD7j1Gy6VFTOFc9uVDqCC9X/qVRvY5ceGZEmqcp1 7uehaZzDqiFwNjiWMtzD9uIX4YJcYEdzrDuxjJnUeoE9Hw9RkthEsf2b6QfW0AMJ3zm8 4zrFhexOh5e8xB+GCJXZHeuwC1JaHWVkVo1JLu0oelqoouUTZ7Ll+BTN5ertxwnjU+Bp HDIvzaWtxcLvcP3BhVD0uvf2QmqncWGfsfD3C7LVoqLc5LUxw+HO6xqusOXShpeAUaoz g30MzdxW4nRhe+WHjJJUYUuGaEPs7oWa3cU8R6ShotZPtTE3ExR7WT/7PVW5SsEpfSw7 RCVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dmarc-filter:sender:dkim-signature; bh=9IwJD0ho4XLFneomGpeCLkp9yYmW0+WPE/5HI1ZoIcY=; b=X8II0MR2BX+1pDpuwU1yOKK5H2ufHdv7f/XT9T3voSPj8JZNYufeVl9mmQC4Lr487u J4ampCM4YMl+pQj2SE70TnOraSblJXWK23COKmmfPhn6366cpNPbKdqLZuQv5XtgR15O R9n9sK+uWTWDQ9N23ZQ+v0xYTtU5w2ZeYFCHwT6MlvrsaVLTiigAGeOhSdQGbs+R4yyZ nyoq1aMP2bai0ZfbYf9qnTtCKBI7uUGrrmQ0bra3wbvErwcGnH43HzZzsZvloTOHUHbB XeBptoIWWOG5b13FpUZ7I8Nd84qj6bgu8KLwgA6zjotNJ5SJJsgKpmcsHlKdcz0sBYko EgRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=HJHyeF3r; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id y5-20020a17090322c500b00151a817aa5fsi236513plg.138.2022.03.02.15.13.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 15:13:01 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=HJHyeF3r; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2EEDE2AE36; Wed, 2 Mar 2022 14:52:43 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243972AbiCBRai (ORCPT + 99 others); Wed, 2 Mar 2022 12:30:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243968AbiCBRaX (ORCPT ); Wed, 2 Mar 2022 12:30:23 -0500 Received: from m43-7.mailgun.net (m43-7.mailgun.net [69.72.43.7]) by lindbergh.monkeyblade.net (Postfix) with UTF8SMTPS id 9AA844BFE9 for ; Wed, 2 Mar 2022 09:29:01 -0800 (PST) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1646242143; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=9IwJD0ho4XLFneomGpeCLkp9yYmW0+WPE/5HI1ZoIcY=; b=HJHyeF3rjiCsFvAZ8XDAMyXyIhvHSRb95aPNaFDzk0PXhb0A0wNcAX0kRIAFOASvkFxO5vGF Udhx0v7Il/tf5QTXUajhl0/QVu5ppcZ11tUz7/iUADLew3NnmNtMi7obwbKmaXlH9pgi/sxW GlJyobmPdCgi93QxYlpeQCTGHZg= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd 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-east-1.postgun.com with SMTP id 621fa93ee1c212bb9c1fd1ee (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 02 Mar 2022 17:28:30 GMT Sender: quic_akhilpo=quicinc.com@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id DFA51C4363B; Wed, 2 Mar 2022 17:28:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 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 Cc: Abhinav Kumar , AngeloGioacchino Del Regno , Daniel Vetter , David Airlie , Jonathan Marek , Sean Paul , Vladimir Lypak , linux-kernel@vger.kernel.org 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) -- 2.7.4