From patchwork Wed Jul 3 11:07:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sibi Sankar X-Patchwork-Id: 13722093 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4BD6BC2BD09 for ; Wed, 3 Jul 2024 11:08:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=OWQnYlzEmKvztF5hGmcsCGk86Zr1SRLYRcSYeQnokE0=; b=YeThh7TvfQN9CypknT9YPj05+A RNS8+jAcxNkYzFFE0w60UXo2++JHEmXjsFCTwPcflm9FqZGyvh4ngxsN63CpOsB8jIgbrnZIqML2M LuVoAJRGhJ/Q2pQuXRzQJpFlw7/GK0L/JVSaIRNEI79rTNL58PZEE4btG5YIh1KaCXvgCOYcjsV+g hZgApjj89lhtiCKqkzt8gpy+2BxPUNW3I0p1ztz1MMbWur6FNJC44CbVWEhlnlydEBxW/pB3n0HXf uOQcEJVxY0t5l8Nhviy+91jSZSIq/8LAjiDOuVmTr4edbOO9MPJSU8VP7p9qB/4PyRg+QGjr3QoXf dm3EC2YA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOxqW-00000009y0R-0o7e; Wed, 03 Jul 2024 11:08:20 +0000 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOxqJ-00000009xyE-1sQq for linux-arm-kernel@lists.infradead.org; Wed, 03 Jul 2024 11:08:09 +0000 Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4632V650028807; Wed, 3 Jul 2024 11:08:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=OWQnYlzEmKvztF5hGmcsCG k86Zr1SRLYRcSYeQnokE0=; b=LfoeD0120dDRx0lxahbziBRdMh1rByTWw5vmHM OKBQLO+Y2p+bv4aDKXD0dmCEqIqWKJMGxi/uVRmfiqLW58MTp8j2svlGoemfKYOq rGTNFab+bRJp6PfayhAhb0sSqG2RIKxVCOBptxVrE5hV9zxSM00oNLyqV+Rua0T9 bIz2jAu0b+9gSWBbwH42k9FpCSt+6Ye+tc0iK6NTtjCPQ6PWiUp5KEFyWDHebTra QWhHjCAMNAuFwJzeg0ITai7SfN/VO/Acv9UZMK3zJB4xcnBSv4arIXYeJ/waE/Ax j+vQzvb/pvJ2lVwqdlMkYiY1yKXlU1Vf9Podv7DE4qMlHR3A== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 404kctjus0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 03 Jul 2024 11:08:00 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 463B7xWu002896 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 3 Jul 2024 11:07:59 GMT Received: from hu-sibis-blr.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Wed, 3 Jul 2024 04:07:55 -0700 From: Sibi Sankar To: , , CC: , , , , , , , , Subject: [PATCH] pmdomain: arm: Fix debugfs node creation failure Date: Wed, 3 Jul 2024 16:37:41 +0530 Message-ID: <20240703110741.2668800-1-quic_sibis@quicinc.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: Cv0fOm5Kl8mxrnMeudx36UyMankDpKtK X-Proofpoint-ORIG-GUID: Cv0fOm5Kl8mxrnMeudx36UyMankDpKtK X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-03_06,2024-07-03_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 adultscore=0 bulkscore=0 mlxlogscore=673 priorityscore=1501 impostorscore=0 suspectscore=0 mlxscore=0 lowpriorityscore=0 clxscore=1011 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2407030082 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240703_040807_521499_30D2BD03 X-CRM114-Status: GOOD ( 13.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The domain attributes returned by the perf protocol can end up reporting identical names across domains, resulting in debugfs node creation failure. Fix this duplication by appending the domain-id to the domain name. Logs: debugfs: Directory 'NCC' with parent 'pm_genpd' already present! debugfs: Directory 'NCC' with parent 'pm_genpd' already present! Fixes: 2af23ceb8624 ("pmdomain: arm: Add the SCMI performance domain") Signed-off-by: Sibi Sankar Reported-by: Johan Hovold --- drivers/pmdomain/arm/scmi_perf_domain.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/pmdomain/arm/scmi_perf_domain.c b/drivers/pmdomain/arm/scmi_perf_domain.c index d7ef46ccd9b8..0af5dc941349 100644 --- a/drivers/pmdomain/arm/scmi_perf_domain.c +++ b/drivers/pmdomain/arm/scmi_perf_domain.c @@ -18,6 +18,7 @@ struct scmi_perf_domain { const struct scmi_perf_proto_ops *perf_ops; const struct scmi_protocol_handle *ph; const struct scmi_perf_domain_info *info; + char domain_name[SCMI_MAX_STR_SIZE]; u32 domain_id; }; @@ -123,7 +124,12 @@ static int scmi_perf_domain_probe(struct scmi_device *sdev) scmi_pd->domain_id = i; scmi_pd->perf_ops = perf_ops; scmi_pd->ph = ph; - scmi_pd->genpd.name = scmi_pd->info->name; + + /* Domain attributes can report identical names across domains */ + snprintf(scmi_pd->domain_name, sizeof(scmi_pd->domain_name), "%s-%d", + scmi_pd->info->name, scmi_pd->domain_id); + + scmi_pd->genpd.name = scmi_pd->domain_name; scmi_pd->genpd.flags = GENPD_FLAG_ALWAYS_ON | GENPD_FLAG_OPP_TABLE_FW; scmi_pd->genpd.set_performance_state = scmi_pd_set_perf_state;