From: Guenter Roeck <private@roeck-us.net>
To: Dirk Behme <dirk.behme@de.bosch.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-next@vger.kernel.org" <linux-next@vger.kernel.org>,
Will Deacon <will.deacon@arm.com>
Subject: Re: linux-next: Crash in arm_pmu_device_probe() due to 'drivers/perf: arm_pmu: make info messages more verbose'
Date: Fri, 18 Mar 2016 06:30:25 -0700 [thread overview]
Message-ID: <56EC02F1.90903@roeck-us.net> (raw)
In-Reply-To: <56EBC7EC.6000907@de.bosch.com>
Hi Dirk,
On 03/18/2016 02:18 AM, Dirk Behme wrote:
> Hi Guenter,
>
> On 18.03.2016 07:44, Guenter Roeck wrote:
>> Hi,
>>
>> I am seeing the attached crash when running a realview-pb-a8 image with
>> realview_defconfig in qemu.
>> bisect wasn't successful, but a commit analysis identified commit
>> 'drivers/perf: arm_pmu: make info
>> messages more verbose' as the culprit. Reverting this commit fixes the
>> problem.
>>
>> The code roughly looks as follows.
>>
>> int arm_pmu_device_probe()
>> {
>> ...
>> if (node && ..) {
>> } else {
>> }
>>
>> if (ret) {
>> pr_info("%s: failed to probe PMU! Error %i\n",
>> node->full_name, ret);
>> goto out_free;
>> }
>> ....
>> out_free:
>> pr_info("%s: failed to register PMU devices! Error %i\n",
>> node->full_name, ret);
>> ....
>> }
>>
>> Note that 'node' is dereferenced even though it was previously checked
>> if it is NULL.
>> The configuration I am testing does not use devicetree.
>>
>> Can you use dev_info() instead ?
>
>
> Does anything like below [1] does work for you?
>
> If so, could you please share the output? I.e. what it prints in your non-devicetree non-pmu case?
>
This is what I get:
hw perfevents: probing PMU on CPU 0
armv7-pmu armv7-pmu: failed to probe PMU! Error -6
armv7-pmu armv7-pmu: failed to register PMU devices! Error -6
Another option might be to use of_node_full_name() (or even better
both dev_info() and of_node_full_name()).
Not sure though what you are looking for. '/soc/pmu_a53' doesn't
tell (me) much either, and I am not sure I understand the context
of the bug description. Why would the kernel try to initialize PMU
for a CPU which isn't online ? And if it really does, wouldn't it make
more sense to print CPU number and CPU ID instead of a devicetree
node name ?
Thanks,
Guenter
> Best regards
>
> Dirk
>
> [1]
>
> diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
> index 11bacc7..bda3502 100644
> --- a/drivers/perf/arm_pmu.c
> +++ b/drivers/perf/arm_pmu.c
> @@ -1002,8 +1002,7 @@ int arm_pmu_device_probe(struct platform_device *pdev,
> }
>
> if (ret) {
> - pr_info("%s: failed to probe PMU! Error %i\n",
> - node->full_name, ret);
> + dev_info(&pdev->dev, "failed to probe PMU! Error %i\n", ret);
> goto out_free;
> }
>
> @@ -1023,8 +1022,7 @@ int arm_pmu_device_probe(struct platform_device *pdev,
> out_destroy:
> cpu_pmu_destroy(pmu);
> out_free:
> - pr_info("%s: failed to register PMU devices! Error %i\n",
> - node->full_name, ret);
> + dev_info(&pdev->dev, "failed to register PMU devices! Error %i\n", ret);
> kfree(pmu);
> return ret;
> }
>
>
next prev parent reply other threads:[~2016-03-18 13:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-18 6:44 linux-next: Crash in arm_pmu_device_probe() due to 'drivers/perf: arm_pmu: make info messages more verbose' Guenter Roeck
2016-03-18 9:18 ` Dirk Behme
2016-03-18 13:30 ` Guenter Roeck [this message]
2016-03-21 7:02 ` Dirk Behme
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=56EC02F1.90903@roeck-us.net \
--to=private@roeck-us.net \
--cc=dirk.behme@de.bosch.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=will.deacon@arm.com \
/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).