Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp652965pxm; Thu, 3 Mar 2022 01:41:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+fBq2Jtl1qm6NdZPYtqFCVGJHW3fxs8iNRPOXm0or0Fu6c6m4+UFzQiuQwowcveKT+2tE X-Received: by 2002:a17:902:ea01:b0:150:760:bfd9 with SMTP id s1-20020a170902ea0100b001500760bfd9mr35817240plg.4.1646300475827; Thu, 03 Mar 2022 01:41:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646300475; cv=none; d=google.com; s=arc-20160816; b=cUkKN3vYhY6EeYXWnZ3/LXB1/jWuVqcFRPTqm3TRtLqMTLtUCOj2SN1nn16XVkDSYd 751XPzMfG7Sy4D7NSg37UWmGspg6kHq+yMpUMkR6eMCUSJNUtSrtPXZz4xm2tMkyWI+b 4bfZ0bAyJiac9Jd089b3nn/lUCpY7rVymlLz3zuOh22NS1+RI9BiKHADXyyJoXEvxbZk vo60kmtIedwikKn1KSjj7F8tWxpgFZiIY/ExLLVD2ibEeGBpZrmEOxD8LL4F7HM1DNwX 1GUWUY2r5v04JY18yyUxst4W7VoXzQ/BvJmKvyOoA5bEofqqG2gZLy8I3sYOme1LYvPW osHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=tBBA380tQQm8TI6qvQkuZuFkHNscIxRxUUOICo+oWmw=; b=HjRke1Hk8ser373nfmS5Eq3Bh+5Goj+UZ94OoV27aE2CgwQGVX5K1Hr9Xw5StqPlEj vUXeKHygYv7QMC53XsBqYo+c8uIvhgcYNnp9l5b1RSK/hZDNVhV/f0JXzrj6uxNfhGZu EINkCvvD5/7WfHD9cgzqOLhK/pBo3XhkHngJjkpaOslqghhXg4nZCtv++duoU/L09LsY NXyiTsVwWnqzKf/xo+L9fQcShVYMw0A5XXDUhN7u/ciUFNTHFPkHkQpgrRPQLmUFtANf PWzQ4t19DSHib1ryYYGYIUKiyRb4M1AytXzoZ3gbq6XTM6/JB14dZReMDz4WaFy5KN6v jAmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=kxwvKdJA; 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=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k15-20020a170902ce0f00b0014f62e9d082si1667507plg.591.2022.03.03.01.41.00; Thu, 03 Mar 2022 01:41:15 -0800 (PST) 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=@collabora.com header.s=mail header.b=kxwvKdJA; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231913AbiCCJWi (ORCPT + 99 others); Thu, 3 Mar 2022 04:22:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231902AbiCCJWf (ORCPT ); Thu, 3 Mar 2022 04:22:35 -0500 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36AE116BCD6; Thu, 3 Mar 2022 01:21:51 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: kholk11) with ESMTPSA id D15781F4537A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1646299309; bh=Oe2pV1nTwtl1ZAeBq7ptzCBBqpUgYg8U9OQ8spRg7k0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=kxwvKdJAr8t3ibeUYyY3yZwFjajIrc8P7Izj4oGXdVD8DepEDb8cHlC6SQHcUe1+6 P5wGoTx1r7580zSAScrN+FoSMg4nK1kc+Fgmz3YnDKHYHFW5erqwKkfCNF4U0af5ai 69xDhPXEgIYTW4uFXwOIqY0Ef1Jr8KYiRT/Fjfdm1216hApVM0PU+0TKPWSzNfDtKq DyslyhiFTfwRe/3qTRGRB++2ApHP5qAZkP21+hqNqdmz+euw1ZlrArm5QJNTRwXiY2 wqhx33a2wZqYobw/xwc/InZYoztSn7aOsMLZ3nhANidG5f9l2kcEM0jwDOTjF3Xujm QGKio3vllwnFw== Message-ID: <373491a2-0fa5-0326-29cd-1650f86202d4@collabora.com> Date: Thu, 3 Mar 2022 10:21:46 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH v1 07/10] drm/msm/adreno: Retry on gpu resume failure Content-Language: en-US To: Akhil P Oommen , freedreno , dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Rob Clark , Dmitry Baryshkov , Bjorn Andersson Cc: Abhinav Kumar , Daniel Vetter , David Airlie , Jonathan Marek , Sean Paul , Vladimir Lypak , linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Martin Botka References: <1646242056-2456-1-git-send-email-quic_akhilpo@quicinc.com> <20220302225551.v1.7.I55e39e28375b64455d1605f67453d5e91b0c2710@changeid> From: AngeloGioacchino Del Regno In-Reply-To: <20220302225551.v1.7.I55e39e28375b64455d1605f67453d5e91b0c2710@changeid> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY 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 Il 02/03/22 18:27, Akhil P Oommen ha scritto: > 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 */ Hello Akhil, the hope for the future would be to at least not lock up everything with an infinite loop, so, please change this to have a limited amount of retries. My guess would be that a maximum of 10 is already a lot of retries, but feel free to choose an appropriate number. Regards, Angelo > + 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)