mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [QUEUED fixes v20160630 0/2] intel_th: Fixes for char-misc-linus
@ 2016-06-30 12:46 Alexander Shishkin
  2016-06-30 12:46 ` [QUEUED fixes v20160630 1/2] intel_th: Fix a deadlock in modprobing Alexander Shishkin
  2016-06-30 12:46 ` [QUEUED fixes v20160630 2/2] intel_th: pci: Add Kaby Lake PCH-H support Alexander Shishkin
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Shishkin @ 2016-06-30 12:46 UTC (permalink / raw)
  To: Greg KH; +Cc: laurent.fert, yann.fouassier, linux-kernel, Alexander Shishkin

Hi Greg,

Here's a fix to one annoying bug in the driver initialization and a
new PCI ID that I'd like to get into 4.7 and probably -stable. I'm
going to request-pull it to you unless somebody objects.

Alexander Shishkin (2):
  intel_th: Fix a deadlock in modprobing
  intel_th: pci: Add Kaby Lake PCH-H support

 drivers/hwtracing/intel_th/core.c     | 35 ++++++++++++++++++++++++++++++++++-
 drivers/hwtracing/intel_th/intel_th.h |  3 +++
 drivers/hwtracing/intel_th/pci.c      |  5 +++++
 3 files changed, 42 insertions(+), 1 deletion(-)

-- 
2.8.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [QUEUED fixes v20160630 1/2] intel_th: Fix a deadlock in modprobing
  2016-06-30 12:46 [QUEUED fixes v20160630 0/2] intel_th: Fixes for char-misc-linus Alexander Shishkin
@ 2016-06-30 12:46 ` Alexander Shishkin
  2016-06-30 12:46 ` [QUEUED fixes v20160630 2/2] intel_th: pci: Add Kaby Lake PCH-H support Alexander Shishkin
  1 sibling, 0 replies; 3+ messages in thread
From: Alexander Shishkin @ 2016-06-30 12:46 UTC (permalink / raw)
  To: Greg KH; +Cc: laurent.fert, yann.fouassier, linux-kernel, Alexander Shishkin

Driver initialization tries to request a hub (GTH) driver module from
its probe callback, resulting in a deadlock.

This patch solves the problem by adding a deferred work for requesting
the hub module.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
 drivers/hwtracing/intel_th/core.c     | 35 ++++++++++++++++++++++++++++++++++-
 drivers/hwtracing/intel_th/intel_th.h |  3 +++
 2 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c
index 1be543e8e4..0b112ae689 100644
--- a/drivers/hwtracing/intel_th/core.c
+++ b/drivers/hwtracing/intel_th/core.c
@@ -465,6 +465,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)
 {
@@ -535,7 +567,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++;
 		}
@@ -652,6 +684,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/drivers/hwtracing/intel_th/intel_th.h b/drivers/hwtracing/intel_th/intel_th.h
index 0df22e3067..0482848260 100644
--- a/drivers/hwtracing/intel_th/intel_th.h
+++ b/drivers/hwtracing/intel_th/intel_th.h
@@ -205,6 +205,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
-- 
2.8.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [QUEUED fixes v20160630 2/2] intel_th: pci: Add Kaby Lake PCH-H support
  2016-06-30 12:46 [QUEUED fixes v20160630 0/2] intel_th: Fixes for char-misc-linus Alexander Shishkin
  2016-06-30 12:46 ` [QUEUED fixes v20160630 1/2] intel_th: Fix a deadlock in modprobing Alexander Shishkin
@ 2016-06-30 12:46 ` Alexander Shishkin
  1 sibling, 0 replies; 3+ messages in thread
From: Alexander Shishkin @ 2016-06-30 12:46 UTC (permalink / raw)
  To: Greg KH; +Cc: laurent.fert, yann.fouassier, linux-kernel, Alexander Shishkin

This adds Intel(R) Trace Hub PCI ID for Kaby Lake PCH-H.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
 drivers/hwtracing/intel_th/pci.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/hwtracing/intel_th/pci.c b/drivers/hwtracing/intel_th/pci.c
index 5e25c7eb31..0bba384233 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[] = {
 		PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x1a8e),
 		.driver_data = (kernel_ulong_t)0,
 	},
+	{
+		/* Kaby Lake PCH-H */
+		PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa2a6),
+		.driver_data = (kernel_ulong_t)0,
+	},
 	{ 0 },
 };
 
-- 
2.8.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-30 12:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-30 12:46 [QUEUED fixes v20160630 0/2] intel_th: Fixes for char-misc-linus Alexander Shishkin
2016-06-30 12:46 ` [QUEUED fixes v20160630 1/2] intel_th: Fix a deadlock in modprobing Alexander Shishkin
2016-06-30 12:46 ` [QUEUED fixes v20160630 2/2] intel_th: pci: Add Kaby Lake PCH-H support Alexander Shishkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®