From patchwork Sat Feb 24 22:29:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darren Hart X-Patchwork-Id: 10240605 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2A21A60209 for ; Sat, 24 Feb 2018 22:29:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C90929C0D for ; Sat, 24 Feb 2018 22:29:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 005D529C17; Sat, 24 Feb 2018 22:29:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C9AD629C0D for ; Sat, 24 Feb 2018 22:29:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751505AbeBXW3T (ORCPT ); Sat, 24 Feb 2018 17:29:19 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:59076 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751399AbeBXW3S (ORCPT ); Sat, 24 Feb 2018 17:29:18 -0500 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=DfB8+6/D2tKVrBedvEmXyZtgyy+TN6tpJSqXDsOW3nM=; b=bybUt1Com5YrtFumzqnKXvmZQ hH9MSGM8VOOGJRs6JHYA4Mqi87jnEYSKksRs7Ja++UKKS1nAqotdRfIrc3B6N2GYshGl/Ontu3IWy LXU4mFR6l9RG5qH6ubiZDKHU8FuF/tzUNsmRD11mZ8A1kW3x3Sq6q6r8ARiqBWqFS5iq3w7cVcPqO stMdsYrOHkCb43z5imXlK8pVHesrk76T9jFr9Lj5g4RVFUxPkLuDQGYsDDJbz6GJ+B/unPeTBAsDs A9h/cDhcKcIq7K+6V74nzw124GQk4KOl0APGiEa2s/tO//zpJo5iMjOKpNOwsbdo132TDRWtsbu0M FmUWPVSKg==; Received: from dvhart by bombadil.infradead.org with local (Exim 4.89 #1 (Red Hat Linux)) id 1epiJe-00067b-Av; Sat, 24 Feb 2018 22:29:14 +0000 Date: Sat, 24 Feb 2018 14:29:11 -0800 From: Darren Hart To: Mario.Limonciello@dell.com Cc: andriy.shevchenko@linux.intel.com, md@linux.it, pali.rohar@gmail.com, platform-driver-x86@vger.kernel.org Subject: Re: dell_smbios in 4.15 and keyboard backlight Message-ID: <20180224222911.GC31352@fury> References: <20180223133330.GA12066@bongo.bofh.it> <20180223190615.GA23961@bongo.bofh.it> <37740d49c7404fae824ff075fb87fbe9@ausx13mpc120.AMER.DELL.COM> <1519414856.10722.131.camel@linux.intel.com> <4882553904ef48da9b12799ed7a7100c@ausx13mpc120.AMER.DELL.COM> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4882553904ef48da9b12799ed7a7100c@ausx13mpc120.AMER.DELL.COM> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Feb 23, 2018 at 07:53:08PM +0000, Mario.Limonciello@dell.com wrote: > > > > -----Original Message----- > > From: Andy Shevchenko [mailto:andriy.shevchenko@linux.intel.com] > > Sent: Friday, February 23, 2018 1:41 PM > > To: Limonciello, Mario ; md@linux.it; > > dvhart@infradead.org > > Cc: pali.rohar@gmail.com; platform-driver-x86@vger.kernel.org > > Subject: Re: dell_smbios in 4.15 and keyboard backlight > > > > On Fri, 2018-02-23 at 19:19 +0000, Mario.Limonciello@dell.com wrote: > > > > -----Original Message----- > > > > From: Marco d'Itri [mailto:md@linux.it] > > > > Sent: Friday, February 23, 2018 1:06 PM > > > > To: Limonciello, Mario > > > > Cc: pali.rohar@gmail.com > > > > Subject: Re: dell_smbios in 4.15 and keyboard backlight > > > > > > > > On Feb 23, Mario Limonciello wrote: > > > > > > > > > Can you please email me on mario.limonciello@dell.com for this > > > > > topic? > > > > > > > > > > I would be interested to know do you have dell-smbios-smm or > > > > > dell-smbios-wmi not loading or compiling? > > > > > > > > Oops... The new modules have not been enabled yet by the Debian > > > > kernel > > > > team, so this explains why I could not find them. > > > > Thank you for your help, I will get back to you if I will still have > > > > troubles with the new kernel. > > > > > > > > > > If you don't mind I'm going to CC this to the mailing list for > > > discussion. I think > > > you identified a valid config problem. > > > > > > Andy, Darren, > > > > > > Marco (CC'ed) privately emailed Pali and I to discuss an issue that > > > dell-laptop > > > wasn't working properly for him and dell-smbios couldn't find a > > > backend. > > > > > > I thought at first it was an issue of the race condition recently > > > discussed but > > > it's actually a case that the distro kernel he's using compiled: > > > > > > DELL_SMBIOS > > > DELL_LAPTOP > > > > > > But didn't select DELL_SMBIOS_WMI or DELL_SMBIOS_SMM. > > > > Distros have to enable whatever they want to. > At least in this instance I'd hypothesize it's because these are new config > options that default to off. > > They probably had DELL_SMBIOS enabled before and carried that forward > But there was nothing to transition them to make them turn on > DELL_SMBIOS_WMI or DELL_SMBIOS_SMM. > > > > > Can it be the Dell model, that survives w/o one of above or even both? > > The design as it exists to day is that dell-laptop needs dell-smbios but > dell-smbios won't run unless it has a backend selected. > > > > > > I remember hypothesizing about this with one of the earlier versions > > > of the > > > patch series but the decision was to just hide config DELL_SMBIOS as > > > an invisible > > > tristate. > > > > > > > Because this is a real problem happening I think we need something > > > like this: > > > > > > diff --git a/drivers/platform/x86/Kconfig > > > b/drivers/platform/x86/Kconfig > > > index 9a8f964..f2f548b 100644 > > > --- a/drivers/platform/x86/Kconfig > > > +++ b/drivers/platform/x86/Kconfig > > > @@ -107,6 +107,7 @@ config ASUS_LAPTOP > > > > > > config DELL_SMBIOS > > > tristate > > > + depends on DELL_SMBIOS_WMI || DELL_SMBIOS_SMM > > > > This will simple not work. > You're right, I tried it and got this: At least one problem with this is that DELL_LAPTOP "selects" DELL_SMBIOS. We only "select" trivial CONFIG options without user selectable dependencies - typically without a prompt, as is the case with DELL_SMBIOS. So, the real dependency here is for DELL_LAPTOP, which requires one of DELL_SMBIOS_WMI or DELL_SMBIOS_SMM. I don't think we want the user to have to pick one of these BEFORE they can enable DELL_LAPTOP. The current situation is a bit weird: DELL_LAPTOP selects DELL_SMBIOS DELL_SMBIOS_(WMI|SMM) select DELL_SMBIOS But if we add the needful dependency, without WMI or SMM, DELL_LAPTOP doesn't appear. > warning: (DELL_SMBIOS_WMI && DELL_SMBIOS_SMM && DELL_LAPTOP && DELL_WMI) selects DELL_SMBIOS which has unmet direct dependencies (X86 && X86_PLATFORM_DEVICES && (DELL_SMBIOS_WMI || DELL_SMBIOS_SMM)) > warning: (DELL_SMBIOS_WMI && DELL_SMBIOS_SMM && DELL_LAPTOP && DELL_WMI) selects DELL_SMBIOS which has unmet direct dependencies (X86 && X86_PLATFORM_DEVICES && (DELL_SMBIOS_WMI || DELL_SMBIOS_SMM)) > > but it still let me go forward. > > Something like this maybe then to not let them even try to run dell-smbios? > > diff --git a/drivers/platform/x86/dell-smbios.c b/drivers/platform/x86/dell-smbios.c > index 8541cde..71489fe 100644 > --- a/drivers/platform/x86/dell-smbios.c > +++ b/drivers/platform/x86/dell-smbios.c > @@ -556,6 +556,11 @@ static int __init dell_smbios_init(void) > const struct dmi_device *valid; > int ret; > > +#if !defined(CONFIG_DELL_SMBIOS_WMI) && !defined(CONFIG_DELL_SMBIOS_SMM) > + pr_err("Missing SMBIOS backend."); > + return -ENODEV; > +#endif > +] If we don't specify the dependency in the Kconfig this is an option... although the user gets warned much later in the process than I think we'd like. Another option would be to make a Dell Laptop menu option, which makes it clear there is *something* there, and populate with Dell Laptop Extras Dell SMBIOS WMI calling interface (WMI | SMM Required) Dell SMBIOS SMM calling interface (WMI | SMM Required) Dell WMI notifications Dell Latitude freefall driver (ACPI SMO88XX) Dell Airplane Mode Switch driver I think users might find this hierarchy useful anyway. By Making the menuentry default to n, we satisfy Linus' concern, and we can also make Dell Laptop Extras depend on DELL_SMBIOS_WMI || DELL_SMBIOS_SMM, and make it and one of them default to M. Maybe something like: From a178faac18684ff216979fe151b6c0bbe1c8c83f Mon Sep 17 00:00:00 2001 Message-Id: From: "Darren Hart (VMware)" Date: Sat, 24 Feb 2018 14:22:30 -0800 Subject: [PATCH] platform/x86: Create Dell Laptop menuconfig The current dependency mapping for: A DELL_LAPTOP B DELL_SMBIOS C DELL_SMBIOS_WMI D DELL_SMBIOS_SMM Is non-intuitive and leads to accidental misconfiguration. Because A depends on either C | D to function, but we can't default them to m or y per Linus' recent comments [1], A will be hidden unless one or the other is enabled. Rather than ask the user to make than non-intuitive leap, create a menuconfig entry for all Dell laptop drivers, which defaults to n, satisfying Linus' concerns, while at the same time making it obvious that there are things to enable for Dell Laptops. This also makes it possible to set default to m for DELL_LAPTOP and DELL_SMBIOS_WMI, which is the preferred configuration going forward. These will be n unless the user explicitly enables the dell laptop menu. 1. https://lkml.org/lkml/2017/11/18/257 Signed-off-by: Darren Hart (VMware) --- drivers/platform/x86/Kconfig | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index bc66a31..001f983 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig @@ -105,11 +105,22 @@ config ASUS_LAPTOP If you have an ACPI-compatible ASUS laptop, say Y or M here. +menuconfig DELL_LAPTOP_EXTRAS + bool "Dell Laptop Specific Device Drivers" + default n + ---help--- + Say Y here to get to see options for Dell Laptop specific device drivers + This option alone does not add any kernel code. + + If you say N, all options in this submenu will be skipped and disabled. + +if DELL_LAPTOP_EXTRAS config DELL_SMBIOS tristate config DELL_SMBIOS_WMI tristate "Dell SMBIOS calling interface (WMI implementation)" + default m depends on ACPI_WMI select DELL_WMI_DESCRIPTOR select DELL_SMBIOS @@ -135,12 +146,13 @@ config DELL_SMBIOS_SMM config DELL_LAPTOP tristate "Dell Laptop Extras" + default m depends on DMI depends on BACKLIGHT_CLASS_DEVICE depends on ACPI_VIDEO || ACPI_VIDEO = n depends on RFKILL || RFKILL = n depends on SERIO_I8042 - select DELL_SMBIOS + depends on DELL_SMBIOS_WMI || DELL_SMBIOS_SMM select POWER_SUPPLY select LEDS_CLASS select NEW_LEDS @@ -212,7 +224,7 @@ config DELL_RBTN To compile this driver as a module, choose M here: the module will be called dell-rbtn. - +endif # DELL_LAPTOP_EXTRAS config FUJITSU_LAPTOP tristate "Fujitsu Laptop Extras"