Message ID | 20230520063818.27208-3-lvjianmin@loongson.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> 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 <rfc822;ahmedalshaiji.dev@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <lvjianmin@loongson.cn> To: Thomas Gleixner <tglx@linutronix.de>, Marc Zyngier <maz@kernel.org> Cc: linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Huacai Chen <chenhuacai@loongson.cn>, loongson-kernel@lists.loongnix.cn, Liu Peibao <liupeibao@loongson.cn>, 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 Content-Transfer-Encoding: 8bit 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: <linux-kernel.vger.kernel.org> 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?= |
Series |
irqchip/loongson: Fix some loongson irqchip drivers
|
|
Commit Message
吕建民
May 20, 2023, 6:38 a.m. UTC
From: Liu Peibao <liupeibao@loongson.cn> 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 <liupeibao@loongson.cn> Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn> --- drivers/irqchip/irq-loongson-pch-pic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On 2023/5/20 14:38, Jianmin Lv wrote: > From: Liu Peibao <liupeibao@loongson.cn> > > 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 "does not have the ht_vec_base subtracted"? > 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 <liupeibao@loongson.cn> > Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn> > --- > 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)
On 2023/5/21 下午6:31, WANG Xuerui wrote: > On 2023/5/20 14:38, Jianmin Lv wrote: >> From: Liu Peibao <liupeibao@loongson.cn> >> >> 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 > > "does not have the ht_vec_base subtracted"? > Ok, I'll change it as your suggestion, thanks. >> 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 <liupeibao@loongson.cn> >> Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn> >> --- >> 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) >
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)