coresight: Move remaining AMBA ACPI devices into platform driver
Subsystems (5)
v7 cover coresight: Move remaining AMBA ACPI devices into platform driver
This moves remaining AMBA ACPI devices into respective platform drivers for enabling ACPI based power management support. This series applies on latest coresight next. This series has been built, and boot tested on a DT based (RB5) and ACPI supported coresight platform (N1SDP).
https://git.gitlab.arm.com/linux-arm/linux-anshuman.git (amba_other_acpi_migration_v7)
Changes in V7:
- Dropped reduntant 'drvdata' check in following functions replicator_platform_remove() funnel_platform_remove()
tpiu_platform_remove()
tmc_platform_remove()
catu_platform_remove()
catu_platform_probe()
debug_platform_remove()
debug_platform_probe()
- Dropped struct resource check before devm_ioremap_resource()
- Sorted the headers in alphabetic order
Changes in V6:
https://lore.kernel.org/all/[email protected]/
- Dropped Jame's RB tag from [PATCH 3/11]
- Added clk_disable_unprepare() for pclk in replicator_probe() error path
- Added clk_disable_unprepare() for pclk in funnel_probe() error path
- Added clk_put() for pclk in catu_platform_probe() error path
- Added clk_put() for pclk in debug_platform_probe() error path
- Added WARN_ON(!drvdata) check in replicator_platform_remove()
- Added WARN_ON(!drvdata) check in funnel_platform_remove()
- Added WARN_ON(!drvdata) check in catu_platform_remove()
- Added WARN_ON(!drvdata) check in tpiu_platform_remove()
- Added WARN_ON(!drvdata) check in tmc_platform_remove()
- Added WARN_ON(!drvdata) check in stm_platform_remove()
- Added WARN_ON(!drvdata) check in debug_platform_remove()
- Added additional elements for all acpi_device_id[] updates
Changes in V5:
https://lore.kernel.org/all/[email protected]/
- Used table->mask to filter out bits from pid in coresight_get_uci_data_from_amba()
- Dropped custom masks such as STM_AMBA_MASK and TMC_AMBA_MASK
- Modified tmc_etr_setup_caps() to accept struct csdev_access argument
- Reverted back tmc_etr_setup_caps() call site position in tmc_probe()
- Changed replicator and funnel devices to use the new helpers earlier in series
- Updated the commit messages regarding xxx_probe() refactoring and renaming
Changes in V4:
https://lore.kernel.org/all/[email protected]/
- Fixed PM imbalance in etm4_probe() error path with pm_runtime_disable()
- Restored back the pm_runtime_disable() on platform probe error paths in replicator, funnel, catu, tpiu, tmc and stm devices
- Dropped dev_caps argument from __tmc_probe()
- Changed xxxx_platform_remove() for platform_driver->remove_new() callback
Changes in V3:
https://lore.kernel.org/all/[email protected]/
- Split coresight_init_driver/remove_driver() helpers into a separate patch
- Added 'drvdata->pclk' comments in replicator, funnel, tpiu, tmc, and stm devices
- Updated funnel, and replicator drivers to use these new helpers
- Check for drvdata instead of drvdata->pclk in suspend and resume paths in catu, tmc and debug devices
- Added patch to extract device name from AMBA pid based table lookup for stm
- Added patch to extract device properties from AMBA pid based table look for tmc
- Dropped pm_runtime_put() from common __probe() functions
- Handled pm_runtime_put() in AMBA driver in success path
- Handled pm_runtime_put() in platform driver in both success and error paths
Changes in V2:
https://lore.kernel.org/all/[email protected]/
- Dropped redundant devm_ioremap_resource() hunk from tmc_platform_probe()
- Defined coresight_[init|remove]_driver() for both AMBA/platform drivers
- Changed catu, tmc, tpiu, stm and debug coresight drivers to use the new helpers avoiding build issues arising from module_amba_driver(), and module_platform_driver() being on the same file
Changes in V1:
https://lore.kernel.org/all/[email protected]/
- Replaced all IS_ERR() instances with IS_ERR_OR_NULL() as per Suzuki
Changes in RFC:
https://lore.kernel.org/all/[email protected]/
Anshuman Khandual (11):
coresight: etm4x: Fix unbalanced pm_runtime_enable()
coresight: stm: Extract device name from AMBA pid based table lookup
coresight: tmc: Extract device properties from AMBA pid based table lookup
coresight: Add helpers registering/removing both AMBA and platform drivers
coresight: replicator: Move ACPI support from AMBA driver to platform driver
coresight: funnel: Move ACPI support from AMBA driver to platform driver
coresight: catu: Move ACPI support from AMBA driver to platform driver
coresight: tpiu: Move ACPI support from AMBA driver to platform driver
coresight: tmc: Move ACPI support from AMBA driver to platform driver
coresight: stm: Move ACPI support from AMBA driver to platform driver
coresight: debug: Move ACPI support from AMBA driver to platform driver
drivers/acpi/arm64/amba.c | 8 - drivers/hwtracing/coresight/coresight-catu.c | 138 +++++++++++++--- drivers/hwtracing/coresight/coresight-catu.h | 1 + drivers/hwtracing/coresight/coresight-core.c | 29 ++++ .../hwtracing/coresight/coresight-cpu-debug.c | 138 ++++++++++++++-- .../coresight/coresight-etm4x-core.c | 3 + .../hwtracing/coresight/coresight-funnel.c | 87 +++++----- drivers/hwtracing/coresight/coresight-priv.h | 10 ++ .../coresight/coresight-replicator.c | 82 +++++----- drivers/hwtracing/coresight/coresight-stm.c | 116 +++++++++++-- .../hwtracing/coresight/coresight-tmc-core.c | 154 +++++++++++++++--- drivers/hwtracing/coresight/coresight-tmc.h | 2 + drivers/hwtracing/coresight/coresight-tpiu.c | 117 +++++++++++-- include/linux/coresight.h | 7 + 14 files changed, 726 insertions(+), 166 deletions(-)
Signature · 1 line
2.25.1
PATCH v7 1/11 coresight: etm4x: Fix unbalanced pm_runtime_enable()
There is an unbalanced pm_runtime_enable() in etm4_probe_platform_dev() when etm4_probe() fails. This problem can be observed via the coresight etm4 module's (load -> unload -> load) sequence when etm4_probe() fails in etm4_probe_platform_dev().
[ 63.379943] coresight-etm4x 7040000.etm: Unbalanced pm_runtime_enable! [ 63.393630] coresight-etm4x 7140000.etm: Unbalanced pm_runtime_enable! [ 63.407455] coresight-etm4x 7240000.etm: Unbalanced pm_runtime_enable! [ 63.420983] coresight-etm4x 7340000.etm: Unbalanced pm_runtime_enable! [ 63.420999] coresight-etm4x 7440000.etm: Unbalanced pm_runtime_enable! [ 63.441209] coresight-etm4x 7540000.etm: Unbalanced pm_runtime_enable! [ 63.454689] coresight-etm4x 7640000.etm: Unbalanced pm_runtime_enable! [ 63.474982] coresight-etm4x 7740000.etm: Unbalanced pm_runtime_enable!
This fixes the above problem - with an explicit pm_runtime_disable() call when etm4_probe() fails during etm4_probe_platform_dev().
--- drivers/hwtracing/coresight/coresight-etm4x-core.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/hwtracing/coresight/coresight-etm4x-core.c +3 -0
@@ -2213,6 +2213,9 @@ static int etm4_probe_platform_dev(struct platform_device *pdev) ret =etm4_probe (&pdev->dev);pm_runtime_put (&pdev->dev); +if (ret) +pm_runtime_disable (&pdev->dev); +return ret; }
Signature · 1 line
2.25.1
PATCH v7 2/11 coresight: stm: Extract device name from AMBA pid based table lookup
In reply to Anshuman KhandualInstead of using AMBA private data field, extract the device name from AMBA pid based table lookup using new coresight_get_uci_data_from_amba() helper.
--- drivers/hwtracing/coresight/coresight-priv.h | 10 ++++++++++ drivers/hwtracing/coresight/coresight-stm.c | 12 +++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-)
drivers/hwtracing/coresight/coresight-priv.h +10 -0
@@ -222,6 +222,16 @@ static inline void *coresight_get_uci_data(const struct amba_id *id)return uci_id->data; } +static inline void *coresight_get_uci_data_from_amba (const struct amba_id *table,u32 pid) +{ +while (table->mask) { +if ((pid & table->mask) == table->id) +return coresight_get_uci_data (table); + table++; + }; +return NULL ; +} +void coresight_release_platform_data (struct coresight_device *csdev,struct device *dev,struct coresight_platform_data *pdata);
drivers/hwtracing/coresight/coresight-stm.c +11 -1
@@ -800,6 +800,16 @@ static void stm_init_generic_data(struct stm_drvdata *drvdata, drvdata->stm.set_options = stm_generic_set_options; } +static const struct amba_id stm_ids[]; + +static char *stm_csdev_name (struct coresight_device *csdev) +{ +u32 stm_pid =coresight_get_pid (&csdev->access); +void *uci_data =coresight_get_uci_data_from_amba (stm_ids, stm_pid); + +return uci_data ? (char *)uci_data :"STM" ; +} +static int stm_probe (struct amba_device *adev,const struct amba_id *id) {int ret, trace_id;
@@ -896,7 +906,7 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id)pm_runtime_put (&adev->dev);dev_info (&drvdata->csdev->dev,"%s initialized\n" , - (char *)coresight_get_uci_data (id)); +stm_csdev_name (drvdata->csdev));return 0 ; cs_unregister:
Signature · 1 line
2.25.1
PATCH v7 3/11 coresight: tmc: Extract device properties from AMBA pid based table lookup
In reply to Anshuman KhandualThis extracts device properties from AMBA pid based table lookup. But first this modifies tmc_etr_setup_caps() to accept csdev access.
--- drivers/hwtracing/coresight/coresight-tmc-core.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/hwtracing/coresight/coresight-tmc-core.c +10 -4
@@ -370,16 +370,23 @@ static inline bool tmc_etr_has_non_secure_access(struct tmc_drvdata *drvdata)return (auth &TMC_AUTH_NSID_MASK ) ==0x3 ; } +static const struct amba_id tmc_ids[]; +/* Detect and initialise the capabilities of a TMC ETR */ -static int tmc_etr_setup_caps (struct device *parent,u32 devid,void *dev_caps) +static int tmc_etr_setup_caps (struct device *parent,u32 devid, +struct csdev_access *access) {int rc; -u32 dma_mask =0 ; +u32 tmc_pid, dma_mask =0 ;struct tmc_drvdata *drvdata =dev_get_drvdata (parent); +void *dev_caps;if (!tmc_etr_has_non_secure_access (drvdata))return -EACCES ; + tmc_pid =coresight_get_pid (access); + dev_caps =coresight_get_uci_data_from_amba (tmc_ids, tmc_pid); +/* Set the unadvertised capabilities */ tmc_etr_init_caps (drvdata, (u32 )(unsigned long )dev_caps);
@@ -497,8 +504,7 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id) desc.type =CORESIGHT_DEV_TYPE_SINK ; desc.subtype.sink_subtype =CORESIGHT_DEV_SUBTYPE_SINK_SYSMEM ; desc.ops = &tmc_etr_cs_ops; - ret =tmc_etr_setup_caps (dev, devid, -coresight_get_uci_data (id)); + ret =tmc_etr_setup_caps (dev, devid, &desc.access);if (ret) goto out;idr_init (&drvdata->idr);
Signature · 1 line
2.25.1
PATCH v7 4/11 coresight: Add helpers registering/removing both AMBA and platform drivers
In reply to Anshuman KhandualThis adds two different helpers i.e coresight_init_driver()/remove_driver() enabling coresight devices to register or remove AMBA and platform drivers. This changes replicator and funnel devices to use above new helpers.
--- drivers/hwtracing/coresight/coresight-core.c | 29 +++++++++++++++++++ .../hwtracing/coresight/coresight-funnel.c | 19 ++---------- .../coresight/coresight-replicator.c | 20 ++----------- include/linux/coresight.h | 7 +++++ 4 files changed, 41 insertions(+), 34 deletions(-)
drivers/hwtracing/coresight/coresight-core.c +29 -0
@@ -1398,6 +1398,35 @@ static void __exit coresight_exit(void)module_init (coresight_init);module_exit (coresight_exit); +int coresight_init_driver (const char *drv,struct amba_driver *amba_drv, +struct platform_driver *pdev_drv) +{ +int ret; + + ret =amba_driver_register (amba_drv); +if (ret) { +pr_err ("%s: error registering AMBA driver\n" , drv); +return ret; + } + + ret =platform_driver_register (pdev_drv); +if (!ret) +return 0 ; + +pr_err ("%s: error registering platform driver\n" , drv); +amba_driver_unregister (amba_drv); +return ret; +} +EXPORT_SYMBOL_GPL (coresight_init_driver); + +void coresight_remove_driver (struct amba_driver *amba_drv, +struct platform_driver *pdev_drv) +{ +amba_driver_unregister (amba_drv); +platform_driver_unregister (pdev_drv); +} +EXPORT_SYMBOL_GPL (coresight_remove_driver); +MODULE_LICENSE ("GPL v2" );MODULE_AUTHOR ("Pratik Patel <[email protected]>" );MODULE_AUTHOR ("Mathieu Poirier <[email protected]>" );
drivers/hwtracing/coresight/coresight-funnel.c +2 -17
@@ -410,27 +410,12 @@ static struct amba_driver dynamic_funnel_driver = {static int __init funnel_init (void ) { -int ret; - - ret =platform_driver_register (&static_funnel_driver); -if (ret) { -pr_info ("Error registering platform driver\n" ); -return ret; - } - - ret =amba_driver_register (&dynamic_funnel_driver); -if (ret) { -pr_info ("Error registering amba driver\n" ); -platform_driver_unregister (&static_funnel_driver); - } - -return ret; +return coresight_init_driver ("funnel" , &dynamic_funnel_driver, &static_funnel_driver); } static void __exit funnel_exit(void) { -platform_driver_unregister (&static_funnel_driver); -amba_driver_unregister (&dynamic_funnel_driver); +coresight_remove_driver (&dynamic_funnel_driver, &static_funnel_driver); }module_init (funnel_init);
drivers/hwtracing/coresight/coresight-replicator.c +3 -17
@@ -416,27 +416,13 @@ static struct amba_driver dynamic_replicator_driver = {static int __init replicator_init (void ) { -int ret; - - ret =platform_driver_register (&static_replicator_driver); -if (ret) { -pr_info ("Error registering platform driver\n" ); -return ret; - } - - ret =amba_driver_register (&dynamic_replicator_driver); -if (ret) { -pr_info ("Error registering amba driver\n" ); -platform_driver_unregister (&static_replicator_driver); - } - -return ret; +return coresight_init_driver ("replicator" , &dynamic_replicator_driver, + &static_replicator_driver); } static void __exit replicator_exit(void) { -platform_driver_unregister (&static_replicator_driver); -amba_driver_unregister (&dynamic_replicator_driver); +coresight_remove_driver (&dynamic_replicator_driver, &static_replicator_driver); }module_init (replicator_init);
include/linux/coresight.h +7 -0
@@ -12,6 +12,8 @@#include <linux/io.h> #include <linux/perf_event.h> #include <linux/sched.h> +#include <linux/amba/bus.h> +#include <linux/platform_device.h> /* Peripheral id registers (0xFD0-0xFEC) */ #define CORESIGHT_PERIPHIDR4 0xfd0
@@ -658,4 +660,9 @@ coresight_find_output_type(struct coresight_platform_data *pdata,enum coresight_dev_type type, union coresight_dev_subtype subtype); +int coresight_init_driver (const char *drv,struct amba_driver *amba_drv, +struct platform_driver *pdev_drv); + +void coresight_remove_driver (struct amba_driver *amba_drv, +struct platform_driver *pdev_drv);#endif /* _LINUX_COREISGHT_H */
Signature · 1 line
2.25.1
PATCH v7 5/11 coresight: replicator: Move ACPI support from AMBA driver to platform driver
In reply to Anshuman KhandualAdd support for the dynamic replicator device in the platform driver, which can then be used on ACPI based platforms. This change would now allow runtime power management for replicator devices on ACPI based systems.
The driver would try to enable the APB clock if available. Also, rename the code to reflect the fact that it now handles both static and dynamic replicators. But first this refactors replicator_probe() making sure it can be used both for platform and AMBA drivers, by moving the pm_runtime_put() to the callers.
---
Changes in V7:
- Dropped reduntant drvdata check in replicator_platform_remove()
drivers/acpi/arm64/amba.c | 1 - .../coresight/coresight-replicator.c | 68 ++++++++++++------- 2 files changed, 45 insertions(+), 24 deletions(-)
drivers/acpi/arm64/amba.c +0 -1
@@ -27,7 +27,6 @@ static const struct acpi_device_id amba_id_list[] = { {"ARMHC503", 0}, /* ARM CoreSight Debug */ {"ARMHC979", 0}, /* ARM CoreSight TPIU */ {"ARMHC97C", 0}, /* ARM CoreSight SoC-400 TMC, SoC-600 ETF/ETB */ - {"ARMHC98D", 0}, /* ARM CoreSight Dynamic Replicator */ {"ARMHC9CA", 0}, /* ARM CoreSight CATU */ {"ARMHC9FF", 0}, /* ARM CoreSight Dynamic Funnel */ {"", 0},
drivers/hwtracing/coresight/coresight-replicator.c +45 -23
166 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH v7 6/11 coresight: funnel: Move ACPI support from AMBA driver to platform driver
In reply to Anshuman KhandualAdd support for the dynamic funnel device in the platform driver, which can then be used on ACPI based platforms. This change would allow runtime power management for ACPI based systems.
The driver would try to enable the APB clock if available. Also, rename the code to reflect the fact that it now handles both static and dynamic funnels. But first this refactors funnel_probe() making sure it can be used both for platform and AMBA drivers, by moving the pm_runtime_put() to the callers.
---
Changes in V7:
- Dropped reduntant drvdata check in funnel_platform_remove()
drivers/acpi/arm64/amba.c | 1 - .../hwtracing/coresight/coresight-funnel.c | 72 ++++++++++++------- 2 files changed, 48 insertions(+), 25 deletions(-)
drivers/acpi/arm64/amba.c +0 -1
@@ -28,7 +28,6 @@ static const struct acpi_device_id amba_id_list[] = { {"ARMHC979", 0}, /* ARM CoreSight TPIU */ {"ARMHC97C", 0}, /* ARM CoreSight SoC-400 TMC, SoC-600 ETF/ETB */ {"ARMHC9CA", 0}, /* ARM CoreSight CATU */ - {"ARMHC9FF", 0}, /* ARM CoreSight Dynamic Funnel */ {"", 0}, };
drivers/hwtracing/coresight/coresight-funnel.c +48 -24
164 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH v7 7/11 coresight: catu: Move ACPI support from AMBA driver to platform driver
In reply to Anshuman KhandualAdd support for the catu devices in a new platform driver, which can then be used on ACPI based platforms. This change would now allow runtime power management for ACPI based systems. The driver would try to enable the APB clock if available. But first this renames and then refactors catu_probe() and catu_remove(), making sure it can be used both for platform and AMBA drivers. This also moves pm_runtime_put() from catu_probe() to the callers.
---
Changes in V7:
- Dropped struct resource check before devm_ioremap_resource()
- Dropped reduntant drvdata check in catu_platform_probe()
- Dropped reduntant drvdata check in catu_platform_remove()
- Sorted the headers in alphabetic order
drivers/acpi/arm64/amba.c | 1 - drivers/hwtracing/coresight/coresight-catu.c | 138 ++++++++++++++++--- drivers/hwtracing/coresight/coresight-catu.h | 1 + 3 files changed, 120 insertions(+), 20 deletions(-)
drivers/acpi/arm64/amba.c +0 -1
@@ -27,7 +27,6 @@ static const struct acpi_device_id amba_id_list[] = { {"ARMHC503", 0}, /* ARM CoreSight Debug */ {"ARMHC979", 0}, /* ARM CoreSight TPIU */ {"ARMHC97C", 0}, /* ARM CoreSight SoC-400 TMC, SoC-600 ETF/ETB */ - {"ARMHC9CA", 0}, /* ARM CoreSight CATU */ {"", 0}, };
drivers/hwtracing/coresight/coresight-catu.c +119 -19
197 lines not on this page · raw message
drivers/hwtracing/coresight/coresight-catu.h +1 -0
@@ -61,6 +61,7 @@#define CATU_IRQEN_OFF 0x0struct catu_drvdata { +struct clk *pclk;void __iomem *base;struct coresight_device *csdev;int irq;
Signature · 1 line
2.25.1
PATCH v7 8/11 coresight: tpiu: Move ACPI support from AMBA driver to platform driver
In reply to Anshuman KhandualAdd support for the tpiu device in the platform driver, which can then be used on ACPI based platforms. This change would now allow runtime power management for ACPI based systems. The driver would try to enable the APB clock if available. But first this renames and then refactors tpiu_probe() and tpiu_remove(), making sure it can be used both for platform and AMBA drivers. This also moves pm_runtime_put() from tpiu_probe() to the callers. While here, this also sorts the included headers in alphabetic order.
---
Changes in V7:
- Dropped reduntant drvdata check in tpiu_platform_remove()
- Sorted the headers in alphabetic order
drivers/acpi/arm64/amba.c | 1 - drivers/hwtracing/coresight/coresight-tpiu.c | 117 ++++++++++++++++--- 2 files changed, 100 insertions(+), 18 deletions(-)
drivers/acpi/arm64/amba.c +0 -1
@@ -25,7 +25,6 @@ static const struct acpi_device_id amba_id_list[] = { {"ARMHC501", 0}, /* ARM CoreSight ETR */ {"ARMHC502", 0}, /* ARM CoreSight STM */ {"ARMHC503", 0}, /* ARM CoreSight Debug */ - {"ARMHC979", 0}, /* ARM CoreSight TPIU */ {"ARMHC97C", 0}, /* ARM CoreSight SoC-400 TMC, SoC-600 ETF/ETB */ {"", 0}, };
drivers/hwtracing/coresight/coresight-tpiu.c +100 -17
194 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH v7 9/11 coresight: tmc: Move ACPI support from AMBA driver to platform driver
In reply to Anshuman KhandualAdd support for the tmc devices in the platform driver, which can then be used on ACPI based platforms. This change would now allow runtime power management for ACPI based systems. The driver would try to enable the APB clock if available. But first this renames and then refactors tmc_probe() and tmc_remove(), making sure it can be used both for platform and AMBA drivers. This also moves pm_runtime_put() from tmc_probe() to the callers.
---
Changes in V7:
- Dropped reduntant drvdata check in tmc_platform_remove()
drivers/acpi/arm64/amba.c | 2 - .../hwtracing/coresight/coresight-tmc-core.c | 140 ++++++++++++++++-- drivers/hwtracing/coresight/coresight-tmc.h | 2 + 3 files changed, 127 insertions(+), 17 deletions(-)
drivers/acpi/arm64/amba.c +0 -2
@@ -22,10 +22,8 @@static const struct acpi_device_id amba_id_list[] = { {"ARMH0061" ,0 },/* PL061 GPIO Device */ {"ARMH0330" ,0 },/* ARM DMA Controller DMA-330 */ - {"ARMHC501" ,0 },/* ARM CoreSight ETR */ {"ARMHC502" ,0 },/* ARM CoreSight STM */ {"ARMHC503" ,0 },/* ARM CoreSight Debug */ - {"ARMHC97C" ,0 },/* ARM CoreSight SoC-400 TMC, SoC-600 ETF/ETB */ {"" ,0 }, };
drivers/hwtracing/coresight/coresight-tmc-core.c +125 -15
196 lines not on this page · raw message
drivers/hwtracing/coresight/coresight-tmc.h +2 -0
@@ -166,6 +166,7 @@ struct etr_buf {/** * struct tmc_drvdata - specifics associated to an TMC component +* @pclk: APB clock if present, otherwise NULL * @base: memory mapped base address for this component. * @csdev: component vitals needed by the framework. * @miscdev: specifics to handle "/dev/xyz.tmc" entry.
@@ -189,6 +190,7 @@ struct etr_buf {* @perf_buf: PERF buffer for ETR. */ struct tmc_drvdata { +struct clk *pclk;void __iomem *base;struct coresight_device *csdev;struct miscdevice miscdev;
Signature · 1 line
2.25.1
PATCH v7 10/11 coresight: stm: Move ACPI support from AMBA driver to platform driver
In reply to Anshuman KhandualAdd support for the stm devices in the platform driver, which can then be used on ACPI based platforms. This change would now allow runtime power management for ACPI based systems. The driver would try to enable the APB clock if available. But first this renames and then refactors stm_probe() and stm_remove(), making sure it can be used both for platform and AMBA drivers. Also this moves pm_runtime_put() from stm_probe() to the callers.
---
Changes in V7:
- Dropped reduntant drvdata check in stm_platform_remove()
drivers/acpi/arm64/amba.c | 1 - drivers/hwtracing/coresight/coresight-stm.c | 104 ++++++++++++++++++-- 2 files changed, 94 insertions(+), 11 deletions(-)
drivers/acpi/arm64/amba.c +0 -1
@@ -22,7 +22,6 @@static const struct acpi_device_id amba_id_list[] = { {"ARMH0061" ,0 },/* PL061 GPIO Device */ {"ARMH0330" ,0 },/* ARM DMA Controller DMA-330 */ - {"ARMHC502" ,0 },/* ARM CoreSight STM */ {"ARMHC503" ,0 },/* ARM CoreSight Debug */ {"" ,0 }, };
drivers/hwtracing/coresight/coresight-stm.c +94 -10
187 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH v7 11/11 coresight: debug: Move ACPI support from AMBA driver to platform driver
In reply to Anshuman KhandualAdd support for the cpu debug devices in a new platform driver, which can then be used on ACPI based platforms. This change would now allow runtime power management for ACPI based systems. The driver would try to enable the APB clock if available. But first this renames and then refactors debug_probe() and debug_remove(), making sure they can be used both for platform and AMBA drivers.
---
Changes in V7:
- Dropped struct resource check before devm_ioremap_resource()
- Dropped reduntant drvdata check in debug_platform_probe()
- Dropped reduntant drvdata check in debug_platform_remove()
- Sorted the headers in alphabetic order
drivers/acpi/arm64/amba.c | 1 - .../hwtracing/coresight/coresight-cpu-debug.c | 138 ++++++++++++++++-- 2 files changed, 122 insertions(+), 17 deletions(-)
drivers/acpi/arm64/amba.c +0 -1
@@ -22,7 +22,6 @@static const struct acpi_device_id amba_id_list[] = { {"ARMH0061" ,0 },/* PL061 GPIO Device */ {"ARMH0330" ,0 },/* ARM DMA Controller DMA-330 */ - {"ARMHC503" ,0 },/* ARM CoreSight Debug */ {"" ,0 }, };
drivers/hwtracing/coresight/coresight-cpu-debug.c +122 -16
191 lines not on this page · raw message
Signature · 1 line
2.25.1
Quoted 22 lines · Anshuman Khandual
This moves remaining AMBA ACPI devices into respective platform drivers for enabling ACPI based power management support. This series applies on latest coresight next. This series has been built, and boot tested on a DT based (RB5) and ACPI supported coresight platform (N1SDP).
https://git.gitlab.arm.com/linux-arm/linux-anshuman.git (
amba_other_acpi_migration_v7)Cc Lorenzo Pieralisi <[email protected]>Cc Sudeep Holla <[email protected]>Cc Suzuki K Poulose <[email protected]>Cc Mike Leach <[email protected]>Cc James Clark <[email protected]>Cc Maxime Coquelin <[email protected]>Cc Alexandre Torgue <[email protected]>Changes in V7:
Quoted 11 lines
- Dropped reduntant 'drvdata' check in following functions
replicator_platform_remove()funnel_platform_remove()
tpiu_platform_remove()
tmc_platform_remove()
catu_platform_remove()
catu_platform_probe()
debug_platform_remove()
debug_platform_probe()
- Dropped struct resource check beforedevm_ioremap_resource()
- Sorted the headers in alphabetic order
Hello Suzuki,
This series still applies cleanly on the latest v6.9-rc2. But please do let me know if you need this to be posted again.
- Anshuman
Quoted 8 lines · Anshuman Khandual
This moves remaining AMBA ACPI devices into respective platform drivers for enabling ACPI based power management support. This series applies on latest coresight next. This series has been built, and boot tested on a DT based (RB5) and ACPI supported coresight platform (N1SDP).
https://git.gitlab.arm.com/linux-arm/linux-anshuman.git (
amba_other_acpi_migration_v7)[...]
Applied, thanks!
[01/11] coresight: etm4x: Fix unbalanced pm_runtime_enable()
https://git.kernel.org/coresight/c/caa41c47dab7e1054f587e592ab21296e3a6781c [02/11] coresight: stm: Extract device name from AMBA pid based table lookup https://git.kernel.org/coresight/c/852e9a32058a73702c016a8be10c60375276e46e [03/11] coresight: tmc: Extract device properties from AMBA pid based table lookup https://git.kernel.org/coresight/c/3ab210297c31b8fef1cfb2aa3d85b227b9ace09b [04/11] coresight: Add helpers registering/removing both AMBA and platform drivers https://git.kernel.org/coresight/c/075b7cd7ad7dec8651a6a6654fa5ebae436ac00f [05/11] coresight: replicator: Move ACPI support from AMBA driver to platform driver https://git.kernel.org/coresight/c/b448c4c72ca3327232dfb20d0065b693b3fcc2e2 [06/11] coresight: funnel: Move ACPI support from AMBA driver to platform driver https://git.kernel.org/coresight/c/8e3227ddfbd7216f14186ec534f43e9dbcde717c [07/11] coresight: catu: Move ACPI support from AMBA driver to platform driver https://git.kernel.org/coresight/c/23567323857d2073197953bb158413be1aceca8b [08/11] coresight: tpiu: Move ACPI support from AMBA driver to platform driver https://git.kernel.org/coresight/c/3d83d4d4904a47626854b6bba44127d21a7dc713 [09/11] coresight: tmc: Move ACPI support from AMBA driver to platform driver https://git.kernel.org/coresight/c/70750e257aab4cd4d755294ae8b9834214a624bb [10/11] coresight: stm: Move ACPI support from AMBA driver to platform driver https://git.kernel.org/coresight/c/057256aaacc862356417a75ceeb1cfa41408dbf0 [11/11] coresight: debug: Move ACPI support from AMBA driver to platform driver https://git.kernel.org/coresight/c/965edae4e6a2bca1f6e56d2c56d992417a53bba4
Best regards,
Signature · 1 line
Suzuki K Poulose <[email protected]>