[alsa-devel] [PATCH] clk: x86: add "mclk" alias for Baytrail/Cherrytrail

Andy Shevchenko andy.shevchenko at gmail.com
Thu Feb 16 03:05:19 CET 2017


On Thu, Feb 16, 2017 at 2:56 AM, Stephen Boyd <sboyd at codeaurora.org> wrote:
> On 02/14, Pierre-Louis Bossart wrote:
>> On 2/14/17 1:04 PM, Stephen Boyd wrote:

>> This is a builtin driver that cannot be configured as a module, is
>> the leaked alias problematic?
>
> Well we don't suppress driver unbinding via sysfs here, unless I
> missed something, so the leak could be triggered that way.

It has ->remove() hook, so, definitely it's possible to unbind.

>  lookup = clkdev_hw_create(data->clks[3].hw, "mclk", NULL);
>
> and then freeing that lookup with clkdev_drop in the remove of
> the driver. "mclk" is really generic for a connection name
> without an associated device id, so you may want to pass some
> device as the last argument here, but dev_name(&pdev->dev) seems
> odd because that's the clock controller device, not whatever
> device would be calling clk_get() with this created lookup in
> mind.

Here is the problem with CLK framework since it's (was?) too oriented
to ARM and clock trees.

The best option for x86 is to place it in some platform code, which is
bad idea per se.
For example, GPIO, PWM, etc have static look up tables and glue
drivers (like PCI part of the driver, or I2C, or similar) can fill
that table based on ID.

My personal opinion that the best place is not the clock driver for
that, rather converting existing drivers to take clock name based on
some (platform related) ID.

-- 
With Best Regards,
Andy Shevchenko


More information about the Alsa-devel mailing list