From nobody Tue Dec 2 02:42:38 2025 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6FAD436C5B6 for ; Tue, 18 Nov 2025 16:28:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763483299; cv=none; b=E/qi5zGLygB2dZFfkiCfE9VY9jlg8A73sjYLxT8or3ZxEHwN3F69YSmzdiOMvWuRCZ1AoBQSyIijpn3bDS6yMYUowJDgphvQpLI44YSh8XEJAfZM47nqG14ETSDijuuUZNUe/1tAdHfBZfKb2c+m4NvYmJgWf+zNbPIfrCAOi/c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763483299; c=relaxed/simple; bh=nwpDrPvo6wsFhTqkdc+mil82YNIIfV6pVmZlogEyGM4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OH9W17ueL4MbGCxU4g/S1/jXM0yVrAqcMgBLXA8F2/LSS3F7mNothfZqLJsX58TpmYj2GtEuODL7ZO4PvbGkRVL2kyJ5iP1rztFmwcT0OdK8ExtD+VVU+wSHx+/7jiAn7jru40pu3Gj3dYpKLQiBb6pqI1PkxMqia0FPhwzVCY4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Rd4e9ea0; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Rd4e9ea0" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4779aa4f928so36660845e9.1 for ; Tue, 18 Nov 2025 08:28:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1763483296; x=1764088096; 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=pfMGtwRScvfZlh/XAQooGxUMOnQFy6aFM90lPPS4zWA=; b=Rd4e9ea0uV0XkSfI9YnF0RciW645RghMAs+rxUsrD4wiAroWlN/pz4EVb95uSkbWd2 6FkOGc/LJbKbaW6PI2OhnZZqQzb7ekMVZcnxWRPtJlu3LDm3vHOxOzCFe7A1eSN6q8fg z2Ksr3il3/nJAZqeMBkM6iwcUS8hpnZuHABJpM4KdQa3zPBodNUlgSqSZBSCQ8s2T/vT EBaewQ9fzZMw/dQvYXHA8pbLME/l4vhUDx2J/CQ7A3716Iz6dgv6QlQKBZi0GFKxeFKx qNrHX0scjZbvLIej0ao6VYEjS3695mjH81bdNCPSIsma5vyr58xmxjUVe3UixVmxh83N YkTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763483296; x=1764088096; 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=pfMGtwRScvfZlh/XAQooGxUMOnQFy6aFM90lPPS4zWA=; b=Yd2JCY2UmCDTydt/+X8HBfq9IqexRDH7JpCLDEB6VpMo1UJUkYwpQgqiQ+6S5WBNl+ JUExtDi5Rcku3mIixCoQkubUsWFHlD0awReS4m3taL5YZI1KY4i3bKITeOWa5JtFPSQh nAqdBmfoXXrSwkYCJ6cPPKhhMgCGw5YAhDrAGHoQfH5pOhengLDu3x17k9WxDHG5Bpkb ojhSxOMjWHZg7xVlyenvYnsJ7EJr73KcfeFxVQyo6PjkE/8AWKv50y42u3tdsYYt0Mgx 4f5Q6ZcOLCNUWJ5ja1Kb3IOC66bxeK6qeb5uZYnm79qnqbfspcasMRyWPRJrNQcfjWfX bO2Q== X-Forwarded-Encrypted: i=1; AJvYcCXBQHJDAZa1t/uHhTSDOLI2YnMVOs6vGAS2L+ZiO+dANIegUMKZBzwjZSiRED3RpM8tmO/5wo6ULfH5vf4=@vger.kernel.org X-Gm-Message-State: AOJu0YxhwDQW8IXYRlCwZ97xFmQGnVzMd4kmiX9xoytMSUKUbE9qWLzA cP66729EVWhpR/P4SkuFyPxmXsCrbdPOar1gNyyQsDCwEs36IB475byj3+dBrAi+IoU= X-Gm-Gg: ASbGnctOMrpXjc3sVRxTaBZ3X30nufhJsWK9YN3fEYOEkoPr1Tg5gnEtZn9OiecRrab dWCyNJSABQku7vr+2GKSXYDZHdrthAJw/CqrNPwZ/R3auNzJvJHYVWUzRyyghTlANjOmMOxXncz zRABWvnY5TAHsLFC7JQM5jx+zvy+/xKqVvuZvpyYzKDkxdTksr4U7nrzrEImE4+/NMd3lXARlhT Km/u0yrdtQVqch32YiP9sLb03qoRLU98AtDxwwbVHokLoQRkaSzGx153fss71jvKwEquLMQmBHU H6kLWFPSYJ6R3Mvqk4X9JQXHJKXaDxfzG1mC1Xj2r9aLfpqPY0EU4KxitJtfUY8MzujHKfHNfqP z+83xkXFVLGYi4RdfsOu8euwD9JnFDME6mLXaECK75GNWMV2R4Zj27+U7EsSvtjSrK6Uyv5SQE2 fyke63LNw6NSz08yriK5OroLOGwXU3Zzo= X-Google-Smtp-Source: AGHT+IEQ71MCFFHm9PfsuQns+Y6ohbXSLi6ir1YdpoytYc9NNxUeZy72YPAlDScgcglr1n/v1Qdp8g== X-Received: by 2002:a05:600c:3593:b0:477:557b:6917 with SMTP id 5b1f17b1804b1-4778fe4fdecmr170984385e9.18.1763483295720; Tue, 18 Nov 2025 08:28:15 -0800 (PST) Received: from ho-tower-lan.lan ([185.48.77.170]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-477a9dea7fcsm20369125e9.8.2025.11.18.08.28.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Nov 2025 08:28:15 -0800 (PST) From: James Clark Date: Tue, 18 Nov 2025 16:27:54 +0000 Subject: [PATCH v5 04/13] coresight: Hide unused ETMv3 format attributes 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: <20251118-james-cs-syncfreq-v5-4-82efd7b1a751@linaro.org> References: <20251118-james-cs-syncfreq-v5-0-82efd7b1a751@linaro.org> In-Reply-To: <20251118-james-cs-syncfreq-v5-0-82efd7b1a751@linaro.org> To: Suzuki K Poulose , Mike Leach , Alexander Shishkin , Jonathan Corbet , Leo Yan , Randy Dunlap Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, James Clark X-Mailer: b4 0.14.0 ETMv3 only has a few attributes, and setting unused ones results in an error, so hide them to begin with. Signed-off-by: James Clark Reviewed-by: Mike Leach --- drivers/hwtracing/coresight/coresight-etm-perf.c | 22 ++++++++++++++++++++= ++ 1 file changed, 22 insertions(+) diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwt= racing/coresight/coresight-etm-perf.c index 17afa0f4cdee..faebd7822a77 100644 --- a/drivers/hwtracing/coresight/coresight-etm-perf.c +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c @@ -106,8 +106,30 @@ static struct attribute *etm_config_formats_attr[] =3D= { NULL, }; =20 +static umode_t etm_format_attr_is_visible(struct kobject *kobj, + struct attribute *attr, int unused) +{ + /* ETM4 has all attributes */ + if (IS_ENABLED(CONFIG_CORESIGHT_SOURCE_ETM4X)) + return attr->mode; + + /* + * ETM3 only uses these attributes for programming itself (see + * ETM3X_SUPPORTED_OPTIONS). Sink ID is also supported for selecting a + * sink, but not used for configuring the ETM. + */ + if (attr =3D=3D &format_attr_cycacc.attr || + attr =3D=3D &format_attr_timestamp.attr || + attr =3D=3D &format_attr_retstack.attr || + attr =3D=3D &format_attr_sinkid.attr) + return attr->mode; + + return 0; +} + static const struct attribute_group etm_pmu_format_group =3D { .name =3D "format", + .is_visible =3D etm_format_attr_is_visible, .attrs =3D etm_config_formats_attr, }; =20 --=20 2.34.1