[PATCH 2/3] i2c: designware_i2c: Remove clk disabled codes
Maniyam, Dinesh
dinesh.maniyam at altera.com
Mon Jun 22 12:41:36 CEST 2026
Hi Heiko,
Thanks for the review.
On 29/4/2026 2:10 pm, Heiko Schocher wrote:
> [CAUTION: This email is from outside your organization. Unless you trust the sender, do not click on links or open attachments as it may be a fraudulent email attempting to steal your information and/or compromise your computer.]
>
> Hello Dinesh,
>
> On 29.04.26 07:11, dinesh.maniyam at altera.com wrote:
>> From: Dinesh Maniyam <dinesh.maniyam at altera.com>
>>
>> l4_sp_clk is disabled when i2c device is removed, this would
>> causing unexpected failing behavior for other peripherals which
>> are still running with l4_sp_clk. The patch removes the codes
>> implementation for disabling the lp_spl_clk.
>>
>> Signed-off-by: Tien Fong Chee <tien.fong.chee at altera.com>
>> Signed-off-by: Dinesh Maniyam <dinesh.maniyam at altera.com>
>> ---
>> drivers/i2c/designware_i2c.c | 4 ----
>> 1 file changed, 4 deletions(-)
>>
>> diff --git a/drivers/i2c/designware_i2c.c b/drivers/i2c/designware_i2c.c
>> index 8ad716f410e..40153c72545 100644
>> --- a/drivers/i2c/designware_i2c.c
>> +++ b/drivers/i2c/designware_i2c.c
>> @@ -807,10 +807,6 @@ int designware_i2c_remove(struct udevice *dev)
>> {
>> struct dw_i2c *priv = dev_get_priv(dev);
>>
>> -#if CONFIG_IS_ENABLED(CLK)
>> - clk_disable(&priv->clk);
>> -#endif
>
> Hmm... clock framework should have a counter how many times clock
> is enabled... with your patch, clock never gets disabled...
>
> bye,
> Heiko
You're right -- this patch is at the wrong layer. designware_i2c is a
generic driver and disabling clk_disable() globally affects every
SoCFPGA / x86 / RISC-V user of it. The asymmetry vs. clk_enable() in
designware_i2c_of_to_plat() is also a refcount leak by construction.
I'll send v2 for this patch series with the fix.
Regards,
Dinesh
>> -
>> return reset_release_bulk(&priv->resets);
>> }
>>
>>
>
> --
> Nabla Software Engineering
> HRB 40522 Augsburg
> Phone: +49 821 45592596
> E-Mail: office at nabladev.com
> Geschäftsführer : Stefano Babic
More information about the U-Boot
mailing list