Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp857989pxb; Thu, 9 Sep 2021 13:52:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLGfub7RqnUgDI6UwOfQ7tRkHhNCCsV8+E1AnZa27jJU25seQWZ3Jg0axJwjYk0xF/pGyB X-Received: by 2002:a05:6602:1845:: with SMTP id d5mr4230510ioi.23.1631220771296; Thu, 09 Sep 2021 13:52:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631220771; cv=none; d=google.com; s=arc-20160816; b=L3P3OBxTV7XUsY8bKecnQ2aAwUKd00YD1aksSjlzmuref1tqAtF2C+sPmQoNxBbo8+ tmR0/vV+JdMOu486pgs4w5SqKeLRMLdxBryMP5vBLENnMPc31v26zuRb2zLw5RePi6/n S3BGRDrj7PPUeTZpx7dlzFQQTR+nV/Soosrz50xCMvErB8drgUvrH9OMnssdSE90YzHm exjMaPB/N+qOpRIDSVIfda4z151WHp0bXdDOpGkIhqXu0QM6ty3+bbWRahpXD+HFb6rL q2tQf1l0GzBWi0+yUHNOKM5/B8Hq3ixP3G26NVe+I9W7A4yPU02kmuZY+zzhGfN7uGKs C29Q== 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=aaLbY2Tz0R78gM5UFyzV3LES/psE8wo8ewJyYFtaGmE=; b=VHxg709c6iJT6RbX5st+sOcXI8tClvJiukYFMj0as0i+N/w1N3xwNHclECI/DRIvph 69lzQqtZIrxSDVjMj7KA0aoIbTC3xo+m0mLlw+HUFjxJzeS7cFaq810BNm2OztoD4Mcf kHDmo6FjfqIGiulbp8dSjhxvZCVbSIBKIu3NkPMJqsNkrLsapLI67lj+wAuU/VBIr4vZ 3kQmNAAU0ZDaR0W2Dl6c7q117+MJ4bwlLD6Skp3N3qURz5efb9JDBP95GhS8f/OcwPBw wXY0TRd7OwSSzGUTr3rLc/nLv2qkGmCZSNcIBr6WQZl2tknG6DJC5DsA5c2cfJpkfgW8 kObQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=M3sRkj5U; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g6si3191923ilq.52.2021.09.09.13.52.38; Thu, 09 Sep 2021 13:52:51 -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=@gmail.com header.s=20210112 header.b=M3sRkj5U; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245195AbhIIUvM (ORCPT + 99 others); Thu, 9 Sep 2021 16:51:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234786AbhIIUvL (ORCPT ); Thu, 9 Sep 2021 16:51:11 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 013F3C061574; Thu, 9 Sep 2021 13:50:01 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id d6so4377869wrc.11; Thu, 09 Sep 2021 13:50:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aaLbY2Tz0R78gM5UFyzV3LES/psE8wo8ewJyYFtaGmE=; b=M3sRkj5UCFFxWHbtvRCrqQogUWXztMX+umO/Fg+EG1xChVQpXicgxu7gvlC9YY2bTk JbMKLpuNoijQ1Kj9gEbQxrNYKJDwjpjkXIjmTEKdd65hOcdjs3YA6SzoHLYl4kVS/K7U wvBZ/yO3gsUyIvnHcgs0AqT6TMLDp++0yr1NJGHXqgf1eTaXqcUhK5DK5FUy46JtvUgS 2T+a5IVMxYE4lM2sr1YpH9jtzgsuRXD0oLap47Yd+rZPXBZvAAJtOFvch5aqzhoRas/8 zBeohRfEYcUdiuoduv0JESigNg7lYZIzAByKfaE6NXp9YbAhr/TAYIN94NUm2XYKjnz+ CxQg== 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=aaLbY2Tz0R78gM5UFyzV3LES/psE8wo8ewJyYFtaGmE=; b=tNsoR6BZUT73DbthRCq+OnLgmapaxoMXb+6QgDMQLKPCEHM9iSRzhWe+ABEZGnrB1a enArxDMoePaDHf+DuLzl5dPAP7bA2/urEyvnMJxAuJouAEL6RXdTcbOCwMP8OlCwcAe1 HMMzucoFwR4L9Tz66X7OPnn9BPpu1zJp/tHx7L8Ivemz0VNIOef11weFd0NvdPEZOfYX tkVqeG7e+BWYJfNLhzepM3ILwk0Z2jJPzDpCKXfoLYKNDV3VcVaJ+965lzMI+MVseYW2 HFJ4hSD5QCKvK4VfFecitTxKMDQkO6i2tU6WMRs/FFEZlkyJFjZwA2BkBZkW4qjuWlLW RBcw== X-Gm-Message-State: AOAM531E+FnEUWJkGAyuuBPFMMKo3IccoPjFsdy5LAuBv9ZdutTz+Tux HvYa28Pamui/TTqMTmKQ3A1don05aVHeW4zuoYY= X-Received: by 2002:adf:e5c2:: with SMTP id a2mr5852512wrn.251.1631220599548; Thu, 09 Sep 2021 13:49:59 -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: Rob Clark Date: Thu, 9 Sep 2021 13:54:26 -0700 Message-ID: Subject: Re: [PATCH] drm/msm: Disable frequency clamping on a630 To: Akhil P Oommen Cc: Amit Pundir , Bjorn Andersson , Caleb Connolly , dri-devel , freedreno , linux-arm-msm , Rob Clark , Sean Paul , David Airlie , Daniel Vetter , Jordan Crouse , Jonathan Marek , Sai Prakash Ranjan , open list , Stephen Boyd Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 9, 2021 at 12:50 PM Akhil P Oommen wrote: > > On 9/9/2021 9:42 PM, Amit Pundir wrote: > > On Thu, 9 Sept 2021 at 17:47, Amit Pundir wrote: > >> > >> 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 > > Are we sure this is the same issue? It could be, but I thought we were > seeing a bunch of random gpu errors (which may eventually hit device crash). In the sense that async-serror often seems to be a clk issue, it *could* be related.. but this would have to be triggered by CPU access. The symptom does seem very different. BR, -R > -Akhil > > > > > fwiw I can't reproduce this crash on RB5 so far with v5.15-rc1 merge > > window (HEAD: 477f70cd2a67) > > > >> > >>> > >>> 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 >