Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3648969imm; Mon, 15 Oct 2018 01:34:24 -0700 (PDT) X-Google-Smtp-Source: ACcGV63nZX+V4MFr3/QFukgHX9zuMnUJTX5ERVKRtP1iXObkVafSfgG4l0WuFa9FdadlZfSZXQGY X-Received: by 2002:a17:902:1a7:: with SMTP id b36-v6mr7846440plb.240.1539592464691; Mon, 15 Oct 2018 01:34:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539592464; cv=none; d=google.com; s=arc-20160816; b=0x7qp7Qih/TrIl306OmOBfeyT26mU99wWvEnvbLp0LNWbkrWqzLoN8qivF2/U0963p XVTTrflIpxy30XeR8k23hBVNxAKCfZUxN41Z8d231xxm5xASgnjbRMDeXbt+guFAo6R/ kiVr0SgtbpmDWRxJ6KBxRoA/2SEoPhX7B/pVMt36lBBPDO5vJxkSjR3HJD5ReOgafKvy QXKruesdOauyLjhPWJdLqL7xvse7rmkUhNaXPE1DaqRfAXBwNzsaM5nh8kAvn7nTTc3x XOCKEJlkav6k2Du8Vh0obLTEOVNGKUHFj7nrp/Gu9XdontF3bSW725sbzkM3PWZH3CcW N2KA== 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=aGTh/G0yhH9nSbdLno69o0fsxoeLwkYyKymuyAJsMI0=; b=KVqdbSg7lKEK/vIswZhF1ReLQmRZlUYBix8SVFt7XhPuCb4QuCZzb3hARnjaHj7aPa oHDNeKlf7yn+iyYSR+wYjUYGnOZWjHRLzloISQPaU62ewObDfZp/8PnEh75OVdvwjpup ed7dDTo4wPn+LKWWS0Ju2hsZmRXXVKwBHbNlQ1jfmvGo4hrmgVNmy2W11gEfP+xYKvh1 abC5QFArISmbk9RvBsr89xRy2O/i0zA8dQ0pqmMJrqVKFdyU2hcSC56QgcJN5FxOHiD7 6DsL1pAyrAdv7zpEO2xPEQNvuZBdsc+2/wgFNekBM9WyVcctbCwgsTUyJmTY823nCuRy toHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Vw4U6nYy; 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 r13-v6si9595728pfb.43.2018.10.15.01.34.10; Mon, 15 Oct 2018 01:34:24 -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=Vw4U6nYy; 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 S1726602AbeJOQQa (ORCPT + 99 others); Mon, 15 Oct 2018 12:16:30 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:52848 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726566AbeJOQQ3 (ORCPT ); Mon, 15 Oct 2018 12:16:29 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20181015083212euoutp023a605e35701ca6a86a9ec5677159706e~duxGj3ZRJ0452704527euoutp02I for ; Mon, 15 Oct 2018 08:32:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20181015083212euoutp023a605e35701ca6a86a9ec5677159706e~duxGj3ZRJ0452704527euoutp02I DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1539592332; bh=aGTh/G0yhH9nSbdLno69o0fsxoeLwkYyKymuyAJsMI0=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=Vw4U6nYyRQ4B/T8skpGgLg0O4RUNFvwkNllMibuFdq0Eh7EEYv1C7kNFDFNPv0Aom PPuc+DhynvNh5xhRCzIqrvYtL6VHF5iGHjCtNLFaDMTb4tLlLihmVU6VW/5JqU2Jhv FPttzjefZEr6SLhpZoOEaK+noMCymcVs6cf2XOCo= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181015083210eucas1p2ead61dd7860022e0f6ebd179bd375ef5~duxFfOFOq0289502895eucas1p2f; Mon, 15 Oct 2018 08:32:10 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 59.99.04806.A8054CB5; Mon, 15 Oct 2018 09:32:10 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20181015083209eucas1p2fb3d1961745fdb3007dec317c6441142~duxEkRvmp2005320053eucas1p2D; Mon, 15 Oct 2018 08:32:09 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20181015083209eusmtrp1d973644d31eb59493cb2b9703f204dec~duxEUgTjJ0145401454eusmtrp1C; Mon, 15 Oct 2018 08:32:09 +0000 (GMT) X-AuditID: cbfec7f5-34dff700000012c6-bd-5bc4508abeda Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 3C.78.04284.98054CB5; Mon, 15 Oct 2018 09:32:09 +0100 (BST) Received: from [106.116.147.30] (unknown [106.116.147.30]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20181015083208eusmtip2619747f46fe26bf73674c7a279993520~duxDXEtXG1270412704eusmtip2_; Mon, 15 Oct 2018 08:32:08 +0000 (GMT) Subject: Re: [RFT PATCH] mmc: pwrseq_simple: Fix incorrect handling of GPIO bitmap To: Janusz Krzysztofik , Ulf Hansson Cc: Linus Walleij , Krzysztof Kozlowski , linux-mmc@vger.kernel.org, linux-gpio@vger.kernel.org, Linux Samsung SOC , linux-kernel@vger.kernel.org, Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org, Kukjin Kim , =?UTF-8?Q?Beno=c3=aet_Cousson?= , Tony Lindgren , Enric Balletbo i Serra , Javier Martinez Canillas , linux-omap@vger.kernel.org, Heiko Stuebner , linux-rockchip@lists.infradead.org, Carlo Caione , Kevin Hilman , linux-amlogic@lists.infradead.org From: Marek Szyprowski Date: Mon, 15 Oct 2018 10:32:08 +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: <20181012190901.1243-1-jmkrzyszt@gmail.com> Content-Transfer-Encoding: 7bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA01Se0hTURjv3HN3d9Wtbkvxy6RoZVTgSnodMqKHf1yCwkCK0qhVF4t0xb1p GUFWmjpKy4r0qim9tadzORMxnOaKUasssVpgWWQ+GrQemC5zXiv/+72+830/OCzWXWDC2J2m vYJoMibpmUC6urnPFWmObYqf62yYQtylPhVpv3Ebk6f95QyprHpDk8H33SrS2l/AkBfVMiYV Z+/RJK+jG5O+LCtFXK47anJm4CpFyoqCiKWjVUWqSgcQMf8qx6SltpghTYN5iBRdyqPJ1/ZB TApc9RTx2Sw06bSGkvsvVhHHzfXLJvI/vufTvKctU82bH+VSvK8oE/P35Ldq3lKRw/Du1jqG r7p0iK/8UkPxeb65v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ZzU7+/s6zk6/L5OxYu8VCeuvKcPYdvMnGeuwlRPs kKeDYJvqi1j7VJuErfDHs62eOoz95ViXGX5YncIbC0zchhyjYNpNaxmUoGaSkTphe7KaSUw6 ujNBQ29LTTnB5eWe4fhtqcfUOZUTX7H8i7Fnp2ecsmJwRymCUDkkt8N3bR+lIgiTU+RdAAfr bPhSsBb23iqWLnEU9HlEYqk0CWBJSx0RCKLIA3Ck50eQoxe5WOySBEoYKcrgjaknWCCgyHYA v3yhA0yQDBQnxaCgIFPh0NN6WYBxcjO8X90RfFeSR2DXjdLlTiTsrR4PbhRKIlj6/UNwJkZu gb66/mVeD1sna5c5Bn4ct0iuAsq8QjevUMwrFPMKxQpwG4jmCgR9tl5g1IJOLxQYstXHjXoH WDyZlpfepjbQb9/vBKQc0OEKMtylpaS6M0Kh3gmgHKOjFfCAU0spTugKz3G8MYsvyOMEJ9As fu4aFqs8blw8QIMpi9EwSSiZSUpMStyB6BiFO77wMEVm60zcaY7L5/j/nkQeGlsMyvSu5uGx 8KyTu9+8Cn3XrDmX8qL/7XmNaqPWqQyp5l1Ww67OBMw8kubNgHFzaTpvhCpysMSAH5qPUK3p Q+/Jyz32NemnhvtmG6Lz91bWvpH18CFjXupZevcv9/Pb5/dcatx3XfWz81rHn8HI8qLEkDhL 7nDGlnHrQKne/31USeNCjo5RYbyg+wee/61xSAMAAA== Message-Id: <20181015083209eucas1p2fb3d1961745fdb3007dec317c6441142~duxEkRvmp2005320053eucas1p2D@eucas1p2.samsung.com> X-CMS-MailID: 20181015083209eucas1p2fb3d1961745fdb3007dec317c6441142 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20181012190748epcas5p3dc41f6d0f9c69f22351209b2e7ea66f3 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181012190748epcas5p3dc41f6d0f9c69f22351209b2e7ea66f3 References: <20180925192433.1377-1-jmkrzyszt@gmail.com> <20181012190901.1243-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-10-12 21:09, 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 new code introduced into > mmc_pwrseq_simple_set_gpios_value() incorrectly interpretes 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, only member 0 of the array is handled correctly. > > Moreover, wrong assumption is taken about the 'values' bitmap size not > exceding the number of bits of the 'value' argument type. > > Fix it. > > Signed-off-by: Janusz Krzysztofik > --- > Hi, > > I think that patch has been missed while we were resolving issues > related to GPIO fast bitmap processing. Since all issues other than the > one addreessed by this patch have been been hopefully identified and > fixed, GPIO tree seems now to be in good shape in regard to that. > However, I believe pwrseq_simple is still broken. Hence, I'm > resubmitting this patch to Ulf for inclusion in MMC tree, Cc: many other > people who are kindly requested to test it if possible. > > I've identified the following DT files representing devices which may be > affected (have more than one GPIO assigned to pwrseq_simple): > - arch/arm/boot/dts/imx6qdl-sr-som-brcm.dtsi > - arch/arm/boot/dts/exynos5250-snow-common.dtsi On Samsung Snow Chromebook it doesn't change anything. Board boots and detects WiFi SDIO card before and after applying it on top on Linux next-20181012. Tested-by: Marek Szyprowski - arch/arm/boot/dts/imx6sl-warp.dts > - arch/arm/boot/dts/omap3-igep0030.dts > - arch/arm/boot/dts/omap3-igep0020.dts > - arch/arm/boot/dts/rk3036-kylin.dts > - arch/arm64/boot/dts/rockchip/rk3368-r88.dts > - arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi > > Please start with checking if pwrseq_simple from linux-next works for > you and if not, please test if this patch fixes the issue. > > Thanks, > Janusz > > > drivers/mmc/core/pwrseq_simple.c | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) > > diff --git a/drivers/mmc/core/pwrseq_simple.c b/drivers/mmc/core/pwrseq_simple.c > index 7f882a2bb872..ece34c734693 100644 > --- a/drivers/mmc/core/pwrseq_simple.c > +++ b/drivers/mmc/core/pwrseq_simple.c > @@ -40,13 +40,22 @@ static void mmc_pwrseq_simple_set_gpios_value(struct mmc_pwrseq_simple *pwrseq, > struct gpio_descs *reset_gpios = pwrseq->reset_gpios; > > if (!IS_ERR(reset_gpios)) { > - DECLARE_BITMAP(values, BITS_PER_TYPE(value)); > + unsigned long *values; > int nvalues = reset_gpios->ndescs; > > - values[0] = value; > + values = bitmap_alloc(nvalues, GFP_KERNEL); > + if (!values) > + return; > + > + if (value) > + bitmap_fill(values, nvalues); > + else > + bitmap_zero(values, nvalues); > > gpiod_set_array_value_cansleep(nvalues, reset_gpios->desc, > reset_gpios->info, values); > + > + kfree(values); > } > } > Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland