On 6/29/22 05:36, Peter Delevoryas wrote:
When a pmbus device switches pages, it should clears its output buffer so
that the next transaction doesn't emit data from the previous page.
Fixes: 3746d5c15e70570b ("hw/i2c: add support for PMBus”)
Signed-off-by: Peter Delevoryas <p...@fb.com>
---
Reviewed-by: Cédric Le Goater <c...@kaod.org>
Thanks,
C.
hw/i2c/pmbus_device.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/i2c/pmbus_device.c b/hw/i2c/pmbus_device.c
index 62885fa6a1..efddc36fd9 100644
--- a/hw/i2c/pmbus_device.c
+++ b/hw/i2c/pmbus_device.c
@@ -1088,6 +1088,7 @@ static int pmbus_write_data(SMBusDevice *smd, uint8_t
*buf, uint8_t len)
if (pmdev->code == PMBUS_PAGE) {
pmdev->page = pmbus_receive8(pmdev);
+ pmdev->out_buf_len = 0;
return 0;
}