From patchwork Wed Sep 20 18:59:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 9962045 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4CB43601D5 for ; Wed, 20 Sep 2017 19:01:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F81E2904D for ; Wed, 20 Sep 2017 19:01:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 340FB29203; Wed, 20 Sep 2017 19:01:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C52A529202 for ; Wed, 20 Sep 2017 19:01:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751781AbdITTAV (ORCPT ); Wed, 20 Sep 2017 15:00:21 -0400 Received: from sauhun.de ([88.99.104.3]:38850 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751606AbdITTAG (ORCPT ); Wed, 20 Sep 2017 15:00:06 -0400 Received: from localhost (p54B332E6.dip0.t-ipconnect.de [84.179.50.230]) by pokefinder.org (Postfix) with ESMTPSA id 9A2622C43AA; Wed, 20 Sep 2017 21:00:04 +0200 (CEST) From: Wolfram Sang 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 Subject: [RFC PATCH v5 6/6] i2c: dev: mark RDWR buffers as DMA_SAFE Date: Wed, 20 Sep 2017 20:59:56 +0200 Message-Id: <20170920185956.13874-7-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170920185956.13874-1-wsa+renesas@sang-engineering.com> References: <20170920185956.13874-1-wsa+renesas@sang-engineering.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Wolfram Sang Reviewed-by: Jonathan Cameron --- 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