Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2169369imm; Thu, 20 Sep 2018 08:47:27 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZu+xgQ7slzCan/Dk8MusDM7PE3xw3FoAq7OeBKNBFvVlj8yROnT3t7hajEktGz0mBa+y0o X-Received: by 2002:a62:398c:: with SMTP id u12-v6mr42511625pfj.9.1537458447745; Thu, 20 Sep 2018 08:47:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537458447; cv=none; d=google.com; s=arc-20160816; b=gDMoBsQNnm9SXdQF4n0hDTod0CVHMYorEyIlavUBcp62YIn0M7vsS1/QhVx8gOU8LM VYnkxEItKrnTbnKHISr+JAOMOUbRCtZ3XKl8nbb3/dhKxKGPEbgOEUVX5tcW4zSd0HRd aDEGkkuqwe2uMtxS8bH0qZr+hFvTpKjCVj3l6GyKAOeXJUVpK5pykBOyGbOOPtJX9PDY UaSA1zH0t/vqhDhi/NUq5DELVRCEqiB9sZbNPzo62ykV5kk+9r/RWvA9RPdaWiaSMqYu SA11ca6xRAjWPIWggdmEkrG94fivVQApqWfCuB7W90wSi0+Elocv6PbrwVOx7H9g8M1H bvFQ== 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=iZUKZkRjOSKC0gRH2KkEyLqg7z+f7HpBCBgWNOvY3kM=; b=RKfMBWw4JNTINXlFwNGY8+lmMqUPqo8wVXcXMkJpNPzMOW/+yXB4jRmgUbDjeG11dJ GMMqcg2s133BBif1uV9BBwVykLuY96hifk7zZ59erMqm9qoPuf0RpGZS2krgvaawXw/p x88D3zgK5SFz2iR06ryh5l1n0obil3MGjGwXfCHU3zZ4jyx5rhEX96i9XsqpEw8AUYD7 RflJ6uFg72YAEMA6zxbWnsEr3RVS30MImPX/X4SSGfr3QFEzeL8F5eu1zcMkpr71H+0T p4scj7oskx4XIBa2It31sqv3lRti7sQ9tTnjVP/RCyqdXhCXhLGde0Vzh24E+QY/AaPF 5T3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZKGdWD7t; 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 t7-v6si24203619pfh.3.2018.09.20.08.47.11; Thu, 20 Sep 2018 08:47:27 -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=ZKGdWD7t; 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 S2387424AbeITVbH (ORCPT + 99 others); Thu, 20 Sep 2018 17:31:07 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:41788 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731463AbeITVbH (ORCPT ); Thu, 20 Sep 2018 17:31:07 -0400 Received: by mail-lj1-f196.google.com with SMTP id y17-v6so8841988ljy.8; Thu, 20 Sep 2018 08:46:58 -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=iZUKZkRjOSKC0gRH2KkEyLqg7z+f7HpBCBgWNOvY3kM=; b=ZKGdWD7t+JWRrLxXOFwq6ekURLLV8uu1NInkzDbxEvY+jZ6B6caIPtCxaiD7bmng1s AjWpFiLSNeAuksmGwulKgbcP9R0aG1UUPnrEsZDuPeBmeQAfkoEh56xVD8LUaeprY11s ZINTt13pshooD4PuQA0bX1d5m3S+xq+LtTDHIbTcTEctNardu4AsKT0ygVoFBcWqBEdr K09Nb1w6BOUyLidzDYBUOECR/6kaUIrFejwv3bE8bnCcX/kCOAbN9wFhRi/zm7ZknfFc t4zisEVvNOw5Kvqg0pishytLkFGXxEq1/rzRUL3F/VLCTb6htbHezTDAC4420gP4p2Az DnDw== 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=iZUKZkRjOSKC0gRH2KkEyLqg7z+f7HpBCBgWNOvY3kM=; b=NUCx6amtc7l004LtTHI5uffcMAgb8Tu5+saYYb4njQDOcddOkjjg47Pe/Z99jvdS1x dCZayZeJCmGQI3VZd7QPkKGJ0h/gwLaWn5yiGfAbC6U1SvHl/frdRleQoZwgHsHtiPis 5dr5w76eKnvzi9H2y+51gYu8nlPs88xWtydZSdHufMxz2ZW3AT+iHMUbk4ycPXD7V+Ny szr10J4YCTfizsWHFjJRcqNASsH+73xANgmmUyaQug6cUQfvwv4PSqKs/ahBVP5yC/DQ lyyYjvZTRX63+Q0MbZz1XA2eU4mppUxG0tW+A9LsNCZD824hjkYtjIJcIvtdm7ecXp5u jFgw== X-Gm-Message-State: APzg51BsnaTlGb1k+i6x0EuDoxkoQzBFpd7H5PGxKt6dfh7Sw9XF666q Al/eVKbDvKvcvV368z1+itU= X-Received: by 2002:a2e:1290:: with SMTP id 16-v6mr27458053ljs.94.1537458418094; Thu, 20 Sep 2018 08:46:58 -0700 (PDT) Received: from z50.localnet (93-181-165-181.internetia.net.pl. [93.181.165.181]) by smtp.gmail.com with ESMTPSA id l141-v6sm1782706lfg.55.2018.09.20.08.46.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Sep 2018 08:46:57 -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 17:48:22 +0200 Message-ID: <9860023.SlBYqtbjDV@z50> In-Reply-To: <20180920101151eucas1p221f5a1715b8556bb9d99bf08fe09ce6f~WE-_cEf4l0754207542eucas1p27@eucas1p2.samsung.com> References: <20180831225616.29221-1-jmkrzyszt@gmail.com> <20180920101151eucas1p221f5a1715b8556bb9d99bf08fe09ce6f~WE-_cEf4l0754207542eucas1p27@eucas1p2.samsung.com> 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 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? Thanks, Janusz From d7ecd435bfb4972766b63ac383a43875700c7452 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..5bc3447949c9 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); + i = 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