From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_MUA_MOZILLA,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8DE0ECE566 for ; Fri, 21 Sep 2018 14:14:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 45BB321550 for ; Fri, 21 Sep 2018 14:14:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="i2DalOc+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 45BB321550 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390142AbeIUUDT (ORCPT ); Fri, 21 Sep 2018 16:03:19 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:35088 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728184AbeIUUDS (ORCPT ); Fri, 21 Sep 2018 16:03:18 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180921141411euoutp01cb700cfde6a17a601cc9b2a095132c7b~Wb813tBWC2628326283euoutp01D; Fri, 21 Sep 2018 14:14:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180921141411euoutp01cb700cfde6a17a601cc9b2a095132c7b~Wb813tBWC2628326283euoutp01D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1537539251; bh=GvZp8nuwtVijAteiyulp3SKkdYv/J3IP6UHkupIZ8zw=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=i2DalOc+j6CF330X1r9ALCIMkmQt8sQPw0pB6yWihTASwMYiHUjGampiBZFGbHElW TAM9Be7iFoSK31YbQxwzFPpJJQJvaEP+yOuZMPZKDGx8HDMnxJ+rv51lUw4hFWVeHr VJhyWt1sXcK9rAmmkLusFNjdsRNnPkoPDU54nJI4= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180921141410eucas1p2eb424aca42ebf40adc7036e4abfbb8f8~Wb81NiUQC1306913069eucas1p2n; Fri, 21 Sep 2018 14:14:10 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id CC.09.04806.1BCF4AB5; Fri, 21 Sep 2018 15:14:10 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20180921141409eucas1p190a47e2608429870d23516ee5e75c191~Wb8z_FmwI1466414664eucas1p1F; Fri, 21 Sep 2018 14:14:09 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20180921141408eusmtrp106086b6e12679e25a8cd67dad7409ad4~Wb8zqCUM42831428314eusmtrp1v; Fri, 21 Sep 2018 14:14:08 +0000 (GMT) X-AuditID: cbfec7f5-34dff700000012c6-e7-5ba4fcb1bd26 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id E5.A5.04128.0BCF4AB5; Fri, 21 Sep 2018 15:14:08 +0100 (BST) Received: from [106.116.147.30] (unknown [106.116.147.30]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20180921141407eusmtip14b73cfb4f9da548f0fb7325da2c9b933~Wb8ySCiPr1685416854eusmtip1S; Fri, 21 Sep 2018 14:14:07 +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 16:14:06 +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: 8bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA01TbWxTZRT2vfftvXfDzrsC7pWpM41iXGBIZvRE1ECiyfWLwA/BOBSucB3I VpZ2H4KSoIN9lJF1FN24FDqzLoMqgts6Rm27rVtWl6Ht2IdQHUHTOgUKnXZNoMO57gbdv+c8 z3nOec6Pw9Ga28wSboeuWNLrxAItk4o7+m//uLx12pb3dPXb4B/30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6hJU/aA4vxYQlIf8rh/bA bXt8tONYvMf3a3exter1+7zRhCLH2rdG+9hf9a3fHk087nJG9iU0PAssfVV+5suONVsUlKhR c2tJvaj+HxIjJ8WjAwAA Message-Id: <20180921141409eucas1p190a47e2608429870d23516ee5e75c191~Wb8z_FmwI1466414664eucas1p1F@eucas1p1.samsung.com> X-CMS-MailID: 20180921141409eucas1p190a47e2608429870d23516ee5e75c191 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> <20180921081806eucas1p182d4646e8510b5f0356214af7edba11e~WXF8Ptw4M0970709707eucas1p1p@eucas1p1.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-21 12:51, Janusz Krzysztofik wrote: > 2018-09-21 10:18 GMT+02:00, Marek Szyprowski : >> 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. > There is a debug message on array_info content available at the end of > gpiod_get_array(), could you please activate it and post the message so > we can understand better what is going on? With debug enabled on next-20180919: [    2.499153] pwrseq_simple mmc3_pwrseq: GPIO array info: chip=gpx0, size=2, get_mask=2, set_mask=2, invert_mask=2 On next-20180920 I get no this message and booting hangs. Same with next-20180920 + your second fix from this thread. I will try to debug this more on Monday. > On the other hand, I've had a look your device-tree configuration and > it looks like that specific setup won't benefit from the fast bitmap path. > You have pin 2 at position 0 and pin 1 at position 1 of the array. > Hence, the fast bitmap path covers only pin 1, and pin 2 is processed > by the old path with apparently buggy code for skipping over fast pins. > > As a temporary workaround, you could try to revert the order of pins in > your dts file (pin 1 at position 0, pin 2 at 1) and the mmc pwrseq code > should work for you again by taking the original old path, not skipping > over fast pins. Results of such check may also help us to better > understand and resolve the issue. Changing the order of mmc pwrseq gpio pins fixes boot hang. Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland