Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3087099pxm; Mon, 28 Feb 2022 11:44:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJylHmcRvTZir8Bwv6QHh3VuFczJGoDPLLKnrxrrfYZ0drUipo4QxuO4ivdfSMrfKTgWoxIc X-Received: by 2002:a63:7d1c:0:b0:373:d43f:3ab7 with SMTP id y28-20020a637d1c000000b00373d43f3ab7mr18364288pgc.425.1646077483611; Mon, 28 Feb 2022 11:44:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646077483; cv=none; d=google.com; s=arc-20160816; b=y3nhLmPE8gzlBSBu7/5m4FJEqCMWCWXUILKI1ucd5TFYkaZwqvmXHJZ+85OHVqm7RI Hy9socP1MXuXD/JVCqzkZUwaQ/nzu1s21GtElONFHgnQIlItXot6Gm6gfGUdND3dFhmJ rkYGqhxFsgR9ENBPl17DpGXfjQ+AHsDopR87SysWK35K/5/azFveVNa6eH3FUP0WqhqM CIdiznpGS5dFIgyspvuYNRO66W1syU2okUmP3IqGvqgIUlcvnt9SbGrU7Mtld7CZ31or YtZOToUV0ZKj8LnVrxu+iD1p+cbmFLP4HTDgC+82iQ8/fmb7i4rmNWuvXzD2Hb2AhkJv Drrg== 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=R8fh9wItMC/HZOdHDqIjndOOW68eWBqfUWixxFYdxCI=; b=M9So5NNUVltD8Q/dSIuWIbea3PevuOdJUhKkiBX6EzxB1UwWEE83A752+ibYV1c6NQ HBeGIjTEz/DXEGRNpMMXMcxRzBLpzuJnVNGSEKNXuq/v5wqrZl5c7YVVsLqrW/n1mSbD 1cVX8W22k6WSRRD4K+sJxsyzd0Tmq9wSnL4WhdFezzELQlxPULbkSRRgvgvo/l6H2/QT hZRdG98o+HB+k25CBYZ4FaZM9O2RuXeL2M+8ORzBdZ4v/3xlk07+0LKDbOqFQ19jFL1c TK5oPJRsJdbYWwAnWbQ9DN81tpXUEyMZp7QQMqv7jRNU39YVRbtKgDm4dhCu6rFea6Qs lqFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=UXW7TG8a; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="7k3Rl//K"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b21-20020a056a000cd500b004e196837c4fsi11134471pfv.75.2022.02.28.11.44.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 11:44:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=UXW7TG8a; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="7k3Rl//K"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 23B6BEB33B; Mon, 28 Feb 2022 11:22:30 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239372AbiB1R4p (ORCPT + 99 others); Mon, 28 Feb 2022 12:56:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239675AbiB1RxS (ORCPT ); Mon, 28 Feb 2022 12:53:18 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB570AA2E9 for ; Mon, 28 Feb 2022 09:40:47 -0800 (PST) Date: Mon, 28 Feb 2022 17:40:41 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1646070042; 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=R8fh9wItMC/HZOdHDqIjndOOW68eWBqfUWixxFYdxCI=; b=UXW7TG8agaM+nFsiEIQVs1bntfeqiGYaW/QMGpplV9bLoZzCQpMo67q/xUI4tLt+GWQYXx csCpt519M8uGm74t/peNssRIfOJhkiWO1vudwn1p8n4TUccX/Gztf5D9UNXTGU6eD/pp5l /49e5ZyQXM9bnmcGK9XKkjcUW9XH+GWWjqtC9qyXxvnijqboJjG+XxR12juIBx4N6TDi+l QP6w4vaU4rfWeajUON2jUokqkuQzZrSbvkbKfKEWLzfj9DdYvJbLMk/T3Q+TZHrHpW7DCU WfuC6CePhL8k7BcDN0XCeFXbtvyPzsST2NNUhYj6a7CSiAbh68Ifhd1dkhpTrw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1646070042; 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=R8fh9wItMC/HZOdHDqIjndOOW68eWBqfUWixxFYdxCI=; b=7k3Rl//K4tva1wkva0EU7e+SaIs3bkKpLEMpvICmYWfO9iiX9eEqvhrmx8U06glIF11byT tntbyCANODvYSYAA== From: "irqchip-bot for Marc Zyngier" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Subject: [irqchip: irq/irqchip-next] irqchip/qcom-pdc: Kill non-wakeup irqdomain Cc: Marc Zyngier , tglx@linutronix.de In-Reply-To: <20220224101226.88373-3-maz@kernel.org> References: <20220224101226.88373-3-maz@kernel.org> MIME-Version: 1.0 Message-ID: <164607004165.16921.333824015089715319.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 The following commit has been merged into the irq/irqchip-next branch of irqchip: Commit-ID: 3b26296c1c56db020100f971a39b59e3fa14491f Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/3b26296c1c56db020100f971a39b59e3fa14491f Author: Marc Zyngier AuthorDate: Thu, 24 Feb 2022 10:12:23 Committer: Marc Zyngier CommitterDate: Mon, 28 Feb 2022 17:32:25 irqchip/qcom-pdc: Kill non-wakeup irqdomain A careful look at the way the PDC driver works shows that: - all interrupts are in the same space - all interrupts are treated the same And yet the driver creates two domains based on whether the interrupt gets mapped directly or from the pinctrl code, which is obviously a waste of resources. Kill the non-wakeup domain and unify all the interrupt handling. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220224101226.88373-3-maz@kernel.org --- drivers/irqchip/qcom-pdc.c | 84 ++++--------------------------------- 1 file changed, 10 insertions(+), 74 deletions(-) diff --git a/drivers/irqchip/qcom-pdc.c b/drivers/irqchip/qcom-pdc.c index 3b214c4..5be5314 100644 --- a/drivers/irqchip/qcom-pdc.c +++ b/drivers/irqchip/qcom-pdc.c @@ -21,7 +21,6 @@ #include #include -#define PDC_MAX_IRQS 168 #define PDC_MAX_GPIO_IRQS 256 #define CLEAR_INTR(reg, intr) (reg & ~(1 << intr)) @@ -228,51 +227,6 @@ static int qcom_pdc_alloc(struct irq_domain *domain, unsigned int virq, if (ret) return ret; - ret = irq_domain_set_hwirq_and_chip(domain, virq, hwirq, - &qcom_pdc_gic_chip, NULL); - if (ret) - return ret; - - region = get_pin_region(hwirq); - if (!region) - return irq_domain_disconnect_hierarchy(domain->parent, virq); - - if (type & IRQ_TYPE_EDGE_BOTH) - type = IRQ_TYPE_EDGE_RISING; - - if (type & IRQ_TYPE_LEVEL_MASK) - type = IRQ_TYPE_LEVEL_HIGH; - - parent_fwspec.fwnode = domain->parent->fwnode; - parent_fwspec.param_count = 3; - parent_fwspec.param[0] = 0; - parent_fwspec.param[1] = pin_to_hwirq(region, hwirq); - parent_fwspec.param[2] = type; - - return irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, - &parent_fwspec); -} - -static const struct irq_domain_ops qcom_pdc_ops = { - .translate = qcom_pdc_translate, - .alloc = qcom_pdc_alloc, - .free = irq_domain_free_irqs_common, -}; - -static int qcom_pdc_gpio_alloc(struct irq_domain *domain, unsigned int virq, - unsigned int nr_irqs, void *data) -{ - struct irq_fwspec *fwspec = data; - struct irq_fwspec parent_fwspec; - struct pdc_pin_region *region; - irq_hw_number_t hwirq; - unsigned int type; - int ret; - - ret = qcom_pdc_translate(domain, fwspec, &hwirq, &type); - if (ret) - return ret; - if (hwirq == GPIO_NO_WAKE_IRQ) return irq_domain_disconnect_hierarchy(domain, virq); @@ -301,16 +255,9 @@ static int qcom_pdc_gpio_alloc(struct irq_domain *domain, unsigned int virq, &parent_fwspec); } -static int qcom_pdc_gpio_domain_select(struct irq_domain *d, - struct irq_fwspec *fwspec, - enum irq_domain_bus_token bus_token) -{ - return bus_token == DOMAIN_BUS_WAKEUP; -} - -static const struct irq_domain_ops qcom_pdc_gpio_ops = { - .select = qcom_pdc_gpio_domain_select, - .alloc = qcom_pdc_gpio_alloc, +static const struct irq_domain_ops qcom_pdc_ops = { + .translate = qcom_pdc_translate, + .alloc = qcom_pdc_alloc, .free = irq_domain_free_irqs_common, }; @@ -361,7 +308,7 @@ static int pdc_setup_pin_mapping(struct device_node *np) static int qcom_pdc_init(struct device_node *node, struct device_node *parent) { - struct irq_domain *parent_domain, *pdc_domain, *pdc_gpio_domain; + struct irq_domain *parent_domain, *pdc_domain; int ret; pdc_base = of_iomap(node, 0); @@ -383,32 +330,21 @@ static int qcom_pdc_init(struct device_node *node, struct device_node *parent) goto fail; } - pdc_domain = irq_domain_create_hierarchy(parent_domain, 0, PDC_MAX_IRQS, - of_fwnode_handle(node), - &qcom_pdc_ops, NULL); - if (!pdc_domain) { - pr_err("%pOF: GIC domain add failed\n", node); - ret = -ENOMEM; - goto fail; - } - - pdc_gpio_domain = irq_domain_create_hierarchy(parent_domain, + pdc_domain = irq_domain_create_hierarchy(parent_domain, IRQ_DOMAIN_FLAG_QCOM_PDC_WAKEUP, PDC_MAX_GPIO_IRQS, of_fwnode_handle(node), - &qcom_pdc_gpio_ops, NULL); - if (!pdc_gpio_domain) { - pr_err("%pOF: PDC domain add failed for GPIO domain\n", node); + &qcom_pdc_ops, NULL); + if (!pdc_domain) { + pr_err("%pOF: PDC domain add failed\n", node); ret = -ENOMEM; - goto remove; + goto fail; } - irq_domain_update_bus_token(pdc_gpio_domain, DOMAIN_BUS_WAKEUP); + irq_domain_update_bus_token(pdc_domain, DOMAIN_BUS_WAKEUP); return 0; -remove: - irq_domain_remove(pdc_domain); fail: kfree(pdc_region); iounmap(pdc_base);