Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp463877imm; Wed, 26 Sep 2018 01:29:54 -0700 (PDT) X-Google-Smtp-Source: ACcGV615xYKgcFvoEzlxrmPfsnkZq3cQkPxGi/yGiohu8GjldMaEbWAk1YJNnk5gdey7dmUQP6vc X-Received: by 2002:a63:730c:: with SMTP id o12-v6mr4593496pgc.397.1537950594537; Wed, 26 Sep 2018 01:29:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537950594; cv=none; d=google.com; s=arc-20160816; b=tJku1+KBus+WgY0qPwfelys7hDzNCPH27727dBdLFdUBn+GkvnHMqB8aEjTMYpvRry v2CoUNxd0P8cUUOPq2Q0LWqhJQFZLtSKqLBuRtLnpOPKaVsRPFWugc0BIc99H5LAuZOd m5/uPGGLLDgKCXdcGzLoRrZ0YZFXP4rMX9CKkgnQzOHEvkMKJrIpx0lHj9yxymA903F6 CWFcRk3gcYd+M8qE1bUbZaXT1JUnKBwQw0+bOv+ec7/mM1uakynr9cZTcV5TH+d+93jx eI9YU9f3W55IaHsq7+W0kb9v6a7B/i8h5GkmdFxQ9FP6on3R4n0DIDu8M9eM1OxLyFS8 I/6w== 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:cc:to:from:subject:dkim-signature:dkim-filter; bh=DGaYL5oWkvxy60NOlTLIXb/Qq//F7CpBP0jVZsjbJjE=; b=v2tbTAWTaQoN/tR5Sl0zegHHjLYoD5ERgvn7kWCZCqNCESW8EKo5cx108KuhuM5e18 yZhDCazPhjfE4FVAJIsPxDLaEjjldSF7MBe4fArABmNKB6A+qUBLwoz9wp9jhNQ/WwLP Sb42PYd39Q+gmr5anXSEnfq8rLeTH+FI7SMdVh2icEsIX2WgEObRL6oSmVqkktJ3iA6Q a9ElwRVs0uOIs58DWqc6kvQmjLM1k2if+3SMivh0KVz/flB8BsGCyFtIpwKbio5pddiy AtM+yO7hOeqq6olR1Qu7PLu18nsjsmTjnyACIiL0C1cgh1DpaaLjMkAjdyH7IULeGY5p uUPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=XYDsIP1U; 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 l12-v6si4732832plc.332.2018.09.26.01.29.38; Wed, 26 Sep 2018 01:29: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=XYDsIP1U; 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 S1727432AbeIZOjW (ORCPT + 99 others); Wed, 26 Sep 2018 10:39:22 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:51637 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726467AbeIZOjW (ORCPT ); Wed, 26 Sep 2018 10:39:22 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180926082733euoutp02894d9160d27a4d0054553fcf8af15f3f~X5cn3tjo42254422544euoutp02T for ; Wed, 26 Sep 2018 08:27:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180926082733euoutp02894d9160d27a4d0054553fcf8af15f3f~X5cn3tjo42254422544euoutp02T DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1537950453; bh=DGaYL5oWkvxy60NOlTLIXb/Qq//F7CpBP0jVZsjbJjE=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=XYDsIP1UWpXLFzpXjALS8Ggs1qPvvP4rfhfh84+3g2vAKv+VJf+VBrGJCNbnJ7zj+ nhvcF66XG4qozUVIef355NhjhsFPTKnWA/T5UqZHOXNA8DoCezueXe6PUHyr4aXeAW eY8mMpIr8NWeopiDzijrkDpxrKi0zXdpSDH7trBA= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180926082732eucas1p1caa59554a2e470e6adcb6c8c0961d9da~X5cnfCWiR0635006350eucas1p1T; Wed, 26 Sep 2018 08:27:32 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 74.2F.04294.4F24BAB5; Wed, 26 Sep 2018 09:27:32 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20180926082731eucas1p1fb936eedca21be0b8cd4dd281e422f27~X5cmfM67m0415004150eucas1p1b; Wed, 26 Sep 2018 08:27:31 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20180926082731eusmtrp1a54607885494047c0bdc2ce71978eee8~X5cmOPvq01963619636eusmtrp1U; Wed, 26 Sep 2018 08:27:31 +0000 (GMT) X-AuditID: cbfec7f4-c77a99c0000010c6-24-5bab42f41b23 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 29.AB.04284.3F24BAB5; Wed, 26 Sep 2018 09:27:31 +0100 (BST) Received: from [106.116.147.30] (unknown [106.116.147.30]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20180926082731eusmtip2f4c7b31850598aacc766403e964b8416~X5clz6v0k2121621216eusmtip2M; Wed, 26 Sep 2018 08:27:31 +0000 (GMT) Subject: Re: [PATCH] mmc: pwrseq_simple: Fix incorrect handling of GPIO bitmap From: Marek Szyprowski To: Janusz Krzysztofik , Linus Walleij Cc: Ulf Hansson , linux-mmc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , Linux Samsung SOC Date: Wed, 26 Sep 2018 10:27:30 +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: <7a4906d9-ffb1-f2af-07e7-d5815dcd0d8c@samsung.com> Content-Transfer-Encoding: 8bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA01SfUhTcRTlt/f29hRnP6fixbJoYKSStrKYaWZptP7SQEhcpEtfKjknm7OU IMM0E81wgfq0FBH8GJZNXbosmZlDJOcXEZWhsiL8QEqxD01re1r+d+45595zL1yaEOn53nRa RhajzlCkiyln0jjw03pg+ZRefnB1zlc6YWQJqdXaJpDeX2vkSdtr15B03FRDSfs3ypC00vqC J7W0no+gZd3spEBmaLlDyT686aFkS4bdMWS8c1gyk56WzaiDwhOdU7+xNirz845rY6V1RB5a cSlGTjTgYKjqeUAWI2dahJsQLEzrCK5YRjBSdndTWUJQP9/B32opHKzfFBoRPOu+hbhiEcFE a7PD5Y5joLetwYEpLIHihWLKjj1wHLQ15jkyCDyN4GO/kbQLJPaF4SX7WJr2xBdg1RRqp4XY DQarbA6LEz4B7YsbDkzgPZDfWU1w2Ave2Wp59pmADQKo/DRPcc3Z8HDWjLi1o+B7d/kmdodZ S4eAw7tgSFdCcs35CG5XsgKuKEHQWdNFca5QeGkZ5du3I7AfPDYFcfRJmBodRnYasCu8XXDj FnKFcmMFwdFCK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henCUNp0ubcCycecns2xepdORMVk7ev 9IuCS8iCNtZG1998DHKfNpRVcjC90lJs/fs9w/+hYbKP4cmTEwzjvt8+FvmlqvfbSm6tYtEM r2r33ytOLcs9tbLt4fYnK5eoWLq+Zl9jv6AopXvjQu/sN6ZrGmx/7hHQfM7GtHffhDVKLMUZ iYZazEXFiQD3FF5o0QIAAA== Message-Id: <20180926082731eucas1p1fb936eedca21be0b8cd4dd281e422f27~X5cmfM67m0415004150eucas1p1b@eucas1p1.samsung.com> X-CMS-MailID: 20180926082731eucas1p1fb936eedca21be0b8cd4dd281e422f27 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20180925192325epcas1p41b5c57a1ff7c9bc00f9a6d3b2e601820 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180925192325epcas1p41b5c57a1ff7c9bc00f9a6d3b2e601820 References: <20180925192433.1377-1-jmkrzyszt@gmail.com> <7a4906d9-ffb1-f2af-07e7-d5815dcd0d8c@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi again, On 2018-09-26 10:14, Marek Szyprowski wrote: > On 2018-09-25 21:24, Janusz Krzysztofik wrote: >> Commit b9762bebc633 ("gpiolib: Pass bitmaps, not integer arrays, to >> get/set array") changed the way GPIO values are passed to >> gpiod_get/set_array_value() and friends.  The updated code of >> mmc_pwrseq_simple_set_gpios_value() incorrectly uses the 'value' >> argument as a bitmap of GPIO values and assigns it directly to the >> 'values' bitmap variable passed to gpiod_set_array_value_cansleep() >> instead of filling that bitmap with bits equal to the 'value' argument. >> As a result, boot hanging caused by incorrectly handled MMC device >> has been observed. >> >> As a side effect of that incorrect interpreation of the 'value' >> argument, wrong assumption is taken about the 'values' bitmap size >> never exceding the number of bits of the 'value' argument type. >> >> Fix it. >> >> Reported-by: Marek Szyprowski >> Signed-off-by: Janusz Krzysztofik >> --- >> Hi, >> >> I hope I've finally identified the root cause of the boot hang reported >> by Marek Szyprowski.  I've reviewed the code of other divers updated for >> the modified GPIO API and found no more issues of that kind. >> >> Marek, can you please test this fix on top of next-20180920 with the fix >> "gpiolib: Fix missing updates of bitmap index" also applied? > > Yes, I've just did such test (next-20180920 + "gpiolib: Fix missing > updates of bitmap index" + "mmc: pwrseq_simple: Fix incorrect handling > of GPIO bitmap") and sadly it doesn't fix the boot hang. > > With some more debugs in mmc_pwrseq_simple I've noticed that > gpiod_set_array_value_cansleep() never ends and busyloops somewhere. > I'm checking this now. I busyloops inside the internal do { } while loop (lines 3163-3201) in gpiod_set_array_value_complex(). 'i' is never incremented. > ... Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland