Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp566713iog; Wed, 15 Jun 2022 07:52:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vXa9Jp9FDDC1qZ5iz9C/MDecusWnKZT/+X44OkPOWoiOhkQX4NCLvBAOkOoq+5vpubh45l X-Received: by 2002:a17:907:8a08:b0:711:d26d:71d with SMTP id sc8-20020a1709078a0800b00711d26d071dmr190964ejc.622.1655304758803; Wed, 15 Jun 2022 07:52:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655304758; cv=none; d=google.com; s=arc-20160816; b=qxmh7I5xkCqlrDYaquYdSWaeqmL+meVydTF1IAbxKOanEiEcPVq0EnVc5kgfuFW8ET tVlIzgekqNDxC1M/1ecFj7tN8AKOA/lVkoSxyDwYa6LcQCw+CboO/++s5RzjA8vfNErk KorH6qOSONwgau5Y+nIcIdA5aaWPR+dOkcXIT9GchO7U9IiTtaejBMEF54xgbZX2HXIg jnfLpj8SWJRsn2gpYZpZIaa6iCpObjOYSqSQfy30Mgp0awNjQdaE6koVVxBeU1JIKixL WbqGH1RegNtUSaJT0Mybeh/A01LdydB/mzcVsTxqr/K8JjbXeeVeLhbqBRpyi2/ibgcd NBhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=7NPzavOlwXG6/MWJuoVFGcXgUDpEOCYVKAvVjOMtda0=; b=VVTkDlovXWB56eTN0bLHC6WObS3UqVdwy/s/AONyXCRvoaE5TwVoGLHoxcfifAVFJp W2MPToHoyy6kLpLXh+Tlo++uD3DsPdcOdBcS3775am8q+I+vC1GomNkukmN/naFFZHI+ 4ODTzxVI/IqauC003IwCOClsRpybzbyhMcosnuhIRmcAEMPziHSIYZ0uAgI8Vhx3mYgo d1zNGY+n/JzGeze8h6npQ3LEIR8XkIDn1yIgHrL92G4Ubf+nWtZVHo5wnr3pTqTWIA3Y sBm9Kl/JFcRVOnH/FK3Xxne/KeebJGNotTxYZl/hmOvvUhT/IQpbI9yRCCIPkB+J7KJ5 WpdA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds14-20020a170907724e00b00711d868d144si17452508ejc.976.2022.06.15.07.52.12; Wed, 15 Jun 2022 07:52:38 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354486AbiFOOpH (ORCPT + 99 others); Wed, 15 Jun 2022 10:45:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353817AbiFOOpA (ORCPT ); Wed, 15 Jun 2022 10:45:00 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2741C3AA42; Wed, 15 Jun 2022 07:44:54 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0ED19153B; Wed, 15 Jun 2022 07:44:54 -0700 (PDT) Received: from pierre123.arm.com (unknown [10.57.5.38]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 885813F73B; Wed, 15 Jun 2022 07:44:51 -0700 (PDT) From: Pierre Gondois To: linux-kernel@vger.kernel.org Cc: Ionela.Voinescu@arm.com, Lukasz.Luba@arm.com, Dietmar.Eggemann@arm.com, Pierre Gondois , "Rafael J. Wysocki" , Viresh Kumar , Andy Gross , Bjorn Andersson , Vladimir Zapolskiy , Dmitry Baryshkov , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 2/4] cpufreq: qcom-hw: Disable LMH irq when disabling policy Date: Wed, 15 Jun 2022 16:43:19 +0200 Message-Id: <20220615144321.262773-3-pierre.gondois@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220615144321.262773-1-pierre.gondois@arm.com> References: <20220615144321.262773-1-pierre.gondois@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,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 If LMH (Limits Management Hardware) is available, when a policy is disabled by unplugging the last online CPU of policy->cpus, the LMH irq is left enabled. When the policy is re-enabled with any of the CPU in policy->cpus being plugged in, qcom_cpufreq_ready() re-enables the irq. This triggers the following warning: [ 379.160106] Unbalanced enable for IRQ 154 [ 379.160120] WARNING: CPU: 7 PID: 48 at kernel/irq/manage.c:774 __enable_irq+0x84/0xc0 Thus disable the irq. This patch also makes the check against throttle_irq consistent, 0 being theoretically valid. Fixes: a1eb080a0447 ("cpufreq: qcom-hw: provide online/offline operations") Signed-off-by: Pierre Gondois --- drivers/cpufreq/qcom-cpufreq-hw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c index 8aba73698eda..8cad3744cff4 100644 --- a/drivers/cpufreq/qcom-cpufreq-hw.c +++ b/drivers/cpufreq/qcom-cpufreq-hw.c @@ -461,7 +461,7 @@ static int qcom_cpufreq_hw_cpu_offline(struct cpufreq_policy *policy) { struct qcom_cpufreq_data *data = policy->driver_data; - if (data->throttle_irq <= 0) + if (data->throttle_irq < 0) return 0; mutex_lock(&data->throttle_lock); @@ -470,6 +470,7 @@ static int qcom_cpufreq_hw_cpu_offline(struct cpufreq_policy *policy) cancel_delayed_work_sync(&data->throttle_work); irq_set_affinity_hint(data->throttle_irq, NULL); + disable_irq_nosync(data->throttle_irq); return 0; } -- 2.25.1