Skip to contentSkip to conversation

i2c: qcom-geni: Fix return value for master_xfer

PATCH In review [email protected] 3 participants 3 messages Feb 9, 2022 – Feb 18, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: qcom-geni: Fix return value for master_xfer

From: Jordan Crouse <[email protected]>

The master_xfer function is supposed to return the number of messages that were processed. Both geni_i2c_gpi_xfer and geni_i2c_fifo_xfer are returning 0 which is being interpeted as a error in the upper layers.

Fixes 8133682618cb ("i2c: qcom-geni: Add support for GPI DMA")

---

 drivers/i2c/busses/i2c-qcom-geni.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/i2c/busses/i2c-qcom-geni.c +3 -3
index c5345f3421a8..e008161e1a67 100644
@@ -619,7 +619,7 @@ static int geni_i2c_gpi_xfer(struct geni_i2c_dev *gi2c, struct i2c_msg msgs[], i
 		geni_i2c_gpi_unmap(gi2c, &msgs[i], tx_buf, tx_addr, rx_buf, rx_addr);
 	}
 
-	return 0;
+	return num;
 
 err:
 	dmaengine_terminate_sync(gi2c->rx_c);
@@ -645,10 +645,10 @@ static int geni_i2c_fifo_xfer(struct geni_i2c_dev *gi2c,
 			ret = geni_i2c_tx_one_msg(gi2c, &msgs[i], m_param);
 
 		if (ret)
-			break;
+			return ret;
 	}
 
-	return ret;
+	return num;
 }
 
 static int geni_i2c_xfer(struct i2c_adapter *adap,
Signature · 1 line
2.32.0
#1 lore raw
Quoted 8 lines · On Wed, Feb 09, 2022 at 09:03:56PM +0000, [email protected] wrote:

From: Jordan Crouse <[email protected]>

The master_xfer function is supposed to return the number of messages that were processed. Both geni_i2c_gpi_xfer and geni_i2c_fifo_xfer are returning 0 which is being interpeted as a error in the upper layers.

Fixes 8133682618cb ("i2c: qcom-geni: Add support for GPI DMA")

For the record, this patch is not upstream yet and needs to be folded into the next version of the GPI DMA patch by Vinod.

#2 lore raw
Quoted 7 lines · Wolfram Sang
Quoted 6 lines · On Wed, Feb 09, 2022 at 09:03:56PM +0000, [email protected] wrote:

From: Jordan Crouse <[email protected]>

The master_xfer function is supposed to return the number of messages that were processed. Both geni_i2c_gpi_xfer and geni_i2c_fifo_xfer are returning 0 which is being interpeted as a error in the upper layers.

Quoted 5 lines
Quoted 2 lines
Fixes 8133682618cb ("i2c: qcom-geni: Add support for GPI DMA")

For the record, this patch is not upstream yet and needs to be folded into the next version of the GPI DMA patch by Vinod.

I have folder this into into my patch and will be posting updated one (this was also in Dmitry's review)

Thanks

Signature · 1 line
~Vinod