From patchwork Wed Oct 10 16:55:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 10634843 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C4295933 for ; Wed, 10 Oct 2018 16:55:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B279E2A005 for ; Wed, 10 Oct 2018 16:55:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A703E2A08B; Wed, 10 Oct 2018 16:55:26 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham 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 2A9CE2A005 for ; Wed, 10 Oct 2018 16:55:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726990AbeJKASU (ORCPT ); Wed, 10 Oct 2018 20:18:20 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:42547 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726568AbeJKASU (ORCPT ); Wed, 10 Oct 2018 20:18:20 -0400 Received: by mail-pl1-f193.google.com with SMTP id c8-v6so2808659plo.9 for ; Wed, 10 Oct 2018 09:55:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=CsUazj8e/ZQvu767Lde9xfu4UDysKXiIgFVGUwQWDTU=; b=VQzOFXErf9dAQUoo77i5/5X2LefJhDDuTib3m5P7mygOk708bwxjo+kN274f+4a5Q/ XTY+lHhdZqqzwbHa9BWwH9CA9pOg79suyVd89TlzGtI6e6wUXMLaL05/vsX9tOSNYd6x SqdZm2lDenn4pkEUiw+Hx3Rtud0aTk6uMZ28g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=CsUazj8e/ZQvu767Lde9xfu4UDysKXiIgFVGUwQWDTU=; b=Ur9SACLnnjsQyuSOTnk46bN4fjLXFCuk3cEty2a86p737nvARfnDzuaHUpayGu9yKh Kj/GswrmpffTRnm0JKkEQ2YR14HtoD1kXiFj9LBBc9crn25//9DKJMM3kw7Z4XrZxqIo iOgktZMTtodRtm+L6o4ahsdoDfS/SkcZSlVfb0nL7QWs6uCj9IIuRjxIEWt2dAC/8XS/ xDh9YdC0uOdtK2djK/1gGWNsrZpR6sA+dlPXTUbBUs094AC/vP61SsjVhWaoFplsQhpP CdnpSFpXKX56uqpEMqarPDlizvGBTC0HTEy+YDPrXWqxS/opXoG9iRhEhQ9SvmAflEoy AjBg== X-Gm-Message-State: ABuFfogta81rD0sIIgeULoMQQXO8pEl37TbyySVXR9qZefm4Vesj+7L6 DILHNufCkflPpnmx1dX40NR7eg== X-Google-Smtp-Source: ACcGV63W8Fi2YvaX8767dvN8DGWugpfDdb1Ii0+GAaZ9mNVkA4OW592PyxXZQN51dUuRr5a/wpdaDw== X-Received: by 2002:a17:902:8a4:: with SMTP id 33-v6mr34135506pll.65.1539190520234; Wed, 10 Oct 2018 09:55:20 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:fed3:9637:a13a:6c15]) by smtp.gmail.com with ESMTPSA id k12-v6sm8961180pgo.34.2018.10.10.09.55.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Oct 2018 09:55:19 -0700 (PDT) From: Stephen Boyd To: Dmitry Torokhov Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Wolfram Sang Subject: [PATCH] Input: elants_i2c - Use DMA safe i2c when possible Date: Wed, 10 Oct 2018 09:55:17 -0700 Message-Id: <20181010165517.178545-1-swboyd@chromium.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This irq handler is always reading bytes from the device into a kmalloced buffer, so it's safe to mark this transaction as DMA safe. This avoids bouncing the buffer when an i2c controller decides to use DMA for a transaction. Cc: Wolfram Sang Signed-off-by: Stephen Boyd --- drivers/input/touchscreen/elants_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c index d21ca39b0fdb..be44abb8de33 100644 --- a/drivers/input/touchscreen/elants_i2c.c +++ b/drivers/input/touchscreen/elants_i2c.c @@ -863,7 +863,7 @@ static irqreturn_t elants_i2c_irq(int irq, void *_dev) int i; int len; - len = i2c_master_recv(client, ts->buf, sizeof(ts->buf)); + len = i2c_master_recv_dmasafe(client, ts->buf, sizeof(ts->buf)); if (len < 0) { dev_err(&client->dev, "%s: failed to read data: %d\n", __func__, len);