Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752693AbcCUHC6 (ORCPT ); Mon, 21 Mar 2016 03:02:58 -0400 Received: from smtp6-v.fe.bosch.de ([139.15.237.11]:60840 "EHLO smtp6-v.fe.bosch.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752569AbcCUHCs (ORCPT ); Mon, 21 Mar 2016 03:02:48 -0400 Subject: Re: linux-next: Crash in arm_pmu_device_probe() due to 'drivers/perf: arm_pmu: make info messages more verbose' To: Guenter Roeck References: <56EBA3C3.10907@roeck-us.net> <56EBC7EC.6000907@de.bosch.com> <56EC02F1.90903@roeck-us.net> CC: "linux-kernel@vger.kernel.org" , "linux-next@vger.kernel.org" , Will Deacon From: Dirk Behme Organization: Robert Bosch Car Multimedia GmbH Message-ID: <56EF9C93.1030007@de.bosch.com> Date: Mon, 21 Mar 2016 08:02:43 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <56EC02F1.90903@roeck-us.net> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.34.217.168] X-TM-AS-MML: disable X-TM-AS-Product-Ver: IMSS-7.1.0.1679-8.0.0.1202-22204.006 X-TMASE-MatchedRID: vEvJ7Rh1lGjoSitJVour/Sa1MaKuob8Pt3aeg7g/usDkMnUVL5d0Ezur Vh7NYTzj3CqjRB/5O61FxD71JMaSRAAlmTJXSGlm4RtSDjG+z7DSL+EVfOJR08lgi/vLS272fAq ezVEoJcKLskPiaWiwhIIkS2U7FTVbszLAY5oHhBCwr5ZZVOw5deWNJG9IamrcrY9uF6odMlwHtd YFc57FhcRMagjlsxrM/Jz+1598eUCGrovtAHQqCZmug812qIbz0w14HFJQjaNtw+n+iKWyyGdR3 KZbtfZIF8ERjV+S3GysPpIvfPu7mrwgpqcke+dmbBu6+EIezdwwCmrLlx+SdRwKSCi0KXuELdvR /W5soAq6QVoWQ9ThAGb0G/ynpIMKR+vpYbhOH1qeAiCmPx4NwLTrdaH1ZWqC1B0Hk1Q1KyLUZxE AlFPo846HM5rqDwqt7J5l7XWEFzvEarQYVHprNBXV/xNaWAZQWRdje0jFnCGb/d1OmDA2tEMMpr cbiest Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2420 Lines: 77 On 18.03.2016 14:30, Guenter Roeck wrote: > 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 ? I have a device tree based ARMv8 Cortex A57 / Cortex A53 based system. The Cortex A57 are always starting fine, but based on some firmware issues the Cortex A53 are sometimes online, sometimes not. But enabling the PMUs is always in the device tree, which fails some times then, too. With the initial non-verbose PMU error messages I needed some time to find out that the error messages were due to the Cortex A53 not being online. And I thought it would help to debug similar cases to make this more verbose. Best regards Dirk