Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp6234433pxb; Tue, 16 Feb 2021 21:54:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJyS9uYL+m4YpvEyTErurSbe85ylCfLaWXTpbDR6LovRY2I1t5Rx06y6QCm/WUGoCpqjGnDU X-Received: by 2002:a17:906:7e42:: with SMTP id z2mr24028562ejr.177.1613541268846; Tue, 16 Feb 2021 21:54:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613541268; cv=none; d=google.com; s=arc-20160816; b=nslrqYB9H2DviqPC1yVd8dfkz7rq9iI6Jla1ksH/ESvv2jLmy+Gjf0zjEp0C+6MNLc kSmwcHX8f5mGFF3Ts3k1YMEk9Ytyxx3Ter4QzayYNKbH+Py/ggZrkU+GczMOU2LcYNUR FPLfvXpToy8qckG4Y/wZrjOO6FX6bAHb8sh/IHmo56QzOhCCtcGVzmTV+6hMVMqYM//O xJF7iskFzRTLeyycuKrq2HtxnJ/SR48PwXczgr1aP0jXDRqoQwuQPUV8YG0lqnS/K9rC E8DJPSGB28IR0S4YSpEk0RjO1PALxFbWR5UTeazq2dLQXew5U95CePb5tQmoDtIh1oZz Kdxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=qkSCWZe3fPVf1MeLv0asrOZ7NO0HuQyQtXUna6IlKOo=; b=03hIj4PQ4iMOJrrYi/PT8kGt/0P8tcJ3tNDM+QtI4QBFet9RRlPP17FYDswlTl1DWy yfsPuFKDao3NlfzF3G+MgTf3GiCg2VZBFZtM9fbXce4Dw8KyuGjCmzdeQoBu4fVs+jXQ Jo/PgCPUomF65LHDMnZan9bNDQsuJFwz8tMg2pRSLl0nPbq2BlsSSWmCGZSVcPRkt4+q TMvuM974T3ISJSNt0OZqQk9J9ZwpprZ81BYGLab1GshKXSZjo9wXCXSz0mGTSqonbgBv t8uwL9g57Ed20pMr1J0h98rjHcz7YaG1ERJ3m5aIpmysiJQ/pJLf/527ApK6VHn9STpY oMJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C1oz9qbn; 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 jl16si773210ejc.461.2021.02.16.21.54.05; Tue, 16 Feb 2021 21:54:28 -0800 (PST) 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=C1oz9qbn; 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 S231382AbhBQFvP (ORCPT + 99 others); Wed, 17 Feb 2021 00:51:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230425AbhBQFvN (ORCPT ); Wed, 17 Feb 2021 00:51:13 -0500 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0A6EC061574 for ; Tue, 16 Feb 2021 21:50:32 -0800 (PST) Received: by mail-pf1-x429.google.com with SMTP id q20so7725839pfu.8 for ; Tue, 16 Feb 2021 21:50:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=qkSCWZe3fPVf1MeLv0asrOZ7NO0HuQyQtXUna6IlKOo=; b=C1oz9qbn1tp0GqzJhJGK3w7HzbreQKZ7gl95fjVZDqlxtGMKJKu1XB+CYLR+D1lgqW UdTcYDJbq3WCMoUoaNwUrR4HWGPJXeyv27gu01mO4Fb/v26u8mPLXfrKJtXpEaRViEz4 s5TI4SUh7OhOKpqcrFNkwesCGnoB+0diRzP5PUD1t8pIfNQAk5zKWnEszExIZ5nt3K26 InkakXPjCRgHLGE2mHVEzvIUJVSJC7S6iaT/Jt8gcny/lHGKowVb1JmzG4GODbfhDfNq lMA+xQ6X01go41TmraZRwDj3wA5egSbBq8+OhKDE+uqvcOdu98EIG2Bm4ZHinzkOHm30 Oekg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=qkSCWZe3fPVf1MeLv0asrOZ7NO0HuQyQtXUna6IlKOo=; b=uiImd6HZvqZOXOVzyAwpXB4ilUbb2yr9k+92sskXssA1jIj3d3o5Dkp+OLkNKHr6X9 HOphTwkRedioq5YpbbvFbB7PXrohLkzFUzoH7QXBbtOL4wR0MgetqJPAGuPBo81phZhI A7ESRAPH7o/9MBWD9aXtebkMP9RbZt0zIkeW3ia+9dOaxx6I6c55k8UtfWbA0z35Vw4r if8vjejcbOBrur/YnRKeiLaWCxfV3owVD3uQDWKxBs0E3IetI378iYX6hJ8R2FsD5uO9 CzdRYCaxEZ2SlTEMPR2IS2xVuzzy2NFyu2oAEijA17FXJGJIIkdwYXlwOJGh4m5pELaL yz0Q== X-Gm-Message-State: AOAM5326ik6wXqYkL4p/zWduzDAgdNVilHPeyDUy3DkLf454wcRlrcnp rcMdKNpFsFx3NeqmEq38tbtrgw== X-Received: by 2002:a63:ec55:: with SMTP id r21mr21916136pgj.144.1613541032581; Tue, 16 Feb 2021 21:50:32 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id h5sm843546pgv.87.2021.02.16.21.50.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Feb 2021 21:50:31 -0800 (PST) Date: Wed, 17 Feb 2021 11:20:29 +0530 From: Viresh Kumar To: Thara Gopinath Cc: rjw@rjwysocki.net, bjorn.andersson@linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH] cpufreq: exclude boost frequencies from valid count if not enabled Message-ID: <20210217055029.a25wjsyoosxageti@vireshk-i7> References: <20210217000013.4063289-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210217000013.4063289-1-thara.gopinath@linaro.org> User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thara, On 16-02-21, 19:00, Thara Gopinath wrote: > This is a fix for a regression observed on db845 platforms with 5.7-rc11 > kernel. On these platforms running stress tests with 5.11-rc7 kernel > causes big cpus to overheat and ultimately shutdown the system due to > hitting critical temperature (thermal throttling does not happen and > cur_state of cpufreq cooling device for big cpus remain stuck at 0 or max > frequency). > > This platform has boost opp defined for big cpus but boost mode itself is > disabled in the cpufreq driver. Hence the initial max frequency request > from cpufreq cooling device(cur_state) for big cpus is for boost > frequency(2803200) where as initial max frequency request from cpufreq > driver itself is for the highest non boost frequency (2649600). Okay. > qos > framework collates these two requests and puts the max frequency of big > cpus to 2649600 which the thermal framework is unaware of. It doesn't need to be aware of that. It sets its max frequency and other frameworks can put their own requests and the lowest one wins. In this case the other constraint came from cpufreq-core, which is fine. > Now during an > over heat event, with step-wise policy governor, thermal framework tries to > throttle the cpu and places a restriction on max frequency of the cpu to > cur_state - 1 Actually it is cur_state + 1 as the values are inversed here, cooling state 0 refers to highest frequency :) > which in this case 2649600. qos framework in turn tells the > cpufreq cooling device that max frequency of the cpu is already at 2649600 > and the cooling device driver returns doing nothing(cur_state of the > cooling device remains unchanged). And that's where the bug lies, I have sent proper fix for that now. > Thus thermal remains stuck in a loop and > never manages to actually throttle the cpu frequency. This ultimately leads > to system shutdown in case of a thermal overheat event on big cpus. > There are multiple possible fixes for this issue. Fundamentally,it is wrong > for cpufreq driver and cpufreq cooling device driver to show different > maximum possible state/frequency for a cpu. Not actually, cpufreq core changes the max supported frequency at runtime based on the availability of boost frequencies. cpufreq_table_count_valid_entries() is used at different places and it is implemented correctly. -- viresh