From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Shevchenko Subject: Re: [PATCH 00/12] i2c: core: introduce atomic transfers Date: Wed, 3 Apr 2019 16:15:10 +0300 Message-ID: <20190403131510.GE9224@smile.fi.intel.com> References: <20190403124019.8947-1-wsa+renesas@sang-engineering.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20190403124019.8947-1-wsa+renesas@sang-engineering.com> Sender: linux-kernel-owner@vger.kernel.org To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Peter Rosin , Stefan Lengfeld , linux-omap@vger.kernel.org, linux-tegra@vger.kernel.org, Linus Walleij List-Id: linux-tegra@vger.kernel.org On Wed, Apr 03, 2019 at 02:40:07PM +0200, Wolfram Sang wrote: > This series adds support for very late atomic transfers to the I2C subsystem. > It finally reached a state which I think is ready-to-apply. This is mainly > because of two things: > > a) we decided to respect the current locking scheme and to not give atomic > transfers a priority. The code needed for that would have been either > incomplete or very invasive. And we cannot guarantee successful transfers > anyhow. See [1] for the discussion and other write-ups for design choices. > > b) thanks to a discussion with Peter Zijlstra[2], the conditions when to allow > atomic transfers became much clearer. The new helper i2c_in_atomic_xfer_mode() > adds readability, too. > > In detail, changes since RFC v2: > > * dropped coding style patch because already applied > * added new patch 1 to drop in_atomic() and have better conditions when > to enter the atomic path > * added support to the mux-core > * simplified omap conversion a little > * added new conversions for ocores, stu300, and algo-bit/gpio > * typo corrections found by Simon and Stefan > * added tags to drivers > * dropped tags from core patches because that part changed too much > > All tested on a Renesas Lager board (R-Car H2). Sadly, the i2c-sh_mobile driver > cannot be converted now because of other work needed first. I tested with the > i2c-gpio driver, though. The other driver patches are build tested. A branch > can be found here: > > git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/i2c/atomic_xfer > > I am happy for reviews and comments. Please note if you review (especially the > core parts), I'd like to have a short summary of your review even if there is > no proposed change. Like what you did, what you think about it, etc. Some stuff > in here is subtle, so if you went through the effort to double check my > assumptions you should name it :) > Thank you! FWIW, Reviewed-by Andy Shevchenko for patches 1-5,12. Indeed, atomic condition sounds clear now. > > Finally, a big thank you and credit to Renesas for funding this work, of course! > > Happy hacking, > > Wolfram > > [1] https://lkml.org/lkml/2019/3/2/76 > [2] http://patchwork.ozlabs.org/patch/1067437/ > > Wolfram Sang (12): > i2c: remove use of in_atomic() > i2c: core: use I2C locking behaviour also for SMBUS > i2c: core: introduce callbacks for atomic transfers > i2c: mux: populate the new *_atomic callbacks > i2c: demux: handle the new atomic callbacks > i2c: omap: Add the master_xfer_irqless hook > i2c: tegra-bpmp: convert to use new atomic callbacks > i2c: ocores: refactor setup for polling > i2c: ocores: enable atomic xfers > i2c: stu300: use xfer_atomic callback to bail out early > i2c: algo: bit: add flag to whitelist atomic transfers > i2c: gpio: flag atomic capability if possible > > drivers/i2c/algos/i2c-algo-bit.c | 22 +++++++++- > drivers/i2c/busses/i2c-gpio.c | 2 + > drivers/i2c/busses/i2c-ocores.c | 16 +++----- > drivers/i2c/busses/i2c-omap.c | 76 +++++++++++++++++++++++++++++------ > drivers/i2c/busses/i2c-stu300.c | 25 +++++------- > drivers/i2c/busses/i2c-tegra-bpmp.c | 25 +++++++++--- > drivers/i2c/i2c-core-base.c | 17 ++++---- > drivers/i2c/i2c-core-smbus.c | 25 +++++++++--- > drivers/i2c/i2c-core.h | 25 ++++++++++++ > drivers/i2c/i2c-mux.c | 6 +++ > drivers/i2c/muxes/i2c-demux-pinctrl.c | 2 + > include/linux/i2c-algo-bit.h | 1 + > include/linux/i2c.h | 15 +++++-- > 13 files changed, 194 insertions(+), 63 deletions(-) > > -- > 2.11.0 > -- With Best Regards, Andy Shevchenko From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2AC7FC4360F for ; Wed, 3 Apr 2019 13:15:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EF3492147C for ; Wed, 3 Apr 2019 13:15:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="olsipYFX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF3492147C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bRy0JCSr3DTcYK/U9NgDmU1doo7gC3RaqWrljEvkZCo=; b=olsipYFX8Gs1y4 gqFzc32D1PFPT/Wr5AMPhsl6btgPIqu0j8PKp/qpmrugtx0D6CQn5R7C+UBxP6cQ52LcaZttYlPl3 iGv0QWQXHlmPdk07n+sx8P4Jl1OvmEbIP5cJiUr5QafEFKXyT7UhigT63iTJAtEATLJoyVBuZyndR /BHcgFchU+12z17/j+lmV9QDDQgGPQU2Brmnxue4d3wV7kImrC0ifQvA6Ihh30PXwLLPegM2GkF1d FGGdgPxFFbsnDTmXcCClZDv4dvkXEPJv/9LeE/JVlqFpK+pvSjMvfsuGurjjfbP2aglQL5Du9xfPQ e0QHQ47eG+1ifwKDzf2Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBfjd-0006kh-OB; Wed, 03 Apr 2019 13:15:21 +0000 Received: from mga05.intel.com ([192.55.52.43]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBfjW-0006Wr-VK for linux-arm-kernel@lists.infradead.org; Wed, 03 Apr 2019 13:15:19 +0000 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Apr 2019 06:15:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,304,1549958400"; d="scan'208";a="334627151" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.86]) by fmsmga005.fm.intel.com with ESMTP; 03 Apr 2019 06:15:11 -0700 Received: from andy by smile with local (Exim 4.92) (envelope-from ) id 1hBfjS-0002qL-IF; Wed, 03 Apr 2019 16:15:10 +0300 Date: Wed, 3 Apr 2019 16:15:10 +0300 From: Andy Shevchenko To: Wolfram Sang Subject: Re: [PATCH 00/12] i2c: core: introduce atomic transfers Message-ID: <20190403131510.GE9224@smile.fi.intel.com> References: <20190403124019.8947-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190403124019.8947-1-wsa+renesas@sang-engineering.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190403_061515_385597_3FFA0E96 X-CRM114-Status: GOOD ( 21.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linus Walleij , linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org, linux-tegra@vger.kernel.org, Stefan Lengfeld , linux-omap@vger.kernel.org, Peter Rosin , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Apr 03, 2019 at 02:40:07PM +0200, Wolfram Sang wrote: > This series adds support for very late atomic transfers to the I2C subsystem. > It finally reached a state which I think is ready-to-apply. This is mainly > because of two things: > > a) we decided to respect the current locking scheme and to not give atomic > transfers a priority. The code needed for that would have been either > incomplete or very invasive. And we cannot guarantee successful transfers > anyhow. See [1] for the discussion and other write-ups for design choices. > > b) thanks to a discussion with Peter Zijlstra[2], the conditions when to allow > atomic transfers became much clearer. The new helper i2c_in_atomic_xfer_mode() > adds readability, too. > > In detail, changes since RFC v2: > > * dropped coding style patch because already applied > * added new patch 1 to drop in_atomic() and have better conditions when > to enter the atomic path > * added support to the mux-core > * simplified omap conversion a little > * added new conversions for ocores, stu300, and algo-bit/gpio > * typo corrections found by Simon and Stefan > * added tags to drivers > * dropped tags from core patches because that part changed too much > > All tested on a Renesas Lager board (R-Car H2). Sadly, the i2c-sh_mobile driver > cannot be converted now because of other work needed first. I tested with the > i2c-gpio driver, though. The other driver patches are build tested. A branch > can be found here: > > git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/i2c/atomic_xfer > > I am happy for reviews and comments. Please note if you review (especially the > core parts), I'd like to have a short summary of your review even if there is > no proposed change. Like what you did, what you think about it, etc. Some stuff > in here is subtle, so if you went through the effort to double check my > assumptions you should name it :) > Thank you! FWIW, Reviewed-by Andy Shevchenko for patches 1-5,12. Indeed, atomic condition sounds clear now. > > Finally, a big thank you and credit to Renesas for funding this work, of course! > > Happy hacking, > > Wolfram > > [1] https://lkml.org/lkml/2019/3/2/76 > [2] http://patchwork.ozlabs.org/patch/1067437/ > > Wolfram Sang (12): > i2c: remove use of in_atomic() > i2c: core: use I2C locking behaviour also for SMBUS > i2c: core: introduce callbacks for atomic transfers > i2c: mux: populate the new *_atomic callbacks > i2c: demux: handle the new atomic callbacks > i2c: omap: Add the master_xfer_irqless hook > i2c: tegra-bpmp: convert to use new atomic callbacks > i2c: ocores: refactor setup for polling > i2c: ocores: enable atomic xfers > i2c: stu300: use xfer_atomic callback to bail out early > i2c: algo: bit: add flag to whitelist atomic transfers > i2c: gpio: flag atomic capability if possible > > drivers/i2c/algos/i2c-algo-bit.c | 22 +++++++++- > drivers/i2c/busses/i2c-gpio.c | 2 + > drivers/i2c/busses/i2c-ocores.c | 16 +++----- > drivers/i2c/busses/i2c-omap.c | 76 +++++++++++++++++++++++++++++------ > drivers/i2c/busses/i2c-stu300.c | 25 +++++------- > drivers/i2c/busses/i2c-tegra-bpmp.c | 25 +++++++++--- > drivers/i2c/i2c-core-base.c | 17 ++++---- > drivers/i2c/i2c-core-smbus.c | 25 +++++++++--- > drivers/i2c/i2c-core.h | 25 ++++++++++++ > drivers/i2c/i2c-mux.c | 6 +++ > drivers/i2c/muxes/i2c-demux-pinctrl.c | 2 + > include/linux/i2c-algo-bit.h | 1 + > include/linux/i2c.h | 15 +++++-- > 13 files changed, 194 insertions(+), 63 deletions(-) > > -- > 2.11.0 > -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel