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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 09 Jan 2015 10:51:40 -0800
From:	Stephen Boyd <sboyd@...eaurora.org>
To:	Philipp Zabel <p.zabel@...gutronix.de>
CC:	Mike Turquette <mturquette@...aro.org>,
	linux-kernel@...r.kernel.org, kernel@...gutronix.de
Subject: Re: [PATCH v2] clk: Do not complain about correctly set read-only
 muxes when assigning clock parents from device tree

On 01/09/2015 06:50 AM, Philipp Zabel wrote:
> Hi Stephen,
>
> Am Donnerstag, den 08.01.2015, 13:32 -0800 schrieb Stephen Boyd:
> [...]
>> Why not do this in the core? As far as I can tell other drivers could
>> run into the same problem, no? Does this work?
>>
>> -----8<-------
>>
>> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
>> index f4963b7d4e17..3278645f4729 100644
>> --- a/drivers/clk/clk.c
>> +++ b/drivers/clk/clk.c
>> @@ -1677,16 +1677,18 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
>>  	if (!clk)
>>  		return 0;
>>  
>> -	/* verify ops for for multi-parent clks */
>> -	if ((clk->num_parents > 1) && (!clk->ops->set_parent))
>> -		return -ENOSYS;
>> -
>>  	/* prevent racing with updates to the clock topology */
>>  	clk_prepare_lock();
>>  
>>  	if (clk->parent == parent)
>>  		goto out;
>>  
>> +	/* verify ops for for multi-parent clks */
>> +	if ((clk->num_parents > 1) && (!clk->ops->set_parent)) {
>> +		ret = -ENOSYS;
>> +		goto out;
>> +	}
>> +
>>  	/* check that we are allowed to re-parent if the clock is in use */
>>  	if ((clk->flags & CLK_SET_PARENT_GATE) && clk->prepare_count) {
>>  		ret = -EBUSY;
> "[PATCH] clk: make set_parent succeed for any clock if the parent to be
> set is the same as the current parent" ?
>
> It works, but it also changes the API, as it makes
>    clk_set_parent(some_non_mux, its_current_parent)
> succeed instead of return -ENOSYS.

I would think a non_mux clk would have clk->num_parents == 1, so I don't
see how it would return -ENOSYS here. What you mention should succeed
today. Otherwise we have a bug.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ