irqchip: Hybrid probing
Subsystems (5)
PATCH 1/6 of: Add basic infrastructure to create early probe arrays
In reply to Marc ZyngierWe currently probe interrupt controller and timers that need to be available very early using an infratstructure that creates struct of_device_id instances in a special section. These are individual structures that are ultimately collated by the linker.
In order to facilitate further use of this infrastructure for drivers that can either be built modular or as an early driver, let's add a couple of helpers that will make it look like a "normal" device_id array, like this:
_OF_DECLARE_ARRAY_START(table, name)_OF_DECLARE_ELMT("compat-1", probe, type)_OF_DECLARE_ELMT("compat-2", probe, type)_OF_DECLARE_ELMT("compat-3", other_probe, type)_OF_DECLARE_ARRAY_END
--- include/linux/of.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
include/linux/of.h +15 -0
@@ -1291,20 +1291,35 @@ static inline int of_get_available_child_count(const struct device_node *np)return num; } +#define __OF_DECLARE_ARRAY_START (name, section) \ + static const struct of_device_id __of_table_##name[] \ + __used __section(section) = { +#if defined(CONFIG_OF ) && !defined(MODULE )#define _OF_DECLARE (table, name, compat, fn, fn_type) \ static const struct of_device_id __of_table_##name \ __used __section(__##table##_of_table) \ = { .compatible = compat, \ .data = (fn == (fn_type)NULL) ? fn : fn } +#define _OF_DECLARE_ARRAY_START (table, name) \ + __OF_DECLARE_ARRAY_START(name, __##table##_of_table)#else #define _OF_DECLARE (table, name, compat, fn, fn_type) \ static const struct of_device_id __of_table_##name \ __attribute__((unused)) \ = { .compatible = compat, \ .data = (fn == (fn_type)NULL) ? fn : fn } +#define _OF_DECLARE_ARRAY_START (table, name) \ + __OF_DECLARE_ARRAY_START(name, unused)#endif +#define _OF_DECLARE_ARRAY_END } +#define _OF_DECLARE_ELMT (compat, fn, fn_type) \ + { \ + .compatible = compat, \ + .data = (fn == (fn_type)NULL) ? fn : fn, \ + }, +typedef int (*of_init_fn_2 )(struct device_node *,struct device_node *);typedef int (*of_init_fn_1_ret )(struct device_node *);typedef void (*of_init_fn_1 )(struct device_node *);
Signature · 1 line
2.28.0
cover irqchip: Hybrid probing
A recent attempt at converting a couple of interrupt controllers from early probing to standard platform drivers have badly failed, as it became evident that although an interrupt controller can easily probe late, device drivers for the endpoints connected to it are rarely equipped to deal with probe deferral. Changes were swiftly reverted.
However, there is some value in *optionally* enabling this, if only for development purposes, as there is otherwise a "chicken and egg" problem, and a few people (cc'd) are working on a potential solution.
This short series enables the infrastructure for modular building whilst retaining the usual early probing for monolithic build, and introduces it to the three drivers that were previously made to probe as platform drivers.
As I don't have any of the HW, this series is fully untested and I'd welcome some feedback on it.
Thanks,
M.
Marc Zyngier (6):
of: Add basic infrastructure to create early probe arrays
irqchip: Make IRQCHIP_MATCH() type safe
irqchip: Introduce IRQCHIP_HYBRID_DRIVER_{BEGIN,END} macros irqchip/mtk-cirq: Allow modular build irqchip/mtk-sysirq: Allow modular build irqchip/qcom-pdc: Allow modular build
drivers/irqchip/irq-mtk-cirq.c | 4 +++- drivers/irqchip/irq-mtk-sysirq.c | 4 +++- drivers/irqchip/qcom-pdc.c | 4 +++- include/linux/irqchip.h | 14 +++++++++++++- include/linux/of.h | 15 +++++++++++++++ 5 files changed, 37 insertions(+), 4 deletions(-)
Signature · 1 line
2.28.0
PATCH 2/6 irqchip: Make IRQCHIP_MATCH() type safe
IRQCHIP_DECLARE() is backed by macros that perform some elementary type checking on the probe function. Unfortunately, IRQCHIP_MATCH() doesn't, risking difficult debugging sessions...
Rewrite IRQCHIP_MATCH() in terms of _OF_DECLARE_ELMT() restore the missing type safety.
--- include/linux/irqchip.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/irqchip.h +1 -1
@@ -33,7 +33,7 @@ extern int platform_irqchip_probe(struct platform_device *pdev);#define IRQCHIP_PLATFORM_DRIVER_BEGIN (drv_name) \ static const struct of_device_id drv_name##_irqchip_match_table[] = { -#define IRQCHIP_MATCH (compat, fn) { .compatible = compat, .data = fn }, +#define IRQCHIP_MATCH (compat, fn) _OF_DECLARE_ELMT(compat, fn, of_init_fn_2)#define IRQCHIP_PLATFORM_DRIVER_END (drv_name) \ {}, \
Signature · 1 line
2.28.0
PATCH 6/6 irqchip/qcom-pdc: Allow modular build
In reply to Marc ZyngierSwitch the driver to a "hybrid probe" model which preserves the built-in behaviour while allowing the driver to be optionnally built as a module for development purposes.
--- drivers/irqchip/qcom-pdc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/irqchip/qcom-pdc.c +3 -1
@@ -430,4 +430,6 @@ static int qcom_pdc_init(struct device_node *node, struct device_node *parent)return ret; } -IRQCHIP_DECLARE (qcom_pdc,"qcom,pdc" , qcom_pdc_init); +IRQCHIP_HYBRID_DRIVER_BEGIN(qcom_pdc) +IRQCHIP_MATCH("qcom,pdc", qcom_pdc_init) +IRQCHIP_HYBRID_DRIVER_END(qcom_pdc)
Signature · 1 line
2.28.0
PATCH 5/6 irqchip/mtk-sysirq: Allow modular build
In reply to Marc ZyngierSwitch the driver to a "hybrid probe" model which preserves the built-in behaviour while allowing the driver to be optionnally built as a module for development purposes.
--- drivers/irqchip/irq-mtk-sysirq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/irqchip/irq-mtk-sysirq.c +3 -1
@@ -231,4 +231,6 @@ static int __init mtk_sysirq_of_init(struct device_node *node,kfree (chip_data);return ret; } -IRQCHIP_DECLARE (mtk_sysirq,"mediatek,mt6577-sysirq" , mtk_sysirq_of_init); +IRQCHIP_HYBRID_DRIVER_BEGIN(mtk_sysirq) +IRQCHIP_MATCH("mediatek,mt6577-sysirq", mtk_sysirq_of_init) +IRQCHIP_HYBRID_DRIVER_END (mtk_sysirq)
Signature · 1 line
2.28.0
PATCH 4/6 irqchip/mtk-cirq: Allow modular build
In reply to Marc ZyngierSwitch the driver to a "hybrid probe" model which preserves the built-in behaviour while allowing the driver to be optionnally built as a module for development purposes.
--- drivers/irqchip/irq-mtk-cirq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/irqchip/irq-mtk-cirq.c +3 -1
@@ -295,4 +295,6 @@ static int __init mtk_cirq_of_init(struct device_node *node,return ret; } -IRQCHIP_DECLARE (mtk_cirq,"mediatek,mtk-cirq" , mtk_cirq_of_init); +IRQCHIP_HYBRID_DRIVER_BEGIN(mtk_cirq) +IRQCHIP_MATCH("mediatek,mtk-cirq", mtk_cirq_of_init) +IRQCHIP_HYBRID_DRIVER_END (mtk_cirq)
Signature · 1 line
2.28.0
PATCH 3/6 irqchip: Introduce IRQCHIP_HYBRID_DRIVER_{BEGIN,END} macros
In reply to Marc ZyngierAlthough we are trying to move to a world where a large number of irqchip drivers can safely be built as platform drivers the reality is that most endpoint drivers are not ready for that, and will fail to probe as they expect their interrupt controller to be up and running.
A halfway house solution is to let the driver indicate that if it is built-in (i.e. not a module), then it must use the earily probe mechanism, IRQCHIP_DECLARE() style. Otherwise, it is a normal module implemenenting a platform driver, and we can fallback to the existing code.
Hopefully we'll one day be able to drop this code altogether, but that's not for tomorrow.
--- include/linux/irqchip.h | 12 ++++++++++++ 1 file changed, 12 insertions(+)
include/linux/irqchip.h +12 -0
@@ -50,6 +50,18 @@ static struct platform_driver drv_name##_driver = { \ }; \ builtin_platform_driver(drv_name##_driver) +#ifdef MODULE +#define IRQCHIP_HYBRID_DRIVER_BEGIN (drv) \ + IRQCHIP_PLATFORM_DRIVER_BEGIN(drv) +#define IRQCHIP_HYBRID_DRIVER_END (drv) \ + IRQCHIP_PLATFORM_DRIVER_END(drv) +#else +#define IRQCHIP_HYBRID_DRIVER_BEGIN (drv) \ + _OF_DECLARE_ARRAY_START(irqchip, drv) +#define IRQCHIP_HYBRID_DRIVER_END (drv) \ + _OF_DECLARE_ARRAY_END; +#endif +/* * This macro must be used by the different irqchip drivers to declare * the association between their version and their initialization function.
Signature · 1 line
2.28.0
Re: [PATCH 1/6] of: Add basic infrastructure to create early probe arrays
In reply to Marc ZyngierQuoted 10 lines · Marc Zyngier
We currently probe interrupt controller and timers that need to be available very early using an infratstructure that creates struct
of_device_idinstances in a special section. These are individual structures that are ultimately collated by the linker.In order to facilitate further use of this infrastructure for drivers that can either be built modular or as an early driver, let's add a couple of helpers that will make it look like a "normal"
device_idarray, like this:
Quoted 6 lines
_OF_DECLARE_ARRAY_START(table, name)_OF_DECLARE_ELMT("compat-1", probe, type)_OF_DECLARE_ELMT("compat-2", probe, type)_OF_DECLARE_ELMT("compat-3", other_probe, type)_OF_DECLARE_ARRAY_END
Regards,
Bjorn
Quoted 48 lines
Signed-off-by Marc Zyngier <[email protected]>--- include/linux/of.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+)include/linux/of.h +15
-0@@ -1291,20 +1291,35 @@ static inline int of_get_available_child_count(const struct device_node *np)return num; } +#define __OF_DECLARE_ARRAY_START (name, section) \ + static const struct of_device_id __of_table_##name[] \ + __used __section(section) = { +#if defined(CONFIG_OF ) && !defined(MODULE )#define _OF_DECLARE (table, name, compat, fn, fn_type) \ static const struct of_device_id __of_table_##name \ __used __section(__##table##_of_table) \ = { .compatible = compat, \ .data = (fn == (fn_type)NULL) ? fn : fn } +#define _OF_DECLARE_ARRAY_START (table, name) \ + __OF_DECLARE_ARRAY_START(name, __##table##_of_table)#else #define _OF_DECLARE (table, name, compat, fn, fn_type) \ static const struct of_device_id __of_table_##name \ __attribute__((unused)) \ = { .compatible = compat, \ .data = (fn == (fn_type)NULL) ? fn : fn } +#define _OF_DECLARE_ARRAY_START (table, name) \ + __OF_DECLARE_ARRAY_START(name, unused)#endif +#define _OF_DECLARE_ARRAY_END } +#define _OF_DECLARE_ELMT (compat, fn, fn_type) \ + { \ + .compatible = compat, \ + .data = (fn == (fn_type)NULL) ? fn : fn, \ + }, +typedef int (*of_init_fn_2 )(struct device_node *,struct device_node *);typedef int (*of_init_fn_1_ret )(struct device_node *);typedef void (*of_init_fn_1 )(struct device_node *);Signature · 1 line
2.28.0
Re: [PATCH 2/6] irqchip: Make IRQCHIP_MATCH() type safe
In reply to Marc ZyngierQuoted 7 lines · Marc Zyngier
IRQCHIP_DECLARE()is backed by macros that perform some elementary type checking on the probe function. Unfortunately,IRQCHIP_MATCH()doesn't, risking difficult debugging sessions...Rewrite
IRQCHIP_MATCH()in terms of_OF_DECLARE_ELMT()restore the missing type safety.
Quoted 21 lines
Signed-off-by Marc Zyngier <[email protected]>--- include/linux/irqchip.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/linux/irqchip.h +1
-1@@ -33,7 +33,7 @@ extern int platform_irqchip_probe(struct platform_device *pdev);#define IRQCHIP_PLATFORM_DRIVER_BEGIN (drv_name) \ static const struct of_device_id drv_name##_irqchip_match_table[] = { -#define IRQCHIP_MATCH (compat, fn) { .compatible = compat, .data = fn }, +#define IRQCHIP_MATCH (compat, fn) _OF_DECLARE_ELMT(compat, fn, of_init_fn_2)#define IRQCHIP_PLATFORM_DRIVER_END (drv_name) \ {}, \Signature · 1 line
2.28.0
Re: [PATCH 3/6] irqchip: Introduce IRQCHIP_HYBRID_DRIVER_{BEGIN,END} macros
In reply to Marc ZyngierQuoted 6 lines · Marc Zyngier
Although we are trying to move to a world where a large number of irqchip drivers can safely be built as platform drivers the reality is that most endpoint drivers are not ready for that, and will fail to probe as they expect their interrupt controller to be up and running.
Quoted 9 lines
A halfway house solution is to let the driver indicate that if it is built-in (i.e. not a module), then it must use the earily probe mechanism,
IRQCHIP_DECLARE()style. Otherwise, it is a normal module implemenenting a platform driver, and we can fallback to the existing code.Hopefully we'll one day be able to drop this code altogether, but that's not for tomorrow.
Quoted 31 lines
Signed-off-by Marc Zyngier <[email protected]>--- include/linux/irqchip.h | 12 ++++++++++++ 1 file changed, 12 insertions(+)include/linux/irqchip.h +12
-0@@ -50,6 +50,18 @@ static struct platform_driver drv_name##_driver = { \ }; \ builtin_platform_driver(drv_name##_driver) +#ifdef MODULE +#define IRQCHIP_HYBRID_DRIVER_BEGIN (drv) \ + IRQCHIP_PLATFORM_DRIVER_BEGIN(drv) +#define IRQCHIP_HYBRID_DRIVER_END (drv) \ + IRQCHIP_PLATFORM_DRIVER_END(drv) +#else +#define IRQCHIP_HYBRID_DRIVER_BEGIN (drv) \ + _OF_DECLARE_ARRAY_START(irqchip, drv) +#define IRQCHIP_HYBRID_DRIVER_END (drv) \ + _OF_DECLARE_ARRAY_END; +#endif +/* * This macro must be used by the different irqchip drivers to declare * the association between their version and their initialization function. Signature · 1 line
2.28.0
Re: [PATCH 4/6] irqchip/mtk-cirq: Allow modular build
In reply to Marc ZyngierQuoted 4 lines · Marc Zyngier
Switch the driver to a "hybrid probe" model which preserves the built-in behaviour while allowing the driver to be optionnally built as a module for development purposes.
Quoted 20 lines
Signed-off-by Marc Zyngier <[email protected]>--- drivers/irqchip/irq-mtk-cirq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/irqchip/irq-mtk-cirq.c +3
-1@@ -295,4 +295,6 @@ static int __init mtk_cirq_of_init(struct device_node *node,return ret; } -IRQCHIP_DECLARE (mtk_cirq,"mediatek,mtk-cirq" , mtk_cirq_of_init); +IRQCHIP_HYBRID_DRIVER_BEGIN(mtk_cirq) +IRQCHIP_MATCH("mediatek,mtk-cirq", mtk_cirq_of_init) +IRQCHIP_HYBRID_DRIVER_END (mtk_cirq)Signature · 1 line
2.28.0
Re: [PATCH 5/6] irqchip/mtk-sysirq: Allow modular build
In reply to Marc ZyngierQuoted 4 lines · Marc Zyngier
Switch the driver to a "hybrid probe" model which preserves the built-in behaviour while allowing the driver to be optionnally built as a module for development purposes.
Quoted 20 lines
Signed-off-by Marc Zyngier <[email protected]>--- drivers/irqchip/irq-mtk-sysirq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/irqchip/irq-mtk-sysirq.c +3
-1@@ -231,4 +231,6 @@ static int __init mtk_sysirq_of_init(struct device_node *node,kfree (chip_data);return ret; } -IRQCHIP_DECLARE (mtk_sysirq,"mediatek,mt6577-sysirq" , mtk_sysirq_of_init); +IRQCHIP_HYBRID_DRIVER_BEGIN(mtk_sysirq) +IRQCHIP_MATCH("mediatek,mt6577-sysirq", mtk_sysirq_of_init) +IRQCHIP_HYBRID_DRIVER_END (mtk_sysirq)Signature · 1 line
2.28.0
Re: [PATCH 6/6] irqchip/qcom-pdc: Allow modular build
In reply to Marc ZyngierQuoted 4 lines · Marc Zyngier
Switch the driver to a "hybrid probe" model which preserves the built-in behaviour while allowing the driver to be optionnally built as a module for development purposes.
Quoted 20 lines
Signed-off-by Marc Zyngier <[email protected]>--- drivers/irqchip/qcom-pdc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/irqchip/qcom-pdc.c +3
-1@@ -430,4 +430,6 @@ static int qcom_pdc_init(struct device_node *node, struct device_node *parent)return ret; } -IRQCHIP_DECLARE (qcom_pdc,"qcom,pdc" , qcom_pdc_init); +IRQCHIP_HYBRID_DRIVER_BEGIN(qcom_pdc) +IRQCHIP_MATCH("qcom,pdc", qcom_pdc_init) +IRQCHIP_HYBRID_DRIVER_END(qcom_pdc)Signature · 1 line
2.28.0
Re: [PATCH 1/6] of: Add basic infrastructure to create early probe arrays
In reply to Marc ZyngierQuoted 2 lines · Marc Zyngier
We currently probe interrupt controller and timers that need to be available very early using an infratstructure that creates
s/infratstructure/infrastructure/
Quoted 62 lines
struct
of_device_idinstances in a special section. These are individual structures that are ultimately collated by the linker.In order to facilitate further use of this infrastructure for drivers that can either be built modular or as an early driver, let's add a couple of helpers that will make it look like a "normal"
device_idarray, like this:
_OF_DECLARE_ARRAY_START(table, name)_OF_DECLARE_ELMT("compat-1", probe, type)_OF_DECLARE_ELMT("compat-2", probe, type)_OF_DECLARE_ELMT("compat-3", other_probe, type)_OF_DECLARE_ARRAY_ENDSigned-off-by Marc Zyngier <[email protected]>--- include/linux/of.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+)include/linux/of.h +15
-0@@ -1291,20 +1291,35 @@ static inline int of_get_available_child_count(const struct device_node *np)return num; } +#define __OF_DECLARE_ARRAY_START (name, section) \ + static const struct of_device_id __of_table_##name[] \ + __used __section(section) = { +#if defined(CONFIG_OF ) && !defined(MODULE )#define _OF_DECLARE (table, name, compat, fn, fn_type) \ static const struct of_device_id __of_table_##name \ __used __section(__##table##_of_table) \ = { .compatible = compat, \ .data = (fn == (fn_type)NULL) ? fn : fn } +#define _OF_DECLARE_ARRAY_START (table, name) \ + __OF_DECLARE_ARRAY_START(name, __##table##_of_table)#else #define _OF_DECLARE (table, name, compat, fn, fn_type) \ static const struct of_device_id __of_table_##name \ __attribute__((unused)) \ = { .compatible = compat, \ .data = (fn == (fn_type)NULL) ? fn : fn } +#define _OF_DECLARE_ARRAY_START (table, name) \ + __OF_DECLARE_ARRAY_START(name, unused)#endif +#define _OF_DECLARE_ARRAY_END } +#define _OF_DECLARE_ELMT (compat, fn, fn_type) \ + { \ + .compatible = compat, \ + .data = (fn == (fn_type)NULL) ? fn : fn, \ + }, +typedef int (*of_init_fn_2 )(struct device_node *,struct device_node *);typedef int (*of_init_fn_1_ret )(struct device_node *);typedef void (*of_init_fn_1 )(struct device_node *);Signature · 1 line
2.28.0
Quoted 11 lines · Marc Zyngier
A recent attempt at converting a couple of interrupt controllers from early probing to standard platform drivers have badly failed, as it became evident that although an interrupt controller can easily probe late, device drivers for the endpoints connected to it are rarely equipped to deal with probe deferral. Changes were swiftly reverted.
However, there is some value in *optionally* enabling this, if only for development purposes, as there is otherwise a "chicken and egg" problem, and a few people (cc'd) are working on a potential solution.
Quoted 7 lines
This short series enables the infrastructure for modular building whilst retaining the usual early probing for monolithic build, and introduces it to the three drivers that were previously made to probe as platform drivers.
As I don't have any of the HW, this series is fully untested and I'd welcome some feedback on it.
I've tested this on db845c along with a small follow-on patch I'll send to you which sets the qcom-pdc as a tristate in the Kconfig, both as a module and as a built-in.
thanks
-john
PATCH 1/1 irqchip/qcom-pdc: Allow QCOM_PDC to be loadable as a permanent module
In reply to Marc ZyngierAllows qcom-pdc driver to be loaded as a permanent module.
An earlier version of this patch was merged in a larger patchset but was reverted entirely when issues were found with other drivers, so now that Marc has provided a better solution in his Hybrid probing patch set, I wanted to re-submit this change.
--- drivers/irqchip/Kconfig | 2 +- drivers/irqchip/qcom-pdc.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
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 +2 -0
@@ -433,3 +433,5 @@ static int qcom_pdc_init(struct device_node *node, struct device_node *parent) IRQCHIP_HYBRID_DRIVER_BEGIN(qcom_pdc) IRQCHIP_MATCH("qcom,pdc", qcom_pdc_init) IRQCHIP_HYBRID_DRIVER_END(qcom_pdc) +MODULE_DESCRIPTION("Qualcomm Technologies, Inc. Power Domain Controller"); +MODULE_LICENSE ("GPL v2" );
Signature · 1 line
2.17.1
Re: [PATCH] irqchip/qcom-pdc: Allow QCOM_PDC to be loadable as a permanent module
Quoted 23 lines · John Stultz
Allows qcom-pdc driver to be loaded as a permanent module.
An earlier version of this patch was merged in a larger patchset but was reverted entirely when issues were found with other drivers, so now that Marc has provided a better solution in his Hybrid probing patch set, I wanted to re-submit this change.
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]>Signed-off-by John Stultz <[email protected]>
Quoted 1 line
---
Re: [PATCH] irqchip/qcom-pdc: Allow QCOM_PDC to be loadable as a permanent module
In reply to John StultzQuoted 7 lines · John Stultz
Allows qcom-pdc driver to be loaded as a permanent module.
An earlier version of this patch was merged in a larger patchset but was reverted entirely when issues were found with other drivers, so now that Marc has provided a better solution in his Hybrid probing patch set, I wanted to re-submit this change.
Quoted 47 lines
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]>Signed-off-by John Stultz <[email protected]>--- drivers/irqchip/Kconfig | 2 +- drivers/irqchip/qcom-pdc.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)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 helpdrivers/irqchip/qcom-pdc.c +2
-0@@ -433,3 +433,5 @@ static int qcom_pdc_init(struct device_node *node, struct device_node *parent) IRQCHIP_HYBRID_DRIVER_BEGIN(qcom_pdc) IRQCHIP_MATCH("qcom,pdc", qcom_pdc_init) IRQCHIP_HYBRID_DRIVER_END(qcom_pdc) +MODULE_DESCRIPTION("Qualcomm Technologies, Inc. Power Domain Controller"); +MODULE_LICENSE ("GPL v2" );Signature · 1 line
2.17.1
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
Rob Herring
maintainerQuoted 6 lines · Marc Zyngier
A recent attempt at converting a couple of interrupt controllers from early probing to standard platform drivers have badly failed, as it became evident that although an interrupt controller can easily probe late, device drivers for the endpoints connected to it are rarely equipped to deal with probe deferral. Changes were swiftly reverted.
Quoted 8 lines
However, there is some value in *optionally* enabling this, if only for development purposes, as there is otherwise a "chicken and egg" problem, and a few people (cc'd) are working on a potential solution.
This short series enables the infrastructure for modular building whilst retaining the usual early probing for monolithic build, and introduces it to the three drivers that were previously made to probe as platform drivers.
I hardly expected more OF_DECLARE macros when I opened this up. Given desires to get rid of them, I don't think adding to it is the way forward. That wrapping a platform driver around OF_DECLARE looks pretty horrible IMO.
I browsed some of the discussion around this. It didn't seem like it's a large number of drivers that have to be fixed to defer probe correctly. Am I missing something?
I'd rather keep the pressure on getting fw_devlink on by default.
Rob
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Enric Balletbo Serra
Tested-by Enric Balletbo i SerraRe: [PATCH 5/6] irqchip/mtk-sysirq: Allow modular build
In reply to Bjorn AnderssonMissatge de Bjorn Andersson <[email protected]> del dia dg., 13 de set. 2020 a les 1:25:
Quoted 11 lines · Marc Zyngier
Quoted 5 lines
Switch the driver to a "hybrid probe" model which preserves the built-in behaviour while allowing the driver to be optionnally built as a module for development purposes.
Reviewed-by Bjorn Andersson <[email protected]>Quoted 1 line
Signed-off-by Marc Zyngier <[email protected]>
I've tested this on mt8173 and mt8183, and this time, the patches didn't break booting on these platforms. For MediaTek, right now, only makes sense the driver to be built-in as other drivers that use it are not ready for deferring their probe. So,
Thanks
Enric
Quoted 19 lines
Quoted 19 lines
--- drivers/irqchip/irq-mtk-sysirq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/irqchip/irq-mtk-sysirq.c +3
-2@@ -231,4 +231,6 @@ static int __init mtk_sysirq_of_init(struct device_node *node,kfree (chip_data);return ret; } -IRQCHIP_DECLARE (mtk_sysirq,"mediatek,mt6577-sysirq" , mtk_sysirq_of_init); +IRQCHIP_HYBRID_DRIVER_BEGIN(mtk_sysirq) +IRQCHIP_MATCH("mediatek,mt6577-sysirq", mtk_sysirq_of_init) +IRQCHIP_HYBRID_DRIVER_END (mtk_sysirq) --2.28.0
Enric Balletbo Serra
Tested-by Enric Balletbo i SerraRe: [PATCH 4/6] irqchip/mtk-cirq: Allow modular build
In reply to Bjorn AnderssonMissatge de Bjorn Andersson <[email protected]> del dia dg., 13 de set. 2020 a les 1:26:
Quoted 11 lines · Marc Zyngier
Quoted 5 lines
Switch the driver to a "hybrid probe" model which preserves the built-in behaviour while allowing the driver to be optionnally built as a module for development purposes.
Reviewed-by Bjorn Andersson <[email protected]>Quoted 1 line
Signed-off-by Marc Zyngier <[email protected]>
I've tested this on mt8173 and mt8183, and this time, the patches didn't break booting on these platforms. For MediaTek, right now, only makes sense the driver to be built-in as other drivers that use it are not ready for deferring their probe. So,
Thanks
Enric
Quoted 19 lines
Quoted 19 lines
--- drivers/irqchip/irq-mtk-cirq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/irqchip/irq-mtk-cirq.c +3
-2@@ -295,4 +295,6 @@ static int __init mtk_cirq_of_init(struct device_node *node,return ret; } -IRQCHIP_DECLARE (mtk_cirq,"mediatek,mtk-cirq" , mtk_cirq_of_init); +IRQCHIP_HYBRID_DRIVER_BEGIN(mtk_cirq) +IRQCHIP_MATCH("mediatek,mtk-cirq", mtk_cirq_of_init) +IRQCHIP_HYBRID_DRIVER_END (mtk_cirq) --2.28.0
Quoted 16 lines · Rob Herring
Quoted 6 lines · Marc Zyngier
A recent attempt at converting a couple of interrupt controllers from early probing to standard platform drivers have badly failed, as it became evident that although an interrupt controller can easily probe late, device drivers for the endpoints connected to it are rarely equipped to deal with probe deferral. Changes were swiftly reverted.
Quoted 8 lines
However, there is some value in *optionally* enabling this, if only for development purposes, as there is otherwise a "chicken and egg" problem, and a few people (cc'd) are working on a potential solution.
This short series enables the infrastructure for modular building whilst retaining the usual early probing for monolithic build, and introduces it to the three drivers that were previously made to probe as platform drivers.
Quoted 4 lines
I hardly expected more
OF_DECLAREmacros when I opened this up. Given desires to get rid of them, I don't think adding to it is the way forward. That wrapping a platform driver aroundOF_DECLARElooks pretty horrible IMO.
Nobody said it was cute. It's a band aid that allows us to move from the status-quo that exists today. How would you propose we allow people to go and start "fixing" drivers if you don't give them the opportunity to even start trying?
Quoted 3 lines
I browsed some of the discussion around this. It didn't seem like it's a large number of drivers that have to be fixed to defer probe correctly. Am I missing something?
Well, that was enough drivers for the two platforms that had it enabled to break horribly, without a way to go back to a working state. Do you find that acceptable? I don't.
Quoted 1 line
I'd rather keep the pressure on getting
fw_devlinkon by default.
So far, fw_devlink breaks everything under the sun, even without modular irqchips. Most of my systems fail to boot if I enable it. So yes, it really needs some work. And this series allows this work to happen.
M.
Signature · 1 line
Jazz is not dead. It just smells funny...
Rob Herring
maintainerQuoted 23 lines · Marc Zyngier
Quoted 16 lines · Rob Herring
Quoted 6 lines · Marc Zyngier
A recent attempt at converting a couple of interrupt controllers from early probing to standard platform drivers have badly failed, as it became evident that although an interrupt controller can easily probe late, device drivers for the endpoints connected to it are rarely equipped to deal with probe deferral. Changes were swiftly reverted.
Quoted 8 lines
However, there is some value in *optionally* enabling this, if only for development purposes, as there is otherwise a "chicken and egg" problem, and a few people (cc'd) are working on a potential solution.
This short series enables the infrastructure for modular building whilst retaining the usual early probing for monolithic build, and introduces it to the three drivers that were previously made to probe as platform drivers.
Quoted 4 lines
I hardly expected more
OF_DECLAREmacros when I opened this up. Given desires to get rid of them, I don't think adding to it is the way forward. That wrapping a platform driver aroundOF_DECLARElooks pretty horrible IMO.
Quoted 4 lines
Nobody said it was cute. It's a band aid that allows us to move from the status-quo that exists today. How would you propose we allow people to go and start "fixing" drivers if you don't give them the opportunity to even start trying?
Apply the reverted patches and start fixing the drivers.
Quoted 7 lines
Quoted 3 lines
I browsed some of the discussion around this. It didn't seem like it's a large number of drivers that have to be fixed to defer probe correctly. Am I missing something?
Well, that was enough drivers for the two platforms that had it enabled to break horribly, without a way to go back to a working state. Do you find that acceptable? I don't.
I understand reverting for v5.9, that was the right choice. But Mediatek had 3 drivers broken. Is there more to it than getting EPROBE_DEFER handled correctly in those drivers?
Quoted 5 lines
Quoted 1 line
I'd rather keep the pressure on getting
fw_devlinkon by default.So far,
fw_devlinkbreaks everything under the sun, even without modular irqchips. Most of my systems fail to boot if I enable it. So yes, it really needs some work. And this series allows this work to happen.
I think we can do something more simple here. We just need to instantiate the irqchip devices earlier to get them to probe first and not cause deferrals. That's just a matter of calling of_platform_device_create() in an earlier initcall (<= arch_initcall_sync ('=' because of link order)). Then once dependent drivers are all fixed, all that has to be done is rip out that initcall and the default of_platform_populate call will create the device instead.
Rob
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel