All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-i2c@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-iio@vger.kernel.org, linux-input@vger.kernel.org,
	linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Wolfram Sang <wsa+renesas@sang-engineering.com>
Subject: [RFC PATCH v5 6/6] i2c: dev: mark RDWR buffers as DMA_SAFE
Date: Wed, 20 Sep 2017 20:59:56 +0200	[thread overview]
Message-ID: <20170920185956.13874-7-wsa+renesas@sang-engineering.com> (raw)
In-Reply-To: <20170920185956.13874-1-wsa+renesas@sang-engineering.com>

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/i2c/i2c-dev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
index 6f638bbc922db4..bbc7aadb4c899d 100644
--- a/drivers/i2c/i2c-dev.c
+++ b/drivers/i2c/i2c-dev.c
@@ -280,6 +280,8 @@ static noinline int i2cdev_ioctl_rdwr(struct i2c_client *client,
 			res = PTR_ERR(rdwr_pa[i].buf);
 			break;
 		}
+		/* memdup_user allocates with GFP_KERNEL, so DMA is ok */
+		rdwr_pa[i].flags |= I2C_M_DMA_SAFE;
 
 		/*
 		 * If the message length is received from the slave (similar
-- 
2.11.0

  parent reply	other threads:[~2017-09-20 19:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-20 18:59 [RFC PATCH v5 0/6] i2c: document DMA handling and add helpers for it Wolfram Sang
2017-09-20 18:59 ` [RFC PATCH v5 1/6] i2c: add a message flag for DMA safe buffers Wolfram Sang
2017-09-20 18:59 ` [RFC PATCH v5 2/6] i2c: add helpers to ease DMA handling Wolfram Sang
2017-09-21 13:59   ` Jonathan Cameron
2017-09-21 13:59     ` Jonathan Cameron
2017-09-21 14:05     ` Jonathan Cameron
2017-09-21 14:05       ` Jonathan Cameron
2017-09-21 14:15       ` Wolfram Sang
2017-09-21 14:36         ` Jonathan Cameron
2017-09-21 14:36           ` Jonathan Cameron
2017-09-20 18:59 ` [RFC PATCH v5 3/6] i2c: add docs to clarify " Wolfram Sang
2017-09-20 19:56   ` Mauro Carvalho Chehab
2017-09-21 14:08     ` Jonathan Cameron
2017-09-21 14:08       ` Jonathan Cameron
2017-09-20 18:59 ` [RFC PATCH v5 4/6] i2c: sh_mobile: use helper to decide if DMA is useful Wolfram Sang
2017-09-20 18:59 ` [RFC PATCH v5 5/6] i2c: rcar: skip DMA if buffer is not safe Wolfram Sang
2017-09-20 18:59 ` Wolfram Sang [this message]
2017-09-21 14:17   ` [RFC PATCH v5 6/6] i2c: dev: mark RDWR buffers as DMA_SAFE Jonathan Cameron
2017-09-21 14:17     ` Jonathan Cameron
2017-09-21 14:23     ` Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170920185956.13874-7-wsa+renesas@sang-engineering.com \
    --to=wsa+renesas@sang-engineering.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.