[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<OSQPR06MB725203E31EBAC2B71A7901E48BF42@OSQPR06MB7252.apcprd06.prod.outlook.com>
Date: Tue, 4 Feb 2025 10:09:31 +0000
From: Billy Tsai <billy_tsai@...eedtech.com>
To: Thomas Weißschuh <linux@...ssschuh.net>
CC: "alexandre.belloni@...tlin.com" <alexandre.belloni@...tlin.com>,
"pgaj@...ence.com" <pgaj@...ence.com>, "miquel.raynal@...tlin.com"
<miquel.raynal@...tlin.com>, "conor.culhane@...vaco.com"
<conor.culhane@...vaco.com>, "aniketmaurya@...gle.com"
<aniketmaurya@...gle.com>, "Shyam-sundar.S-k@....com"
<Shyam-sundar.S-k@....com>, "jarkko.nikula@...ux.intel.com"
<jarkko.nikula@...ux.intel.com>, "wsa+renesas@...g-engineering.com"
<wsa+renesas@...g-engineering.com>, "xiaopei01@...inos.cn"
<xiaopei01@...inos.cn>, "Guruvendra.Punugupati@....com"
<Guruvendra.Punugupati@....com>, "linux-i3c@...ts.infradead.org"
<linux-i3c@...ts.infradead.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, BMC-SW <BMC-SW@...eedtech.com>
Subject: Re: [PATCH v2 1/2] i3c: Remove the const qualifier from i2c_msg
pointer in i2c_xfers API
> On 2025-02-04 17:17:01+0800, Billy Tsai wrote:
> > The change is necessary to enable the use of the
> > `i2c_get_dma_safe_msg_buf()` API, which requires a non-const
> > `struct i2c_msg *` to operate. The `i2c_get_dma_safe_msg_buf()` function
> > ensures safe handling of I2C messages when using DMA, making it essential
> > for scenarios where DMA transfers are involved. By removing the `const`
> > qualifier, this patch allows drivers to prepare and manage DMA-safe
> > buffers directly.
> This is missing a changelog to v1 of the series.
> Also I asked before why it is not possible to change the signature of
> i2c_get_dma_safe_msg_buf() to accept 'const struct i2c_msg *' [0].
> That looks like the nicer solution to me.
Hi Thomas,
The i2c_get_dma_safe_msg_buf() function has existed for a long time, but I do not know the original reason why it declares struct i2c_msg * without const. However, I believe this is because the i2c_put_dma_safe_msg_buf() function modifies the buffer data, so for consistency, it is declared without const.
Best regards,
Billy Tsai.
Powered by blists - more mailing lists