Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp1483831pxt; Sat, 7 Aug 2021 12:23:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytMCV2FdNQI6+J8g4nDEw5rmmBnaxeid+O8/ExT3t536gbw0pgNHFJ3hc1KMQhFUZtYlkO X-Received: by 2002:a05:6638:2186:: with SMTP id s6mr15445496jaj.127.1628364211806; Sat, 07 Aug 2021 12:23:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628364211; cv=none; d=google.com; s=arc-20160816; b=NDefx3BzimNLd+IDpzMEgJkwj0kUOrpdMzbpZfpaWXCWxe8JXO4plsGLswMxtLyx6m B6iuaNpVV58rR3EfrhvR+WaH+/8QsbYOR2FMNqJQ+Ij2qdpjK9esrafNo9mtoa/QdhwT 5NDSCWFiNLQ8VcHAZ/NxTTmgcJJdWaRI6zw2kl5AMx/68UUK8GWxraDp8T6AIuwS/8K3 SqObh6bIESUgCgyECE0N9CIBP/iFusM1T12XTh8E4yFSmEUuuDhyfAwownI50hxuVHQi Ymw/BkMIh9+ENo10LrTmDJlGtlCqEEzQVlk1u+zXgW0gZx7lxpNpbPTGnDf0SGTYqj0w /MZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=zC7y0PTScHH/ipa0plXxkGuFfW8aO4YnqDt5Y1MGCY0=; b=D5RdPIkb7sdtfElgNGs6Q0vOj8FIcBC0QJurx971B8fEjOo6qC4Gq621F6O1vHIdrH C803P6j+pDDnfoTrbqQcB+bVaZfkhJx8YK7Nsvhgg6IUsKNQYuIZ0UHejxYE0ke9oFpK 8b0lcuawu55injkxg325hAYgCLFY3ww3rEZO8z9HjQGOOv4pgyorCist6hsSG3bkmtoX YgsTADSKX5ilTZ9iRwi7V8Mh5HRRChevAGaFnSRWvpvT5JLPZvuSP4OnV3a1ALaySK6U uFxGknKUtrM5ajbQ4d9lMzX2uW+Xgt2Y7re9xLDr+oqGDAkZpKCWWSfDSQbL0dASpfnJ 4OhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g3dFNgA7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z14si13941990ilu.89.2021.08.07.12.23.19; Sat, 07 Aug 2021 12:23:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g3dFNgA7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S229705AbhHGTVp (ORCPT + 99 others); Sat, 7 Aug 2021 15:21:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbhHGTVp (ORCPT ); Sat, 7 Aug 2021 15:21:45 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66657C0613CF for ; Sat, 7 Aug 2021 12:21:26 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id k29so2874166wrd.7 for ; Sat, 07 Aug 2021 12:21:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=zC7y0PTScHH/ipa0plXxkGuFfW8aO4YnqDt5Y1MGCY0=; b=g3dFNgA7i0iE8E6mG+gjMhuM9jRtxcDw0QINW0Nsofw2sWRnJ31YxvzY7TPAvJGQRL m3S6eM8ljhIuOIxlVHvfjnVOR2NhRWEfhIvcY1gx/HX9z6/w64bX6A/xOSTx84k5AORF wBTUiYZJId0XcrNNwLsmoI2eZ40kbvSyYrA+wd/nV5R82vQifnxiyAcRXkqDFkvgCMKG r+NTnigaiyTlWiITnSk/zPdI1bCwHYfXcOV1KFpu/GHSr+HDWmzgbJK0S+Bk35DbzjKZ HrXRhu4D5WWtaGB7Cvy5shGwYLYmLFecYgejryXtHNOVgWvZeCB/1wIrnWK/4L8sqs8F Itbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zC7y0PTScHH/ipa0plXxkGuFfW8aO4YnqDt5Y1MGCY0=; b=LpMplsOJYLIX3Po/0ouljL7va+fZPhP3MWlrewNGBsdbJx0Gv48/3pns6a06qfD9vs 1MxnnNpCY5cVYKUGIzkrvLwxrbIjJees7MhAPVUhXbM0PzTxb8YlKrqRlcAuG2cDan2i kpfsvasYBOaKM5IShf4vQ94eFZnp7JRRJjhCIBEsqG9GG/+2KKUcXcFn3WuFLcb+Gbyt D1f9tsq16bUyg8OqWt2TNOb9HXYh9zsMcndZn+ZuB0SB+OhLvp9WrxHXVuz0WtGazatJ P3wvAOLEdyzZGZp1t2KKeiz9xQ5a9ab503OxYDHO3useU0RglKTBeDvUu8+sP+FX/0Ab PnqA== X-Gm-Message-State: AOAM5323spgct3xEEJSD91zpFhcoFrBkYOSh4p+qgcympujWyYcLiME7 zVzCAWTxC3VQ0OAA7qb1d+So9Q== X-Received: by 2002:a05:6000:1241:: with SMTP id j1mr3531000wrx.338.1628364085060; Sat, 07 Aug 2021 12:21:25 -0700 (PDT) Received: from [192.168.1.12] (host-92-17-52-101.as13285.net. [92.17.52.101]) by smtp.gmail.com with ESMTPSA id i10sm16041196wmq.21.2021.08.07.12.21.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 07 Aug 2021 12:21:24 -0700 (PDT) Subject: Re: [PATCH] drm/msm: Disable frequency clamping on a630 To: Rob Clark , Akhil P Oommen Cc: dri-devel , freedreno , linux-arm-msm , Rob Clark , Sean Paul , David Airlie , Daniel Vetter , Jordan Crouse , Jonathan Marek , Sai Prakash Ranjan , Bjorn Andersson , Sharat Masetty , open list , Stephen Boyd References: <20210729183942.2839925-1-robdclark@gmail.com> <1a38a590-a64e-58ef-1bbf-0ae49c004d05@linaro.org> From: Caleb Connolly Message-ID: Date: Sat, 7 Aug 2021 20:21:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rob, Akhil, On 29/07/2021 21:53, Rob Clark wrote: > On Thu, Jul 29, 2021 at 1:28 PM Caleb Connolly > wrote: >> >> >> >> On 29/07/2021 21:24, Rob Clark wrote: >>> On Thu, Jul 29, 2021 at 1:06 PM Caleb Connolly >>> wrote: >>>> >>>> Hi Rob, >>>> >>>> I've done some more testing! It looks like before that patch ("drm/msm: Devfreq tuning") the GPU would never get above >>>> the second frequency in the OPP table (342MHz) (at least, not in glxgears). With the patch applied it would more >>>> aggressively jump up to the max frequency which seems to be unstable at the default regulator voltages. >>> >>> *ohh*, yeah, ok, that would explain it >>> >>>> Hacking the pm8005 s1 regulator (which provides VDD_GFX) up to 0.988v (instead of the stock 0.516v) makes the GPU stable >>>> at the higher frequencies. >>>> >>>> Applying this patch reverts the behaviour, and the GPU never goes above 342MHz in glxgears, losing ~30% performance in >>>> glxgear. >>>> >>>> I think (?) that enabling CPR support would be the proper solution to this - that would ensure that the regulators run >>>> at the voltage the hardware needs to be stable. >>>> >>>> Is hacking the voltage higher (although ideally not quite that high) an acceptable short term solution until we have >>>> CPR? Or would it be safer to just not make use of the higher frequencies on a630 for now? >>>> >>> >>> tbh, I'm not sure about the regulator stuff and CPR.. Bjorn is already >>> on CC and I added sboyd, maybe one of them knows better. >>> >>> In the short term, removing the higher problematic OPPs from dts might >>> be a better option than this patch (which I'm dropping), since there >>> is nothing stopping other workloads from hitting higher OPPs. >> Oh yeah that sounds like a more sensible workaround than mine . >>> >>> I'm slightly curious why I didn't have problems at higher OPPs on my >>> c630 laptop (sdm850) >> Perhaps you won the sillicon lottery - iirc sdm850 is binned for higher clocks as is out of the factory. >> >> Would it be best to drop the OPPs for all devices? Or just those affected? I guess it's possible another c630 might >> crash where yours doesn't? > > I've not heard any reports of similar issues from the handful of other > folks with c630's on #aarch64-laptops.. but I can't really say if that > is luck or not. It looks like this affects at least the OnePlus 6 and PocoPhone F1, I've done some more poking and the following diff seems to fix the stability issues completely, it seems the delay is required to let the update propagate. This doesn't feel like the right fix, but hopefully it's enough to come up with a better solution than disabling the new devfreq behaviour on a630. diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c index d7cec7f0dde0..69e2a5e84dae 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c @@ -139,6 +139,10 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp) return; } + dev_pm_opp_set_opp(&gpu->pdev->dev, opp); + + usleep_range(300, 500); + gmu_write(gmu, REG_A6XX_GMU_DCVS_ACK_OPTION, 0); gmu_write(gmu, REG_A6XX_GMU_DCVS_PERF_SETTING, @@ -158,7 +162,6 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp) if (ret) dev_err(gmu->dev, "GMU set GPU frequency error: %d\n", ret); - dev_pm_opp_set_opp(&gpu->pdev->dev, opp); pm_runtime_put(gmu->dev); } > > Maybe just remove it for affected devices? But I'll defer to Bjorn. > > BR, > -R > -- Kind Regards, Caleb (they/them)