Message ID | 1679910560-23469-1-git-send-email-quic_taozha@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1387216vqo; Mon, 27 Mar 2023 02:52:48 -0700 (PDT) X-Google-Smtp-Source: AKy350avJaFrpWVEdzGgCbfbbY92vxYsBUanNwR73jbfpKgr/Tbk+t1QLAmK3SCeaGV/Q8Ic2LZ6 X-Received: by 2002:a17:906:3a43:b0:932:aa80:406 with SMTP id a3-20020a1709063a4300b00932aa800406mr13215945ejf.32.1679910767418; Mon, 27 Mar 2023 02:52:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679910767; cv=none; d=google.com; s=arc-20160816; b=lIr5QlfKB/k1WqRlMYkVk3NrwPuHUGuatys4oP0FKi6AHVF2WY67lxggf/SJpPVowJ QgRkdX+SdxRhN7DEPu/SSDmh4ih5BTcU8tMil65fH8V+NQBFBMwBaCwU1lLOOVPfGJAB bq/1aDsFDX8XaXeglzP0mK0PFVngsKm0/ZdKusVXq5HkOnn11ZDwyDCCH2CJaslhSh36 Owa/R7ttKGWIDJDT28gPb3013g7d4MBnA6ySyLcgV8VsNH17l22jCpEoixoxnjtEaYLV h2K9zHVhI33G7G8Tjb6gBZMVJQRMp2AK9REclO86ihBB1R3kZ35ibdsjl9f5TK43apbP Zg3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=oS+hBJb9vkKxePNAcrapTq00m2jJWTChzFWKxBvsVwk=; b=tSfix5ZhR8wQK0V5vBgk1j3MKal8PKECDsJ0dX08lfBjJ2N85DSorFw33wYMzvNqKQ zQVXsqUuWET8acXjSCUBwuUy+B/jJGgU1fKdZHHPVcLs6SCa2FFQD5h4x+ejCxzulyDF Oo2feaqWDQc0W4GVNztzszwobLZ6OniCWVF6gcluF9A6TqMBMZ9aeG2/k92ToVU4Pk9D ZH6QeLsuQfafd4lKs6xCpkUBiJfryMBp3tWfgrL6nDzeRE6AG4jEGOdbxfX/V/S95yFp aZa2Bxoidz2LmGrJ9m3+BwY1grrYGrTHLdqnRo/a/kpQoK59bDx/tviEEgHbuVyldiXN Lqeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=U8qiaC6w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l20-20020a170906795400b00933f92e9917si20804346ejo.371.2023.03.27.02.52.23; Mon, 27 Mar 2023 02:52:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=U8qiaC6w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232439AbjC0JuO (ORCPT <rfc822;makky5685@gmail.com> + 99 others); Mon, 27 Mar 2023 05:50:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233009AbjC0JuG (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 27 Mar 2023 05:50:06 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 460B759E2; Mon, 27 Mar 2023 02:50:03 -0700 (PDT) Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32R8K3db002800; Mon, 27 Mar 2023 09:49:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=qcppdkim1; bh=oS+hBJb9vkKxePNAcrapTq00m2jJWTChzFWKxBvsVwk=; b=U8qiaC6wNmWkGRog4KnrhJDMuv9buJd+idOClI4zj4knM5uVbuTsvB74zQVPRGTWVTGI vOonXwKDcjfB8R6VgP0ZEPDg0h9KYYAEopsbudmxPLh2QqHoxJrVvKwRLsTeMF0YbtoG E5AW9U343qtj3tAVEruNJ/bM/zGb5iL0jDwuIIjXAsNFhuFawecZ23rhFHpyWWNHdSF3 L0FESpAC9uWntZ4ucfba6AfRnC8EpJ+Flq0g7/quIwvpWpz6LELx/LaxzGP5RlWf2MXU E5ZC6DoKyJ8Fs0iRhZIzyrjU/E5zUrroWvUR6oICWKERQK8oSGlqHNSrcCaTUF4YIusA 7Q== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3pk7h8r6vs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Mar 2023 09:49:49 +0000 Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 32R9nmHr024809 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Mar 2023 09:49:48 GMT Received: from taozha-gv.qualcomm.com (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 27 Mar 2023 02:49:43 -0700 From: Tao Zhang <quic_taozha@quicinc.com> To: Mathieu Poirier <mathieu.poirier@linaro.org>, Suzuki K Poulose <suzuki.poulose@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Konrad Dybcio <konradybcio@gmail.com>, Mike Leach <mike.leach@linaro.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org> CC: Tao Zhang <quic_taozha@quicinc.com>, Jinlong Mao <quic_jinlmao@quicinc.com>, Leo Yan <leo.yan@linaro.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, <coresight@lists.linaro.org>, <linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>, Tingwei Zhang <quic_tingweiz@quicinc.com>, Yuanfang Zhang <quic_yuanfang@quicinc.com>, Trilok Soni <quic_tsoni@quicinc.com>, Hao Zhang <quic_hazha@quicinc.com>, <linux-arm-msm@vger.kernel.org>, <andersson@kernel.org> Subject: [PATCH] coresight: cti: Check if the CPU activated for the CPU CTI Date: Mon, 27 Mar 2023 17:49:20 +0800 Message-ID: <1679910560-23469-1-git-send-email-quic_taozha@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: NkyfZOnNuAnRTYGkD0QAnYDrP5ywxOTu X-Proofpoint-ORIG-GUID: NkyfZOnNuAnRTYGkD0QAnYDrP5ywxOTu X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-24_11,2023-03-24_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 spamscore=0 bulkscore=0 impostorscore=0 malwarescore=0 adultscore=0 lowpriorityscore=0 clxscore=1015 mlxlogscore=999 phishscore=0 priorityscore=1501 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303270080 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761514112933994215?= X-GMAIL-MSGID: =?utf-8?q?1761514112933994215?= |
Series |
coresight: cti: Check if the CPU activated for the CPU CTI
|
|
Commit Message
Tao Zhang
March 27, 2023, 9:49 a.m. UTC
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 <quic_taozha@quicinc.com>
---
drivers/hwtracing/coresight/coresight-cti-core.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Comments
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 <quic_taozha@quicinc.com> > --- > 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;
On 27/03/2023 15:28, Tao Zhang wrote: > Hi Suzuki, > > On 3/27/2023 5:52 PM, Suzuki K Poulose wrote: >> 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 <quic_taozha@quicinc.com> >>> --- >>> 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 > > We found that when the CPU core is disabled, for example, CPU3 is > disabled, but > > CPU3 CTI node corresponding to CPU3 still exists. In fact, in this case, > CPU3 CTI > > has been unable to trigger CPU3 properly since CPU3 is in an inactive > state. This change > > is to avoid configuring the CPU CTI of the CPU that has been disabled in > this case. Who is configuring the trigger ? Shouldn't we skip "enabling" the CTI when the associated CPU is inactive instead ? Disabling the probe with an error doesn't solve the problem. What if the CPU becomes active later ? What makes sure that the CTI is probed then ? Suzuki > > Tao > >> >> >>> - else >>> + } else >>> cti_desc.name = coresight_alloc_device_name(&cti_sys_devs, >>> dev); >>> if (!cti_desc.name) >>> return -ENOMEM; >>
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); - else + } else cti_desc.name = coresight_alloc_device_name(&cti_sys_devs, dev); if (!cti_desc.name) return -ENOMEM;