From 09753024bbd330b31ec5510fe22a248fd94d5b53 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Sat, 19 Sep 2026 21:36:41 +0200 Subject: [PATCH] i2c: acpi: Use I2C_M_DMA_SAFE in acpi_gsb_i2c_[read|write]_bytes() The main read / write "buffer" is kzalloc()ed and as such is safe to directly use for DMA (unlike stack mem). Add the I2C_M_DMA_SAFE flag to the transfers using these buffers. Signed-off-by: Hans de Goede Acked-by: Mika Westerberg Signed-off-by: Andi Shyti Link: https://patch.msgid.link/20260919193642.43058-1-johannes.goede@oss.qualcomm.com --- drivers/i2c/i2c-core-acpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c index 564e6ad66398..f0bf7eba5415 100644 --- a/drivers/i2c/i2c-core-acpi.c +++ b/drivers/i2c/i2c-core-acpi.c @@ -609,7 +609,7 @@ static int acpi_gsb_i2c_read_bytes(struct i2c_client *client, msgs[0].buf = &cmd; msgs[1].addr = client->addr; - msgs[1].flags = client->flags | I2C_M_RD; + msgs[1].flags = client->flags | I2C_M_RD | I2C_M_DMA_SAFE; msgs[1].len = data_len; msgs[1].buf = buffer; @@ -650,7 +650,7 @@ static int acpi_gsb_i2c_write_bytes(struct i2c_client *client, memcpy(buffer + 1, data, data_len); msgs[0].addr = client->addr; - msgs[0].flags = client->flags; + msgs[0].flags = client->flags | I2C_M_DMA_SAFE; msgs[0].len = data_len + 1; msgs[0].buf = buffer;