From: Suzuki K Poulose <suzuki.poulose@arm.com>
To: mike.leach@linaro.org
Cc: mathieu.poirier@linaro.org, coresight@lists.linaro.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v4 17/30] coresight: Make device to CPU mapping generic
Date: Thu, 6 Jun 2019 13:56:23 +0100 [thread overview]
Message-ID: <cb81b7e6-f698-6f90-411f-419598284477@arm.com> (raw)
In-Reply-To: <CAJ9a7ViQq-bdAw7HOOkSxinC0jhRjpAr-oJVv5GLHfBRpFu6hw@mail.gmail.com>
On 03/06/2019 11:07, Mike Leach wrote:
> Hi,
>
> On Wed, 22 May 2019 at 11:37, Suzuki K Poulose <suzuki.poulose@arm.com> wrote:
>>
>> The CoreSight components ETM and CPU-Debug are always associated
>> with CPUs. Replace the of_coresight_get_cpu() with a platform
>> agnostic helper, in preparation to add ACPI support.
>>
>> Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
>> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
>> ---
>> drivers/hwtracing/coresight/coresight-cpu-debug.c | 3 +--
>> drivers/hwtracing/coresight/coresight-platform.c | 18 +++++++++++++-----
>> include/linux/coresight.h | 7 +------
>> 3 files changed, 15 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/hwtracing/coresight/coresight-cpu-debug.c b/drivers/hwtracing/coresight/coresight-cpu-debug.c
>> index e8819d7..07a1367 100644
>> --- a/drivers/hwtracing/coresight/coresight-cpu-debug.c
>> +++ b/drivers/hwtracing/coresight/coresight-cpu-debug.c
>> @@ -572,14 +572,13 @@ static int debug_probe(struct amba_device *adev, const struct amba_id *id)
>> struct device *dev = &adev->dev;
>> struct debug_drvdata *drvdata;
>> struct resource *res = &adev->res;
>> - struct device_node *np = adev->dev.of_node;
>> int ret;
>>
>> drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
>> if (!drvdata)
>> return -ENOMEM;
>>
>> - drvdata->cpu = np ? of_coresight_get_cpu(np) : 0;
>> + drvdata->cpu = coresight_get_cpu(dev);
>> if (per_cpu(debug_drvdata, drvdata->cpu)) {
>> dev_err(dev, "CPU%d drvdata has already been initialized\n",
>> drvdata->cpu);
>> diff --git a/drivers/hwtracing/coresight/coresight-platform.c b/drivers/hwtracing/coresight/coresight-platform.c
>> index 5d78f4f..ba8c146 100644
>> --- a/drivers/hwtracing/coresight/coresight-platform.c
>> +++ b/drivers/hwtracing/coresight/coresight-platform.c
>> @@ -151,12 +151,14 @@ static void of_coresight_get_ports(const struct device_node *node,
>> }
>> }
>>
>> -int of_coresight_get_cpu(const struct device_node *node)
>> +static int of_coresight_get_cpu(struct device *dev)
>> {
>> int cpu;
>> struct device_node *dn;
>>
>> - dn = of_parse_phandle(node, "cpu", 0);
>> + if (!dev->of_node)
>> + return 0;
>> + dn = of_parse_phandle(dev->of_node, "cpu", 0);
>> /* Affinity defaults to CPU0 */
>> if (!dn)
>> return 0;
>> @@ -166,7 +168,6 @@ int of_coresight_get_cpu(const struct device_node *node)
>> /* Affinity to CPU0 if no cpu nodes are found */
>> return (cpu < 0) ? 0 : cpu;
>> }
>> -EXPORT_SYMBOL_GPL(of_coresight_get_cpu);
>>
>> /*
>> * of_coresight_parse_endpoint : Parse the given output endpoint @ep
>> @@ -240,8 +241,6 @@ static int of_get_coresight_platform_data(struct device *dev,
>> bool legacy_binding = false;
>> struct device_node *node = dev->of_node;
>>
>> - pdata->cpu = of_coresight_get_cpu(node);
>> -
>> /* Get the number of input and output port for this component */
>> of_coresight_get_ports(node, &pdata->nr_inport, &pdata->nr_outport);
>>
>> @@ -300,6 +299,14 @@ of_get_coresight_platform_data(struct device *dev,
>> }
>> #endif
>>
>> +int coresight_get_cpu(struct device *dev)
>> +{
>> + if (is_of_node(dev->fwnode))
>> + return of_coresight_get_cpu(dev);
>
> No of_coresight_get_cpu() will be defined if CONFIG_OF _not_ defined.
> This will hit an implicit declaration compile error in this case.
Thanks for catching it and you're right. I will fix this.
Cheers
Suzuki
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-06-06 12:56 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-22 10:34 [PATCH v4 00/30] coresight: Support for ACPI bindings Suzuki K Poulose
2019-05-22 10:34 ` [PATCH v4 01/30] coresight: funnel: Clean up device book keeping Suzuki K Poulose
2019-05-22 10:34 ` [PATCH v4 02/30] coresight: replicator: Cleanup device tracking Suzuki K Poulose
2019-05-22 10:34 ` [PATCH v4 03/30] coresight: tmc: Clean up device specific data Suzuki K Poulose
2019-05-22 10:34 ` [PATCH v4 04/30] coresight: catu: Cleanup " Suzuki K Poulose
2019-05-22 10:34 ` [PATCH v4 05/30] coresight: tpiu: Clean up " Suzuki K Poulose
2019-05-22 10:34 ` [PATCH v4 06/30] coresight: stm: Cleanup " Suzuki K Poulose
2019-05-22 10:34 ` [PATCH v4 07/30] coresight: etm: Clean up " Suzuki K Poulose
2019-05-22 10:34 ` [PATCH v4 08/30] coresight: etb10: " Suzuki K Poulose
2019-05-22 10:34 ` [PATCH v4 09/30] coresight: Use coresight device names for sinks in PMU attribute Suzuki K Poulose
2019-05-22 10:34 ` [PATCH v4 10/30] coresight: Rename of_coresight to coresight-platform Suzuki K Poulose
2019-05-22 10:34 ` [PATCH v4 11/30] coresight: etm3x: Rearrange cp14 access detection Suzuki K Poulose
2019-05-22 10:34 ` [PATCH v4 12/30] coresight: stm: Rearrange probing the stimulus area Suzuki K Poulose
2019-05-22 10:34 ` [PATCH v4 13/30] coresight: tmc-etr: Rearrange probing default buffer size Suzuki K Poulose
2019-05-22 10:34 ` [PATCH v4 14/30] coresight: platform: Make memory allocation helper generic Suzuki K Poulose
2019-05-22 10:34 ` [PATCH v4 15/30] coresight: Make sure device uses DT for obsolete compatible check Suzuki K Poulose
2019-05-22 10:34 ` [PATCH v4 16/30] coresight: Introduce generic platform data helper Suzuki K Poulose
2019-05-22 10:34 ` [PATCH v4 17/30] coresight: Make device to CPU mapping generic Suzuki K Poulose
2019-06-03 10:07 ` Mike Leach
2019-06-06 12:56 ` Suzuki K Poulose [this message]
2019-05-22 10:34 ` [PATCH v4 18/30] coresight: Remove cpu field from platform data Suzuki K Poulose
2019-05-22 10:34 ` [PATCH v4 19/30] coresight: Remove name from platform description Suzuki K Poulose
2019-05-22 10:34 ` [PATCH v4 20/30] coresight: Cleanup coresight_remove_conns Suzuki K Poulose
2019-05-22 10:34 ` [PATCH v4 21/30] coresight: Reuse platform data structure for connection tracking Suzuki K Poulose
2019-05-22 10:34 ` [PATCH v4 22/30] coresight: Rearrange platform data probing Suzuki K Poulose
2019-05-22 10:34 ` [PATCH v4 23/30] coresight: Add support for releasing platform specific data Suzuki K Poulose
2019-05-22 10:34 ` [PATCH v4 24/30] coresight: platform: Use fwnode handle for device search Suzuki K Poulose
2019-05-22 10:34 ` [PATCH v4 25/30] coresight: Use fwnode handle instead of device names Suzuki K Poulose
2019-05-22 10:34 ` [PATCH v4 26/30] coresight: Use platform agnostic names Suzuki K Poulose
2019-05-29 9:32 ` Mike Leach
2019-06-03 10:12 ` Suzuki K Poulose
2019-05-22 10:35 ` [PATCH v4 27/30] coresight: stm: ACPI support for parsing stimulus base Suzuki K Poulose
2019-05-22 10:35 ` [PATCH v4 28/30] coresight: Support for ACPI bindings Suzuki K Poulose
2019-05-22 10:35 ` [PATCH v4 29/30] coresight: acpi: Support for AMBA components Suzuki K Poulose
2019-05-22 10:35 ` [PATCH v4 30/30] coresight: acpi: Support for platform devices Suzuki K Poulose
2019-05-22 10:35 ` [TEST PATCH 31/30][EDK2] edk2-platform: juno: Update ACPI CoreSight Bindings Suzuki K Poulose
2019-05-23 13:37 ` [PATCH v4 00/30] coresight: Support for ACPI bindings Suzuki K Poulose
2019-05-23 14:32 ` Leo Yan
2019-05-23 15:31 ` Suzuki K Poulose
2019-05-24 1:38 ` Leo Yan
2019-05-24 13:19 ` Mike Leach
2019-05-28 5:19 ` Leo Yan
2019-05-28 8:08 ` Leo Yan
2019-05-28 14:51 ` Mathieu Poirier
2019-05-29 6:34 ` Leo Yan
2019-05-28 17:32 ` Mathieu Poirier
2019-05-28 17:36 ` Mathieu Poirier
2019-05-28 17:40 ` Suzuki K Poulose
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cb81b7e6-f698-6f90-411f-419598284477@arm.com \
--to=suzuki.poulose@arm.com \
--cc=coresight@lists.linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=mike.leach@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).