From 797c42073794716d95576801ea6e7365121fa68e Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 9 Feb 2009 09:25:21 -0800 Subject: [PATCH] .28 patches --- ...tness-behavior-on-thinkpad-sl-series.patch | 70 +++++++++++ ...pw2200-fix-scanning-while-associated.patch | 110 ++++++++++++++++++ queue-2.6.28/series | 3 + ...from-bio-error-in-xfs_buf_bio_end_io.patch | 33 ++++++ 4 files changed, 216 insertions(+) create mode 100644 queue-2.6.28/acpi-video-fix-reversed-brightness-behavior-on-thinkpad-sl-series.patch create mode 100644 queue-2.6.28/ipw2200-fix-scanning-while-associated.patch create mode 100644 queue-2.6.28/xfs-set-b_error-from-bio-error-in-xfs_buf_bio_end_io.patch diff --git a/queue-2.6.28/acpi-video-fix-reversed-brightness-behavior-on-thinkpad-sl-series.patch b/queue-2.6.28/acpi-video-fix-reversed-brightness-behavior-on-thinkpad-sl-series.patch new file mode 100644 index 00000000000..8f8854a0b80 --- /dev/null +++ b/queue-2.6.28/acpi-video-fix-reversed-brightness-behavior-on-thinkpad-sl-series.patch @@ -0,0 +1,70 @@ +From 935e5f290ec1eb0f1c15004421f5fd3154380fd5 Mon Sep 17 00:00:00 2001 +From: Zhang Rui +Date: Thu, 11 Dec 2008 16:24:52 -0500 +Subject: ACPI: video: Fix reversed brightness behavior on ThinkPad SL series + +From: Zhang Rui + +commit 935e5f290ec1eb0f1c15004421f5fd3154380fd5 upstream. + +Section B.6.2 of ACPI 3.0b specification that defines _BCL method +doesn't require the brightness levels returned to be sorted. +At least ThinkPad SL300 (and probably all IdeaPads) returns the +array reversed (i.e. bightest levels have lowest indexes), which +causes the brightness management behave in completely reversed +manner on these machines (brightness increases when the laptop is +idle, while the display dims when used). + +Sorting the array by brightness level values after reading the list +fixes the issue. + +http://bugzilla.kernel.org/show_bug.cgi?id=12037 + +Signed-off-by: Zhang Rui +Tested-by: Lubomir Rintel +Signed-off-by: Len Brown +Signed-off-by: Thomas Renninger +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/video.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +--- a/drivers/acpi/video.c ++++ b/drivers/acpi/video.c +@@ -36,6 +36,7 @@ + #include + #include + #include ++#include + #include + + #include +@@ -631,6 +632,16 @@ acpi_video_bus_DOS(struct acpi_video_bus + } + + /* ++ * Simple comparison function used to sort backlight levels. ++ */ ++ ++static int ++acpi_video_cmp_level(const void *a, const void *b) ++{ ++ return *(int *)a - *(int *)b; ++} ++ ++/* + * Arg: + * device : video output device (LCD, CRT, ..) + * +@@ -681,6 +692,10 @@ acpi_video_init_brightness(struct acpi_v + count++; + } + ++ /* don't sort the first two brightness levels */ ++ sort(&br->levels[2], count - 2, sizeof(br->levels[2]), ++ acpi_video_cmp_level, NULL); ++ + if (count < 2) + goto out_free_levels; + diff --git a/queue-2.6.28/ipw2200-fix-scanning-while-associated.patch b/queue-2.6.28/ipw2200-fix-scanning-while-associated.patch new file mode 100644 index 00000000000..a2a1c82e96f --- /dev/null +++ b/queue-2.6.28/ipw2200-fix-scanning-while-associated.patch @@ -0,0 +1,110 @@ +From 14a4dfe2ff8c353f59ae8324059ded1cfe22c7d9 Mon Sep 17 00:00:00 2001 +From: Helmut Schaa +Date: Wed, 10 Dec 2008 13:17:26 +0100 +Subject: ipw2200: fix scanning while associated + +From: Helmut Schaa + +commit 14a4dfe2ff8c353f59ae8324059ded1cfe22c7d9 upstream. + +This patch fixes sporadic firmware restarts when scanning while associated. + +The firmware will quietly cancel a scan (while associated) if the dwell time +for a channel to be scanned is larger than the time it may stay away from the +operating channel (because of DTIM catching). Unfortunately the driver is not +notified about the canceled scan and therefore the scan watchdog timeout will +be hit and the driver causes a firmware restart which results in +disassociation. This mainly happens on passive channels which use a dwell time +of 120 whereas a typical beacon interval is around 100. + +The patch changes the dwell time for passive channels to be slightly smaller +than the actual beacon interval to work around the firmware issue. Furthermore +the number of allowed beacon misses is increased from one to three as otherwise +most scans (while associated) won't complete successfully. + +However scanning while associated will still fail in corner cases such as a +beacon intervals below 30. + +Signed-off-by: Helmut Schaa +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/ipw2200.c | 28 ++++++++++++++++++++++------ + drivers/net/wireless/ipw2200.h | 1 + + 2 files changed, 23 insertions(+), 6 deletions(-) + +--- a/drivers/net/wireless/ipw2200.c ++++ b/drivers/net/wireless/ipw2200.c +@@ -4347,7 +4347,8 @@ static void ipw_handle_missed_beacon(str + return; + } + +- if (priv->status & STATUS_SCANNING) { ++ if (priv->status & STATUS_SCANNING && ++ missed_count > IPW_MB_SCAN_CANCEL_THRESHOLD) { + /* Stop scan to keep fw from getting + * stuck (only if we aren't roaming -- + * otherwise we'll never scan more than 2 or 3 +@@ -6277,6 +6278,20 @@ static void ipw_add_scan_channels(struct + } + } + ++static int ipw_passive_dwell_time(struct ipw_priv *priv) ++{ ++ /* staying on passive channels longer than the DTIM interval during a ++ * scan, while associated, causes the firmware to cancel the scan ++ * without notification. Hence, don't stay on passive channels longer ++ * than the beacon interval. ++ */ ++ if (priv->status & STATUS_ASSOCIATED ++ && priv->assoc_network->beacon_interval > 10) ++ return priv->assoc_network->beacon_interval - 10; ++ else ++ return 120; ++} ++ + static int ipw_request_scan_helper(struct ipw_priv *priv, int type, int direct) + { + struct ipw_scan_request_ext scan; +@@ -6320,16 +6335,16 @@ static int ipw_request_scan_helper(struc + scan.full_scan_index = cpu_to_le32(ieee80211_get_scans(priv->ieee)); + + if (type == IW_SCAN_TYPE_PASSIVE) { +- IPW_DEBUG_WX("use passive scanning\n"); +- scan_type = IPW_SCAN_PASSIVE_FULL_DWELL_SCAN; ++ IPW_DEBUG_WX("use passive scanning\n"); ++ scan_type = IPW_SCAN_PASSIVE_FULL_DWELL_SCAN; + scan.dwell_time[IPW_SCAN_PASSIVE_FULL_DWELL_SCAN] = +- cpu_to_le16(120); ++ cpu_to_le16(ipw_passive_dwell_time(priv)); + ipw_add_scan_channels(priv, &scan, scan_type); + goto send_request; + } + + /* Use active scan by default. */ +- if (priv->config & CFG_SPEED_SCAN) ++ if (priv->config & CFG_SPEED_SCAN) + scan.dwell_time[IPW_SCAN_ACTIVE_BROADCAST_SCAN] = + cpu_to_le16(30); + else +@@ -6339,7 +6354,8 @@ static int ipw_request_scan_helper(struc + scan.dwell_time[IPW_SCAN_ACTIVE_BROADCAST_AND_DIRECT_SCAN] = + cpu_to_le16(20); + +- scan.dwell_time[IPW_SCAN_PASSIVE_FULL_DWELL_SCAN] = cpu_to_le16(120); ++ scan.dwell_time[IPW_SCAN_PASSIVE_FULL_DWELL_SCAN] = ++ cpu_to_le16(ipw_passive_dwell_time(priv)); + scan.dwell_time[IPW_SCAN_ACTIVE_DIRECT_SCAN] = cpu_to_le16(20); + + #ifdef CONFIG_IPW2200_MONITOR +--- a/drivers/net/wireless/ipw2200.h ++++ b/drivers/net/wireless/ipw2200.h +@@ -244,6 +244,7 @@ enum connection_manager_assoc_states { + #define HOST_NOTIFICATION_S36_MEASUREMENT_REFUSED 31 + + #define HOST_NOTIFICATION_STATUS_BEACON_MISSING 1 ++#define IPW_MB_SCAN_CANCEL_THRESHOLD 3 + #define IPW_MB_ROAMING_THRESHOLD_MIN 1 + #define IPW_MB_ROAMING_THRESHOLD_DEFAULT 8 + #define IPW_MB_ROAMING_THRESHOLD_MAX 30 diff --git a/queue-2.6.28/series b/queue-2.6.28/series index b99568044c6..35783f0e4fa 100644 --- a/queue-2.6.28/series +++ b/queue-2.6.28/series @@ -41,3 +41,6 @@ serial-set-correct-baud_base-for-oxford-semiconductor-ltd-exsys-ex-41092-dual-16 add-support-for-8-port-rs-232-mic-3620-from-advantech.patch mm-fix-error-case-in-mlock-downgrade-reversion.patch elf-core-dump-fix-get_user-use.patch +acpi-video-fix-reversed-brightness-behavior-on-thinkpad-sl-series.patch +ipw2200-fix-scanning-while-associated.patch +xfs-set-b_error-from-bio-error-in-xfs_buf_bio_end_io.patch diff --git a/queue-2.6.28/xfs-set-b_error-from-bio-error-in-xfs_buf_bio_end_io.patch b/queue-2.6.28/xfs-set-b_error-from-bio-error-in-xfs_buf_bio_end_io.patch new file mode 100644 index 00000000000..87653d82420 --- /dev/null +++ b/queue-2.6.28/xfs-set-b_error-from-bio-error-in-xfs_buf_bio_end_io.patch @@ -0,0 +1,33 @@ +From cfbe52672fbc6f333892e8dde82c35e0a76aa5f5 Mon Sep 17 00:00:00 2001 +From: Lachlan McIlroy +Date: Fri, 12 Dec 2008 15:27:25 +1100 +Subject: XFS: set b_error from bio error in xfs_buf_bio_end_io + +From: Lachlan McIlroy + +commit cfbe52672fbc6f333892e8dde82c35e0a76aa5f5 upstream. + +Preserve any error returned by the bio layer. + +Reviewed-by: Eric Sandeen +Reviewed-by: Tim Shimmin +Signed-off-by: Lachlan McIlroy +Cc: Neil Brown +Signed-off-by: Greg Kroah-Hartman + +--- + fs/xfs/linux-2.6/xfs_buf.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/fs/xfs/linux-2.6/xfs_buf.c ++++ b/fs/xfs/linux-2.6/xfs_buf.c +@@ -1114,8 +1114,7 @@ xfs_buf_bio_end_io( + unsigned int blocksize = bp->b_target->bt_bsize; + struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1; + +- if (!test_bit(BIO_UPTODATE, &bio->bi_flags)) +- bp->b_error = EIO; ++ xfs_buf_ioerror(bp, -error); + + do { + struct page *page = bvec->bv_page; -- 2.47.3