On 2/5/26 22:03, Michael Tokarev wrote:
On 1/21/26 00:11, Nabih Estefan wrote:
If aspeed_i2c_dma_read fails in aspeed_i2c_bus_send currently, we get
stuck in an infinite retry loop. Add a check for the return value of
aspeed_i2c_dma_read that will break us out of said loop.

Signed-off-by: Nabih Estefan <[email protected]>

This looks like a qemu-stable material.

yes.

Thanks,

C.



Please let me know if it isn't.

Thanks,

/mjt

---
  hw/i2c/aspeed_i2c.c | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/hw/i2c/aspeed_i2c.c b/hw/i2c/aspeed_i2c.c
index 1b8ac561c3..3de72db652 100644
--- a/hw/i2c/aspeed_i2c.c
+++ b/hw/i2c/aspeed_i2c.c
@@ -272,7 +272,11 @@ static int aspeed_i2c_bus_send(AspeedI2CBus *bus)
          }
          while (bus->regs[reg_dma_len]) {
              uint8_t data;
-            aspeed_i2c_dma_read(bus, &data);
+            ret = aspeed_i2c_dma_read(bus, &data);
+            /* Check that we were able to read the DMA */
+            if (ret) {
+                break;
+            }
              trace_aspeed_i2c_bus_send("DMA", bus->regs[reg_dma_len],
                                        bus->regs[reg_dma_len], data);
              ret = i2c_send(bus->bus, data);



Reply via email to