From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Boyd Subject: [PATCH] Input: elants_i2c - Use DMA safe i2c when possible Date: Wed, 10 Oct 2018 09:55:17 -0700 Message-ID: <20181010165517.178545-1-swboyd@chromium.org> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Return-path: Sender: linux-kernel-owner@vger.kernel.org To: Dmitry Torokhov Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Wolfram Sang List-Id: linux-input@vger.kernel.org This irq handler is always reading bytes from the device into a kmalloced buffer, so it's safe to mark this transaction as DMA safe. This avoids bouncing the buffer when an i2c controller decides to use DMA for a transaction. Cc: Wolfram Sang Signed-off-by: Stephen Boyd --- drivers/input/touchscreen/elants_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c index d21ca39b0fdb..be44abb8de33 100644 --- a/drivers/input/touchscreen/elants_i2c.c +++ b/drivers/input/touchscreen/elants_i2c.c @@ -863,7 +863,7 @@ static irqreturn_t elants_i2c_irq(int irq, void *_dev) int i; int len; - len = i2c_master_recv(client, ts->buf, sizeof(ts->buf)); + len = i2c_master_recv_dmasafe(client, ts->buf, sizeof(ts->buf)); if (len < 0) { dev_err(&client->dev, "%s: failed to read data: %d\n", __func__, len); -- Sent by a computer through tubes