Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2359783imm; Mon, 24 Sep 2018 03:03:54 -0700 (PDT) X-Google-Smtp-Source: ANB0VdafpzunDeh8MFtHTpdB7lvJRbo2grAIke+8KjrgYhL5jG1nEFJBY6R+9ZPHdI9S4A0mAuZ5 X-Received: by 2002:a62:9042:: with SMTP id a63-v6mr9657445pfe.52.1537783434491; Mon, 24 Sep 2018 03:03:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537783434; cv=none; d=google.com; s=arc-20160816; b=e8Kv2PLC/zIQydZ/LBxa3+LMq30c/3uANNZfvY0eTjxJcd1aS85QxNoUwYvngB5Ycq RE01uVV2yo9gck6WdN6ILz78Wm09gQ6kenNKbRVzBMjMsAGXekUAzgW13LZKVg527UGR ymu6fajx/ERJwUtJxd+uwvHbw4Q8iQwt11M+VxnGQdAMMvbsI8vgrJGRMNSvuP84FJMY pVgFpYTx63iGCphNSlcD2KwGl17PVBB7jha2w33U072Kar3Ze8AcFNMEOGgOTNcHkdho DXxq4GIcmEpuzUeycX8Idk1MwLB1I1l0O2XFD//XuiXJzMoesbFZm04a9z0liOSE4oXU faLA== 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=726bnIJMb0wLjQreKFN5gJWwhAg/m1QD0m/DhMsrOTk=; b=l2fEh56qGeklwa9THKx6yfValxux3u4CoXPZlO/QjwxDWBNlWUC2L+Ksx3CqGehGME CZzrZrGioJcYs4nmYcKRbk4bMBohvKkZolX6khtWYYaYbS7rS2OCeJbLCbtJRzuUglhT w9SaQj5fR3OqnX7yNjk5mVn8l3zdmwVKRCxUdK2mWEO1XwtMHBluGgoh+onMYeIFGONn 1xyiU/4qqvhYxTeAXde7nJqigtjR1qbaEf1OQRhx2wqDHaHYcfDPtXOyw1IPZQILuMHP lezmFG28ZLdUYwUksRZ0S/GqHwxT5DMGaw9Z1oR/uxgDsKWvZJdrjjhgkOtHPgxSa9Xi yLvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=BjdjvdwO; 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 w71-v6si32429530pgd.362.2018.09.24.03.03.38; Mon, 24 Sep 2018 03:03:54 -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=BjdjvdwO; 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 S1728163AbeIXPpA (ORCPT + 99 others); Mon, 24 Sep 2018 11:45:00 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:54584 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725982AbeIXPo7 (ORCPT ); Mon, 24 Sep 2018 11:44:59 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180924094342euoutp0154a34d80780d17f8613d0d4b0e9971c5~XTMiVAOTr2119121191euoutp01O; Mon, 24 Sep 2018 09:43:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180924094342euoutp0154a34d80780d17f8613d0d4b0e9971c5~XTMiVAOTr2119121191euoutp01O DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1537782222; bh=726bnIJMb0wLjQreKFN5gJWwhAg/m1QD0m/DhMsrOTk=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=BjdjvdwOxMTMEfZ+Rw3RWRY7qkAoqwLT4iHKxsJ81GfH0RJReQWu3PUFyH5kdpdNo W2gs3W95q3vdi0y2yibnrthP8Z7lhcFggUz9WxRjy9NZzXk0FSK+qw3y6pU1n5lRPQ Knc2fy5/KbR8AGFhEHNDN6O58F3FeytSBC51NYzo= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180924094341eucas1p11938ef2f0e9b2940afaf061eeb10878f~XTMhfgzon0949609496eucas1p1E; Mon, 24 Sep 2018 09:43:41 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id EE.FC.04806.CC1B8AB5; Mon, 24 Sep 2018 10:43:40 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20180924094339eucas1p282f2f7cb627c183fe87da044edb90fa5~XTMgQ4GFs1339913399eucas1p2N; Mon, 24 Sep 2018 09:43:39 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20180924094339eusmtrp2bbf0b24381befcb603a462e828eb120f~XTMf70DTU1162911629eusmtrp2T; Mon, 24 Sep 2018 09:43:39 +0000 (GMT) X-AuditID: cbfec7f5-79db79c0000012c6-4d-5ba8b1ccaece Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id FE.C1.04128.BC1B8AB5; Mon, 24 Sep 2018 10:43:39 +0100 (BST) Received: from [106.116.147.30] (unknown [106.116.147.30]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20180924094338eusmtip1c0e7ab75c421028ebf5e323898e1008f~XTMen-Fr-2500325003eusmtip1o; Mon, 24 Sep 2018 09:43:38 +0000 (GMT) Subject: Re: [PATCH 0/2] gpiolib: Fix issues introduced by fast bitmap processing path To: Janusz Krzysztofik , Linus Walleij Cc: 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 11:43:37 +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: <20180923235336.22148-1-jmkrzyszt@gmail.com> Content-Transfer-Encoding: 8bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA01TfUwTdxje7+64u5aVHPWD38DE2G2wkUw0w+RddEYXs9yWuCzZli1j2Tzh Vsj40J6wuWRJBwZZw1IEN/CoFgdJkcGKqHx0fK2tlAW0VBGlImGmOJGPMQWDBccoBxv/Pe/7 Ps/7vM8fL0tqg3Q0m5Z5RDRkCuk6Wk01dj25+krv+eqkbc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6wV01 6enLlsX3bm/49J8bYcaCL2Y3q2z3V37dxvYp5y3b+gue+O5dGf1wbquv7nfjn7qMrteRipGy 9Jo3aZOk/x8pQTLVoAMAAA== Message-Id: <20180924094339eucas1p282f2f7cb627c183fe87da044edb90fa5~XTMgQ4GFs1339913399eucas1p2N@eucas1p2.samsung.com> X-CMS-MailID: 20180924094339eucas1p282f2f7cb627c183fe87da044edb90fa5 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> 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 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: 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++) + gpiod_set_value_cansleep(reset_gpios->desc[i], value);  }  static void mmc_pwrseq_simple_pre_power_on(struct mmc_host *host) Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland