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=-6.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 9D8A2C432C0 for ; Mon, 18 Nov 2019 10:56:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6EF0820730 for ; Mon, 18 Nov 2019 10:56:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="KQ5ze8tI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726668AbfKRK4l (ORCPT ); Mon, 18 Nov 2019 05:56:41 -0500 Received: from mail-io1-f68.google.com ([209.85.166.68]:37483 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726627AbfKRK4l (ORCPT ); Mon, 18 Nov 2019 05:56:41 -0500 Received: by mail-io1-f68.google.com with SMTP id 1so18233345iou.4 for ; Mon, 18 Nov 2019 02:56:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=BpjkydcILv4WRatAhMF8ID6gevL7eMvwGFbXOPEOTT8=; b=KQ5ze8tIdjs8igU04GRoglPdZXSB6Omi1Lgtu481bI2uLKnXgkwgQA0yf5N9lVpKKD /k5GQwzi+FIjlOKP9lHC5oB4xnYRnkx4rdzpuosu6C6Ak3fFp9ybKC33qahHuoSUfPHC qemRopZDWSLYVuxsVGNnjZ1DWR2RlKLP9IeG+YoPUYWqQ2Tr0L+68/Onk6xi4td5MUjf ORfTMmeS/wfdAAsP6p9g+SE/KpgrPUPNLHaaRw5V6yARCKv7KCK5TIzIqXAKRkKgoaCB mDr8N7mXKjncVx5m10JoX8Q5272M/EFFGZ26Yg5H5Da/+KjDqJrUGpJylYmKHdVeqLiP iFHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=BpjkydcILv4WRatAhMF8ID6gevL7eMvwGFbXOPEOTT8=; b=Ei6RyKTEiJJeh2thi5gEosaEbKsBPy/r+vcd0Wti1zav1OqkdbIrd65dmbt2Tv+lUn wZRG8hzlT8PgTbx9glbOws76YuTmg3FtryR31q6F9T7dpHSvTE2PQdz4dSCWmrrHuX4Y IcCpJ103ad2RYUEDlx2RqPlvlIWJQ3HQn6S17WI8B5OUbGlcmEPlcoZQ9lPg1BmkTHxC CBKGf4+m9+DBBFSYdWISqmb/cxNEF7q+DkGHZkirKt648XFC06Th1Dc51AUsFrcUydmG EZHD44Ch8fENp2ON2r3pKQFoo+FHNBhkvwKixdYaMlBMGL2fvZUZtbClWbA5+zZQ+EX6 ttXg== X-Gm-Message-State: APjAAAU0xdBdPOP7Nuw2uXCoqRYLNmXsUMA3/1Z3zz0CHV8J+RXzGDn1 W2SWn+pvIx5/AGwzC9i0JWstVTllyOYZzsnfxK2epw== X-Google-Smtp-Source: APXvYqys+DHRyHrExAkuVoqSvESVnhLyTrN6zzDEb2BCGFENYKMYYlQu22DMWnY0oiCxedTbQwzF2JUozTlFrD4Y+kI= X-Received: by 2002:a6b:18c1:: with SMTP id 184mr12748500ioy.40.1574074600772; Mon, 18 Nov 2019 02:56:40 -0800 (PST) MIME-Version: 1.0 References: <20190916134344.26656-1-m.felsch@pengutronix.de> <20191118103332.bmafrl5izirbauqw@pengutronix.de> In-Reply-To: <20191118103332.bmafrl5izirbauqw@pengutronix.de> From: Bartosz Golaszewski Date: Mon, 18 Nov 2019 11:56:29 +0100 Message-ID: Subject: Re: [PATCH] gpio: fix getting nonexclusive gpiods from DT To: Marco Felsch Cc: Bartosz Golaszewski , Linus Walleij , m.szyprowski@samsung.com, Charles Keepax , Mark Brown , linux-gpio , Sascha Hauer Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org pon., 18 lis 2019 o 11:33 Marco Felsch napisa=C5= =82(a): > > Hi Bart, > > On 19-09-17 09:53, Bartosz Golaszewski wrote: > > pon., 16 wrz 2019 o 15:43 Marco Felsch napisa= =C5=82(a): > > > > > > Since commit ec757001c818 ("gpio: Enable nonexclusive gpiods from DT > > > nodes") we are able to get GPIOD_FLAGS_BIT_NONEXCLUSIVE marked gpios. > > > Currently the gpiolib uses the wrong flags variable for the check. We > > > need to check the gpiod_flags instead of the of_gpio_flags else we > > > return -EBUSY for GPIOD_FLAGS_BIT_NONEXCLUSIVE marked and requested > > > gpiod's. > > > > > > Fixes: ec757001c818 gpio: Enable nonexclusive gpiods from DT nodes > > > Signed-off-by: Marco Felsch > > > --- > > > drivers/gpio/gpiolib.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c > > > index d9074191edef..e4203c1eb869 100644 > > > --- a/drivers/gpio/gpiolib.c > > > +++ b/drivers/gpio/gpiolib.c > > > @@ -4303,7 +4303,7 @@ struct gpio_desc *gpiod_get_from_of_node(struct= device_node *node, > > > transitory =3D flags & OF_GPIO_TRANSITORY; > > > > > > ret =3D gpiod_request(desc, label); > > > - if (ret =3D=3D -EBUSY && (flags & GPIOD_FLAGS_BIT_NONEXCLUSIV= E)) > > > + if (ret =3D=3D -EBUSY && (dflags & GPIOD_FLAGS_BIT_NONEXCLUSI= VE)) > > > return desc; > > > if (ret) > > > return ERR_PTR(ret); > > > -- > > > 2.20.1 > > > > > > > Queued for fixes, thanks. > > I rebased my patch stack ontop of -rc8 and didn't saw this commit. Is > this intended? > I'm not sure what you mean, it's been in mainline since v5.4-rc2 as commit be7ae45cfea9 ("gpio: fix getting nonexclusive gpiods from DT"). Bart > Regards, > Marco > > > Bart > > > > -- > Pengutronix e.K. | = | > Steuerwalder Str. 21 | http://www.pengutronix.de/ = | > 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 = | > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 = |