Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1796455pxb; Wed, 9 Feb 2022 04:50:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxVP5bDLwijQ6q7GSq71vO8ckWcHtijpsOt+QbUQxW9p1X0G+2QXBD2DXimZRk6FSieaptG X-Received: by 2002:a17:90a:5a:: with SMTP id 26mr744537pjb.240.1644411028406; Wed, 09 Feb 2022 04:50:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644411028; cv=none; d=google.com; s=arc-20160816; b=uBMncyM11HU0bApJhMUFOvtqudhLXqNh8Yv1wlBnBZOX3JZyQppBmQn9j0V0yXPqZg lTMn6JuJq9CzqMN2bdu/Dq4cDUWJ3bdqUIpox1l9TBo4kyJd5DWdkJ0jFIT9uuVREvIS oANzI9J2RsMkOnRBCyScIvPHsWMqRpUhrXbBiMBE5N2a8xS6L0XpU9SQWNazYosII3C7 t5b2bUmmrwWDiNEALWsBUppf424BsNy5NUsCYMSXlXrWLgB+rQ6k5P5tJl+MZu6IMfax B69vN4HFC9AT/DcERK7Pwc7rm6THKTXiiFErmP7HByRe8BzkXpOAXo5w5C1bP54syenE x+Mg== 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=A7moO6TkWuZd8WQdT04YbPTaZYf9v5wim/a38Dn6kdU=; b=DZ4MQvDQvn+UoCMjiVVnhvUDkNXbLYoZ0Y0yJw18yfFdpPzA+MeWjVRTSS7OQiLzR+ olf1yEEJNzSk9095Yzjrk5ygjKeI2c6ncGE2aHZM1x1Y5nAgTvly9xuj3l9VFlq4mMOG nE7yUIN4G+i1+d52S59wz2XOEQD/IBPovPoCv1xjPSxfHvks7OhDxpnFt7czbOg/wUHT Qg9fBe2q+C8WIuNgsz7lddJ1Pb8iy4jbncinLOrkPs5ZMCZGlytpDVtK61qwuzaVQ1m/ ZHxcCSul6TDZhm7fgkHYaIWTvaYZF/RLC3EOhENZPQzzqx3JbiIOd6KJOs0u4zb/Etxp lGPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="d7OY/fw7"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f7si15265741pgc.3.2022.02.09.04.50.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 04:50:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="d7OY/fw7"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D6118E15B627; Wed, 9 Feb 2022 02:30:33 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238476AbiBIHiv (ORCPT + 99 others); Wed, 9 Feb 2022 02:38:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238705AbiBIHis (ORCPT ); Wed, 9 Feb 2022 02:38:48 -0500 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90E11C05CB87 for ; Tue, 8 Feb 2022 23:38:52 -0800 (PST) Received: by mail-pl1-x632.google.com with SMTP id c3so1505315pls.5 for ; Tue, 08 Feb 2022 23:38:52 -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=A7moO6TkWuZd8WQdT04YbPTaZYf9v5wim/a38Dn6kdU=; b=d7OY/fw7ZyhqzU2siPVnMH2MTqK8RfIIThY4XV8/L7Zqc8FAjRbEGUf97eHrHtJ2jZ cVn4ySmLnUxoNuhyFTYlVQTiBtIRKeE/xV8gSA4A3hVCPxO8bGpQlQ5oeB6j68MVu9in W7do93yqrY+rjx/eOZ1OwuXeCvBsesJ5aPMBB/pSypJmrAsgOMExGCGnJMgpSgBGKg6B hemFbHx3bg+KLJEQfmmxI8j2sjHpyiksRSq0B+Y5JFHGPf1kWzTQ5xcT9+SbXo3urkl1 VeQvsjBKTl9j7WiLVt0GjbnXQatn32ucPoXbxJjsZ2JB02WGlCqmdDCmjXEEqrTMeUdL Lqrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=A7moO6TkWuZd8WQdT04YbPTaZYf9v5wim/a38Dn6kdU=; b=lU6LSRJwaZdOMtLpeL5xlazJmCxXz6VqwqKzjTL6CFdOs0VlyR+S8R3x/EUUaY7QPt AguSpHzkVR/Nb6NFcU3GWTh8AVwnIMDRUKug6J1qcqI6gpft3ymULr5az2y+JaQin6WP PQ+eJb9KAXZdmpOujSvncXedsxd/VHxlshB6GGx3lBCVv2ZiRLYKEKFDnk7YAYhjWtut Hy0eM/NgrN2AZtCT86mSJLt+lYHtAvfeXHPYGucBmMgoes+X26XVbBW3bVqjcaZFskoM MZVxsmv62jfQE/RA1XIJXjQST08EVmE/9TskH64upCdXVf4D6m8RnyPz+EvruvRmfk69 AFzA== X-Gm-Message-State: AOAM532eytuWUEU9/ts+YG5fdOocw3uAgvtAaxg5FYX4sXdVhP+FpDy9 /Lv+AydO3Ifq2jNqYjeFOSl24w== X-Received: by 2002:a17:90b:2243:: with SMTP id hk3mr2024689pjb.244.1644392331056; Tue, 08 Feb 2022 23:38:51 -0800 (PST) Received: from localhost ([136.185.132.167]) by smtp.gmail.com with ESMTPSA id c4sm6075144pfl.131.2022.02.08.23.38.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 23:38:50 -0800 (PST) Date: Wed, 9 Feb 2022 13:08:48 +0530 From: Viresh Kumar To: Bjorn Andersson Cc: Lukasz Luba , Jonathan Corbet , linux-pm@vger.kernel.org, "Rafael J. Wysocki" , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH v2 2/2] cpufreq: qcom-hw: Delay enabling throttle_irq Message-ID: <20220209073848.os3i7unf2qw3un3i@vireshk-i7> References: <20220128032554.155132-1-bjorn.andersson@linaro.org> <20220128032554.155132-2-bjorn.andersson@linaro.org> <5433250b-ee51-06e0-3ef8-ab287a112611@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716-391-311a52 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,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 28-01-22, 10:30, Bjorn Andersson wrote: > On Fri 28 Jan 02:39 PST 2022, Lukasz Luba wrote: > > On 1/28/22 3:25 AM, Bjorn Andersson wrote: > > > In the event that the SoC is under thermal pressure while booting it's > > > possible for the dcvs notification to happen inbetween the cpufreq > > > framework calling init and it actually updating the policy's > > > related_cpus cpumask. > > > > > > Prior to the introduction of the thermal pressure update helper an empty > > > cpumask would simply result in the thermal pressure of no cpus being > > > updated, but the new code will attempt to dereference an invalid per_cpu > > > variable. > > > > Just to confirm, is that per-cpu var the 'policy->related_cpus' in this > > driver? > > > > Correct, we boot under thermal pressure, so the interrupt fires before > we return from "init", which means that related_cpus is still 0. Just to clarify here a bit, policy->related_cpus is already allocated at this point of time. AFAICT, the dereferencing of the invalid per-cpu variable refers to the per-cpu freq_factor in arch_topology.c, which happens because the cpumask isn't initialized yet. -- viresh