public inbox for qemu-devel@nongnu.org
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@redhat.com>
To: qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>,
	"Jamin Lin" <jamin_lin@aspeedtech.com>,
	"Kane Chen" <kane_chen@aspeedtech.com>,
	"Cédric Le Goater" <clg@redhat.com>
Subject: [PATCH v2 3/3] hw/i2c/aspeed_i2c: Remove assert
Date: Mon, 23 Mar 2026 13:55:45 +0100	[thread overview]
Message-ID: <20260323125545.577653-4-clg@redhat.com> (raw)
In-Reply-To: <20260323125545.577653-1-clg@redhat.com>

According to the Aspeed datasheet, the RX_BUF_LEN_W1T and
TX_BUF_LEN_W1T bits of the A_I2CS_DMA_LEN (0x2c) register allow
firmware to program the TX and RX DMA length (TX_BUF_LEN and
RX_BUF_LEN fields of the same register) separately without the need to
read/modify/write the value.  If RX_BUF_LEN_W1T and TX_BUF_LEN_W1T
bits are 0, then both TX and RX DMA length will be written.

When setting the RX_BUF_LEN field, the TX_BUF_LEN field being set is
not an invalid condition. Remove the assert.

Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3315
Reviewed-by: Jamin Lin <jamin_lin@aspeedtech.com>
Link: https://lore.kernel.org/qemu-devel/20260322215732.387383-4-clg@redhat.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
 hw/i2c/aspeed_i2c.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/i2c/aspeed_i2c.c b/hw/i2c/aspeed_i2c.c
index ad6342bec0d4..5d18f8d49ea4 100644
--- a/hw/i2c/aspeed_i2c.c
+++ b/hw/i2c/aspeed_i2c.c
@@ -780,7 +780,6 @@ static void aspeed_i2c_bus_new_write(AspeedI2CBus *bus, hwaddr offset,
         bus->regs[R_I2CS_DMA_RX_ADDR] = value;
         break;
     case A_I2CS_DMA_LEN:
-        assert(FIELD_EX32(value, I2CS_DMA_LEN, TX_BUF_LEN) == 0);
         if (FIELD_EX32(value, I2CS_DMA_LEN, RX_BUF_LEN_W1T)) {
             ARRAY_FIELD_DP32(bus->regs, I2CS_DMA_LEN, RX_BUF_LEN,
                              FIELD_EX32(value, I2CS_DMA_LEN, RX_BUF_LEN));
-- 
2.53.0



  parent reply	other threads:[~2026-03-23 12:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-23 12:55 [PATCH v2 0/3] aspeed: Improve error handling and fix DMA issues Cédric Le Goater
2026-03-23 12:55 ` [PATCH v2 1/3] hw/ssi/aspeed_smc: Convert mem ops to read/write_with_attrs for error handling Cédric Le Goater
2026-03-23 12:55 ` [PATCH v2 2/3] ftgmac100: Improve DMA " Cédric Le Goater
2026-03-24 14:45   ` Michael Tokarev
2026-03-24 14:49     ` Cédric Le Goater
2026-03-23 12:55 ` Cédric Le Goater [this message]
2026-03-23 13:21 ` [PATCH v2 0/3] aspeed: Improve error handling and fix DMA issues Cédric Le Goater

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=20260323125545.577653-4-clg@redhat.com \
    --to=clg@redhat.com \
    --cc=jamin_lin@aspeedtech.com \
    --cc=kane_chen@aspeedtech.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox