From patchwork Mon Nov 28 11:53:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 26685 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5609632wrr; Mon, 28 Nov 2022 04:03:56 -0800 (PST) X-Google-Smtp-Source: AA0mqf6KUhg41niPn5fF+eJzMjaHVxOwRxkg89kkroEhMLGOZpm3IndTXfWxKyerH/+yCW+vrn1t X-Received: by 2002:a17:903:3302:b0:189:9590:4f98 with SMTP id jk2-20020a170903330200b0018995904f98mr446655plb.148.1669637036242; Mon, 28 Nov 2022 04:03:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669637036; cv=none; d=google.com; s=arc-20160816; b=CM2Y4+vOQ7aJGmyC+2+JK1XSnxE0bA1lLsJRd5whYz8Do02GkL1GBUv0mBmMgb8lu8 SwpZLwRgYLmob5AQFesUVnA0BpBpOXYzdl45Ukjf7pd7v86nquR6Z9soSr0jUWzCt/jr 25rViCHgTnjEZ8suP+HMonxRu7bk0QutfIGWh8cIo8pMi7wAjxQE1IBJsXx3EUc+uxWM V/MzrMN/6wLlAJFLx/6V3R544/+Uw/wZQbk4qLBHL9RQamG6FKIHEzaxzYgS5gov1yxN sKvR0qMUAKPkfDKiw38dZnBGexfA9ZlRY2juqVcWzUcd78YFqXl22MkVFXpKzKj5NE4S YXdg== 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=YtL6Af3VEuxIb9nNzbuRAY2P4xAKy98cTKdZ26I/ZOc=; b=r3OO71VGlGh3Kx2cADmC8VL0VPp3NhfgwbG6t/9HrewpHUqysKUYlUh67gZibUuhRb XUcb0Dv9jiHVZDwjkzWgT0H9riBJQ0RshatvXrRsgVmMhBgK1cCqzb/D0eIxRQGFYqDC KgPcJ5U+RutumpDmO3A6ZqEEJwfQ20/3F4o5Olf1sV2TuqzvZM1oLQQkZJH3owdmZEyD VspiSDd75uisJIxVQASzhXCubXebxBOziMMPrKu/NljKCe86AICMMb6DE/M1OHO18Glt 7rMwpkA7V7XfMZb4t2Ijz7yCG+mdyHbjKKctN/nymkfdV8F/5w4oHaa+Cu4XZt/xCR2G 9K2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=dA3+gYir; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=335OyTM8; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a192-20020a6390c9000000b00476f4361432si12447580pge.13.2022.11.28.04.03.37; Mon, 28 Nov 2022 04:03:56 -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=dA3+gYir; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=335OyTM8; 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 S230467AbiK1Lx6 (ORCPT + 99 others); Mon, 28 Nov 2022 06:53:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229702AbiK1Lx5 (ORCPT ); Mon, 28 Nov 2022 06:53:57 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECAC2B1CC for ; Mon, 28 Nov 2022 03:53:55 -0800 (PST) Date: Mon, 28 Nov 2022 11:53:52 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669636434; 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=YtL6Af3VEuxIb9nNzbuRAY2P4xAKy98cTKdZ26I/ZOc=; b=dA3+gYirGFrVzWE9AjDbLyXKXd40FOdOA6LQdKGtdW45zp5CqsH6QFerBIRPeOf1Tww8nG QjAww+iJk0P4indm2rsiJObsL6VmExfI9EmddwaM1CC2Lvf17O+MtT8BxSn/BS6JrLhOGe vXUEl7YucssNOiYa2PqRXbT+FRZxry1uOu5AJ/TS0ehQXZLo75iukw31mi9VhGS5buFIJ2 rL17tQxKln5IFx0zn6DP2PkumS06NM1kHzAJd1BmsKikYrpPPYjd8mj41bOAKjcGLkGdkb VYKyISw1G4Iub2RrEIUU80mkSXtK4tzd7898q0jwjBbQ+9yGEAsNihra9N1E3g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669636434; 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=YtL6Af3VEuxIb9nNzbuRAY2P4xAKy98cTKdZ26I/ZOc=; b=335OyTM8u9SRutGFxaEtesnzhrENQ5FFoRI+QGiLjqPtGOIocDud8y6jEtl458kL1jJP7j lwTtNbKwoLpkTMBg== From: "irqchip-bot for Huacai Chen" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Subject: [irqchip: irq/irqchip-next] irqchip/loongarch: Adjust acpi_cascade_irqdomain_init() and sub-routines Cc: Huacai Chen , Marc Zyngier , tglx@linutronix.de In-Reply-To: <20221020142514.1725514-1-chenhuacai@loongson.cn> References: <20221020142514.1725514-1-chenhuacai@loongson.cn> MIME-Version: 1.0 Message-ID: <166963643290.4906.12034977441732808858.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747217930157610806?= X-GMAIL-MSGID: =?utf-8?q?1750741324744351619?= The following commit has been merged into the irq/irqchip-next branch of irqchip: Commit-ID: 3d12938dbc048ecb193fec69898d95f6b4813a4b Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/3d12938dbc048ecb193fec69898d95f6b4813a4b Author: Huacai Chen AuthorDate: Thu, 20 Oct 2022 22:25:14 +08:00 Committer: Marc Zyngier CommitterDate: Mon, 28 Nov 2022 11:49:31 irqchip/loongarch: Adjust acpi_cascade_irqdomain_init() and sub-routines 1, Adjust the return of acpi_cascade_irqdomain_init() and check its return value. 2, Combine unnecessary short lines to one long line. Signed-off-by: Huacai Chen Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20221020142514.1725514-1-chenhuacai@loongson.cn --- drivers/irqchip/irq-loongarch-cpu.c | 30 +++++++++++++++---------- drivers/irqchip/irq-loongson-eiointc.c | 30 ++++++++++++++----------- drivers/irqchip/irq-loongson-pch-pic.c | 15 +++++++------ 3 files changed, 44 insertions(+), 31 deletions(-) diff --git a/drivers/irqchip/irq-loongarch-cpu.c b/drivers/irqchip/irq-loongarch-cpu.c index 741612b..fdec3e9 100644 --- a/drivers/irqchip/irq-loongarch-cpu.c +++ b/drivers/irqchip/irq-loongarch-cpu.c @@ -92,18 +92,16 @@ static const struct irq_domain_ops loongarch_cpu_intc_irq_domain_ops = { .xlate = irq_domain_xlate_onecell, }; -static int __init -liointc_parse_madt(union acpi_subtable_headers *header, - const unsigned long end) +static int __init liointc_parse_madt(union acpi_subtable_headers *header, + const unsigned long end) { struct acpi_madt_lio_pic *liointc_entry = (struct acpi_madt_lio_pic *)header; return liointc_acpi_init(irq_domain, liointc_entry); } -static int __init -eiointc_parse_madt(union acpi_subtable_headers *header, - const unsigned long end) +static int __init eiointc_parse_madt(union acpi_subtable_headers *header, + const unsigned long end) { struct acpi_madt_eio_pic *eiointc_entry = (struct acpi_madt_eio_pic *)header; @@ -112,16 +110,24 @@ eiointc_parse_madt(union acpi_subtable_headers *header, static int __init acpi_cascade_irqdomain_init(void) { - acpi_table_parse_madt(ACPI_MADT_TYPE_LIO_PIC, - liointc_parse_madt, 0); - acpi_table_parse_madt(ACPI_MADT_TYPE_EIO_PIC, - eiointc_parse_madt, 0); + int r; + + r = acpi_table_parse_madt(ACPI_MADT_TYPE_LIO_PIC, liointc_parse_madt, 0); + if (r < 0) + return r; + + r = acpi_table_parse_madt(ACPI_MADT_TYPE_EIO_PIC, eiointc_parse_madt, 0); + if (r < 0) + return r; + return 0; } static int __init cpuintc_acpi_init(union acpi_subtable_headers *header, const unsigned long end) { + int ret; + if (irq_domain) return 0; @@ -139,9 +145,9 @@ static int __init cpuintc_acpi_init(union acpi_subtable_headers *header, set_handle_irq(&handle_cpu_irq); acpi_set_irq_model(ACPI_IRQ_MODEL_LPIC, lpic_get_gsi_domain_id); acpi_set_gsi_to_irq_fallback(lpic_gsi_to_irq); - acpi_cascade_irqdomain_init(); + ret = acpi_cascade_irqdomain_init(); - return 0; + return ret; } IRQCHIP_ACPI_DECLARE(cpuintc_v1, ACPI_MADT_TYPE_CORE_PIC, diff --git a/drivers/irqchip/irq-loongson-eiointc.c b/drivers/irqchip/irq-loongson-eiointc.c index 5cf4b80..d15fd38 100644 --- a/drivers/irqchip/irq-loongson-eiointc.c +++ b/drivers/irqchip/irq-loongson-eiointc.c @@ -333,9 +333,8 @@ static struct syscore_ops eiointc_syscore_ops = { .resume = eiointc_resume, }; -static int __init -pch_pic_parse_madt(union acpi_subtable_headers *header, - const unsigned long end) +static int __init pch_pic_parse_madt(union acpi_subtable_headers *header, + const unsigned long end) { struct acpi_madt_bio_pic *pchpic_entry = (struct acpi_madt_bio_pic *)header; unsigned int node = (pchpic_entry->address >> 44) & 0xf; @@ -347,9 +346,8 @@ pch_pic_parse_madt(union acpi_subtable_headers *header, return -EINVAL; } -static int __init -pch_msi_parse_madt(union acpi_subtable_headers *header, - const unsigned long end) +static int __init pch_msi_parse_madt(union acpi_subtable_headers *header, + const unsigned long end) { struct acpi_madt_msi_pic *pchmsi_entry = (struct acpi_madt_msi_pic *)header; struct irq_domain *parent = acpi_get_vec_parent(eiointc_priv[nr_pics - 1]->node, msi_group); @@ -362,17 +360,23 @@ pch_msi_parse_madt(union acpi_subtable_headers *header, static int __init acpi_cascade_irqdomain_init(void) { - acpi_table_parse_madt(ACPI_MADT_TYPE_BIO_PIC, - pch_pic_parse_madt, 0); - acpi_table_parse_madt(ACPI_MADT_TYPE_MSI_PIC, - pch_msi_parse_madt, 1); + int r; + + r = acpi_table_parse_madt(ACPI_MADT_TYPE_BIO_PIC, pch_pic_parse_madt, 0); + if (r < 0) + return r; + + r = acpi_table_parse_madt(ACPI_MADT_TYPE_MSI_PIC, pch_msi_parse_madt, 1); + if (r < 0) + return r; + return 0; } int __init eiointc_acpi_init(struct irq_domain *parent, struct acpi_madt_eio_pic *acpi_eiointc) { - int i, parent_irq; + int i, ret, parent_irq; unsigned long node_map; struct eiointc_priv *priv; @@ -419,9 +423,9 @@ int __init eiointc_acpi_init(struct irq_domain *parent, acpi_set_vec_parent(acpi_eiointc->node, priv->eiointc_domain, pch_group); acpi_set_vec_parent(acpi_eiointc->node, priv->eiointc_domain, msi_group); - acpi_cascade_irqdomain_init(); + ret = acpi_cascade_irqdomain_init(); - return 0; + return ret; out_free_handle: irq_domain_free_fwnode(priv->domain_handle); diff --git a/drivers/irqchip/irq-loongson-pch-pic.c b/drivers/irqchip/irq-loongson-pch-pic.c index 1fd015e..437f1af 100644 --- a/drivers/irqchip/irq-loongson-pch-pic.c +++ b/drivers/irqchip/irq-loongson-pch-pic.c @@ -378,9 +378,8 @@ int find_pch_pic(u32 gsi) return -1; } -static int __init -pch_lpc_parse_madt(union acpi_subtable_headers *header, - const unsigned long end) +static int __init pch_lpc_parse_madt(union acpi_subtable_headers *header, + const unsigned long end) { struct acpi_madt_lpc_pic *pchlpc_entry = (struct acpi_madt_lpc_pic *)header; @@ -389,8 +388,12 @@ pch_lpc_parse_madt(union acpi_subtable_headers *header, static int __init acpi_cascade_irqdomain_init(void) { - acpi_table_parse_madt(ACPI_MADT_TYPE_LPC_PIC, - pch_lpc_parse_madt, 0); + int r; + + r = acpi_table_parse_madt(ACPI_MADT_TYPE_LPC_PIC, pch_lpc_parse_madt, 0); + if (r < 0) + return r; + return 0; } @@ -417,7 +420,7 @@ int __init pch_pic_acpi_init(struct irq_domain *parent, } if (acpi_pchpic->id == 0) - acpi_cascade_irqdomain_init(); + ret = acpi_cascade_irqdomain_init(); return ret; }