[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 08/13] hw/i2c/pmbus: Reset out buf after switching pages
From: |
Titus Rwantare |
Subject: |
Re: [PATCH v2 08/13] hw/i2c/pmbus: Reset out buf after switching pages |
Date: |
Wed, 29 Jun 2022 11:05:08 -0700 |
On Tue, 28 Jun 2022 at 20:36, Peter Delevoryas
<peterdelevoryas@gmail.com> 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 <pdel@fb.com>
> ---
> 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;
> }
>
I suspect you were running into this because ic_device_id was putting
too much data in the output buffer. Still, I wouldn't want the buffer
cleared if the page hasn't changed. Some drivers write the same page
before every read.
Titus
- [PATCH v2 03/13] hw/i2c/aspeed: Fix MASTER_EN missing error message, (continued)
- [PATCH v2 03/13] hw/i2c/aspeed: Fix MASTER_EN missing error message, Peter Delevoryas, 2022/06/28
- [PATCH v2 02/13] hw/i2c/aspeed: Fix DMA len write-enable bit handling, Peter Delevoryas, 2022/06/28
- [PATCH v2 04/13] hw/i2c: support multiple masters, Peter Delevoryas, 2022/06/28
- [PATCH v2 05/13] hw/i2c: add asynchronous send, Peter Delevoryas, 2022/06/28
- [PATCH v2 06/13] hw/i2c/aspeed: add slave device in old register mode, Peter Delevoryas, 2022/06/28
- [PATCH v2 08/13] hw/i2c/pmbus: Reset out buf after switching pages, Peter Delevoryas, 2022/06/28
- [PATCH v2 07/13] hw/i2c/aspeed: Add new-registers DMA slave mode RX support, Peter Delevoryas, 2022/06/28
- [PATCH v2 09/13] hw/i2c/pmbus: Add read-only IC_DEVICE_ID support, Peter Delevoryas, 2022/06/28
[PATCH v2 10/13] hw/misc/aspeed: Add PECI controller, Peter Delevoryas, 2022/06/28