Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2208806imm; Thu, 20 Sep 2018 09:21:16 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaoSvgnDmlCEa8XJnGysZ+VI3+uGGisESfkP2vXhZzlbRQk1mVND1qUKLjkuKly+bXRaDAr X-Received: by 2002:a63:c00b:: with SMTP id h11-v6mr37302812pgg.279.1537460476157; Thu, 20 Sep 2018 09:21:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537460476; cv=none; d=google.com; s=arc-20160816; b=wZS9gCOXMV1PwcKnsZsUsFpe8/EhEsfwbdgsX7TkPmhyS/iEWG972R80riPCAxjc9t IgmZtitLLrBsJpEMB7Wt7Ynf8qEqc6gx0ptCMNbAVItfu+zJmeIYOAAeFZ6m8LkquTVw gpvuYQnM7wFklm/ri+mXK9gC35sRCX+i4wNjp7zilanFYN4atZSB3NpNWip3sLsXM7Xw gnxXMVZ+97QON2WRgtdQnQpTJzQCX1GJZL9MQnWrHj4Sf6mPw44kHx2wNjl/cZkScKCm RRKr0/rd03oJ5R5yuv8fus/Tya6V7mxycqVPbq6PhXsazcfU0qHG5FGHhp8iC7btlStj 9Vgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+UPtWUl6Yh7NRq4oZEu4K6wGXZnx26UbRhox6oV/oH4=; b=kYEcJmL55yZie0rdLG4P+szYvfupeDXHBlBDDj6VmK+1l4jfZp1jlu55ppLouFPJzk uyjMO1lOIGNsTcN8dCVABkaKePFXUqnTDh+ICMIvBhJGiGtaAgQJCKrA0k8HRBs91G/y mW3IClKC9ZkrrElAKz5mt0KhFnJ52bHLGQMcpW1fpI1V03g//YC3b3I6T3Mjd3bGs2aN juCarOI4l6IW2eBP3w9YfGg8HiETdJljgQWSBcVLLGYrEQnYfdKdaBw6V9rel++G7P2W y1naBWzBK50rD/eYudBkFA4mxbXSNBL18vJK+Sr4Zwz5IKBZKG9zQ67Y/z+29qrFjHwV EijQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=T9nzEVcK; 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 a8-v6si25734466ple.189.2018.09.20.09.20.51; Thu, 20 Sep 2018 09:21:16 -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=T9nzEVcK; 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 S2387471AbeITWEC (ORCPT + 99 others); Thu, 20 Sep 2018 18:04:02 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:35408 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727813AbeITWEC (ORCPT ); Thu, 20 Sep 2018 18:04:02 -0400 Received: by mail-lj1-f194.google.com with SMTP id p10-v6so8960501ljg.2; Thu, 20 Sep 2018 09:19:44 -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 :mime-version:content-transfer-encoding; bh=+UPtWUl6Yh7NRq4oZEu4K6wGXZnx26UbRhox6oV/oH4=; b=T9nzEVcKHbkS0N9olmvbKlcapG6lPHsVNt13Hug5keW+LOAnopW9H2KQZEKvY+Yr2U m8cFBK4aZ/yJ4Ny1aGvQdWHNLckm3pSZs55Y15JQwqajfCBgb5wsOKZSzbN3BL9roYO9 8JC2tlOY7L4hoG8v49Ol+FoJxQ6Z5KY3McO8zZoE1TevEOjXRAfi7SBbHslXxYk+XkWV D0SM9N7FQmdV6pzLQPhQmKSfCRhn3QMsUqx98UMaimu6/k8GqqFC0Y/FcQ+Ua/nGBNoe K60aiNa+cpTzYm0PSPi/xja5b7TnNYkXqQGy/DMF1o9YRHDJzT5kd4gSjriSnQXTK0mL fiwg== 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:mime-version:content-transfer-encoding; bh=+UPtWUl6Yh7NRq4oZEu4K6wGXZnx26UbRhox6oV/oH4=; b=lpc/4zc8LnK1MlX/9AaD9UhoXks2S7s4/5tHJzMzXGawJsdDyrXhE0XMs8qCgaXK2W ff+AJeFqmEDUDWReEjOBhT/0NuUafKoj3/op5S5Yv3LlqpZXzE+EzdrWlUzHv6DM/saY PU7oVlpXsqRBFMvuS10SiDmITDJiIoo+jmmzWuoB0VY6W2GM3Ht7JfJBFNHzq/oAXieM QYGT+S3OJ0ZWna/KVBtBgsEPFqROJrcKsenD9MZHkwvqI1R1sAnNyu8Rp6woVpuleHDU Koyg5buxTauPHXZu4K2O8I8svn4P43hgQPnoQAhlgfIhfYteTzjREzDSTYJAqDzCcgJh G5GQ== X-Gm-Message-State: ABuFfojPlCCV4M0FpIPegBQUjZIEAt8xY9JDd80NGd86kPM7CivkiVRU rVruFMG7kwtdmGid2rdpiSs= X-Received: by 2002:a2e:b007:: with SMTP id y7-v6mr2609415ljk.22.1537460384110; Thu, 20 Sep 2018 09:19:44 -0700 (PDT) Received: from z50.localnet (93-181-165-181.internetia.net.pl. [93.181.165.181]) by smtp.gmail.com with ESMTPSA id b80-v6sm1810441lfe.83.2018.09.20.09.19.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Sep 2018 09:19:43 -0700 (PDT) From: Janusz Krzysztofik To: Marek Szyprowski Cc: Linus Walleij , 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, Sebastien Bourdelin , Lukas Wunner , Rojhalat Ibrahim , Russell King , Tony Lindgren , Yegor Yefremov , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , "'Linux Samsung SOC'" , Krzysztof Kozlowski , Janusz Krzysztofik Subject: Re: [PATCH v7 4/4] gpiolib: Implement fast processing path in get/set array Date: Thu, 20 Sep 2018 18:21:09 +0200 Message-ID: <15226900.TQMLYV7PZ0@z50> In-Reply-To: <9860023.SlBYqtbjDV@z50> References: <20180831225616.29221-1-jmkrzyszt@gmail.com> <20180920101151eucas1p221f5a1715b8556bb9d99bf08fe09ce6f~WE-_cEf4l0754207542eucas1p27@eucas1p2.samsung.com> <9860023.SlBYqtbjDV@z50> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday, September 20, 2018 5:48:22 PM CEST Janusz Krzysztofik wrote: > On Thursday, September 20, 2018 12:11:48 PM CEST Marek Szyprowski wrote: > > Hi All, > > > > On 2018-09-02 14:01, Janusz Krzysztofik wrote: > > > Certain GPIO descriptor arrays returned by gpio_get_array() may contain > > > information on direct mapping of array members to pins of a single GPIO > > > chip in hardware order. In such cases, bitmaps of values can be passed > > > directly from/to the chip's .get/set_multiple() callbacks without > > > wasting time on iterations. > > > > > > Add respective code to gpiod_get/set_array_bitmap_complex() functions. > > > Pins not applicable for fast path are processed as before, skipping > > > over the 'fast' ones. > > > > > > Cc: Jonathan Corbet > > > Signed-off-by: Janusz Krzysztofik > > > > I've just noticed that this patch landed in today's linux-next. Sadly it > > breaks booting of Exynos5250-based Samsung Snow Chromebook (ARM 32bit, > > device-tree source arch/arm/boot/dts/exynos5250-snow.dts). > > > > Booting hangs after detecting MMC cards. Reverting this patch fixes the > > boot. I will try later to add some debugs and investigate it further what > > really happens when booting hangs. > > Hi Marek, > > Thanks for reporting. Could you please try the following fix? Hi again, I realized the patch was not correct, j, not i, should be updated in second hunk. Please try the following one. Thanks, Janusz From a919c504850f6cb40e8e81267a3a37537f7c4fd4 Mon Sep 17 00:00:00 2001 From: Janusz Krzysztofik Date: Thu, 20 Sep 2018 17:37:21 +0200 Subject: [PATCH] gpiolib: Fix bitmap index not updated While skipping fast path bits, bitmap index is not updated with next found zero bit position. Fix it. Signed-off-by: Janusz Krzysztofik --- drivers/gpio/gpiolib.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index a53d17745d21..369bdd358fcc 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -2880,7 +2880,7 @@ int gpiod_get_array_value_complex(bool raw, bool can_sleep, __set_bit(hwgpio, mask); if (array_info) - find_next_zero_bit(array_info->get_mask, + i = find_next_zero_bit(array_info->get_mask, array_size, i); else i++; @@ -2905,7 +2905,8 @@ int gpiod_get_array_value_complex(bool raw, bool can_sleep, trace_gpio_value(desc_to_gpio(desc), 1, value); if (array_info) - find_next_zero_bit(array_info->get_mask, i, j); + j = find_next_zero_bit(array_info->get_mask, i, + j); else j++; } @@ -3192,7 +3193,7 @@ int gpiod_set_array_value_complex(bool raw, bool can_sleep, } if (array_info) - find_next_zero_bit(array_info->set_mask, + i = find_next_zero_bit(array_info->set_mask, array_size, i); else i++; -- 2.16.4