lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b7bd87f8-d651-4d27-bfc7-040a5192f285@kernel.org>
Date: Tue, 17 Dec 2024 06:39:06 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Johnny Liu <johnliu@...dia.com>, thierry.reding@...il.com,
 jonathanh@...dia.com, skomatineni@...dia.com, luca.ceresoli@...tlin.com,
 mperttunen@...dia.com, maarten.lankhorst@...ux.intel.com,
 mripard@...nel.org, tzimmermann@...e.de, airlied@...il.com, simona@...ll.ch,
 robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org
Cc: linux-media@...r.kernel.org, linux-tegra@...r.kernel.org,
 dri-devel@...ts.freedesktop.org, devicetree@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 3/5] gpu: host1x: Support device monitoring with actmon

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ