From: Nicholas Piggin <npiggin@gmail.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: Corey Minyard <cminyard@mvista.com>,
Alistair Francis <alistair.francis@wdc.com>,
Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>,
Chao Liu <chao.liu.zevorn@gmail.com>,
Chris Rauer <crauer@google.com>,
Michael Ellerman <mpe@kernel.org>,
Joel Stanley <jms@oss.tenstorrent.com>,
Anirudh Srinivasan <asrinivasan@oss.tenstorrent.com>,
Portia Stephens <portias@oss.tenstorrent.com>,
qemu-riscv@nongnu.org, qemu-devel@nongnu.org,
Hao Wu <wuhaotsh@google.com>
Subject: Re: [PATCH 2/4] [RFC] hw/i2c/designware_i2c: Switch to Fifo8
Date: Sat, 16 May 2026 04:23:00 +1000 [thread overview]
Message-ID: <agdi9vz5Ty3XsSH5@lima-default> (raw)
In-Reply-To: <9c5d66ee-0e50-4311-8dc8-17797e92fdbd@linaro.org>
On Mon, May 11, 2026 at 12:18:41PM +0200, Philippe Mathieu-Daudé wrote:
> On 7/5/26 14:05, Nicholas Piggin wrote:
> > Alistair suggested moving to Fifo8, which I think is
> > a good improvement.
> >
> > Broken out for individual review, but IMO we should
> > squash before merge since it changes VMState format.
> >
> > Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> > ---
> > hw/i2c/designware_i2c.c | 37 ++++++++++++++++++++-------------
> > include/hw/i2c/designware_i2c.h | 7 +++----
> > 2 files changed, 25 insertions(+), 19 deletions(-)
>
>
> > @@ -53,8 +54,6 @@ typedef enum DesignWareI2CStatus {
> > * @ic_comp_version: I2C component version register
> > * @ic_comp_type: I2C component type register
> > * @rx_fifo: The FIFO buffer for receiving in FIFO mode.
> > - * @rx_cur: The current position of rx_fifo.
> > - * @status: The current status of the SMBus.
> > */
> > typedef struct DesignWareI2CState {
> > SysBusDevice parent_obj;
> > @@ -88,8 +87,8 @@ typedef struct DesignWareI2CState {
> > uint32_t ic_comp_version;
> > uint32_t ic_comp_type;
> > - uint8_t rx_fifo[DESIGNWARE_I2C_RX_FIFO_SIZE];
> > - uint8_t rx_cur;
> > + /* fifo8_num_used(rx_fifo) should always equal ic_rxflr */
>
> Why not remove ic_rxflr then?
I did consider that... but the next patch to rework the registers
adds storage for them all as a block. We could still just ignore
the storage and use fifo8_num_used() instead but I was vaguely
worried about complexity of vmstate compat if we change things, but
not sure if that is a rational concern. In the end the code is
quite simple and only a couple of places where this is adjusted so
I kept it this way.
Thanks,
Nick
next prev parent reply other threads:[~2026-05-15 18:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-07 12:05 [PATCH 0/4] hw/i2c: Add designware i2c controller Nicholas Piggin
2026-05-07 12:05 ` [PATCH 1/4] " Nicholas Piggin
2026-05-11 10:20 ` Philippe Mathieu-Daudé
2026-05-07 12:05 ` [PATCH 2/4] [RFC] hw/i2c/designware_i2c: Switch to Fifo8 Nicholas Piggin
2026-05-11 10:18 ` Philippe Mathieu-Daudé
2026-05-15 18:23 ` Nicholas Piggin [this message]
2026-05-07 12:05 ` [PATCH 3/4] [RFC] hw/i2c/designware_i2c: Switch to QEMU register API Nicholas Piggin
2026-05-13 2:03 ` Alistair Francis
2026-05-15 18:34 ` Nicholas Piggin
2026-05-07 12:05 ` [PATCH 4/4] [RFC] hw/i2c/designware_i2c: add SMBUS_INTR_MASK Nicholas Piggin
2026-05-11 10:19 ` Philippe Mathieu-Daudé
2026-05-10 13:03 ` [PATCH 0/4] hw/i2c: Add designware i2c controller Corey Minyard
2026-05-15 23:00 ` Nicholas Piggin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=agdi9vz5Ty3XsSH5@lima-default \
--to=npiggin@gmail.com \
--cc=alistair.francis@wdc.com \
--cc=asrinivasan@oss.tenstorrent.com \
--cc=chao.liu.zevorn@gmail.com \
--cc=cminyard@mvista.com \
--cc=crauer@google.com \
--cc=daniel.barboza@oss.qualcomm.com \
--cc=jms@oss.tenstorrent.com \
--cc=mpe@kernel.org \
--cc=philmd@linaro.org \
--cc=portias@oss.tenstorrent.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=wuhaotsh@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.