From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161470AbbBDS1X (ORCPT ); Wed, 4 Feb 2015 13:27:23 -0500 Received: from mail-by2on0063.outbound.protection.outlook.com ([207.46.100.63]:32512 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1161336AbbBDS1V (ORCPT ); Wed, 4 Feb 2015 13:27:21 -0500 Date: Wed, 4 Feb 2015 10:27:15 -0800 From: =?utf-8?B?U8O2cmVu?= Brinkmann To: Linus Walleij CC: Alexandre Courbot , Johan Hovold , , Linux Kernel Mailing List , "linux-gpio@vger.kernel.org" , "linux-doc@vger.kernel.org" Subject: Re: [PATCH v4] gpio: lib-sysfs: Add 'wakeup' attribute References: <1421351389-11660-1-git-send-email-soren.brinkmann@xilinx.com> <20150116111108.GG30960@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-7.5.0.1018-21304.001 X-TM-AS-User-Approved-Sender: Yes;Yes Message-ID: X-EOPAttributedMessage: 0 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=soren.brinkmann@xilinx.com; X-Forefront-Antispam-Report: CIP:149.199.60.83;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(438002)(24454002)(51704005)(52604005)(377454003)(377424004)(77156002)(62966003)(108616004)(85202003)(92566002)(53416004)(2950100001)(50466002)(92726002)(110136001)(106466001)(74316001)(47776003)(33646002)(76176999)(50986999)(54356999)(46102003)(85182001)(87936001)(104016003)(23676002)(86362001)(6806004)(19580395003)(93886004)(19580405001)(83506001)(107986001)(24736002)(23106004);DIR:OUT;SFP:1101;SCL:1;SRVR:BN1AFFO11HUB008;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;MLV:sfv;LANG:en; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BN1AFFO11HUB008; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004);SRVR:BN1AFFO11HUB008; X-Forefront-PRVS: 04772EA191 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:BN1AFFO11HUB008; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Feb 2015 18:27:18.1548 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.83] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1AFFO11HUB008 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2015-02-04 at 10:19AM +0100, Linus Walleij wrote: > On Thu, Jan 29, 2015 at 6:23 PM, Sören Brinkmann > wrote: > > On Mon, 2015-01-19 at 09:54AM +0100, Linus Walleij wrote: > >> On Mon, Jan 19, 2015 at 5:20 AM, Alexandre Courbot wrote: > >> > On Sat, Jan 17, 2015 at 1:49 AM, Sören Brinkmann wrote: > >> >> On Fri, 2015-01-16 at 12:11PM +0100, Johan Hovold wrote: > >> > >> >>> Implementing proper wakeup support for unclaimed GPIOs would take some > >> >>> work (if at all desired), but that is not a reason to be adding custom > >> >>> implementations that violates the kernel's power policies and new ABIs > >> >>> that would need to be maintained forever. > >> (...) > >> >>> Meanwhile you can (should) use gpio-keys if you need to wake your system > >> >>> on gpio events. > >> >> > >> >> We had that discussion and I don't think GPIO keys is the right solution > >> >> for every use-case. > >> > > >> > Sorry, it has been a while - can you remind us of why? > >> > >> There are such cases. Of course keys should be handled by GPIO-keys > >> and these will trigger the right wakeup events in such cases. > >> > >> This is for more esoteric cases: we cannot have a kernel module for > >> everything people want to do with GPIOs, and the use case I accept > >> is GPIOs used in automatic control etc, think factory lines or doors. > >> We can't have a "door" driver or "punch arm" or "fire alarm" driver > >> in the kernel. Those are userspace things. > >> > >> Still such embedded systems need to be able to go to idle and > >> sleep to conerve power, and then they need to put wakeups on > >> these GPIOs. > >> > >> So it is a feature userspace needs, though as with much of the > >> sysfs ABI it is very often abused for things like keys and LEDs which > >> is an abomination but we can't do much about it :( > > > > Thanks for clearing that up. > > What does that mean for this patch? Are we going ahead, accepting the > > extension of this API or do all these use-cases have to wait for the > > rewrite of a proper GPIO userspace interface? > > What needs to happen (IMHO) is to make gpio_chips properly obeying > the device model, and then add the attributes for fiddling around with > GPIOs to either the *real* device or create a new char device interface. > Whatever works best. These mock devices are fragile and never > worked properly especially in the removal path as Johans recent > fixes has shown. Sure, that would be a nice long-term solution. But until then this patch would probably be welcomed by some people, without making the brokenness of this interface much worse. Sören