X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=src%2Fpatches%2Fsuse-2.6.27.31%2Fpatches.arch%2Facpi-dock-don-t-eval-_sta-on-every-show_docked-sysfs-read.patch;fp=src%2Fpatches%2Fsuse-2.6.27.31%2Fpatches.arch%2Facpi-dock-don-t-eval-_sta-on-every-show_docked-sysfs-read.patch;h=f1c4f9baa90f661517deefab32e445f3983a9b4a;hb=38e2b028de682e6c22e4249acadbdddd4d8b4b8a;hp=0000000000000000000000000000000000000000;hpb=3a87c0dd202ab6cd1546ce56fca50ef45f561e54;p=people%2Fpmueller%2Fipfire-2.x.git diff --git a/src/patches/suse-2.6.27.31/patches.arch/acpi-dock-don-t-eval-_sta-on-every-show_docked-sysfs-read.patch b/src/patches/suse-2.6.27.31/patches.arch/acpi-dock-don-t-eval-_sta-on-every-show_docked-sysfs-read.patch new file mode 100644 index 0000000000..f1c4f9baa9 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.arch/acpi-dock-don-t-eval-_sta-on-every-show_docked-sysfs-read.patch @@ -0,0 +1,47 @@ +From 1d672ef324e78a467603ef55aa4558cac9f895ba Mon Sep 17 00:00:00 2001 +From: Holger Macht +Date: Tue, 20 Jan 2009 12:18:24 +0100 +Subject: ACPI: dock: Don't eval _STA on every show_docked sysfs read + +From: Holger Macht + +commit fc5a9f8841ee87d93376ada5d73117d4d6a373ea upstream. + +Some devices trigger a DEVICE_CHECK on every evalutation of _STA. This +can also be seen in commit 8b59560a3baf2e7c24e0fb92ea5d09eca92805db +(ACPI: dock: avoid check _STA method). If an undock is processed, the +dock driver sends a uevent and userspace might read the show_docked +property in sysfs. This causes an evaluation of _STA of the particular +device which causes the dock driver to immediately dock again. + +In any case, evaluation of _STA (show_docked) does not necessarily mean +that we are docked, so check with the internal device structure. + +http://bugzilla.kernel.org/show_bug.cgi?id=12360 + +Signed-off-by: Holger Macht +Signed-off-by: Len Brown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/dock.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/acpi/dock.c ++++ b/drivers/acpi/dock.c +@@ -854,8 +854,14 @@ fdd_out: + static ssize_t show_docked(struct device *dev, + struct device_attribute *attr, char *buf) + { +- return snprintf(buf, PAGE_SIZE, "%d\n", dock_present(dock_station)); ++ struct acpi_device *tmp; + ++ struct dock_station *dock_station = *((struct dock_station **) ++ dev->platform_data); ++ ++ if (ACPI_SUCCESS(acpi_bus_get_device(dock_station->handle, &tmp))) ++ return snprintf(buf, PAGE_SIZE, "1\n"); ++ return snprintf(buf, PAGE_SIZE, "0\n"); + } + static DEVICE_ATTR(docked, S_IRUGO, show_docked, NULL); +