RE: [PATCH v3] Add driver to force WMI Thunderbolt controller power status

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Lukas Wunner [mailto:lukas@xxxxxxxxx]
> Sent: Thursday, September 14, 2017 4:14 AM
> To: Limonciello, Mario <Mario_Limonciello@xxxxxxxx>
> Cc: dvhart@xxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; platform-driver-
> x86@xxxxxxxxxxxxxxx; hughsient@xxxxxxxxx; yehezkelshb@xxxxxxxxx;
> mika.westerberg@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH v3] Add driver to force WMI Thunderbolt controller power
> status
> 
> On Thu, Sep 14, 2017 at 06:42:03AM +0000, Mario.Limonciello@xxxxxxxx wrote:
> > > On Fri, Sep 08, 2017 at 10:23:11AM -0500, Mario Limonciello wrote:
> > > > +static const struct wmi_device_id intel_wmi_thunderbolt_id_table[] = {
> > > > +	{ .guid_string = INTEL_WMI_THUNDERBOLT_GUID },
> > > > +	{ },
> > > > +};
> > >
> > > I'm not familiar with WMI, but don't you need a MODULE_DEVICE_TABLE here?
> > > How does user space know which module to load upon receiving the uevent?
> >
> > Some macros for WMI bus devices.
> >
> https://github.com/torvalds/linux/blob/e0f25a3f2d052e36ff67a9b4db835c3e27e9
> 50d8/include/linux/wmi.h#L55
> > https://github.com/torvalds/linux/blob/master/include/linux/device.h#L1487
> 
> No, the init and exit hooks defined by this macro are executed
> *after* the module has been loaded.  The question was, how does
> the module get loaded in the first place?
> 
> 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.





[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux