Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp2762525pxx; Sun, 1 Nov 2020 09:05:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJwMhXKL+MOtS116nUq2HNvl7K7dfedTHydyELz0r2CAMOdor7LPXhs9unnmaEghfIQUF6QN X-Received: by 2002:a17:906:748b:: with SMTP id e11mr2929718ejl.513.1604250325193; Sun, 01 Nov 2020 09:05:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604250325; cv=none; d=google.com; s=arc-20160816; b=eb1T2gPL4RVcHCDWM8tbwEguWvrYF0SCVT3cr4VTF/bdFNuU+zihHfjLqTBEzueXBq ITGxPvZObNTtdBzvCkTJn00g0HWRCeaVEXYSw1silTdZUgaoq8S6RXSEpePiPd1bKTRn LRiknTfwW8gbj4H+gfwDBwtuFosmDb75oMQN64+NsmyzrWw7OXtscYG7h9p0OKy5KSlq k5fZkX+u0fK6eKxEd6AX07CWR30hnPhep8bPOkaJrogSkuBNquOtE2MWGbRC5Xps0l8v 0Cu6ytsVzAAj2zT4/lW0EfKxBqnYeRwo9vCJzkl6wc42xO/0kQGxOuNc1GKUuvRx+Xjg 1tHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=dQ6lvHJD+OePwiwlrUcBRMbj79KkOxpLdVmqdVRuFgw=; b=Q7KeuIoOx6v7esOUiCJEVRv5m1CiP6XwuS0wsLwzxl/Ps0HgiAVjyem1D+XTla/Lw+ 8G7+1p0S5M7gAyvOO4/XdxQ6wd27SjornvvHnXVzUGH5GUszuU070p77ru9T05v5+cdQ zhlJrNWncvxHCkSD2zd39SOe+SkbrbD++JBq6cTwHtxLoacq168hUWKyUfedCkcZm+YB TT1gotv2lSWBw/4E/eEBaZLYVis4dc0DlYwX4sF3/+l57sJXW/vLAezAlndQu64uVAWn xtaWrlthwnuDV/d+w2Eq3DVvd9GNdDAz7hBdheG1Ws1rJeUOK6f5K627zjHAvMdAQuv9 T1xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=0YgMeVcz; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="8pDvh9/B"; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j2si9405007edj.194.2020.11.01.09.05.01; Sun, 01 Nov 2020 09:05:25 -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=@linutronix.de header.s=2020 header.b=0YgMeVcz; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="8pDvh9/B"; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727069AbgKARAN (ORCPT + 99 others); Sun, 1 Nov 2020 12:00:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727060AbgKARAM (ORCPT ); Sun, 1 Nov 2020 12:00:12 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1056DC0617A6; Sun, 1 Nov 2020 09:00:12 -0800 (PST) Date: Sun, 01 Nov 2020 17:00:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1604250010; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dQ6lvHJD+OePwiwlrUcBRMbj79KkOxpLdVmqdVRuFgw=; b=0YgMeVczDA60g9SFpklnLMW15oNjh+oeb0cGkrhbSze3LfLX5s9+WktRB3/0bjxHfzrbGH EZuxgi/XKvGIpZqCKye8iz95HdEDvLCZCUrA5TJU/ISgLGqqn3x0cU/X4pHVUBmqdU5FhM BVBS/BDw++pwK70qB1dsLgMocd65D+7tJExiaDmEJPlOCXNl6oMenOcTeyjL8zo9FO/opu 4EDc3sAhD5/sm03BlHHGj2l2Dmvm/YrZeMLk6q0FI1T5hpSsl2y/O8T0EaUKf5kxwWGdY9 WbbEuGlRPwOsyix7BRoUm7SsdIm4slXGaVBzbSZmxANYE8sc6v3Bs0QgwnRugg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1604250010; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dQ6lvHJD+OePwiwlrUcBRMbj79KkOxpLdVmqdVRuFgw=; b=8pDvh9/B1LwhsWGp5m/WD5uRVjwPJT+vftIJRcNbzZLz8biODWHIzWqdEVUdpOFUEg1eYK 7iCUjcrieE46f8Dw== From: "tip-bot2 for Greentime Hu" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/urgent] irqchip/sifive-plic: Fix broken irq_set_affinity() callback Cc: Greentime Hu , Marc Zyngier , Anup Patel , x86 , LKML In-Reply-To: <20201020081532.2377-1-greentime.hu@sifive.com> References: <20201020081532.2377-1-greentime.hu@sifive.com> MIME-Version: 1.0 Message-ID: <160425000981.397.18063893287457447572.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the irq/urgent branch of tip: Commit-ID: a7480c5d725c4ecfc627e70960f249c34f5d13e8 Gitweb: https://git.kernel.org/tip/a7480c5d725c4ecfc627e70960f249c34f5d13e8 Author: Greentime Hu AuthorDate: Tue, 20 Oct 2020 16:15:32 +08:00 Committer: Marc Zyngier CommitterDate: Sun, 25 Oct 2020 12:33:07 irqchip/sifive-plic: Fix broken irq_set_affinity() callback An interrupt submitted to an affinity change will always be left enabled after plic_set_affinity() has been called, while the expectation is that it should stay in whatever state it was before the call. Preserving the configuration fixes a PWM hang issue on the Unleashed board. [ 919.015783] rcu: INFO: rcu_sched detected stalls on CPUs/tasks: [ 919.020922] rcu: 0-...0: (0 ticks this GP) idle=7d2/1/0x4000000000000002 softirq=1424/1424 fqs=105807 [ 919.030295] (detected by 1, t=225825 jiffies, g=1561, q=3496) [ 919.036109] Task dump for CPU 0: [ 919.039321] kworker/0:1 R running task 0 30 2 0x00000008 [ 919.046359] Workqueue: events set_brightness_delayed [ 919.051302] Call Trace: [ 919.053738] [] __schedule+0x194/0x4de [ 982.035783] rcu: INFO: rcu_sched detected stalls on CPUs/tasks: [ 982.040923] rcu: 0-...0: (0 ticks this GP) idle=7d2/1/0x4000000000000002 softirq=1424/1424 fqs=113325 [ 982.050294] (detected by 1, t=241580 jiffies, g=1561, q=3509) [ 982.056108] Task dump for CPU 0: [ 982.059321] kworker/0:1 R running task 0 30 2 0x00000008 [ 982.066359] Workqueue: events set_brightness_delayed [ 982.071302] Call Trace: [ 982.073739] [] __schedule+0x194/0x4de [..] Fixes: bb0fed1c60cc ("irqchip/sifive-plic: Switch to fasteoi flow") Signed-off-by: Greentime Hu [maz: tidy-up commit message] Signed-off-by: Marc Zyngier Reviewed-by: Anup Patel Link: https://lore.kernel.org/r/20201020081532.2377-1-greentime.hu@sifive.com --- drivers/irqchip/irq-sifive-plic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c index eaa3e9f..4048657 100644 --- a/drivers/irqchip/irq-sifive-plic.c +++ b/drivers/irqchip/irq-sifive-plic.c @@ -151,7 +151,7 @@ static int plic_set_affinity(struct irq_data *d, return -EINVAL; plic_irq_toggle(&priv->lmask, d, 0); - plic_irq_toggle(cpumask_of(cpu), d, 1); + plic_irq_toggle(cpumask_of(cpu), d, !irqd_irq_masked(d)); irq_data_update_effective_affinity(d, cpumask_of(cpu));