Procházet zdrojové kódy

eeepc-laptop: dmi blacklist to disable pci hotplug code

This is a short term workaround for Eeepc 1005HA.

refs: <http://bugzilla.kernel.org/show_bug.cgi?id=14570>

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
Corentin Chary před 15 roky
rodič
revize
10ae4b5663
1 změnil soubory, kde provedl 20 přidání a 5 odebrání
  1. 20 5
      drivers/platform/x86/eeepc-laptop.c

+ 20 - 5
drivers/platform/x86/eeepc-laptop.c

@@ -161,6 +161,7 @@ struct eeepc_laptop {
 	u32 cm_supported;		/* the control methods supported
 	u32 cm_supported;		/* the control methods supported
 					   by this BIOS */
 					   by this BIOS */
 	bool cpufv_disabled;
 	bool cpufv_disabled;
+	bool hotplug_disabled;
 	u16 event_count[128];		/* count for each event */
 	u16 event_count[128];		/* count for each event */
 
 
 	struct platform_device *platform_device;
 	struct platform_device *platform_device;
@@ -845,6 +846,9 @@ static int eeepc_rfkill_init(struct eeepc_laptop *eeepc)
 	if (result && result != -ENODEV)
 	if (result && result != -ENODEV)
 		goto exit;
 		goto exit;
 
 
+	if (eeepc->hotplug_disabled)
+		return 0;
+
 	result = eeepc_setup_pci_hotplug(eeepc);
 	result = eeepc_setup_pci_hotplug(eeepc);
 	/*
 	/*
 	 * If we get -EBUSY then something else is handling the PCI hotplug -
 	 * If we get -EBUSY then something else is handling the PCI hotplug -
@@ -1314,6 +1318,10 @@ static void eeepc_dmi_check(struct eeepc_laptop *eeepc)
 {
 {
 	const char *model;
 	const char *model;
 
 
+	model = dmi_get_system_info(DMI_PRODUCT_NAME);
+	if (!model)
+		return;
+
 	/*
 	/*
 	 * Blacklist for setting cpufv (cpu speed).
 	 * Blacklist for setting cpufv (cpu speed).
 	 *
 	 *
@@ -1333,17 +1341,24 @@ static void eeepc_dmi_check(struct eeepc_laptop *eeepc)
 	 * substring matching.  We don't want to affect the "701SD"
 	 * substring matching.  We don't want to affect the "701SD"
 	 * and "701SDX" models, because they do support S.H.E.
 	 * and "701SDX" models, because they do support S.H.E.
 	 */
 	 */
-
-	model = dmi_get_system_info(DMI_PRODUCT_NAME);
-	if (!model)
-		return;
-
 	if (strcmp(model, "701") == 0 || strcmp(model, "702") == 0) {
 	if (strcmp(model, "701") == 0 || strcmp(model, "702") == 0) {
 		eeepc->cpufv_disabled = true;
 		eeepc->cpufv_disabled = true;
 		pr_info("model %s does not officially support setting cpu "
 		pr_info("model %s does not officially support setting cpu "
 			"speed\n", model);
 			"speed\n", model);
 		pr_info("cpufv disabled to avoid instability\n");
 		pr_info("cpufv disabled to avoid instability\n");
 	}
 	}
+
+	/*
+	 * Blacklist for wlan hotplug
+	 *
+	 * Eeepc 1005HA doesn't work like others models and don't need the
+	 * hotplug code. In fact, current hotplug code seems to unplug another
+	 * device...
+	 */
+	if (strcmp(model, "1005HA") == 0) {
+		eeepc->hotplug_disabled = true;
+		pr_info("wlan hotplug disabled\n");
+	}
 }
 }
 
 
 static void cmsg_quirk(struct eeepc_laptop *eeepc, int cm, const char *name)
 static void cmsg_quirk(struct eeepc_laptop *eeepc, int cm, const char *name)