devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Johnny Liu <johnliu@nvidia.com>,
	thierry.reding@gmail.com, jonathanh@nvidia.com,
	skomatineni@nvidia.com, luca.ceresoli@bootlin.com,
	mperttunen@nvidia.com, maarten.lankhorst@linux.intel.com,
	mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com,
	simona@ffwll.ch, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org
Cc: linux-media@vger.kernel.org, linux-tegra@vger.kernel.org,
	dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 3/5] gpu: host1x: Support device monitoring with actmon
Date: Tue, 17 Dec 2024 06:39:06 +0100	[thread overview]
Message-ID: <b7bd87f8-d651-4d27-bfc7-040a5192f285@kernel.org> (raw)
In-Reply-To: <20241210174554.18869-4-johnliu@nvidia.com>

On 10/12/2024 18:45, Johnny Liu wrote:

> +
> +static int host1x_actmon_sample_period_set(void *data, u64 val)
> +{
> +	struct host1x_actmon *actmon = (struct host1x_actmon *)data;
> +
> +	actmon->usecs_per_sample = (u32)val;
> +	host1x_actmon_update_sample_period(actmon);
> +
> +	return 0;
> +}
> +
> +DEFINE_SIMPLE_ATTRIBUTE(host1x_actmon_sample_period_fops,
> +			host1x_actmon_sample_period_get,
> +		host1x_actmon_sample_period_set,
> +		"%lld\n");
> +
> +/**
> + * host1x_actmon_debug_init - Initialize actmon debugfs


No, debugfs is only for debugging, not for usual interfaces. You now
added several driver knobs bypassing any ABI documentation.


> + * @actmon: the actmon instance being configured
> + * @name: an unique name of the actmon
> + *
> + * There are multiple modules available inside the actmon, and they perform the
> + * signal sampling at the same rate. The debugfs of an actmon will expose this
> + * shared configuration, sample_period, via a debugfs node:
> + * - sample_period:
> + *   Sampling period in micro-second of modules inside the actmon
> + */
> +static void host1x_actmon_debug_init(struct host1x_actmon *actmon, const char *name)
> +{
> +	struct host1x *host = dev_get_drvdata(actmon->client->host->parent);
> +
> +	if (!host->debugfs) {
> +		dev_warn(host->dev, "debugfs is unavailable\n");
> +		return;
> +	}
> +
> +	if (!host->actmon_debugfs)
> +		host->actmon_debugfs = debugfs_create_dir("actmon", host->debugfs);
> +
> +	actmon->debugfs = debugfs_create_dir(name, host->actmon_debugfs);
> +
> +	/* R/W files */
> +	debugfs_create_file("sample_period", 0644, actmon->debugfs, actmon,
> +			    &host1x_actmon_sample_period_fops);
> +}
> +
Best regards,
Krzysztof

  reply	other threads:[~2024-12-17  5:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-10 17:45 [PATCH v1 0/5] Support host1x actmon Johnny Liu
2024-12-10 17:45 ` [PATCH v1 1/5] dt-bindings: display: tegra: Add actmon information Johnny Liu
2024-12-13 10:44   ` Krzysztof Kozlowski
2024-12-13 23:29     ` Johnny Liu
2024-12-16  7:26       ` Krzysztof Kozlowski
2024-12-17  1:08         ` Johnny Liu
2024-12-17  5:36           ` Krzysztof Kozlowski
2024-12-10 17:45 ` [PATCH v1 2/5] arm64: " Johnny Liu
2024-12-10 17:45 ` [PATCH v1 3/5] gpu: host1x: Support device monitoring with actmon Johnny Liu
2024-12-17  5:39   ` Krzysztof Kozlowski [this message]
2024-12-19 20:29     ` Johnny Liu
2024-12-10 17:45 ` [PATCH v1 4/5] drm/tegra: nvdec: Register the device " Johnny Liu
2024-12-10 17:45 ` [PATCH v1 5/5] drm/tegra: vic: " Johnny Liu
2024-12-13 10:42 ` [PATCH v1 0/5] Support host1x actmon Krzysztof Kozlowski
2024-12-13 23:17   ` Johnny Liu
2024-12-16  7:27     ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b7bd87f8-d651-4d27-bfc7-040a5192f285@kernel.org \
    --to=krzk@kernel.org \
    --cc=airlied@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=johnliu@nvidia.com \
    --cc=jonathanh@nvidia.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mperttunen@nvidia.com \
    --cc=mripard@kernel.org \
    --cc=robh@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=skomatineni@nvidia.com \
    --cc=thierry.reding@gmail.com \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).