Cover Letter Detail
Show a cover letter.
GET /api/covers/816408/?format=api
{ "id": 816408, "url": "http://patchwork.ozlabs.org/api/covers/816408/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-i2c/cover/20170920185956.13874-1-wsa+renesas@sang-engineering.com/", "project": { "id": 35, "url": "http://patchwork.ozlabs.org/api/projects/35/?format=api", "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-1-wsa+renesas@sang-engineering.com>", "list_archive_url": null, "date": "2017-09-20T18:59:50", "name": "[RFC,v5,0/6] i2c: document DMA handling and add helpers for it", "submitter": { "id": 69646, "url": "http://patchwork.ozlabs.org/api/people/69646/?format=api", "name": "Wolfram Sang", "email": "wsa+renesas@sang-engineering.com" }, "mbox": "http://patchwork.ozlabs.org/project/linux-i2c/cover/20170920185956.13874-1-wsa+renesas@sang-engineering.com/mbox/", "series": [ { "id": 4199, "url": "http://patchwork.ozlabs.org/api/series/4199/?format=api", "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/covers/816408/comments/", "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 3xy8HD4zpnz9sPm\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 05:01:44 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751523AbdITTAE (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tWed, 20 Sep 2017 15:00:04 -0400", "from sauhun.de ([88.99.104.3]:38831 \"EHLO pokefinder.org\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1751361AbdITTAD (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 5456F2C4391;\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 0/6] i2c: document DMA handling and add helpers for it", "Date": "Wed, 20 Sep 2017 20:59:50 +0200", "Message-Id": "<20170920185956.13874-1-wsa+renesas@sang-engineering.com>", "X-Mailer": "git-send-email 2.11.0", "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": "So, after revisiting old mail threads, taking part in a similar discussion on\nthe USB list, and implementing a not-convincing solution before, here is what I\ncooked up to document and ease DMA handling for I2C within Linux. Please have a\nlook at the documentation introduced in patch 3 for details. And to make it\nclear again: The stuff below is opt-in. If host drivers are not updated, they\nwill continue to work like before.\n\nWhile the previous versions tried to magically apply bounce buffers when\nneeded, it became clear that detecting DMA safe buffers is too fragile. This\napproach is now opt-in, a DMA_SAFE flag needs to be set on an i2c_msg. The\noutcome so far is very convincing IMO. The core additions are simple and easy\nto understand (makes me even think of inlining them again?). The driver changes\nfor the Renesas IP cores became easier to understand, too. While only a tad for\nthe i2c-sh_mobile driver, the situation became a LOT better for the i2c-rcar\ndriver. No more DMA disabling for the whole transfer in case of unsafe buffers,\nwe are back to per-msg handling. And the code fix is now an easy to understand\none line change. Yay!\n\nOf course, we must now whitelist DMA safe buffers. An example for I2C_RDWR case\nis in this series. It makes the i2ctransfer utility have DMA_SAFE buffers,\nwhich is nice for testing as i2cdump will (currently) not use DMA_SAFE buffers.\nMy plan is to add two new calls: i2c_master_{send|receive}_dma_safe which can\nbe used if DMA_SAFE buffers are provided. So, drivers can simply switch to\nthem. Also, the buffers used within i2c_smbus_xfer_emulated() need to be\nconverted to be DMA_SAFE which will cover a huge bunch of use cases. The rest\nis then updating drivers which can be done when needed.\n\nAs these conversions are not done yet, this patch series has RFC status. But I\nalready would like to get opinions on this approach, so I'll cc mailing lists\nof the heavier I2C users. Please let me know what you think.\n\nAll patches have been tested with a Renesas Salvator-X board (r8a7796/M3-W).\n\nThe branch can be found here:\n\ngit://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/topic/i2c-core-dma-rfc-v5\n\nAnd big kudos to Renesas Electronics for funding this work, thank you very much!\n\nRegards,\n\n Wolfram\n\nChanges since v4:\n\t* rebased to v4.14-rc1\n\t* (hopefully) improved the docs to be more clear\n\t* added basic RST syntax to the docs\n\nThis is mainly an update to agree on the docs. Missing code is still missing\nand will be added in v6.\n\nChanges since v3:\n\t* completely redesigned\n\n\nWolfram Sang (6):\n i2c: add a message flag for DMA safe buffers\n i2c: add helpers to ease DMA handling\n i2c: add docs to clarify DMA handling\n i2c: sh_mobile: use helper to decide if DMA is useful\n i2c: rcar: skip DMA if buffer is not safe\n i2c: dev: mark RDWR buffers as DMA_SAFE\n\n Documentation/i2c/DMA-considerations | 58 ++++++++++++++++++++++++++++++++++++\n drivers/i2c/busses/i2c-rcar.c | 2 +-\n drivers/i2c/busses/i2c-sh_mobile.c | 8 +++--\n drivers/i2c/i2c-core-base.c | 45 ++++++++++++++++++++++++++++\n drivers/i2c/i2c-dev.c | 2 ++\n include/linux/i2c.h | 3 ++\n include/uapi/linux/i2c.h | 3 ++\n 7 files changed, 118 insertions(+), 3 deletions(-)\n create mode 100644 Documentation/i2c/DMA-considerations" }