From patchwork Sat May 20 06:38:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5ZCV5bu65rCR?= X-Patchwork-Id: 96732 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp183360vqo; Fri, 19 May 2023 23:39:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4HrXb0+p7LL4E7VAidZDWdMqabY1yvutAXPBJFgs2iCNoye5s/DwFisTad6ko2vWU5r4qY X-Received: by 2002:a17:902:d4c5:b0:1ac:6b92:70c8 with SMTP id o5-20020a170902d4c500b001ac6b9270c8mr6006625plg.48.1684564748096; Fri, 19 May 2023 23:39:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684564748; cv=none; d=google.com; s=arc-20160816; b=t9yzdkqvr1ADrGOECVMOBm5nO9ePnVhym0IRBG60UOtQfWfhhZ2y0K8p5IONFgcdaG iQV1adpxfi8EsdA9W2IL68TuW2l+Un6UW/XlO+8F7FeW0GKjS9Oap0Usha3xeoq/X6ud eOOMiaQTEIImksWfXIQLTuYWHTZCFfa40hAFZVzVaUDDoJxTHf9ahj1L8IbghjKmbxvf pP9qg/kzNvn3CFevokeTIz7UgL1YR7Ggdwgc0NjDX7EQoGveuzhMQWl1c1zPXbZYjePD gL7ivyj6hLiPKyYB8IUAvz+Tx0lp+rjbOytMy+yHsI5VUpLMjhk5Gn17zyh2kn6XAK9j C6LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=cKTyBDzdqlpOVQU4bno15c7kSsRJ86GiBx3v4w5fLdk=; b=noRDf7XNTVf5VUODdSi1bWbCmSzcd1bOjTHIDrh8CyqchUrUwJWG6dKxQvalo8vkV5 WpNcXU92ySYoD5omsOSrdkpfZ58GsxuXITQGhs8aWn2P++0Ju01Ry/3CbMPP1UItUtE6 icXcaNpnz5Ky+PrgGg8aqEnV9UvWQaGT246Snjz6xt8b8KZAQE2IuPLtUkBWPSPRF7xM 3sbenDxIh7ZFbK+aHfopSY/VVuxmqjhR7e/OGSLmoVlwD7Qvk1g0OdFxmMJro5Yi/sbV 3YHg9qMRkoZeXyktiLYFPD0XqRcVumqm/Lle1VR+lnZZppU6n7DpFZS91aAlOTkyc4yB CdtQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id iz11-20020a170902ef8b00b001a980a2b405si841813plb.471.2023.05.19.23.38.54; Fri, 19 May 2023 23:39:08 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229950AbjETGi2 (ORCPT + 99 others); Sat, 20 May 2023 02:38:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjETGi0 (ORCPT ); Sat, 20 May 2023 02:38:26 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 42ABC1A8; Fri, 19 May 2023 23:38:24 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.176]) by gateway (Coremail) with SMTP id _____8CxuOnfamhk5V4KAA--.18097S3; Sat, 20 May 2023 14:38:23 +0800 (CST) Received: from loongson-pc.loongson.cn (unknown [10.20.42.176]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxFLXaamhkd1JrAA--.51105S3; Sat, 20 May 2023 14:38:22 +0800 (CST) From: Jianmin Lv To: Thomas Gleixner , Marc Zyngier Cc: linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, Lorenzo Pieralisi , Jiaxun Yang , Huacai Chen , loongson-kernel@lists.loongnix.cn, stable@vger.kernel.org Subject: [PATCH V1 1/4] irqchip/loongson-pch-pic: Fix initialization of HT vector register Date: Sat, 20 May 2023 14:38:15 +0800 Message-Id: <20230520063818.27208-2-lvjianmin@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230520063818.27208-1-lvjianmin@loongson.cn> References: <20230520063818.27208-1-lvjianmin@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8BxFLXaamhkd1JrAA--.51105S3 X-CM-SenderInfo: 5oymxthqpl0qxorr0wxvrqhubq/ X-Coremail-Antispam: 1Uk129KBjvJXoW7AF17uFyrZr48urWftw1kXwb_yoW8uw13pa yaqa1avr4UJr4UKFy8Ga1rXFy3Ja9xC39rKa1Yyrn3Xws8Ca4DKrsrA3W0vFWxCrWUZ3W3 ZrWSvF1rC3W5AF7anT9S1TB71UUUUjDqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU bSxYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s 1l1IIY67AEw4v_Jrv_JF1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVW8JVW5JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwA2z4 x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v26r4UJVWxJr1l n4kS14v26r126r1DM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6x ACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1q6rW5McIj6I8E 87Iv67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lc7CjxV Aaw2AFwI0_JF0_Jw1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1l4IxY O2xFxVAFwI0_JF0_Jw1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGV WUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_ Gr0_Xr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rV WUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4U JbIYCTnIWIevJa73UjIFyTuYvjxU4Xo7DUUUU X-Spam-Status: No, score=1.4 required=5.0 tests=BAYES_00,RCVD_IN_SBL_CSS, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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?1766394165388886189?= X-GMAIL-MSGID: =?utf-8?q?1766394165388886189?= In a dual-bridge system based ACPI, the IRQ on PCH PIC of each bridge sent to CPU is always a zero-based number, which means that the IRQ on PCH PIC of each bridge is mapped into vector range from 0 to 63 of upstream irqchip(e.g. EIOINTC). EIOINTC N: [0 ... 63 | 64 ... 255] -------- ---------- ^ ^ | | PCH PIC N | PCH MSI N For example, the IRQ vector number of sata controller on PCH PIC of each bridge is 16, which is sent to upstream irqchip of EIOINTC when an interrupt occurs, which will set bit 16 of EIOINTC. Since hwirq of 16 on EIOINTC has been mapped to a irq_desc for sata controller during hierarchy irq allocation, the related mapped IRQ will be found through irq_resolve_mapping() in the IRQ domain of EIOINTC. So, the IRQ number set in HT vector register should be fixed to be a zero-based number. Cc: stable@vger.kernel.org Signed-off-by: Jianmin Lv Signed-off-by: liuyun Signed-off-by: liuyun Signed-off-by: Jianmin Lv --- drivers/irqchip/irq-loongson-pch-pic.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/irqchip/irq-loongson-pch-pic.c b/drivers/irqchip/irq-loongson-pch-pic.c index e5fe4d50be05..921c5c0190d1 100644 --- a/drivers/irqchip/irq-loongson-pch-pic.c +++ b/drivers/irqchip/irq-loongson-pch-pic.c @@ -401,14 +401,12 @@ static int __init acpi_cascade_irqdomain_init(void) int __init pch_pic_acpi_init(struct irq_domain *parent, struct acpi_madt_bio_pic *acpi_pchpic) { - int ret, vec_base; + int ret; struct fwnode_handle *domain_handle; if (find_pch_pic(acpi_pchpic->gsi_base) >= 0) return 0; - vec_base = acpi_pchpic->gsi_base - GSI_MIN_PCH_IRQ; - domain_handle = irq_domain_alloc_fwnode(&acpi_pchpic->address); if (!domain_handle) { pr_err("Unable to allocate domain handle\n"); @@ -416,7 +414,7 @@ int __init pch_pic_acpi_init(struct irq_domain *parent, } ret = pch_pic_init(acpi_pchpic->address, acpi_pchpic->size, - vec_base, parent, domain_handle, acpi_pchpic->gsi_base); + 0, parent, domain_handle, acpi_pchpic->gsi_base); if (ret < 0) { irq_domain_free_fwnode(domain_handle); From patchwork Sat May 20 06:38:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5ZCV5bu65rCR?= X-Patchwork-Id: 96733 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp188987vqo; Fri, 19 May 2023 23:53:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ooJ5xqgJ7FUrmqamezHtgbCCwwwgm7EpsS92jh3P1YeJGeJrZeeeycsF3kjzTufCrZ552 X-Received: by 2002:a17:902:d484:b0:1ab:1355:1a45 with SMTP id c4-20020a170902d48400b001ab13551a45mr6433339plg.30.1684565610606; Fri, 19 May 2023 23:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684565610; cv=none; d=google.com; s=arc-20160816; b=o9INqUe+f7F0MJrq9tWUaiJtdmwZ41p5kmn6Z2cjM5GzgOYsCXUoUjQkfULrhH1NHX xZJpFkCwyTqd/EXwAV1atjZlUaXYrpwh6XUEZOLV5lVWf5LXXgZu0t4oUweLjaoAW9LX vpEmPnczxdEBgWHTdPO/vvvSvaYGH7Piv+XfZTutT0x5EmHFijLm+hVq6a5qKkwZgwFs 3HGIP33bbsAcraLPTPGo3iF7skyE0bbBEZpdUngu8g5H0x8Zb9Z0PEb8NpGwvGEEe/T2 cPMfQR+FApnpMQhwg5h8XuLOuvbkNbwUq0XwEZ67MdVoqGenC3NWKfbFdlNidDvh9Z2C TjFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=DxqmnBNTi+lhzErEEfGT8WFKupMMrKFTKLZH+Y3S4W0=; b=WqWou5KxKhIakoyAilJVZweglGMUBQCIw61yy8z0G6heaEiWs+svE0mJW4GgjyoxGj khB3roAnVsY4ic8P531sBti4xr9OyQpMTRCvChp160TZfzKI+4r4x1MBNAtbc2lqc3dl /K4Wv5ttcpHqaqpENnA/O9vPjtUS36qQ0ttMH80zk3CRrgifyiv3UpzpRukUFqzgdkNJ K84sy+j1BKms0e+xWEV0of/HhjRDvzXDeOaN+DKq8uGxqcVLGqwdV9GOfyjA6jmZEuaJ GEfNBP6Y86cwoXVxXevsMQys5OKxMNrKPZrmFgdJvujl7imJe+HV637fkQVyWJB6/BWA LqiQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f17-20020a170902ce9100b001ae8b0f8491si1004272plg.454.2023.05.19.23.53.15; Fri, 19 May 2023 23:53:30 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230018AbjETGib (ORCPT + 99 others); Sat, 20 May 2023 02:38:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229960AbjETGi3 (ORCPT ); Sat, 20 May 2023 02:38:29 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AD7831AB; Fri, 19 May 2023 23:38:27 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.176]) by gateway (Coremail) with SMTP id _____8BxZ+niamhk+V4KAA--.17830S3; Sat, 20 May 2023 14:38:26 +0800 (CST) Received: from loongson-pc.loongson.cn (unknown [10.20.42.176]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxFLXaamhkd1JrAA--.51105S4; Sat, 20 May 2023 14:38:26 +0800 (CST) From: Jianmin Lv To: Thomas Gleixner , Marc Zyngier Cc: linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, Lorenzo Pieralisi , Jiaxun Yang , Huacai Chen , loongson-kernel@lists.loongnix.cn, Liu Peibao , stable@vger.kernel.org Subject: [PATCH V1 2/4] irqchip/loongson-pch-pic: Fix potential incorrect hwirq assignment Date: Sat, 20 May 2023 14:38:16 +0800 Message-Id: <20230520063818.27208-3-lvjianmin@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230520063818.27208-1-lvjianmin@loongson.cn> References: <20230520063818.27208-1-lvjianmin@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8BxFLXaamhkd1JrAA--.51105S4 X-CM-SenderInfo: 5oymxthqpl0qxorr0wxvrqhubq/ X-Coremail-Antispam: 1Uk129KBjvJXoW7uF48ZrWxXF1DCw4DJry3XFb_yoW8Cr1UpF 47uwsa9F4DAF1jyw18Gw4kW343Aa9xtFW7Ka1SyF93ur1kJ34qkF1UZF1F9r1kZrWfAFWU ZFZI9FWY9F1xAFJanT9S1TB71UUUUjDqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU bSxYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s 1l1IIY67AEw4v_Jrv_JF1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVW5JVW7JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwA2z4 x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v26r4UJVWxJr1l n4kS14v26r126r1DM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6x ACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1q6rW5McIj6I8E 87Iv67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lc7CjxV Aaw2AFwI0_JF0_Jw1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1l4IxY O2xFxVAFwI0_JF0_Jw1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGV WUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_ Xr0_Ar1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rV WUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4U JbIYCTnIWIevJa73UjIFyTuYvjxU4Xo7DUUUU X-Spam-Status: No, score=1.4 required=5.0 tests=BAYES_00,RCVD_IN_SBL_CSS, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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?1766395069925153513?= X-GMAIL-MSGID: =?utf-8?q?1766395069925153513?= From: Liu Peibao In DeviceTree path, when ht_vec_base is not zero, the hwirq of PCH PIC will be assigned incorrectly. Because when pch_pic_domain_translate() adds the ht_vec_base to hwirq, the hwirq dose not subtract the ht_vec_base when calling irq_domain_set_info(). The ht_vec_base is designed for the parent irq chip/domain of the PCH PIC. It seems not proper to deal this in callbacks of the PCH PIC domain and let's put this back like the initial commit ef8c01eb64ca ("irqchip: Add Loongson PCH PIC controller"). Fixes: bcdd75c596c8 ("irqchip/loongson-pch-pic: Add ACPI init support") Cc: stable@vger.kernel.org Signed-off-by: Liu Peibao Signed-off-by: Jianmin Lv --- drivers/irqchip/irq-loongson-pch-pic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-loongson-pch-pic.c b/drivers/irqchip/irq-loongson-pch-pic.c index 921c5c0190d1..93a71f66efeb 100644 --- a/drivers/irqchip/irq-loongson-pch-pic.c +++ b/drivers/irqchip/irq-loongson-pch-pic.c @@ -164,7 +164,7 @@ static int pch_pic_domain_translate(struct irq_domain *d, if (fwspec->param_count < 2) return -EINVAL; - *hwirq = fwspec->param[0] + priv->ht_vec_base; + *hwirq = fwspec->param[0]; *type = fwspec->param[1] & IRQ_TYPE_SENSE_MASK; } else { if (fwspec->param_count < 1) @@ -196,7 +196,7 @@ static int pch_pic_alloc(struct irq_domain *domain, unsigned int virq, parent_fwspec.fwnode = domain->parent->fwnode; parent_fwspec.param_count = 1; - parent_fwspec.param[0] = hwirq; + parent_fwspec.param[0] = hwirq + priv->ht_vec_base; err = irq_domain_alloc_irqs_parent(domain, virq, 1, &parent_fwspec); if (err) From patchwork Sat May 20 06:38:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5ZCV5bu65rCR?= X-Patchwork-Id: 96734 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp188986vqo; Fri, 19 May 2023 23:53:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4zKHuF41jeh1VhdEjlh5ktc4eJI3j3iD1bbzi6TiS2vrqd6/PlXKzgbkgHcCs8+bh1aUOn X-Received: by 2002:a17:903:2303:b0:1ae:610a:4a46 with SMTP id d3-20020a170903230300b001ae610a4a46mr6166712plh.47.1684565610605; Fri, 19 May 2023 23:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684565610; cv=none; d=google.com; s=arc-20160816; b=TGbqvmfKo0V3c9/Fg+KtRNpOMMX0gFzCYjcBP0D+C3/WcCpVkpPkR1YssE09YsK1Rw fo+kJQjmJXzjCxcYt5OvZaaRwHvF50xB2LmUORUIG3E6I4e36xMCOLIBGwqnjmXmCnsk IOQm6wBqBQkY7fHgQ7NZ8Jcu6VNFTppwtca9FotQvTvwz4xki9Ms5MZmkcS8ebWnYKFz gfXRgEwU3lVbHO6acbQOBeWjFfX47F6bNg9Ct6/Zq2O6lZR43hTAzjplm4eFrMSvkeKU v89gWYz+LTkcvDLFi45MBzrrw33z/sANYvixdra520G5nS+N4TMBZLUGrLu1abR3BkH4 g9+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=LMnyA4eKqrlVUommlWfknYHOSxZ3YTr5cCzoyNBJtWM=; b=oq1RslJA0adQZKF3yY4VVx7OeClDUSutm1WJLhzroroUifO4NP4ddV7mfsX7qpv4Il 671AJ0TtYQcqs35yZfmbJ1rQeNifvxfqYDVidbsVFVxQ4lIc2HZoQ/8YmoMjMBuni9o7 myz4V+9hXkRe5ThIVdxam82Ec+P3/lsi5k19NvnAEnIRyRUDemOEVzNhFfKSGt2UAwo1 ZM+ehS6Ldzvp2xaAQF+CrvCGHogb0Ums1PwIaP0L3/w8M38uIIY9MtocMDYiOZiBK6ZM BWqqReKZqLbnB3xjcbXHeR1Oq9eBkxmePpgtqIDNygIA20cmGV5JwkxRNGJUKOtnkwWz dwgw== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n2-20020a170902d2c200b001ae3cb42bfdsi903031plc.634.2023.05.19.23.53.15; Fri, 19 May 2023 23:53:30 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230303AbjETGig (ORCPT + 99 others); Sat, 20 May 2023 02:38:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229989AbjETGia (ORCPT ); Sat, 20 May 2023 02:38:30 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1D5C21AC; Fri, 19 May 2023 23:38:28 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.176]) by gateway (Coremail) with SMTP id _____8DxzOrkamhkB18KAA--.17949S3; Sat, 20 May 2023 14:38:28 +0800 (CST) Received: from loongson-pc.loongson.cn (unknown [10.20.42.176]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxFLXaamhkd1JrAA--.51105S5; Sat, 20 May 2023 14:38:27 +0800 (CST) From: Jianmin Lv To: Thomas Gleixner , Marc Zyngier Cc: linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, Lorenzo Pieralisi , Jiaxun Yang , Huacai Chen , loongson-kernel@lists.loongnix.cn, stable@vger.kernel.org Subject: [PATCH V1 3/4] irqchip/loongson-liointc: Fix IRQ trigger polarity Date: Sat, 20 May 2023 14:38:17 +0800 Message-Id: <20230520063818.27208-4-lvjianmin@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230520063818.27208-1-lvjianmin@loongson.cn> References: <20230520063818.27208-1-lvjianmin@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8BxFLXaamhkd1Jr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xvE42xK8VAvwI8IcIk0rV WUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4U JbIYCTnIWIevJa73UjIFyTuYvjxUcYiiDUUUU X-Spam-Status: No, score=1.4 required=5.0 tests=BAYES_00,RCVD_IN_SBL_CSS, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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?1766395069846752466?= X-GMAIL-MSGID: =?utf-8?q?1766395069846752466?= For IRQ controller INT_POLARITY regitser of Loongson-2K CPU series, '0' indicates high level or rising edge triggered IRQ, '1' indicates low level or falling edge triggered IRQ. For Loongson-3A CPU series, setting INT_POLARITY register is not supported and writting it has no effect. So trigger polarity setting shouled be fixed for Loongson-2K CPU series. Fixes: 17343d0b4039 ("irqchip/loongson-liointc: Support to set IRQ type for ACPI path") Cc: stable@vger.kernel.org Signed-off-by: Chong Qiao Signed-off-by: Jianmin Lv Signed-off-by: Chong Qiao Signed-off-by: Jianmin Lv --- drivers/irqchip/irq-loongson-liointc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/irqchip/irq-loongson-liointc.c b/drivers/irqchip/irq-loongson-liointc.c index 8d00a9ad5b00..9a9c2bf048a3 100644 --- a/drivers/irqchip/irq-loongson-liointc.c +++ b/drivers/irqchip/irq-loongson-liointc.c @@ -116,19 +116,19 @@ static int liointc_set_type(struct irq_data *data, unsigned int type) switch (type) { case IRQ_TYPE_LEVEL_HIGH: liointc_set_bit(gc, LIOINTC_REG_INTC_EDGE, mask, false); - liointc_set_bit(gc, LIOINTC_REG_INTC_POL, mask, true); + liointc_set_bit(gc, LIOINTC_REG_INTC_POL, mask, false); break; case IRQ_TYPE_LEVEL_LOW: liointc_set_bit(gc, LIOINTC_REG_INTC_EDGE, mask, false); - liointc_set_bit(gc, LIOINTC_REG_INTC_POL, mask, false); + liointc_set_bit(gc, LIOINTC_REG_INTC_POL, mask, true); break; case IRQ_TYPE_EDGE_RISING: liointc_set_bit(gc, LIOINTC_REG_INTC_EDGE, mask, true); - liointc_set_bit(gc, LIOINTC_REG_INTC_POL, mask, true); + liointc_set_bit(gc, LIOINTC_REG_INTC_POL, mask, false); break; case IRQ_TYPE_EDGE_FALLING: liointc_set_bit(gc, LIOINTC_REG_INTC_EDGE, mask, true); - liointc_set_bit(gc, LIOINTC_REG_INTC_POL, mask, false); + liointc_set_bit(gc, LIOINTC_REG_INTC_POL, mask, true); break; default: irq_gc_unlock_irqrestore(gc, flags); From patchwork Sat May 20 06:38:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5ZCV5bu65rCR?= X-Patchwork-Id: 96735 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp189091vqo; Fri, 19 May 2023 23:53:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4NIpLgPnYEs9dGthj/Wg7vI7tZHAKO9f6Bx2m/3uiD071gZxp1+hcIe49HT6DqpctvbSoH X-Received: by 2002:a17:902:d4c2:b0:1ac:6c46:8c80 with SMTP id o2-20020a170902d4c200b001ac6c468c80mr6405305plg.53.1684565629947; Fri, 19 May 2023 23:53:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684565629; cv=none; d=google.com; s=arc-20160816; b=og1fCasAbZ7OyxxhuXa2XkWBkReD9BuKrsD1NNg6X0yyiPz6nsajRplH7phCXw65kb 5pVLAGlGVjGPf2U/Iucj/VMM5Sqn++7VX2lgDYYpmjgli3pN0C0NjYaR81ZZMQBnYOW5 5qlYfLO8qOIreDJ1PBK3e53TY6wdjh9Tqn2i7xDfqU2MPbB7dMSZ+bHsKdlmamBqkf7b yTC50QwDLbfQWdd5Jgw5/HZ71KHQWB/fmD+FiUBMWcG9CeoxGPVfxT7ev7LSp/TWyR3/ kolZ9ypeFVB8AFnOZMhn10Ko0NDX4Histg8SmYQYZCFvxdaUtO3JdcPMw87Vr0T0NUv+ zlLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=/3aKiemlYayG10N/6o2Jo4eIPgYwBtXA5PbKIj6gqt4=; b=YTFjmnqEiXMwEFEz9M1JoCVe9xgxDUB36iXDVDY8UohZblf+Atnj0T6Cb3YYtJc2H7 P8aWDgRVaGylIrKqj+IpmpXmqbDydQvHtsFtAx7E2IPtuMblr6QESBCy6VeRnR2eA/yL +m2esMGDpTwH1J5RNAe8uUoD3/qjQ1l2gsC8hDCcyAgNNMfl8kNtPj/Bjh/nnu+vC3y5 A+Q6tXT/ArxDfD+eRcDDSVqquGiR9IM1YZEveZwRP073sXBYMZg4XurI8AIkqj8vbQD8 8vlMKBswJOB0Xm4Vpgk1bcRmdOvuE0rq09ac6E8G6KZZU2ZDq49JfHzr+BNotrix5HWp P6SA== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ix10-20020a170902f80a00b001aade552f84si962446plb.93.2023.05.19.23.53.37; Fri, 19 May 2023 23:53:49 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230171AbjETGie (ORCPT + 99 others); Sat, 20 May 2023 02:38:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229991AbjETGia (ORCPT ); Sat, 20 May 2023 02:38:30 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 566911A8 for ; Fri, 19 May 2023 23:38:29 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.176]) by gateway (Coremail) with SMTP id _____8CxlfDkamhkD18KAA--.18223S3; Sat, 20 May 2023 14:38:28 +0800 (CST) Received: from loongson-pc.loongson.cn (unknown [10.20.42.176]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxFLXaamhkd1JrAA--.51105S6; Sat, 20 May 2023 14:38:27 +0800 (CST) From: Jianmin Lv To: Thomas Gleixner , Marc Zyngier Cc: linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, Lorenzo Pieralisi , Jiaxun Yang , Huacai Chen , loongson-kernel@lists.loongnix.cn, Yinbo Zhu Subject: [PATCH V1 4/4] irqchip/loongson-liointc: Add IRQCHIP_SKIP_SET_WAKE flag Date: Sat, 20 May 2023 14:38:18 +0800 Message-Id: <20230520063818.27208-5-lvjianmin@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230520063818.27208-1-lvjianmin@loongson.cn> References: <20230520063818.27208-1-lvjianmin@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8BxFLXaamhkd1JrAA--.51105S6 X-CM-SenderInfo: 5oymxthqpl0qxorr0wxvrqhubq/ X-Coremail-Antispam: 1Uk129KBjvdXoW7Jry3XF48ZryDXF4fuFy3Arb_yoWkGFX_WF y7Jw1kCry2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UUUUU= X-Spam-Status: No, score=1.4 required=5.0 tests=BAYES_00,RCVD_IN_SBL_CSS, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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?1766395089821920039?= X-GMAIL-MSGID: =?utf-8?q?1766395089821920039?= From: Yinbo Zhu Liointc doesn't require specific logic to work with wakeup IRQs, and no irq_set_wake callback is needed. To allow registered IRQs from liointc to be used as a wakeup-source, and ensure irq_set_irq_wake() works well, the flag IRQCHIP_SKIP_SET_WAKE should be added. Signed-off-by: Yinbo Zhu Signed-off-by: Jianmin Lv Reviewed-by: Huacai Chen --- drivers/irqchip/irq-loongson-liointc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/irqchip/irq-loongson-liointc.c b/drivers/irqchip/irq-loongson-liointc.c index 9a9c2bf048a3..dbd1ccce0fb2 100644 --- a/drivers/irqchip/irq-loongson-liointc.c +++ b/drivers/irqchip/irq-loongson-liointc.c @@ -291,6 +291,7 @@ static int liointc_init(phys_addr_t addr, unsigned long size, int revision, ct->chip.irq_mask = irq_gc_mask_disable_reg; ct->chip.irq_mask_ack = irq_gc_mask_disable_reg; ct->chip.irq_set_type = liointc_set_type; + ct->chip.flags = IRQCHIP_SKIP_SET_WAKE; gc->mask_cache = 0; priv->gc = gc;