Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5442960ybl; Tue, 10 Dec 2019 06:12:07 -0800 (PST) X-Google-Smtp-Source: APXvYqy8bqPWMlLJ14ARbg5GUOKxUrLfvIv70xxQVQAHTPBP9/PRqOktfPbrN11yVlwI/fZTYpPq X-Received: by 2002:a05:6830:1607:: with SMTP id g7mr26185727otr.320.1575987127580; Tue, 10 Dec 2019 06:12:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575987127; cv=none; d=google.com; s=arc-20160816; b=RhpN0dDBjZHUnZbLQjJhcDrPtj0/D8acRw+8mBlRuGFYCU3KgJ3p0uOn8y7xZEKWfm XsvILtSGS/iTvTYpjgfKZE3tyggzimip4UlnFNaPhD+BeNGcBUSnM6cyP3kTJZ+N6K+q MjELZLwlhoj4RY6f9N6uBdk4qfHwWFqpZ/3ewM/mfLqbyxGt9mp8NTvmFktzgPO1dpVx lqW14HTRZN4701ZSEr05qGYTNa1uml6V9oD6EOfKGtAoY3ByR1yU7IW6wqp8X6v7QERv mMUbYlFoAyj4D6q+OINSk08RLcrRbxd7O/oocceSroAM68sXgVXTOPUpkT6WZsctg36E H6fg== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=B2D3Qyl+CwEJ45ada86WIyLvrr4ccx3M8jqZypSwAH4=; b=DWUGBQDZWVRvTkZjNLvBzPD67uEQpRUtgGrxxSTvR9PEEKdV98cxtKGrh3OnpWYNCu w4H2Dixevk9aOMfSxvXc1Gwd0+7TqoaqiLYJUNPH/X4EFxQv7sKJpr72pGRl2EBd5ga7 tD7tH0AT+84WT0ibUyOKPDWmNnEBOxdp45vfSw/E5mfTtxbTtUA4LgtvlMEIYmISn131 a+LltP5AECgPGvrddBQ5Tx/UBKOHbyZeHMJVEXdP58JRwmhWQavUQ3466mphc59CzEYq ibXK05wrjcn65SD0yPwjkF19KxJMolVtY9OWYic9M5JWLzWP6wvjutDZlCM422tncK9r RK/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=pD2UzuXZ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w26si1871036otl.213.2019.12.10.06.11.54; Tue, 10 Dec 2019 06:12:07 -0800 (PST) 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=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=pD2UzuXZ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727426AbfLJOLY (ORCPT + 99 others); Tue, 10 Dec 2019 09:11:24 -0500 Received: from mail-il1-f195.google.com ([209.85.166.195]:39657 "EHLO mail-il1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727145AbfLJOLY (ORCPT ); Tue, 10 Dec 2019 09:11:24 -0500 Received: by mail-il1-f195.google.com with SMTP id n1so1690239ilm.6 for ; Tue, 10 Dec 2019 06:11:23 -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=B2D3Qyl+CwEJ45ada86WIyLvrr4ccx3M8jqZypSwAH4=; b=pD2UzuXZbkpf0sMWJFiX6bgUR5KEaxD9P2Yt1cXm4D0vXt+bVxawCksIZu7jsPCOYn qx7TsRGaq8G9OrHx/dYkHvnen0oKgHN85Q9QH1uydQ5ODdNZmTiW1rNLjgjDwzyGyojr XpI7BqXabgC4zw5xpi4Vw1Yaf8I8kGMZgI995YCY9dzEieBRe7jJ4SYqE+LnAk92UzNg xO2v0IWBY2kxI3RXX1Ma7znE5R5aUHW/ZiIJGJXcDOZLt1z/OeKW1Bpwb4/dPUNgli73 yaXAWmM2e1I8VHxY/9UN9l3JJtxn/IIKnxjU/wCcSfb0MZKiZqQQt5KfCVFPVJqYGj0N 9RAw== 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=B2D3Qyl+CwEJ45ada86WIyLvrr4ccx3M8jqZypSwAH4=; b=nXyCIZiRaRYUYwoo4ejCBScWUYLrACPOxgihLes+u8dx5uNfjaXcL3qlIJ3SJUPgJl yWdise4ou6oXnudZKH3g++XA2p8saiotMlKuwYT8BHjuet4J05PpFF18VwnLOEysaewN PmnB8n+jxxhZYhARU7Bl9Qe8YWUy2DeDQuDv6B7SUwS9E50z9tAtlKggErjnYFQm/NFe mV2ygK9VVrpaS7AX2khrgNVLBVnGN7FCjdfV70VyRoEaje9IqoKkjp+tggUlSWIEmBU1 bVur24r106XNdE0w74myIlQXXNKf9w1Z6FhuR6C2GHO83TEv3aoafgPYAlpzgnIzuqex ILQw== X-Gm-Message-State: APjAAAVbdN41XoWhmygdzBZO5FsZCGz+cicXagKADhEtcnKdRIfz+y1/ BA/r4r2Vz1QCdIKKTgjBeQLM50pasecBiVc2cJ/lBg== X-Received: by 2002:a05:6e02:5c8:: with SMTP id l8mr34653892ils.287.1575987083100; Tue, 10 Dec 2019 06:11:23 -0800 (PST) MIME-Version: 1.0 References: <20191210021525.13455-1-warthog618@gmail.com> In-Reply-To: <20191210021525.13455-1-warthog618@gmail.com> From: Bartosz Golaszewski Date: Tue, 10 Dec 2019 15:11:12 +0100 Message-ID: Subject: Re: [PATCH] gpio: gpio-mockup: Fix usage of new GPIO_LINE_DIRECTION To: Kent Gibson Cc: Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , Bartosz Golaszewski , Linus Walleij , Bamvor Jian Zhang Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org wt., 10 gru 2019 o 03:15 Kent Gibson napisa=C5=82(a)= : > > Restore the external behavior of gpio-mockup to what it was prior to the > change to using GPIO_LINE_DIRECTION. > > Signed-off-by: Kent Gibson > --- > > Fix a regression introduced in v5.5-rc1. > > The change to GPIO_LINE_DIRECTION reversed the polarity of the > dir field within gpio-mockup.c, but overlooked inverting the value on > initialization and when returned by gpio_mockup_get_direction. > The latter is a bug. > The former is a problem for tests which assume initial conditions, > specifically the mockup used to initialize chips with all lines as inputs= . > That superficially appeared to be the case after the previous patch due > to the bug in gpio_mockup_get_direction. > > drivers/gpio/gpio-mockup.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpio/gpio-mockup.c b/drivers/gpio/gpio-mockup.c > index 56d647a30e3e..c4fdc192ea4e 100644 > --- a/drivers/gpio/gpio-mockup.c > +++ b/drivers/gpio/gpio-mockup.c > @@ -226,7 +226,7 @@ static int gpio_mockup_get_direction(struct gpio_chip= *gc, unsigned int offset) > int direction; > > mutex_lock(&chip->lock); > - direction =3D !chip->lines[offset].dir; > + direction =3D chip->lines[offset].dir; > mutex_unlock(&chip->lock); > > return direction; > @@ -395,7 +395,7 @@ static int gpio_mockup_probe(struct platform_device *= pdev) > struct gpio_chip *gc; > struct device *dev; > const char *name; > - int rv, base; > + int rv, base, i; > u16 ngpio; > > dev =3D &pdev->dev; > @@ -447,6 +447,9 @@ static int gpio_mockup_probe(struct platform_device *= pdev) > if (!chip->lines) > return -ENOMEM; > > + for (i =3D 0; i < gc->ngpio; i++) > + chip->lines[i].dir =3D GPIO_LINE_DIRECTION_IN; > + > if (device_property_read_bool(dev, "named-gpio-lines")) { > rv =3D gpio_mockup_name_lines(dev, chip); > if (rv) > -- > 2.24.0 > Hi Kent, I was applying and testing your libgpiod series and noticed that the gpio-tools tests fail after applying patches 16 & 17 (with linux v5.5-rc1). Is this fix related to this? Bart