Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751234AbdIOQhT (ORCPT ); Fri, 15 Sep 2017 12:37:19 -0400 Received: from esa3.dell-outbound.iphmx.com ([68.232.153.94]:53366 "EHLO esa3.dell-outbound.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750838AbdIOQhR (ORCPT ); Fri, 15 Sep 2017 12:37:17 -0400 From: X-LoopCount0: from 10.175.216.249 X-IronPort-AV: E=Sophos;i="5.42,397,1500958800"; d="scan'208";a="1153613123" X-DLP: DLP_GlobalPCIDSS To: , CC: , , , , Subject: RE: [PATCH v3] Add driver to force WMI Thunderbolt controller power status Thread-Topic: [PATCH v3] Add driver to force WMI Thunderbolt controller power status Thread-Index: AQHTLLSVuR5xYYUojUGNvKrrghaW4aKz7E6ggACBxwCAAApgoIAAVgiAgAEY44CAAEAJMA== Date: Fri, 15 Sep 2017 16:34:32 +0000 Message-ID: <614e119265294c4886bddf5c485f0c8c@ausx13mpc120.AMER.DELL.COM> References: <1504884191-16528-1-git-send-email-mario.limonciello@dell.com> <20170913172024.GA8782@wunner.de> <27f4070678744d0f80761a95579b4cd3@ausx13mpc120.AMER.DELL.COM> <20170914091416.GA28049@wunner.de> <58820c0d563845659030881cd44cfe97@ausx13mpc120.AMER.DELL.COM> <20170914145919.GU2477@lahna.fi.intel.com> <20170915074439.GA17644@wunner.de> In-Reply-To: <20170915074439.GA17644@wunner.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.143.242.75] Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v8FGbPmX010335 Content-Length: 1742 Lines: 36 > -----Original Message----- > From: Lukas Wunner [mailto:lukas@wunner.de] > Sent: Friday, September 15, 2017 2:45 AM > To: Mika Westerberg > Cc: Limonciello, Mario ; dvhart@infradead.org; > linux-kernel@vger.kernel.org; platform-driver-x86@vger.kernel.org; > hughsient@gmail.com; yehezkelshb@gmail.com > Subject: Re: [PATCH v3] Add driver to force WMI Thunderbolt controller power > status > > On Thu, Sep 14, 2017 at 05:59:19PM +0300, Mika Westerberg wrote: > > On Thu, Sep 14, 2017 at 02:52:27PM +0000, Mario.Limonciello@dell.com wrote: > > > > Looking at drivers/platform/x86/wmi.c:wmi_dev_uevent() it seems that > > > > a modalias consisting of "wmi:" followed by the GUID is sent to udevd. > > > > For udevd to then load the module, I suspect you need to add a > > > > MODULE_DEVICE_TABLE(wmi, ...) to your driver. > > > > > > Ah, you're looking for this code from the WMI bus driver: > > > > https://github.com/torvalds/linux/blob/master/drivers/platform/x86/wmi.c#L724 > > > > > > That happens when the bus is initialized. > > > > That's right you get the uevent and whatnot but Lucas means that if you > > don't have MODULE_DEVICE_TABLE(wmi, ...) in the driver, udev cannot load > > the module automatically when the device appears. > > Digging a bit deeper I notice the wmi drivers seem to solve this by > directly declaring a MODULE_ALIAS(), which is also present in Mario's > driver. Mario, have you tested if auto-loading works if compiled as > a module? If so, sorry for the noise. > Yes, I had tested that and that's why I was really baffled at needing to add MODULE_DEVICE_TABLE. I was going to dig further into this today, but I'm glad you figured it out.