[PATCH v8 09/14] ASoC: Intel: catpt: Simple sysfs attributes

Andy Shevchenko andriy.shevchenko at linux.intel.com
Thu Sep 24 16:24:48 CEST 2020


On Wed, Sep 23, 2020 at 06:31:08PM +0000, Rojewski, Cezary wrote:
> On 2020-09-23 3:34 PM, Andy Shevchenko wrote:
> > On Wed, Sep 23, 2020 at 02:25:03PM +0200, Cezary Rojewski wrote:

...

> >> +	pm_runtime_get_sync(cdev->dev);
> >> +
> >> +	ret = catpt_ipc_get_fw_version(cdev, &version);
> >> +
> >> +	pm_runtime_mark_last_busy(cdev->dev);
> >> +	pm_runtime_put_autosuspend(cdev->dev);
> > 
> > Is it subject to change at run-time?
> 
> No it does not. However, I do not intent to have the fw_version occupy
> memory for device's drvdata (i.e. send the IPC internally and store it
> inside struct catpt_dev). So, I'd rather wake the device, dump the
> version and leave the bytes alone.
> 
> One could think about statics but then again, how many times this sysfs
> file is going to get read anyway?
> It's more readable and simple this way, losing nothing in return TBH.

For regular user perhaps few times or from time to time, but for dump syzkaller
type of fuzzers it may be thousands per second...

Greg is happy anyway, so choose yourself the best one you think of.

-- 
With Best Regards,
Andy Shevchenko




More information about the Alsa-devel mailing list