{"id":816405,"url":"http://patchwork.ozlabs.org/api/patches/816405/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-i2c/patch/20170920185956.13874-2-wsa+renesas@sang-engineering.com/","project":{"id":35,"url":"http://patchwork.ozlabs.org/api/projects/35/?format=json","name":"Linux I2C development","link_name":"linux-i2c","list_id":"linux-i2c.vger.kernel.org","list_email":"linux-i2c@vger.kernel.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170920185956.13874-2-wsa+renesas@sang-engineering.com>","list_archive_url":null,"date":"2017-09-20T18:59:51","name":"[RFC,v5,1/6] i2c: add a message flag for DMA safe buffers","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"bddd5f186e82d27ce84b1deec4206e85175f0892","submitter":{"id":69646,"url":"http://patchwork.ozlabs.org/api/people/69646/?format=json","name":"Wolfram Sang","email":"wsa+renesas@sang-engineering.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-i2c/patch/20170920185956.13874-2-wsa+renesas@sang-engineering.com/mbox/","series":[{"id":4199,"url":"http://patchwork.ozlabs.org/api/series/4199/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-i2c/list/?series=4199","date":"2017-09-20T18:59:56","name":"i2c: document DMA handling and add helpers for it","version":5,"mbox":"http://patchwork.ozlabs.org/series/4199/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/816405/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/816405/checks/","tags":{},"related":[],"headers":{"Return-Path":"<linux-i2c-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-i2c-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xy8GT6KJSz9s4s\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 05:01:05 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751626AbdITTAF (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tWed, 20 Sep 2017 15:00:05 -0400","from sauhun.de ([88.99.104.3]:38834 \"EHLO pokefinder.org\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1751396AbdITTAD (ORCPT <rfc822;linux-i2c@vger.kernel.org>);\n\tWed, 20 Sep 2017 15:00:03 -0400","from localhost (p54B332E6.dip0.t-ipconnect.de [84.179.50.230])\n\tby pokefinder.org (Postfix) with ESMTPSA id DD2652C4397;\n\tWed, 20 Sep 2017 21:00:01 +0200 (CEST)"],"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,\n\tlinux-iio@vger.kernel.org, linux-input@vger.kernel.org,\n\tlinux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,\n\tWolfram Sang <wsa+renesas@sang-engineering.com>","Subject":"[RFC PATCH v5 1/6] i2c: add a message flag for DMA safe buffers","Date":"Wed, 20 Sep 2017 20:59:51 +0200","Message-Id":"<20170920185956.13874-2-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-i2c-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-i2c.vger.kernel.org>","X-Mailing-List":"linux-i2c@vger.kernel.org"},"content":"I2C has no requirement that the buffer of a message needs to be DMA\nsafe. In case it is, it can now be flagged, so drivers wishing to\ndo DMA can use the buffer directly.\n\nSigned-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>\n---\n include/uapi/linux/i2c.h | 3 +++\n 1 file changed, 3 insertions(+)","diff":"diff --git a/include/uapi/linux/i2c.h b/include/uapi/linux/i2c.h\nindex 009e27bb9abe19..1c683cb319e4b7 100644\n--- a/include/uapi/linux/i2c.h\n+++ b/include/uapi/linux/i2c.h\n@@ -71,6 +71,9 @@ struct i2c_msg {\n #define I2C_M_RD\t\t0x0001\t/* read data, from slave to master */\n \t\t\t\t\t/* I2C_M_RD is guaranteed to be 0x0001! */\n #define I2C_M_TEN\t\t0x0010\t/* this is a ten bit chip address */\n+#define I2C_M_DMA_SAFE\t\t0x0200\t/* the buffer of this message is DMA safe */\n+\t\t\t\t\t/* makes only sense in kernelspace */\n+\t\t\t\t\t/* userspace buffers are copied anyway */\n #define I2C_M_RECV_LEN\t\t0x0400\t/* length will be first received byte */\n #define I2C_M_NO_RD_ACK\t\t0x0800\t/* if I2C_FUNC_PROTOCOL_MANGLING */\n #define I2C_M_IGNORE_NAK\t0x1000\t/* if I2C_FUNC_PROTOCOL_MANGLING */\n","prefixes":["RFC","v5","1/6"]}