From patchwork Mon Mar 27 09:49:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tao Zhang X-Patchwork-Id: 75329 Return-Path: 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 + 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 ); 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 To: Mathieu Poirier , Suzuki K Poulose , Alexander Shishkin , Konrad Dybcio , Mike Leach , Rob Herring , Krzysztof Kozlowski CC: Tao Zhang , Jinlong Mao , Leo Yan , Greg Kroah-Hartman , , , , , Tingwei Zhang , Yuanfang Zhang , Trilok Soni , Hao Zhang , , 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 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: 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?= 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); - else + } else cti_desc.name = coresight_alloc_device_name(&cti_sys_devs, dev); if (!cti_desc.name) return -ENOMEM;