[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231209204455.jxize3muvx7hhpos@zenone.zhora.eu>
Date: Sat, 9 Dec 2023 21:44:55 +0100
From: Andi Shyti <andi.shyti@...nel.org>
To: Quan Nguyen <quan@...amperecomputing.com>
Cc: Brendan Higgins <brendan.higgins@...ux.dev>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Joel Stanley <joel@....id.au>,
Andrew Jeffery <andrew@...econstruct.com.au>,
Wolfram Sang <wsa@...nel.org>,
Jae Hyun Yoo <jae.hyun.yoo@...ux.intel.com>,
Guenter Roeck <linux@...ck-us.net>, linux-i2c@...r.kernel.org,
openbmc@...ts.ozlabs.org, linux-arm-kernel@...ts.infradead.org,
linux-aspeed@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
Cosmo Chou <chou.cosmo@...il.com>,
Open Source Submission <patches@...erecomputing.com>,
Phong Vo <phong@...amperecomputing.com>,
"Thang Q . Nguyen" <thang@...amperecomputing.com>
Subject: Re: [PATCH v3 2/2] i2c: aspeed: Acknowledge Tx done with and without
ACK irq late
Hi Quan,
[...]
> - /* Ack all interrupts except for Rx done */
> - writel(irq_received & ~ASPEED_I2CD_INTR_RX_DONE,
> - bus->base + ASPEED_I2C_INTR_STS_REG);
> +
> + /*
> + * Early acking of INTR_RX_DONE and INTR_TX_[ACK|NAK] would indicate HW to
> + * start receiving or sending new data, and this may cause a race condition
> + * as the irq handler has not yet handled these irqs but is being acked.
> + * Let's ack them late at the end of the irq handler when those are truly processed.
> + */
> + irq_ack_last = ASPEED_I2CD_INTR_RX_DONE | ASPEED_I2CD_INTR_TX_ACK | ASPEED_I2CD_INTR_TX_NAK;
> + writel(irq_received & ~irq_ack_last, bus->base + ASPEED_I2C_INTR_STS_REG);
I like Andrews suggestion of having irq_ack_last as a define that
is already negated, instead of negating it in the writel, which
makes it a bit difficult to read.
Besides, ack_last, as a name is not very meaningful, I'd rather
call it irq_ack_rx_tx (or something similar).
But I'm not going to block it for this, up to you if you want to
send a new version.
Reviewed-by: Andi Shyti <andi.shyti@...nel.org>
Thanks,
Andi
Powered by blists - more mailing lists