diff options
Diffstat (limited to 'kernel/drivers/hwtracing')
-rw-r--r-- | kernel/drivers/hwtracing/intel_th/core.c | 35 | ||||
-rw-r--r-- | kernel/drivers/hwtracing/intel_th/intel_th.h | 3 | ||||
-rw-r--r-- | kernel/drivers/hwtracing/intel_th/pci.c | 5 | ||||
-rw-r--r-- | kernel/drivers/hwtracing/stm/Kconfig | 1 |
4 files changed, 43 insertions, 1 deletions
diff --git a/kernel/drivers/hwtracing/intel_th/core.c b/kernel/drivers/hwtracing/intel_th/core.c index 165d3001c..c6ec5c62b 100644 --- a/kernel/drivers/hwtracing/intel_th/core.c +++ b/kernel/drivers/hwtracing/intel_th/core.c @@ -419,6 +419,38 @@ static struct intel_th_subdevice { }, }; +#ifdef CONFIG_MODULES +static void __intel_th_request_hub_module(struct work_struct *work) +{ + struct intel_th *th = container_of(work, struct intel_th, + request_module_work); + + request_module("intel_th_%s", th->hub->name); +} + +static int intel_th_request_hub_module(struct intel_th *th) +{ + INIT_WORK(&th->request_module_work, __intel_th_request_hub_module); + schedule_work(&th->request_module_work); + + return 0; +} + +static void intel_th_request_hub_module_flush(struct intel_th *th) +{ + flush_work(&th->request_module_work); +} +#else +static inline int intel_th_request_hub_module(struct intel_th *th) +{ + return -EINVAL; +} + +static inline void intel_th_request_hub_module_flush(struct intel_th *th) +{ +} +#endif /* CONFIG_MODULES */ + static int intel_th_populate(struct intel_th *th, struct resource *devres, unsigned int ndevres, int irq) { @@ -488,7 +520,7 @@ static int intel_th_populate(struct intel_th *th, struct resource *devres, /* need switch driver to be loaded to enumerate the rest */ if (subdev->type == INTEL_TH_SWITCH && !req) { th->hub = thdev; - err = request_module("intel_th_%s", subdev->name); + err = intel_th_request_hub_module(th); if (!err) req++; } @@ -603,6 +635,7 @@ void intel_th_free(struct intel_th *th) { int i; + intel_th_request_hub_module_flush(th); for (i = 0; i < TH_SUBDEVICE_MAX; i++) if (th->thdev[i] != th->hub) intel_th_device_remove(th->thdev[i]); diff --git a/kernel/drivers/hwtracing/intel_th/intel_th.h b/kernel/drivers/hwtracing/intel_th/intel_th.h index 57fd72b20..d03a6cd1c 100644 --- a/kernel/drivers/hwtracing/intel_th/intel_th.h +++ b/kernel/drivers/hwtracing/intel_th/intel_th.h @@ -197,6 +197,9 @@ struct intel_th { int id; int major; +#ifdef CONFIG_MODULES + struct work_struct request_module_work; +#endif /* CONFIG_MODULES */ #ifdef CONFIG_INTEL_TH_DEBUG struct dentry *dbg; #endif diff --git a/kernel/drivers/hwtracing/intel_th/pci.c b/kernel/drivers/hwtracing/intel_th/pci.c index 641e87936..d57a2f75d 100644 --- a/kernel/drivers/hwtracing/intel_th/pci.c +++ b/kernel/drivers/hwtracing/intel_th/pci.c @@ -67,6 +67,11 @@ static const struct pci_device_id intel_th_pci_id_table[] = { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa126), .driver_data = (kernel_ulong_t)0, }, + { + /* Kaby Lake PCH-H */ + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa2a6), + .driver_data = (kernel_ulong_t)0, + }, { 0 }, }; diff --git a/kernel/drivers/hwtracing/stm/Kconfig b/kernel/drivers/hwtracing/stm/Kconfig index 83e9f591a..e7a348807 100644 --- a/kernel/drivers/hwtracing/stm/Kconfig +++ b/kernel/drivers/hwtracing/stm/Kconfig @@ -1,6 +1,7 @@ config STM tristate "System Trace Module devices" select CONFIGFS_FS + select SRCU help A System Trace Module (STM) is a device exporting data in System Trace Protocol (STP) format as defined by MIPI STP standards. |