From patchwork Sat Oct 9 02:20:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 12547261 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76572C433F5 for ; Sat, 9 Oct 2021 03:09:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3665B60FC1 for ; Sat, 9 Oct 2021 03:09:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3665B60FC1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uwYt1LbcutwbTHmo21nE6BAa4F3WOOaI7MOYHYOC3yU=; b=2ccyXAClKKGJd5 9FHg77/zmArceHsh3kvNxOHPX1rgPMzOvbf4JqZE2fJOrLbXUnI5/kTmu5606QQItkCtjiDI1jBAr 7d5vhdgRN+Eqkuf8hRF7BKt21mFgP4z44IPKHxW5opzah7ldG6Eqb2r6fzPCU6d1OWyocEqgRiyf9 lVe/VfU2MuoItgXAiRpOujqj7jAF4oOQAxVnyyOv6TBtGdnEVMpIXtcTZhoXs8GqlsUXgZzV4vTvM OuQGMYHizPnw+gkzdpbflJ5nQJqoDNYAZs+AJzK96jE1iDYh7TcEZeMZciuz5M4Y3FJP+Bjc9nLRw fkqlWZF5OW0L2iWXIMug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZ2hq-004pny-UC; Sat, 09 Oct 2021 03:07:28 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZ1yY-004Xtx-44 for linux-arm-kernel@lists.infradead.org; Sat, 09 Oct 2021 02:20:39 +0000 Received: by mail-pj1-x1033.google.com with SMTP id na16-20020a17090b4c1000b0019f5bb661f9so9151922pjb.0 for ; Fri, 08 Oct 2021 19:20:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eUj8nxm+KdP0d5VfXzrEXZEp4lkprKHXeVwPIifh+Cg=; b=c3kSTNU5BJ5QJ8JFiLbKzy/A99Z9toAXdm8flW49HTdq+mK8b6A7ui+km1TYuw8W+N 5+vQc53uz6VTLSSGmQd3YezfNXwoErRNKVSe0OKKkNje2y9rvVwCQHfRFqiejMI91MWY 1ntrMG6PNrlUvm6tyTuQIPpftoTaATluQibOUCeOfx9gLuSQ7+lzSWvEaJFxHcpgYO5h We7BGG2kamEbC2Cg+uMSjwJoSd/CgEqTvCjM0FB5Gj/lBa4MEP/WKQd/L5ZmjLJt4/0t bh2DjPtu8X0s+rEjCTZcKOagnohQmQ6OSCa1fqKmZ0+QwBJE369PCCeoHqNlkl+comGp FEpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eUj8nxm+KdP0d5VfXzrEXZEp4lkprKHXeVwPIifh+Cg=; b=5cvYuTWdN9N/JVZRdq5Yqkkk/RgAYn7cJXo5JFlJFkRLHZshLiHVdbOvbio4qZHynl EsteNbxvrtz//6pfVw/kau9EzDEDvg+LZfCRW+kKHIrpRt0GbiyRJ4g5MbJIy/G+4oJK Rt5cBJfWyMUEdswHuepSRiS808WnpUtCGvh0y7x2xy5M2do4FGkvJUyPDFrW5MNkDcOc HRhavllbpU/+b0thpGJilvcPa1PqYgCJnN6utejI1vvlmb0F1J9GCgxOAeyDnl7NE7RW 6FxBgCc4O2x5fG/K/QjMB96C0guDk12JUdD/V2XMg/bZfeMLopLEQJEDS40O8bOPE5tA glmQ== X-Gm-Message-State: AOAM533a+UKB9pE4/gSYWuCSoC7olaQy3qGQCpiawZYYWNqLR92YRjAu D3UIzJw30Zbijk4g5OU51P4= X-Google-Smtp-Source: ABdhPJylbltqq722kc9cPzBDT4GPP7LV4CG7AB61SJI6JZWdbUgJzjWWOuuGBYhxg/9m938uUnCb/Q== X-Received: by 2002:a17:902:f691:b0:13f:2034:7613 with SMTP id l17-20020a170902f69100b0013f20347613mr2540590plg.81.1633746036946; Fri, 08 Oct 2021 19:20:36 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id pi9sm444692pjb.31.2021.10.08.19.20.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 19:20:36 -0700 (PDT) From: Florian Fainelli To: linux-kernel@vger.kernel.org Cc: Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com (maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...), Russell King , Catalin Marinas , Will Deacon , Thomas Bogendoerfer , Thomas Gleixner , Marc Zyngier , Rob Herring , Frank Rowand , linux-arm-kernel@lists.infradead.org (moderated list:ARM SUB-ARCHITECTURES), linux-mips@vger.kernel.org (open list:MIPS), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE) Subject: [PATCH v4 05/14] irqchip/irq-bcm7038-l1: Restrict affinity setting to MIPS Date: Fri, 8 Oct 2021 19:20:14 -0700 Message-Id: <20211009022023.3796472-6-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211009022023.3796472-1-f.fainelli@gmail.com> References: <20211009022023.3796472-1-f.fainelli@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211008_192038_216858_BF4EBED9 X-CRM114-Status: GOOD ( 17.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Only MIPS based platforms using this interrupt controller as first level interrupt controller can actually change the affinity of interrupts by re-programming the affinity mask of the interrupt controller and use another word group to have another CPU process the interrupt. When this interrupt is used as a second level interrupt controller on ARM/ARM64 there is no way to change the interrupt affinity. This fixes a NULL pointer de-reference while trying to change the affinity since there is only a single word group in that case, and we would have been overruning the intc->cpus[] array. Signed-off-by: Florian Fainelli --- drivers/irqchip/irq-bcm7038-l1.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/irqchip/irq-bcm7038-l1.c b/drivers/irqchip/irq-bcm7038-l1.c index 3c4e348c661e..357570dd8780 100644 --- a/drivers/irqchip/irq-bcm7038-l1.c +++ b/drivers/irqchip/irq-bcm7038-l1.c @@ -191,6 +191,7 @@ static void bcm7038_l1_mask(struct irq_data *d) raw_spin_unlock_irqrestore(&intc->lock, flags); } +#if defined(CONFIG_MIPS) && defined(CONFIG_SMP) static int bcm7038_l1_set_affinity(struct irq_data *d, const struct cpumask *dest, bool force) @@ -217,6 +218,7 @@ static int bcm7038_l1_set_affinity(struct irq_data *d, return 0; } +#endif static int __init bcm7038_l1_init_one(struct device_node *dn, unsigned int idx, @@ -365,7 +367,9 @@ static struct irq_chip bcm7038_l1_irq_chip = { .name = "bcm7038-l1", .irq_mask = bcm7038_l1_mask, .irq_unmask = bcm7038_l1_unmask, +#if defined(CONFIG_SMP) && defined(CONFIG_MIPS) .irq_set_affinity = bcm7038_l1_set_affinity, +#endif #ifdef CONFIG_PM_SLEEP .irq_set_wake = bcm7038_l1_set_wake, #endif