All of lore.kernel.org
 help / color / mirror / Atom feed
From: punit.agrawal@arm.com (Punit Agrawal)
To: linux-arm-kernel@lists.infradead.org
Subject: [Patch v3 3/3] drivers: CCI: add ARM CCI PMU support
Date: Fri, 30 Aug 2013 15:34:03 +0100	[thread overview]
Message-ID: <5220AD5B.2090300@arm.com> (raw)
In-Reply-To: <20130830112448.GC12160@mudshark.cambridge.arm.com>

On 30/08/13 12:24, Will Deacon wrote:
> Hi Punit,
>
> On Thu, Aug 22, 2013 at 04:02:28PM +0100, Punit Agrawal wrote:
>> Extend the existing CCI driver to support the PMU by registering a perf
>> backend for it.
>>
>> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
>> Cc: Nicolas Pitre <nico@linaro.org>
>> Cc: Dave Martin <dave.martin@linaro.org>
>> Cc: Will Deacon <will.deacon@arm.com>
>> Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
>> Reviewed-by: Will Deacon <will.deacon@arm.com>
>> ---
>>   drivers/bus/arm-cci.c |  628 +++++++++++++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 628 insertions(+)
>
> [...]
>
>> +static int cci_platform_probe(struct platform_device *pdev)
>> +{
>> +       if (!cci_probed())
>> +               return -ENODEV;
>> +
>> +       return of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
>> +}
>
> cci_probed is marked as __init, so you have a section mismatch here:
>
>    arch/arm/kernel/return_address.c:63:2: warning: #warning "TODO: return_address should use unwind tables" [-Wcpp]
>    WARNING: drivers/bus/built-in.o(.text+0xb48): Section mismatch in reference from the function cci_platform_probe() to the function .init.text:cci_probed()
>    The function cci_platform_probe() references
>    the function __init cci_probed().
>    This is often because cci_platform_probe lacks a __init
>    annotation or the annotation of cci_probed is wrong.
>

Good catch. Missed this one.

> Unfortunately, resolving this requires removing a bunch of annotations (see
> patch below), so you might want to reconsider how the probe checking is
> handled (by moving the cci_init_status check out of cci_init).
>

In cci_platform_probe, cci_probed is called to check whether the CCI has 
been initialised, and also to initialise it if required.

Even if the check for cci_init_status is moved out, I'll still need to 
call cci_init which will again cause a section mis-match.

I think removing the annotations is the way to go. Is it OK to fold your 
patch into the CCI PMU patch, or you prefer to keep it separate?

Cheers,
Punit

> Will
>
> --->8
>
> diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c
> index ddc36f6..4816759 100644
> --- a/drivers/bus/arm-cci.c
> +++ b/drivers/bus/arm-cci.c
> @@ -711,7 +711,7 @@ int cci_ace_get_port(struct device_node *dn)
>   }
>   EXPORT_SYMBOL_GPL(cci_ace_get_port);
>
> -static void __init cci_ace_init_ports(void)
> +static void cci_ace_init_ports(void)
>   {
>          int port, ac, cpu;
>          u64 hwid;
> @@ -991,7 +991,7 @@ static const struct of_device_id arm_cci_ctrl_if_matches[] = {
>          {},
>   };
>
> -static int __init cci_probe(void)
> +static int cci_probe(void)
>   {
>          struct cci_nb_ports const *cci_config;
>          int ret, i, nb_ace = 0, nb_ace_lite = 0;
> @@ -1095,7 +1095,7 @@ memalloc_err:
>   static int cci_init_status = -EAGAIN;
>   static DEFINE_MUTEX(cci_probing);
>
> -static int __init cci_init(void)
> +static int cci_init(void)
>   {
>          if (cci_init_status != -EAGAIN)
>                  return cci_init_status;
> @@ -1149,7 +1149,7 @@ static int __init cci_platform_init(void)
>    * has been initialized, if not it calls the init function that probes
>    * the driver and updates the return value.
>    */
> -bool __init cci_probed(void)
> +bool cci_probed(void)
>   {
>          return cci_init() == 0;
>   }
>
>
>

  reply	other threads:[~2013-08-30 14:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-22 15:02 [Patch v3 0/3] Add CCI PMU support Punit Agrawal
2013-08-22 15:02 ` [Patch v3 1/3] ARM: dts: Improve CCI bindings documentation Punit Agrawal
2013-08-22 22:15   ` Stephen Warren
2013-08-22 15:02 ` [Patch v3 2/3] ARM: dts: Document the CCI PMU DT bindings Punit Agrawal
2013-08-22 22:17   ` Stephen Warren
2013-08-23  9:56     ` Punit Agrawal
2013-08-30 13:59   ` Jon Medhurst (Tixy)
2013-08-30 13:59     ` Jon Medhurst (Tixy)
2013-08-30 14:36     ` Punit Agrawal
2013-08-30 14:36       ` Punit Agrawal
2013-08-30 16:17   ` Kumar Gala
2013-08-30 16:17     ` Kumar Gala
2013-09-04 12:26     ` Punit Agrawal
2013-09-04 12:26       ` Punit Agrawal
2013-09-05 12:51       ` Will Deacon
2013-09-05 12:51         ` Will Deacon
2013-08-22 15:02 ` [Patch v3 3/3] drivers: CCI: add ARM CCI PMU support Punit Agrawal
2013-08-30 11:24   ` Will Deacon
2013-08-30 14:34     ` Punit Agrawal [this message]
2013-08-30 14:37       ` Will Deacon

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=5220AD5B.2090300@arm.com \
    --to=punit.agrawal@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.