Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp364557imm; Fri, 21 Sep 2018 01:20:00 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYyF3InZ67ftW7SfJ8Hv5ZRl+oi33lDehJgChIZz+8c3ntYUgT/jTPygYaxjPLKqpuc8Ylr X-Received: by 2002:a17:902:9045:: with SMTP id w5-v6mr43622907plz.10.1537518000293; Fri, 21 Sep 2018 01:20:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537518000; cv=none; d=google.com; s=arc-20160816; b=Nh5+atwFjNiXQ2FYUKzmjVq2w7cmeL/Lf3f18BnKfqJNAwXfjJVEtafj0A9FS10Tsm p6mJBDf9UQc7/aSoNAfKeUGXSa+XyCGJxXz2o9R6soUUiP51aka/3LXbJ6zLe3TifthV 7g+8nDpH07mrA8ZP4shNDWguqn3y7eKUa4Azh4seioidbFMbpYfwfFGFDUBqQcOMyfsD tyxA8C/EQckeY7a60MQ/q2tU743X9NSZawxm+l0HtUGyixXLs5eiVPBWHQ9YWs2ZmGiF uG8EqgL6DMVBKWXQTpyacCBEWAdTPSlwOTjskTlpb6wCrXeON6hElXBFF1duvarJl8TP 9IGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:message-id :content-language:content-transfer-encoding:in-reply-to:mime-version :user-agent:date:from:cc:to:subject:dkim-signature:dkim-filter; bh=hGFqaZUCupr+lrJzPVvoMy4VazWZX2OR+dcZpgrV2EY=; b=EMAyN5Nq5Tf2p1F3fveV1lboV9VS3Ump54gG5aP16HPNyIGbHdM474MLhgSm1LU/vJ EgJaW0KOIe8Fjo6zyWsoOWzm1Vbf915eTCgltumXrkCBkh18U1OHSm3Tq+BmHSUbzJi5 LlmNJiHSdMBh2CeOQYp5nS+2S73MMd3qyRLuqQdbYjzwNRX2YalKL/Biqiyyb1R/Q5cd ANt6THVOY6CTOMeJ5MdQISYcBTcMmzbYFZsanNt2MqBfJQVHgi5tcU3Nmj4AxdiYmasv nAldVBJvGZz4BmJ/MefD+2ld855WE83F9IELmts25yPBQyy3GW7rPCHnIx8lWHshNFr6 sfug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=sH+74FMZ; 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=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5-v6si976101pgk.395.2018.09.21.01.19.44; Fri, 21 Sep 2018 01:20:00 -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=@samsung.com header.s=mail20170921 header.b=sH+74FMZ; 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=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389439AbeIUOF5 (ORCPT + 99 others); Fri, 21 Sep 2018 10:05:57 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:55196 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388909AbeIUOF4 (ORCPT ); Fri, 21 Sep 2018 10:05:56 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180921081808euoutp01e325329236ec06f1e0b5967a4b768078~WXF_ANv860207202072euoutp01_; Fri, 21 Sep 2018 08:18:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180921081808euoutp01e325329236ec06f1e0b5967a4b768078~WXF_ANv860207202072euoutp01_ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1537517888; bh=hGFqaZUCupr+lrJzPVvoMy4VazWZX2OR+dcZpgrV2EY=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=sH+74FMZ3nvZyiUUvL0YwU+qaXRS72tKmeCisxSq4EG6QErFEVblgjnm0YUXsXL4I WJ4tLxrXa2/+89zu6Lgk1TDwy9+DWszAwYOpqMIKpTC4hNR9wYgwz0BTA3uCvl6012 Nb2lEyySWvtkkFFd5iRzjo7Rp2qkCPw0oGK/kNWE= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180921081807eucas1p111ace4ada25239982711eb0b991f9cb3~WXF9ev1Pv0749907499eucas1p1h; Fri, 21 Sep 2018 08:18:07 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id A9.1C.04294.F39A4AB5; Fri, 21 Sep 2018 09:18:07 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20180921081806eucas1p182d4646e8510b5f0356214af7edba11e~WXF8Ptw4M0970709707eucas1p1p; Fri, 21 Sep 2018 08:18:06 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20180921081805eusmtrp1319111806d37e3e25b5e5b0b7300dbed~WXF778yFG2128521285eusmtrp1R; Fri, 21 Sep 2018 08:18:05 +0000 (GMT) X-AuditID: cbfec7f4-84fff700000010c6-cc-5ba4a93f4121 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 1F.C6.04128.D39A4AB5; Fri, 21 Sep 2018 09:18:05 +0100 (BST) Received: from [106.116.147.30] (unknown [106.116.147.30]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20180921081804eusmtip24004dc82555db6de203bf7cc7c3b21e8~WXF6hDJuJ1973419734eusmtip2x; Fri, 21 Sep 2018 08:18:04 +0000 (GMT) Subject: Re: [PATCH v7 4/4] gpiolib: Implement fast processing path in get/set array To: Janusz Krzysztofik 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-K=c3=b6nig?= , 'Linux Samsung SOC' , Krzysztof Kozlowski From: Marek Szyprowski Date: Fri, 21 Sep 2018 10:18:03 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <15226900.TQMLYV7PZ0@z50> Content-Transfer-Encoding: 7bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA01Tb0xTVxzN7Xt971FW8iwOrnRB020uuqGwLNtvcXEz2Ye3PyZmW1gcc/o2 3tCNgnkVBtsXN1GwwYGUWHxWy9KaaiPaqau1tsBa0roULUJxyobZlrZsKMomkgl1jPJw49s5 555z7zkfLkNopqg8ZlvFDkGs4Mt1lIp0h+5fLnj5uL2kMNTGQHQ4QEC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nVHZmhJx8rTTwYvPpB1kvTpPE13froBUX66OtrocsxYx5Tc33mq+JVdcZbnxkW744dr9r2 ZsJ6vcgoOQbpedqsGP4Dr4dwiKIDAAA= Message-Id: <20180921081806eucas1p182d4646e8510b5f0356214af7edba11e~WXF8Ptw4M0970709707eucas1p1p@eucas1p1.samsung.com> X-CMS-MailID: 20180921081806eucas1p182d4646e8510b5f0356214af7edba11e X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20180920161947epcas3p491e6c136fe05d9672c81b7b4b8328f64 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180920161947epcas3p491e6c136fe05d9672c81b7b4b8328f64 References: <20180831225616.29221-1-jmkrzyszt@gmail.com> <20180920101151eucas1p221f5a1715b8556bb9d99bf08fe09ce6f~WE-_cEf4l0754207542eucas1p27@eucas1p2.samsung.com> <9860023.SlBYqtbjDV@z50> <15226900.TQMLYV7PZ0@z50> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Janusz, On 2018-09-20 18:21, Janusz Krzysztofik wrote: > 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: >>> 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 This one also doesn't help. A quick compare of logs with this version and a working system shows, that with your patch (and fix) there are no calls to gpx0-2 pin (which are a part of mmc pwrseq), what causes mmc failure. If you need any more information (what kind of logs will help?), let me know. > --- > 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++; Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland