Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4341752pxu; Tue, 20 Oct 2020 14:42:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfatBdZfZRbjUqKEEVIwcUThL94WeEaIz8hoI9YG2eF8RCULWjTdtYya0EZlmdkaQSlRQk X-Received: by 2002:a17:906:7f05:: with SMTP id d5mr205324ejr.362.1603230130312; Tue, 20 Oct 2020 14:42:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603230130; cv=none; d=google.com; s=arc-20160816; b=oUQ6Hl1qRpnVMjOe66FSVVI6ygfv/mIcQaJ4HzkUOYV5w/27vBPLukDSvR1JI1xF5P G81KzFcsFzao0lULOJkRggCND3ffm9XblIPsTC1oXFdsUu08JOUO4SI/sMdPpkaITYKx QPcQrlm/+yU5yfN5xIZ2VBxl2dUqF2CpXTvhfVgUB+1ipkani7lwUbbWVr8FEe7tyRC1 vyJHbhSo6SJz83orIEVbQC78xzjOoS5Qn3RLs4+DCVR9xGO7NLcKM2LvaK4tqPRnH01Q 5vknWGtrVORyflgwp+6XftPCXbKn43e/71oQ/qg0neVgkBnloqrsXqIQw5knztZNIA8o J6HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=SUh/HgM+ua4NwVRYsXhIRglonIVZJrlor5QZYC9gpY4=; b=C/rMAiwJOAST+rSv1WoxOwr3qF5z0kia4CienGEOj+5VoA8++Pni3z1LjoClumk+7y psmSRTsneAYZaXEbooD65ErrDN5zig/JIsaJdEnYM8p2obMVe7Eic8MsTjFplQQVMlu8 yag0rrTzq30FxxUXije9wbZEEvo6Gfw9dcaNPoG9o7NWcXr8KX9LSA+ZuRhIJnrvUgXR W1I6jeIfMMojSp3VcUtwiErsRokh4khHOLVrUS0V7DJGPIiSnn8K+tUihJu9Yez/AIsk T8HOwuUfGXnMhIX9tOYlCrNbfWwgehQRJEjLsahXrg8GtG7OzBpKoEXoGxq1QMknaWoL tYkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=V77vpMhw; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k19si73408eds.17.2020.10.20.14.41.39; Tue, 20 Oct 2020 14:42:10 -0700 (PDT) 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=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=V77vpMhw; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392080AbgJTIkC (ORCPT + 99 others); Tue, 20 Oct 2020 04:40:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726763AbgJTIkB (ORCPT ); Tue, 20 Oct 2020 04:40:01 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3198DC061755 for ; Tue, 20 Oct 2020 01:40:01 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id e17so1058256wru.12 for ; Tue, 20 Oct 2020 01:40:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SUh/HgM+ua4NwVRYsXhIRglonIVZJrlor5QZYC9gpY4=; b=V77vpMhwIw+3HwH8CM2qAFK9RNuXrN0WlM5hHqoxwPYWYnGcsQZLYmrHXsTwC/b2tB sfBDlilU4lbEbEX0u1ypCLPJb9Y1vSL45IUIFn7+B2TZetoF/mN44NgeDciJrq+K7hmy 08M4MO7L0ZPiEaqz/cJbv+Wm8KnaO9sXrd1VXJ2nPkQuUVCDqE2hBMRokScAToTyxKDC xFKQSkiQ4RzVCFK2qnolRi0rcSNYvrWhV4/zej+NrE7pHpX3sH/iZ2DbVx1K/trt4sCk oY+qr4BwzBVx7M0SpACF/9PglsL8rUUtZt8amrflzFponix3FEhAa9dWoqZ/+eobe535 Qebw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SUh/HgM+ua4NwVRYsXhIRglonIVZJrlor5QZYC9gpY4=; b=pl4I8zFaK3JuPf4+LzRJ8AAkpuuZwmZZ+y3cmvcIs6f+ItXA4LHk02VfeTf4Rd4E9Z urdu9wJlnW59hfC0Zjv5eUfG+dMnN+HIS3zja8IKm/NiWAQyIcI/Q/TBX7wrarGHMroP 9jwVqJDsAzaW2lv0nJKkuEczS53T/bNFsvtdlV7wyStdnxNCxHyWLg2izp4+24mFToek La3DWvzQEcXuuwPxM78zo1BG/Qw2ntuy2F5t63h5X+jYP5Ffm+aqoIcmAIOTCK/u20Vy jiVwvyZ8fFuh8GA8c/gpNiEy8oN0f7rkbg9woWaFJ/IgDMrAUnncfNFTnRsLinopJWkT WeVw== X-Gm-Message-State: AOAM533eyRqoue3EDTVMgdlIxKDbmv2qPxOYIztm2/zrfFUVh74kP1pl PaEF24/l8bjNFId6B4UWPgb8zt2OV5LnutINb0KCIw== X-Received: by 2002:adf:80cb:: with SMTP id 69mr2124137wrl.325.1603183199773; Tue, 20 Oct 2020 01:39:59 -0700 (PDT) MIME-Version: 1.0 References: <20201020081532.2377-1-greentime.hu@sifive.com> In-Reply-To: <20201020081532.2377-1-greentime.hu@sifive.com> From: Anup Patel Date: Tue, 20 Oct 2020 14:09:48 +0530 Message-ID: Subject: Re: [PATCH] irqchip/sifive-plic: Fix broken irq_set_affinity() callback To: Greentime Hu Cc: Thomas Gleixner , Jason Cooper , Marc Zyngier , Palmer Dabbelt , Paul Walmsley , "linux-kernel@vger.kernel.org List" , linux-riscv Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 20, 2020 at 1:45 PM Greentime Hu wrote: > > It will always enable the interrupt after calling plic_set_affinity() > however it should set to it previous setting. Staying disabled or enabled. > > This patch can also fix this pwm hang issue in 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 > --- > 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 eaa3e9fe54e9..4048657ece0a 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)); > > -- > 2.28.0 > Looks good to me. Reviewed-by: Anup Patel Regards, Anup