Skip to contentSkip to conversation

Allow for qcom-pdc to be loadable as a module

PATCH Applied John Stultz 3 participants 6 messages Jul 10, 2020 – Jul 17, 2020

Subsystems (5)

v3 of 5 Applied Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v3 cover Allow for qcom-pdc to be loadable as a module

This patch series provides exports and config tweaks to allow the qcom-pdc driver to be able to be configured as a permement modules (particularlly useful for the Android Generic Kernel Image efforts).

This was part of a larger patch series, to enable qcom_scm driver to be a module as well, but I've split it out as there are some outstanding objections I still need to address with the follow-on patches, and wanted to see if progress could be made on this subset of the series in the meantime.

New in v3:
* Drop conditional usage of IRQCHIP_DECLARE as suggested by Stephen Boyd and Marc Zyngier

thanks
-john

Cc Andy Gross <[email protected]>
Cc Bjorn Andersson <[email protected]>
Cc Joerg Roedel <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Jason Cooper <[email protected]>
Cc Marc Zyngier <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Lina Iyer <[email protected]>
Cc Maulik Shah <[email protected]>
Cc Saravana Kannan <[email protected]>
Cc Todd Kjos <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

John Stultz (3):
irq: irqdomain: Export irq_domain_update_bus_token
irq: irqchip: Export irq_chip_retrigger_hierarchy and
irq_chip_set_vcpu_affinity_parent
irqchip: Allow QCOM_PDC to be loadable as a permanent module

 drivers/irqchip/Kconfig    |  2 +-
 drivers/irqchip/qcom-pdc.c | 28 +++++++++++++++++++++++++++-
 kernel/irq/chip.c          |  3 ++-
 kernel/irq/irqdomain.c     |  1 +
 4 files changed, 31 insertions(+), 3 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH v3 1/3 irq: irqdomain: Export irq_domain_update_bus_token

Add export for irq_domain_update_bus_token() so that we can allow drivers like the qcom-pdc driver to be loadable as a module.

Cc Andy Gross <[email protected]>
Cc Bjorn Andersson <[email protected]>
Cc Joerg Roedel <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Jason Cooper <[email protected]>
Cc Marc Zyngier <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Maulik Shah <[email protected]>
Cc Lina Iyer <[email protected]>
Cc Saravana Kannan <[email protected]>
Cc Todd Kjos <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 kernel/irq/irqdomain.c | 1 +
 1 file changed, 1 insertion(+)
kernel/irq/irqdomain.c +1 -0
index a4c2c915511d..ca974d965fda 100644
@@ -281,6 +281,7 @@ void irq_domain_update_bus_token(struct irq_domain *domain,
 
 	mutex_unlock(&irq_domain_mutex);
 }
+EXPORT_SYMBOL_GPL(irq_domain_update_bus_token);
 
 /**
  * irq_domain_add_simple() - Register an irq_domain and optionally map a range of irqs
Signature · 1 line
2.17.1
#2 lore raw

PATCH v3 2/3 irq: irqchip: Export irq_chip_retrigger_hierarchy and irq_chip_set_vcpu_affinity_parent

In reply to John Stultz

Add EXPORT_SYMBOL_GPL entries for irq_chip_retrigger_hierarchy() and irq_chip_set_vcpu_affinity_parent() so that we can allow drivers like the qcom-pdc driver to be loadable as a module.

Cc Andy Gross <[email protected]>
Cc Bjorn Andersson <[email protected]>
Cc Joerg Roedel <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Jason Cooper <[email protected]>
Cc Marc Zyngier <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Maulik Shah <[email protected]>
Cc Lina Iyer <[email protected]>
Cc Saravana Kannan <[email protected]>
Cc Todd Kjos <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 kernel/irq/chip.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/irq/chip.c +2 -1
index 41e7e37a0928..ba6ce66d7ed6 100644
@@ -1478,6 +1478,7 @@ int irq_chip_retrigger_hierarchy(struct irq_data *data)
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(irq_chip_retrigger_hierarchy);
 
 /**
  * irq_chip_set_vcpu_affinity_parent - Set vcpu affinity on the parent interrupt
@@ -1492,7 +1493,7 @@ int irq_chip_set_vcpu_affinity_parent(struct irq_data *data, void *vcpu_info)
 
 	return -ENOSYS;
 }
-
+EXPORT_SYMBOL_GPL(irq_chip_set_vcpu_affinity_parent);
 /**
  * irq_chip_set_wake_parent - Set/reset wake-up on the parent interrupt
  * @data:	Pointer to interrupt specific data
Signature · 1 line
2.17.1
#3 lore raw

PATCH v3 3/3 irqchip: Allow QCOM_PDC to be loadable as a permanent module

In reply to John Stultz

Allows qcom-pdc driver to be loaded as a permanent module

Also, due to the fact that IRQCHIP_DECLARE becomes a no-op when building as a module, we have to replace it with platform driver hooks explicitly.

Thanks to Saravana for his help on pointing out the IRQCHIP_DECLARE issue and guidance on a solution.

Cc Andy Gross <[email protected]>
Cc Bjorn Andersson <[email protected]>
Cc Joerg Roedel <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Jason Cooper <[email protected]>
Cc Marc Zyngier <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Maulik Shah <[email protected]>
Cc Lina Iyer <[email protected]>
Cc Saravana Kannan <[email protected]>
Cc Todd Kjos <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---
v2: Fix spelling, include order and set suppress_bind_attrs
suggested by Maulik Shah

v3: Drop conditional usage of IRQCHIP_DECLARE as suggested
by Stephen Boyd and Marc Zyngier

---
 drivers/irqchip/Kconfig    |  2 +-
 drivers/irqchip/qcom-pdc.c | 28 +++++++++++++++++++++++++++-
 2 files changed, 28 insertions(+), 2 deletions(-)
drivers/irqchip/Kconfig +1 -1
index 216b3b8392b5..cc285c1a54c1 100644
@@ -425,7 +425,7 @@ config GOLDFISH_PIC
          for Goldfish based virtual platforms.
 
 config QCOM_PDC
-	bool "QCOM PDC"
+	tristate "QCOM PDC"
 	depends on ARCH_QCOM
 	select IRQ_DOMAIN_HIERARCHY
 	help
drivers/irqchip/qcom-pdc.c +27 -1
index 6ae9e1f0819d..5b624e3295e4 100644
@@ -11,9 +11,11 @@
 #include <linux/irqdomain.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
+#include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_device.h>
+#include <linux/of_irq.h>
 #include <linux/soc/qcom/irq.h>
 #include <linux/spinlock.h>
 #include <linux/slab.h>
@@ -430,4 +432,28 @@ static int qcom_pdc_init(struct device_node *node, struct device_node *parent)
 	return ret;
 }
 
-IRQCHIP_DECLARE(qcom_pdc, "qcom,pdc", qcom_pdc_init);
+static int qcom_pdc_probe(struct platform_device *pdev)
+{
+	struct device_node *np = pdev->dev.of_node;
+	struct device_node *parent = of_irq_find_parent(np);
+
+	return qcom_pdc_init(np, parent);
+}
+
+static const struct of_device_id qcom_pdc_match_table[] = {
+	{ .compatible = "qcom,pdc" },
+	{}
+};
+MODULE_DEVICE_TABLE(of, qcom_pdc_match_table);
+
+static struct platform_driver qcom_pdc_driver = {
+	.probe = qcom_pdc_probe,
+	.driver = {
+		.name = "qcom-pdc",
+		.of_match_table = qcom_pdc_match_table,
+		.suppress_bind_attrs = true,
+	},
+};
+module_platform_driver(qcom_pdc_driver);
+MODULE_DESCRIPTION("Qualcomm Technologies, Inc. Power Domain Controller");
+MODULE_LICENSE("GPL v2");
Signature · 6 lines
2.17.1

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
Reviewed-by on the v3 series
#4 lore raw
In reply to John Stultz
Quoted 11 lines · John Stultz

This patch series provides exports and config tweaks to allow the qcom-pdc driver to be able to be configured as a permement modules (particularlly useful for the Android Generic Kernel Image efforts).

This was part of a larger patch series, to enable qcom_scm driver to be a module as well, but I've split it out as there are some outstanding objections I still need to address with the follow-on patches, and wanted to see if progress could be made on this subset of the series in the meantime.

Quoted 3 lines

New in v3:
* Drop conditional usage of IRQCHIP_DECLARE as suggested by Stephen Boyd and Marc Zyngier

This patch set looks entirely reasonable to me.

Yours,
Linus Walleij

Applied
#5 lore raw
In reply to John Stultz
Quoted 5 lines · John Stultz

This patch series provides exports and config tweaks to allow the qcom-pdc driver to be able to be configured as a permement modules (particularlly useful for the Android Generic Kernel Image efforts).

Quoted 7 lines

This was part of a larger patch series, to enable qcom_scm driver to be a module as well, but I've split it out as there are some outstanding objections I still need to address with the follow-on patches, and wanted to see if progress could be made on this subset of the series in the meantime.

[...]

Applied to irq/irqchip-5.9, thanks!

[1/3] irqdomain: Export irq_domain_update_bus_token

      commit: ce8cefa53c06cd98607125c52c91e74373a893a0
[2/3] genirq: Export irq_chip_retrigger_hierarchy and irq_chip_set_vcpu_affinity_parent
      commit: 96703f046c42f8ab15e735953cbfee572c717e2d
[3/3] irqchip/qcom-pdc: Allow QCOM_PDC to be loadable as a permanent module
      commit: 5ef7f1bbf9f56c5380c4d876655920cac92008e5

Cheers,

	M.
Signature · 7 lines
Without deviation from the norm, progress is not possible.


_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu