[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241219202950.15277-1-johnliu@nvidia.com>
Date: Thu, 19 Dec 2024 12:29:50 -0800
From: Johnny Liu <johnliu@...dia.com>
To: <krzk@...nel.org>
CC: <airlied@...il.com>, <conor+dt@...nel.org>, <devicetree@...r.kernel.org>,
<dri-devel@...ts.freedesktop.org>, <johnliu@...dia.com>,
<jonathanh@...dia.com>, <krzk+dt@...nel.org>, <linux-kernel@...r.kernel.org>,
<linux-media@...r.kernel.org>, <linux-tegra@...r.kernel.org>,
<luca.ceresoli@...tlin.com>, <maarten.lankhorst@...ux.intel.com>,
<mperttunen@...dia.com>, <mripard@...nel.org>, <robh@...nel.org>,
<simona@...ll.ch>, <skomatineni@...dia.com>, <thierry.reding@...il.com>,
<tzimmermann@...e.de>
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.
Thank you for pointing out the issue. I will expose these control
interfaces under sysfs, probably hwmon, in the next patch series.
> > + * @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);
> > +}
> > +
Thanks,
Johnny
Powered by blists - more mailing lists