From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2294C761AF for ; Mon, 27 Mar 2023 09:52:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232935AbjC0JwL (ORCPT ); Mon, 27 Mar 2023 05:52:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232818AbjC0JwJ (ORCPT ); Mon, 27 Mar 2023 05:52:09 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4EAB149CA; Mon, 27 Mar 2023 02:52:07 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2A42E4B3; Mon, 27 Mar 2023 02:52:51 -0700 (PDT) Received: from [10.1.197.1] (ewhatever.cambridge.arm.com [10.1.197.1]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A165E3F73F; Mon, 27 Mar 2023 02:52:04 -0700 (PDT) Message-ID: <9c7f6414-ac5c-bee2-7068-04a7ee7d94f9@arm.com> Date: Mon, 27 Mar 2023 10:52:03 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH] coresight: cti: Check if the CPU activated for the CPU CTI Content-Language: en-US To: Tao Zhang , Mathieu Poirier , Alexander Shishkin , Konrad Dybcio , Mike Leach , Rob Herring , Krzysztof Kozlowski Cc: Jinlong Mao , Leo Yan , Greg Kroah-Hartman , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Tingwei Zhang , Yuanfang Zhang , Trilok Soni , Hao Zhang , linux-arm-msm@vger.kernel.org, andersson@kernel.org References: <1679910560-23469-1-git-send-email-quic_taozha@quicinc.com> From: Suzuki K Poulose In-Reply-To: <1679910560-23469-1-git-send-email-quic_taozha@quicinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27/03/2023 10:49, Tao Zhang wrote: > Check whether the CPU corresponding to the CPU CTI is activated. > If it is not activated, the CPU CTI node should not exist, and > an error will be returned in the initialization function. > > Signed-off-by: Tao Zhang > --- > drivers/hwtracing/coresight/coresight-cti-core.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/hwtracing/coresight/coresight-cti-core.c b/drivers/hwtracing/coresight/coresight-cti-core.c > index 277c890..aaa83ae 100644 > --- a/drivers/hwtracing/coresight/coresight-cti-core.c > +++ b/drivers/hwtracing/coresight/coresight-cti-core.c > @@ -899,10 +899,12 @@ static int cti_probe(struct amba_device *adev, const struct amba_id *id) > drvdata->config.hw_powered = true; > > /* set up device name - will depend if cpu bound or otherwise */ > - if (drvdata->ctidev.cpu >= 0) > + if (drvdata->ctidev.cpu >= 0) { > + if (!cpu_active(drvdata->ctidev.cpu)) > + return -ENXIO; > cti_desc.name = devm_kasprintf(dev, GFP_KERNEL, "cti_cpu%d", > drvdata->ctidev.cpu); But why ? As long as we do not enable or touch any CPU specific bits in the probe, why do we need to fail this ? What are you trying to fix ? Please could you share the log if you are hitting something ? This looks like masking a problem. Suzuki > - else > + } else > cti_desc.name = coresight_alloc_device_name(&cti_sys_devs, dev); > if (!cti_desc.name) > return -ENOMEM;