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=-3.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_NEOMUTT 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 7B744C43441 for ; Fri, 9 Nov 2018 13:10:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 328F820827 for ; Fri, 9 Nov 2018 13:10:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 328F820827 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727845AbeKIWvN (ORCPT ); Fri, 9 Nov 2018 17:51:13 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:43499 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727784AbeKIWvM (ORCPT ); Fri, 9 Nov 2018 17:51:12 -0500 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gL6YW-00073V-Sq; Fri, 09 Nov 2018 14:10:36 +0100 Received: from ukl by ptx.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1gL6YW-0000Pt-Bn; Fri, 09 Nov 2018 14:10:36 +0100 Date: Fri, 9 Nov 2018 14:10:36 +0100 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Bartosz Golaszewski Cc: Bamvor Jian Zhang , Linus Walleij , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List Subject: Re: [PATCH 1/3] gpio: mockup: fix indicated direction Message-ID: <20181109131036.v6d645ojv6jr7v3y@pengutronix.de> References: <20181108165255.9940-1-brgl@bgdev.pl> <20181108165255.9940-2-brgl@bgdev.pl> <20181108203546.54rncnydgamud5z3@pengutronix.de> <20181109115424.pe4w26nmt6xplzto@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Fri, Nov 09, 2018 at 01:24:36PM +0100, Bartosz Golaszewski wrote: > pt., 9 lis 2018 o 12:54 Uwe Kleine-König > napisał(a): > > On Fri, Nov 09, 2018 at 12:13:44PM +0100, Bartosz Golaszewski wrote: > > > czw., 8 lis 2018 o 21:35 Uwe Kleine-König > > > napisał(a): > > > > On Thu, Nov 08, 2018 at 05:52:53PM +0100, Bartosz Golaszewski wrote: > > > > > Commit 3edfb7bd76bd ("gpiolib: Show correct direction from the > > > > > beginning") fixed an existing issue but broke libgpiod tests by > > > > > changing the default direction of dummy lines to output. > > > > > > > > The indicated commit only changed what was shown in debugfs, but didn't > > > > touch the actual direction of a GPIO, doesn't it? If someone called > > > > gpiod_get_direction before it would have returned "output", too, unless > > > > I miss something. > > > > > > > > > > This commit (3edfb7bd76bd) sets the correct direction of the line by > > > actually calling get_direction() instead of assuming input if > > > direction_input is not NULL. It just so happened that previously the > > > default direction of gpio-mockup lines was output but it would be > > > displayed as input due to this inconsistency. > > > > Does the test that fails since 3edfb7bd76bd use debugfs/gpio to find out > > the direction of a gpio? I'd say it's a bad idea to depend on this as > > (AFAICT) debugfs is only a debug aid and you shouldn't depend on stuff > > contained in it. > > No, this is what we get from the LINEINFO ioctl(). I only use debugfs > for triggering dummy interrupts. A right, gpio_ioctl uses these flags, too. > > I'd weaken the commit log a bit to not claim that the commit broke > > libgpiod but that it only made the inconsistency visible. After all this > > commit didn't "change the default direction of dummy lines to output", > > they were an output already before. > > Well it did break the tests you know. ;) Which test failed exactly? Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ |