Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4036031imm; Mon, 6 Aug 2018 15:32:18 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcSG48ad53wBqdAZnHCtfAyLEkoN9M75gBtx1U1gPtoaHwgQhTJo1hrZ+xNNWDv0ik9cMOH X-Received: by 2002:a62:c0a:: with SMTP id u10-v6mr18914006pfi.43.1533594738321; Mon, 06 Aug 2018 15:32:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533594738; cv=none; d=google.com; s=arc-20160816; b=XSCpPLhHu+yJUu9ml5R6YxbdFW+/lSX/v3jcSeIAHS6pWJhAyG2GBW2egyA8Ppa6Lc vtzCy9KMIhKEEX125ni5G1x45kfI9FSvSMIloMdiP0IojUIcb4aDhlG0/sN0woK7aCW7 WQn3k3JRSkVWxUReXcpmHcIGL5LwCGWpBOKsXX2Kks8DRiMGmKxO9XdBTHoy1wmjKh0B lBSW7v9sXdi/S0apME9fOvMuUupaUMyi7XJaUidcdgeSlfC3PDCY9uSEW829cuR6z43Z Mjrxg/zXSvbGGeaxOgaTi0sNWcYIJwRdqGUfVa84QdPmmkhWat9o6uvC+1zQr3wdeiiK dNwA== 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=FDaMkIad0o9QzNTv2EARYdjQpGULA5HnpcmySlWm3i8=; b=OCYnGEZK0sjEumkOe242s8x/7baUWEs2t5DYdJKn2SHnPxQ9AHFXATj/gnP4jeb8Wb L/Y6V2Z20cmX36h5BULeTAZNE7xWbzbYCZ7+BbKlSPLKHwTNIk69xIIFb6vCMiDVeHLy CF4Rhhy8IxQHcWMCT1ymWbUSV4Rhz6kTG1YJMujQ4PFrz+2hf2eXsxtc3FOJqcy7NRr9 XUQoKmuYAmqKQ1QHtsHuHpoPzLfejKDl+gch3K3r78InD3NzAjhWOj35AoZ2yYtbjA7+ JgNWpSfM0EXPwUE4J1LsYXqGkcaE960bynSohj8MWkjccZDpE4XWg5W1iKfdxEVfyz1t /61Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=O2N6qSTD; 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 t67-v6si13633558pfd.364.2018.08.06.15.32.03; Mon, 06 Aug 2018 15:32:18 -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=O2N6qSTD; 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 S2388154AbeHGAlL (ORCPT + 99 others); Mon, 6 Aug 2018 20:41:11 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:35199 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387814AbeHGAk4 (ORCPT ); Mon, 6 Aug 2018 20:40:56 -0400 Received: by mail-lf1-f68.google.com with SMTP id f18-v6so10225814lfc.2; Mon, 06 Aug 2018 15:29:43 -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=FDaMkIad0o9QzNTv2EARYdjQpGULA5HnpcmySlWm3i8=; b=O2N6qSTD6wcYUO5uf/sAtdsjHk+jMRgROxM64BeLFfqEax+Sd2rSsUJXBLoACFBcfU vpNekW03thHx+TO+4dBbmDjf2ARNzjZJ8OwQ2JmymgK+1PhoIzxi4XFh9k23tXNkeVvg R/uUcHgx02mbIEzP04Oerc0v2PIDWffK6wANRL7q1ngph2ViEoL9LEDoA7W496FeGGWy fDEOFe7qBJJOAxK5zUlkF+1u2agqRzLDQjvJ1yRepsL8yKJFWV99oaF+DF47sTpWYxgX BhOrFttIAwOnfZYjZuWzM/h2xNhw20WJknDy/Yd3cYox7qeKVDQ+D6qNwpfoF+0FY7d4 Dgug== 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=FDaMkIad0o9QzNTv2EARYdjQpGULA5HnpcmySlWm3i8=; b=XCqM7J3M8OFMENwt9BO2WoX1MyR0fXST2ovOBJ16Bx/PwoJsOZTdMgRz0TywB0PuVm fYB8L3mkq+TVh6ui+Cq4hb9krNoHGvAs/CVgxd2ueoYRBZxQmTGX+PcbQ+R0LHgu3dbV Xk3FtuUt3TsewjfGxHeXnQDZocMOS0y34pLZWCWHFSytMKpjkDPCDCEL74ydPR2xUOnA QjIGMny081zM79t8Tydcvr3DXdTmunEZSTwNoh/kmc8q/uOnt1DRY6pB2U6JO9AJE7yV bbLH7Z/dqGzIoI0Q1SsYhveJG5GSvYyoHlSwuh91RpU2PPJQodawc1VqFjJ6Ttu5vtSY jweQ== X-Gm-Message-State: AOUpUlGGSRtgx2XtVq6kI/o/0EhEmz2hQgu324HV1nGMCIakn5l+Rwo+ oUqe+VJEwM1dtMQyEUxpKvU= X-Received: by 2002:a19:b24e:: with SMTP id b75-v6mr11741465lff.11.1533594583186; Mon, 06 Aug 2018 15:29:43 -0700 (PDT) Received: from z50.lan (93-181-165-181.internetia.net.pl. [93.181.165.181]) by smtp.gmail.com with ESMTPSA id o4-v6sm2438561ljc.67.2018.08.06.15.29.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Aug 2018 15:29:42 -0700 (PDT) From: Janusz Krzysztofik To: Boris Brezillon , Linus Walleij Cc: Jonathan Corbet , Miquel Raynal , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , Tony Lindgren , Aaro Koskinen , linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-mtd@lists.infradead.org, linux-doc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Janusz Krzysztofik Subject: [RFC PATCH v2 11/12] mtd: rawnand: ams-delta: Use GPIO API bitmap extension Date: Tue, 7 Aug 2018 00:29:17 +0200 Message-Id: <20180806222918.12644-12-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180806222918.12644-1-jmkrzyszt@gmail.com> References: <20180718235710.18242-1-jmkrzyszt@gmail.com> <20180806222918.12644-1-jmkrzyszt@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Try to address the driver performance issues by replacing traditional get/set array function calls with their bitmap based equivalents. As long as fast bitmap processing path is not implemented in the new API extension, performance of the driver remains unchanged. Signed-off-by: Janusz Krzysztofik --- drivers/mtd/nand/raw/ams-delta.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/mtd/nand/raw/ams-delta.c b/drivers/mtd/nand/raw/ams-delta.c index 30c461138195..7b08b2c441d3 100644 --- a/drivers/mtd/nand/raw/ams-delta.c +++ b/drivers/mtd/nand/raw/ams-delta.c @@ -78,15 +78,9 @@ static void ams_delta_write_commit(struct ams_delta_nand *priv) static void ams_delta_write_next_byte(struct ams_delta_nand *priv, u_char byte) { - struct gpio_descs *data_gpiods = priv->data_gpiods; unsigned long bits = byte; - int i, value_array[data_gpiods->ndescs]; - - for (i = 0; i < data_gpiods->ndescs; i++) - value_array[i] = test_bit(i, &bits); - gpiod_set_raw_array_value(data_gpiods->ndescs, data_gpiods->desc, - value_array); + gpiod_set_raw_array_bitmap(priv->data_gpiods, &bits); ams_delta_write_commit(priv); } @@ -106,22 +100,15 @@ static void ams_delta_write_first_byte(struct ams_delta_nand *priv, u_char byte) static u_char ams_delta_read_next_byte(struct ams_delta_nand *priv) { - struct gpio_descs *data_gpiods = priv->data_gpiods; - unsigned long bits = 0; - int i, value_array[data_gpiods->ndescs]; + unsigned long bits; gpiod_set_value(priv->gpiod_nre, 0); ndelay(40); - gpiod_get_raw_array_value(data_gpiods->ndescs, data_gpiods->desc, - value_array); + gpiod_get_raw_array_bitmap(priv->data_gpiods, &bits); gpiod_set_value(priv->gpiod_nre, 1); - for (i = 0; i < data_gpiods->ndescs; i++) - if (value_array[i]) - __set_bit(i, &bits); - return bits; } -- 2.16.4