Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3696121pxb; Mon, 24 Jan 2022 15:37:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBZsvpgkgV2fYHI3nf3xohGdOhGZiv34Oe4J7xfGhx/jXdO+sfwTYnNHEMTX38dgUK1Tik X-Received: by 2002:a17:90b:1e0e:: with SMTP id pg14mr540866pjb.235.1643067444904; Mon, 24 Jan 2022 15:37:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643067444; cv=none; d=google.com; s=arc-20160816; b=tZDe255vDys/Na9zqKQDsWgderFWL2uMCo0uty/Mf/Y1DM21UPKcQhf2uSm/YDiA70 82Zg03efp/Co7XL2hJC3QY4UFYoI/SRFVrodaDsBqkvJhk8WbtcW6RdYU3DUL0PoRMwY qfu/ldyBbq1Geqg34m6a0Cx7DqDnk8rlosFxEGKcuBkNOV2ksAUMC+HgytdPEAyDgakn +n0wxLAwmfzryAiAnNABhBueS/ys03QIQ/m/C8icG9VK/2gRIVpVmxRWtoc3JgHK6jQr LiQgSJoHZi9wrSMOfAKUlXSENqUq6LxeGxJAewBGS/j9M0TDJHpFaMiSj8XR7j0Towzg JvpA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=f3lytJAY0gZoG/y+g+tg5p/HVT96mbPjfZXPg4tuA4o=; b=Pf+F/neK9iT4wfeO7a5+BAUftNH6a2fNSWsnj2NaJtmx+yCemg1tGoGwBoXcnpsGO9 RLCceKr7itX7ILMKyUxczlP3foaloJdS/nq632qJHohWoWXf3oMUq7bkf1oh4gMY7lAe HpvDpU93OWUT6kvlnV7YkLmXKhPi3kRV+Z1KW1iGfdWyiaIRW4QKZn85r+A4SlVp65+x JELWuYwm0rCm2yCiTmWc0NyFp+lY1dYb07FlxD9uDiA+qDPgwRmX2ZB/T+akCQTTACCw oPqi9h1u+c0hKW/JBEcKm6n5P35FCVoF7gybzieHHurB+eB72kAXSrhWVyByi4rqWk82 6+bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cRgLAbuc; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 138si15033260pgc.498.2022.01.24.15.37.12; Mon, 24 Jan 2022 15:37:24 -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=@linuxfoundation.org header.s=korg header.b=cRgLAbuc; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1851298AbiAXXcU (ORCPT + 99 others); Mon, 24 Jan 2022 18:32:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1836484AbiAXWjg (ORCPT ); Mon, 24 Jan 2022 17:39:36 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10B40C054870; Mon, 24 Jan 2022 13:00:57 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C1DC9B80FA1; Mon, 24 Jan 2022 21:00:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5FE3C340E5; Mon, 24 Jan 2022 21:00:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058054; bh=MkNJ0R11zL6n7hF6vlIkD+vGmpNLfrFTWV3DUt/AYkk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cRgLAbuc26JFrl1fLWfK7k1ABfkSR6VjAxOp4EKcKaTa+pglcA1e6PO5HoAmnoq41 3mFkUZ8lBXvs/faqMtrqLVil/5plnuuj6f3y25w1xKHPZI7TwsnijtGIIwJR+dW+yM GLjdwoG9arZZaYYCfqVS3FmBZIDL3AwL7mZE+12k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vladimir Zapolskiy , Matthias Kaehlcke , Bjorn Andersson , Viresh Kumar , Sasha Levin Subject: [PATCH 5.16 0167/1039] cpufreq: qcom-hw: Fix probable nested interrupt handling Date: Mon, 24 Jan 2022 19:32:36 +0100 Message-Id: <20220124184130.833736034@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vladimir Zapolskiy [ Upstream commit e0e27c3d4e20dab861566f1c348ae44e4b498630 ] Re-enabling an interrupt from its own interrupt handler may cause an interrupt storm, if there is a pending interrupt and because its handling is disabled due to already done entrance into the handler above in the stack. Also, apparently it is improper to lock a mutex in an interrupt contex. Fixes: 275157b367f4 ("cpufreq: qcom-cpufreq-hw: Add dcvs interrupt support") Signed-off-by: Vladimir Zapolskiy Reviewed-by: Matthias Kaehlcke Reviewed-by: Bjorn Andersson Signed-off-by: Viresh Kumar Signed-off-by: Sasha Levin --- drivers/cpufreq/qcom-cpufreq-hw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c index 0138b2ec406dc..35d93361fda1a 100644 --- a/drivers/cpufreq/qcom-cpufreq-hw.c +++ b/drivers/cpufreq/qcom-cpufreq-hw.c @@ -343,9 +343,9 @@ static irqreturn_t qcom_lmh_dcvs_handle_irq(int irq, void *data) /* Disable interrupt and enable polling */ disable_irq_nosync(c_data->throttle_irq); - qcom_lmh_dcvs_notify(c_data); + schedule_delayed_work(&c_data->throttle_work, 0); - return 0; + return IRQ_HANDLED; } static const struct qcom_cpufreq_soc_data qcom_soc_data = { -- 2.34.1