* [PATCH v1 2/2] i3c: mipi-i3c-hci: Use DMA-safe buffer for I2C transfers
2025-01-21 11:07 [PATCH v1 1/2] i3c: Remove the const qualifier from i2c_msg pointer in i2c_xfers API Billy Tsai
@ 2025-01-21 11:07 ` Billy Tsai
2025-01-21 22:19 ` Wolfram Sang
` (2 more replies)
2025-01-21 22:18 ` [PATCH v1 1/2] i3c: Remove the const qualifier from i2c_msg pointer in i2c_xfers API Wolfram Sang
` (3 subsequent siblings)
4 siblings, 3 replies; 11+ messages in thread
From: Billy Tsai @ 2025-01-21 11:07 UTC (permalink / raw)
To: alexandre.belloni, pgaj, miquel.raynal, conor.culhane,
aniketmaurya, billy_tsai, Shyam-sundar.S-k, jarkko.nikula,
wsa+renesas, xiaopei01, Guruvendra.Punugupati, linux-i3c,
linux-kernel
The i2c_get_dma_safe_msg_buf function is used to ensure safe handling of
I2C messages in HCI DMA mode.
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
---
drivers/i3c/master/mipi-i3c-hci/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c
index a408feac3e9e..3567cd566339 100644
--- a/drivers/i3c/master/mipi-i3c-hci/core.c
+++ b/drivers/i3c/master/mipi-i3c-hci/core.c
@@ -382,7 +382,7 @@ static int i3c_hci_i2c_xfers(struct i2c_dev_desc *dev,
return -ENOMEM;
for (i = 0; i < nxfers; i++) {
- xfer[i].data = i2c_xfers[i].buf;
+ xfer[i].data = i2c_get_dma_safe_msg_buf(&i2c_xfers[i], 1);
xfer[i].data_len = i2c_xfers[i].len;
xfer[i].rnw = i2c_xfers[i].flags & I2C_M_RD;
hci->cmd->prep_i2c_xfer(hci, dev, &xfer[i]);
--
2.25.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH v1 2/2] i3c: mipi-i3c-hci: Use DMA-safe buffer for I2C transfers
2025-01-21 11:07 ` [PATCH v1 2/2] i3c: mipi-i3c-hci: Use DMA-safe buffer for I2C transfers Billy Tsai
@ 2025-01-21 22:19 ` Wolfram Sang
2025-01-23 10:23 ` Billy Tsai
2025-01-22 7:11 ` Mukesh Kumar Savaliya
2025-01-22 8:28 ` Jarkko Nikula
2 siblings, 1 reply; 11+ messages in thread
From: Wolfram Sang @ 2025-01-21 22:19 UTC (permalink / raw)
To: Billy Tsai
Cc: alexandre.belloni, pgaj, miquel.raynal, conor.culhane,
aniketmaurya, Shyam-sundar.S-k, jarkko.nikula, xiaopei01,
Guruvendra.Punugupati, linux-i3c, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 152 bytes --]
> - xfer[i].data = i2c_xfers[i].buf;
> + xfer[i].data = i2c_get_dma_safe_msg_buf(&i2c_xfers[i], 1);
Where is a 'get' there also should be a 'put'.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v1 2/2] i3c: mipi-i3c-hci: Use DMA-safe buffer for I2C transfers
2025-01-21 22:19 ` Wolfram Sang
@ 2025-01-23 10:23 ` Billy Tsai
0 siblings, 0 replies; 11+ messages in thread
From: Billy Tsai @ 2025-01-23 10:23 UTC (permalink / raw)
To: Wolfram Sang
Cc: alexandre.belloni@bootlin.com, pgaj@cadence.com,
miquel.raynal@bootlin.com, conor.culhane@silvaco.com,
aniketmaurya@google.com, Shyam-sundar.S-k@amd.com,
jarkko.nikula@linux.intel.com, xiaopei01@kylinos.cn,
Guruvendra.Punugupati@amd.com, linux-i3c@lists.infradead.org,
linux-kernel@vger.kernel.org
> > - xfer[i].data = i2c_xfers[i].buf;
> > + xfer[i].data = i2c_get_dma_safe_msg_buf(&i2c_xfers[i], 1);
> Where is a 'get' there also should be a 'put'.
Thanks.
I will add the i2c_put_dma_safe_msg_buf in the next version.
Billy Tsai
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v1 2/2] i3c: mipi-i3c-hci: Use DMA-safe buffer for I2C transfers
2025-01-21 11:07 ` [PATCH v1 2/2] i3c: mipi-i3c-hci: Use DMA-safe buffer for I2C transfers Billy Tsai
2025-01-21 22:19 ` Wolfram Sang
@ 2025-01-22 7:11 ` Mukesh Kumar Savaliya
2025-01-22 8:28 ` Jarkko Nikula
2 siblings, 0 replies; 11+ messages in thread
From: Mukesh Kumar Savaliya @ 2025-01-22 7:11 UTC (permalink / raw)
To: Billy Tsai, alexandre.belloni, pgaj, miquel.raynal, conor.culhane,
aniketmaurya, Shyam-sundar.S-k, jarkko.nikula, wsa+renesas,
xiaopei01, Guruvendra.Punugupati, linux-i3c, linux-kernel
On 1/21/2025 4:37 PM, Billy Tsai wrote:
> The i2c_get_dma_safe_msg_buf function is used to ensure safe handling of
> I2C messages in HCI DMA mode.
>
> Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
> ---
> drivers/i3c/master/mipi-i3c-hci/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c
> index a408feac3e9e..3567cd566339 100644
> --- a/drivers/i3c/master/mipi-i3c-hci/core.c
> +++ b/drivers/i3c/master/mipi-i3c-hci/core.c
> @@ -382,7 +382,7 @@ static int i3c_hci_i2c_xfers(struct i2c_dev_desc *dev,
> return -ENOMEM;
>
> for (i = 0; i < nxfers; i++) {
> - xfer[i].data = i2c_xfers[i].buf;
> + xfer[i].data = i2c_get_dma_safe_msg_buf(&i2c_xfers[i], 1);
Should be i2c_xfers[i].buf ? IIUC, it's iterating over many message
buffers upto nxfers.
> xfer[i].data_len = i2c_xfers[i].len;
> xfer[i].rnw = i2c_xfers[i].flags & I2C_M_RD;
> hci->cmd->prep_i2c_xfer(hci, dev, &xfer[i]);
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH v1 2/2] i3c: mipi-i3c-hci: Use DMA-safe buffer for I2C transfers
2025-01-21 11:07 ` [PATCH v1 2/2] i3c: mipi-i3c-hci: Use DMA-safe buffer for I2C transfers Billy Tsai
2025-01-21 22:19 ` Wolfram Sang
2025-01-22 7:11 ` Mukesh Kumar Savaliya
@ 2025-01-22 8:28 ` Jarkko Nikula
2 siblings, 0 replies; 11+ messages in thread
From: Jarkko Nikula @ 2025-01-22 8:28 UTC (permalink / raw)
To: Billy Tsai, alexandre.belloni, pgaj, miquel.raynal, conor.culhane,
aniketmaurya, Shyam-sundar.S-k, wsa+renesas, xiaopei01,
Guruvendra.Punugupati, linux-i3c, linux-kernel
On 1/21/25 1:07 PM, Billy Tsai wrote:
> The i2c_get_dma_safe_msg_buf function is used to ensure safe handling of
> I2C messages in HCI DMA mode.
>
> Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
> ---
> drivers/i3c/master/mipi-i3c-hci/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c
> index a408feac3e9e..3567cd566339 100644
> --- a/drivers/i3c/master/mipi-i3c-hci/core.c
> +++ b/drivers/i3c/master/mipi-i3c-hci/core.c
> @@ -382,7 +382,7 @@ static int i3c_hci_i2c_xfers(struct i2c_dev_desc *dev,
> return -ENOMEM;
>
> for (i = 0; i < nxfers; i++) {
> - xfer[i].data = i2c_xfers[i].buf;
> + xfer[i].data = i2c_get_dma_safe_msg_buf(&i2c_xfers[i], 1);
> xfer[i].data_len = i2c_xfers[i].len;
> xfer[i].rnw = i2c_xfers[i].flags & I2C_M_RD;
> hci->cmd->prep_i2c_xfer(hci, dev, &xfer[i]);
This allow to remove calls to i3c_hci_alloc_safe_xfer_buf() and
i3c_hci_free_safe_xfer_buf() in i3c_hci_i2c_xfers().
I was pondering the i2c_get_dma_safe_msg_buf() when making commit
4afd72876942 ("i3c: mipi-i3c-hci: Add DMA bounce buffer for private
transfers") but decided to reuse the same (own) helper for both
i3c_hci_priv_xfers() and i3c_hci_i2c_xfers().
In that sense I'd modify the commit log a bit that instead of ensuring
safe handling patch switches from custom helper to
i2c_get_dma_safe_msg_buf() and i2c_put_dma_safe_msg_buf() (please note
the comment from Wolfram).
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v1 1/2] i3c: Remove the const qualifier from i2c_msg pointer in i2c_xfers API
2025-01-21 11:07 [PATCH v1 1/2] i3c: Remove the const qualifier from i2c_msg pointer in i2c_xfers API Billy Tsai
2025-01-21 11:07 ` [PATCH v1 2/2] i3c: mipi-i3c-hci: Use DMA-safe buffer for I2C transfers Billy Tsai
@ 2025-01-21 22:18 ` Wolfram Sang
2025-01-22 7:11 ` Mukesh Kumar Savaliya
` (2 subsequent siblings)
4 siblings, 0 replies; 11+ messages in thread
From: Wolfram Sang @ 2025-01-21 22:18 UTC (permalink / raw)
To: Billy Tsai
Cc: alexandre.belloni, pgaj, miquel.raynal, conor.culhane,
aniketmaurya, Shyam-sundar.S-k, jarkko.nikula, xiaopei01,
Guruvendra.Punugupati, linux-i3c, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 646 bytes --]
On Tue, Jan 21, 2025 at 07:07:55PM +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.
>
> Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Makes sense to me:
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH v1 1/2] i3c: Remove the const qualifier from i2c_msg pointer in i2c_xfers API
2025-01-21 11:07 [PATCH v1 1/2] i3c: Remove the const qualifier from i2c_msg pointer in i2c_xfers API Billy Tsai
2025-01-21 11:07 ` [PATCH v1 2/2] i3c: mipi-i3c-hci: Use DMA-safe buffer for I2C transfers Billy Tsai
2025-01-21 22:18 ` [PATCH v1 1/2] i3c: Remove the const qualifier from i2c_msg pointer in i2c_xfers API Wolfram Sang
@ 2025-01-22 7:11 ` Mukesh Kumar Savaliya
2025-01-22 7:21 ` Wolfram Sang
2025-01-22 8:42 ` Thomas Weißschuh
2025-02-04 15:15 ` Mukesh Kumar Savaliya
4 siblings, 1 reply; 11+ messages in thread
From: Mukesh Kumar Savaliya @ 2025-01-22 7:11 UTC (permalink / raw)
To: Billy Tsai, alexandre.belloni, pgaj, miquel.raynal, conor.culhane,
aniketmaurya, Shyam-sundar.S-k, jarkko.nikula, wsa+renesas,
xiaopei01, Guruvendra.Punugupati, linux-i3c, linux-kernel
Good Change Billy. Thanks for bringing this to i3c.
On 1/21/2025 4:37 PM, 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.
>
> Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
> ---
> drivers/i3c/master/dw-i3c-master.c | 2 +-
> drivers/i3c/master/i3c-master-cdns.c | 2 +-
> drivers/i3c/master/mipi-i3c-hci/core.c | 2 +-
> drivers/i3c/master/svc-i3c-master.c | 2 +-
> include/linux/i3c/master.h | 2 +-
> 5 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
> index d09ea5b6467c..54c7d86997d5 100644
> --- a/drivers/i3c/master/dw-i3c-master.c
> +++ b/drivers/i3c/master/dw-i3c-master.c
> @@ -1079,7 +1079,7 @@ static void dw_i3c_master_detach_i3c_dev(struct i3c_dev_desc *dev)
> }
>
> static int dw_i3c_master_i2c_xfers(struct i2c_dev_desc *dev,
> - const struct i2c_msg *i2c_xfers,
> + struct i2c_msg *i2c_xfers,
what we need is only i2c_xfers->buf to be DMA-safe, not the *i2c_xfers.
Right ?
> int i2c_nxfers)
> {
> struct dw_i3c_i2c_dev_data *data = i2c_dev_get_master_data(dev);
> diff --git a/drivers/i3c/master/i3c-master-cdns.c b/drivers/i3c/master/i3c-master-cdns.c
> index 8d69a34986d9..c9e4c129454c 100644
> --- a/drivers/i3c/master/i3c-master-cdns.c
> +++ b/drivers/i3c/master/i3c-master-cdns.c
> @@ -813,7 +813,7 @@ static int cdns_i3c_master_priv_xfers(struct i3c_dev_desc *dev,
> }
>
> static int cdns_i3c_master_i2c_xfers(struct i2c_dev_desc *dev,
> - const struct i2c_msg *xfers, int nxfers)
> + struct i2c_msg *xfers, int nxfers)
> {
> struct i3c_master_controller *m = i2c_dev_get_master(dev);
> struct cdns_i3c_master *master = to_cdns_i3c_master(m);
we only need to use i2c_get_dma_safe_msg_buf() for the xfers[i].buf
being used inside the driver as a protection ?
Also I guess same change is required for all the vendor drivers. But Not
sure if it's feasible with this patch ?
> diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c
> index e6e482a259b4..a408feac3e9e 100644
> --- a/drivers/i3c/master/mipi-i3c-hci/core.c
> +++ b/drivers/i3c/master/mipi-i3c-hci/core.c
> @@ -367,7 +367,7 @@ static int i3c_hci_priv_xfers(struct i3c_dev_desc *dev,
> }
>
> static int i3c_hci_i2c_xfers(struct i2c_dev_desc *dev,
> - const struct i2c_msg *i2c_xfers, int nxfers)
> + struct i2c_msg *i2c_xfers, int nxfers)
> {
> struct i3c_master_controller *m = i2c_dev_get_master(dev);
> struct i3c_hci *hci = to_i3c_hci(m);
> diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c
> index c1ee3828e7ee..24bd701b5de0 100644
> --- a/drivers/i3c/master/svc-i3c-master.c
> +++ b/drivers/i3c/master/svc-i3c-master.c
> @@ -1584,7 +1584,7 @@ static int svc_i3c_master_priv_xfers(struct i3c_dev_desc *dev,
> }
>
> static int svc_i3c_master_i2c_xfers(struct i2c_dev_desc *dev,
> - const struct i2c_msg *xfers,
> + struct i2c_msg *xfers,
> int nxfers)
> {
> struct i3c_master_controller *m = i2c_dev_get_master(dev);
> diff --git a/include/linux/i3c/master.h b/include/linux/i3c/master.h
> index 12d532b012c5..c67922ece617 100644
> --- a/include/linux/i3c/master.h
> +++ b/include/linux/i3c/master.h
> @@ -475,7 +475,7 @@ struct i3c_master_controller_ops {
> int (*attach_i2c_dev)(struct i2c_dev_desc *dev);
> void (*detach_i2c_dev)(struct i2c_dev_desc *dev);
> int (*i2c_xfers)(struct i2c_dev_desc *dev,
> - const struct i2c_msg *xfers, int nxfers);
> + struct i2c_msg *xfers, int nxfers);
> int (*request_ibi)(struct i3c_dev_desc *dev,
> const struct i3c_ibi_setup *req);
> void (*free_ibi)(struct i3c_dev_desc *dev);
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH v1 1/2] i3c: Remove the const qualifier from i2c_msg pointer in i2c_xfers API
2025-01-22 7:11 ` Mukesh Kumar Savaliya
@ 2025-01-22 7:21 ` Wolfram Sang
0 siblings, 0 replies; 11+ messages in thread
From: Wolfram Sang @ 2025-01-22 7:21 UTC (permalink / raw)
To: Mukesh Kumar Savaliya
Cc: Billy Tsai, alexandre.belloni, pgaj, miquel.raynal, conor.culhane,
aniketmaurya, Shyam-sundar.S-k, jarkko.nikula, xiaopei01,
Guruvendra.Punugupati, linux-i3c, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 393 bytes --]
> what we need is only i2c_xfers->buf to be DMA-safe, not the *i2c_xfers.
> Right ?
Yes.
> Also I guess same change is required for all the vendor drivers. But Not
> sure if it's feasible with this patch ?
I also wondered if the I3C core should maybe provide this, but then I
saw that currently only the mipi-hci driver uses DMA and concluded that
per-driver is better. At least for now.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v1 1/2] i3c: Remove the const qualifier from i2c_msg pointer in i2c_xfers API
2025-01-21 11:07 [PATCH v1 1/2] i3c: Remove the const qualifier from i2c_msg pointer in i2c_xfers API Billy Tsai
` (2 preceding siblings ...)
2025-01-22 7:11 ` Mukesh Kumar Savaliya
@ 2025-01-22 8:42 ` Thomas Weißschuh
2025-02-04 15:15 ` Mukesh Kumar Savaliya
4 siblings, 0 replies; 11+ messages in thread
From: Thomas Weißschuh @ 2025-01-22 8:42 UTC (permalink / raw)
To: Billy Tsai
Cc: alexandre.belloni, pgaj, miquel.raynal, conor.culhane,
aniketmaurya, Shyam-sundar.S-k, jarkko.nikula, wsa+renesas,
xiaopei01, Guruvendra.Punugupati, linux-i3c, linux-kernel
On 2025-01-21 19:07:55+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.
Why not modify i2c_get_dma_safe_msg_buf() to accept
'const struct i2c_msg' instead?
> Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
> ---
> drivers/i3c/master/dw-i3c-master.c | 2 +-
> drivers/i3c/master/i3c-master-cdns.c | 2 +-
> drivers/i3c/master/mipi-i3c-hci/core.c | 2 +-
> drivers/i3c/master/svc-i3c-master.c | 2 +-
> include/linux/i3c/master.h | 2 +-
> 5 files changed, 5 insertions(+), 5 deletions(-)
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH v1 1/2] i3c: Remove the const qualifier from i2c_msg pointer in i2c_xfers API
2025-01-21 11:07 [PATCH v1 1/2] i3c: Remove the const qualifier from i2c_msg pointer in i2c_xfers API Billy Tsai
` (3 preceding siblings ...)
2025-01-22 8:42 ` Thomas Weißschuh
@ 2025-02-04 15:15 ` Mukesh Kumar Savaliya
4 siblings, 0 replies; 11+ messages in thread
From: Mukesh Kumar Savaliya @ 2025-02-04 15:15 UTC (permalink / raw)
To: Billy Tsai, alexandre.belloni, pgaj, miquel.raynal, conor.culhane,
aniketmaurya, Shyam-sundar.S-k, jarkko.nikula, wsa+renesas,
xiaopei01, Guruvendra.Punugupati, linux-i3c, linux-kernel
Looks good to me.
On 1/21/2025 4:37 PM, 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.
>
> Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Acked-by: Mukesh Kumar Savaliya <quic_msavaliy@quicinc.com>
> ---
> drivers/i3c/master/dw-i3c-master.c | 2 +-
> drivers/i3c/master/i3c-master-cdns.c | 2 +-
> drivers/i3c/master/mipi-i3c-hci/core.c | 2 +-
> drivers/i3c/master/svc-i3c-master.c | 2 +-
> include/linux/i3c/master.h | 2 +-
> 5 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
> index d09ea5b6467c..54c7d86997d5 100644
> --- a/drivers/i3c/master/dw-i3c-master.c
> +++ b/drivers/i3c/master/dw-i3c-master.c
> @@ -1079,7 +1079,7 @@ static void dw_i3c_master_detach_i3c_dev(struct i3c_dev_desc *dev)
> }
>
> static int dw_i3c_master_i2c_xfers(struct i2c_dev_desc *dev,
> - const struct i2c_msg *i2c_xfers,
> + struct i2c_msg *i2c_xfers,
> int i2c_nxfers)
> {
> struct dw_i3c_i2c_dev_data *data = i2c_dev_get_master_data(dev);
> diff --git a/drivers/i3c/master/i3c-master-cdns.c b/drivers/i3c/master/i3c-master-cdns.c
> index 8d69a34986d9..c9e4c129454c 100644
> --- a/drivers/i3c/master/i3c-master-cdns.c
> +++ b/drivers/i3c/master/i3c-master-cdns.c
> @@ -813,7 +813,7 @@ static int cdns_i3c_master_priv_xfers(struct i3c_dev_desc *dev,
> }
>
> static int cdns_i3c_master_i2c_xfers(struct i2c_dev_desc *dev,
> - const struct i2c_msg *xfers, int nxfers)
> + struct i2c_msg *xfers, int nxfers)
> {
> struct i3c_master_controller *m = i2c_dev_get_master(dev);
> struct cdns_i3c_master *master = to_cdns_i3c_master(m);
> diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c
> index e6e482a259b4..a408feac3e9e 100644
> --- a/drivers/i3c/master/mipi-i3c-hci/core.c
> +++ b/drivers/i3c/master/mipi-i3c-hci/core.c
> @@ -367,7 +367,7 @@ static int i3c_hci_priv_xfers(struct i3c_dev_desc *dev,
> }
>
> static int i3c_hci_i2c_xfers(struct i2c_dev_desc *dev,
> - const struct i2c_msg *i2c_xfers, int nxfers)
> + struct i2c_msg *i2c_xfers, int nxfers)
> {
> struct i3c_master_controller *m = i2c_dev_get_master(dev);
> struct i3c_hci *hci = to_i3c_hci(m);
> diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c
> index c1ee3828e7ee..24bd701b5de0 100644
> --- a/drivers/i3c/master/svc-i3c-master.c
> +++ b/drivers/i3c/master/svc-i3c-master.c
> @@ -1584,7 +1584,7 @@ static int svc_i3c_master_priv_xfers(struct i3c_dev_desc *dev,
> }
>
> static int svc_i3c_master_i2c_xfers(struct i2c_dev_desc *dev,
> - const struct i2c_msg *xfers,
> + struct i2c_msg *xfers,
> int nxfers)
> {
> struct i3c_master_controller *m = i2c_dev_get_master(dev);
> diff --git a/include/linux/i3c/master.h b/include/linux/i3c/master.h
> index 12d532b012c5..c67922ece617 100644
> --- a/include/linux/i3c/master.h
> +++ b/include/linux/i3c/master.h
> @@ -475,7 +475,7 @@ struct i3c_master_controller_ops {
> int (*attach_i2c_dev)(struct i2c_dev_desc *dev);
> void (*detach_i2c_dev)(struct i2c_dev_desc *dev);
> int (*i2c_xfers)(struct i2c_dev_desc *dev,
> - const struct i2c_msg *xfers, int nxfers);
> + struct i2c_msg *xfers, int nxfers);
> int (*request_ibi)(struct i3c_dev_desc *dev,
> const struct i3c_ibi_setup *req);
> void (*free_ibi)(struct i3c_dev_desc *dev);
^ permalink raw reply [flat|nested] 11+ messages in thread