Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp313158pxk; Fri, 11 Sep 2020 07:38:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8yyXicYZeMsBRIUvoYxlht6/6jf2iBUVpH/6EGoUptwtjAj2sxaauCwGE7jW3nLTe7J6M X-Received: by 2002:a17:906:2c01:: with SMTP id e1mr2444434ejh.128.1599835116938; Fri, 11 Sep 2020 07:38:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599835116; cv=none; d=google.com; s=arc-20160816; b=pMgA15lpW4+3YDuzHukEkMGiZo78P5pzlSGTZj1pQy8pZm/k841LFr4lMsEXmqlZal Bfi+PwIV24LKgi9nN7lGarNveA2+ERZaJ3k3jpgKRvQuPm1hY1Hr5KSJ+tqBjQUwcoD8 R+HvnoW+cLmGG/MwiHbv4b90/y9eC8SLX2YScT6oT33zbbiJPsNXtM9KlurMrYW3aogs ULLGArX5knBTkyHf0Bz+M6haOld0cdYgO9OMkSG3vHPA2eix2MqIq+LnGOdFg+owv6BC uinwhaWbir2ZRttxRLi/OC6SnLKQUsAV0j6qwb5IvTts6f6zOscbtyulYVQyevgaz55O EJKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=mDt6kSmqwxp3/bKrhXXfocRucx6HHYr3BJEsXGkBEEU=; b=o/5hwcW3EPQIiFIJJPzxFkczkd4hsdsmmluc1F7xSR7IQgjpSgyOuw44xcWrGHXmlG IiyYpGOCMVFogpBieEAQCz1l//U0YcI5lNgZSLh+4QNV+tKs2q2V+0aKufOyKGPHjlwi 6yR4Ywgh8FLL4+VSrK/plXDqZUuGfPv0Jva2wdTzfFRISnzy7oPqQOpAjYzmf17kKREg bjXO8NKkGHrdrz6hrv7nJS+EN3B3Wq8U2AZ0JYnyR0RPCdITaZG22a1wnLVS5uid5cWI ZB1d6iXlYfHQ+/E4DtAF9iTs2ZynNZMxZ3R2XjJqPnRQEYPTj4QAj8nIOlhO+z76BMKN Dhfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=njqGWaXD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q6si1340538edh.358.2020.09.11.07.38.13; Fri, 11 Sep 2020 07:38:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=njqGWaXD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726227AbgIKOgB (ORCPT + 99 others); Fri, 11 Sep 2020 10:36:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:56046 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726204AbgIKNMA (ORCPT ); Fri, 11 Sep 2020 09:12:00 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EB9AC22473; Fri, 11 Sep 2020 13:00:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599829259; bh=IyvEvOPgto/Pn5HZjNjgTK0PWnd9QVmaHjv3C3iB+l0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=njqGWaXDI2bwZRIKgvzoWnAM/8gymlwGBUYLNfq1bjuDPLiZa082yMwG9zIqGgDBf XVlAsQ58AkucCUgbLs9WZ1aFWT08HetSenRxCiOVcfnEZdo1gJDqyzJdNi1AyRshuK PTwY7QrsapXkhwPyC1BS602027lZ4eJCem1iEAu4= Date: Fri, 11 Sep 2020 14:56:25 +0200 From: Greg Kroah-Hartman To: Bartosz Golaszewski Cc: Bartosz Golaszewski , Andy Shevchenko , Randy Dunlap , Linus Walleij , Jonathan Corbet , Mika Westerberg , Kent Gibson , linux-gpio , linux-doc , LKML , ACPI Devel Maling List Subject: Re: [PATCH 23/23] Documentation: gpio: add documentation for gpio-mockup Message-ID: <20200911125625.GF3758477@kroah.com> References: <20200904154547.3836-1-brgl@bgdev.pl> <20200904154547.3836-24-brgl@bgdev.pl> <26ea1683-da8f-30e7-f004-3616e96d56b3@infradead.org> <20200907095932.GU1891694@smile.fi.intel.com> <20200907115310.GA1891694@smile.fi.intel.com> <20200907122238.GA1849893@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 08, 2020 at 07:03:30PM +0200, Bartosz Golaszewski wrote: > On Mon, Sep 7, 2020 at 2:22 PM Greg Kroah-Hartman > wrote: > > > > On Mon, Sep 07, 2020 at 02:06:15PM +0200, Bartosz Golaszewski wrote: > > > On Mon, Sep 7, 2020 at 1:53 PM Andy Shevchenko > > > wrote: > > > > > > > > On Mon, Sep 07, 2020 at 12:26:34PM +0200, Bartosz Golaszewski wrote: > > > > > On Mon, Sep 7, 2020 at 11:59 AM Andy Shevchenko > > > > > wrote: > > > > > > > > > > > > On Fri, Sep 04, 2020 at 08:15:59PM -0700, Randy Dunlap wrote: > > > > > > > On 9/4/20 8:45 AM, Bartosz Golaszewski wrote: > > > > > > > > > > > > ... > > > > > > > > > > > > > > +GPIO Testing Driver > > > > > > > > +=================== > > > > > > > > + > > > > > > > > +The GPIO Testing Driver (gpio-mockup) provides a way to create simulated GPIO > > > > > > > > +chips for testing purposes. There are two ways of configuring the chips exposed > > > > > > > > +by the module. The lines can be accessed using the standard GPIO character > > > > > > > > +device interface as well as manipulated using the dedicated debugfs directory > > > > > > > > +structure. > > > > > > > > > > > > > > Could configfs be used for this instead of debugfs? > > > > > > > debugfs is ad hoc. > > > > > > > > > > > > Actually sounds like a good idea. > > > > > > > > > > > > > > > > Well, then we can go on and write an entirely new mockup driver > > > > > (ditching module params and dropping any backwards compatibility) > > > > > because we're already using debugfs for line values. > > > > > > > > > > How would we pass the device properties to configfs created GPIO chips > > > > > anyway? Devices seem to only be created using mkdir. Am I missing > > > > > something? > > > > > > > > Same way how USB composite works, no? > > > > > > > > > > OK, so create a new chip directory in configfs, configure it using > > > some defined configfs attributes and then finally instantiate it from > > > sysfs? > > > > > > Makes sense and is probably the right way to go. Now the question is: > > > is it fine to just entirely remove the previous gpio-mockup? Should we > > > keep some backwards compatibility? Should we introduce an entirely new > > > module and have a transition period before removing previous > > > gpio-mockup? > > > > > > Also: this is a testing module so to me debugfs is just fine. Is > > > configfs considered stable ABI like sysfs? > > > > Yes it is. Or at least until you fix all existing users so that if you > > do change it, no one notices it happening :) > > > > Got it. One more question: the current debugfs interface we're using > in gpio-mockup exists to allow to read current values of GPIO lines in > output mode (check how the user drives dummy lines) and to set their > simulated pull-up/pull-down resistors (what values the user reads in > input mode). > > This works like this: in /sys/kernel/debug/gpio-mockup every dummy > chip creates its own directory (e.g. > /sys/kernel/debug/gpio-mockup/gpiochip0) and inside this directory > there's an attribute per line named after the line's offset (e.g. > /sys/kernel/debug/gpio-mockup/gpiochip0/4). Writing 0 or 1 to this > attribute sets the pull resistor. Reading from it yields the current > value (0 or 1 as well). > > This is pretty non-standard so I proposed to put it in debugfs. If we > were to use configfs - is this where something like this should go? Or > rather sysfs? Is it even suitable/acceptable for sysfs? That sounds like it would work in sysfs just fine as-is, why don't you all want to use that? configfs is good for "set a bunch of attributes to different values and then do a 'create/go/work'" type action. thanks, greg k-h