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: <754e12d4-6bfa-4417-afbf-8d1353ea3ade@kernel.org>
Date: Thu, 31 Oct 2024 17:05:00 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: shunxi zhang <ot_shunxi.zhang@...iatek.com>,
 alexandre.belloni@...tlin.com, matthias.bgg@...il.com,
 angelogioacchino.delregno@...labora.com, lee@...nel.org
Cc: linux-kernel@...r.kernel.org, linux-rtc@...r.kernel.org,
 linux-arm-kernel@...ts.infradead.org, linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH 1/1] rtc: mediatek: Add mt6685 RTC driver

On 31/10/2024 16:58, Krzysztof Kozlowski wrote:
>> +	regmap_write(rtc->regmap, RG_RTC_32K_CK_PDN_CLR, RG_RTC_32K_CK_PDN_MASK);
>> +	regmap_write(rtc->regmap, RG_RTC_MCLK_PDN_CLR, RG_RTC_MCLK_PDN_MASK);
>> +	counter++;
>> +	mdelay(1);
>> +	mutex_unlock(&rtc->clk_lock);
>> +}
>> +
>> +static void power_down_mclk(struct mt6685_rtc *rtc)
>> +{
>> +	mutex_lock(&rtc->clk_lock);
>> +	counter--;
>> +	if (counter < 0) {
>> +		//dump_stack();
>> +		pr_info("mclk_counter[%d]\n", counter);
> 
> Oh man... So many wrong things. This applies to entire code:
> 1. Drop dead code. All dead code.
> 
> 2. Do not use pr_xxx but dev_xxx
> 
> 3. Drop all such useless printks because your driver is supposed to be
> silent.
> 
> 4. Implement proper clock handling instead of reimplementing it yourself
> with some counters.

... clock handling or runtime PM, depending what this thing here really is.

Best regards,
Krzysztof


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ