Message ID | 20221022075955.11726-3-lvjianmin@loongson.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1141454wrr; Sat, 22 Oct 2022 03:28:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM61RzIcOwEWHFuB5lIv2KMUXZJ2LRFsuk2NzgKXJDs27MtnEEGI1FtuTE6ql3PBoO8dEuzc X-Received: by 2002:a17:907:a47:b0:79e:56dc:5373 with SMTP id be7-20020a1709070a4700b0079e56dc5373mr4674268ejc.148.1666434517425; Sat, 22 Oct 2022 03:28:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666434517; cv=none; d=google.com; s=arc-20160816; b=H4zeLWXISaxo3np7kkSLA/OziOkEBqLEJcLT1K2QpWCoBCKbzu8a91XiWLer61n2PG U1aJJsl1XM18CFgylwCSJoy3MExSrrC/cUU/5q+RujTjkWuI2iET8ixUaX8KcVrjerkF XvAxJ0yZVXBgJgXxK055BdmsKWg6GDd+w5PTLf/HxmwabRAbGqK3oWEx+FEYoaRxoEtG ooRLgEDRow04kxrkk5ZJbxibCmc2bZ5CsyzDK70cWW/4usTOPum3OV57hd4/ekFM1pzL /43K2krf2yTiWo0M5+iHnE7Y0ixA84ajbZDAmNawIom09jwOnlYsCbuvd6WhJI4vt+dE uQSw== 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=zgOd34BXqS87z+6TAGzoILQvVlwJSiusbLJmO87vHak=; b=1ARcgqWZGvVUXf0tzfnlSBSzXHdS8JAK38FPYA/e9MM/8D3DKekGHe7GanLU2zDKdD 4z6cez9QokcZWp7FZfpvz8piO6rg1bU/bbenGK5flmw2Eks92cOjdCoPPtPjRpzDWSC2 +BYe3kpgwA+3WbLzwqpbnrqideKBfW1K7Fg3RQIkOpoOxXfmVGg0AFkwoMoireXsxt8O AodJfvhxhZBgzOjBZYn9qVFIZ9r/dnVAfXDoNYj21qOFlca3+r1R3NC1jUvD+Y2E4//x Qd1wQDVFSSX40lkF/RNJtjY1CqMpcCqWUHUmfZx1wJsqepu1J1UORCuGIOnP0qOD4XHs H4RQ== 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 ds1-20020a170907724100b0078e18bd3073si23066670ejc.820.2022.10.22.03.28.12; Sat, 22 Oct 2022 03:28:37 -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 S230407AbiJVK01 (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Sat, 22 Oct 2022 06:26:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230160AbiJVKZm (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 22 Oct 2022 06:25:42 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E098930A40E; Sat, 22 Oct 2022 02:41:19 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.32]) by gateway (Coremail) with SMTP id _____8Bxnrf8olNjMp0BAA--.2161S3; Sat, 22 Oct 2022 15:59:56 +0800 (CST) Received: from loongson-pc.loongson.cn (unknown [10.20.42.32]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Dx_1f7olNjLlUDAA--.13337S4; Sat, 22 Oct 2022 15:59:55 +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, Jiaxun Yang <jiaxun.yang@flygoat.com>, Huacai Chen <chenhuacai@loongson.cn>, Bjorn Helgaas <bhelgaas@google.com>, Len Brown <lenb@kernel.org>, rafael@kernel.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org Subject: [PATCH V5 2/4] irqchip/loongson-pch-pic: fix translate callback for DT path Date: Sat, 22 Oct 2022 15:59:53 +0800 Message-Id: <20221022075955.11726-3-lvjianmin@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20221022075955.11726-1-lvjianmin@loongson.cn> References: <20221022075955.11726-1-lvjianmin@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8Dx_1f7olNjLlUDAA--.13337S4 X-CM-SenderInfo: 5oymxthqpl0qxorr0wxvrqhubq/ X-Coremail-Antispam: 1Uk129KBjvdXoW7Xr15GF4rZr43JFyxZF1rCrg_yoWktFb_uF 1SqFn3Kw17Zr1Iq3y8Kr4rXF9rta4Du3WvkFs5Aay5GayUXayxAr1Svw4fJa9rGFWUAF1f C395ur1xZF4I9jkaLaAFLSUrUUUU0b8apTn2vfkv8UJUUUU8wcxFpf9Il3svdxBIdaVrn0 xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUY C7kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3w AFIxvE14AKwVWUXVWUAwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK 6xIIjxv20xvE14v26r4j6ryUM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j6F4UM28EF7 xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gr1j6F4UJwAa w2AFwI0_JF0_Jw1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44 I27wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jw0_WrylYx0Ex4A2 jsIE14v26r4j6F4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCY1x0262 kKe7AKxVWUAVWUtwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwCFI7km 07C267AKxVWUAVWUtwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r 1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVW8 JVW5JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r 1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1U YxBIdaVFxhVjvjDU0xZFpf9x07jz5lbUUUUU= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, 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: <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?1747383240328938743?= X-GMAIL-MSGID: =?utf-8?q?1747383240328938743?= |
Series |
irqchip: Support to set irq type for ACPI path
|
|
Commit Message
吕建民
Oct. 22, 2022, 7:59 a.m. UTC
In DT path of translate callback, if fwspec->param_count==1
and of_node is non-null, fwspec->param[1] will be accessed,
which is introduced from previous commit bcdd75c596c8
(irqchip/loongson-pch-pic: Add ACPI init support).
Before the patch, for non-null of_node, translate callback
(use irq_domain_translate_twocell()) will return -EINVAL if
fwspec->param_count < 2, so the check in the patch is added.
Fixes: bcdd75c596c8 ("irqchip/loongson-pch-pic: Add ACPI init support")
Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn>
---
drivers/irqchip/irq-loongson-pch-pic.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/irqchip/irq-loongson-pch-pic.c b/drivers/irqchip/irq-loongson-pch-pic.c index c01b9c257005..03493cda65a3 100644 --- a/drivers/irqchip/irq-loongson-pch-pic.c +++ b/drivers/irqchip/irq-loongson-pch-pic.c @@ -159,6 +159,9 @@ static int pch_pic_domain_translate(struct irq_domain *d, return -EINVAL; if (of_node) { + if (fwspec->param_count < 2) + return -EINVAL; + *hwirq = fwspec->param[0] + priv->ht_vec_base; *type = fwspec->param[1] & IRQ_TYPE_SENSE_MASK; } else {