Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp123042iog; Thu, 16 Jun 2022 23:46:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s2Jz1UgV95IdSB3s9rmALGertZkBoeu7bMIjgJh669sFdQd7A8DdBu1LgiqotipXZCyV1k X-Received: by 2002:a63:2447:0:b0:3fd:b97e:7f0f with SMTP id k68-20020a632447000000b003fdb97e7f0fmr7768758pgk.516.1655448415993; Thu, 16 Jun 2022 23:46:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655448415; cv=none; d=google.com; s=arc-20160816; b=TDSh2wcNnajxdeLaQS5HzcMUqNC/rMRXxmhSglcVTmAQpKfGSZ4Gtu45HJAGrrJgbx LufRyRwAWyB9r1u0z3SchI38MD089iUb8B8jbzoE7Yaiq6so/LsrK3J0JqXayOqZQLs7 em11K8CsCbjl9CxvG0PDvWtL7hReNQe0Wic/YICf2ghj0bVo4x+rDkjmlpFPshYR5Zqa eq/4liZI/KibC8+AsUF/vRhWFrsyyhSXvy4/8Hz51RYWr8sn/vZyc03f4IPVH5mDx5GY 3n5s54FCYhQ3H9UG4eQmRsO43xcjq8sw9yaarEaQVxfnZ7VHKOtkXAreK/l0okL2rBOE k79w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=t5wVSTLROhkU8HXqMP/abdw9XRrdz4zSxZcZ0lfDfuM=; b=Ye4Awgs4FslmoKxunPbg2Drb0+gwDso3gQ7ozx+SNELiu7UO21I/pTox031I9Nbsdt 7vWNr8oxkREjMHGBYO3bVTHmr2SxT3fzbRxEitsjVxhAIB56TYgI+H1rLBeKSDSYGanq s1jWjsZPtQYBR+/djZmaXpCubAeH1MUr54isk62tak/rtT6sxcV9QGFKENvS1BH7I+m7 mNKbI1r7cXF/NHjUulbm8eHwHoVTof0WwxApG49qFsLENEEriP9lQdDum0rQJQ4MfNnv JJmqJXx69nLpv2NrWbUWAgiJWYfXLHh6unNsAJw66yfZu+bDcQejNF2T85XG1ccwYhH4 5B8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NZf6IJed; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f21-20020a056a0022d500b0051cb8b91215si5823424pfj.293.2022.06.16.23.46.10; Thu, 16 Jun 2022 23:46:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NZf6IJed; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1380298AbiFQGo1 (ORCPT + 99 others); Fri, 17 Jun 2022 02:44:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380215AbiFQGo0 (ORCPT ); Fri, 17 Jun 2022 02:44:26 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2274D248E3 for ; Thu, 16 Jun 2022 23:44:25 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id u2so3421162pfc.2 for ; Thu, 16 Jun 2022 23:44:25 -0700 (PDT) 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; bh=t5wVSTLROhkU8HXqMP/abdw9XRrdz4zSxZcZ0lfDfuM=; b=NZf6IJedrYbVqQt0JF0bEjSf1suhLv4Jknt7JX739ATYEU+n8RKZoMUgYH13SnYHBS 93mmyPmsBXZppn/Uoz58gqhKrwlrjdOZy7lOWMJ6x06mc67pc+W9ZVdztz4f+F4tQ3Gz 78f7TY2Zu4DS6ZbRbqwyKQb29pzJM4x/6PVOUqYVdoA5sOgL0L+106tP1lizZ7fth9Dm 5QigGOEVEUvf3F5gEHhNyFQrwhxmhfPI4VAhfR45UeUY+cVV4JfNZQyYkWuH3Tu/ChTG DkJmAMzMN8KYEhFajeEXyjgkhFmIZIXds703WBqLln8kY9XXOC98HigIlyo/ntR3f2MX fwBQ== 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; bh=t5wVSTLROhkU8HXqMP/abdw9XRrdz4zSxZcZ0lfDfuM=; b=19ZA/IcEERDKLak2aM8xk7jtPf4sNfvUTV4ANITWoshigSyh7NqkVFmnVQhx+fTR/+ GQhr4XS2czWixbTMweeVNezdg2XLt005I1lli6oqg7Rj97f9ThnbFULP1sm/cKyd9MUl e1PLJ/AMKsqcw0etD3B+NjcYiWk3OpPtgnXzPPr5R2W4llPfsacZ9XFwgZ6NwIM9pjgg cXny2dg2i2rvvkJZ/heLNwnk+NcdbRR3XyXnMklFYYeWX4Y75IzJjeQmsj5fxQamqYXr GEelPCTbR0NCWuH7SYDKLy5C0IPMbDYmBZ2ZTUHUN2eSkGrGdjb7aoKiujg/kJ5ImxPn m+yg== X-Gm-Message-State: AJIora9nKGdLuTLk+yJw+CbcWABTLhEw7/X9Q02Q9blRf20me7CoiUtE Ygnc1moufM6SYKtv1Y3igC83Uw== X-Received: by 2002:a63:b105:0:b0:3fd:a875:d16 with SMTP id r5-20020a63b105000000b003fda8750d16mr7824743pgf.209.1655448264630; Thu, 16 Jun 2022 23:44:24 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id p15-20020a1709027ecf00b00165103c9903sm2731643plb.113.2022.06.16.23.44.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jun 2022 23:44:24 -0700 (PDT) Date: Fri, 17 Jun 2022 12:14:21 +0530 From: Viresh Kumar To: Vladimir Zapolskiy Cc: Stephen Boyd , linux-kernel@vger.kernel.org, patches@lists.linux.dev, linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, "Rafael J. Wysocki" , Rob Clark , Bjorn Andersson , Dmitry Baryshkov Subject: Re: [PATCH] cpufreq: qcom-hw: Don't do lmh things without a throttle interrupt Message-ID: <20220617064421.l4vshytmqtittzee@vireshk-i7> References: <20220616224531.3139080-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 17-06-22, 03:21, Vladimir Zapolskiy wrote: > On 6/17/22 01:45, Stephen Boyd wrote: > > Offlining cpu6 and cpu7 and then onlining cpu6 hangs on > > sc7180-trogdor-lazor because the throttle interrupt doesn't exist. > > Similarly, things go sideways when suspend/resume runs. That's because > > the qcom_cpufreq_hw_cpu_online() and qcom_cpufreq_hw_lmh_exit() > > functions are calling genirq APIs with an interrupt value of '-6', i.e. > > -ENXIO, and that isn't good. > > > > Check the value of the throttle interrupt like we already do in other > > functions in this file and bail out early from lmh code to fix the hang. > > > > Reported-by: Rob Clark > > Cc: Vladimir Zapolskiy > > Cc: Bjorn Andersson > > Cc: Dmitry Baryshkov > > Fixes: a1eb080a0447 ("cpufreq: qcom-hw: provide online/offline operations") > > Signed-off-by: Stephen Boyd > > --- > > drivers/cpufreq/qcom-cpufreq-hw.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c > > index 0253731d6d25..36c79580fba2 100644 > > --- a/drivers/cpufreq/qcom-cpufreq-hw.c > > +++ b/drivers/cpufreq/qcom-cpufreq-hw.c > > @@ -442,6 +442,9 @@ static int qcom_cpufreq_hw_cpu_online(struct cpufreq_policy *policy) > > struct platform_device *pdev = cpufreq_get_driver_data(); > > int ret; > > + if (data->throttle_irq <= 0) > > + return 0; > > + > > ret = irq_set_affinity_hint(data->throttle_irq, policy->cpus); > > if (ret) > > dev_err(&pdev->dev, "Failed to set CPU affinity of %s[%d]\n", > > @@ -469,6 +472,9 @@ static int qcom_cpufreq_hw_cpu_offline(struct cpufreq_policy *policy) > > static void qcom_cpufreq_hw_lmh_exit(struct qcom_cpufreq_data *data) > > { > > + if (data->throttle_irq <= 0) > > + return; > > + > > free_irq(data->throttle_irq, data); > > } > > > Reviewed-by: Vladimir Zapolskiy Applied. Thanks. -- viresh