From patchwork Tue Sep 18 08:50:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 10603869 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 769E413AD for ; Tue, 18 Sep 2018 08:51:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6604129E1D for ; Tue, 18 Sep 2018 08:51:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A2B129F37; Tue, 18 Sep 2018 08:51:02 +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=-5.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 16A0229E1D for ; Tue, 18 Sep 2018 08:51:01 +0000 (UTC) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 1F701D0A; Tue, 18 Sep 2018 08:51:00 +0000 (UTC) X-Original-To: ltsi-dev@lists.linuxfoundation.org Delivered-To: ltsi-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 68213D0A for ; Tue, 18 Sep 2018 08:50:58 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from kirsty.vergenet.net (kirsty.vergenet.net [202.4.237.240]) by smtp1.linuxfoundation.org (Postfix) with ESMTP id D84C5784 for ; Tue, 18 Sep 2018 08:50:57 +0000 (UTC) Received: from reginn.horms.nl (watermunt.horms.nl [80.127.179.77]) by kirsty.vergenet.net (Postfix) with ESMTPA id 0B39A25B7E0; Tue, 18 Sep 2018 18:50:56 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=verge.net.au; s=mail; t=1537260656; bh=zkFO5ulHDrYFICIUsTX/L22j7jod/ErH9fV9Q5bRT1I=; h=Date:From:To:Cc:Subject:From; b=Iz8c/BsS1wri34LpKiGe10vGFENXHpYvyu1wesRgx7DijDeQxnK9aCr2+a03kms0L znY6M9kl7LM6mCGaSQgeOsoFq9uLB6CwBErw7OHLJmepLEoFJkkRficYUHq6lIvyRv xdIIKjAEurKANL8c7DKtyrUdSzPMkiVih13/yBGg= Received: by reginn.horms.nl (Postfix, from userid 7100) id D43BD9401E2; Tue, 18 Sep 2018 10:50:53 +0200 (CEST) Date: Tue, 18 Sep 2018 10:50:53 +0200 From: Simon Horman To: Greg KH Message-ID: <20180918085053.lu2k46vqffzj37ah@verge.net.au> MIME-Version: 1.0 Content-Disposition: inline Organisation: Horms Solutions BV User-Agent: NeoMutt/20170113 (1.7.2) Cc: ltsi-dev@lists.linuxfoundation.org, linux-renesas-soc@vger.kernel.org, Magnus Damm Subject: [LTSI-dev] [GIT PULL LTSI-4.14] LTSI-v4.14 Backport or I2C R-Car Fix X-BeenThere: ltsi-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "A list to discuss patches, development, and other things related to the LTSI project" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ltsi-dev-bounces@lists.linuxfoundation.org Errors-To: ltsi-dev-bounces@lists.linuxfoundation.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, This is intended as a submission to LTSI-4.14. It is the backport of a fixes for safe DMA buffer handling for the SH-Mobile I2C driver and I2C code. All patches are present in v4.19-rc3. This pull-request is based on "[GIT PULL LTSI-4.14] LTSI-v4.14 Backport or I2C R-Car Fix" tagged as backport/v4.14.61/snapshot-to-v4.18+fixes-flattened, which I have already sent a pull-request for. There are 10 patches. I have performed build testing of this backports on a wide range of defconfigs and I am not aware of any regressions over v4.14.40 (the baseline chosen when this work began). The following changes since commit 4d4605e5c137ed9a53582e573118cbc16b82cbf1: i2c: rcar: implement STOP and REP_START according to docs (2018-08-28 13:35:06 +0200) are available in the git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-backport.git backport/v4.14.61/snapshot-to-v4.18+fixes-v2-flattened for you to fetch changes up to 720043a4efbb3356db116d084c7b877ad41ee51a: i2c: sh_mobile: fix leak when using DMA bounce buffer (2018-09-17 15:54:30 +0200) ---------------------------------------------------------------- Second Round of LTSI-v4.14 Backports of I2C R-Car Fixes Base: * v4.14.61 * Backports of components for Renesas SoCs to v4.18 * First round of Backports of I2C R-Car Fixes Backport of post-v4.18 fix for i2c-shmobile and I2C core The focus of these fixes is to make DMA buffer handling safe ---------------------------------------------------------------- Peter Rosin (1): i2c: smbus: kill memory leak on emulated and failed DMA SMBus xfers Wenwen Wang (1): i2c: core: smbus: fix a potential missing-check bug Wolfram Sang (8): i2c: dev: mark RDWR buffers as DMA_SAFE i2c: refactor i2c_master_{send_recv} i2c: add i2c_master_{send|recv}_dmasafe i2c: smbus: use DMA safe buffers for emulated SMBus transactions i2c: add docs to clarify DMA handling i2c: refactor function to release a DMA safe buffer i2c: sh_mobile: define start_ch() void as it only returns 0 anyhow i2c: sh_mobile: fix leak when using DMA bounce buffer Documentation/i2c/DMA-considerations | 71 ++++++++++++++++++++++++++++++++++ drivers/i2c/busses/i2c-sh_mobile.c | 15 ++++---- drivers/i2c/i2c-core-base.c | 75 ++++++++++++------------------------ drivers/i2c/i2c-core-smbus.c | 57 ++++++++++++++++++++++----- drivers/i2c/i2c-dev.c | 2 + include/linux/i2c.h | 68 +++++++++++++++++++++++++++++--- 6 files changed, 215 insertions(+), 73 deletions(-) create mode 100644 Documentation/i2c/DMA-considerations