From patchwork Tue Mar 13 06:32:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darren Hart X-Patchwork-Id: 10277835 X-Patchwork-Delegate: dvhart@infradead.org 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 4351260231 for ; Tue, 13 Mar 2018 06:32:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4260928DA7 for ; Tue, 13 Mar 2018 06:32:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3532828EA0; Tue, 13 Mar 2018 06:32:19 +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 016E928DA7 for ; Tue, 13 Mar 2018 06:32:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751462AbeCMGcQ (ORCPT ); Tue, 13 Mar 2018 02:32:16 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:54462 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751402AbeCMGcQ (ORCPT ); Tue, 13 Mar 2018 02:32:16 -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=V3xGHsgoL1V3iVsiuPGcvJ9xJXRWGw305vjeKx57SMY=; b=dypcooquEXFBzOX/HITX7Exgy UCoj7UMS2C3w3D5COJQCPsR/7fpU2/h5Ca06Ihi2OaglJmc/Yqk5nXkFqrA0V6CuSVshOq14e6fXz AqJMM+9PulCChPRqEHMEarZ/wXLksoxk4b9XU92FPlqk5qzK+xetSeTvnNavTYLpmEtNJ/SK1wK7B /S+OYvLFAXXc2A2g5lJrBnQyo5l9Fzcta0acRO/wOJTwqK6ajVWkB1AFqWZUMKsD6XQZGgwJmWsWh 5okcTNwpNa54B1d8Q4pSVjETidkjI0lC0dZcJZMMv1zioCffRPxJmR4+xP5XfEENN9gIpSX0rZoqb si1B3SiqA==; Received: from dvhart by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1evdTq-0001ZO-Mk; Tue, 13 Mar 2018 06:32:14 +0000 Date: Mon, 12 Mar 2018 23:32:13 -0700 From: Darren Hart To: Dominik Brodowski Cc: Mario.Limonciello@dell.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Dell Inc. XPS 13 9343/0TM99H fails to boot v4.16-rc5 Message-ID: <20180313063213.GA20710@localhost.localdomain> References: <20180312185357.GA1672@light.dominikbrodowski.net> <4cce64d16cab4d499dca9347c1a1f30c@ausx13mpc120.AMER.DELL.COM> <20180313055109.GA14542@light.dominikbrodowski.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180313055109.GA14542@light.dominikbrodowski.net> 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 Tue, Mar 13, 2018 at 06:51:09AM +0100, Dominik Brodowski wrote: > On Mon, Mar 12, 2018 at 10:42:01PM +0000, Mario.Limonciello@dell.com wrote: > > > > > > > -----Original Message----- > > > From: Dominik Brodowski [mailto:linux@dominikbrodowski.net] > > > Sent: Tuesday, March 13, 2018 2:54 AM > > > To: dvhart@infradead.org; Limonciello, Mario > > > Cc: platform-driver-x86@vger.kernel.org; linux-kernel@vger.kernel.org > > > Subject: Dell Inc. XPS 13 9343/0TM99H fails to boot v4.16-rc5 > > > > > > Mario, > > > > > > unfortunately, my Dell Inc. XPS 13 9343/0TM99H, BIOS A11 12/08/2016 fails to > > > boot v4.16-rc5. More exactly, I could bisect it down to commit 25d47027e10 > > > ("platform/x86: dell-smbios: Link all dell-smbios-* modules together"). > > > Usually, I have enabled > > > > > > CONFIG_SENSORS_DELL_SMM=y > > > CONFIG_DELL_SMBIOS=y > > > CONFIG_DELL_SMBIOS_WMI=y > > > CONFIG_DELL_SMBIOS_SMM=y > > > CONFIG_DELL_LAPTOP=y > > > CONFIG_DELL_WMI=y > > > CONFIG_DELL_WMI_DESCRIPTOR=y > > > # CONFIG_DELL_WMI_AIO is not set > > > # CONFIG_DELL_WMI_LED is not set > > > # CONFIG_DELL_SMO8800 is not set > > > # CONFIG_DELL_RBTN is not set > > > # CONFIG_DELL_RBU is not set > > > > > > For v4.16-rc5 to work, I need to manually disable DELL_SMBIOS_WMI: > > > > > > -CONFIG_DELL_SMBIOS_WMI=y > > > +# CONFIG_DELL_SMBIOS_WMI is not set > > > > > > Any ideas? > > > > > Dominick, > > > > Interesting. Can you please change CONFIG_DELL_SMBIOS to a module > > and see if that behavior persists? If it does, can you please blacklist it on > > the kernel command line and try to load it manually and share any > > backtrace? > > Mario, > > building and running it as a *module* works flawlessly. But that was > actually expected after a 'grep "initcall"' in drivers/platform/x86: > > As Darren pointed out, DELL_SMBIOS_WMI depends on ACPI_WMI, so probably > ACPI_WMI needs to be initialized first. However, the all-in-one > dell-smbios.o is run as subsys_initcall(), same as wmi.o > (subsys_initcall_sync() there). > > If both are built-ins, that means that dell-smbios.o is run first, and wmi.o > second. Changing dell-smbios.o to run at the later fs_initcall() level > instead lets me boot the kernel. HOWEVER: > > 1) Is there a reason why both the core and the dell-smbios-smm driver have > to run already at subsys_initcall() time? They did so previous to your > patch. Is it OK to defer these parts opf the all-in-one dell-smbios.o > to fs_initcall(), or even to the default device_initcall()? > > 2) dell-smbios-wmi depends on (well, selects) DELL_WMI_DESCRIPTOR. The > dell-smbios-wmi is running at the default device_initcall() time, but > (AFAICS) probably later than the initialization of dell-smbios-wmi.o. > May I presume that this poses no additional problem? Nice catch Dominik, There is one other caveat, which you'll find documented in dell-laptop.c, namely that dell-laptop needs to init after dell-rbtn (I'm starting to appreciate the monolithic thinkpad-acpi driver). We need things to init in this order (items on the same line have no dependency): 1. DCDBAS, ACPI_WMI 2. DELL_SMBIOS, DELL_RBTN 3. DELL_LAPTOP, DELL_WMI Currently: subsys_initcall: ACPI_WMI, DELL_SMBIOS module_init: DCDBAS, DELL_WMI late_initcall: DELL_LAPTOP From a quick naive glance, it appears as though we might be able to address this as follows: subsys_initcall: DCDBAS, ACPI_WMI module_init: DELL_SMBIOS, DELL_RBTN late_initcall: DELL_LAPTOP, DELL_WMI e.g. Totally untested... From 2dd1191593a46bf8fd1e5be8bbfb98b797e041f8 Mon Sep 17 00:00:00 2001 Message-Id: <2dd1191593a46bf8fd1e5be8bbfb98b797e041f8.1520922688.git.dvhart@infradead.org> From: "Darren Hart (VMware)" Date: Mon, 12 Mar 2018 23:28:00 -0700 Subject: [PATCH] platform/x86: Fix dell driver init order Update the initcall ordering to satisfy the following dependency ordering: 1. DCDBAS, ACPI_WMI 2. DELL_SMBIOS, DELL_RBTN 3. DELL_LAPTOP, DELL_WMI By assigning them to the following initcall levels: subsys_initcall: DCDBAS, ACPI_WMI module_init: DELL_SMBIOS, DELL_RBTN late_initcall: DELL_LAPTOP, DELL_WMI Cc: Dominik Brodowski Cc: Mario.Limonciello@dell.com Signed-off-by: Darren Hart (VMware) --- drivers/firmware/dcdbas.c | 2 +- drivers/platform/x86/dell-smbios-base.c | 2 +- drivers/platform/x86/dell-wmi.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/dcdbas.c b/drivers/firmware/dcdbas.c index c16600f..0bdea60 100644 --- a/drivers/firmware/dcdbas.c +++ b/drivers/firmware/dcdbas.c @@ -639,7 +639,7 @@ static void __exit dcdbas_exit(void) platform_driver_unregister(&dcdbas_driver); } -module_init(dcdbas_init); +subsys_initcall_sync(dcdbas_init); module_exit(dcdbas_exit); MODULE_DESCRIPTION(DRIVER_DESCRIPTION " (version " DRIVER_VERSION ")"); diff --git a/drivers/platform/x86/dell-smbios-base.c b/drivers/platform/x86/dell-smbios-base.c index 5bcf8a1..2485c80 100644 --- a/drivers/platform/x86/dell-smbios-base.c +++ b/drivers/platform/x86/dell-smbios-base.c @@ -637,7 +637,7 @@ static void __exit dell_smbios_exit(void) mutex_unlock(&smbios_mutex); } -subsys_initcall(dell_smbios_init); +module_init(dell_smbios_init); module_exit(dell_smbios_exit); MODULE_AUTHOR("Matthew Garrett "); diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c index 2c99274..8d10219 100644 --- a/drivers/platform/x86/dell-wmi.c +++ b/drivers/platform/x86/dell-wmi.c @@ -714,7 +714,7 @@ static int __init dell_wmi_init(void) return wmi_driver_register(&dell_wmi_driver); } -module_init(dell_wmi_init); +late_initcall(dell_wmi_init); static void __exit dell_wmi_exit(void) {