3.4.17-stable review
Subsystems (40)
Greg Kroah-Hartman
maintainercover 3.4.17-stable review
This is the start of the stable review cycle for the 3.4.17 release. There are 54 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed Oct 31 21:37:26 UTC 2012. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.4.17-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 3.4.17-rc1
Sjoerd Simons <[email protected]>
drm/i915: no lvds quirk for Zotac ZDBOX SD ID12/ID13
Yinghai Lu <[email protected]>
x86, mm: Use memblock memory loop instead of e820_RAM
Ian Abbott <[email protected]>
staging: comedi: amplc_pc236: fix invalid register access during detach
Olof Johansson <[email protected]>
x86: efi: Turn off efi_enabled after setup on mixed fw/kernel
Josh Triplett <[email protected]>
efi: Defer freeing boot services memory until after ACPI init
Yinghai Lu <[email protected]>
x86, mm: Undo incorrect revert in arch/x86/mm/init.c
Jacob Shin <[email protected]>
x86, mm: Find_early_table_space based on ranges that are actually being mapped
Felix Fietkau <[email protected]>
Revert "ath9k_hw: Updated AR9003 tx gain table for 5GHz"
Andreas Herrmann <[email protected]>
cpufreq / powernow-k8: Remove usage of smp_processor_id() in preemptible code
Piotr Haber <[email protected]>
bcma: fix unregistration of cores
Wei Yongjun <[email protected]>
dmaengine: imx-dma: fix missing unlock on error in imxdma_xfer_desc()
Barry Song <[email protected]>
dmaengine: sirf: fix a typo in moving running dma_desc to active queue
Barry Song <[email protected]>
dmaengine: sirf: fix a typo in dma_prep_interleaved
Oleg Nesterov <[email protected]>
freezer: exec should clear PF_NOFREEZE along with PF_KTHREAD
Johan Hedberg <[email protected]>
Bluetooth: SMP: Fix setting unknown auth_req bits
Stanislaw Gruszka <[email protected]>
mac80211: check if key has TKIP type before updating IV
Ivan Shugov <[email protected]>
ARM: at91: at91sam9g10: fix SOC type detection
Bo Shen <[email protected]>
ARM: at91/i2c: change id to let i2c-gpio work
Josh Wu <[email protected]>
ARM: at91/tc: fix typo in the DT document
Heiko Stuebner <[email protected]>
ARM: SAMSUNG: Add naming of s3c64xx-spi devices
Michael S. Tsirkin <[email protected]>
vhost: fix mergeable bufs on BE hosts
Johan Hovold <[email protected]>
USB: mos7840: remove invalid disconnect handling
Johan Hovold <[email protected]>
USB: mos7840: remove NULL-urb submission
Johan Hovold <[email protected]>
USB: mos7840: fix port-device leak in error path
Johan Hovold <[email protected]>
USB: mos7840: fix urb leak at release
Johan Hovold <[email protected]>
USB: sierra: fix memory leak in probe error path
Johan Hovold <[email protected]>
USB: sierra: fix memory leak in attach error path
Lennart Sorensen <[email protected]>
USB: serial: Fix memory leak in sierra_release()
Johan Hovold <[email protected]>
USB: opticon: fix memory leak in error path
Johan Hovold <[email protected]>
USB: opticon: fix DMA from stack
Johan Hovold <[email protected]>
USB: whiteheat: fix memory leak in error path
Octavian Purdila <[email protected]>
usb hub: send clear_tt_buffer_complete events when canceling TT clear work
Michael Shigorin <[email protected]>
usb-storage: add unusual_devs entry for Casio EX-N1 digital camera
Anisse Astier <[email protected]>
ehci: Add yet-another Lucid nohandoff pci quirk
Anisse Astier <[email protected]>
ehci: fix Lucid nohandoff pci quirk to be more generic with BIOS versions
K. Y. Srinivasan <[email protected]>
Drivers: hv: Cleanup error handling in vmbus_open()
Arve Hjønnevåg <[email protected]>
Staging: android: binder: Allow using highmem for binder buffers
Arve Hjønnevåg <[email protected]>
Staging: android: binder: Fix memory leak on thread/process exit
Geert Uytterhoeven <[email protected]>
sysfs: sysfs_pathname/sysfs_add_one: Use strlcat() instead of strcat()
Sarah Sharp <[email protected]>
xhci: Fix potential NULL ptr deref in command cancellation.
Trond Myklebust <[email protected]>
SUNRPC: Prevent races in xs_abort_connection()
Trond Myklebust <[email protected]>
Revert "SUNRPC: Ensure we close the socket on EPIPE errors too..."
Trond Myklebust <[email protected]>
SUNRPC: Clear the connect flag when socket state is TCP_CLOSE_WAIT
Trond Myklebust <[email protected]>
SUNRPC: Get rid of the xs_error_report socket callback
Jan Kara <[email protected]>
mm: fix XFS oops due to dirty pages without buffers on s390
Yinghai Lu <[email protected]>
x86, mm: Trim memory in memblock to be page aligned
Will Deacon <[email protected]>
ARM: 7559/1: smp: switch away from the idmap before updating init_mm.mm_count
Thadeu Lima de Souza Cascardo <[email protected]>
genalloc: stop crashing the system when destroying a pool
Jan Luebbe <[email protected]>
drivers/rtc/rtc-imxdi.c: add missing spin lock initialization
Kees Cook <[email protected]>
fs/compat_ioctl.c: VIDEO_SET_SPU_PALETTE missing error check
Kees Cook <[email protected]>
gen_init_cpio: avoid stack overflow when expanding
Stefán Freyr <[email protected]>
ALSA: hda - add dock support for Thinkpad T430
Alex Deucher <[email protected]>
drm/radeon: add error output if VM CS fails on cayman
Alex Deucher <[email protected]>
drm/radeon: add some new SI PCI ids
-------------
Diffstat:
.../devicetree/bindings/arm/atmel-at91.txt | 2 +- Makefile | 4 +- arch/arm/kernel/smp.c | 14 +- arch/arm/mach-at91/at91rm9200_devices.c | 2 +- arch/arm/mach-at91/at91sam9260_devices.c | 2 +- arch/arm/mach-at91/at91sam9261_devices.c | 2 +- arch/arm/mach-at91/at91sam9263_devices.c | 2 +- arch/arm/mach-at91/at91sam9rl_devices.c | 2 +- arch/arm/mach-at91/setup.c | 2 +- arch/arm/mach-exynos/common.c | 5 + arch/arm/mach-s3c24xx/s3c2416.c | 2 + arch/arm/mach-s3c24xx/s3c2443.c | 4 + arch/arm/mach-s5p64x0/common.c | 3 + arch/arm/mach-s5pc100/common.c | 3 + arch/arm/mach-s5pv210/common.c | 3 + arch/arm/plat-samsung/include/plat/spi-core.h | 30 ++++ arch/x86/include/asm/efi.h | 1 + arch/x86/kernel/e820.c | 3 + arch/x86/kernel/setup.c | 27 +++- arch/x86/mm/init.c | 69 +++++---- arch/x86/platform/efi/efi.c | 43 +++--- drivers/bcma/main.c | 5 +- drivers/cpufreq/powernow-k8.c | 9 +- drivers/dma/imx-dma.c | 4 +- drivers/dma/sirf-dma.c | 4 +- drivers/gpu/drm/i915/intel_lvds.c | 8 + drivers/gpu/drm/radeon/evergreen_cs.c | 1 + drivers/hv/channel.c | 24 +-- .../net/wireless/ath/ath9k/ar9003_2p2_initvals.h | 164 ++++++++++----------- drivers/rtc/rtc-imxdi.c | 2 + drivers/staging/android/binder.c | 30 +++- drivers/staging/comedi/drivers/amplc_pc236.c | 2 +- drivers/usb/core/hub.c | 7 +- drivers/usb/host/pci-quirks.c | 9 +- drivers/usb/host/xhci-ring.c | 11 ++ drivers/usb/serial/mos7840.c | 30 +--- drivers/usb/serial/opticon.c | 11 +- drivers/usb/serial/sierra.c | 26 +++- drivers/usb/serial/whiteheat.c | 1 + drivers/usb/storage/unusual_devs.h | 6 + drivers/vhost/net.c | 3 +- fs/compat_ioctl.c | 2 + fs/exec.c | 3 +- fs/sysfs/dir.c | 16 +- include/drm/drm_pciids.h | 3 + include/linux/efi.h | 5 + include/linux/memblock.h | 1 + init/main.c | 3 + lib/genalloc.c | 2 +- mm/memblock.c | 24 +++ mm/rmap.c | 20 ++- net/bluetooth/smp.c | 6 +- net/mac80211/wpa.c | 3 +- net/sunrpc/xprtsock.c | 41 ++---- sound/pci/hda/patch_realtek.c | 1 + usr/gen_init_cpio.c | 43 +++--- 56 files changed, 469 insertions(+), 286 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/54 drm/radeon: add some new SI PCI ids
3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit b6aa22db7857ab7ed042d6c56b800bfc727cfdff upstream.
--- include/drm/drm_pciids.h | 3 +++ 1 file changed, 3 insertions(+)
include/drm/drm_pciids.h +3 -0
@@ -209,6 +209,8 @@ {0x1002, 0x6788, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ {0x1002, 0x678A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6790, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x6791, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x6792, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6798, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6799, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ {0x1002, 0x679A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
@@ -221,6 +223,7 @@ {0x1002, 0x6808, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6809, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6810, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x6811, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6816, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6817, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6818, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \
Greg Kroah-Hartman
maintainerPATCH 2/54 drm/radeon: add error output if VM CS fails on cayman
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit c71721324c612f7f040657ce9917d87f530f9784 upstream.
So we know why the CS was rejected.
--- drivers/gpu/drm/radeon/evergreen_cs.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/radeon/evergreen_cs.c +1 -0
@@ -2775,6 +2775,7 @@ static bool evergreen_vm_reg_valid(u32 rcase CAYMAN_SQ_EX_ALLOC_TABLE_SLOTS :return true;default : +DRM_ERROR ("Invalid register 0x%x in CS\n" , reg);return false; } }
Greg Kroah-Hartman
maintainerPATCH 3/54 ALSA: hda - add dock support for Thinkpad T430
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Stef=C3=A1n=20Freyr?= <[email protected]>
commit 84f98fdf7865fbd35b312eb39ea91e5618c514c7 upstream.
I have a Lenovo ThinkPad T430 and an UltraBase Series 3 docking station.
Without this patch, if I plug my headphones into the jack on the computer, everything works fine. The computer speakers mute and the audio is played in the headphones. However, if I plug into the docking station headphone jack the computer speakers are muted but there is no audio in the headphones.
Addresses https://bugs.launchpad.net/bugs/1060372
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -6184,6 +6184,7 @@ static const struct snd_pci_quirk alc269SND_PCI_QUIRK (0x17aa ,0x21e9 ,"Thinkpad Edge 15" ,ALC269_FIXUP_SKU_IGNORE ),SND_PCI_QUIRK (0x17aa ,0x21f6 ,"Thinkpad T530" ,ALC269_FIXUP_LENOVO_DOCK ),SND_PCI_QUIRK (0x17aa ,0x21fa ,"Thinkpad X230" ,ALC269_FIXUP_LENOVO_DOCK ), +SND_PCI_QUIRK (0x17aa ,0x21f3 ,"Thinkpad T430" ,ALC269_FIXUP_LENOVO_DOCK ),SND_PCI_QUIRK (0x17aa ,0x21fb ,"Thinkpad T430s" ,ALC269_FIXUP_LENOVO_DOCK ),SND_PCI_QUIRK (0x17aa ,0x2203 ,"Thinkpad X230 Tablet" ,ALC269_FIXUP_LENOVO_DOCK ), SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
Greg Kroah-Hartman
maintainerPATCH 4/54 gen_init_cpio: avoid stack overflow when expanding
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kees Cook <[email protected]>
commit 20f1de659b77364d55d4e7fad2ef657e7730323f upstream.
Fix possible overflow of the buffer used for expanding environment variables when building file list.
In the extremely unlikely case of an attacker having control over the environment variables visible to gen_init_cpio, control over the contents of the file gen_init_cpio parses, and gen_init_cpio was built without compiler hardening, the attacker can gain arbitrary execution control via a stack buffer overflow.
$ cat usr/crash.list
file foo ${BIG}${BIG}${BIG}${BIG}${BIG}${BIG} 0755 0 0
$ BIG=$(perl -e 'print "A" x 4096;') ./usr/gen_init_cpio usr/crash.list
*** buffer overflow detected ***: ./usr/gen_init_cpio terminatedThis also replaces the space-indenting with tabs.
Patch based on existing fix extracted from grsecurity.
--- usr/gen_init_cpio.c | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-)
usr/gen_init_cpio.c +22 -19
@@ -303,7 +303,7 @@ static int cpio_mkfile(const char *name,int retval;int rc =-1 ;int namesize; -int i; +unsigned int i; mode |=S_IFREG ;
@@ -381,25 +381,28 @@ error:static char *cpio_replace_env (char *new_location) { -char expanded[PATH_MAX +1 ]; -char env_var[PATH_MAX +1 ]; -char *start; -char *end; - -for (start =NULL ; (start =strstr (new_location,"${" )); ) { - end =strchr (start,'}' ); -if (start < end) { - *env_var = *expanded ='\0' ; -strncat (env_var, start +2 , end - start -2 ); -strncat (expanded, new_location, start - new_location); -strncat (expanded,getenv (env_var),PATH_MAX ); -strncat (expanded, end +1 ,PATH_MAX ); -strncpy (new_location, expanded,PATH_MAX ); - }else -break ; - } +char expanded[PATH_MAX +1 ]; +char env_var[PATH_MAX +1 ]; +char *start; +char *end; + +for (start =NULL ; (start =strstr (new_location,"${" )); ) { + end =strchr (start,'}' ); +if (start < end) { + *env_var = *expanded ='\0' ; +strncat (env_var, start +2 , end - start -2 ); +strncat (expanded, new_location, start - new_location); +strncat (expanded,getenv (env_var), +PATH_MAX -strlen (expanded)); +strncat (expanded, end +1 , +PATH_MAX -strlen (expanded)); +strncpy (new_location, expanded,PATH_MAX ); + new_location[PATH_MAX ] =0 ; + }else +break ; + } -return new_location; +return new_location; }
Greg Kroah-Hartman
maintainerPATCH 5/54 fs/compat_ioctl.c: VIDEO_SET_SPU_PALETTE missing error check
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kees Cook <[email protected]>
commit 12176503366885edd542389eed3aaf94be163fdb upstream.
The compat ioctl for VIDEO_SET_SPU_PALETTE was missing an error check while converting ioctl arguments. This could lead to leaking kernel stack contents into userspace.
Patch extracted from existing fix in grsecurity.
--- fs/compat_ioctl.c | 2 ++ 1 file changed, 2 insertions(+)
fs/compat_ioctl.c +2 -0
@@ -210,6 +210,8 @@ static int do_video_set_spu_palette(unsi err =get_user (palp, &up->palette); err |=get_user (length, &up->length); +if (err) +return -EFAULT ; up_native =compat_alloc_user_space (sizeof (struct video_spu_palette )); err =put_user (compat_ptr (palp), &up_native->palette);
Greg Kroah-Hartman
maintainerPATCH 6/54 drivers/rtc/rtc-imxdi.c: add missing spin lock initialization
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Luebbe <[email protected]>
commit fee0de7791f967c2c5f0d43eb7b7261761b45e64 upstream.
--- drivers/rtc/rtc-imxdi.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/rtc/rtc-imxdi.c +2 -0
@@ -392,6 +392,8 @@ static int dryice_rtc_probe(struct platfif (imxdi->ioaddr ==NULL )return -ENOMEM ; +spin_lock_init (&imxdi->irq_lock); + imxdi->irq =platform_get_irq (pdev,0 );if (imxdi->irq <0 )return imxdi->irq;
Greg Kroah-Hartman
maintainerPATCH 7/54 genalloc: stop crashing the system when destroying a pool
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thadeu Lima de Souza Cascardo <[email protected]>
commit eedce141cd2dad8d0cefc5468ef41898949a7031 upstream.
The genalloc code uses the bitmap API from include/linux/bitmap.h and lib/bitmap.c, which is based on long values. Both bitmap_set from lib/bitmap.c and bitmap_set_ll, which is the lockless version from genalloc.c, use BITMAP_LAST_WORD_MASK to set the first bits in a long in the bitmap.
That one uses (1 << bits) - 1, 0b111, if you are setting the first three bits. This means that the API counts from the least significant bits (LSB from now on) to the MSB. The LSB in the first long is bit 0, then. The same works for the lookup functions.
The genalloc code uses longs for the bitmap, as it should. In include/linux/genalloc.h, struct gen_pool_chunk has unsigned long bits[0] as its last member. When allocating the struct, genalloc should reserve enough space for the bitmap. This should be a proper number of longs that can fit the amount of bits in the bitmap.
However, genalloc allocates an integer number of bytes that fit the amount of bits, but may not be an integer amount of longs. 9 bytes, for example, could be allocated for 70 bits.
This is a problem in itself if the Least Significat Bit in a long is in the byte with the largest address, which happens in Big Endian machines. This means genalloc is not allocating the byte in which it will try to set or check for a bit.
This may end up in memory corruption, where genalloc will try to set the bits it has not allocated. In fact, genalloc may not set these bits because it may find them already set, because they were not zeroed since they were not allocated. And that's what causes a BUG when gen_pool_destroy is called and check for any set bits.
What really happens is that genalloc uses kmalloc_node with __GFP_ZERO on gen_pool_add_virt. With SLAB and SLUB, this means the whole slab will be cleared, not only the requested bytes. Since struct gen_pool_chunk has a size that is a multiple of 8, and slab sizes are multiples of 8, we get lucky and allocate and clear the right amount of bytes.
Hower, this is not the case with SLOB or with older code that did memset after allocating instead of using __GFP_ZERO.
So, a simple module as this (running 3.6.0), will cause a crash when rmmod'ed.
[root@phantom-lp2 foo]# cat foo.c
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/genalloc.h>
MODULE_LICENSE("GPL");
MODULE_VERSION("0.1"); static struct gen_pool *foo_pool;
static __init int foo_init(void)
{
int ret;
foo_pool = gen_pool_create(10, -1);
if (!foo_pool)
return -ENOMEM;
ret = gen_pool_add(foo_pool, 0xa0000000, 32 << 10, -1);
if (ret) {
gen_pool_destroy(foo_pool);
return ret;
}
return 0;
}
static __exit void foo_exit(void)
{
gen_pool_destroy(foo_pool);
} module_init(foo_init);
module_exit(foo_exit);
[root@phantom-lp2 foo]# zcat /proc/config.gz | grep SLOB CONFIG_SLOB=y
[root@phantom-lp2 foo]# insmod ./foo.ko [root@phantom-lp2 foo]# rmmod foo
------------[ cut here ]------------
kernel BUG at lib/genalloc.c:243!
cpu 0x4: Vector: 700 (Program Check) at [c0000000bb0e7960]
pc: c0000000003cb50c: .gen_pool_destroy+0xac/0x110
lr: c0000000003cb4fc: .gen_pool_destroy+0x9c/0x110
sp: c0000000bb0e7be0
msr: 8000000000029032
current = 0xc0000000bb0e0000
paca = 0xc000000006d30e00 softe: 0 irq_happened: 0x01
pid = 13044, comm = rmmod
kernel BUG at lib/genalloc.c:243!
[c0000000bb0e7ca0] d000000004b00020 .foo_exit+0x20/0x38 [foo]
[c0000000bb0e7d20] c0000000000dff98 .SyS_delete_module+0x1a8/0x290
[c0000000bb0e7e30] c0000000000097d4 syscall_exit+0x0/0x94
--- Exception: c00 (System Call) at 000000800753d1a0
SP (fffd0b0e640) is in userspace--- lib/genalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/genalloc.c +1 -1
@@ -176,7 +176,7 @@ int gen_pool_add_virt(struct gen_pool *pstruct gen_pool_chunk *chunk;int nbits = size >> pool->min_alloc_order;int nbytes =sizeof (struct gen_pool_chunk ) + - (nbits +BITS_PER_BYTE -1 ) /BITS_PER_BYTE ; +BITS_TO_LONGS (nbits) *sizeof (long ); chunk =kmalloc_node (nbytes,GFP_KERNEL | __GFP_ZERO, nid);if (unlikely (chunk ==NULL ))
Greg Kroah-Hartman
maintainerPATCH 8/54 ARM: 7559/1: smp: switch away from the idmap before updating init_mm.mm_count
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <[email protected]>
commit 5f40b909728ad784eb43aa309d3c4e9bdf050781 upstream.
When booting a secondary CPU, the primary CPU hands two sets of page tables via the secondary_data struct:
(1) swapper_pg_dir: a normal, cacheable, shared (if SMP) mapping of the kernel image (i.e. the tables used by init_mm).
(2) idmap_pgd: an uncached mapping of the .idmap.text ELF section.
The idmap is generally used when enabling and disabling the MMU, which includes early CPU boot. In this case, the secondary CPU switches to swapper as soon as it enters C code:
struct mm_struct *mm = &init_mm; unsigned int cpu = smp_processor_id(); /* * All kernel threads share the same mm context; grab a * reference and switch to it. */ atomic_inc(&mm->mm_count); current->active_mm = mm; cpumask_set_cpu(cpu, mm_cpumask(mm)); cpu_switch_mm(mm->pgd, mm);
This causes a problem on ARMv7, where the identity mapping is treated as strongly-ordered leading to architecturally UNPREDICTABLE behaviour of exclusive accesses, such as those used by atomic_inc.
This patch re-orders the secondary_start_kernel function so that we switch to swapper before performing any exclusive accesses.
--- arch/arm/kernel/smp.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
arch/arm/kernel/smp.c +10 -4
@@ -249,18 +249,24 @@ static void percpu_timer_setup(void); asmlinkage void __cpuinit secondary_start_kernel(void) {struct mm_struct *mm = &init_mm; -unsigned int cpu =smp_processor_id (); +unsigned int cpu; + +/* +* The identity mapping is uncached (strongly ordered), so +* switch away from it before attempting any exclusive accesses. +*/ +cpu_switch_mm (mm->pgd, mm); +enter_lazy_tlb (mm, current); +local_flush_tlb_all ();/* * All kernel threads share the same mm context; grab a * reference and switch to it. */ + cpu =smp_processor_id ();atomic_inc (&mm->mm_count); current->active_mm = mm;cpumask_set_cpu (cpu,mm_cpumask (mm)); -cpu_switch_mm (mm->pgd, mm); -enter_lazy_tlb (mm, current); -local_flush_tlb_all ();printk ("CPU%u: Booted secondary processor\n" , cpu);
Greg Kroah-Hartman
maintainerPATCH 9/54 x86, mm: Trim memory in memblock to be page aligned
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yinghai Lu <[email protected]>
commit 6ede1fd3cb404c0016de6ac529df46d561bd558b upstream.
We will not map partial pages, so need to make sure memblock allocation will not allocate those bytes out.
Also we will use for_each_mem_pfn_range() to loop to map memory range to keep them consistent.
--- arch/x86/kernel/e820.c | 3 +++ include/linux/memblock.h | 1 + mm/memblock.c | 24 ++++++++++++++++++++++++ 3 files changed, 28 insertions(+)
arch/x86/kernel/e820.c +3 -0
@@ -1076,6 +1076,9 @@ void __init memblock_x86_fill(void)memblock_add (ei->addr, ei->size); } +/* throw away partial pages */ +memblock_trim_memory (PAGE_SIZE ); +memblock_dump_all (); }
include/linux/memblock.h +1 -0
@@ -57,6 +57,7 @@ int memblock_add(phys_addr_t base, phys_int memblock_remove (phys_addr_t base,phys_addr_t size);int memblock_free (phys_addr_t base,phys_addr_t size);int memblock_reserve (phys_addr_t base,phys_addr_t size); +void memblock_trim_memory (phys_addr_t align);#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn,
mm/memblock.c +24 -0
@@ -908,6 +908,30 @@ int __init_memblock memblock_is_region_rreturn memblock_overlaps_region (&memblock.reserved, base, size) >=0 ; } +void __init_memblock memblock_trim_memory(phys_addr_t align) +{ +int i; +phys_addr_t start, end, orig_start, orig_end; +struct memblock_type *mem = &memblock.memory; + +for (i =0 ; i < mem->cnt; i++) { + orig_start = mem->regions[i].base; + orig_end = mem->regions[i].base + mem->regions[i].size; + start =round_up (orig_start, align); + end =round_down (orig_end, align); + +if (start == orig_start && end == orig_end) +continue ; + +if (start < end) { + mem->regions[i].base = start; + mem->regions[i].size = end - start; + }else { +memblock_remove_region (mem, i); + i--; + } + } +} void __init_memblock memblock_set_current_limit(phys_addr_t limit) {
Greg Kroah-Hartman
maintainerPATCH 10/54 mm: fix XFS oops due to dirty pages without buffers on s390
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <[email protected]>
commit ef5d437f71afdf4afdbab99213add99f4b1318fd upstream.
On s390 any write to a page (even from kernel itself) sets architecture specific page dirty bit. Thus when a page is written to via buffered write, HW dirty bit gets set and when we later map and unmap the page, page_remove_rmap() finds the dirty bit and calls set_page_dirty().
Dirtying of a page which shouldn't be dirty can cause all sorts of problems to filesystems. The bug we observed in practice is that buffers from the page get freed, so when the page gets later marked as dirty and writeback writes it, XFS crashes due to an assertion BUG_ON(!PagePrivate(page)) in page_buffers() called from xfs_count_page_state().
Similar problem can also happen when zero_user_segment() call from xfs_vm_writepage() (or block_write_full_page() for that matter) set the hardware dirty bit during writeback, later buffers get freed, and then page unmapped.
Fix the issue by ignoring s390 HW dirty bit for page cache pages of mappings with mapping_cap_account_dirty(). This is safe because for such mappings when a page gets marked as writeable in PTE it is also marked dirty in do_wp_page() or do_page_fault(). When the dirty bit is cleared by clear_page_dirty_for_io(), the page gets writeprotected in page_mkclean(). So pagecache page is writeable if and only if it is dirty.
Thanks to Hugh Dickins for pointing out mapping has to have mapping_cap_account_dirty() for things to work and proposing a cleaned up variant of the patch.
The patch has survived about two hours of running fsx-linux on tmpfs while heavily swapping and several days of running on out build machines where the original problem was triggered.
--- mm/rmap.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-)
mm/rmap.c +15 -5
@@ -56,6 +56,7 @@#include <linux/mmu_notifier.h> #include <linux/migrate.h> #include <linux/hugetlb.h> +#include <linux/backing-dev.h> #include <asm/tlbflush.h>
@@ -977,11 +978,8 @@ int page_mkclean(struct page *page)if (page_mapped (page)) {struct address_space *mapping =page_mapping (page); -if (mapping) { +if (mapping) ret =page_mkclean_file (mapping, page); -if (page_test_and_clear_dirty (page_to_pfn (page),1 )) - ret =1 ; - } }return ret;
@@ -1167,6 +1165,7 @@ void page_add_file_rmap(struct page *pag*/ void page_remove_rmap (struct page *page) { +struct address_space *mapping =page_mapping (page);bool anon =PageAnon (page);bool locked;unsigned long flags;
@@ -1189,8 +1188,19 @@ void page_remove_rmap(struct page *page)* this if the page is anon, so about to be freed; but perhaps * not if it's in swapcache - there might be another pte slot * containing the swap entry, but page not yet written to swap. +* +* And we can skip it on file pages, so long as the filesystem +* participates in dirty tracking; but need to catch shm and tmpfs +* and ramfs pages which have been modified since creation by read +* fault. +* +* Note that mapping must be decided above, before decrementing +* mapcount (which luckily provides a barrier): once page is unmapped, +* it could be truncated and page->mapping reset to NULL at any moment. +* Note also that we are relying on page_mapping(page) to set mapping +* to &swapper_space when PageSwapCache(page). */ -if ((!anon ||PageSwapCache (page)) && +if (mapping && !mapping_cap_account_dirty (mapping) &&page_test_and_clear_dirty (page_to_pfn (page),1 ))set_page_dirty (page);/*
Greg Kroah-Hartman
maintainerPATCH 11/54 SUNRPC: Get rid of the xs_error_report socket callback
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
commit f878b657ce8e7d3673afe48110ec208a29e38c4a upstream.
Chris Perl reports that we're seeing races between the wakeup call in xs_error_report and the connect attempts. Basically, Chris has shown that in certain circumstances, the call to xs_error_report causes the rpc_task that is responsible for reconnecting to wake up early, thus triggering a disconnect and retry.
Since the sk->sk_error_report() calls in the socket layer are always followed by a tcp_done() in the cases where we care about waking up the rpc_tasks, just let the state_change callbacks take responsibility for those wake ups.
--- net/sunrpc/xprtsock.c | 25 ------------------------- 1 file changed, 25 deletions(-)
net/sunrpc/xprtsock.c +0 -25
@@ -254,7 +254,6 @@ struct sock_xprt {void (*old_data_ready)(struct sock *,int );void (*old_state_change)(struct sock *);void (*old_write_space)(struct sock *); -void (*old_error_report)(struct sock *); };/*
@@ -781,7 +780,6 @@ static void xs_save_old_callbacks(struct transport->old_data_ready = sk->sk_data_ready; transport->old_state_change = sk->sk_state_change; transport->old_write_space = sk->sk_write_space; - transport->old_error_report = sk->sk_error_report; }static void xs_restore_old_callbacks (struct sock_xprt *transport,struct sock *sk)
@@ -789,7 +787,6 @@ static void xs_restore_old_callbacks(str sk->sk_data_ready = transport->old_data_ready; sk->sk_state_change = transport->old_state_change; sk->sk_write_space = transport->old_write_space; - sk->sk_error_report = transport->old_error_report; }static void xs_reset_transport (struct sock_xprt *transport)
@@ -1552,25 +1549,6 @@ static void xs_tcp_state_change(struct sread_unlock_bh (&sk->sk_callback_lock); } -/** -* xs_error_report - callback mainly for catching socket errors -* @sk: socket -*/ -static void xs_error_report (struct sock *sk) -{ -struct rpc_xprt *xprt; - -read_lock_bh (&sk->sk_callback_lock); -if (!(xprt =xprt_from_sock (sk))) - goto out; -dprintk ("RPC: %s client %p...\n" -"RPC: error %d\n" , - __func__, xprt, sk->sk_err); -xprt_wake_pending_tasks (xprt, -EAGAIN ); -out: -read_unlock_bh (&sk->sk_callback_lock); -} -static void xs_write_space (struct sock *sk) {struct socket *sock;
@@ -1870,7 +1848,6 @@ static int xs_local_finish_connecting(st sk->sk_user_data = xprt; sk->sk_data_ready = xs_local_data_ready; sk->sk_write_space = xs_udp_write_space; - sk->sk_error_report = xs_error_report; sk->sk_allocation =GFP_ATOMIC ;xprt_clear_connected (xprt);
@@ -1959,7 +1936,6 @@ static void xs_udp_finish_connecting(str sk->sk_user_data = xprt; sk->sk_data_ready = xs_udp_data_ready; sk->sk_write_space = xs_udp_write_space; - sk->sk_error_report = xs_error_report; sk->sk_no_check =UDP_CSUM_NORCV ; sk->sk_allocation =GFP_ATOMIC ;
@@ -2075,7 +2051,6 @@ static int xs_tcp_finish_connecting(stru sk->sk_data_ready = xs_tcp_data_ready; sk->sk_state_change = xs_tcp_state_change; sk->sk_write_space = xs_tcp_write_space; - sk->sk_error_report = xs_error_report; sk->sk_allocation =GFP_ATOMIC ;/* socket options */
Greg Kroah-Hartman
maintainerPATCH 12/54 SUNRPC: Clear the connect flag when socket state is TCP_CLOSE_WAIT
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
commit d0bea455dd48da1ecbd04fedf00eb89437455fdc upstream.
This is needed to ensure that we call xprt_connect() upon the next call to call_connect().
--- net/sunrpc/xprtsock.c | 1 + 1 file changed, 1 insertion(+)
net/sunrpc/xprtsock.c +1 -0
@@ -1525,6 +1525,7 @@ static void xs_tcp_state_change(struct scase TCP_CLOSE_WAIT :/* The server initiated a shutdown of the socket */ xprt->connect_cookie++; +clear_bit (XPRT_CONNECTED , &xprt->state);xs_tcp_force_close (xprt);case TCP_CLOSING :/*
Greg Kroah-Hartman
maintainerPATCH 13/54 Revert "SUNRPC: Ensure we close the socket on EPIPE errors too..."
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
commit b9d2bb2ee537424a7f855e1f93eed44eb9ee0854 upstream.
This reverts commit 55420c24a0d4d1fce70ca713f84aa00b6b74a70e. Now that we clear the connected flag when entering TCP_CLOSE_WAIT, the deadlock described in this commit is no longer possible. Instead, the resulting call to xs_tcp_shutdown() can interfere with pending reconnection attempts.
--- net/sunrpc/xprtsock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sunrpc/xprtsock.c +1 -1
@@ -736,10 +736,10 @@ static int xs_tcp_send_request(struct rpdprintk ("RPC: sendmsg returned unrecognized error %d\n" , -status);case -ECONNRESET : -case -EPIPE :xs_tcp_shutdown (xprt);case -ECONNREFUSED :case -ENOTCONN : +case -EPIPE :clear_bit (SOCK_ASYNC_NOSPACE , &transport->sock->flags); }
Greg Kroah-Hartman
maintainerPATCH 14/54 SUNRPC: Prevent races in xs_abort_connection()
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
commit 4bc1e68ed6a8b59be8a79eb719be515a55c7bc68 upstream.
The call to xprt_disconnect_done() that is triggered by a successful connection reset will trigger another automatic wakeup of all tasks on the xprt->pending rpc_wait_queue. In particular it will cause an early wake up of the task that called xprt_connect().
All we really want to do here is clear all the socket-specific state flags, so we split that functionality out of xs_sock_mark_closed() into a helper that can be called by xs_abort_connection()
--- net/sunrpc/xprtsock.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
net/sunrpc/xprtsock.c +8 -5
@@ -1462,7 +1462,7 @@ static void xs_tcp_cancel_linger_timeoutxprt_clear_connecting (xprt); } -static void xs_sock_mark_closed (struct rpc_xprt *xprt) +static void xs_sock_reset_connection_flags (struct rpc_xprt *xprt) {smp_mb__before_clear_bit ();clear_bit (XPRT_CONNECTION_ABORT , &xprt->state);
@@ -1470,6 +1470,11 @@ static void xs_sock_mark_closed(struct rclear_bit (XPRT_CLOSE_WAIT , &xprt->state);clear_bit (XPRT_CLOSING , &xprt->state);smp_mb__after_clear_bit (); +} + +static void xs_sock_mark_closed (struct rpc_xprt *xprt) +{ +xs_sock_reset_connection_flags (xprt);/* Mark transport as closed and wake up all pending tasks */ xprt_disconnect_done (xprt); }
@@ -2004,10 +2009,8 @@ static void xs_abort_connection(struct s any.sa_family =AF_UNSPEC ; result =kernel_connect (transport->sock, &any,sizeof (any),0 );if (!result) -xs_sock_mark_closed (&transport->xprt); -else -dprintk ("RPC: AF_UNSPEC connect return code %d\n" , - result); +xs_sock_reset_connection_flags (&transport->xprt); +dprintk ("RPC: AF_UNSPEC connect return code %d\n" , result); }static void xs_tcp_reuse_connection (struct sock_xprt *transport)
Greg Kroah-Hartman
maintainerPATCH 15/54 xhci: Fix potential NULL ptr deref in command cancellation.
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sarah Sharp <[email protected]>
commit 43a09f7fb01fa1e091416a2aa49b6c666458c1ee upstream.
The command cancellation code doesn't check whether find_trb_seg() couldn't find the segment that contains the TRB to be canceled. This could cause a NULL pointer deference later in the function when next_trb is called. It's unlikely to happen unless something is wrong with the command ring pointers, so add some debugging in case it happens.
This patch should be backported to stable kernels as old as 3.0, that contain the commit b63f4053cc8aa22a98e3f9a97845afe6c15d0a0d "xHCI:
handle command after aborting the command ring".
--- drivers/usb/host/xhci-ring.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/usb/host/xhci-ring.c +11 -0
@@ -1228,6 +1228,17 @@ static void xhci_cmd_to_noop(struct xhci cur_seg =find_trb_seg (xhci->cmd_ring->first_seg, xhci->cmd_ring->dequeue, &cycle_state); +if (!cur_seg) { +xhci_warn (xhci,"Command ring mismatch, dequeue = %p %llx (dma)\n" , + xhci->cmd_ring->dequeue, + (unsigned long long ) +xhci_trb_virt_to_dma (xhci->cmd_ring->deq_seg, + xhci->cmd_ring->dequeue)); +xhci_debug_ring (xhci, xhci->cmd_ring); +xhci_dbg_ring_ptrs (xhci, xhci->cmd_ring); +return ; + } +/* find the command trb matched by cd from command ring */ for (cmd_trb = xhci->cmd_ring->dequeue; cmd_trb != xhci->cmd_ring->enqueue;
Greg Kroah-Hartman
maintainerPATCH 16/54 sysfs: sysfs_pathname/sysfs_add_one: Use strlcat() instead of strcat()
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
commit 66081a72517a131430dcf986775f3268aafcb546 upstream.
The warning check for duplicate sysfs entries can cause a buffer overflow when printing the warning, as strcat() doesn't check buffer sizes. Use strlcat() instead.
Since strlcat() doesn't return a pointer to the passed buffer, unlike strcat(), I had to convert the nested concatenation in sysfs_add_one() to an admittedly more obscure comma operator construct, to avoid emitting code for the concatenation if CONFIG_BUG is disabled.
--- fs/sysfs/dir.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
fs/sysfs/dir.c +8 -8
@@ -457,20 +457,18 @@ int __sysfs_add_one(struct sysfs_addrm_c/** * sysfs_pathname - return full path to sysfs dirent * @sd: sysfs_dirent whose path we want -* @path: caller allocated buffer +* @path: caller allocated buffer of size PATH_MAX * * Gives the name "/" to the sysfs_root entry; any path returned * is relative to wherever sysfs is mounted. -* -* XXX: does no error checking on @path size */ static char *sysfs_pathname (struct sysfs_dirent *sd,char *path) {if (sd->s_parent) {sysfs_pathname (sd->s_parent, path); -strcat (path,"/" ); +strlcat (path,"/" ,PATH_MAX ); } -strcat (path, sd->s_name); +strlcat (path, sd->s_name,PATH_MAX );return path; }
@@ -503,9 +501,11 @@ int sysfs_add_one(struct sysfs_addrm_cxtchar *path =kzalloc (PATH_MAX ,GFP_KERNEL );WARN (1 ,KERN_WARNING "sysfs: cannot create duplicate filename '%s'\n" , - (path ==NULL ) ? sd->s_name : -strcat (strcat (sysfs_pathname (acxt->parent_sd, path),"/" ), - sd->s_name)); + (path ==NULL ) ? sd->s_name + : (sysfs_pathname (acxt->parent_sd, path), +strlcat (path,"/" ,PATH_MAX ), +strlcat (path, sd->s_name,PATH_MAX ), + path));kfree (path); }
Greg Kroah-Hartman
maintainerPATCH 17/54 Staging: android: binder: Fix memory leak on thread/process exit
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arve Hjønnevåg <[email protected]>
commit 675d66b0ed5fd170d6a44cf8dbb3fa56a5347bdb upstream.
If a thread or process exited while a reply, one-way transaction or death notification was pending, the struct holding the pending work was leaked.
--- drivers/staging/android/binder.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-)
drivers/staging/android/binder.c +27 -1
@@ -2507,14 +2507,38 @@ static void binder_release_work(struct lstruct binder_transaction *t; t = container_of(w, struct binder_transaction, work); -if (t->buffer->target_node && !(t->flags &TF_ONE_WAY )) +if (t->buffer->target_node && + !(t->flags &TF_ONE_WAY )) {binder_send_failed_reply (t,BR_DEAD_REPLY ); + }else { +binder_debug (BINDER_DEBUG_DEAD_TRANSACTION , +"binder: undelivered transaction %d\n" , + t->debug_id); + t->buffer->transaction =NULL ; +kfree (t); +binder_stats_deleted (BINDER_STAT_TRANSACTION ); + } }break ;case BINDER_WORK_TRANSACTION_COMPLETE : { +binder_debug (BINDER_DEBUG_DEAD_TRANSACTION , +"binder: undelivered TRANSACTION_COMPLETE\n" );kfree (w);binder_stats_deleted (BINDER_STAT_TRANSACTION_COMPLETE ); }break ; +case BINDER_WORK_DEAD_BINDER_AND_CLEAR : +case BINDER_WORK_CLEAR_DEATH_NOTIFICATION : { +struct binder_ref_death *death; + + death = container_of(w, struct binder_ref_death, work); +binder_debug (BINDER_DEBUG_DEAD_TRANSACTION , +"binder: undelivered death notification, %p\n" , + death->cookie); +kfree (death); +binder_stats_deleted (BINDER_STAT_DEATH ); + }break ;default : +pr_err ("binder: unexpected work type, %d, not freed\n" , + w->type);break ; } }
@@ -2984,6 +3008,7 @@ static void binder_deferred_release(stru nodes++;rb_erase (&node->rb_node, &proc->nodes);list_del_init (&node->work.entry); +binder_release_work (&node->async_todo);if (hlist_empty (&node->refs)) {kfree (node);binder_stats_deleted (BINDER_STAT_NODE );
@@ -3022,6 +3047,7 @@ static void binder_deferred_release(strubinder_delete_ref (ref); }binder_release_work (&proc->todo); +binder_release_work (&proc->delivered_death); buffers =0 ;while ((n =rb_first (&proc->allocated_buffers))) {
Greg Kroah-Hartman
maintainerPATCH 18/54 Staging: android: binder: Allow using highmem for binder buffers
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arve Hjønnevåg <[email protected]>
commit 585650dcec88e704a19bb226a34b6a7166111623 upstream.
The default kernel mapping for the pages allocated for the binder buffers is never used. Set the __GFP_HIGHMEM flag when allocating these pages so we don't needlessly use low memory pages that may be required elsewhere.
--- drivers/staging/android/binder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/android/binder.c +1 -1
@@ -655,7 +655,7 @@ static int binder_update_page_range(stru page = &proc->pages[(page_addr - proc->buffer) /PAGE_SIZE ];BUG_ON (*page); - *page =alloc_page (GFP_KERNEL | __GFP_ZERO); + *page =alloc_page (GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO);if (*page ==NULL ) {printk (KERN_ERR "binder: %d: binder_alloc_buf failed " "for page at %p\n" , proc->pid, page_addr);
Greg Kroah-Hartman
maintainerPATCH 19/54 Drivers: hv: Cleanup error handling in vmbus_open()
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: "K. Y. Srinivasan" <[email protected]>
commit 1392550240aaa72ce3a094a38bd23525cd67ce60 upstream.
Fix a memory leak in the error handling path in the function vmbus_open().
--- drivers/hv/channel.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-)
drivers/hv/channel.c +13 -11
@@ -146,14 +146,14 @@ int vmbus_open(struct vmbus_channel *newif (ret !=0 ) { err = ret; - goto errorout; + goto error0; } ret =hv_ringbuffer_init ( &newchannel->inbound, in, recv_ringbuffer_size);if (ret !=0 ) { err = ret; - goto errorout; + goto error0; }
@@ -168,7 +168,7 @@ int vmbus_open(struct vmbus_channel *newif (ret !=0 ) { err = ret; - goto errorout; + goto error0; }/* Create and init the channel open message */
@@ -177,7 +177,7 @@ int vmbus_open(struct vmbus_channel *new GFP_KERNEL);if (!open_info) { err = -ENOMEM ; - goto errorout; + goto error0; }init_completion (&open_info->waitevent);
@@ -193,7 +193,7 @@ int vmbus_open(struct vmbus_channel *newif (userdatalen >MAX_USER_DEFINED_BYTES ) { err = -EINVAL ; - goto errorout; + goto error0; }if (userdatalen)
@@ -208,19 +208,18 @@ int vmbus_open(struct vmbus_channel *new sizeof(struct vmbus_channel_open_channel));if (ret !=0 ) - goto cleanup; + goto error1; t =wait_for_completion_timeout (&open_info->waitevent,5 *HZ );if (t ==0 ) { err = -ETIMEDOUT ; - goto errorout; + goto error1; }if (open_info->response.open_result.status) err = open_info->response.open_result.status; -cleanup:spin_lock_irqsave (&vmbus_connection.channelmsg_lock, flags);list_del (&open_info->msglistentry);spin_unlock_irqrestore (&vmbus_connection.channelmsg_lock, flags);
@@ -228,9 +227,12 @@ cleanup:kfree (open_info);return err; -errorout: -hv_ringbuffer_cleanup (&newchannel->outbound); -hv_ringbuffer_cleanup (&newchannel->inbound); +error1: +spin_lock_irqsave (&vmbus_connection.channelmsg_lock, flags); +list_del (&open_info->msglistentry); +spin_unlock_irqrestore (&vmbus_connection.channelmsg_lock, flags); + +error0:free_pages ((unsigned long )out,get_order (send_ringbuffer_size + recv_ringbuffer_size));kfree (open_info);
Greg Kroah-Hartman
maintainerPATCH 20/54 ehci: fix Lucid nohandoff pci quirk to be more generic with BIOS versions
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anisse Astier <[email protected]>
commit c323dc023b9501e5d09582ec7efd1d40a9001d99 upstream.
BIOS vendors keep changing the BIOS versions. Only match the beginning of the string to match all Lucid tablets with board name M11JB.
--- drivers/usb/host/pci-quirks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/pci-quirks.c +1 -1
@@ -545,7 +545,7 @@ static const struct dmi_system_id __devi/* Pegatron Lucid (Ordissimo AIRIS) */ .matches = {DMI_MATCH (DMI_BOARD_NAME ,"M11JB" ), - DMI_MATCH(DMI_BIOS_VERSION, "Lucid-GE-133"), + DMI_MATCH(DMI_BIOS_VERSION, "Lucid-"), }, }, { }
Greg Kroah-Hartman
maintainerPATCH 21/54 ehci: Add yet-another Lucid nohandoff pci quirk
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anisse Astier <[email protected]>
commit 8daf8b6086f9d575200cd0aa3797e26137255609 upstream.
Board name changed on another shipping Lucid tablet.
--- drivers/usb/host/pci-quirks.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/usb/host/pci-quirks.c +7 -0
@@ -548,6 +548,13 @@ static const struct dmi_system_id __devi DMI_MATCH(DMI_BIOS_VERSION, "Lucid-"), }, }, + { + /* Pegatron Lucid (Ordissimo) */ + .matches = { + DMI_MATCH(DMI_BOARD_NAME, "Ordissimo"), + DMI_MATCH(DMI_BIOS_VERSION, "Lucid-"), + }, + }, { } };
Greg Kroah-Hartman
maintainerPATCH 22/54 usb-storage: add unusual_devs entry for Casio EX-N1 digital camera
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Shigorin <[email protected]>
commit d7870af7e2e3a91b462075ec1ca669b482215187 upstream.
This commit sets removable subclass for Casio EX-N1 digital camera.
The patch has been tested within an ALT Linux kernel:
http://git.altlinux.org/people/led/packages/?p=kernel-image-3.0.git;a=commitdiff;h=c0fd891836e89fe0c93a4d536a59216d90e4e3e7
See also https://bugzilla.kernel.org/show_bug.cgi?id=49221
--- drivers/usb/storage/unusual_devs.h | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/usb/storage/unusual_devs.h +6 -0
@@ -1004,6 +1004,12 @@ UNUSUAL_DEV( 0x07cf, 0x1001, 0x1000, 0x9 USB_SC_8070, USB_PR_CB, NULL, US_FL_NEED_OVERRIDE | US_FL_FIX_INQUIRY ), +/* Submitted by Oleksandr Chumachenko <[email protected]> */ +UNUSUAL_DEV (0x07cf ,0x1167 ,0x0100 ,0x0100 , +"Casio" , +"EX-N1 DigitalCamera" , +USB_SC_8070 ,USB_PR_DEVICE ,NULL ,0 ), +/* Submitted by Hartmut Wahl <[email protected]>*/ UNUSUAL_DEV( 0x0839, 0x000a, 0x0001, 0x0001, "Samsung",
Greg Kroah-Hartman
maintainerPATCH 23/54 usb hub: send clear_tt_buffer_complete events when canceling TT clear work
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Octavian Purdila <[email protected]>
commit 3b6054da68f9b0d5ed6a7ed0f42a79e61904352c upstream.
There is a race condition in the USB hub code with regard to handling TT clear requests that can get the HCD driver in a deadlock. Usually when an TT clear request is scheduled it will be executed immediately:
<7>[ 6.077583] usb 2-1.3: unlink qh1-0e01/f4d4db00 start 0 [1/2 us] <3>[ 6.078041] usb 2-1: clear tt buffer port 3, a3 ep2 t04048d82 <7>[ 6.078299] hub_tt_work:731 <7>[ 9.309089] usb 2-1.5: link qh1-0e01/f4d506c0 start 0 [1/2 us] <7>[ 9.324526] ehci_hcd 0000:00:1d.0: reused qh f4d4db00 schedule <7>[ 9.324539] usb 2-1.3: link qh1-0e01/f4d4db00 start 0 [1/2 us] <7>[ 9.341530] usb 1-1.1: link qh4-0e01/f397aec0 start 2 [1/2 us] <7>[ 10.116159] usb 2-1.3: unlink qh1-0e01/f4d4db00 start 0 [1/2 us] <3>[ 10.116459] usb 2-1: clear tt buffer port 3, a3 ep2 t04048d82 <7>[ 10.116537] hub_tt_work:731
However, if a suspend operation is triggered before hub_tt_work is scheduled, hub_quiesce will cancel the work without notifying the HCD driver:
<3>[ 35.033941] usb 2-1: clear tt buffer port 3, a3 ep2 t04048d80 <5>[ 35.034022] sd 0:0:0:0: [sda] Stopping disk <7>[ 35.034039] hub 2-1:1.0: hub_suspend <7>[ 35.034067] usb 2-1: unlink qh256-0001/f3b1ab00 start 1 [1/0 us] <7>[ 35.035085] hub 1-0:1.0: hub_suspend <7>[ 35.035102] usb usb1: bus suspend, wakeup 0 <7>[ 35.035106] ehci_hcd 0000:00:1a.0: suspend root hub <7>[ 35.035298] hub 2-0:1.0: hub_suspend <7>[ 35.035313] usb usb2: bus suspend, wakeup 0 <7>[ 35.035315] ehci_hcd 0000:00:1d.0: suspend root hub <6>[ 35.250017] PM: suspend of devices complete after 216.979 msecs <6>[ 35.250822] PM: late suspend of devices complete after 0.799 msecs <7>[ 35.252343] ehci_hcd 0000:00:1d.0: wakeup: 1 <7>[ 35.262923] ehci_hcd 0000:00:1d.0: --> PCI D3hot <7>[ 35.263302] ehci_hcd 0000:00:1a.0: wakeup: 1 <7>[ 35.273912] ehci_hcd 0000:00:1a.0: --> PCI D3hot <6>[ 35.274254] PM: noirq suspend of devices complete after 23.442 msecs <6>[ 35.274975] ACPI: Preparing to enter system sleep state S3 <6>[ 35.292666] PM: Saving platform NVS memory <7>[ 35.295030] Disabling non-boot CPUs ... <6>[ 35.297351] CPU 1 is now offline <6>[ 35.300345] CPU 2 is now offline <6>[ 35.303929] CPU 3 is now offline <7>[ 35.303931] lockdep: fixing up alternatives. <6>[ 35.304825] Extended CMOS year: 2000
When the device will resume the EHCI driver will get stuck in ehci_endpoint_disable waiting for the tt_clearing flag to reset:
<0>[ 47.610967] usb 2-1.3: **** DPM device timeout **** <7>[ 47.610972] f2f11c60 00000092 f2f11c0c c10624a5 00000003 f4c6e880 c1c8a4c0 c1c8a4c0 <7>[ 47.610983] 15c55698 0000000b f56b34c0 f2a45b70 f4c6e880 00000082 f2a4602c f2f11c30 <7>[ 47.610993] c10787f8 f4cac000 f2a45b70 00000000 f4cac010 f2f11c58 00000046 00000001 <7>[ 47.611004] Call Trace: <7>[ 47.611006] [<c10624a5>] ? sched_clock_cpu+0xf5/0x160 <7>[ 47.611019] [<c10787f8>] ? lock_release_holdtime.part.22+0x88/0xf0 <7>[ 47.611026] [<c103ed46>] ? lock_timer_base.isra.35+0x26/0x50 <7>[ 47.611034] [<c17592d3>] ? schedule_timeout+0x133/0x290 <7>[ 47.611044] [<c175b43e>] schedule+0x1e/0x50 <7>[ 47.611051] [<c17592d8>] schedule_timeout+0x138/0x290 <7>[ 47.611057] [<c10624a5>] ? sched_clock_cpu+0xf5/0x160 <7>[ 47.611063] [<c103e560>] ? usleep_range+0x40/0x40 <7>[ 47.611070] [<c1759445>] schedule_timeout_uninterruptible+0x15/0x20 <7>[ 47.611077] [<c14935f4>] ehci_endpoint_disable+0x64/0x160 <7>[ 47.611084] [<c147d1ee>] ? usb_hcd_flush_endpoint+0x10e/0x1d0 <7>[ 47.611092] [<c1165663>] ? sysfs_add_file+0x13/0x20 <7>[ 47.611100] [<c147d5a9>] usb_hcd_disable_endpoint+0x29/0x40 <7>[ 47.611107] [<c147fafc>] usb_disable_endpoint+0x5c/0x80 <7>[ 47.611111] [<c147fb57>] usb_disable_interface+0x37/0x50 <7>[ 47.611116] [<c1477650>] usb_reset_and_verify_device+0x4b0/0x640 <7>[ 47.611122] [<c1474665>] ? hub_port_status+0xb5/0x100 <7>[ 47.611129] [<c147a975>] usb_port_resume+0xd5/0x220 <7>[ 47.611136] [<c148877f>] generic_resume+0xf/0x30 <7>[ 47.611142] [<c14821a3>] usb_resume+0x133/0x180 <7>[ 47.611147] [<c1473b10>] ? usb_dev_thaw+0x10/0x10 <7>[ 47.611152] [<c1473b1d>] usb_dev_resume+0xd/0x10 <7>[ 47.611157] [<c13baa60>] dpm_run_callback+0x40/0xb0 <7>[ 47.611164] [<c13bdb03>] ? pm_runtime_enable+0x43/0x70 <7>[ 47.611171] [<c13bafc6>] device_resume+0x1a6/0x2c0 <7>[ 47.611177] [<c13ba940>] ? dpm_show_time+0xe0/0xe0 <7>[ 47.611183] [<c13bb0f9>] async_resume+0x19/0x40 <7>[ 47.611189] [<c10580c4>] async_run_entry_fn+0x64/0x160 <7>[ 47.611196] [<c104a244>] ? process_one_work+0x104/0x480 <7>[ 47.611203] [<c104a24c>] ? process_one_work+0x10c/0x480 <7>[ 47.611209] [<c104a2c0>] process_one_work+0x180/0x480 <7>[ 47.611215] [<c104a244>] ? process_one_work+0x104/0x480 <7>[ 47.611220] [<c1058060>] ? async_schedule+0x10/0x10 <7>[ 47.611226] [<c104c15c>] worker_thread+0x11c/0x2f0 <7>[ 47.611233] [<c104c040>] ? manage_workers.isra.27+0x1f0/0x1f0 <7>[ 47.611239] [<c10507f8>] kthread+0x78/0x80 <7>[ 47.611244] [<c1750000>] ? timer_cpu_notify+0xd6/0x20d <7>[ 47.611253] [<c1050780>] ? __init_kthread_worker+0x60/0x60 <7>[ 47.611258] [<c176357e>] kernel_thread_helper+0x6/0xd <7>[ 47.611283] ------------[ cut here ]------------
This patch changes hub_quiesce behavior to flush the TT clear work instead of canceling it, to make sure that no TT clear request remains uncompleted before suspend.
--- drivers/usb/core/hub.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/usb/core/hub.c +5 -2
@@ -507,13 +507,16 @@ static void hub_tt_work(struct work_struint limit =100 ;spin_lock_irqsave (&hub->tt.lock, flags); -while (--limit && !list_empty (&hub->tt.clear_list)) { +while (!list_empty (&hub->tt.clear_list)) {struct list_head *next;struct usb_tt_clear *clear;struct usb_device *hdev = hub->hdev;const struct hc_driver *drv;int status; +if (!hub->quiescing && --limit <0 ) +break ; + next = hub->tt.clear_list.next; clear = list_entry (next, struct usb_tt_clear, clear_list);list_del (&clear->clear_list);
@@ -978,7 +981,7 @@ static void hub_quiesce(struct usb_hub *if (hub->has_indicators)cancel_delayed_work_sync (&hub->leds);if (hub->tt.hub) -cancel_work_sync (&hub->tt.clear_work); +flush_work_sync (&hub->tt.clear_work); }/* caller has locked the hub device */
Greg Kroah-Hartman
maintainerPATCH 24/54 USB: whiteheat: fix memory leak in error path
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit c129197c99550d356cf5f69b046994dd53cd1b9d upstream.
Make sure command buffer is deallocated in case of errors during attach.
--- drivers/usb/serial/whiteheat.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/serial/whiteheat.c +1 -0
@@ -525,6 +525,7 @@ no_firmware:"%s: please contact [email protected]\n" , serial->type->description);kfree (result); +kfree (command);return -ENODEV ; no_command_private:
Greg Kroah-Hartman
maintainerPATCH 25/54 USB: opticon: fix DMA from stack
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit ea0dbebffe118724cd4df7d9b071ea8ee48d48f0 upstream.
Make sure to allocate the control-message buffer dynamically as some platforms cannot do DMA from stack.
Note that only the first byte of the old buffer was used.
--- drivers/usb/serial/opticon.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/usb/serial/opticon.c +6 -1
@@ -160,7 +160,11 @@ static int send_control_msg(struct usb_s {struct usb_serial *serial = port->serial;int retval; -u8 buffer[2 ]; +u8 *buffer; + + buffer =kzalloc (1 ,GFP_KERNEL ); +if (!buffer) +return -ENOMEM ; buffer[0 ] = val;/* Send the message to the vendor control endpoint
@@ -169,6 +173,7 @@ static int send_control_msg(struct usb_s requesttype,USB_DIR_OUT |USB_TYPE_VENDOR |USB_RECIP_INTERFACE , 0, 0, buffer, 1, 0); +kfree (buffer);return retval; }
Greg Kroah-Hartman
maintainerPATCH 26/54 USB: opticon: fix memory leak in error path
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit acbf0e5263de563e25f7c104868e4490b9e72b13 upstream.
Fix memory leak in write error path.
--- drivers/usb/serial/opticon.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/serial/opticon.c +3 -1
@@ -297,7 +297,7 @@ static int opticon_write(struct tty_struif (!dr) {dev_err (&port->dev,"out of memory\n" ); count = -ENOMEM ; - goto error; + goto error_no_dr; } dr->bRequestType =USB_TYPE_VENDOR |USB_RECIP_INTERFACE |USB_DIR_OUT ;
@@ -327,6 +327,8 @@ static int opticon_write(struct tty_strureturn count; error: +kfree (dr); +error_no_dr:usb_free_urb (urb); error_no_urb:kfree (buffer);
Greg Kroah-Hartman
maintainerPATCH 27/54 USB: serial: Fix memory leak in sierra_release()
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lennart Sorensen <[email protected]>
commit f7bc5051667b74c3861f79eed98c60d5c3b883f7 upstream.
I found a memory leak in sierra_release() (well sierra_probe() I guess) that looses 8 bytes each time the driver releases a device.
--- drivers/usb/serial/sierra.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/serial/sierra.c +1 -0
@@ -992,6 +992,7 @@ static void sierra_release(struct usb_secontinue ;kfree (portdata); } +kfree (serial->private); }#ifdef CONFIG_PM
Greg Kroah-Hartman
maintainerPATCH 28/54 USB: sierra: fix memory leak in attach error path
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 7e41f9bcdd2e813ea2a3c40db291d87ea06b559f upstream.
Make sure port private data is deallocated on errors in attach.
--- drivers/usb/serial/sierra.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/usb/serial/sierra.c +8 -1
@@ -936,7 +936,7 @@ static int sierra_startup(struct usb_serdev_dbg (&port->dev,"%s: kmalloc for " "sierra_port_private (%d) failed!\n" , __func__, i); -return -ENOMEM ; + goto err; }spin_lock_init (&portdata->lock);init_usb_anchor (&portdata->active);
@@ -973,6 +973,13 @@ static int sierra_startup(struct usb_ser }return 0 ; +err: +for (--i; i >=0 ; --i) { + portdata =usb_get_serial_port_data (serial->port[i]); +kfree (portdata); + } + +return -ENOMEM ; }static void sierra_release (struct usb_serial *serial)
Greg Kroah-Hartman
maintainerPATCH 29/54 USB: sierra: fix memory leak in probe error path
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 084817d79399ab5ccab2f90a148b0369912a8369 upstream.
Move interface data allocation to attach so that it is deallocated on errors in usb-serial probe.
--- drivers/usb/serial/sierra.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/usb/serial/sierra.c +10 -6
@@ -171,7 +171,6 @@ static int sierra_probe(struct usb_seria {int result =0 ;struct usb_device *udev; -struct sierra_intf_private *data;u8 ifnum; udev = serial->dev;
@@ -199,11 +198,6 @@ static int sierra_probe(struct usb_seriareturn -ENODEV ; } - data = serial->private =kzalloc (sizeof (struct sierra_intf_private ),GFP_KERNEL ); -if (!data) -return -ENOMEM ; -spin_lock_init (&data->susp_lock); -return result; }
@@ -914,6 +908,7 @@ static void sierra_dtr_rts(struct usb_sestatic int sierra_startup (struct usb_serial *serial) {struct usb_serial_port *port; +struct sierra_intf_private *intfdata;struct sierra_port_private *portdata;struct sierra_iface_info *himemoryp =NULL ;int i;
@@ -921,6 +916,14 @@ static int sierra_startup(struct usb_serdev_dbg (&serial->dev->dev,"%s\n" , __func__); + intfdata =kzalloc (sizeof (*intfdata),GFP_KERNEL ); +if (!intfdata) +return -ENOMEM ; + +spin_lock_init (&intfdata->susp_lock); + +usb_set_serial_data (serial, intfdata); +/* Set Device mode to D0 */ sierra_set_power_state (serial->dev,0x0000 );
@@ -978,6 +981,7 @@ err: portdata =usb_get_serial_port_data (serial->port[i]);kfree (portdata); } +kfree (intfdata);return -ENOMEM ; }
Greg Kroah-Hartman
maintainerPATCH 30/54 USB: mos7840: fix urb leak at release
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 65a4cdbb170e4ec1a7fa0e94936d47e24a17b0e8 upstream.
Make sure control urb is freed at release.
--- drivers/usb/serial/mos7840.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/serial/mos7840.c +1 -0
@@ -2657,6 +2657,7 @@ static void mos7840_release(struct usb_s mos7840_port =mos7840_get_port_private (serial->port[i]);dbg ("mos7840_port %d = %p" , i, mos7840_port);if (mos7840_port) { +usb_free_urb (mos7840_port->control_urb);kfree (mos7840_port->ctrl_buf);kfree (mos7840_port->dr);kfree (mos7840_port);
Greg Kroah-Hartman
maintainerPATCH 31/54 USB: mos7840: fix port-device leak in error path
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 3eb55cc4ed88eee3b5230f66abcdbd2a91639eda upstream.
The driver set the usb-serial port pointers to NULL on errors in attach, effectively preventing usb-serial core from decrementing the port ref counters and releasing the port devices and associated data.
--- drivers/usb/serial/mos7840.c | 1 - 1 file changed, 1 deletion(-)
drivers/usb/serial/mos7840.c +0 -1
@@ -2590,7 +2590,6 @@ error:kfree (mos7840_port->ctrl_buf);usb_free_urb (mos7840_port->control_urb);kfree (mos7840_port); - serial->port[i] =NULL ; }return status; }
Greg Kroah-Hartman
maintainerPATCH 32/54 USB: mos7840: remove NULL-urb submission
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 28c3ae9a8cf45f439c9a0779ebd0256e2ae72813 upstream.
The private int_urb is never allocated so the submission from the control completion handler will always fail. Remove this odd piece of broken code.
--- drivers/usb/serial/mos7840.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-)
drivers/usb/serial/mos7840.c +1 -14
@@ -235,7 +235,6 @@ struct moschip_port {int port_num;/*Actual port number in the device(1,2,etc) */ struct urb *write_urb;/* write URB for this port */ struct urb *read_urb;/* read URB for this port */ -struct urb *int_urb;__u8 shadowLCR;/* last LCR value received */ __u8 shadowMCR;/* last MCR value received */ char open;
@@ -505,7 +504,6 @@ static void mos7840_control_callback(strunsigned char *data;struct moschip_port *mos7840_port;__u8 regval =0x0 ; -int result =0 ;int status = urb->status; mos7840_port = urb->context;
@@ -524,7 +522,7 @@ static void mos7840_control_callback(strdefault :dbg ("%s - nonzero urb status received: %d" , __func__, status); - goto exit; +return ; }dbg ("%s urb buffer size is %d" , __func__, urb->actual_length);
@@ -537,17 +535,6 @@ static void mos7840_control_callback(strmos7840_handle_new_msr (mos7840_port, regval); else if (mos7840_port->MsrLsr == 1) mos7840_handle_new_lsr(mos7840_port, regval); - -exit: -spin_lock (&mos7840_port->pool_lock); -if (!mos7840_port->zombie) - result =usb_submit_urb (mos7840_port->int_urb,GFP_ATOMIC ); -spin_unlock (&mos7840_port->pool_lock); -if (result) { -dev_err (&urb->dev->dev, -"%s - Error %d submitting interrupt urb\n" , - __func__, result); - } } static int mos7840_get_reg(struct moschip_port *mcs, __u16 Wval, __u16 reg,
Greg Kroah-Hartman
maintainerPATCH 33/54 USB: mos7840: remove invalid disconnect handling
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit e681b66f2e19fadbe8a7e2a17900978cb6bc921f upstream.
Remove private zombie flag used to signal disconnect and to prevent control urb from being submitted from interrupt urb completion handler.
The control urb will not be re-submitted as both the control urb and the interrupt urb is killed on disconnect.
--- drivers/usb/serial/mos7840.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/usb/serial/mos7840.c +1 -12
@@ -239,7 +239,6 @@ struct moschip_port {__u8 shadowMCR;/* last MCR value received */ char open;char open_ports; -char zombie;wait_queue_head_t wait_chase;/* for handling sleeping while waiting for chase to finish */ wait_queue_head_t delta_msr_wait;/* for handling sleeping while waiting for msr change to happen */ int delta_msr_cond;
@@ -642,14 +641,7 @@ static void mos7840_interrupt_callback(s wreg =MODEM_STATUS_REGISTER ;break ; } -spin_lock (&mos7840_port->pool_lock); -if (!mos7840_port->zombie) { - rv =mos7840_get_reg (mos7840_port, wval, wreg, &Data); - }else { -spin_unlock (&mos7840_port->pool_lock); -return ; - } -spin_unlock (&mos7840_port->pool_lock); + rv =mos7840_get_reg (mos7840_port, wval, wreg, &Data); } } }
@@ -2607,9 +2599,6 @@ static void mos7840_disconnect(struct us mos7840_port =mos7840_get_port_private (serial->port[i]);dbg ("mos7840_port %d = %p" , i, mos7840_port);if (mos7840_port) { -spin_lock_irqsave (&mos7840_port->pool_lock, flags); - mos7840_port->zombie =1 ; -spin_unlock_irqrestore (&mos7840_port->pool_lock, flags);usb_kill_urb (mos7840_port->control_urb); } }
Greg Kroah-Hartman
maintainerPATCH 34/54 vhost: fix mergeable bufs on BE hosts
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Michael S. Tsirkin" <[email protected]>
commit 910a578f7e9400a78a3b13aba0b4d2df16a2cb05 upstream.
We copy head count to a 16 bit field, this works by chance on LE but on BE guest gets 0. Fix it up.
--- drivers/vhost/net.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/vhost/net.c +2 -1
@@ -376,7 +376,8 @@ static void handle_rx(struct vhost_net * .hdr.gso_type = VIRTIO_NET_HDR_GSO_NONE };size_t total_len =0 ; -int err, headcount, mergeable; +int err, mergeable; +s16 headcount;size_t vhost_hlen, sock_hlen;size_t vhost_len, sock_len;/* TODO: check that we are running from vhost_worker? */
Greg Kroah-Hartman
maintainerPATCH 35/54 ARM: SAMSUNG: Add naming of s3c64xx-spi devices
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heiko Stuebner <[email protected]>
commit 308b3afb97dc342e9c4f958d8b4c459ae0e22bd7 upstream.
Commit a5238e360b71 (spi: s3c64xx: move controller information into driver data) introduced separate device names for the different subtypes of the spi controller but forgot to set these in the relevant machines.
To fix this introduce a s3c64xx_spi_setname function and populate all Samsung arches with the correct names. The function resides in a new header, as the s3c64xx-spi.h contains driver platform data and should therefore at some later point move out of the Samsung include dir.
Tested on a s3c2416-based machine.
--- arch/arm/mach-exynos/common.c | 5 ++++ arch/arm/mach-s3c24xx/s3c2416.c | 2 + arch/arm/mach-s3c24xx/s3c2443.c | 4 +++ arch/arm/mach-s5p64x0/common.c | 3 ++ arch/arm/mach-s5pc100/common.c | 3 ++ arch/arm/mach-s5pv210/common.c | 3 ++ arch/arm/plat-samsung/include/plat/spi-core.h | 30 ++++++++++++++++++++++++++ 7 files changed, 50 insertions(+)
arch/arm/mach-exynos/common.c +5 -0
@@ -44,6 +44,7 @@#include <plat/fimc-core.h> #include <plat/iic-core.h> #include <plat/tv-core.h> +#include <plat/spi-core.h> #include <plat/regs-serial.h> #include "common.h"
@@ -338,6 +339,8 @@ static void __init exynos4_map_io(void)s5p_fb_setname (0 ,"exynos4-fb" );s5p_hdmi_setname ("exynos4-hdmi" ); + +s3c64xx_spi_setname ("exynos4210-spi" ); }static void __init exynos5_map_io (void )
@@ -358,6 +361,8 @@ static void __init exynos5_map_io(void)s3c_i2c0_setname ("s3c2440-i2c" );s3c_i2c1_setname ("s3c2440-i2c" );s3c_i2c2_setname ("s3c2440-i2c" ); + +s3c64xx_spi_setname ("exynos4210-spi" ); }static void __init exynos4_init_clocks (int xtal)
arch/arm/mach-s3c24xx/s3c2416.c +2 -0
@@ -61,6 +61,7 @@#include <plat/nand-core.h> #include <plat/adc-core.h> #include <plat/rtc-core.h> +#include <plat/spi-core.h> static struct map_desc s3c2416_iodesc[]__initdata = {IODESC_ENT (WATCHDOG ),
@@ -131,6 +132,7 @@ void __init s3c2416_map_io(void)/* initialize device information early */ s3c2416_default_sdhci0 ();s3c2416_default_sdhci1 (); +s3c64xx_spi_setname ("s3c2443-spi" );iotable_init (s3c2416_iodesc,ARRAY_SIZE (s3c2416_iodesc)); }
arch/arm/mach-s3c24xx/s3c2443.c +4 -0
@@ -43,6 +43,7 @@#include <plat/nand-core.h> #include <plat/adc-core.h> #include <plat/rtc-core.h> +#include <plat/spi-core.h> static struct map_desc s3c2443_iodesc[]__initdata = {IODESC_ENT (WATCHDOG ),
@@ -100,6 +101,9 @@ void __init s3c2443_map_io(void) s3c24xx_gpiocfg_default.set_pull = s3c2443_gpio_setpull; s3c24xx_gpiocfg_default.get_pull = s3c2443_gpio_getpull; +/* initialize device information early */ +s3c64xx_spi_setname ("s3c2443-spi" ); +iotable_init (s3c2443_iodesc,ARRAY_SIZE (s3c2443_iodesc)); }
arch/arm/mach-s5p64x0/common.c +3 -0
@@ -44,6 +44,7 @@#include <plat/sdhci.h> #include <plat/adc-core.h> #include <plat/fb-core.h> +#include <plat/spi-core.h> #include <plat/gpio-cfg.h> #include <plat/regs-irqtype.h> #include <plat/regs-serial.h>
@@ -179,6 +180,7 @@ void __init s5p6440_map_io(void)/* initialize any device information early */ s3c_adc_setname ("s3c64xx-adc" );s3c_fb_setname ("s5p64x0-fb" ); +s3c64xx_spi_setname ("s5p64x0-spi" );s5p64x0_default_sdhci0 ();s5p64x0_default_sdhci1 ();
@@ -193,6 +195,7 @@ void __init s5p6450_map_io(void)/* initialize any device information early */ s3c_adc_setname ("s3c64xx-adc" );s3c_fb_setname ("s5p64x0-fb" ); +s3c64xx_spi_setname ("s5p64x0-spi" );s5p64x0_default_sdhci0 ();s5p64x0_default_sdhci1 ();
arch/arm/mach-s5pc100/common.c +3 -0
@@ -45,6 +45,7 @@#include <plat/fb-core.h> #include <plat/iic-core.h> #include <plat/onenand-core.h> +#include <plat/spi-core.h> #include <plat/regs-serial.h> #include <plat/watchdog-reset.h>
@@ -165,6 +166,8 @@ void __init s5pc100_map_io(void)s3c_onenand_setname ("s5pc100-onenand" );s3c_fb_setname ("s5pc100-fb" );s3c_cfcon_setname ("s5pc100-pata" ); + +s3c64xx_spi_setname ("s5pc100-spi" ); }void __init s5pc100_init_clocks (int xtal)
arch/arm/mach-s5pv210/common.c +3 -0
@@ -43,6 +43,7 @@#include <plat/iic-core.h> #include <plat/keypad-core.h> #include <plat/tv-core.h> +#include <plat/spi-core.h> #include <plat/regs-serial.h> #include "common.h"
@@ -196,6 +197,8 @@ void __init s5pv210_map_io(void)/* setup TV devices */ s5p_hdmi_setname ("s5pv210-hdmi" ); + +s3c64xx_spi_setname ("s5pv210-spi" ); }void __init s5pv210_init_clocks (int xtal)
arch/arm/plat-samsung/include/plat/spi-core.h new file +30 -0
@@ -0,0 +1,30 @@ +/* +* Copyright (C) 2012 Heiko Stuebner <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef __PLAT_S3C_SPI_CORE_H +#define __PLAT_S3C_SPI_CORE_H + +/* These functions are only for use with the core support code, such as +* the cpu specific initialisation code +*/ + +/* re-define device name depending on support. */ +static inline void s3c64xx_spi_setname (char *name) +{ +#ifdef CONFIG_S3C64XX_DEV_SPI0 + s3c64xx_device_spi0.name = name; +#endif +#ifdef CONFIG_S3C64XX_DEV_SPI1 + s3c64xx_device_spi1.name = name; +#endif +#ifdef CONFIG_S3C64XX_DEV_SPI2 + s3c64xx_device_spi2.name = name; +#endif +} + +#endif /* __PLAT_S3C_SPI_CORE_H */
Re: [ 35/54] ARM: SAMSUNG: Add naming of s3c64xx-spi devices
Quoted 202 lines · Greg Kroah-Hartman
3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heiko Stuebner <[email protected]>
commit
308b3afb97dc342e9c4f958d8b4c459ae0e22bd7upstream.Commit
a5238e360b71(spi: s3c64xx: move controller information into driver data) introduced separate device names for the different subtypes of the spi controller but forgot to set these in the relevant machines.To fix this introduce a
s3c64xx_spi_setnamefunction and populate all Samsung arches with the correct names. The function resides in a new header, as thes3c64xx-spi.hcontains driver platform data and should therefore at some later point move out of the Samsung include dir.Tested on a s3c2416-based machine.
Signed-off-by Heiko Stuebner <[email protected]>Reviewed-by Sylwester Nawrocki <[email protected]>[[email protected]: tested on mach-exynos]Tested-by Sylwester Nawrocki <[email protected]>Signed-off-by Kukjin Kim <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- arch/arm/mach-exynos/common.c | 5 ++++ arch/arm/mach-s3c24xx/s3c2416.c | 2 + arch/arm/mach-s3c24xx/s3c2443.c | 4 +++ arch/arm/mach-s5p64x0/common.c | 3 ++ arch/arm/mach-s5pc100/common.c | 3 ++ arch/arm/mach-s5pv210/common.c | 3 ++ arch/arm/plat-samsung/include/plat/spi-core.h | 30 ++++++++++++++++++++++++++ 7 files changed, 50 insertions(+)arch/arm/mach-exynos/common.c +5
-0@@ -44,6 +44,7 @@#include <plat/fimc-core.h> #include <plat/iic-core.h> #include <plat/tv-core.h> +#include <plat/spi-core.h> #include <plat/regs-serial.h> #include "common.h" @@ -338,6 +339,8 @@ static void __init exynos4_map_io(void)s5p_fb_setname (0 ,"exynos4-fb" );s5p_hdmi_setname ("exynos4-hdmi" ); + +s3c64xx_spi_setname ("exynos4210-spi" ); }static void __init exynos5_map_io (void )@@ -358,6 +361,8 @@ static void __init exynos5_map_io(void)s3c_i2c0_setname ("s3c2440-i2c" );s3c_i2c1_setname ("s3c2440-i2c" );s3c_i2c2_setname ("s3c2440-i2c" ); + +s3c64xx_spi_setname ("exynos4210-spi" ); }static void __init exynos4_init_clocks (int xtal)arch/arm/mach-s3c24xx/s3c2416.c +2
-0@@ -61,6 +61,7 @@#include <plat/nand-core.h> #include <plat/adc-core.h> #include <plat/rtc-core.h> +#include <plat/spi-core.h> static struct map_desc s3c2416_iodesc[]__initdata = {IODESC_ENT (WATCHDOG ),@@ -131,6 +132,7 @@ void __init s3c2416_map_io(void)/* initialize device information early */ s3c2416_default_sdhci0 ();s3c2416_default_sdhci1 (); +s3c64xx_spi_setname ("s3c2443-spi" );iotable_init (s3c2416_iodesc,ARRAY_SIZE (s3c2416_iodesc)); }arch/arm/mach-s3c24xx/s3c2443.c +4
-0@@ -43,6 +43,7 @@#include <plat/nand-core.h> #include <plat/adc-core.h> #include <plat/rtc-core.h> +#include <plat/spi-core.h> static struct map_desc s3c2443_iodesc[]__initdata = {IODESC_ENT (WATCHDOG ),@@ -100,6 +101,9 @@ void __init s3c2443_map_io(void) s3c24xx_gpiocfg_default.set_pull = s3c2443_gpio_setpull; s3c24xx_gpiocfg_default.get_pull = s3c2443_gpio_getpull; +/* initialize device information early */ +s3c64xx_spi_setname ("s3c2443-spi" ); +iotable_init (s3c2443_iodesc,ARRAY_SIZE (s3c2443_iodesc)); }arch/arm/mach-s5p64x0/common.c +3
-0@@ -44,6 +44,7 @@#include <plat/sdhci.h> #include <plat/adc-core.h> #include <plat/fb-core.h> +#include <plat/spi-core.h> #include <plat/gpio-cfg.h> #include <plat/regs-irqtype.h> #include <plat/regs-serial.h> @@ -179,6 +180,7 @@ void __init s5p6440_map_io(void)/* initialize any device information early */ s3c_adc_setname ("s3c64xx-adc" );s3c_fb_setname ("s5p64x0-fb" ); +s3c64xx_spi_setname ("s5p64x0-spi" );s5p64x0_default_sdhci0 ();s5p64x0_default_sdhci1 ();@@ -193,6 +195,7 @@ void __init s5p6450_map_io(void)/* initialize any device information early */ s3c_adc_setname ("s3c64xx-adc" );s3c_fb_setname ("s5p64x0-fb" ); +s3c64xx_spi_setname ("s5p64x0-spi" );s5p64x0_default_sdhci0 ();s5p64x0_default_sdhci1 ();arch/arm/mach-s5pc100/common.c +3
-0@@ -45,6 +45,7 @@#include <plat/fb-core.h> #include <plat/iic-core.h> #include <plat/onenand-core.h> +#include <plat/spi-core.h> #include <plat/regs-serial.h> #include <plat/watchdog-reset.h> @@ -165,6 +166,8 @@ void __init s5pc100_map_io(void)s3c_onenand_setname ("s5pc100-onenand" );s3c_fb_setname ("s5pc100-fb" );s3c_cfcon_setname ("s5pc100-pata" ); + +s3c64xx_spi_setname ("s5pc100-spi" ); }void __init s5pc100_init_clocks (int xtal)arch/arm/mach-s5pv210/common.c +3
-0@@ -43,6 +43,7 @@#include <plat/iic-core.h> #include <plat/keypad-core.h> #include <plat/tv-core.h> +#include <plat/spi-core.h> #include <plat/regs-serial.h> #include "common.h" @@ -196,6 +197,8 @@ void __init s5pv210_map_io(void)/* setup TV devices */ s5p_hdmi_setname ("s5pv210-hdmi" ); + +s3c64xx_spi_setname ("s5pv210-spi" ); }void __init s5pv210_init_clocks (int xtal)arch/arm/plat-samsung/include/plat/spi-core.h new file +30
-1@@ -0,0 +1,30 @@ +/* +* Copyright (C) 2012 Heiko Stuebner <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef __PLAT_S3C_SPI_CORE_H +#define __PLAT_S3C_SPI_CORE_H + +/* These functions are only for use with the core support code, such as +* the cpu specific initialisation code +*/ + +/* re-define device name depending on support. */ +static inline void s3c64xx_spi_setname (char *name) +{ +#ifdef CONFIG_S3C64XX_DEV_SPI0 + s3c64xx_device_spi0.name = name; +#endif +#ifdef CONFIG_S3C64XX_DEV_SPI1 + s3c64xx_device_spi1.name = name; +#endif +#ifdef CONFIG_S3C64XX_DEV_SPI2 + s3c64xx_device_spi2.name = name; +#endif +} + +#endif /* __PLAT_S3C_SPI_CORE_H */ --
Quoted 4 lines
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
This patch breaks Exynos5 spi on 3.4.17. The patch with the bug that this patch was supposed to address went in to 3.6 and not 3.4, so this patch causes a driver name mismatch when applied to 3.4.
Greg Kroah-Hartman
maintainerRe: [ 35/54] ARM: SAMSUNG: Add naming of s3c64xx-spi devices
Quoted 203 lines · Colin Cross
Quoted 201 lines · Greg Kroah-Hartman
3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heiko Stuebner <[email protected]>
commit
308b3afb97dc342e9c4f958d8b4c459ae0e22bd7upstream.Commit
a5238e360b71(spi: s3c64xx: move controller information into driver data) introduced separate device names for the different subtypes of the spi controller but forgot to set these in the relevant machines.To fix this introduce a
s3c64xx_spi_setnamefunction and populate all Samsung arches with the correct names. The function resides in a new header, as thes3c64xx-spi.hcontains driver platform data and should therefore at some later point move out of the Samsung include dir.Tested on a s3c2416-based machine.
Signed-off-by Heiko Stuebner <[email protected]>Reviewed-by Sylwester Nawrocki <[email protected]>[[email protected]: tested on mach-exynos]Tested-by Sylwester Nawrocki <[email protected]>Signed-off-by Kukjin Kim <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- arch/arm/mach-exynos/common.c | 5 ++++ arch/arm/mach-s3c24xx/s3c2416.c | 2 + arch/arm/mach-s3c24xx/s3c2443.c | 4 +++ arch/arm/mach-s5p64x0/common.c | 3 ++ arch/arm/mach-s5pc100/common.c | 3 ++ arch/arm/mach-s5pv210/common.c | 3 ++ arch/arm/plat-samsung/include/plat/spi-core.h | 30 ++++++++++++++++++++++++++ 7 files changed, 50 insertions(+)arch/arm/mach-exynos/common.c +5
-0@@ -44,6 +44,7 @@#include <plat/fimc-core.h> #include <plat/iic-core.h> #include <plat/tv-core.h> +#include <plat/spi-core.h> #include <plat/regs-serial.h> #include "common.h" @@ -338,6 +339,8 @@ static void __init exynos4_map_io(void)s5p_fb_setname (0 ,"exynos4-fb" );s5p_hdmi_setname ("exynos4-hdmi" ); + +s3c64xx_spi_setname ("exynos4210-spi" ); }static void __init exynos5_map_io (void )@@ -358,6 +361,8 @@ static void __init exynos5_map_io(void)s3c_i2c0_setname ("s3c2440-i2c" );s3c_i2c1_setname ("s3c2440-i2c" );s3c_i2c2_setname ("s3c2440-i2c" ); + +s3c64xx_spi_setname ("exynos4210-spi" ); }static void __init exynos4_init_clocks (int xtal)arch/arm/mach-s3c24xx/s3c2416.c +2
-0@@ -61,6 +61,7 @@#include <plat/nand-core.h> #include <plat/adc-core.h> #include <plat/rtc-core.h> +#include <plat/spi-core.h> static struct map_desc s3c2416_iodesc[]__initdata = {IODESC_ENT (WATCHDOG ),@@ -131,6 +132,7 @@ void __init s3c2416_map_io(void)/* initialize device information early */ s3c2416_default_sdhci0 ();s3c2416_default_sdhci1 (); +s3c64xx_spi_setname ("s3c2443-spi" );iotable_init (s3c2416_iodesc,ARRAY_SIZE (s3c2416_iodesc)); }arch/arm/mach-s3c24xx/s3c2443.c +4
-0@@ -43,6 +43,7 @@#include <plat/nand-core.h> #include <plat/adc-core.h> #include <plat/rtc-core.h> +#include <plat/spi-core.h> static struct map_desc s3c2443_iodesc[]__initdata = {IODESC_ENT (WATCHDOG ),@@ -100,6 +101,9 @@ void __init s3c2443_map_io(void) s3c24xx_gpiocfg_default.set_pull = s3c2443_gpio_setpull; s3c24xx_gpiocfg_default.get_pull = s3c2443_gpio_getpull; +/* initialize device information early */ +s3c64xx_spi_setname ("s3c2443-spi" ); +iotable_init (s3c2443_iodesc,ARRAY_SIZE (s3c2443_iodesc)); }arch/arm/mach-s5p64x0/common.c +3
-0@@ -44,6 +44,7 @@#include <plat/sdhci.h> #include <plat/adc-core.h> #include <plat/fb-core.h> +#include <plat/spi-core.h> #include <plat/gpio-cfg.h> #include <plat/regs-irqtype.h> #include <plat/regs-serial.h> @@ -179,6 +180,7 @@ void __init s5p6440_map_io(void)/* initialize any device information early */ s3c_adc_setname ("s3c64xx-adc" );s3c_fb_setname ("s5p64x0-fb" ); +s3c64xx_spi_setname ("s5p64x0-spi" );s5p64x0_default_sdhci0 ();s5p64x0_default_sdhci1 ();@@ -193,6 +195,7 @@ void __init s5p6450_map_io(void)/* initialize any device information early */ s3c_adc_setname ("s3c64xx-adc" );s3c_fb_setname ("s5p64x0-fb" ); +s3c64xx_spi_setname ("s5p64x0-spi" );s5p64x0_default_sdhci0 ();s5p64x0_default_sdhci1 ();arch/arm/mach-s5pc100/common.c +3
-0@@ -45,6 +45,7 @@#include <plat/fb-core.h> #include <plat/iic-core.h> #include <plat/onenand-core.h> +#include <plat/spi-core.h> #include <plat/regs-serial.h> #include <plat/watchdog-reset.h> @@ -165,6 +166,8 @@ void __init s5pc100_map_io(void)s3c_onenand_setname ("s5pc100-onenand" );s3c_fb_setname ("s5pc100-fb" );s3c_cfcon_setname ("s5pc100-pata" ); + +s3c64xx_spi_setname ("s5pc100-spi" ); }void __init s5pc100_init_clocks (int xtal)arch/arm/mach-s5pv210/common.c +3
-0@@ -43,6 +43,7 @@#include <plat/iic-core.h> #include <plat/keypad-core.h> #include <plat/tv-core.h> +#include <plat/spi-core.h> #include <plat/regs-serial.h> #include "common.h" @@ -196,6 +197,8 @@ void __init s5pv210_map_io(void)/* setup TV devices */ s5p_hdmi_setname ("s5pv210-hdmi" ); + +s3c64xx_spi_setname ("s5pv210-spi" ); }void __init s5pv210_init_clocks (int xtal)arch/arm/plat-samsung/include/plat/spi-core.h new file +30
-0@@ -0,0 +1,30 @@ +/* +* Copyright (C) 2012 Heiko Stuebner <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef __PLAT_S3C_SPI_CORE_H +#define __PLAT_S3C_SPI_CORE_H + +/* These functions are only for use with the core support code, such as +* the cpu specific initialisation code +*/ + +/* re-define device name depending on support. */ +static inline void s3c64xx_spi_setname (char *name) +{ +#ifdef CONFIG_S3C64XX_DEV_SPI0 + s3c64xx_device_spi0.name = name; +#endif +#ifdef CONFIG_S3C64XX_DEV_SPI1 + s3c64xx_device_spi1.name = name; +#endif +#ifdef CONFIG_S3C64XX_DEV_SPI2 + s3c64xx_device_spi2.name = name; +#endif +} + +#endif /* __PLAT_S3C_SPI_CORE_H */
Quoted 9 lines
Quoted 5 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/This patch breaks Exynos5 spi on 3.4.17. The patch with the bug that this patch was supposed to address went in to 3.6 and not 3.4, so this patch causes a driver name mismatch when applied to 3.4.
Ah, thanks for letting me know. I'll revert this for the next stable release. It didn't get into any other older kernel (like 3.0 or 3.2), and also needs to be reverted there, did it?
thanks,
greg k-h
Re: [ 35/54] ARM: SAMSUNG: Add naming of s3c64xx-spi devices
Quoted 214 lines · Greg Kroah-Hartman
Quoted 203 lines · Colin Cross
Quoted 201 lines · Greg Kroah-Hartman
3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heiko Stuebner <[email protected]>
commit
308b3afb97dc342e9c4f958d8b4c459ae0e22bd7upstream.Commit
a5238e360b71(spi: s3c64xx: move controller information into driver data) introduced separate device names for the different subtypes of the spi controller but forgot to set these in the relevant machines.To fix this introduce a
s3c64xx_spi_setnamefunction and populate all Samsung arches with the correct names. The function resides in a new header, as thes3c64xx-spi.hcontains driver platform data and should therefore at some later point move out of the Samsung include dir.Tested on a s3c2416-based machine.
Signed-off-by Heiko Stuebner <[email protected]>Reviewed-by Sylwester Nawrocki <[email protected]>[[email protected]: tested on mach-exynos]Tested-by Sylwester Nawrocki <[email protected]>Signed-off-by Kukjin Kim <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- arch/arm/mach-exynos/common.c | 5 ++++ arch/arm/mach-s3c24xx/s3c2416.c | 2 + arch/arm/mach-s3c24xx/s3c2443.c | 4 +++ arch/arm/mach-s5p64x0/common.c | 3 ++ arch/arm/mach-s5pc100/common.c | 3 ++ arch/arm/mach-s5pv210/common.c | 3 ++ arch/arm/plat-samsung/include/plat/spi-core.h | 30 ++++++++++++++++++++++++++ 7 files changed, 50 insertions(+)arch/arm/mach-exynos/common.c +5
-0@@ -44,6 +44,7 @@#include <plat/fimc-core.h> #include <plat/iic-core.h> #include <plat/tv-core.h> +#include <plat/spi-core.h> #include <plat/regs-serial.h> #include "common.h" @@ -338,6 +339,8 @@ static void __init exynos4_map_io(void)s5p_fb_setname (0 ,"exynos4-fb" );s5p_hdmi_setname ("exynos4-hdmi" ); + +s3c64xx_spi_setname ("exynos4210-spi" ); }static void __init exynos5_map_io (void )@@ -358,6 +361,8 @@ static void __init exynos5_map_io(void)s3c_i2c0_setname ("s3c2440-i2c" );s3c_i2c1_setname ("s3c2440-i2c" );s3c_i2c2_setname ("s3c2440-i2c" ); + +s3c64xx_spi_setname ("exynos4210-spi" ); }static void __init exynos4_init_clocks (int xtal)arch/arm/mach-s3c24xx/s3c2416.c +2
-0@@ -61,6 +61,7 @@#include <plat/nand-core.h> #include <plat/adc-core.h> #include <plat/rtc-core.h> +#include <plat/spi-core.h> static struct map_desc s3c2416_iodesc[]__initdata = {IODESC_ENT (WATCHDOG ),@@ -131,6 +132,7 @@ void __init s3c2416_map_io(void)/* initialize device information early */ s3c2416_default_sdhci0 ();s3c2416_default_sdhci1 (); +s3c64xx_spi_setname ("s3c2443-spi" );iotable_init (s3c2416_iodesc,ARRAY_SIZE (s3c2416_iodesc)); }arch/arm/mach-s3c24xx/s3c2443.c +4
-0@@ -43,6 +43,7 @@#include <plat/nand-core.h> #include <plat/adc-core.h> #include <plat/rtc-core.h> +#include <plat/spi-core.h> static struct map_desc s3c2443_iodesc[]__initdata = {IODESC_ENT (WATCHDOG ),@@ -100,6 +101,9 @@ void __init s3c2443_map_io(void) s3c24xx_gpiocfg_default.set_pull = s3c2443_gpio_setpull; s3c24xx_gpiocfg_default.get_pull = s3c2443_gpio_getpull; +/* initialize device information early */ +s3c64xx_spi_setname ("s3c2443-spi" ); +iotable_init (s3c2443_iodesc,ARRAY_SIZE (s3c2443_iodesc)); }arch/arm/mach-s5p64x0/common.c +3
-0@@ -44,6 +44,7 @@#include <plat/sdhci.h> #include <plat/adc-core.h> #include <plat/fb-core.h> +#include <plat/spi-core.h> #include <plat/gpio-cfg.h> #include <plat/regs-irqtype.h> #include <plat/regs-serial.h> @@ -179,6 +180,7 @@ void __init s5p6440_map_io(void)/* initialize any device information early */ s3c_adc_setname ("s3c64xx-adc" );s3c_fb_setname ("s5p64x0-fb" ); +s3c64xx_spi_setname ("s5p64x0-spi" );s5p64x0_default_sdhci0 ();s5p64x0_default_sdhci1 ();@@ -193,6 +195,7 @@ void __init s5p6450_map_io(void)/* initialize any device information early */ s3c_adc_setname ("s3c64xx-adc" );s3c_fb_setname ("s5p64x0-fb" ); +s3c64xx_spi_setname ("s5p64x0-spi" );s5p64x0_default_sdhci0 ();s5p64x0_default_sdhci1 ();arch/arm/mach-s5pc100/common.c +3
-0@@ -45,6 +45,7 @@#include <plat/fb-core.h> #include <plat/iic-core.h> #include <plat/onenand-core.h> +#include <plat/spi-core.h> #include <plat/regs-serial.h> #include <plat/watchdog-reset.h> @@ -165,6 +166,8 @@ void __init s5pc100_map_io(void)s3c_onenand_setname ("s5pc100-onenand" );s3c_fb_setname ("s5pc100-fb" );s3c_cfcon_setname ("s5pc100-pata" ); + +s3c64xx_spi_setname ("s5pc100-spi" ); }void __init s5pc100_init_clocks (int xtal)arch/arm/mach-s5pv210/common.c +3
-0@@ -43,6 +43,7 @@#include <plat/iic-core.h> #include <plat/keypad-core.h> #include <plat/tv-core.h> +#include <plat/spi-core.h> #include <plat/regs-serial.h> #include "common.h" @@ -196,6 +197,8 @@ void __init s5pv210_map_io(void)/* setup TV devices */ s5p_hdmi_setname ("s5pv210-hdmi" ); + +s3c64xx_spi_setname ("s5pv210-spi" ); }void __init s5pv210_init_clocks (int xtal)arch/arm/plat-samsung/include/plat/spi-core.h new file +30
-0@@ -0,0 +1,30 @@ +/* +* Copyright (C) 2012 Heiko Stuebner <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef __PLAT_S3C_SPI_CORE_H +#define __PLAT_S3C_SPI_CORE_H + +/* These functions are only for use with the core support code, such as +* the cpu specific initialisation code +*/ + +/* re-define device name depending on support. */ +static inline void s3c64xx_spi_setname (char *name) +{ +#ifdef CONFIG_S3C64XX_DEV_SPI0 + s3c64xx_device_spi0.name = name; +#endif +#ifdef CONFIG_S3C64XX_DEV_SPI1 + s3c64xx_device_spi1.name = name; +#endif +#ifdef CONFIG_S3C64XX_DEV_SPI2 + s3c64xx_device_spi2.name = name; +#endif +} + +#endif /* __PLAT_S3C_SPI_CORE_H */ Quoted 9 lines
Quoted 5 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/This patch breaks Exynos5 spi on 3.4.17. The patch with the bug that this patch was supposed to address went in to 3.6 and not 3.4, so this patch causes a driver name mismatch when applied to 3.4.
Quoted 7 lines
Ah, thanks for letting me know. I'll revert this for the next stable release. It didn't get into any other older kernel (like 3.0 or 3.2), and also needs to be reverted there, did it?
thanks,
greg k-h
I don't think so, it wouldn't have applied cleanly to anything earlier than 3.3.
Greg Kroah-Hartman
maintainerPATCH 36/54 ARM: at91/tc: fix typo in the DT document
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josh Wu <[email protected]>
commit 11930c530f3edf81160e4962e363d579f5cdce7e upstream.
--- Documentation/devicetree/bindings/arm/atmel-at91.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/arm/atmel-at91.txt +1 -1
@@ -8,7 +8,7 @@ PIT Timer required properties: shared across all System Controller members. TC/TCLIB Timer required properties: -- compatible: Should be "atmel,<chip>-pit". +- compatible: Should be "atmel,<chip>-tcb". <chip> can be "at91rm9200" or "at91sam9x5" - reg: Should contain registers location and length - interrupts: Should contain all interrupts for the TC block
Greg Kroah-Hartman
maintainerPATCH 37/54 ARM: at91/i2c: change id to let i2c-gpio work
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bo Shen <[email protected]>
commit 7840487cd6298f9f931103b558290d8d98d41c49 upstream.
The i2c core driver will turn the platform device ID to busnum When using platfrom device ID as -1, it means dynamically assigned the busnum. When writing code, we need to make sure the busnum, and call i2c_register_board_info(int busnum, ...) to register device if using -1, we do not know the value of busnum
In order to solve this issue, set the platform device ID as a fix number Here using 0 to match the busnum used in i2c_regsiter_board_info()
--- arch/arm/mach-at91/at91rm9200_devices.c | 2 +- arch/arm/mach-at91/at91sam9260_devices.c | 2 +- arch/arm/mach-at91/at91sam9261_devices.c | 2 +- arch/arm/mach-at91/at91sam9263_devices.c | 2 +- arch/arm/mach-at91/at91sam9rl_devices.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/mach-at91/at91rm9200_devices.c +1 -1
@@ -463,7 +463,7 @@ static struct i2c_gpio_platform_data pdastatic struct platform_device at91rm9200_twi_device = { .name ="i2c-gpio" , - .id =-1 , + .id =0 , .dev.platform_data = &pdata, };
arch/arm/mach-at91/at91sam9260_devices.c +1 -1
@@ -468,7 +468,7 @@ static struct i2c_gpio_platform_data pdastatic struct platform_device at91sam9260_twi_device = { .name ="i2c-gpio" , - .id =-1 , + .id =0 , .dev.platform_data = &pdata, };
arch/arm/mach-at91/at91sam9261_devices.c +1 -1
@@ -285,7 +285,7 @@ static struct i2c_gpio_platform_data pdastatic struct platform_device at91sam9261_twi_device = { .name ="i2c-gpio" , - .id =-1 , + .id =0 , .dev.platform_data = &pdata, };
arch/arm/mach-at91/at91sam9263_devices.c +1 -1
@@ -542,7 +542,7 @@ static struct i2c_gpio_platform_data pdastatic struct platform_device at91sam9263_twi_device = { .name ="i2c-gpio" , - .id =-1 , + .id =0 , .dev.platform_data = &pdata, };
arch/arm/mach-at91/at91sam9rl_devices.c +1 -1
@@ -314,7 +314,7 @@ static struct i2c_gpio_platform_data pdastatic struct platform_device at91sam9rl_twi_device = { .name ="i2c-gpio" , - .id =-1 , + .id =0 , .dev.platform_data = &pdata, };
Greg Kroah-Hartman
maintainerPATCH 38/54 ARM: at91: at91sam9g10: fix SOC type detection
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ivan Shugov <[email protected]>
commit 3d9a0183dd3423353e9e363bcc261c1220d05f9f upstream.
Newer at91sam9g10 SoC revision can't be detected, so the kernel can't boot with this kind of kernel panic:
"AT91: Impossible to detect the SOC type"
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Atmel AT91SAM9G10-EK
Ignoring tag cmdline (using the default kernel command line) bootconsole [earlycon0] enabled
Memory policy: ECC disabled, Data cache writeback
Kernel panic - not syncing: AT91: Impossible to detect the SOC type [<c00133d4>] (unwind_backtrace+0x0/0xe0) from [<c02366dc>] (panic+0x78/0x1cc) [<c02366dc>] (panic+0x78/0x1cc) from [<c02fa35c>] (at91_map_io+0x90/0xc8) [<c02fa35c>] (at91_map_io+0x90/0xc8) from [<c02f9860>] (paging_init+0x564/0x6d0) [<c02f9860>] (paging_init+0x564/0x6d0) from [<c02f7914>] (setup_arch+0x464/0x704) [<c02f7914>] (setup_arch+0x464/0x704) from [<c02f44f8>] (start_kernel+0x6c/0x2d4) [<c02f44f8>] (start_kernel+0x6c/0x2d4) from [<20008040>] (0x20008040)
The reason for this is that the Debug Unit Chip ID Register has changed between Engineering Sample and definitive revision of the SoC. Changing the check of cidr to socid will address the problem. We do not integrate this check to the list just above because we also have to make sure that the extended id is disregarded.
--- arch/arm/mach-at91/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-at91/setup.c +1 -1
@@ -146,7 +146,7 @@ static void __init soc_detect(u32 dbgu_b }/* at91sam9g10 */ -if ((cidr & ~AT91_CIDR_EXT ) ==ARCH_ID_AT91SAM9G10 ) { +if ((socid & ~AT91_CIDR_EXT ) ==ARCH_ID_AT91SAM9G10 ) { at91_soc_initdata.type =AT91_SOC_SAM9G10 ; at91_boot_soc = at91sam9261_soc; }
Greg Kroah-Hartman
maintainerPATCH 39/54 mac80211: check if key has TKIP type before updating IV
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanislaw Gruszka <[email protected]>
commit 4045f72bcf3c293c7c5932ef001742d8bb5ded76 upstream.
This patch fix corruption which can manifest itself by following crash when switching on rfkill switch with rt2x00 driver:
https://bugzilla.redhat.com/attachment.cgi?id=615362
Pointer key->u.ccmp.tfm of group key get corrupted in:
ieee80211_rx_h_michael_mic_verify():
/* update IV in key information to be able to detect replays */
rx->key->u.tkip.rx[rx->security_idx].iv32 = rx->tkip_iv32;
rx->key->u.tkip.rx[rx->security_idx].iv16 = rx->tkip_iv16;because rt2x00 always set RX_FLAG_MMIC_STRIPPED, even if key is not TKIP.
We already check type of the key in different path in ieee80211_rx_h_michael_mic_verify() function, so adding additional check here is reasonable.
--- net/mac80211/wpa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/mac80211/wpa.c +2 -1
@@ -106,7 +106,8 @@ ieee80211_rx_h_michael_mic_verify(structif (status->flag &RX_FLAG_MMIC_ERROR ) goto mic_fail; -if (!(status->flag &RX_FLAG_IV_STRIPPED ) && rx->key) +if (!(status->flag &RX_FLAG_IV_STRIPPED ) && rx->key && + rx->key->conf.cipher ==WLAN_CIPHER_SUITE_TKIP ) goto update_iv;return RX_CONTINUE ;
Greg Kroah-Hartman
maintainerPATCH 40/54 Bluetooth: SMP: Fix setting unknown auth_req bits
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hedberg <[email protected]>
commit 065a13e2cc665f6547dc7e8a9d6b6565badf940a upstream.
When sending a pairing request or response we should not just blindly copy the value that the remote device sent. Instead we should at least make sure to mask out any unknown bits. This is particularly critical from the upcoming LE Secure Connections feature perspective as incorrectly indicating support for it (by copying the remote value) would cause a failure to pair with devices that support it.
--- net/bluetooth/smp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/bluetooth/smp.c +4 -2
@@ -31,6 +31,8 @@#define SMP_TIMEOUT msecs_to_jiffies(30000) +#define AUTH_REQ_MASK 0x07 +static inline void swap128 (u8 src[16 ],u8 dst[16 ]) {int i;
@@ -229,7 +231,7 @@ static void build_pairing_cmd(struct l2c req->max_key_size =SMP_MAX_ENC_KEY_SIZE ; req->init_key_dist =0 ; req->resp_key_dist = dist_keys; - req->auth_req = authreq; + req->auth_req = (authreq &AUTH_REQ_MASK );return ; }
@@ -238,7 +240,7 @@ static void build_pairing_cmd(struct l2c rsp->max_key_size =SMP_MAX_ENC_KEY_SIZE ; rsp->init_key_dist =0 ; rsp->resp_key_dist = req->resp_key_dist & dist_keys; - rsp->auth_req = authreq; + rsp->auth_req = (authreq &AUTH_REQ_MASK ); }static u8 check_enc_key_size (struct l2cap_conn *conn,__u8 max_key_size)
Greg Kroah-Hartman
maintainerPATCH 41/54 freezer: exec should clear PF_NOFREEZE along with PF_KTHREAD
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleg Nesterov <[email protected]>
commit b40a79591ca918e7b91b0d9b6abd5d00f2e88c19 upstream.
flush_old_exec() clears PF_KTHREAD but forgets about PF_NOFREEZE.
--- fs/exec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/exec.c +2 -1
@@ -1114,7 +1114,8 @@ int flush_old_exec(struct linux_binprm * bprm->mm =NULL ;/* We're using it now */ set_fs (USER_DS ); - current->flags &= ~(PF_RANDOMIZE |PF_FORKNOEXEC |PF_KTHREAD ); + current->flags &= + ~(PF_RANDOMIZE |PF_FORKNOEXEC |PF_KTHREAD |PF_NOFREEZE );flush_thread (); current->personality &= ~bprm->per_clear;
Greg Kroah-Hartman
maintainerPATCH 42/54 dmaengine: sirf: fix a typo in dma_prep_interleaved
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Barry Song <[email protected]>
commit 5997e089e4c3a7f0958a8fb0a54ec2b5a6f06168 upstream.
either DEV_TO_MEM or MEM_TO_DEV is supported, so change OR to AND.
--- drivers/dma/sirf-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/sirf-dma.c +1 -1
@@ -428,7 +428,7 @@ static struct dma_async_tx_descriptor *sunsigned long iflags;int ret; -if ((xt->dir !=DMA_MEM_TO_DEV ) || (xt->dir !=DMA_DEV_TO_MEM )) { +if ((xt->dir !=DMA_MEM_TO_DEV ) && (xt->dir !=DMA_DEV_TO_MEM )) { ret = -EINVAL ; goto err_dir; }
Greg Kroah-Hartman
maintainerPATCH 43/54 dmaengine: sirf: fix a typo in moving running dma_desc to active queue
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Barry Song <[email protected]>
commit 26fd12209c08fe947be1828896ef4ffc5bd0e6df upstream.
list_move_tail(&schan->queued, &schan->active) makes the list_empty(schan->queued) undefined, we either should change it to:list_move_tail(schan->queued.next, &schan->active)
orlist_move_tail(&sdesc->node, &schan->active)
--- drivers/dma/sirf-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/sirf-dma.c +1 -1
@@ -109,7 +109,7 @@ static void sirfsoc_dma_execute(struct s sdesc = list_first_entry(&schan->queued, struct sirfsoc_dma_desc, node);/* Move the first queued descriptor to active list */ -list_move_tail (&schan->queued, &schan->active); +list_move_tail (&sdesc->node, &schan->active);/* Start the DMA transfer */ writel_relaxed(sdesc->width, sdma->base + SIRFSOC_DMA_WIDTH_0 +
Greg Kroah-Hartman
maintainerPATCH 44/54 dmaengine: imx-dma: fix missing unlock on error in imxdma_xfer_desc()
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Yongjun <[email protected]>
commit 720dfd250e48a8c7fd1b2b8645955413989c4ee0 upstream.
Add the missing unlock on the error handling path in function imxdma_xfer_desc().
--- drivers/dma/imx-dma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/dma/imx-dma.c +3 -1
@@ -473,8 +473,10 @@ static int imxdma_xfer_desc(struct imxdm slot = i;break ; } -if (slot <0 ) +if (slot <0 ) { +spin_unlock_irqrestore (&imxdma->lock, flags);return -EBUSY ; + } imxdma->slots_2d[slot].xsr = d->x; imxdma->slots_2d[slot].ysr = d->y;
Greg Kroah-Hartman
maintainerPATCH 45/54 bcma: fix unregistration of cores
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Piotr Haber <[email protected]>
commit 1fffa905adffbf0d3767fc978ef09afb830275eb upstream.
When cores are unregistered, entries
need to be removed from cores list in a safe manner.
--- drivers/bcma/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/bcma/main.c +3 -2
@@ -131,9 +131,10 @@ static int bcma_register_cores(struct bcstatic void bcma_unregister_cores (struct bcma_bus *bus) { -struct bcma_device *core; +struct bcma_device *core, *tmp; -list_for_each_entry (core, &bus->cores, list) { +list_for_each_entry_safe (core, tmp, &bus->cores, list) { +list_del (&core->list);if (core->dev_registered)device_unregister (&core->dev); }
Greg Kroah-Hartman
maintainerPATCH 46/54 cpufreq / powernow-k8: Remove usage of smp_processor_id() in preemptible code
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andreas Herrmann <[email protected]>
commit e4df1cbcc1f329e53a1fff7450b2229e0addff20 upstream.
Commit 6889125b8b4e09c5e53e6ecab3433bed1ce198c9
(cpufreq/powernow-k8: workqueue user shouldn't migrate the kworker to another CPU) causes powernow-k8 to trigger a preempt warning, e.g.:
BUG: using smp_processor_id() in preemptible [00000000] code: cpufreq/3776 caller is powernowk8_target+0x20/0x49 Pid: 3776, comm: cpufreq Not tainted 3.6.0 #9 Call Trace: [<ffffffff8125b447>] debug_smp_processor_id+0xc7/0xe0 [<ffffffff814877e7>] powernowk8_target+0x20/0x49 [<ffffffff81482b02>] __cpufreq_driver_target+0x82/0x8a [<ffffffff81484fc6>] cpufreq_governor_performance+0x4e/0x54 [<ffffffff81482c50>] __cpufreq_governor+0x8c/0xc9 [<ffffffff81482e6f>] __cpufreq_set_policy+0x1a9/0x21e [<ffffffff814839af>] store_scaling_governor+0x16f/0x19b [<ffffffff81484f16>] ? cpufreq_update_policy+0x124/0x124 [<ffffffff8162b4a5>] ? _raw_spin_unlock_irqrestore+0x2c/0x49 [<ffffffff81483640>] store+0x60/0x88 [<ffffffff811708c0>] sysfs_write_file+0xf4/0x130 [<ffffffff8111243b>] vfs_write+0xb5/0x151 [<ffffffff811126e0>] sys_write+0x4a/0x71 [<ffffffff816319a9>] system_call_fastpath+0x16/0x1b
Fix this by by always using work_on_cpu().
--- drivers/cpufreq/powernow-k8.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/cpufreq/powernow-k8.c +1 -8
@@ -1223,14 +1223,7 @@ static int powernowk8_target(struct cpufstruct powernowk8_target_arg pta = { .pol = pol, .targfreq = targfreq, .relation = relation }; -/* -* Must run on @pol->cpu. cpufreq core is responsible for ensuring -* that we're bound to the current CPU and pol->cpu stays online. -*/ -if (smp_processor_id () == pol->cpu) -return powernowk8_target_fn (&pta); -else -return work_on_cpu (pol->cpu, powernowk8_target_fn, &pta); +return work_on_cpu (pol->cpu, powernowk8_target_fn, &pta); }/* Driver entry point to verify the policy and range of frequencies */
Greg Kroah-Hartman
maintainerPATCH 47/54 Revert "ath9k_hw: Updated AR9003 tx gain table for 5GHz"
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <[email protected]>
commit 73b26df5fa1a6245d6fc982362518b620bc7c2fe upstream.
This reverts commit a240dc7b3c7463bd60cf0a9b2a90f52f78aae0fd.
This commit is reducing tx power by at least 10 db on some devices, e.g. the Buffalo WZR-HP-G450H.
--- drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h | 164 +++++++++---------- 1 file changed, 82 insertions(+), 82 deletions(-)
drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h +82 -82
@@ -533,107 +533,107 @@ static const u32 ar9300_2p2_baseband_corstatic const u32 ar9300Modes_high_power_tx_gain_table_2p2[][5 ] = {/* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ - {0x0000a2dc ,0x000cfff0 ,0x000cfff0 ,0x03aaa352 ,0x03aaa352 }, - {0x0000a2e0 ,0x000f0000 ,0x000f0000 ,0x03ccc584 ,0x03ccc584 }, - {0x0000a2e4 ,0x03f00000 ,0x03f00000 ,0x03f0f800 ,0x03f0f800 }, + {0x0000a2dc ,0x00033800 ,0x00033800 ,0x03aaa352 ,0x03aaa352 }, + {0x0000a2e0 ,0x0003c000 ,0x0003c000 ,0x03ccc584 ,0x03ccc584 }, + {0x0000a2e4 ,0x03fc0000 ,0x03fc0000 ,0x03f0f800 ,0x03f0f800 }, {0x0000a2e8 ,0x00000000 ,0x00000000 ,0x03ff0000 ,0x03ff0000 }, {0x0000a410 ,0x000050d9 ,0x000050d9 ,0x000050d9 ,0x000050d9 }, {0x0000a500 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 }, {0x0000a504 ,0x06000003 ,0x06000003 ,0x04000002 ,0x04000002 }, {0x0000a508 ,0x0a000020 ,0x0a000020 ,0x08000004 ,0x08000004 }, {0x0000a50c ,0x10000023 ,0x10000023 ,0x0b000200 ,0x0b000200 }, - {0x0000a510 ,0x15000028 ,0x15000028 ,0x0f000202 ,0x0f000202 }, - {0x0000a514 ,0x1b00002b ,0x1b00002b ,0x12000400 ,0x12000400 }, - {0x0000a518 ,0x1f020028 ,0x1f020028 ,0x16000402 ,0x16000402 }, - {0x0000a51c ,0x2502002b ,0x2502002b ,0x19000404 ,0x19000404 }, - {0x0000a520 ,0x2a04002a ,0x2a04002a ,0x1c000603 ,0x1c000603 }, - {0x0000a524 ,0x2e06002a ,0x2e06002a ,0x21000a02 ,0x21000a02 }, - {0x0000a528 ,0x3302202d ,0x3302202d ,0x25000a04 ,0x25000a04 }, - {0x0000a52c ,0x3804202c ,0x3804202c ,0x28000a20 ,0x28000a20 }, - {0x0000a530 ,0x3c06202c ,0x3c06202c ,0x2c000e20 ,0x2c000e20 }, - {0x0000a534 ,0x4108202d ,0x4108202d ,0x30000e22 ,0x30000e22 }, - {0x0000a538 ,0x4506402d ,0x4506402d ,0x34000e24 ,0x34000e24 }, - {0x0000a53c ,0x4906222d ,0x4906222d ,0x38001640 ,0x38001640 }, - {0x0000a540 ,0x4d062231 ,0x4d062231 ,0x3c001660 ,0x3c001660 }, - {0x0000a544 ,0x50082231 ,0x50082231 ,0x3f001861 ,0x3f001861 }, - {0x0000a548 ,0x5608422e ,0x5608422e ,0x43001a81 ,0x43001a81 }, - {0x0000a54c ,0x5a08442e ,0x5a08442e ,0x47001a83 ,0x47001a83 }, - {0x0000a550 ,0x5e0a4431 ,0x5e0a4431 ,0x4a001c84 ,0x4a001c84 }, - {0x0000a554 ,0x640a4432 ,0x640a4432 ,0x4e001ce3 ,0x4e001ce3 }, - {0x0000a558 ,0x680a4434 ,0x680a4434 ,0x52001ce5 ,0x52001ce5 }, - {0x0000a55c ,0x6c0a6434 ,0x6c0a6434 ,0x56001ce9 ,0x56001ce9 }, - {0x0000a560 ,0x6f0a6633 ,0x6f0a6633 ,0x5a001ceb ,0x5a001ceb }, - {0x0000a564 ,0x730c6634 ,0x730c6634 ,0x5d001eec ,0x5d001eec }, - {0x0000a568 ,0x730c6634 ,0x730c6634 ,0x5d001eec ,0x5d001eec }, - {0x0000a56c ,0x730c6634 ,0x730c6634 ,0x5d001eec ,0x5d001eec }, - {0x0000a570 ,0x730c6634 ,0x730c6634 ,0x5d001eec ,0x5d001eec }, - {0x0000a574 ,0x730c6634 ,0x730c6634 ,0x5d001eec ,0x5d001eec }, - {0x0000a578 ,0x730c6634 ,0x730c6634 ,0x5d001eec ,0x5d001eec }, - {0x0000a57c ,0x730c6634 ,0x730c6634 ,0x5d001eec ,0x5d001eec }, + {0x0000a510 ,0x16000220 ,0x16000220 ,0x0f000202 ,0x0f000202 }, + {0x0000a514 ,0x1c000223 ,0x1c000223 ,0x12000400 ,0x12000400 }, + {0x0000a518 ,0x21002220 ,0x21002220 ,0x16000402 ,0x16000402 }, + {0x0000a51c ,0x27002223 ,0x27002223 ,0x19000404 ,0x19000404 }, + {0x0000a520 ,0x2b022220 ,0x2b022220 ,0x1c000603 ,0x1c000603 }, + {0x0000a524 ,0x2f022222 ,0x2f022222 ,0x21000a02 ,0x21000a02 }, + {0x0000a528 ,0x34022225 ,0x34022225 ,0x25000a04 ,0x25000a04 }, + {0x0000a52c ,0x3a02222a ,0x3a02222a ,0x28000a20 ,0x28000a20 }, + {0x0000a530 ,0x3e02222c ,0x3e02222c ,0x2c000e20 ,0x2c000e20 }, + {0x0000a534 ,0x4202242a ,0x4202242a ,0x30000e22 ,0x30000e22 }, + {0x0000a538 ,0x4702244a ,0x4702244a ,0x34000e24 ,0x34000e24 }, + {0x0000a53c ,0x4b02244c ,0x4b02244c ,0x38001640 ,0x38001640 }, + {0x0000a540 ,0x4e02246c ,0x4e02246c ,0x3c001660 ,0x3c001660 }, + {0x0000a544 ,0x52022470 ,0x52022470 ,0x3f001861 ,0x3f001861 }, + {0x0000a548 ,0x55022490 ,0x55022490 ,0x43001a81 ,0x43001a81 }, + {0x0000a54c ,0x59022492 ,0x59022492 ,0x47001a83 ,0x47001a83 }, + {0x0000a550 ,0x5d022692 ,0x5d022692 ,0x4a001c84 ,0x4a001c84 }, + {0x0000a554 ,0x61022892 ,0x61022892 ,0x4e001ce3 ,0x4e001ce3 }, + {0x0000a558 ,0x65024890 ,0x65024890 ,0x52001ce5 ,0x52001ce5 }, + {0x0000a55c ,0x69024892 ,0x69024892 ,0x56001ce9 ,0x56001ce9 }, + {0x0000a560 ,0x6e024c92 ,0x6e024c92 ,0x5a001ceb ,0x5a001ceb }, + {0x0000a564 ,0x74026e92 ,0x74026e92 ,0x5d001eec ,0x5d001eec }, + {0x0000a568 ,0x74026e92 ,0x74026e92 ,0x5d001eec ,0x5d001eec }, + {0x0000a56c ,0x74026e92 ,0x74026e92 ,0x5d001eec ,0x5d001eec }, + {0x0000a570 ,0x74026e92 ,0x74026e92 ,0x5d001eec ,0x5d001eec }, + {0x0000a574 ,0x74026e92 ,0x74026e92 ,0x5d001eec ,0x5d001eec }, + {0x0000a578 ,0x74026e92 ,0x74026e92 ,0x5d001eec ,0x5d001eec }, + {0x0000a57c ,0x74026e92 ,0x74026e92 ,0x5d001eec ,0x5d001eec }, {0x0000a580 ,0x00800000 ,0x00800000 ,0x00800000 ,0x00800000 }, {0x0000a584 ,0x06800003 ,0x06800003 ,0x04800002 ,0x04800002 }, {0x0000a588 ,0x0a800020 ,0x0a800020 ,0x08800004 ,0x08800004 }, {0x0000a58c ,0x10800023 ,0x10800023 ,0x0b800200 ,0x0b800200 }, - {0x0000a590 ,0x15800028 ,0x15800028 ,0x0f800202 ,0x0f800202 }, - {0x0000a594 ,0x1b80002b ,0x1b80002b ,0x12800400 ,0x12800400 }, - {0x0000a598 ,0x1f820028 ,0x1f820028 ,0x16800402 ,0x16800402 }, - {0x0000a59c ,0x2582002b ,0x2582002b ,0x19800404 ,0x19800404 }, - {0x0000a5a0 ,0x2a84002a ,0x2a84002a ,0x1c800603 ,0x1c800603 }, - {0x0000a5a4 ,0x2e86002a ,0x2e86002a ,0x21800a02 ,0x21800a02 }, - {0x0000a5a8 ,0x3382202d ,0x3382202d ,0x25800a04 ,0x25800a04 }, - {0x0000a5ac ,0x3884202c ,0x3884202c ,0x28800a20 ,0x28800a20 }, - {0x0000a5b0 ,0x3c86202c ,0x3c86202c ,0x2c800e20 ,0x2c800e20 }, - {0x0000a5b4 ,0x4188202d ,0x4188202d ,0x30800e22 ,0x30800e22 }, - {0x0000a5b8 ,0x4586402d ,0x4586402d ,0x34800e24 ,0x34800e24 }, - {0x0000a5bc ,0x4986222d ,0x4986222d ,0x38801640 ,0x38801640 }, - {0x0000a5c0 ,0x4d862231 ,0x4d862231 ,0x3c801660 ,0x3c801660 }, - {0x0000a5c4 ,0x50882231 ,0x50882231 ,0x3f801861 ,0x3f801861 }, - {0x0000a5c8 ,0x5688422e ,0x5688422e ,0x43801a81 ,0x43801a81 }, - {0x0000a5cc ,0x5a88442e ,0x5a88442e ,0x47801a83 ,0x47801a83 }, - {0x0000a5d0 ,0x5e8a4431 ,0x5e8a4431 ,0x4a801c84 ,0x4a801c84 }, - {0x0000a5d4 ,0x648a4432 ,0x648a4432 ,0x4e801ce3 ,0x4e801ce3 }, - {0x0000a5d8 ,0x688a4434 ,0x688a4434 ,0x52801ce5 ,0x52801ce5 }, - {0x0000a5dc ,0x6c8a6434 ,0x6c8a6434 ,0x56801ce9 ,0x56801ce9 }, - {0x0000a5e0 ,0x6f8a6633 ,0x6f8a6633 ,0x5a801ceb ,0x5a801ceb }, - {0x0000a5e4 ,0x738c6634 ,0x738c6634 ,0x5d801eec ,0x5d801eec }, - {0x0000a5e8 ,0x738c6634 ,0x738c6634 ,0x5d801eec ,0x5d801eec }, - {0x0000a5ec ,0x738c6634 ,0x738c6634 ,0x5d801eec ,0x5d801eec }, - {0x0000a5f0 ,0x738c6634 ,0x738c6634 ,0x5d801eec ,0x5d801eec }, - {0x0000a5f4 ,0x738c6634 ,0x738c6634 ,0x5d801eec ,0x5d801eec }, - {0x0000a5f8 ,0x738c6634 ,0x738c6634 ,0x5d801eec ,0x5d801eec }, - {0x0000a5fc ,0x738c6634 ,0x738c6634 ,0x5d801eec ,0x5d801eec }, + {0x0000a590 ,0x16800220 ,0x16800220 ,0x0f800202 ,0x0f800202 }, + {0x0000a594 ,0x1c800223 ,0x1c800223 ,0x12800400 ,0x12800400 }, + {0x0000a598 ,0x21802220 ,0x21802220 ,0x16800402 ,0x16800402 }, + {0x0000a59c ,0x27802223 ,0x27802223 ,0x19800404 ,0x19800404 }, + {0x0000a5a0 ,0x2b822220 ,0x2b822220 ,0x1c800603 ,0x1c800603 }, + {0x0000a5a4 ,0x2f822222 ,0x2f822222 ,0x21800a02 ,0x21800a02 }, + {0x0000a5a8 ,0x34822225 ,0x34822225 ,0x25800a04 ,0x25800a04 }, + {0x0000a5ac ,0x3a82222a ,0x3a82222a ,0x28800a20 ,0x28800a20 }, + {0x0000a5b0 ,0x3e82222c ,0x3e82222c ,0x2c800e20 ,0x2c800e20 }, + {0x0000a5b4 ,0x4282242a ,0x4282242a ,0x30800e22 ,0x30800e22 }, + {0x0000a5b8 ,0x4782244a ,0x4782244a ,0x34800e24 ,0x34800e24 }, + {0x0000a5bc ,0x4b82244c ,0x4b82244c ,0x38801640 ,0x38801640 }, + {0x0000a5c0 ,0x4e82246c ,0x4e82246c ,0x3c801660 ,0x3c801660 }, + {0x0000a5c4 ,0x52822470 ,0x52822470 ,0x3f801861 ,0x3f801861 }, + {0x0000a5c8 ,0x55822490 ,0x55822490 ,0x43801a81 ,0x43801a81 }, + {0x0000a5cc ,0x59822492 ,0x59822492 ,0x47801a83 ,0x47801a83 }, + {0x0000a5d0 ,0x5d822692 ,0x5d822692 ,0x4a801c84 ,0x4a801c84 }, + {0x0000a5d4 ,0x61822892 ,0x61822892 ,0x4e801ce3 ,0x4e801ce3 }, + {0x0000a5d8 ,0x65824890 ,0x65824890 ,0x52801ce5 ,0x52801ce5 }, + {0x0000a5dc ,0x69824892 ,0x69824892 ,0x56801ce9 ,0x56801ce9 }, + {0x0000a5e0 ,0x6e824c92 ,0x6e824c92 ,0x5a801ceb ,0x5a801ceb }, + {0x0000a5e4 ,0x74826e92 ,0x74826e92 ,0x5d801eec ,0x5d801eec }, + {0x0000a5e8 ,0x74826e92 ,0x74826e92 ,0x5d801eec ,0x5d801eec }, + {0x0000a5ec ,0x74826e92 ,0x74826e92 ,0x5d801eec ,0x5d801eec }, + {0x0000a5f0 ,0x74826e92 ,0x74826e92 ,0x5d801eec ,0x5d801eec }, + {0x0000a5f4 ,0x74826e92 ,0x74826e92 ,0x5d801eec ,0x5d801eec }, + {0x0000a5f8 ,0x74826e92 ,0x74826e92 ,0x5d801eec ,0x5d801eec }, + {0x0000a5fc ,0x74826e92 ,0x74826e92 ,0x5d801eec ,0x5d801eec }, {0x0000a600 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 }, {0x0000a604 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 }, - {0x0000a608 ,0x01804601 ,0x01804601 ,0x00000000 ,0x00000000 }, - {0x0000a60c ,0x01804601 ,0x01804601 ,0x00000000 ,0x00000000 }, - {0x0000a610 ,0x01804601 ,0x01804601 ,0x00000000 ,0x00000000 }, - {0x0000a614 ,0x01804601 ,0x01804601 ,0x01404000 ,0x01404000 }, - {0x0000a618 ,0x01804601 ,0x01804601 ,0x01404501 ,0x01404501 }, - {0x0000a61c ,0x01804601 ,0x01804601 ,0x02008501 ,0x02008501 }, - {0x0000a620 ,0x03408d02 ,0x03408d02 ,0x0280ca03 ,0x0280ca03 }, - {0x0000a624 ,0x0300cc03 ,0x0300cc03 ,0x03010c04 ,0x03010c04 }, - {0x0000a628 ,0x03410d04 ,0x03410d04 ,0x04014c04 ,0x04014c04 }, - {0x0000a62c ,0x03410d04 ,0x03410d04 ,0x04015005 ,0x04015005 }, - {0x0000a630 ,0x03410d04 ,0x03410d04 ,0x04015005 ,0x04015005 }, - {0x0000a634 ,0x03410d04 ,0x03410d04 ,0x04015005 ,0x04015005 }, - {0x0000a638 ,0x03410d04 ,0x03410d04 ,0x04015005 ,0x04015005 }, - {0x0000a63c ,0x03410d04 ,0x03410d04 ,0x04015005 ,0x04015005 }, - {0x0000b2dc ,0x000cfff0 ,0x000cfff0 ,0x03aaa352 ,0x03aaa352 }, - {0x0000b2e0 ,0x000f0000 ,0x000f0000 ,0x03ccc584 ,0x03ccc584 }, - {0x0000b2e4 ,0x03f00000 ,0x03f00000 ,0x03f0f800 ,0x03f0f800 }, + {0x0000a608 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 }, + {0x0000a60c ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 }, + {0x0000a610 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 }, + {0x0000a614 ,0x02004000 ,0x02004000 ,0x01404000 ,0x01404000 }, + {0x0000a618 ,0x02004801 ,0x02004801 ,0x01404501 ,0x01404501 }, + {0x0000a61c ,0x02808a02 ,0x02808a02 ,0x02008501 ,0x02008501 }, + {0x0000a620 ,0x0380ce03 ,0x0380ce03 ,0x0280ca03 ,0x0280ca03 }, + {0x0000a624 ,0x04411104 ,0x04411104 ,0x03010c04 ,0x03010c04 }, + {0x0000a628 ,0x04411104 ,0x04411104 ,0x04014c04 ,0x04014c04 }, + {0x0000a62c ,0x04411104 ,0x04411104 ,0x04015005 ,0x04015005 }, + {0x0000a630 ,0x04411104 ,0x04411104 ,0x04015005 ,0x04015005 }, + {0x0000a634 ,0x04411104 ,0x04411104 ,0x04015005 ,0x04015005 }, + {0x0000a638 ,0x04411104 ,0x04411104 ,0x04015005 ,0x04015005 }, + {0x0000a63c ,0x04411104 ,0x04411104 ,0x04015005 ,0x04015005 }, + {0x0000b2dc ,0x00033800 ,0x00033800 ,0x03aaa352 ,0x03aaa352 }, + {0x0000b2e0 ,0x0003c000 ,0x0003c000 ,0x03ccc584 ,0x03ccc584 }, + {0x0000b2e4 ,0x03fc0000 ,0x03fc0000 ,0x03f0f800 ,0x03f0f800 }, {0x0000b2e8 ,0x00000000 ,0x00000000 ,0x03ff0000 ,0x03ff0000 }, - {0x0000c2dc ,0x000cfff0 ,0x000cfff0 ,0x03aaa352 ,0x03aaa352 }, - {0x0000c2e0 ,0x000f0000 ,0x000f0000 ,0x03ccc584 ,0x03ccc584 }, - {0x0000c2e4 ,0x03f00000 ,0x03f00000 ,0x03f0f800 ,0x03f0f800 }, + {0x0000c2dc ,0x00033800 ,0x00033800 ,0x03aaa352 ,0x03aaa352 }, + {0x0000c2e0 ,0x0003c000 ,0x0003c000 ,0x03ccc584 ,0x03ccc584 }, + {0x0000c2e4 ,0x03fc0000 ,0x03fc0000 ,0x03f0f800 ,0x03f0f800 }, {0x0000c2e8 ,0x00000000 ,0x00000000 ,0x03ff0000 ,0x03ff0000 }, {0x00016044 ,0x012492d4 ,0x012492d4 ,0x012492d4 ,0x012492d4 }, - {0x00016048 ,0x61200001 ,0x61200001 ,0x66480001 ,0x66480001 }, + {0x00016048 ,0x66480001 ,0x66480001 ,0x66480001 ,0x66480001 }, {0x00016068 ,0x6db6db6c ,0x6db6db6c ,0x6db6db6c ,0x6db6db6c }, {0x00016444 ,0x012492d4 ,0x012492d4 ,0x012492d4 ,0x012492d4 }, - {0x00016448 ,0x61200001 ,0x61200001 ,0x66480001 ,0x66480001 }, + {0x00016448 ,0x66480001 ,0x66480001 ,0x66480001 ,0x66480001 }, {0x00016468 ,0x6db6db6c ,0x6db6db6c ,0x6db6db6c ,0x6db6db6c }, {0x00016844 ,0x012492d4 ,0x012492d4 ,0x012492d4 ,0x012492d4 }, - {0x00016848 ,0x61200001 ,0x61200001 ,0x66480001 ,0x66480001 }, + {0x00016848 ,0x66480001 ,0x66480001 ,0x66480001 ,0x66480001 }, {0x00016868 ,0x6db6db6c ,0x6db6db6c ,0x6db6db6c ,0x6db6db6c }, };
Greg Kroah-Hartman
maintainerPATCH 48/54 x86, mm: Find_early_table_space based on ranges that are actually being mapped
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jacob Shin <[email protected]>
commit 844ab6f993b1d32eb40512503d35ff6ad0c57030 upstream.
Current logic finds enough space for direct mapping page tables from 0 to end. Instead, we only need to find enough space to cover mr[0].start to mr[nr_range].end -- the range that is actually being mapped by init_memory_mapping()
This is needed after 1bbbbe779aabe1f0768c2bf8f8c0a5583679b54a, to address the panic reported here:
https://lkml.org/lkml/2012/10/20/160
https://lkml.org/lkml/2012/10/21/157
--- arch/x86/mm/init.c | 73 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 43 insertions(+), 30 deletions(-)
arch/x86/mm/init.c +43 -30
@@ -29,36 +29,54 @@ int direct_gbpages#endif ; -static void __init find_early_table_space (unsigned long end,int use_pse, -int use_gbpages) +struct map_range { +unsigned long start; +unsigned long end; +unsigned page_size_mask; +}; + +/* +* First calculate space needed for kernel direct mapping page tables to cover +* mr[0].start to mr[nr_range - 1].end, while accounting for possible 2M and 1GB +* pages. Then find enough contiguous space for those page tables. +*/ +static void __init find_early_table_space (struct map_range *mr,int nr_range) { -unsigned long puds, pmds, ptes, tables, start =0 , good_end = end; +int i; +unsigned long puds =0 , pmds =0 , ptes =0 , tables; +unsigned long start =0 , good_end;phys_addr_t base; - puds = (end +PUD_SIZE -1 ) >>PUD_SHIFT ; - tables =roundup (puds *sizeof (pud_t),PAGE_SIZE ); +for (i =0 ; i < nr_range; i++) { +unsigned long range, extra; -if (use_gbpages) { -unsigned long extra; + range = mr[i].end - mr[i].start; + puds += (range +PUD_SIZE -1 ) >>PUD_SHIFT ; - extra = end - ((end>>PUD_SHIFT ) <<PUD_SHIFT ); - pmds = (extra +PMD_SIZE -1 ) >>PMD_SHIFT ; - }else - pmds = (end +PMD_SIZE -1 ) >>PMD_SHIFT ; - - tables +=roundup (pmds *sizeof (pmd_t),PAGE_SIZE ); +if (mr[i].page_size_mask & (1 <<PG_LEVEL_1G )) { + extra = range - ((range >>PUD_SHIFT ) <<PUD_SHIFT ); + pmds += (extra +PMD_SIZE -1 ) >>PMD_SHIFT ; + }else { + pmds += (range +PMD_SIZE -1 ) >>PMD_SHIFT ; + } -if (use_pse) { -unsigned long extra; - - extra = end - ((end>>PMD_SHIFT ) <<PMD_SHIFT ); +if (mr[i].page_size_mask & (1 <<PG_LEVEL_2M )) { + extra = range - ((range >>PMD_SHIFT ) <<PMD_SHIFT );#ifdef CONFIG_X86_32 - extra +=PMD_SIZE ; + extra +=PMD_SIZE ;#endif - ptes = (extra +PAGE_SIZE -1 ) >>PAGE_SHIFT ; - }else - ptes = (end +PAGE_SIZE -1 ) >>PAGE_SHIFT ; +/* The first 2/4M doesn't use large pages. */ +if (mr[i].start <PMD_SIZE ) + extra += range; + + ptes += (extra +PAGE_SIZE -1 ) >>PAGE_SHIFT ; + }else { + ptes += (range +PAGE_SIZE -1 ) >>PAGE_SHIFT ; + } + } + tables =roundup (puds *sizeof (pud_t),PAGE_SIZE ); + tables +=roundup (pmds *sizeof (pmd_t),PAGE_SIZE ); tables +=roundup (ptes *sizeof (pte_t),PAGE_SIZE );#ifdef CONFIG_X86_32
@@ -75,8 +93,9 @@ static void __init find_early_table_spac pgt_buf_end = pgt_buf_start; pgt_buf_top = pgt_buf_start + (tables >>PAGE_SHIFT ); -printk (KERN_DEBUG "kernel direct mapping tables up to %lx @ %lx-%lx\n" , - end, pgt_buf_start <<PAGE_SHIFT , pgt_buf_top <<PAGE_SHIFT ); +printk (KERN_DEBUG "kernel direct mapping tables up to %#lx @ [mem %#010lx-%#010lx]\n" , + mr[nr_range -1 ].end -1 , pgt_buf_start <<PAGE_SHIFT , + (pgt_buf_top <<PAGE_SHIFT ) -1 ); }void __init native_pagetable_reserve (u64 start,u64 end)
@@ -84,12 +103,6 @@ void __init native_pagetable_reserve(u64memblock_reserve (start, end - start); } -struct map_range { -unsigned long start; -unsigned long end; -unsigned page_size_mask; -}; -#ifdef CONFIG_X86_32 #define NR_RANGE_MR 3#else /* CONFIG_X86_64 */
@@ -261,7 +274,7 @@ unsigned long __init_refok init_memory_m* nodes are discovered. */ if (!after_bootmem) -find_early_table_space (end, use_pse, use_gbpages); +find_early_table_space (mr, nr_range);for (i =0 ; i < nr_range; i++) ret = kernel_physical_mapping_init(mr[i].start, mr[i].end,
Greg Kroah-Hartman
maintainerPATCH 49/54 x86, mm: Undo incorrect revert in arch/x86/mm/init.c
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yinghai Lu <[email protected]>
commit f82f64dd9f485e13f29f369772d4a0e868e5633a upstream.
Commit
844ab6f9 x86, mm: Find_early_table_space based on ranges that are actually being mapped
added back some lines back wrongly that has been removed in commit
7b16bbf97 Revert "x86/mm: Fix the size calculation of mapping tables"
remove them again.
--- arch/x86/mm/init.c | 4 ---- 1 file changed, 4 deletions(-)
arch/x86/mm/init.c +0 -4
@@ -65,10 +65,6 @@ static void __init find_early_table_spac#ifdef CONFIG_X86_32 extra +=PMD_SIZE ;#endif -/* The first 2/4M doesn't use large pages. */ -if (mr[i].start <PMD_SIZE ) - extra += range; - ptes += (extra +PAGE_SIZE -1 ) >>PAGE_SHIFT ; }else { ptes += (range +PAGE_SIZE -1 ) >>PAGE_SHIFT ;
Greg Kroah-Hartman
maintainerPATCH 50/54 efi: Defer freeing boot services memory until after ACPI init
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josh Triplett <[email protected]>
commit 785107923a83d8456bbd8564e288a24d84109a46 upstream.
Some new ACPI 5.0 tables reference resources stored in boot services memory, so keep that memory around until we have ACPI and can extract data from it.
--- arch/x86/platform/efi/efi.c | 31 ++++++++++++++++++------------- include/linux/efi.h | 5 +++++ init/main.c | 3 +++ 3 files changed, 26 insertions(+), 13 deletions(-)
arch/x86/platform/efi/efi.c +18 -13
@@ -419,10 +419,21 @@ void __init efi_reserve_boot_services(vo } } -static void __init efi_free_boot_services (void ) +static void __init efi_unmap_memmap (void ) +{ +if (memmap.map) { +early_iounmap (memmap.map, memmap.nr_map * memmap.desc_size); + memmap.map =NULL ; + } +} + +void __init efi_free_boot_services (void ) {void *p; +if (!efi_native) +return ; +for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {efi_memory_desc_t *md = p;unsigned long long start = md->phys_addr;
@@ -438,6 +449,8 @@ static void __init efi_free_boot_servicefree_bootmem_late (start, size); } + +efi_unmap_memmap (); }static int __init efi_systab_init (void *phys)
@@ -787,8 +800,10 @@ void __init efi_enter_virtual_mode(void)* non-native EFI */ -if (!efi_native) - goto out; +if (!efi_native) { +efi_unmap_memmap (); +return ; + }/* Merge contiguous regions of the same type and attribute */ for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
@@ -878,13 +893,6 @@ void __init efi_enter_virtual_mode(void) }/* -* Thankfully, it does seem that no runtime services other than -* SetVirtualAddressMap() will touch boot services code, so we can -* get rid of it all at this point -*/ -efi_free_boot_services (); - -/* * Now that EFI is in virtual mode, update the function * pointers in the runtime service table to the new virtual addresses. *
@@ -907,9 +915,6 @@ void __init efi_enter_virtual_mode(void)if (__supported_pte_mask & _PAGE_NX)runtime_code_page_mkexec (); -out: -early_iounmap (memmap.map, memmap.nr_map * memmap.desc_size); - memmap.map =NULL ;kfree (new_memmap); }
include/linux/efi.h +5 -0
@@ -496,6 +496,11 @@ extern void efi_map_pal_code (void);extern void efi_memmap_walk (efi_freemem_callback_t callback,void *arg);extern void efi_gettimeofday (struct timespec *ts);extern void efi_enter_virtual_mode (void );/* switch EFI to virtual mode, if possible */ +#ifdef CONFIG_X86 +extern void efi_free_boot_services (void ); +#else +static inline void efi_free_boot_services (void ) {} +#endif extern u64 efi_get_iobase (void );extern u32 efi_mem_type (unsigned long phys_addr);extern u64 efi_mem_attributes (unsigned long phys_addr);
init/main.c +3 -0
@@ -630,6 +630,9 @@ asmlinkage void __init start_kernel(voidacpi_early_init ();/* before LAPIC and SMP init */ sfi_init_late (); +if (efi_enabled) +efi_free_boot_services (); +ftrace_init ();/* Do the rest non-__init'ed, we're now alive */
Greg Kroah-Hartman
maintainerPATCH 51/54 x86: efi: Turn off efi_enabled after setup on mixed fw/kernel
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Olof Johansson <[email protected]>
commit 5189c2a7c7769ee9d037d76c1a7b8550ccf3481c upstream.
When 32-bit EFI is used with 64-bit kernel (or vice versa), turn off efi_enabled once setup is done. Beyond setup, it is normally used to determine if runtime services are available and we will have none.
This will resolve issues stemming from efivars modprobe panicking on a 32/64-bit setup, as well as some reboot issues on similar setups.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=45991
--- arch/x86/include/asm/efi.h | 1 + arch/x86/kernel/setup.c | 12 ++++++++++++ arch/x86/platform/efi/efi.c | 18 ++++++++++-------- 3 files changed, 23 insertions(+), 8 deletions(-)
arch/x86/include/asm/efi.h +1 -0
@@ -98,6 +98,7 @@ extern void efi_set_executable(efi_memorextern int efi_memblock_x86_reserve_range (void );extern void efi_call_phys_prelog (void );extern void efi_call_phys_epilog (void ); +extern void efi_unmap_memmap (void );#ifndef CONFIG_EFI /*
arch/x86/kernel/setup.c +12 -0
@@ -1053,6 +1053,18 @@ void __init setup_arch(char **cmdline_p)mcheck_init ();arch_init_ideal_nops (); + +#ifdef CONFIG_EFI +/* Once setup is done above, disable efi_enabled on mismatched +* firmware/kernel archtectures since there is no support for +* runtime services. +*/ +if (efi_enabled &&IS_ENABLED (CONFIG_X86_64 ) != efi_64bit) { +pr_info ("efi: Setup done, disabling due to 32/64-bit mismatch\n" ); +efi_unmap_memmap (); + efi_enabled =0 ; + } +#endif }#ifdef CONFIG_X86_32
arch/x86/platform/efi/efi.c +10 -8
@@ -69,11 +69,15 @@ EXPORT_SYMBOL(efi);struct efi_memory_map memmap;bool efi_64bit; -static bool efi_native;static struct efi efi_phys__initdata ;static efi_system_table_t efi_systab__initdata ; +static inline bool efi_is_native (void ) +{ +return IS_ENABLED (CONFIG_X86_64 ) == efi_64bit; +} +static int __init setup_noefi (char *arg) { efi_enabled =0 ;
@@ -419,7 +423,7 @@ void __init efi_reserve_boot_services(vo } } -static void __init efi_unmap_memmap (void ) +void __init efi_unmap_memmap (void ) {if (memmap.map) {early_iounmap (memmap.map, memmap.nr_map * memmap.desc_size);
@@ -431,7 +435,7 @@ void __init efi_free_boot_services(void) {void *p; -if (!efi_native) +if (!efi_is_native ())return ;for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
@@ -683,12 +687,10 @@ void __init efi_init(void) return; } efi_phys.systab = (efi_system_table_t *)boot_params.efi_info.efi_systab; - efi_native = !efi_64bit;#else efi_phys.systab = (efi_system_table_t *) (boot_params.efi_info.efi_systab | ((__u64 )boot_params.efi_info.efi_systab_hi<<32 )); - efi_native = efi_64bit;#endif if (efi_systab_init (efi_phys.systab)) {
@@ -722,7 +724,7 @@ void __init efi_init(void)* that doesn't match the kernel 32/64-bit mode. */ -if (!efi_native) +if (!efi_is_native ())pr_info ("No EFI runtime due to 32/64-bit mismatch with kernel\n" );else if (efi_runtime_init ()) { efi_enabled =0 ;
@@ -734,7 +736,7 @@ void __init efi_init(void)return ; }#ifdef CONFIG_X86_32 -if (efi_native) { +if (efi_is_native ()) { x86_platform.get_wallclock = efi_get_time; x86_platform.set_wallclock = efi_set_rtc_mmss; }
@@ -800,7 +802,7 @@ void __init efi_enter_virtual_mode(void)* non-native EFI */ -if (!efi_native) { +if (!efi_is_native ()) {efi_unmap_memmap ();return ; }
Greg Kroah-Hartman
maintainerPATCH 52/54 staging: comedi: amplc_pc236: fix invalid register access during detach
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Abbott <[email protected]>
commit aaeb61a97b7159ebe30b18a422d04eeabfa8790b upstream.
pc236_detach() is called by the comedi core if it attempted to attach a device and failed. pc236_detach() calls pc236_intr_disable() if the comedi device private data pointer (devpriv) is non-null. This test is insufficient as pc236_intr_disable() accesses hardware registers and the attach routine may have failed before it has saved their I/O base addresses.
Fix it by checking dev->iobase is non-zero before calling pc236_intr_disable() as that means the I/O base addresses have been saved and the hardware registers can be accessed. It also implies the comedi device private data pointer is valid, so there is no need to check it.
--- drivers/staging/comedi/drivers/amplc_pc236.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/comedi/drivers/amplc_pc236.c +1 -1
@@ -468,7 +468,7 @@ static int pc236_detach(struct comedi_de {printk (KERN_DEBUG "comedi%d: %s: detach\n" , dev->minor,PC236_DRIVER_NAME ); -if (devpriv) +if (dev->iobase)pc236_intr_disable (dev);if (dev->irq)
Greg Kroah-Hartman
maintainerPATCH 53/54 x86, mm: Use memblock memory loop instead of e820_RAM
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yinghai Lu <[email protected]>
commit 1f2ff682ac951ed82cc043cf140d2851084512df upstream.
We need to handle E820_RAM and E820_RESERVED_KERNEL at the same time.
Also memblock has page aligned range for ram, so we could avoid mapping partial pages.
--- arch/x86/kernel/setup.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
arch/x86/kernel/setup.c +8 -7
@@ -928,18 +928,19 @@ void __init setup_arch(char **cmdline_p)#ifdef CONFIG_X86_64 if (max_pfn > max_low_pfn) {int i; -for (i =0 ; i < e820.nr_map; i++) { -struct e820entry *ei = &e820.map[i]; +unsigned long start, end; +unsigned long start_pfn, end_pfn; -if (ei->addr + ei->size <=1UL <<32 ) -continue ; +for_each_mem_pfn_range (i,MAX_NUMNODES , &start_pfn, &end_pfn, +NULL ) { -if (ei->type ==E820_RESERVED ) + end =PFN_PHYS (end_pfn); +if (end <= (1UL <<32 ))continue ; + start =PFN_PHYS (start_pfn); max_pfn_mapped =init_memory_mapping ( - ei->addr <1UL <<32 ?1UL <<32 : ei->addr, - ei->addr + ei->size); +max ((1UL <<32 ), start), end); }/* can we preseve max_low_pfn ?*/
Greg Kroah-Hartman
maintainerPATCH 54/54 drm/i915: no lvds quirk for Zotac ZDBOX SD ID12/ID13
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sjoerd Simons <[email protected]>
commit 9756fe38d10b2bf90c81dc4d2f17d5632e135364 upstream.
This box claims to have an LVDS interface but doesn't actually have one.
--- drivers/gpu/drm/i915/intel_lvds.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/i915/intel_lvds.c +8 -0
@@ -777,6 +777,14 @@ static const struct dmi_system_id intel_ DMI_MATCH(DMI_BOARD_NAME, "MS-7469"), }, }, + { + .callback = intel_no_lvds_dmi_callback, + .ident = "ZOTAC ZBOXSD-ID12/ID13", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ZOTAC"), + DMI_MATCH(DMI_BOARD_NAME, "ZBOXSD-ID12/ID13"), + }, + }, { }/* terminating entry */ };