Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2447686imm; Mon, 24 Sep 2018 04:40:21 -0700 (PDT) X-Google-Smtp-Source: ACcGV63IHz9bp0+dAXELr5x4jtVlzKloOTCdl1vuN59ToNLD3znyB//3on0kUACqk2t1gtGswDT6 X-Received: by 2002:a63:c114:: with SMTP id w20-v6mr8889600pgf.234.1537789221863; Mon, 24 Sep 2018 04:40:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537789221; cv=none; d=google.com; s=arc-20160816; b=n2CcNhBtzKsszNyq16E2XQutas3x+7dSKoRzMzl575/oSO9Kle8sv/vm6NF1H2/q3b mMr74JSu3cj/+mdfiun7r4B7XaHWREWUQRO4KYE41AE6+gGGUca01IQEoijZ50vjLUFN +gFdzNf/5INP6xspwvXtum2D2NQ1Ng96mEOHKdsXFkKZ7pEFJ+vosDHyLXF5i8734CjK tkeZyz4iIW/Q7IQfrIB9vPyJRF5lN64A+SdLNlT7j0HFwT1+l+kfPNRL637QIdyrhlyu lrX3rSKBg2vnfI30vADpLJs1O1yYvyF0H6CLtawVqX3mpOyS3EPhstikKfyklc91BnkY HvAg== 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=otrGG1Yb+cMvuXNARd4n1SIpqJgyUU3FRQ50b11u2Vc=; b=p6R6buqHl2vwp0aWEhbTdbftQiW8wvoNL51R5apFNkmUkA7RREg2AuUQwCFaQY2952 WRHuasktvGuGlCEyX0K9PRpdvmSjBVtcb7nSRxNII+gL+xXMUbpg1VXQnF5ZAjFgVILT /4beGPnIVEXissbRoj7637cqP2VtPSxRgqCPO1Bnwx6oudo0uhg4T2fFQmhowE1K/+WI V+Do4O/pvAL5x9eGqCtUPnc3NpAMyvZqXFNUZdDadCNhbQQgWmqBe/zDt23gd0QsIav/ /MpbvDXcFdqG1JNNsmZroRu7pTq3XCbSdSw1HXde0gsoYzMOtuL3tb3TcwLfBTIfcZAz OK0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=oo5JtESV; 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 d4-v6si37337891pfc.219.2018.09.24.04.40.06; Mon, 24 Sep 2018 04:40:21 -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=oo5JtESV; 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 S1729206AbeIXRkp (ORCPT + 99 others); Mon, 24 Sep 2018 13:40:45 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:40535 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726269AbeIXRkn (ORCPT ); Mon, 24 Sep 2018 13:40:43 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180924113901euoutp01a33620a7ef39e597ab53a8a8eae6f36b~XUxOkHOkv1855318553euoutp01m; Mon, 24 Sep 2018 11:39:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180924113901euoutp01a33620a7ef39e597ab53a8a8eae6f36b~XUxOkHOkv1855318553euoutp01m DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1537789141; bh=otrGG1Yb+cMvuXNARd4n1SIpqJgyUU3FRQ50b11u2Vc=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=oo5JtESVLlA1oGTztu//fjt2FatnJRJHhZWGh1VxNIjS6Ax6Uil8nlAjDOcw2w6Rw WQcurTrHtTYJsJapl7eMcwSDfHOQNEVF4sdYcB3AMg8ppChgOmqp/3Jc0kselmFHIl UI68RsUaHiDMY5dU6X8Hq3qzvZst0lDwiBi3fFeA= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180924113901eucas1p14d79380b2152fa59250925d9a62892cd~XUxOGP-Fn3141231412eucas1p1Z; Mon, 24 Sep 2018 11:39:01 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 53.CC.04806.4DCC8AB5; Mon, 24 Sep 2018 12:39:00 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20180924113859eucas1p160322f5844c771bc9c680d35de4877a3~XUxM0smXV0334103341eucas1p1s; Mon, 24 Sep 2018 11:38:59 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20180924113859eusmtrp200e35534f75dbbab7ffa284d076246f5~XUxMgMtDJ0893608936eusmtrp2N; Mon, 24 Sep 2018 11:38:59 +0000 (GMT) X-AuditID: cbfec7f5-367ff700000012c6-b3-5ba8ccd47c7c Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 72.C1.04128.3DCC8AB5; Mon, 24 Sep 2018 12:38:59 +0100 (BST) Received: from [106.116.147.30] (unknown [106.116.147.30]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20180924113857eusmtip14349e9b8ccff189b9f6353135e0ef6fb~XUxLJLmWa2124321243eusmtip17; Mon, 24 Sep 2018 11:38:57 +0000 (GMT) Subject: Re: [PATCH 0/2] gpiolib: Fix issues introduced by fast bitmap processing path 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 , Sebastien Bourdelin , Lukas Wunner , Rojhalat Ibrahim , Russell King , Tony Lindgren , Yegor Yefremov , =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= , 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, Krzysztof Kozlowski , Linux Samsung SOC From: Marek Szyprowski Date: Mon, 24 Sep 2018 13:38:57 +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: Content-Transfer-Encoding: 7bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA01TbUxTVxjeuff0nltYybXoOJFlJk22qXM4s2V5F9RIMre77Y/LfmyRxa3a OzADJK3g3I/FiANWcYCQAXfVQiRWqs5KsZMKrRRCGR8rIDg+CsOkOAfiwA+ilY9Zrm78e97n fZ/3eZ+THJ7VhrnV/N6M/ZIxQ5+m46Kwq/VR4PW+zjPJb3jKEyAw4mMhdDUPgSVwBENDZ5hA +E4LgZtDjQzknLrA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WrPQ9/30XfSxLT22JPzptYtnlcTomJ KuVXpE5U/QfICFIXoAMAAA== Message-Id: <20180924113859eucas1p160322f5844c771bc9c680d35de4877a3~XUxM0smXV0334103341eucas1p1s@eucas1p1.samsung.com> X-CMS-MailID: 20180924113859eucas1p160322f5844c771bc9c680d35de4877a3 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20180923235237epcas3p3aa946da71a07da1bc3cd0e8cce3473b2 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180923235237epcas3p3aa946da71a07da1bc3cd0e8cce3473b2 References: <2785169.v6aIfS3K2k@z50> <20180923235336.22148-1-jmkrzyszt@gmail.com> <20180924094339eucas1p282f2f7cb627c183fe87da044edb90fa5~XTMgQ4GFs1339913399eucas1p2N@eucas1p2.samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Janusz, On 2018-09-24 13:08, Janusz Krzysztofik wrote: > 2018-09-24 11:43 GMT+02:00, Marek Szyprowski : >> On 2018-09-24 01:53, Janusz Krzysztofik wrote: >>> While investigating possible reasons of GPIO fast bitmap processing >>> related boot hang on Samsung Snow Chromebook, reported by Marek >>> Szyprowski (thanks!), I've discovered one coding bug, addressed by >>> PATCH 1/2 of this series, and one potential regression introduced at >>> design level of the solution, hopefully fixed by PATCH 2/2. See >>> commit messages for details. >>> >>> Janusz Krzysztofik (2): >>> gpiolib: Fix missing updates of bitmap index >>> gpiolib: Fix array members of same chip processed separately >>> >>> The fixes should resolve the boot hang observed by Marek, however the >>> second change excludes that particular case from fast bitmap processing >>> and restores the old behaviour. >> I confirm, that the above 2 patches fixes boot issue on Samsung Snow >> Chromebook with next-20180920. >> >> Tested-by: Marek Szyprowski >> >>> Hence, it is possible still another >>> issue which have had an influence on that boot hang exists in the code. >>> In order to fully verify the fix, it would have to be tested on a >>> platform where an array of GPIO descriptors is used which starts from >>> at least two consecutive pins of one GPIO chip in hardware order, >>> starting ftom 0, followed by one or more pins belonging to other >>> chip(s). >>> >>> In order to verify if separate calls to .set() chip callback for each >>> pin instead of one call to .set_multiple() is actually the reason of >>> boot hang on Samsung Snow Chromebook, the affected driver - >>> drivers/mmc/core/pwrseq_simple.c - would have to be temporarily >>> modified for testing purposes so it calls gpiod_set_value() for each >>> pin instead of gpiod_set_array_value() for all of them. If that would >>> also result in boot hang, we could be sure the issue was really the >>> one addressed by the second fix. Marek, could you please try to >>> perform such test? >> Yes, I've just tested next-20180920 only with the first patch from this >> patchset and the mentioned change to drivers/mmc/core/pwrseq_simple.c. >> It boots fine, so indeed the issue is in handling of arrays of gpios. >> >> Just to be sure I did it right, this is my change to the mentioned file: > Yeah, that's what I had on mind. However, I'd be more lucky if it didn't work > for you. Setting the pins sequentially, not simultaneously as before, was > exactly what I hoped was the reason of the hang. > >> diff --git a/drivers/mmc/core/pwrseq_simple.c >> b/drivers/mmc/core/pwrseq_simple.c >> index 7f882a2bb872..9397dc1f2e38 100644 >> --- a/drivers/mmc/core/pwrseq_simple.c >> +++ b/drivers/mmc/core/pwrseq_simple.c >> @@ -38,16 +38,11 @@ static void mmc_pwrseq_simple_set_gpios_value(struct >> mmc_pwrseq_simple *pwrseq, >> int value) >> { >> struct gpio_descs *reset_gpios = pwrseq->reset_gpios; >> + int i; >> >> - if (!IS_ERR(reset_gpios)) { >> - DECLARE_BITMAP(values, BITS_PER_TYPE(value)); >> - int nvalues = reset_gpios->ndescs; >> - >> - values[0] = value; >> - >> - gpiod_set_array_value_cansleep(nvalues, reset_gpios->desc, >> - reset_gpios->info, values); >> - } >> + if (!IS_ERR(reset_gpios)) >> + for (i = 0; i < reset_gpios->ndescs; i++) > The only difference from the behaviour when the hang was occurring is now > the order the pins are manipulated. Maybe that matters? > Could you please retry the same with the order of pins reversed, either in > the .dts file or here inside this for loop? I've switched the order of pins in dts and next-20180920 + first patch + above change also boots fine. Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland