From nobody Fri Dec 19 13:50:37 2025 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 486EE30171F for ; Tue, 2 Dec 2025 06:43:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764657804; cv=none; b=X9bpsWOuo4KY1ukpXmyd31lIzzUQTw24IzASh8kVLJetOGGG5VvC5HYztMY2b5uha8hGvgrwlRayjaC+pde/mgz7bFJ9iiyfxG3wGwhoHi2RZOCane6Syq5IyKuVy2J/02KwgTitPKMRBNter7d8jTJ/ScyF7sa6i2hEEu1wuSY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764657804; c=relaxed/simple; bh=EHk3TrdZcUh7JFRp0sXEzGfbX5tPAbR/co7dEigVes4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=D64kMgJOgvnflf4fPRz3I8aKkHPVXbVN1gxsHj4eyFLCkoYPxbBmWfXiEjDBAAjyUzAMNY1yoC7AQSm9xaZJigJE8+trEEl9Vb26hNT6LeFtLRInXdEO/By35/cLfa/qUekpK1bVEI3qPxTouElvFxfXFb4cI+1JPZ7Vz+n29jw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=jFUmtDKB; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=FTpaq04Y; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="jFUmtDKB"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="FTpaq04Y" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5B2300JI1090992 for ; Tue, 2 Dec 2025 06:43:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= U4CEPosLk4c8VO1ED7x/05VLZq/brB7mPtuz/Jxmq8A=; b=jFUmtDKB7kyAvsfs Pzm3Ouv06eEskmYHbf0WWPD9htXOn7iRky0pfD2/vIWWzwGV1tmfUW5yQO6Noy0p aPFpys+TdHKf1ov8edJ4PcB8RUfmAFfiW8ULfxQCqf0Lofmp96+pgv9I2lJr5HKo q1cAdkpNGGDaMElWRz/N+agnnUbSgCEoRX5jHWp0P48UY7AxrOloAVacL/UBjj4e b8Wrhao7FV3uML9sFePBDcmGrcHHvaLpgKQsQ4t09tSikNXEiM04Rp7MwggTXzcY CeJoOtpSd6PtCM1zPG//Q4gBCgGyt1RSw2msFcchVHAcTkgOF5eIyf0SXEYzBlCF 5dY52w== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4asfu126n2-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 02 Dec 2025 06:43:20 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-297fbfb4e53so77803565ad.1 for ; Mon, 01 Dec 2025 22:43:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1764657800; x=1765262600; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=U4CEPosLk4c8VO1ED7x/05VLZq/brB7mPtuz/Jxmq8A=; b=FTpaq04YeIwOQB0baQviYzLZbbtQqhQUKNMB2WJfKyt62QGbXRYRZLoIyYDffFlT62 D6Aj4PeQTb6705EnwwkFHcrGzGQaai3QYGAB9XKNfDnDXx/OzyU/sLEFfWuz0hAaR6Bf 84S6e15lnav2XxI5LAJfuRm+gM75QZsfYLJ2WKOlhYtt9oEB1Bd8+X+k0AlwtS80x5wI eOTwp197GDYILf8mw9K3TEmg82nlkqjdOq6EShDCpnY0Ggf/Ps0KPdleNCjqSYeDe5nc 0+06VVfMJJeL2QOa1Vyd+H3CD3jIGUnvFWAWoqefe4pi2FR9R5YQ8sASzBH/zT0ZUA+k htfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764657800; x=1765262600; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=U4CEPosLk4c8VO1ED7x/05VLZq/brB7mPtuz/Jxmq8A=; b=Z7rCCbtyimALDy+jAyoyf1Rjk7l/HPCwyGZBs2VlzlsOdqo0EoVUiX9ngSpFe6jwGi QoUpCNqovCeilvE3eYSqLugezf0FWdIki5X3n9uWlOsM7xvdmU2yWvxiZJUe6jP4vGef dZEp3SsaFVH6D/eBn1yg2xWlU8ogAeNFpWQTc6jFvzB+nf2iXwhQ+NnFdmedzw4dZylL Tmzta4QIuVEI5socngy0q+EzQfB/A7I0Ex+i8hb4qsZgEfnRXPaUM5tAMDFWKG86HQPz xBEOXTxwtqbLR3eJGW0N/P4N7odGs3rS6yWnLaUnVDNFGgUC6C8uF3WJupabGiQMk2VS VCrQ== X-Forwarded-Encrypted: i=1; AJvYcCXMXl9QKMIXCv8WyjdERv/ej0/iYpJ0+eM4JThcnh4n9EarV3qPqPu7Phroam99+GLk7sk/+YadWsx0qts=@vger.kernel.org X-Gm-Message-State: AOJu0Yxusp5N400CurBUGLUsUecPlhgY96QqUpxm3Zk/gY5YBHZ1/MU+ bWPabj96faIEZDGX/TbMhdUK3RV2rzhnN15rSX3+mi6Gl1efEFKM1+AqQ93MCVoe8WtkIhEYmg4 swETRaNgryk2XiyIpmk0g1Zyd42FhqR11coxp530FuL7zUmfxN+fsQS/SjIThTg4nlC2fD+d+N4 0= X-Gm-Gg: ASbGnctfkd/LI3SPrz13oMKZtUtKW7fV9Kxkg2m5ldCmlgx/Zj3WZ26hPwpffb0a4sz zIYuHGFnanGH41kTqp/RV9CwAsP5wddtqFWyHwTtWSAMq3OlcyZ2UqyuEBkPdNgf9K5qNjTpL8T 83K+LE12c/Pu+DuEGUYQky7BVxGPC6E6QFdtKG7XJulku7DAqYftDRQOtB1/0r4sFqs0fJAZCC+ QvhwZJq1UcnOKUYlEyVoGZNJVnnPc1KvFhRVwiJgEPIz6Ve97iG1ALDhMDpZtKctfr7r2NZeiQ1 6DFjJPhxpqKZfOLnDXmRO/1HYsfDt7WbTNwiFYBb9ZDLJNbBCWmNFynXuB8r/8NNvtQkUjzeuIY MG3RQPwPFHksXythJw92Lef8xWMpE7FIqcCi92jj8lwpgotqUSpHkLiyhbd1YQa+5XQv+oImq13 QQlA== X-Received: by 2002:a17:902:d58c:b0:294:fcae:826 with SMTP id d9443c01a7336-29bab2fa50bmr322287765ad.59.1764657799639; Mon, 01 Dec 2025 22:43:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IEmz69O+sqegGqvJXNp/6khVCSF1CST5oB/umMY14G4/IE96n6RMjq94/Om9UK6eOYz4XsexQ== X-Received: by 2002:a17:902:d58c:b0:294:fcae:826 with SMTP id d9443c01a7336-29bab2fa50bmr322287495ad.59.1764657799070; Mon, 01 Dec 2025 22:43:19 -0800 (PST) Received: from jinlmao-gv.qualcomm.com (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-29bceb450cfsm141821675ad.74.2025.12.01.22.43.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Dec 2025 22:43:18 -0800 (PST) From: Yingchao Deng Date: Tue, 02 Dec 2025 14:42:20 +0800 Subject: [PATCH v6 1/2] coresight: cti: Convert trigger usage fields to dynamic bitmaps and arrays Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251202-extended_cti-v6-1-ab68bb15c4f5@oss.qualcomm.com> References: <20251202-extended_cti-v6-0-ab68bb15c4f5@oss.qualcomm.com> In-Reply-To: <20251202-extended_cti-v6-0-ab68bb15c4f5@oss.qualcomm.com> To: Suzuki K Poulose , Mike Leach , James Clark , Alexander Shishkin Cc: Tingwei Zhang , quic_yingdeng@quicinc.com, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Jinlong Mao , Yingchao Deng X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1764657791; l=11022; i=yingchao.deng@oss.qualcomm.com; s=20251128; h=from:subject:message-id; bh=EHk3TrdZcUh7JFRp0sXEzGfbX5tPAbR/co7dEigVes4=; b=rfWFNPeqLs2m3d1ZANKeGBcScEpjUwqAL2uCsg3Sa+pbdy682Ft9mbOKsOf5bL0PgIVkMQwuX KjM6alLM856CASByihVQ2PwMmSFEuo1COuKjH9NuStcYuD85OpdmbV7 X-Developer-Key: i=yingchao.deng@oss.qualcomm.com; a=ed25519; pk=QWvd9DuX5YKvc7/VfWGCElGNr3HbCyig5bEb+lUUohg= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjAyMDA1MSBTYWx0ZWRfX5idJQe6M34Lo RA/9OVw4jG9qAFTa+sHk0EROQsFT1n49ndlc1QPX5nve663PC4Ci22g6X3EvrdrxU16IcKlezMt jrkcEvziXCKDEzrIE5/sSpmkt/Eg7ZBHAjZdJ4V3r6h7L1XPAshGTqCiPr3rL/Fo/GtrSMKfk39 7lVgqfBYwLSElUb5/OkF9yHAWIti796umkFjvFAoD52bbogw293cp+SdtbvKE54G1EI/JqwNCvQ tvtSfVLXvp/6bIcAvE/bd1zq5690TEjCfjgZM4UIj84VQL52vGLgbyVTScZHju1Sj6/Hcgtbx7O i2K9LMSWSEwZl8ErNy6QnX5aOzpRP7cN5SlkRWNe15aiLgLUHtkLoH2ZToCp59jz/uRuBKBm6ES 7wHef1Reu5IgVMjDYknpRFIJ2enc9g== X-Authority-Analysis: v=2.4 cv=BJW+bVQG c=1 sm=1 tr=0 ts=692e8a88 cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=wP3pNCr1ah4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=qBB9sKLMsZVO1SgW7bQA:9 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 X-Proofpoint-GUID: gCxcGQwr-s7FG91IeybhrTdbNp4yp6aV X-Proofpoint-ORIG-GUID: gCxcGQwr-s7FG91IeybhrTdbNp4yp6aV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-28_08,2025-11-27_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 clxscore=1015 malwarescore=0 suspectscore=0 adultscore=0 spamscore=0 impostorscore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2512020051 Replace the fixed-size u32 fields in the cti_config and cti_trig_grp structure with dynamically allocated bitmaps and arrays. This allows memory to be allocated based on the actual number of triggers during probe time, reducing memory footprint and improving scalability for platforms with varying trigger counts. Additionally, repack struct cti_config to reduce its size from 80 bytes to 72 bytes. Signed-off-by: Yingchao Deng --- drivers/hwtracing/coresight/coresight-cti-core.c | 58 ++++++++++++++++--= ---- .../hwtracing/coresight/coresight-cti-platform.c | 16 +++--- drivers/hwtracing/coresight/coresight-cti-sysfs.c | 10 ++-- drivers/hwtracing/coresight/coresight-cti.h | 17 ++++--- 4 files changed, 65 insertions(+), 36 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-cti-core.c b/drivers/hwt= racing/coresight/coresight-cti-core.c index bfbc365bb2ef..f9970e40dd59 100644 --- a/drivers/hwtracing/coresight/coresight-cti-core.c +++ b/drivers/hwtracing/coresight/coresight-cti-core.c @@ -214,8 +214,8 @@ void cti_write_intack(struct device *dev, u32 ackval) /* DEVID[19:16] - number of CTM channels */ #define CTI_DEVID_CTMCHANNELS(devid_val) ((int) BMVAL(devid_val, 16, 19)) =20 -static void cti_set_default_config(struct device *dev, - struct cti_drvdata *drvdata) +static int cti_set_default_config(struct device *dev, + struct cti_drvdata *drvdata) { struct cti_config *config =3D &drvdata->config; u32 devid; @@ -234,12 +234,33 @@ static void cti_set_default_config(struct device *dev, config->nr_trig_max =3D CTIINOUTEN_MAX; } =20 + config->trig_in_use =3D devm_bitmap_zalloc(dev, config->nr_trig_max, GFP_= KERNEL); + if (!config->trig_in_use) + return -ENOMEM; + + config->trig_out_use =3D devm_bitmap_zalloc(dev, config->nr_trig_max, GFP= _KERNEL); + if (!config->trig_out_use) + return -ENOMEM; + + config->trig_out_filter =3D devm_bitmap_zalloc(dev, config->nr_trig_max, = GFP_KERNEL); + if (!config->trig_out_filter) + return -ENOMEM; + + config->ctiinen =3D devm_kcalloc(dev, config->nr_trig_max, sizeof(u32), G= FP_KERNEL); + if (!config->ctiinen) + return -ENOMEM; + + config->ctiouten =3D devm_kcalloc(dev, config->nr_trig_max, sizeof(u32), = GFP_KERNEL); + if (!config->ctiouten) + return -ENOMEM; + config->nr_ctm_channels =3D CTI_DEVID_CTMCHANNELS(devid); =20 /* Most regs default to 0 as zalloc'ed except...*/ config->trig_filter_enable =3D true; config->ctigate =3D GENMASK(config->nr_ctm_channels - 1, 0); config->enable_req_count =3D 0; + return 0; } =20 /* @@ -270,8 +291,10 @@ int cti_add_connection_entry(struct device *dev, struc= t cti_drvdata *drvdata, cti_dev->nr_trig_con++; =20 /* add connection usage bit info to overall info */ - drvdata->config.trig_in_use |=3D tc->con_in->used_mask; - drvdata->config.trig_out_use |=3D tc->con_out->used_mask; + bitmap_or(drvdata->config.trig_in_use, drvdata->config.trig_in_use, + tc->con_in->used_mask, drvdata->config.nr_trig_max); + bitmap_or(drvdata->config.trig_out_use, drvdata->config.trig_out_use, + tc->con_out->used_mask, drvdata->config.nr_trig_max); =20 return 0; } @@ -293,12 +316,20 @@ struct cti_trig_con *cti_allocate_trig_con(struct dev= ice *dev, int in_sigs, if (!in) return NULL; =20 + in->used_mask =3D devm_bitmap_alloc(dev, in_sigs, GFP_KERNEL); + if (!in->used_mask) + return NULL; + out =3D devm_kzalloc(dev, offsetof(struct cti_trig_grp, sig_types[out_sigs]), GFP_KERNEL); if (!out) return NULL; =20 + out->used_mask =3D devm_bitmap_alloc(dev, out_sigs, GFP_KERNEL); + if (!out->used_mask) + return NULL; + tc->con_in =3D in; tc->con_out =3D out; tc->con_in->nr_sigs =3D in_sigs; @@ -314,7 +345,6 @@ int cti_add_default_connection(struct device *dev, stru= ct cti_drvdata *drvdata) { int ret =3D 0; int n_trigs =3D drvdata->config.nr_trig_max; - u32 n_trig_mask =3D GENMASK(n_trigs - 1, 0); struct cti_trig_con *tc =3D NULL; =20 /* @@ -325,8 +355,9 @@ int cti_add_default_connection(struct device *dev, stru= ct cti_drvdata *drvdata) if (!tc) return -ENOMEM; =20 - tc->con_in->used_mask =3D n_trig_mask; - tc->con_out->used_mask =3D n_trig_mask; + bitmap_fill(tc->con_in->used_mask, n_trigs); + bitmap_fill(tc->con_out->used_mask, n_trigs); + ret =3D cti_add_connection_entry(dev, drvdata, tc, NULL, "default"); return ret; } @@ -339,7 +370,6 @@ int cti_channel_trig_op(struct device *dev, enum cti_ch= an_op op, { struct cti_drvdata *drvdata =3D dev_get_drvdata(dev->parent); struct cti_config *config =3D &drvdata->config; - u32 trig_bitmask; u32 chan_bitmask; u32 reg_value; int reg_offset; @@ -349,18 +379,16 @@ int cti_channel_trig_op(struct device *dev, enum cti_= chan_op op, (trigger_idx >=3D config->nr_trig_max)) return -EINVAL; =20 - trig_bitmask =3D BIT(trigger_idx); - /* ensure registered triggers and not out filtered */ if (direction =3D=3D CTI_TRIG_IN) { - if (!(trig_bitmask & config->trig_in_use)) + if (!(test_bit(trigger_idx, config->trig_in_use))) return -EINVAL; } else { - if (!(trig_bitmask & config->trig_out_use)) + if (!(test_bit(trigger_idx, config->trig_out_use))) return -EINVAL; =20 if ((config->trig_filter_enable) && - (config->trig_out_filter & trig_bitmask)) + test_bit(trigger_idx, config->trig_out_filter)) return -EINVAL; } =20 @@ -892,7 +920,9 @@ static int cti_probe(struct amba_device *adev, const st= ruct amba_id *id) raw_spin_lock_init(&drvdata->spinlock); =20 /* initialise CTI driver config values */ - cti_set_default_config(dev, drvdata); + ret =3D cti_set_default_config(dev, drvdata); + if (ret) + return ret; =20 pdata =3D coresight_cti_get_platform_data(dev); if (IS_ERR(pdata)) { diff --git a/drivers/hwtracing/coresight/coresight-cti-platform.c b/drivers= /hwtracing/coresight/coresight-cti-platform.c index d0ae10bf6128..4bef860a0484 100644 --- a/drivers/hwtracing/coresight/coresight-cti-platform.c +++ b/drivers/hwtracing/coresight/coresight-cti-platform.c @@ -136,8 +136,8 @@ static int cti_plat_create_v8_etm_connection(struct dev= ice *dev, goto create_v8_etm_out; =20 /* build connection data */ - tc->con_in->used_mask =3D 0xF0; /* sigs <4,5,6,7> */ - tc->con_out->used_mask =3D 0xF0; /* sigs <4,5,6,7> */ + bitmap_set(tc->con_in->used_mask, 4, 4); /* sigs <4,5,6,7> */ + bitmap_set(tc->con_out->used_mask, 4, 4); /* sigs <4,5,6,7> */ =20 /* * The EXTOUT type signals from the ETM are connected to a set of input @@ -194,10 +194,10 @@ static int cti_plat_create_v8_connections(struct devi= ce *dev, goto of_create_v8_out; =20 /* Set the v8 PE CTI connection data */ - tc->con_in->used_mask =3D 0x3; /* sigs <0 1> */ + bitmap_set(tc->con_in->used_mask, 0, 2); /* sigs <0 1> */ tc->con_in->sig_types[0] =3D PE_DBGTRIGGER; tc->con_in->sig_types[1] =3D PE_PMUIRQ; - tc->con_out->used_mask =3D 0x7; /* sigs <0 1 2 > */ + bitmap_set(tc->con_out->used_mask, 0, 3); /* sigs <0 1 2 > */ tc->con_out->sig_types[0] =3D PE_EDBGREQ; tc->con_out->sig_types[1] =3D PE_DBGRESTART; tc->con_out->sig_types[2] =3D PE_CTIIRQ; @@ -213,7 +213,7 @@ static int cti_plat_create_v8_connections(struct device= *dev, goto of_create_v8_out; =20 /* filter pe_edbgreq - PE trigout sig <0> */ - drvdata->config.trig_out_filter |=3D 0x1; + set_bit(0, drvdata->config.trig_out_filter); =20 of_create_v8_out: return ret; @@ -257,7 +257,7 @@ static int cti_plat_read_trig_group(struct cti_trig_grp= *tgrp, if (!err) { /* set the signal usage mask */ for (idx =3D 0; idx < tgrp->nr_sigs; idx++) - tgrp->used_mask |=3D BIT(values[idx]); + set_bit(values[idx], tgrp->used_mask); } =20 kfree(values); @@ -331,7 +331,9 @@ static int cti_plat_process_filter_sigs(struct cti_drvd= ata *drvdata, =20 err =3D cti_plat_read_trig_group(tg, fwnode, CTI_DT_FILTER_OUT_SIGS); if (!err) - drvdata->config.trig_out_filter |=3D tg->used_mask; + bitmap_or(drvdata->config.trig_out_filter, + drvdata->config.trig_out_filter, + tg->used_mask, drvdata->config.nr_trig_max); =20 kfree(tg); return err; diff --git a/drivers/hwtracing/coresight/coresight-cti-sysfs.c b/drivers/hw= tracing/coresight/coresight-cti-sysfs.c index 572b80ee96fb..a9df77215141 100644 --- a/drivers/hwtracing/coresight/coresight-cti-sysfs.c +++ b/drivers/hwtracing/coresight/coresight-cti-sysfs.c @@ -711,10 +711,8 @@ static ssize_t trigout_filtered_show(struct device *de= v, struct cti_drvdata *drvdata =3D dev_get_drvdata(dev->parent); struct cti_config *cfg =3D &drvdata->config; int size =3D 0, nr_trig_max =3D cfg->nr_trig_max; - unsigned long mask =3D cfg->trig_out_filter; =20 - if (mask) - size =3D bitmap_print_to_pagebuf(true, buf, &mask, nr_trig_max); + size =3D bitmap_print_to_pagebuf(true, buf, cfg->trig_out_filter, nr_trig= _max); return size; } static DEVICE_ATTR_RO(trigout_filtered); @@ -926,9 +924,8 @@ static ssize_t trigin_sig_show(struct device *dev, struct cti_trig_con *con =3D (struct cti_trig_con *)ext_attr->var; struct cti_drvdata *drvdata =3D dev_get_drvdata(dev->parent); struct cti_config *cfg =3D &drvdata->config; - unsigned long mask =3D con->con_in->used_mask; =20 - return bitmap_print_to_pagebuf(true, buf, &mask, cfg->nr_trig_max); + return bitmap_print_to_pagebuf(true, buf, con->con_in->used_mask, cfg->nr= _trig_max); } =20 static ssize_t trigout_sig_show(struct device *dev, @@ -940,9 +937,8 @@ static ssize_t trigout_sig_show(struct device *dev, struct cti_trig_con *con =3D (struct cti_trig_con *)ext_attr->var; struct cti_drvdata *drvdata =3D dev_get_drvdata(dev->parent); struct cti_config *cfg =3D &drvdata->config; - unsigned long mask =3D con->con_out->used_mask; =20 - return bitmap_print_to_pagebuf(true, buf, &mask, cfg->nr_trig_max); + return bitmap_print_to_pagebuf(true, buf, con->con_out->used_mask, cfg->n= r_trig_max); } =20 /* convert a sig type id to a name */ diff --git a/drivers/hwtracing/coresight/coresight-cti.h b/drivers/hwtracin= g/coresight/coresight-cti.h index 4f89091ee93f..e7b88b07cffe 100644 --- a/drivers/hwtracing/coresight/coresight-cti.h +++ b/drivers/hwtracing/coresight/coresight-cti.h @@ -68,7 +68,7 @@ struct fwnode_handle; */ struct cti_trig_grp { int nr_sigs; - u32 used_mask; + unsigned long *used_mask; int sig_types[]; }; =20 @@ -146,20 +146,21 @@ struct cti_config { bool hw_enabled; bool hw_powered; =20 - /* registered triggers and filtering */ - u32 trig_in_use; - u32 trig_out_use; - u32 trig_out_filter; bool trig_filter_enable; u8 xtrig_rchan_sel; =20 /* cti cross trig programmable regs */ - u32 ctiappset; u8 ctiinout_sel; - u32 ctiinen[CTIINOUTEN_MAX]; - u32 ctiouten[CTIINOUTEN_MAX]; + u32 ctiappset; u32 ctigate; u32 asicctl; + u32 *ctiinen; + u32 *ctiouten; + + /* registered triggers and filtering */ + unsigned long *trig_in_use; + unsigned long *trig_out_use; + unsigned long *trig_out_filter; }; =20 /** --=20 2.43.0