Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2281749pxm; Fri, 4 Mar 2022 13:02:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJw/i51PzrrNRtNbYR250gjYuD6C/KlGja7Ouhg6hQSb9nUhWh+tSTy5gdMloKZ+M07Dzp4H X-Received: by 2002:a17:90a:ad88:b0:1be:ec99:a695 with SMTP id s8-20020a17090aad8800b001beec99a695mr487616pjq.119.1646427766587; Fri, 04 Mar 2022 13:02:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646427766; cv=none; d=google.com; s=arc-20160816; b=pCiT2tN0FfiZYuIdX2AVdwWBlUUfArhqd0RRObeiNHx0ZOhs1o75RC0JtvslqbSX11 rhrApU+ctGsFNtcxk9qUaIeUzvNGrUk47/Qu8z71eg93ObZTTh2Z6ox6JjukunEWCLUm rs6YZ+PIBQC7rDwRJI3mB8tjlhKJI154LZbgVVunoTV3cCb0Py+wOaJTDzbmWqqu3q0X DPn8uX/4Xc2YtbQxgyuKk5BCESXX8c9Z8HX2/d8oQ2PEaikDS4nTX+ssxeiBn8xGe9Wj zMUdBc3u08+1M+3oTdf0PNDFd4P1CDQwIHOgFop8wl7NZa6FT63a8OnOSy++gGtKEqSE 93+w== 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=UBESVlzmGH+/Gac4srZ64vERJW8ASdnCOUV8oAcRbY0=; b=HcudLVWQ4kX4+mpDH9tMhYDhK0eNST5f4hKMp7DRwTUkpMgdeLCAdSxIAUOKHnQRPb 4cPJ9nMRSOOxq7gSjr9zQn8DcTULZbKeRurrvjNTKRiC2DJHQ/kTNxKxZGB0BXENldGf 0j4gxw3atfbDMVcK1lCHv2DiGwPVQAxJX7SanRm6FHkqyF3Ey6ey1n3AFdi3cZGVirYh R2n22tEAX8a960ILM++ntfOdQcacOBU5WmLPDI0YpDNTr+oYJQZzQ6ru62z+kAJpJ7dJ Yf7rj0VUHwT5lt12AyojG+XWuvJQkfHs7V9pTWdtWMduzKuwbNumNzQkyj7mbGuQrggV 7AyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=vSKwuBTv; 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=pass (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 i2-20020a170902c94200b0014fc71ab2f6si6112395pla.511.2022.03.04.13.02.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 13:02:46 -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=@quicinc.com header.s=qcdkim header.b=vSKwuBTv; 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=pass (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 BEED424C418; Fri, 4 Mar 2022 12:13:54 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231384AbiCDUOM (ORCPT + 99 others); Fri, 4 Mar 2022 15:14:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231829AbiCDUNX (ORCPT ); Fri, 4 Mar 2022 15:13:23 -0500 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2976F47C5; Fri, 4 Mar 2022 12:07:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1646424461; x=1677960461; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=UBESVlzmGH+/Gac4srZ64vERJW8ASdnCOUV8oAcRbY0=; b=vSKwuBTvHXdeFFmjYFqGZF8aRwFEl2pvrY6EotnX896WPDLV9MuMSlj8 +QCPFhVxx+rsCg5x516eS6SJ89PZw6xbBt9rDXQYYyzy7hbWK+0OWD65r +yABhrvEkHT9sV98Z1w/pith17bBmoAfcDkmyUrhd33OdFokI0aNuNVug g=; Received: from unknown (HELO ironmsg-SD-alpha.qualcomm.com) ([10.53.140.30]) by alexa-out-sd-01.qualcomm.com with ESMTP; 04 Mar 2022 11:22:38 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg-SD-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2022 11:22:38 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15; Fri, 4 Mar 2022 11:22:37 -0800 Received: from [10.216.41.112] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15; Fri, 4 Mar 2022 11:22:29 -0800 Message-ID: Date: Sat, 5 Mar 2022 00:52:25 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: [PATCH v1 07/10] drm/msm/adreno: Retry on gpu resume failure Content-Language: en-US To: AngeloGioacchino Del Regno , freedreno , , , Rob Clark , Dmitry Baryshkov , "Bjorn Andersson" CC: Abhinav Kumar , Daniel Vetter , David Airlie , Jonathan Marek , Sean Paul , Vladimir Lypak , , Marijn Suijten , Konrad Dybcio , Martin Botka References: <1646242056-2456-1-git-send-email-quic_akhilpo@quicinc.com> <20220302225551.v1.7.I55e39e28375b64455d1605f67453d5e91b0c2710@changeid> <373491a2-0fa5-0326-29cd-1650f86202d4@collabora.com> From: Akhil P Oommen In-Reply-To: <373491a2-0fa5-0326-29cd-1650f86202d4@collabora.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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 On 3/3/2022 2:51 PM, AngeloGioacchino Del Regno wrote: > 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. Thanks for the feedback, Angelo. I will revisit this. -Akhil. > > 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) > >