From patchwork Sat Oct 22 07:59:55 2022 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: 7784 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1121600wrr; Sat, 22 Oct 2022 02:29:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4cVkyKHc/WieQwThYw97F8SoGnuNEo73p+GKKzKflnSAXDkXFRhFcDdK2UR6XooGC4LeeK X-Received: by 2002:a17:907:980e:b0:78d:b6d8:f53c with SMTP id ji14-20020a170907980e00b0078db6d8f53cmr19838257ejc.70.1666430942937; Sat, 22 Oct 2022 02:29:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666430942; cv=none; d=google.com; s=arc-20160816; b=jW/C5y72XSsk+jgYmtJ3JSvAE2rIxVkUqw77aLqA8AU4SgPFbxyGrhHcn29H44Cqcy 4bn7GjTIU+u2++gpBmUtyGzQHbUUvHKTfH5yDBZGfcjnQE1l35QmuQECg0tM/2nbdJLR GlxXIbKf8UnBEq3zA76GZmESfN0hFiCEzBg5xs1ulpyK7UE4td2b15AmupyH7/B6ARZ6 K+etXEbfalJWOGh12aUY1poW7mtQFsEVBbkFLIUFb7HU7YQsM03jdUj6avuBv/Xntryc A0VCZjOkn52MTI7H5oWn41y1e7e0qiJuLwtIORn+V/lcye3YZ4oh/xpqMxZW1spMHl/o 9FEg== 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=NvBM4Q7lvcsq90N0nsp8WRhih8UGBEzZPYn3ZIequKE=; b=Luy+NO4/6NI1P4yw/d4Z/9JjSv4kLCxKrUzbM/o/qlOvRNkmf8JBlNwgtIVeaqJiSu pFqNXqn4dHPZ9U3dUvd4mk59lEQn7B9D3z9mjpM6M4lRxfo6FUE2cdPUJsHI3xKKca4c rWGdB3uEIOk9etYnlAyy2HL5LovxOILHQPzOMtxYbHXKf0OuoOdkUjrdbV3IaLxfkWD4 KzTa+jhsJyWRb28Umckx1oNM37748TGhsLYydIx+zEOANzCyTOPYpcaBBfbUe5/ynDMp akjAHrqaPsUpFc+MdyGPCgy5kctVX8Phkv7UIEs0MeUNIDxqYIJv3plj9jsIjiXAymPA vocw== 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 y10-20020aa7ccca000000b004612220a97fsi4862275edt.100.2022.10.22.02.28.38; Sat, 22 Oct 2022 02:29:02 -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 S231130AbiJVJI3 (ORCPT + 99 others); Sat, 22 Oct 2022 05:08:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233057AbiJVJHs (ORCPT ); Sat, 22 Oct 2022 05:07:48 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7DAA530071A; Sat, 22 Oct 2022 01:21:52 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.32]) by gateway (Coremail) with SMTP id _____8BxHdn8olNjPp0BAA--.6980S3; 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--.13337S6; Sat, 22 Oct 2022 15:59:56 +0800 (CST) From: Jianmin Lv To: Thomas Gleixner , Marc Zyngier Cc: linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, Jiaxun Yang , Huacai Chen , Bjorn Helgaas , Len Brown , rafael@kernel.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org Subject: [PATCH V5 4/4] irqchip/loongson-liointc: Support to set IRQ type for ACPI path Date: Sat, 22 Oct 2022 15:59:55 +0800 Message-Id: <20221022075955.11726-5-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 X-CM-TRANSID: AQAAf8Dx_1f7olNjLlUDAA--.13337S6 X-CM-SenderInfo: 5oymxthqpl0qxorr0wxvrqhubq/ X-Coremail-Antispam: 1Uk129KBjvdXoW7XF4DXF15XrWxCF4Dtry5Arb_yoWfKwc_u3 yIgwnxGa4rZF1xJr97Ww1YvrWI9aykW3WqgF45uasIy3y8W343urW7AwnxJa93KrW0vFZ7 AF1F9rySya47tjkaLaAFLSUrUUUU0b8apTn2vfkv8UJUUUU8wcxFpf9Il3svdxBIdaVrn0 xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUY C7kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3w AFIxvE14AKwVWUXVWUAwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK 6xIIjxv20xvE14v26ryj6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j6F4UM28EF7 xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gr1j6F4UJwAa w2AFwI0_JF0_Jw1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44 I27wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jw0_WrylYx0Ex4A2 jsIE14v26r4j6F4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCY1x0262 kKe7AKxVWUAVWUtwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwCFI7km 07C267AKxVWUAVWUtwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r 1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVW5 JVW7JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747379492703790566?= X-GMAIL-MSGID: =?utf-8?q?1747379492703790566?= For ACPI path, the xlate callback used IRQ_TYPE_NONE and ignored the IRQ type in intspec[1]. For supporting to set type for IRQs of the irqdomain, intspec[1] should be used to get IRQ type. Signed-off-by: Jianmin Lv --- drivers/irqchip/irq-loongson-liointc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-loongson-liointc.c b/drivers/irqchip/irq-loongson-liointc.c index 0da8716f8f24..838c8fa2d868 100644 --- a/drivers/irqchip/irq-loongson-liointc.c +++ b/drivers/irqchip/irq-loongson-liointc.c @@ -167,7 +167,12 @@ static int liointc_domain_xlate(struct irq_domain *d, struct device_node *ctrlr, if (WARN_ON(intsize < 1)) return -EINVAL; *out_hwirq = intspec[0] - GSI_MIN_CPU_IRQ; - *out_type = IRQ_TYPE_NONE; + + if (intsize > 1) + *out_type = intspec[1] & IRQ_TYPE_SENSE_MASK; + else + *out_type = IRQ_TYPE_NONE; + return 0; }