Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1422456imm; Sun, 23 Sep 2018 03:52:35 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ/Gf62X/lMt+FMZ7PLee4dZsSWCeLilXnwNi6imAuTgIfiRARTYMsVDXkktk+cN1koe+qC X-Received: by 2002:a62:5306:: with SMTP id h6-v6mr723177pfb.54.1537699955411; Sun, 23 Sep 2018 03:52:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537699955; cv=none; d=google.com; s=arc-20160816; b=GnR141cWORpD0sgGEqy2hz3F5erEvz3FCqKNjUpUlCBwmC2tYNIYGPqMF74KJu2qkn zXiHcdMMHdNSoucMhh3e/8MUuJ24HPmqzkQfjD26oJELtbXdO8YoAm93WInc05X70oc4 4p32iaxneV5sBOmrNKZLTLMMhmo5gq9qdPGkwdjFth6LFoa4BO7W8d8YzYNjJcjSao8v nxaGTe+aCoGbs7vWi/LUuxI0dbnq8xc8+a/43scTLzI7fOI0SQKackhiFhVy1DfM9xHM 5Duvn+5YI5MVw8rIbsZc/j/wMFg5A5xE1+z5yrVkP47Z7r5B8DzB8v08KtNofmSomFAA xXBg== 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=K0GH2NVxQkTSkS8u1BEKMC2mAlJe+QorxWmVBJLGL2Y=; b=AnyCfUYpEpVeBY1A/NH5NXTVvQKRt9t0I5Bc65CHlYXR1eD4wm9KrpCH5o5L50+x0y EtBnI84S2SSl5J6wlrEAPF7h8lFoIrN1/psWIcRA2sl5NrB9jyaWCaVHoCR/zmcttsiE ECcm7eI7pkeZqkb5QCpmMBTZHQrtJ7AXI00pPJMgVH+kVW24vfvUOjlWUVboVNOSfKYo OaLQCQB5iet7QZgQOkJ9V4b85uwjJhkEAs00ijnJ1nhZPoGPSKHyFWfsEOGQWCWCkzO7 lmeZmvcSbxtNCq8lgQnkWntRURUCDCblNveS4aHouBa1AbU+tj6cePbIm5i5GESnaOEV 7oag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RVurwvMq; 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 3-v6si31792407plr.488.2018.09.23.03.52.19; Sun, 23 Sep 2018 03:52:35 -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=RVurwvMq; 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 S1726231AbeIWQtS (ORCPT + 99 others); Sun, 23 Sep 2018 12:49:18 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:36792 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726088AbeIWQtS (ORCPT ); Sun, 23 Sep 2018 12:49:18 -0400 Received: by mail-lj1-f196.google.com with SMTP id v26-v6so15722980ljj.3; Sun, 23 Sep 2018 03:52:10 -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=K0GH2NVxQkTSkS8u1BEKMC2mAlJe+QorxWmVBJLGL2Y=; b=RVurwvMqZGuudiwFPI8sJYI8cFsAAvMAGhmv73Pl1OUSC4vjfwJ04Ph9Ds/dTVAAfB kzfoKzVga4rXuhTKG1KVboaa0ruMy4m6kZIgN6vgRUB0+CegSX18O+7hwsF/juyqVBEv piIivj0E5jgH33+Xv4lfao14AKyMMhdUoqn01o3UKBZ0xWMb33//a7MVhKiIr7SYzHSQ bCKrL3LZK0RztzmsxWBgQ5q/Z3lbLyfyIn2o0thk1iJ5XWzVVcYSKq8NDjrtpxtfjZXu 5CubHYwvJ5XWeo64XdNGxbJ3xST+73PPnhrdUkQdFmXRU5nInNglJL1iLtrEPjGjUJWk rb+Q== 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=K0GH2NVxQkTSkS8u1BEKMC2mAlJe+QorxWmVBJLGL2Y=; b=BSgtuBZJFmfs5fMlzyExkfgiGx12LH5yV3batD3xlBqH6pSZ0n+XGAKnRypWy9Y4Lf sW0yGkz0E0e5vdRpqsHB/L2DfvHu2V75sYCkYTUHTk1k9SOhOqNnjItfHkpyFY2ddvDp h8CV6nHYKQAiv1X9CseA77Mu5NiiUf2z0pi2D4LqCuw3P2bTUkCt4JVw8qkEhbrbRWrH nCogUSUJJFyAdYquDUrWqB4rwkGUJ7TZp7d9NO9HYF9tvz1BWwCYyRQclXNSo6AGm9rR bXhsMBXn+kTpddQ2PmffqCTjb2aZRefR2Me6wPvZmpThPY7BPC8Bl5hwPGnJGui1bpNi 7GHw== X-Gm-Message-State: APzg51CsdSdA/AYW8AfZyMpL2ZNmd85bDIlHkZJdJkAWM6UrhuZupbrr tCrElEQiFpsVSTR+RvJfv94= X-Received: by 2002:a2e:8513:: with SMTP id j19-v6mr7454235lji.10.1537699929521; Sun, 23 Sep 2018 03:52:09 -0700 (PDT) Received: from z50.localnet (apn-31-0-38-37.dynamic.gprs.plus.pl. [31.0.38.37]) by smtp.gmail.com with ESMTPSA id t200-v6sm61182lff.77.2018.09.23.03.52.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Sep 2018 03:52:08 -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: Sun, 23 Sep 2018 12:43:53 +0200 Message-ID: <2785169.v6aIfS3K2k@z50> In-Reply-To: <20180921141409eucas1p190a47e2608429870d23516ee5e75c191~Wb8z_FmwI1466414664eucas1p1F@eucas1p1.samsung.com> References: <20180831225616.29221-1-jmkrzyszt@gmail.com> <20180921141409eucas1p190a47e2608429870d23516ee5e75c191~Wb8z_FmwI1466414664eucas1p1F@eucas1p1.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 Friday, September 21, 2018 4:14:06 PM CEST Marek Szyprowski wrote: > 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 Looks good to me, i..e., in line with what one could expect. However, ... > 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. Not being able to discover more coding bugs in the code modified by the series, I'm wondering if the reason for the issue you are observing comes from the fact both pins are no longer manipulated together within a single .set_multiple() chip callback. I'm working on a fix which prevents from that. Thanks, Janusz