From patchwork Mon Jul 3 19:00:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 115486 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp765152vqx; Mon, 3 Jul 2023 13:14:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4R8C93mwETB3BAWyXNY697pQvgd9p6BuvqnsA7zQVhwTWqN9obBexUETxiqq5gmkq5f0F7 X-Received: by 2002:a05:6a20:8e19:b0:12d:77e:ba3 with SMTP id y25-20020a056a208e1900b0012d077e0ba3mr15982379pzj.0.1688415244985; Mon, 03 Jul 2023 13:14:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688415244; cv=none; d=google.com; s=arc-20160816; b=SgDXmBQnnE4BF4IRPZqdXQkUHwdHXxThj8k3Jv3uSVSuJuwjkGDMaIYtXg3LtTzEVz dtDEu6uzn7Nd9mNk73azMKaddknYhtz4x/Jf6CUPip7F2MNu61fl1h4s4Ithk5FF6Xxo qDKkJdFMz4w6uXwUsWzAHGPsd1eSCRsEAGKjk1jTXUKj08Gx8bRuGxvZrK+COK/6bRhK 1mnqUmd6h/WoctRphcsYnVjMZd/1GsCComLo/YP1E2xh1ndSwTVPPgG3FSFXqXyywShj etAJDfUDeUu/wEttPXQFHY+4si1jCsN73bGnUZyUPgyAC2Hp4Wsx/lnnfBKFLCDGWork /RAw== 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=HKhXlmbNlkSzh7GXP62fqrW0/HPTfBTzxq98qGCo0nU=; fh=Q3+eeqz/S8ySW0HMMGcUsKtlkf4ts/wBgKVX4O3SZU4=; b=B0g7rkrBKfnwwY9XR56K23GpkGePMhyjYojYXIXvX/RB5bMP7nVyrkbUKbzsKOPkZk HdpnxATTGUFS8bPARlKu/nC4XaKOQqq8YCnSWb2G9h7DOWm+XUAokpi+fNpHwkdoLOPv RfE9YoqOSSpAkVtPkrYyBQnnWBAz7CvbUbO86LBb6PLkVJ3sZ9lHQn4bSsoQ9W13XFBP HyST/Knxh7mWjZe044cUue25uC0FfFoRVRv7ZwudVmdZLjUut8KyVBIPR0AFByT6LecV LBCc1q8rof1AY7XsvHgm0Ahp3g/yf67nRoS34KQknPKlq1mQDHg6EhcA5jPYSkb0q7f0 QsMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=jKxybCFz; dkim=neutral (no key) header.i=@linutronix.de; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t10-20020a17090340ca00b001b845157b69si10836755pld.414.2023.07.03.13.13.51; Mon, 03 Jul 2023 13:14:04 -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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=jKxybCFz; dkim=neutral (no key) header.i=@linutronix.de; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231487AbjGCTAj (ORCPT + 99 others); Mon, 3 Jul 2023 15:00:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230097AbjGCTAb (ORCPT ); Mon, 3 Jul 2023 15:00:31 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 190C9E6B for ; Mon, 3 Jul 2023 12:00:30 -0700 (PDT) Date: Mon, 03 Jul 2023 19:00:28 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1688410828; 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=HKhXlmbNlkSzh7GXP62fqrW0/HPTfBTzxq98qGCo0nU=; b=jKxybCFzzcdPtLRCJ37twNCwgQ1iAYUVWhoH7Sb6zWpugXxZ4MMiioegI0SzDiR4Dyo5TN FPfHIV6T2pWVRmd+vPEMtaztI64+ogpJhQHI4L9WYPSZvKNLU6ewtOohNsin7tSCG3Vphm IMuLZ+2ZEuLbV2qonhmevZOFRTUZ8DR7UBMEd8JBnpAuFGDgs52A4YmR/77M0Ihn8FYKE5 jA6Mxy7qN0DTnoh+VjfrR/1QQ7/DnbLpYuDlLrZq+R8RbYUzi/bbnU2j45ktuD27Wa0Ah9 NGW1kASYw1DiyQkxsZfyJbaP4NBbU2gfWD51tcysMwozKgi73wMSGTYOjHlrfQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1688410828; 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=HKhXlmbNlkSzh7GXP62fqrW0/HPTfBTzxq98qGCo0nU=; b=AxRnJLj/HPe1Xnxe9odqWWubGJ6mDfg4k6JA6GjYKzwz9z0VKBHsAUsazXrlguNkesJr3P cssYPH2pX6kSzNCA== From: "irqchip-bot for Jonas Gorski" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Subject: [irqchip: irq/irqchip-fixes] irq-bcm6345-l1: Do not assume a fixed block to cpu mapping Cc: Jonas Gorski , philmd@linaro.org, Florian Fainelli , Marc Zyngier , tglx@linutronix.de In-Reply-To: <20230629072620.62527-1-jonas.gorski@gmail.com> References: <20230629072620.62527-1-jonas.gorski@gmail.com> MIME-Version: 1.0 Message-ID: <168841082817.404.2381514452871552922.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770431704183251380?= X-GMAIL-MSGID: =?utf-8?q?1770431704183251380?= The following commit has been merged into the irq/irqchip-fixes branch of irqchip: Commit-ID: 55ad24857341c36616ecc1d9580af5626c226cf1 Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/55ad24857341c36616ecc1d9580af5626c226cf1 Author: Jonas Gorski AuthorDate: Thu, 29 Jun 2023 09:26:20 +02:00 Committer: Marc Zyngier CommitterDate: Mon, 03 Jul 2023 19:47:51 +01:00 irq-bcm6345-l1: Do not assume a fixed block to cpu mapping The irq to block mapping is fixed, and interrupts from the first block will always be routed to the first parent IRQ. But the parent interrupts themselves can be routed to any available CPU. This is used by the bootloader to map the first parent interrupt to the boot CPU, regardless wether the boot CPU is the first one or the second one. When booting from the second CPU, the assumption that the first block's IRQ is mapped to the first CPU breaks, and the system hangs because interrupts do not get routed correctly. Fix this by passing the appropriate bcm6434_l1_cpu to the interrupt handler instead of the chip itself, so the handler always has the right block. Fixes: c7c42ec2baa1 ("irqchips/bmips: Add bcm6345-l1 interrupt controller") Signed-off-by: Jonas Gorski Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Florian Fainelli Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230629072620.62527-1-jonas.gorski@gmail.com --- drivers/irqchip/irq-bcm6345-l1.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/irqchip/irq-bcm6345-l1.c b/drivers/irqchip/irq-bcm6345-l1.c index fa113cb..6341c01 100644 --- a/drivers/irqchip/irq-bcm6345-l1.c +++ b/drivers/irqchip/irq-bcm6345-l1.c @@ -82,6 +82,7 @@ struct bcm6345_l1_chip { }; struct bcm6345_l1_cpu { + struct bcm6345_l1_chip *intc; void __iomem *map_base; unsigned int parent_irq; u32 enable_cache[]; @@ -115,17 +116,11 @@ static inline unsigned int cpu_for_irq(struct bcm6345_l1_chip *intc, static void bcm6345_l1_irq_handle(struct irq_desc *desc) { - struct bcm6345_l1_chip *intc = irq_desc_get_handler_data(desc); - struct bcm6345_l1_cpu *cpu; + struct bcm6345_l1_cpu *cpu = irq_desc_get_handler_data(desc); + struct bcm6345_l1_chip *intc = cpu->intc; struct irq_chip *chip = irq_desc_get_chip(desc); unsigned int idx; -#ifdef CONFIG_SMP - cpu = intc->cpus[cpu_logical_map(smp_processor_id())]; -#else - cpu = intc->cpus[0]; -#endif - chained_irq_enter(chip, desc); for (idx = 0; idx < intc->n_words; idx++) { @@ -253,6 +248,7 @@ static int __init bcm6345_l1_init_one(struct device_node *dn, if (!cpu) return -ENOMEM; + cpu->intc = intc; cpu->map_base = ioremap(res.start, sz); if (!cpu->map_base) return -ENOMEM; @@ -271,7 +267,7 @@ static int __init bcm6345_l1_init_one(struct device_node *dn, return -EINVAL; } irq_set_chained_handler_and_data(cpu->parent_irq, - bcm6345_l1_irq_handle, intc); + bcm6345_l1_irq_handle, cpu); return 0; }