{"id":816404,"url":"http://patchwork.ozlabs.org/api/patches/816404/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-i2c/patch/20170920185956.13874-6-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-6-wsa+renesas@sang-engineering.com>","list_archive_url":null,"date":"2017-09-20T18:59:55","name":"[RFC,v5,5/6] i2c: rcar: skip DMA if buffer is not safe","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"17617d4ac7f1843fbe65c3e7ebe834cc72381ae0","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-6-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/816404/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/816404/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 3xy8GL5W6Bz9s4s\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 05:00:58 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751707AbdITTAj (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tWed, 20 Sep 2017 15:00:39 -0400","from sauhun.de ([88.99.104.3]:38847 \"EHLO pokefinder.org\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1751572AbdITTAG (ORCPT <rfc822;linux-i2c@vger.kernel.org>);\n\tWed, 20 Sep 2017 15:00:06 -0400","from localhost (p54B332E6.dip0.t-ipconnect.de [84.179.50.230])\n\tby pokefinder.org (Postfix) with ESMTPSA id 1A6842C43A8;\n\tWed, 20 Sep 2017 21:00:04 +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 5/6] i2c: rcar: skip DMA if buffer is not safe","Date":"Wed, 20 Sep 2017 20:59:55 +0200","Message-Id":"<20170920185956.13874-6-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":"This HW is prone to races, so it needs to setup new messages in irq\ncontext. That means we can't alloc bounce buffers if a message buffer is\nnot DMA safe. So, in that case, simply fall back to PIO.\n\nSigned-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>\n---\n drivers/i2c/busses/i2c-rcar.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)","diff":"diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c\nindex 15d764afec3b29..8a2ae3e6c561c4 100644\n--- a/drivers/i2c/busses/i2c-rcar.c\n+++ b/drivers/i2c/busses/i2c-rcar.c\n@@ -359,7 +359,7 @@ static void rcar_i2c_dma(struct rcar_i2c_priv *priv)\n \tint len;\n \n \t/* Do not use DMA if it's not available or for messages < 8 bytes */\n-\tif (IS_ERR(chan) || msg->len < 8)\n+\tif (IS_ERR(chan) || msg->len < 8 || !(msg->flags & I2C_M_DMA_SAFE))\n \t\treturn;\n \n \tif (read) {\n","prefixes":["RFC","v5","5/6"]}