Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp24883imm; Fri, 31 Aug 2018 15:57:02 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbiNgz+7u0/CiftHrjJsbrzn++MEfHyppBsKRout4+r9JkulKVZ/t/WiJn7lnsW3uRDnre1 X-Received: by 2002:a17:902:c6b:: with SMTP id 98-v6mr17683807pls.233.1535756222650; Fri, 31 Aug 2018 15:57:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535756222; cv=none; d=google.com; s=arc-20160816; b=uHlh/L8x4FurJhdEZvC4Bx7ruWB6D31RdI7D8yZlGQ+pcgSOP1cC/KRs1Wfw9tzZ0H ytQDKsZ37Om7BlGyxNefDKGbySUzHOjfWznbckfe+Xp9X+4XydBjBunME7gZpViAjLm2 WIQEQzxmBhJhARJBM4uudZV542MLtuNUn02iFgKKnDbkCHX/FtSoPbquOA7RmNCOg4YJ VTJ3wknpP32Y5QfxaPwR/NHiamIhC8veinIB5SzfDGuFqq/1Y/bWb1V3LgFplMOpU6P/ 7zJzCyLkjq6L942OlE91TpLPhtrmo2o3DlUVYmHMmm64uCMq7YZwrjLeg9iVNZtWf26Y Sggg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=xZQjF2wUZU1Wu5F/h+ur4D4/urcXADQiqQlR+w8e6QA=; b=m/i+CP9BARvyspy/3ZIlLpBB8gq/S5cfIMO73ZFQZ7lIKtPvVjz5LtZI5b/j9h9fHx 8sehOYD8aL7BQw/5rXYTTlOfQ+abGSiLxxL+ztwBG9UADFc3PhjMkgTa/BCtAlPeItWe Je9Lh0cmsDAfZcRH+51I4I3QHT5Dyr+tXHNXCRIjlgcaapu6mHOsDQnDDS/tQIVjMk1B 4eTUQaS1n0GRtbwPdPRXWQv9fKmgT1iFa9a2KNyZ1CmkkDlk8p4wrP63OkNoyP1fqyzs 9w9L6e8BLQTldXOBlaNh4e/5jCUU7tk8yxi81nzAXV/aD8sCMoVL3Vodm/oETRG0qZ+8 fWSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Sdsw4efq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k6-v6si10297955plt.111.2018.08.31.15.56.48; Fri, 31 Aug 2018 15:57:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Sdsw4efq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727713AbeIADFE (ORCPT + 99 others); Fri, 31 Aug 2018 23:05:04 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:35601 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727560AbeIADFD (ORCPT ); Fri, 31 Aug 2018 23:05:03 -0400 Received: by mail-lf1-f68.google.com with SMTP id q13-v6so11159574lfc.2; Fri, 31 Aug 2018 15:55:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xZQjF2wUZU1Wu5F/h+ur4D4/urcXADQiqQlR+w8e6QA=; b=Sdsw4efq5usJ7S64Sh+zhugjlc9XLh5d2obJMr8HGYpByiCxWh8dN6Jow32PBFrucT 5PGulZe6gXrA5lLFyvJ2P949AY853CNfezS9P9i6vKf8ijjWv+dELdoUsGinua9G59JF s03wpkiP2OyiHfBxcPuIR8slvJsRH6p8wxK51Pl+XDR4svFuPn4J9mgDPhCltD2n3cp7 9ST2oNwuMmJ4mK2rsI7zKX9L5LrGszMLdOhNOmtv3zRu9fgOPwPhVt2bNka/qUpjMOwQ EYrdyOGpgOXQX1O7yKYEAfUzre5tH//rrDeY/UTg5FdEWkrPk/qEM7Uyo3Xcr8yK1JU+ sIMg== 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:in-reply-to :references; bh=xZQjF2wUZU1Wu5F/h+ur4D4/urcXADQiqQlR+w8e6QA=; b=hZO7hTFOGvRYCiwjOvGsOrSUWVGRKb1gOerqTFNYPutwmJS3yJoYV3YqGfKn5dGdSm nQVW8nWof3rNSfkfKfi4MR6I9wMrQrHB2cc4YvbhEy0YKh9pMKd+uBFewcsQEyn9JIxx PO9O+r0xbuQL0ssgxzT2lC8CnPRfJYhCxVg7gQn8sjNEpHyGWnuVflXMNfMVnxPzVI/r Vku+cNCjACzYBeTqZ5sT7/iI7opDFUAsrpFNeIK6CSRNxF0R+Z4Vf5MLsnOAn9nk4ZF0 KQ/YA9/shGzYOwwm31V/kZOWS6Dqfq1QSBr855sQn3fxXhUEk+H0lyYo9iVdNUbSEIbx ni/w== X-Gm-Message-State: APzg51AVEIN+Qw66Iwjhesb1G8RSl+Z0i/zpG0jaf3K+eIKsJom2bN9v xArsCEf4V8wX+DYGIJeUXmg= X-Received: by 2002:a19:f802:: with SMTP id a2-v6mr11328129lff.33.1535756121275; Fri, 31 Aug 2018 15:55:21 -0700 (PDT) Received: from localhost.localdomain (apn-37-248-212-140.dynamic.gprs.plus.pl. [37.248.212.140]) by smtp.gmail.com with ESMTPSA id v20-v6sm1969187ljc.94.2018.08.31.15.55.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Aug 2018 15:55:20 -0700 (PDT) From: Janusz Krzysztofik To: Linus Walleij Cc: Jonathan Corbet , Miguel Ojeda Sandonis , Peter Korsgaard , Peter Rosin , Ulf Hansson , Andrew Lunn , Florian Fainelli , "David S. Miller" , Dominik Brodowski , Greg Kroah-Hartman , Kishon Vijay Abraham I , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Hartmut Knaack , Peter Meerwald-Stadler , Jiri Slaby , Willy Tarreau , Geert Uytterhoeven , linux-doc@vger.kernel.org, linux-i2c@vger.kernel.org, linux-mmc@vger.kernel.org, netdev@vger.kernel.org, linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-serial@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Janusz Krzysztofik Subject: [PATH v6 0/4] gpiolib: speed up GPIO array processing Date: Sat, 1 Sep 2018 00:56:12 +0200 Message-Id: <20180831225616.29221-1-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180829204900.19390-1-jmkrzyszt@gmail.com> References: <20180829204900.19390-1-jmkrzyszt@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The goal is to boost performance of get/set array functions while processing GPIO arrays which represent pins of a signle chip in hardware order. If resulting performance is close to PIO, GPIO API can be used for data I/O without much loss of speed. Created and tested on a low end Amstrad Delta board with NAND driver updated to use GPIO API for data I/O. Performance degrade compared to PIO is much better than before the optimization but still not quite satisfactory. Janusz Krzysztofik (4): gpiolib: Pass bitmaps, not integer arrays, to get/set array gpiolib: Identify arrays matching GPIO hardware gpiolib: Pass array info to get/set array functions gpiolib: Implement fast processing path in get/set array Changelog: v6: [PATCH v6 1/4] gpiolib: Pass bitmaps, not integer arrays, to get/set - use DECLARE_BITMAP() macro for declaring value_bitmap - great idea by David Laight, thanks! drivers/auxdisplay/hd44780.c: - simplify the code and adjust comments as recommended by Geert Uytterhoeven - thanks!, drivers/i2c/muxes/i2c-mux-gpio.c: - drop .values member of struct gpiomux - details prvided by Peter Rosin, thanks!, drivers/mux/gpio.c: - drop .val member of struct mux_gpio - details prvided by Peter Rosin, thanks!, drivers/net/phy/mdio-mux-gpio.c: - drop .values member of struct mdio_mux_gpio_state and is processsing. v5: [PATCH v5 1/4] gpiolib: Pass bitmaps, not integer arrays, to get/set - drivers/i2c/muxes/i2c-mux-gpio.c: - drop assigment of values to struct gpiomux.values, as recommended by Peter Rosin - thanks!, - mark the .values member of the structure as obsolete, - drivers/mux/gpio.c: - drop assigment of values to struct mux_gpio.val, also recommended by Peter Rosin - thanks!, - merk the .val member of the structure as obsolete, - drivers/auxdisplay/hd44780.c: - fix incorrect bitmap size, - use >>= operator to simplify notation, both catched by Miguel Ojeda - thanks!, - add Cc: clauses as well as Acked-by: collected so far. [PATCH v5 2/4] gpiolib: Identify arrays matching GPIO hardware - add Cc: clause. [PATCH v5 3/4] gpiolib: Pass array info to get/set array functions - add Cc: clauses as well as Acked-by: collected so far. [PATCH v5 4/4] gpiolib: Implement fast processing path in get/set - add Cc: clause. v4: That series was a follow up of the former "mtd: rawnand: ams-delta: Use gpio-omap accessors for data I/O" which already contained some changes to gpiolib. Those previous attempts were commented by Borris Brezillon who suggested using GPIO API modified to accept bitmaps, and by Linus Walleij who suggested still more great ideas for further immprovement of the proposed API changes - thanks! diffstat: Documentation/driver-api/gpio/board.rst | 15 + Documentation/driver-api/gpio/consumer.rst | 48 +++- drivers/auxdisplay/hd44780.c | 74 +++---- drivers/bus/ts-nbus.c | 27 +- drivers/gpio/gpio-max3191x.c | 23 +- drivers/gpio/gpiolib.c | 279 ++++++++++++++++++++++------ drivers/gpio/gpiolib.h | 15 + drivers/i2c/muxes/i2c-mux-gpio.c | 16 - drivers/mmc/core/pwrseq_simple.c | 15 - drivers/mux/gpio.c | 18 - drivers/net/phy/mdio-mux-gpio.c | 13 - drivers/pcmcia/soc_common.c | 14 - drivers/phy/motorola/phy-mapphone-mdm6600.c | 21 +- drivers/staging/iio/adc/ad7606.c | 12 - drivers/tty/serial/serial_mctrl_gpio.c | 9 include/linux/gpio/consumer.h | 35 ++- 16 files changed, 417 insertions(+), 217 deletions(-)