All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: qup: Fix error return code in qup_i2c_bam_schedule_desc()
@ 2020-11-16 14:10 Zhihao Cheng
  2020-11-22  4:08 ` Bjorn Andersson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Zhihao Cheng @ 2020-11-16 14:10 UTC (permalink / raw)
  To: agross, bjorn.andersson, wsa, sricharan
  Cc: linux-arm-msm, linux-i2c, linux-kernel, chengzhihao1, yi.zhang

Fix to return the error code from qup_i2c_change_state()
instaed of 0 in qup_i2c_bam_schedule_desc().

Fixes: fbf9921f8b35d9b2 ("i2c: qup: Fix error handling")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
---
 drivers/i2c/busses/i2c-qup.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
index fbc04b60cfd1..5a47915869ae 100644
--- a/drivers/i2c/busses/i2c-qup.c
+++ b/drivers/i2c/busses/i2c-qup.c
@@ -801,7 +801,8 @@ static int qup_i2c_bam_schedule_desc(struct qup_i2c_dev *qup)
 	if (ret || qup->bus_err || qup->qup_err) {
 		reinit_completion(&qup->xfer);
 
-		if (qup_i2c_change_state(qup, QUP_RUN_STATE)) {
+		ret = qup_i2c_change_state(qup, QUP_RUN_STATE);
+		if (ret) {
 			dev_err(qup->dev, "change to run state timed out");
 			goto desc_err;
 		}
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] i2c: qup: Fix error return code in qup_i2c_bam_schedule_desc()
  2020-11-16 14:10 [PATCH] i2c: qup: Fix error return code in qup_i2c_bam_schedule_desc() Zhihao Cheng
@ 2020-11-22  4:08 ` Bjorn Andersson
  2020-12-02 15:42 ` Wolfram Sang
  2020-12-29 20:15 ` patchwork-bot+linux-arm-msm
  2 siblings, 0 replies; 4+ messages in thread
From: Bjorn Andersson @ 2020-11-22  4:08 UTC (permalink / raw)
  To: Zhihao Cheng
  Cc: agross, wsa, sricharan, linux-arm-msm, linux-i2c, linux-kernel, yi.zhang

On Mon 16 Nov 08:10 CST 2020, Zhihao Cheng wrote:

> Fix to return the error code from qup_i2c_change_state()
> instaed of 0 in qup_i2c_bam_schedule_desc().
> 
> Fixes: fbf9921f8b35d9b2 ("i2c: qup: Fix error handling")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
> ---
>  drivers/i2c/busses/i2c-qup.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
> index fbc04b60cfd1..5a47915869ae 100644
> --- a/drivers/i2c/busses/i2c-qup.c
> +++ b/drivers/i2c/busses/i2c-qup.c
> @@ -801,7 +801,8 @@ static int qup_i2c_bam_schedule_desc(struct qup_i2c_dev *qup)
>  	if (ret || qup->bus_err || qup->qup_err) {
>  		reinit_completion(&qup->xfer);
>  
> -		if (qup_i2c_change_state(qup, QUP_RUN_STATE)) {
> +		ret = qup_i2c_change_state(qup, QUP_RUN_STATE);

In the case that we entered this block because ret was -ETIMEDOUT then
this will overwrite this and the function will return -EIO.

But in the other paths out of this block ret is being overwritten
anyways, so I think it's fine.

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

> +		if (ret) {
>  			dev_err(qup->dev, "change to run state timed out");
>  			goto desc_err;
>  		}
> -- 
> 2.25.4
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] i2c: qup: Fix error return code in qup_i2c_bam_schedule_desc()
  2020-11-16 14:10 [PATCH] i2c: qup: Fix error return code in qup_i2c_bam_schedule_desc() Zhihao Cheng
  2020-11-22  4:08 ` Bjorn Andersson
@ 2020-12-02 15:42 ` Wolfram Sang
  2020-12-29 20:15 ` patchwork-bot+linux-arm-msm
  2 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2020-12-02 15:42 UTC (permalink / raw)
  To: Zhihao Cheng
  Cc: agross, bjorn.andersson, sricharan, linux-arm-msm, linux-i2c,
	linux-kernel, yi.zhang

[-- Attachment #1: Type: text/plain, Size: 376 bytes --]

On Mon, Nov 16, 2020 at 10:10:58PM +0800, Zhihao Cheng wrote:
> Fix to return the error code from qup_i2c_change_state()
> instaed of 0 in qup_i2c_bam_schedule_desc().
> 
> Fixes: fbf9921f8b35d9b2 ("i2c: qup: Fix error handling")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>

Applied to for-current, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] i2c: qup: Fix error return code in qup_i2c_bam_schedule_desc()
  2020-11-16 14:10 [PATCH] i2c: qup: Fix error return code in qup_i2c_bam_schedule_desc() Zhihao Cheng
  2020-11-22  4:08 ` Bjorn Andersson
  2020-12-02 15:42 ` Wolfram Sang
@ 2020-12-29 20:15 ` patchwork-bot+linux-arm-msm
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+linux-arm-msm @ 2020-12-29 20:15 UTC (permalink / raw)
  To: Zhihao Cheng; +Cc: linux-arm-msm

Hello:

This patch was applied to qcom/linux.git (refs/heads/for-next):

On Mon, 16 Nov 2020 22:10:58 +0800 you wrote:
> Fix to return the error code from qup_i2c_change_state()
> instaed of 0 in qup_i2c_bam_schedule_desc().
> 
> Fixes: fbf9921f8b35d9b2 ("i2c: qup: Fix error handling")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
> 
> [...]

Here is the summary with links:
  - i2c: qup: Fix error return code in qup_i2c_bam_schedule_desc()
    https://git.kernel.org/qcom/c/e9acf0298c66

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-29 20:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16 14:10 [PATCH] i2c: qup: Fix error return code in qup_i2c_bam_schedule_desc() Zhihao Cheng
2020-11-22  4:08 ` Bjorn Andersson
2020-12-02 15:42 ` Wolfram Sang
2020-12-29 20:15 ` patchwork-bot+linux-arm-msm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.