Allow for qcom-pdc to be loadable as a module
Subsystems (5)
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
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
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.
--- kernel/irq/irqdomain.c | 1 + 1 file changed, 1 insertion(+)
kernel/irq/irqdomain.c +1 -0
@@ -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
PATCH v3 2/3 irq: irqchip: Export irq_chip_retrigger_hierarchy and irq_chip_set_vcpu_affinity_parent
In reply to John StultzAdd 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.
--- kernel/irq/chip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/irq/chip.c +2 -1
@@ -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
PATCH v3 3/3 irqchip: Allow QCOM_PDC to be loadable as a permanent module
In reply to John StultzAllows 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.
---
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
@@ -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
@@ -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
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_scmdriver 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 ofIRQCHIP_DECLAREas suggested by Stephen Boyd and Marc Zyngier
This patch set looks entirely reasonable to me.
Yours,
Linus Walleij
Marc Zyngier
AppliedQuoted 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_scmdriver 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: 5ef7f1bbf9f56c5380c4d876655920cac92008e5Cheers,
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