Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp566643pxb; Thu, 9 Sep 2021 07:16:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8Yp7FjGrZTsO41e89KgqoHJwceNbsgDlH5Ze8CXaKr1dNFEFCJml52emmLJqyUrqu6Rz5 X-Received: by 2002:a05:6402:31b9:: with SMTP id dj25mr3508415edb.180.1631196962360; Thu, 09 Sep 2021 07:16:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631196962; cv=none; d=google.com; s=arc-20160816; b=lUuTyjPA3l/lKTy0TD7xocqAw7JwPQdXJ33dSsKIraP0KO3UlUCHl+cYp44w06Jdbt Ewk6nswu3xC+BUEnsz39j71/WO7ZtH8ccY0ap/goMTys2gT9y4yHpj4YyQZdSpLxBdfL 8LMzVi5dNCL83t90j7M2kRTDSjIIgSw4ZrHXxZiPLlXUO+gUxdhPG8ZZWT/ODOu3LcaZ p0OOcS4AZFG98oBXTbLzDp8f5u2A3hRNU+G9hLfWEXbH+OIKuelwHcNDN6Nk13fdg4H9 IKOiChEpsWNP75KKY3CmgFOFgB3fruFvrNHfuB+PHiI/QnTE+bPBPDo6eFBp9q7Oug2e crNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=rYmN9+Vy/Zm7v0RZi8m78PsGaMbXCo9rwM4fXnlFa0A=; b=V6vSFp5RLgZUlk8QhlpwbHO21Mfmk96bRd5D0I83OdvLlcZDDjh6/LJJEe4DR1axpG IZ5+UrDCxQuInpAjQB/wQ6XOKKseB8Cnl6cVl3ofsUHvOJjoZssoLxta64OAo6pYfcIx 7/M4C+SmdhVsbUrXG+HXqWxd4Ib5f8K/PEJeXgY4AjvaryHQBtWxXaVKGIQS6oV6yky1 cNztFFLRkYuvnOHkW9PW/6nz2q/8flrlESDlm76KsgbdaeVdYrs0zlHi12e0FpGZFKbh 7PKc2VevI8gD9GLJlCCHOm7pWh/lVWO/2UBxMxTWs3x4RRiaEsSq9ExjjIToJEIP6nnW v6kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jw+iTpcL; 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 js7si2136323ejc.83.2021.09.09.07.15.35; Thu, 09 Sep 2021 07:16:02 -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=jw+iTpcL; 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 S1350341AbhIIOMg (ORCPT + 99 others); Thu, 9 Sep 2021 10:12:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347902AbhIIOMb (ORCPT ); Thu, 9 Sep 2021 10:12:31 -0400 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFE6CC08EB2A for ; Thu, 9 Sep 2021 05:17:52 -0700 (PDT) Received: by mail-io1-xd31.google.com with SMTP id b10so1970458ioq.9 for ; Thu, 09 Sep 2021 05:17:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rYmN9+Vy/Zm7v0RZi8m78PsGaMbXCo9rwM4fXnlFa0A=; b=jw+iTpcLGi33/KUcEaVR3lYwDq9++0Zt56YuT9/orXgQXI25hLKmgRmzW2toJi7myz JPbld8zzLLon+cNCj7SMJHWAl067f8z7RD/RvROUFdI3Ou9HjZc9T162pgu15ZOYJZWf 8l6XWBvHQpCKJinTzZt7rdtsbGzQav/fEejvqKQbrPDpfyb0sFGaBk0BRRnT7PFZbdPv yDVqfSiMT2ie32yRsY5ei1vNEx8mK2qHqgyP2v9nXFZ+u09F6NjF7dVD9o9Dow2NTDdo xk3EumusBusF2wvolA+8go4RMKS8aOVH48wEZotYmp2DTIahIZFdmmYTDp8UB7F2vQc+ wEzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rYmN9+Vy/Zm7v0RZi8m78PsGaMbXCo9rwM4fXnlFa0A=; b=oYQfjbG5lM3sePfKHYXNQnZ8dZZwCOwitIYZVqFv2SbeDzze3cdZHpgxm9jhMMgZcd jkfKKg4DmYCV/u/20c/cxm4fNY1npCarM1XwUI1vvHNha+rqVnIgc/PnoJRT5dcspvl5 x7spie4CXhMwa7OqBsyMi8h/FaC/9IJeNogl0wAoGG1H206d1LT9TIJIUl4YljjtYPVg 8B8nxxBKKOD4zOoiPaMv/ZA8eX8VTzOkq6LWVyMkLfcLe+pwMu3rEjcCnnKNFwm1Sckn YwdDKBTRgp+XqkAYL4he4+YZ5EqgyaYDZBHqc/0rbKPAOESANA2zSgdu0C6uBGBZYrpw PYQg== X-Gm-Message-State: AOAM530jh6bPE0wkhKxXFR5hT1aASe+XzQtt+JVDIK1w7gby3PxWUTuW BnkDV2w5AsaP5cccDcDRbgo5RQhO9s+Sy2qMRhiQog== X-Received: by 2002:a6b:3f02:: with SMTP id m2mr2358919ioa.136.1631189872259; Thu, 09 Sep 2021 05:17:52 -0700 (PDT) MIME-Version: 1.0 References: <8aa590be-6a9f-9343-e897-18e86ea48202@linaro.org> <6eefedb2-9e59-56d2-7703-2faf6cb0ca3a@codeaurora.org> <83ecbe74-caf0-6c42-e6f5-4887b3b534c6@linaro.org> <53d3e5b7-9dc0-a806-70e9-b9b5ff877462@codeaurora.org> In-Reply-To: From: Amit Pundir Date: Thu, 9 Sep 2021 17:47:16 +0530 Message-ID: Subject: Re: [PATCH] drm/msm: Disable frequency clamping on a630 To: Bjorn Andersson Cc: Akhil P Oommen , Caleb Connolly , Rob Clark , dri-devel , freedreno , linux-arm-msm , Rob Clark , Sean Paul , David Airlie , Daniel Vetter , Jordan Crouse , Jonathan Marek , Sai Prakash Ranjan , Sharat Masetty , open list , Stephen Boyd Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 8 Sept 2021 at 07:50, Bjorn Andersson wrote: > > On Mon 09 Aug 10:26 PDT 2021, Akhil P Oommen wrote: > > > On 8/9/2021 9:48 PM, Caleb Connolly wrote: > > > > > > > > > On 09/08/2021 17:12, Rob Clark wrote: > > > > On Mon, Aug 9, 2021 at 7:52 AM Akhil P Oommen > > > > wrote: > [..] > > > > > I am a bit confused. We don't define a power domain for gpu in dt, > > > > > correct? Then what exactly set_opp do here? Do you think this usleep is > > > > > what is helping here somehow to mask the issue? > > > The power domains (for cx and gx) are defined in the GMU DT, the OPPs in > > > the GPU DT. For the sake of simplicity I'll refer to the lowest > > > frequency (257000000) and OPP level (RPMH_REGULATOR_LEVEL_LOW_SVS) as > > > the "min" state, and the highest frequency (710000000) and OPP level > > > (RPMH_REGULATOR_LEVEL_TURBO_L1) as the "max" state. These are defined in > > > sdm845.dtsi under the gpu node. > > > > > > The new devfreq behaviour unmasks what I think is a driver bug, it > > > inadvertently puts much more strain on the GPU regulators than they > > > usually get. With the new behaviour the GPU jumps from it's min state to > > > the max state and back again extremely rapidly under workloads as small > > > as refreshing UI. Where previously the GPU would rarely if ever go above > > > 342MHz when interacting with the device, it now jumps between min and > > > max many times per second. > > > > > > If my understanding is correct, the current implementation of the GMU > > > set freq is the following: > > > - Get OPP for frequency to set > > > - Push the frequency to the GMU - immediately updating the core clock > > > - Call dev_pm_opp_set_opp() which triggers a notify chain, this winds > > > up somewhere in power management code and causes the gx regulator level > > > to be updated > > > > Nope. dev_pm_opp_set_opp() sets the bandwidth for gpu and nothing else. We > > were using a different api earlier which got deprecated - > > dev_pm_opp_set_bw(). > > > > On the Lenovo Yoga C630 this is reproduced by starting alacritty and if > I'm lucky I managed to hit a few keys before it crashes, so I spent a > few hours looking into this as well... > > As you say, the dev_pm_opp_set_opp() will only cast a interconnect vote. > The opp-level is just there for show and isn't used by anything, at > least not on 845. > > Further more, I'm missing something in my tree, so the interconnect > doesn't hit sync_state, and as such we're not actually scaling the > buses. So the problem is not that Linux doesn't turn on the buses in > time. > > So I suspect that the "AHB bus error" isn't saying that we turned off > the bus, but rather that the GPU becomes unstable or something of that > sort. > > > Lastly, I reverted 9bc95570175a ("drm/msm: Devfreq tuning") and ran > Aquarium for 20 minutes without a problem. I then switched the gpu > devfreq governor to "userspace" and ran the following: > > while true; do > echo 257000000 > /sys/class/devfreq/5000000.gpu/userspace/set_freq > echo 710000000 > /sys/class/devfreq/5000000.gpu/userspace/set_freq > done > > It took 19 iterations of this loop to crash the GPU. Ack. With your above script, I can reproduce a crash too on db845c (A630) running v5.14. I didn't get any crash log though and device just rebooted to USB crash mode. And same crash on RB5 (A650) too https://hastebin.com/raw/ejutetuwun > > So the problem doesn't seem to be Rob's change, it's just that prior to > it the chance to hitting it is way lower. Question is still what it is > that we're triggering. > > Regards, > Bjorn