From: Greg Kroah-Hartman Date: Fri, 5 Mar 2010 00:00:17 +0000 (-0800) Subject: more .31 patches X-Git-Tag: v2.6.32.10~41 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=86b26af78ad467115c6458a17dc3b158b8a35272;p=thirdparty%2Fkernel%2Fstable-queue.git more .31 patches --- diff --git a/queue-2.6.31/b43-fix-throughput-regression.patch b/queue-2.6.31/b43-fix-throughput-regression.patch new file mode 100644 index 00000000000..c943aeba32a --- /dev/null +++ b/queue-2.6.31/b43-fix-throughput-regression.patch @@ -0,0 +1,69 @@ +From b6c3f5be7c6ac3375f44de4545c1ffe216b34022 Mon Sep 17 00:00:00 2001 +From: Larry Finger +Date: Tue, 2 Feb 2010 10:08:19 -0600 +Subject: b43: Fix throughput regression + +From: Larry Finger + +commit b6c3f5be7c6ac3375f44de4545c1ffe216b34022 upstream. + +Commit c7ab5ef9bcd281135c21b4732c9be779585181be entitled "b43: implement +short slot and basic rate handling" reduced the transmit throughput for +my BCM4311 device from 18 Mb/s to 0.7 Mb/s. The basic rate handling +portion is OK, the problem is in the short slot handling. + +Prior to this change, the short slot enable/disable routines were never +called. Experimentation showed that the critical part was changing the +value at offset 0x0010 in the shared memory. This is supposed to contain +the 802.11 Slot Time in usec, but if it is changed from its initial value +of zero, performance is destroyed. On the other hand, changing the value +in the MMIO register corresponding to the Interframe Slot Time increased +performance from 18 to 22 Mb/s. A BCM4306/3 also shows dramatic +improvement of the transmit rate from 5.3 to 19.0 Mb/s. + +Other changes in the patch include removal of the magic number for the +MMIO register, and allowing the slot time to be set for any PHY operating +in the 2.4 GHz band. Previously, the routine was executed only for G PHYs. + +Signed-off-by: Larry Finger +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/b43/b43.h | 1 + + drivers/net/wireless/b43/main.c | 13 ++++++++++--- + 2 files changed, 11 insertions(+), 3 deletions(-) + +--- a/drivers/net/wireless/b43/b43.h ++++ b/drivers/net/wireless/b43/b43.h +@@ -117,6 +117,7 @@ + #define B43_MMIO_TSF_2 0x636 /* core rev < 3 only */ + #define B43_MMIO_TSF_3 0x638 /* core rev < 3 only */ + #define B43_MMIO_RNG 0x65A ++#define B43_MMIO_IFSSLOT 0x684 /* Interframe slot time */ + #define B43_MMIO_IFSCTL 0x688 /* Interframe space control */ + #define B43_MMIO_IFSCTL_USE_EDCF 0x0004 + #define B43_MMIO_POWERUP_DELAY 0x6A8 +--- a/drivers/net/wireless/b43/main.c ++++ b/drivers/net/wireless/b43/main.c +@@ -664,10 +664,17 @@ static void b43_upload_card_macaddress(s + static void b43_set_slot_time(struct b43_wldev *dev, u16 slot_time) + { + /* slot_time is in usec. */ +- if (dev->phy.type != B43_PHYTYPE_G) ++ /* This test used to exit for all but a G PHY. */ ++ if (b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ) + return; +- b43_write16(dev, 0x684, 510 + slot_time); +- b43_shm_write16(dev, B43_SHM_SHARED, 0x0010, slot_time); ++ b43_write16(dev, B43_MMIO_IFSSLOT, 510 + slot_time); ++ /* Shared memory location 0x0010 is the slot time and should be ++ * set to slot_time; however, this register is initially 0 and changing ++ * the value adversely affects the transmit rate for BCM4311 ++ * devices. Until this behavior is unterstood, delete this step ++ * ++ * b43_shm_write16(dev, B43_SHM_SHARED, 0x0010, slot_time); ++ */ + } + + static void b43_short_slot_timing_enable(struct b43_wldev *dev) diff --git a/queue-2.6.31/class-free-the-class-private-data-in-class_release.patch b/queue-2.6.31/class-free-the-class-private-data-in-class_release.patch new file mode 100644 index 00000000000..d51298c3c6b --- /dev/null +++ b/queue-2.6.31/class-free-the-class-private-data-in-class_release.patch @@ -0,0 +1,31 @@ +From 18d19c96457d172d913510c083bc7411ed40cb10 Mon Sep 17 00:00:00 2001 +From: Laurent Pinchart +Date: Wed, 10 Feb 2010 13:32:49 +0100 +Subject: class: Free the class private data in class_release + +From: Laurent Pinchart + +commit 18d19c96457d172d913510c083bc7411ed40cb10 upstream. + +Fix a memory leak by freeing the memory allocated in __class_register +for the class private data. + +Signed-off-by: Laurent Pinchart +Acked-by: Artem Bityutskiy +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/base/class.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/base/class.c ++++ b/drivers/base/class.c +@@ -59,6 +59,8 @@ static void class_release(struct kobject + else + pr_debug("class '%s' does not have a release() function, " + "be careful\n", class->name); ++ ++ kfree(cp); + } + + static struct sysfs_ops class_sysfs_ops = { diff --git a/queue-2.6.31/serial-8250-add-serial-transmitter-fully-empty-test.patch b/queue-2.6.31/serial-8250-add-serial-transmitter-fully-empty-test.patch new file mode 100644 index 00000000000..a3a00945baf --- /dev/null +++ b/queue-2.6.31/serial-8250-add-serial-transmitter-fully-empty-test.patch @@ -0,0 +1,83 @@ +From bca476139d2ded86be146dae09b06e22548b67f3 Mon Sep 17 00:00:00 2001 +From: Dick Hollenbeck +Date: Wed, 9 Dec 2009 12:31:34 -0800 +Subject: serial: 8250: add serial transmitter fully empty test + +From: Dick Hollenbeck + +commit bca476139d2ded86be146dae09b06e22548b67f3 upstream. + +When controlling an industrial radio modem it can be necessary to +manipulate the handshake lines in order to control the radio modem's +transmitter, from userspace. + +The transmitter should not be turned off before all characters have been +transmitted. serial8250_tx_empty() was reporting that all characters were +transmitted before they actually were. + +=== + +Discovered in parallel with more testing and analysis by Kees Schoenmakers +as follows: + +I ran into an NetMos 9835 serial pci board which behaves a little +different than the standard. This type of expansion board is very common. + +"Standard" 8250 compatible devices clear the 'UART_LST_TEMT" bit together +with the "UART_LSR_THRE" bit when writing data to the device. + +The NetMos device does it slightly different + +I believe that the TEMT bit is coupled to the shift register. The problem +is that after writing data to the device and very quickly after that one +does call serial8250_tx_empty, it returns the wrong information. + +My patch makes the test more robust (and solves the problem) and it does +not affect the already correct devices. + +Alan: + + We may yet need to quirk this but now we know which chips we have a + way to do that should we find this breaks some other 8250 clone with + dodgy THRE. + +Signed-off-by: Dick Hollenbeck +Signed-off-by: Alan Cox +Cc: Kees Schoenmakers +Signed-off-by: Andrew Morton +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/serial/8250.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +--- a/drivers/serial/8250.c ++++ b/drivers/serial/8250.c +@@ -81,6 +81,9 @@ static int serial_index(struct uart_port + + #define PASS_LIMIT 256 + ++#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) ++ ++ + /* + * We default to IRQ0 for the "no irq" hack. Some + * machine types want others as well - they're free +@@ -1790,7 +1793,7 @@ static unsigned int serial8250_tx_empty( + up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS; + spin_unlock_irqrestore(&up->port.lock, flags); + +- return lsr & UART_LSR_TEMT ? TIOCSER_TEMT : 0; ++ return (lsr & BOTH_EMPTY) == BOTH_EMPTY ? TIOCSER_TEMT : 0; + } + + static unsigned int serial8250_get_mctrl(struct uart_port *port) +@@ -1848,8 +1851,6 @@ static void serial8250_break_ctl(struct + spin_unlock_irqrestore(&up->port.lock, flags); + } + +-#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) +- + /* + * Wait for transmitter & holding register to empty + */ diff --git a/queue-2.6.31/series b/queue-2.6.31/series index 5eedd43d9b0..ae0aa91528a 100644 --- a/queue-2.6.31/series +++ b/queue-2.6.31/series @@ -63,3 +63,6 @@ nfs-fix-a-bug-in-nfs_fscache_release_page.patch cifs-fix-length-calculation-for-converted-unicode-readdir-names.patch drm-r128-add-test-for-initialisation-to-all-ioctls-that-require-it.patch alsa-hda-intel-avoid-divide-by-zero-crash.patch +b43-fix-throughput-regression.patch +class-free-the-class-private-data-in-class_release.patch +serial-8250-add-serial-transmitter-fully-empty-test.patch