Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp12211108rwb; Sat, 26 Nov 2022 06:04:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf5seZPqJy8cibixXvWTSAE7UEmewW+RElIodu0GD968Zsew/KAKrIF1uuOQvAN3Edrug7/k X-Received: by 2002:a17:90b:3941:b0:215:db2e:bb17 with SMTP id oe1-20020a17090b394100b00215db2ebb17mr45847280pjb.166.1669471439884; Sat, 26 Nov 2022 06:03:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669471439; cv=none; d=google.com; s=arc-20160816; b=DaFeSyo9gi4q0Tp5Yso0829Tc+08d3f/nOc6gdKfR89YaqmF1NAmgAG6Pr/ovV/NbX 31I0/Sm6rqqycuifrLkRfPniV/ifc+mE53NfezanI5CqplGY5bEVqCo22dwo0V6GUaJ4 21B3V3sPV+6EljVW+5OxYL5YUyeC/QvPYM9xOaq3XFkEnMqhRJtt6YJxJkWFCrzud5I7 iIkbcniKbGCUOkk7sDtoP8BgIYNPllHxuq1aCdURWE5UJuE/L9sdpJsxX5v2IDLG/SBI Gj69VAre277+LRC4tLlNrcJHYcMs1ujW0VXbjRxSIo8CvPYcNoWlKE6wy6a86CgHxPSg sERg== 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=z+aAeOvcokyixQe3HMWUXwl0ngwH7WlfNDdh9p82BLM=; b=oZ4BEIzAw4JJ2Ls98UlUmtD03oR9CZuwu4b9k8FFeqrShFnQ1rGANWZcFht3PKl15W YjbmvcuSMuGcu6nB6pEGvyfR5Wbb5pgP2Enix2LfoS6VSLj1QVxrJk8WdMzTe44XTsdz +MsVMZeV7ag47AmF9Z1ANPxtJwEyuxTeDcuIetySPQUszHHSBGOOqA3771pysrPHfH2m TXgkz2hhQy47lAUehRYqNWMm75VeDVxy5tmaq38Ae64PobxYifZStdLfTMpwqRyXCKSx C1v0FyuVxAd+T5ikyoQMtGYY9kNjuHBAp4jynFiFyfnqgoOAa8VQxQxVyY9qThPcAEFi V80A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=NYJfXhH6; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=oBiWBLBP; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q13-20020a170902f78d00b001789a178e33si6942523pln.428.2022.11.26.06.03.49; Sat, 26 Nov 2022 06:03:59 -0800 (PST) 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=NYJfXhH6; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=oBiWBLBP; 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 S229801AbiKZNfk (ORCPT + 84 others); Sat, 26 Nov 2022 08:35:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229676AbiKZNfM (ORCPT ); Sat, 26 Nov 2022 08:35:12 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF7D92180B for ; Sat, 26 Nov 2022 05:34:47 -0800 (PST) Date: Sat, 26 Nov 2022 13:34:44 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669469686; 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=z+aAeOvcokyixQe3HMWUXwl0ngwH7WlfNDdh9p82BLM=; b=NYJfXhH6c1xpPWbIhzxbwEgl8qrRfYSghEpr94k3wG+sIomCJWw0OdZENrlVTkIccga4iS Yvsjl1Jgl40GM20KD8qKqlFPex3W/TukTGS0SUdF7KIyX/nuaeq0FgAZqan7L0cV/dt4Tl pzLDvnn42NfFMlUH6vhOvQSFQK3NLZ836LhfCOn0l4IdTuSggq2EOR0fGrumOtNgqBYmUE HhgvBCyUEJdUj69+5+uAPRK+mWDQaEB0TbCm2GXIK5/vq16BVRyL2vKkSiv30+We3hA8NU XhhnrdozCT7nyLgikrFyCJBF0mBZ8akiBXA++6HrS7UVwl2jHGKQE5Q6fTmdRQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669469686; 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=z+aAeOvcokyixQe3HMWUXwl0ngwH7WlfNDdh9p82BLM=; b=oBiWBLBPKrlmHbmx5/i4LD3BzBj7Ymq3lr6EGlCVuwq3QE0BFPiXaTXo4bwGlTI5fnoB/3 7qu6ZPpTktiukXDQ== From: "irqchip-bot for Jianmin Lv" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Subject: [irqchip: irq/irqchip-next] ACPI / PCI: fix LPIC IRQ model default PCI IRQ polarity Cc: Jianmin Lv , Huacai Chen , Marc Zyngier , tglx@linutronix.de In-Reply-To: <20221022075955.11726-2-lvjianmin@loongson.cn> References: <20221022075955.11726-2-lvjianmin@loongson.cn> MIME-Version: 1.0 Message-ID: <166946968496.4906.3078056706775236509.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 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 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 The following commit has been merged into the irq/irqchip-next branch of irqchip: Commit-ID: d0c50cc4b957b2cf6e43cec4998d212b5abe9220 Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/d0c50cc4b957b2cf6e43cec4998d212b5abe9220 Author: Jianmin Lv AuthorDate: Sat, 22 Oct 2022 15:59:52 +08:00 Committer: Marc Zyngier CommitterDate: Sat, 26 Nov 2022 12:57:18 ACPI / PCI: fix LPIC IRQ model default PCI IRQ polarity On LoongArch based systems, the PCI devices (e.g. SATA controllers and PCI-to-PCI bridge controllers) in Loongson chipsets output high-level interrupt signal to the interrupt controller they are connected (see Loongson 7A1000 Bridge User Manual v2.00, sec 5.3, "For the bridge chip, AC97 DMA interrupts are edge triggered, gpio interrupts can be configured to be level triggered or edge triggered as needed, and the rest of the interrupts are level triggered and active high."), while the IRQs are active low from the perspective of PCI (see Conventional PCI spec r3.0, sec 2.2.6, "Interrupts on PCI are optional and defined as level sensitive, asserted low."), which means that the interrupt output of PCI devices plugged into PCI-to-PCI bridges of Loongson chipset will be also converted to high-level. So high level triggered type is required to be passed to acpi_register_gsi() when creating mappings for PCI devices. Signed-off-by: Jianmin Lv Reviewed-by: Huacai Chen Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20221022075955.11726-2-lvjianmin@loongson.cn --- drivers/acpi/pci_irq.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index 08e1577..ff30cec 100644 --- a/drivers/acpi/pci_irq.c +++ b/drivers/acpi/pci_irq.c @@ -387,13 +387,15 @@ int acpi_pci_irq_enable(struct pci_dev *dev) u8 pin; int triggering = ACPI_LEVEL_SENSITIVE; /* - * On ARM systems with the GIC interrupt model, level interrupts + * On ARM systems with the GIC interrupt model, or LoongArch + * systems with the LPIC interrupt model, level interrupts * are always polarity high by specification; PCI legacy * IRQs lines are inverted before reaching the interrupt * controller and must therefore be considered active high * as default. */ - int polarity = acpi_irq_model == ACPI_IRQ_MODEL_GIC ? + int polarity = acpi_irq_model == ACPI_IRQ_MODEL_GIC || + acpi_irq_model == ACPI_IRQ_MODEL_LPIC ? ACPI_ACTIVE_HIGH : ACPI_ACTIVE_LOW; char *link = NULL; char link_desc[16];