diff mbox series

[-next] i2c: qcom-geni: Add missing clk_disable_unprepare in geni_i2c_runti

Message ID 20240803061041.283940-1-cuigaosheng1@huawei.com (mailing list archive)
State Not Applicable
Headers show
Series [-next] i2c: qcom-geni: Add missing clk_disable_unprepare in geni_i2c_runti | expand

Commit Message

cuigaosheng Aug. 3, 2024, 6:10 a.m. UTC
Add the missing clk_disable_unprepare() before return in
geni_i2c_runti().

Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
---
 drivers/i2c/busses/i2c-qcom-geni.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Vladimir Zapolskiy Aug. 4, 2024, 9:21 p.m. UTC | #1
On 8/3/24 09:10, Gaosheng Cui wrote:
> Add the missing clk_disable_unprepare() before return in
> geni_i2c_runti().

The function name above is scrambled, it should be geni_i2c_runtime_resume().

> 
> Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
> ---
>   drivers/i2c/busses/i2c-qcom-geni.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c
> index 0a8b95ce35f7..78f43648e9f3 100644
> --- a/drivers/i2c/busses/i2c-qcom-geni.c
> +++ b/drivers/i2c/busses/i2c-qcom-geni.c
> @@ -990,8 +990,10 @@ static int __maybe_unused geni_i2c_runtime_resume(struct device *dev)
>   		return ret;
>   
>   	ret = geni_se_resources_on(&gi2c->se);
> -	if (ret)
> +	if (ret) {
> +		clk_disable_unprepare(gi2c->core_clk);
>   		return ret;
> +	}
>   
>   	enable_irq(gi2c->irq);
>   	gi2c->suspended = 0;

The fix is correct, thank you.

FWIW there is another missed call of geni_icc_disable(&gi2c->se) on the error paths.

Fixes: 14d02fbadb5d ("i2c: qcom-geni: add desc struct to prepare support for I2C Master Hub variant")
Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>

--
Best wishes,
Vladimir
Andi Shyti Aug. 5, 2024, 5:11 p.m. UTC | #2
Hi Gaosheng,

On Mon, Aug 05, 2024 at 12:21:53AM GMT, Vladimir Zapolskiy wrote:
> On 8/3/24 09:10, Gaosheng Cui wrote:
> > Add the missing clk_disable_unprepare() before return in
> > geni_i2c_runti().
> 
> The function name above is scrambled, it should be geni_i2c_runtime_resume().

with the function names fixed, merged into i2c/i2c-host-fixes.

> > 
> > Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
> > ---
> >   drivers/i2c/busses/i2c-qcom-geni.c | 4 +++-
> >   1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c
> > index 0a8b95ce35f7..78f43648e9f3 100644
> > --- a/drivers/i2c/busses/i2c-qcom-geni.c
> > +++ b/drivers/i2c/busses/i2c-qcom-geni.c
> > @@ -990,8 +990,10 @@ static int __maybe_unused geni_i2c_runtime_resume(struct device *dev)
> >   		return ret;
> >   	ret = geni_se_resources_on(&gi2c->se);
> > -	if (ret)
> > +	if (ret) {
> > +		clk_disable_unprepare(gi2c->core_clk);
> >   		return ret;
> > +	}
> >   	enable_irq(gi2c->irq);
> >   	gi2c->suspended = 0;
> 
> The fix is correct, thank you.
> 
> FWIW there is another missed call of geni_icc_disable(&gi2c->se) on the error paths.

Are you going to take care of this, as well?

Thanks,
Andi

> Fixes: 14d02fbadb5d ("i2c: qcom-geni: add desc struct to prepare support for I2C Master Hub variant")
> Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
> 
> --
> Best wishes,
> Vladimir
cuigaosheng Aug. 6, 2024, 12:55 p.m. UTC | #3
Thanks for your time!

> Are you going to take care of this, as well?
>
> Thanks,
> Andi
I've made and submitted a patch, thanks again.

On 2024/8/6 1:11, Andi Shyti wrote:
> Hi Gaosheng,
>
> On Mon, Aug 05, 2024 at 12:21:53AM GMT, Vladimir Zapolskiy wrote:
>> On 8/3/24 09:10, Gaosheng Cui wrote:
>>> Add the missing clk_disable_unprepare() before return in
>>> geni_i2c_runti().
>> The function name above is scrambled, it should be geni_i2c_runtime_resume().
> with the function names fixed, merged into i2c/i2c-host-fixes.
>
>>> Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
>>> ---
>>>    drivers/i2c/busses/i2c-qcom-geni.c | 4 +++-
>>>    1 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c
>>> index 0a8b95ce35f7..78f43648e9f3 100644
>>> --- a/drivers/i2c/busses/i2c-qcom-geni.c
>>> +++ b/drivers/i2c/busses/i2c-qcom-geni.c
>>> @@ -990,8 +990,10 @@ static int __maybe_unused geni_i2c_runtime_resume(struct device *dev)
>>>    		return ret;
>>>    	ret = geni_se_resources_on(&gi2c->se);
>>> -	if (ret)
>>> +	if (ret) {
>>> +		clk_disable_unprepare(gi2c->core_clk);
>>>    		return ret;
>>> +	}
>>>    	enable_irq(gi2c->irq);
>>>    	gi2c->suspended = 0;
>> The fix is correct, thank you.
>>
>> FWIW there is another missed call of geni_icc_disable(&gi2c->se) on the error paths.
> Are you going to take care of this, as well?
>
> Thanks,
> Andi
>
>> Fixes: 14d02fbadb5d ("i2c: qcom-geni: add desc struct to prepare support for I2C Master Hub variant")
>> Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
>>
>> --
>> Best wishes,
>> Vladimir
> .
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c
index 0a8b95ce35f7..78f43648e9f3 100644
--- a/drivers/i2c/busses/i2c-qcom-geni.c
+++ b/drivers/i2c/busses/i2c-qcom-geni.c
@@ -990,8 +990,10 @@  static int __maybe_unused geni_i2c_runtime_resume(struct device *dev)
 		return ret;
 
 	ret = geni_se_resources_on(&gi2c->se);
-	if (ret)
+	if (ret) {
+		clk_disable_unprepare(gi2c->core_clk);
 		return ret;
+	}
 
 	enable_irq(gi2c->irq);
 	gi2c->suspended = 0;