diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-07-15 01:19:11 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-07-15 01:19:11 -0400 |
commit | 80f76319634fc62befd440b328042dbd54e3b6f8 (patch) | |
tree | e786c2ca89641d38ca5ea90a7a44b2edf57ade14 | |
parent | 241903641111803807c90016866d88d7ef8c9347 (diff) | |
parent | 7a1a47ce35821b40f5b2ce46379ba14393bc3873 (diff) |
Merge tag 'stm-for-greg-20160714' of git://git.kernel.org/pub/scm/linux/kernel/git/ash/stm into char-misc-next
Alexander writes:
intel_th: Fixes -t://git.kernel.org/pub/scm/linux/kernel/git/ash/stm.git
tags/stm-for-greg-20160714
stable
These are:
* a fix for a modprobe time deadlock
* a new PCI ID for Kaby Lake PCH-H
-rw-r--r-- | drivers/hwtracing/intel_th/core.c | 35 | ||||
-rw-r--r-- | drivers/hwtracing/intel_th/intel_th.h | 3 | ||||
-rw-r--r-- | drivers/hwtracing/intel_th/pci.c | 5 |
3 files changed, 42 insertions, 1 deletions
diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c index fdd17636d109..6f0a51a2c6ec 100644 --- a/drivers/hwtracing/intel_th/core.c +++ b/drivers/hwtracing/intel_th/core.c | |||
@@ -490,6 +490,38 @@ static struct intel_th_subdevice { | |||
490 | }, | 490 | }, |
491 | }; | 491 | }; |
492 | 492 | ||
493 | #ifdef CONFIG_MODULES | ||
494 | static void __intel_th_request_hub_module(struct work_struct *work) | ||
495 | { | ||
496 | struct intel_th *th = container_of(work, struct intel_th, | ||
497 | request_module_work); | ||
498 | |||
499 | request_module("intel_th_%s", th->hub->name); | ||
500 | } | ||
501 | |||
502 | static int intel_th_request_hub_module(struct intel_th *th) | ||
503 | { | ||
504 | INIT_WORK(&th->request_module_work, __intel_th_request_hub_module); | ||
505 | schedule_work(&th->request_module_work); | ||
506 | |||
507 | return 0; | ||
508 | } | ||
509 | |||
510 | static void intel_th_request_hub_module_flush(struct intel_th *th) | ||
511 | { | ||
512 | flush_work(&th->request_module_work); | ||
513 | } | ||
514 | #else | ||
515 | static inline int intel_th_request_hub_module(struct intel_th *th) | ||
516 | { | ||
517 | return -EINVAL; | ||
518 | } | ||
519 | |||
520 | static inline void intel_th_request_hub_module_flush(struct intel_th *th) | ||
521 | { | ||
522 | } | ||
523 | #endif /* CONFIG_MODULES */ | ||
524 | |||
493 | static int intel_th_populate(struct intel_th *th, struct resource *devres, | 525 | static int intel_th_populate(struct intel_th *th, struct resource *devres, |
494 | unsigned int ndevres, int irq) | 526 | unsigned int ndevres, int irq) |
495 | { | 527 | { |
@@ -560,7 +592,7 @@ static int intel_th_populate(struct intel_th *th, struct resource *devres, | |||
560 | /* need switch driver to be loaded to enumerate the rest */ | 592 | /* need switch driver to be loaded to enumerate the rest */ |
561 | if (subdev->type == INTEL_TH_SWITCH && !req) { | 593 | if (subdev->type == INTEL_TH_SWITCH && !req) { |
562 | th->hub = thdev; | 594 | th->hub = thdev; |
563 | err = request_module("intel_th_%s", subdev->name); | 595 | err = intel_th_request_hub_module(th); |
564 | if (!err) | 596 | if (!err) |
565 | req++; | 597 | req++; |
566 | } | 598 | } |
@@ -683,6 +715,7 @@ void intel_th_free(struct intel_th *th) | |||
683 | { | 715 | { |
684 | int i; | 716 | int i; |
685 | 717 | ||
718 | intel_th_request_hub_module_flush(th); | ||
686 | for (i = 0; i < TH_SUBDEVICE_MAX; i++) | 719 | for (i = 0; i < TH_SUBDEVICE_MAX; i++) |
687 | if (th->thdev[i] != th->hub) | 720 | if (th->thdev[i] != th->hub) |
688 | intel_th_device_remove(th->thdev[i]); | 721 | intel_th_device_remove(th->thdev[i]); |
diff --git a/drivers/hwtracing/intel_th/intel_th.h b/drivers/hwtracing/intel_th/intel_th.h index 20f57aa4d8f5..4c195786bf1f 100644 --- a/drivers/hwtracing/intel_th/intel_th.h +++ b/drivers/hwtracing/intel_th/intel_th.h | |||
@@ -208,6 +208,9 @@ struct intel_th { | |||
208 | 208 | ||
209 | int id; | 209 | int id; |
210 | int major; | 210 | int major; |
211 | #ifdef CONFIG_MODULES | ||
212 | struct work_struct request_module_work; | ||
213 | #endif /* CONFIG_MODULES */ | ||
211 | #ifdef CONFIG_INTEL_TH_DEBUG | 214 | #ifdef CONFIG_INTEL_TH_DEBUG |
212 | struct dentry *dbg; | 215 | struct dentry *dbg; |
213 | #endif | 216 | #endif |
diff --git a/drivers/hwtracing/intel_th/pci.c b/drivers/hwtracing/intel_th/pci.c index 5e25c7eb31d3..0bba3842336e 100644 --- a/drivers/hwtracing/intel_th/pci.c +++ b/drivers/hwtracing/intel_th/pci.c | |||
@@ -80,6 +80,11 @@ static const struct pci_device_id intel_th_pci_id_table[] = { | |||
80 | PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x1a8e), | 80 | PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x1a8e), |
81 | .driver_data = (kernel_ulong_t)0, | 81 | .driver_data = (kernel_ulong_t)0, |
82 | }, | 82 | }, |
83 | { | ||
84 | /* Kaby Lake PCH-H */ | ||
85 | PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa2a6), | ||
86 | .driver_data = (kernel_ulong_t)0, | ||
87 | }, | ||
83 | { 0 }, | 88 | { 0 }, |
84 | }; | 89 | }; |
85 | 90 | ||