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]
Message-ID: <4FB1AC79.7000901@codeaurora.org>
Date:	Mon, 14 May 2012 18:08:09 -0700
From:	Saravana Kannan <skannan@...eaurora.org>
To:	"Turquette, Mike" <mturquette@...com>
CC:	Mark Brown <broonie@...nsource.wolfsonmicro.com>,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	Sascha Hauer <s.hauer@...gutronix.de>, andrew@...n.ch,
	rnayak@...com,
	"linux-arm-msm@...r.kernel.org" <linux-arm-msm@...r.kernel.org>
Subject: Re: [PATCH] clk: Constify struct clk_init_data

On 05/14/2012 02:53 PM, Turquette, Mike wrote:
> On Mon, May 14, 2012 at 7:12 AM, Mark Brown<broonie@...nsource.wolfsonmicro.com>  wrote:
>> Allow drivers to declare their clk_init_data const, the framework really
>> shouldn't be modifying the data.
>>
>> Signed-off-by: Mark Brown<broonie@...nsource.wolfsonmicro.com>
>
> +interested parties
>
> Mark, I like this change but it's reminded me of a few things I meant to
> bring up on the list in the past.  Certainly some folks will mark their
> struct clk_hw_init data as __initconst.  Currently none of the
> documentation mentions that fact and I'm a bit worried about clk code
> which assumes that hw->init will always be around and freely accesses
> it.
>
> I think that, as a rule, hw->init cannot be assumed to be valid after
> clk_register returns.  Would anyone else like to weigh in on it?  If so
> then I'll cook up a follow-up patch to reflect this in the kerneldoc.

If you mean hw->init pointer can't be assumed to be point to anything 
valid after clk_register or __clk_register, then yes, I agree with that. 
But the actual data that hw->init pointed to might still be around and 
referenced by clk if __clk_register is used.

Btw, I didn't follow up on the other thread we were having, but can you 
remind me again what was the reason that you thought that only 
__clk_init() would work for your static init code and __clk_register() 
won't work? Or did I just misunderstand your comment that was trying to 
say that you didn't want to switch to __clk_register close to kernel 
release?

There are some older threads where I think we are a bit out of sync on 
the init data (I thought I did what you said you preferred, but you 
asked me why I did that). I will try to restart them.

Thanks,
Saravana

>
> Thanks,
> Mike
>
>> ---
>>   include/linux/clk-provider.h |    2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
>> index c1c23b9..fc43ea6 100644
>> --- a/include/linux/clk-provider.h
>> +++ b/include/linux/clk-provider.h
>> @@ -143,7 +143,7 @@ struct clk_init_data {
>>   */
>>   struct clk_hw {
>>         struct clk *clk;
>> -       struct clk_init_data *init;
>> +       const struct clk_init_data *init;
>>   };
>>
>>   /*
>> --
>> 1.7.10
>>
>


-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
--
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