Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1476007imm; Fri, 8 Jun 2018 17:33:59 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLkurrm4R/6UwnJ8eW0EPeb2EoFEADQ7ySPRpG+Dd3HalvBSLY1Ty7fg7V2N05Oq4GKXa2K X-Received: by 2002:a62:a8e:: with SMTP id 14-v6mr8053696pfk.57.1528504438921; Fri, 08 Jun 2018 17:33:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528504438; cv=none; d=google.com; s=arc-20160816; b=zxzClyzblr5HacWOn7ctn9ZAIChrft46VmJ93Ynwza7MUUqk7T9v+gO1Ilqm0rkKyT SrfrSAQ1rM2AMQWzdk22azc8kqb62zxaMkFPYq1+X4fbsNsj3z1PHY7vc3QgE+9nJ3EL 7XX2i6Kh+ACYaYVk5Kd92YWIYdatXOfMdMYYxo8sXTFF0bSGoG2vgHnRg8hrKJNg5toJ pGNGeAFDaj/+LYZ8ijDfcstlzF7hOLPmGRpVvXx/NxIc4P9gmNqENufR44bawjywzUk3 EcJ7EI+RGAXYmoU1ZELbdFw6KgNoVAbRtfLFybq3SkMro/Zzi5oCTCBDOjFBkgeccHTQ PgJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=aukOO0HPl/mCQ+SiE+ZdsI1IEF4QiZwx97LqPvobG9w=; b=frH/XkW01Bu32g0/G2v3UU9SHkkhV/j7azexrT+NrcL2Rikt1puzaHc41ylqmavRD4 iTz2TWz09gz6CfHVlY1vc8N0FM1KIPiCeYLS+RwQRtlAM7fzVuGymOvPQdlbQN7khXqS DkOdNrfV0rju+QrkYq911c5oP2owYL9T5bRT796rwJugmLDZOgUVeq6FCJwb4QYbxpaE bd90m4S2eknpP0bj+qQ0ZTIq5B4GuiDbJrrZCSBIetUI/NNGW/sZlOGDfLXuXJlgeE/X ysyYN5j6kwWRcGowbw8VYxMUzHi9Wla+rxDXUAMiR6mShM2RimqpU8AtB3rM3i039ibi a8yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=KdNItCiK; 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 h16-v6si26556739pgv.354.2018.06.08.17.33.43; Fri, 08 Jun 2018 17:33:58 -0700 (PDT) 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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=KdNItCiK; 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 S1753091AbeFIAdQ (ORCPT + 99 others); Fri, 8 Jun 2018 20:33:16 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:55470 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752691AbeFIAdO (ORCPT ); Fri, 8 Jun 2018 20:33:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=aukOO0HPl/mCQ+SiE+ZdsI1IEF4QiZwx97LqPvobG9w=; b=KdNItCiK/7t9IIxv8pDVCze0u QT8oQPF8u7WNrh4+DZ3xNnGu93Sm6WdjW2/B2piXhJF+SPrB4F4a2SR+EakNU8eOsqr+JKjKw5K4D xaCHIJqxS8pydlHmtABKGJ/CGQ39mjiFnvQjds3N7CSprbsKJ+d6lrN2jxr61i+aNDJLe5Dmw89ZM BiYy+Hxh7WmqDffI3+B7OCXUweP5eDuxO5nmDtpftrAVvX3y8eybWN93n2N//qG9VyxlpDK43FgY0 5fKIgrJN4NjqpdDxudlMRltqsReQZ6s7y/SBHjwQX4zsleGVFE9R0MhbEm9+IjIZIFGuyT4tIqZ+v KxvEdbYgw==; Received: from dvhart by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fRRoW-0000uS-U9; Sat, 09 Jun 2018 00:33:04 +0000 Date: Fri, 8 Jun 2018 17:33:03 -0700 From: Darren Hart To: Hans de Goede Cc: Benjamin Berg , Chris Chiu , Bastien Nocera , Daniel Drake , Corentin Chary , Andy Shevchenko , Linux Kernel , Platform Driver , acpi4asus-user , Linux Upstreaming Team Subject: Re: [PATCH 1/2] platform/x86: asus-wmi: Call new led hw_changed API on kbd brightness change Message-ID: <20180609003303.GD111314@localhost.localdomain> References: <38cb3527-8480-bdb9-a5d9-b601bc494a5f@redhat.com> <71df09bc89619aba975147e6b07920f1dfc2f46f.camel@hadess.net> <94789b55b88ae5a296e1fca3b0311318e7b507ee.camel@hadess.net> <0443419b-3147-163b-374d-bb8651b08837@redhat.com> <362131bf-3b6b-58aa-bda6-003f5ffb5e8e@redhat.com> <33c55842c8d9ce199f0f8ef314dea85fb848b0be.camel@sipsolutions.net> <173fdeb2-8129-57eb-fe2e-3ae16eec54b6@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <173fdeb2-8129-57eb-fe2e-3ae16eec54b6@redhat.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 06, 2018 at 05:32:52PM +0200, Hans de Goede wrote: > > > > > If we are adding hwdb entries anyway to control the userspace > > > > > interpretation of the TOGGLE key, then we could also add the new CYCLE > > > > > key and explicitly re-map it to TOGGLE. That requires slightly more > > > > > logic in hwdb, but it does mean that we could theoretically just drop > > > > > the workaround if we ever stop caring about Xorg. > > > > > > > > Hmm, interesting proposal, I say go for it :) > > > > > > > > > > So maybe the next stop is that I can follow Darren's suggestion to eliminate > > > the is_kbd_led_event() and send a v2 for review? > > > > I believe the best compromise we have right now is to do what Hans > > suggested in an earlier proposal. That is implementing the two separate > > behaviours in the kernel > > > > 1) handle this in the kernel as if the hardware changed it, and > > 2) send a new KEY_KBDILLUMCYCLE event [default]. > > I think you mean or, not and, depending on a module option the > code should do either 1) or 2) not both :) > > Darren, Andy could you live with a module option for this? We are of course strongly opposed to adding module options. I agree we can't ignore Xorg. I agree policy in general should not be in the kernel. I also see many of these drivers as the last mile to getting a platform fully working. If there is a place for one-off fixes, it's in these drivers. I'd love to refactor and use proper abstractions and all that as the patterns make those abstractions clear - but I don't want to delay getting something working waiting for the ideal solution. So I have two questions I'd like to confirm before saying "OK" to a module option. 1) Hans I think you said that doing the code conversion from TOGGLE to UP based on the LED value and the max value was racy with userspace. What is the failure mode here? Is it not easily recoverable? And how do I enter it? Do I have to simultaneously modify the software brightness control AND press the keyboard brightness control? How practical is that? If recoverable AND hard to trigger, I think there is value in the very simple 3 level brightness cycle being handled in the kernel. 2) Why is a module option preferable to a compile time option? It seems to me the policy will be largely distro dependent, and the same kernel needing to support both modes seems likely to be pretty rare. -- Darren Hart VMware Open Source Technology Center