[PATCH 3/3] PCI Hotplug: workaround for Thunderbolt on Intel DZ77RE-75K motherboard

From: Kirill A. Shutemov
Date: Thu Dec 13 2012 - 10:31:12 EST


From: "Kirill A. Shutemov" <kirill.shutemov@xxxxxxxxxxxxxxx>

BIOS on Intel DZ77RE-75K motherboard notifies OS about Thunderbolt
hotplug before devices behind Thunderbolt are ready to be enumerated.

Let's delay enumeration by 2 seconds.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>
---
drivers/pci/hotplug/acpiphp_glue.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index 1a2b3ca..165987a 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -49,6 +49,7 @@
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/acpi.h>
+#include <linux/dmi.h>

#include "../pci.h"
#include "acpiphp.h"
@@ -1327,6 +1328,19 @@ out:
static void handle_hotplug_event_bridge(acpi_handle handle, u32 type,
void *context)
{
+ unsigned long delay = 0;
+ const char *board_name;
+
+ board_name = dmi_get_system_info(DMI_BOARD_NAME);
+ /*
+ * BIOS on Intel DZ77RE-75K motherboard notifies OS about Thunderbolt
+ * hotplug before devices behind Thunderbolt are ready to be
+ * enumerated.
+ * Let's delay enumeration by 2 seconds.
+ */
+ if (board_name && !strcmp(board_name, "DZ77RE-75K"))
+ delay = 2 * HZ;
+
/*
* Currently the code adds all hotplug events to the kacpid_wq
* queue when it should add hotplug events to the kacpi_hotplug_wq.
@@ -1336,7 +1350,7 @@ static void handle_hotplug_event_bridge(acpi_handle handle, u32 type,
* don't deadlock on hotplug actions.
*/
alloc_acpiphp_hp_work(handle, type, context,
- _handle_hotplug_event_bridge, 0);
+ _handle_hotplug_event_bridge, delay);
}

static void _handle_hotplug_event_func(struct work_struct *work)
--
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/