commit ad07d7b92e72331be7fa555491d42686e8c4e925 Author: Greg Kroah-Hartman Date: Fri Apr 13 09:42:02 2012 -0700 Linux 3.3.2 commit 2ed63a49ab039d590f7f9fef63706d83805079c6 Author: Sujith Manoharan Date: Tue Apr 10 12:26:11 2012 +0530 Revert "ath9k: fix going to full-sleep on PS idle" commit 011afa1ed8c408d694957d2474d89dc81a60b70c upstream. This reverts commit c1afdaff90538ef085b756454f12b29575411214. Users have reported connection failures in 3.3.1 and suspend/resume failures in 3.4-rcX. Revert this commit for now - PS IDLE can be fixed in a clean manner later on. Signed-off-by: Sujith Manoharan Signed-off-by: John W. Linville Signed-off-by: Greg Kroah-Hartman commit b502007fc61b7799148ccd1bc4a502acd1a0b8fa Author: Oleg Nesterov Date: Mon Apr 9 21:03:50 2012 +0200 cred: copy_process() should clear child->replacement_session_keyring commit 79549c6dfda0603dba9a70a53467ce62d9335c33 upstream. keyctl_session_to_parent(task) sets ->replacement_session_keyring, it should be processed and cleared by key_replace_session_keyring(). However, this task can fork before it notices TIF_NOTIFY_RESUME and the new child gets the bogus ->replacement_session_keyring copied by dup_task_struct(). This is obviously wrong and, if nothing else, this leads to put_cred(already_freed_cred). change copy_creds() to clear this member. If copy_process() fails before this point the wrong ->replacement_session_keyring doesn't matter, exit_creds() won't be called. Signed-off-by: Oleg Nesterov Acked-by: David Howells Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman commit e4d3aa91a6b7d6a6ca73b6c169848f7acbecbd8f Author: Simon Arlott Date: Mon Feb 6 17:57:01 2012 -0300 media: dvb-core: fix DVBFE_ALGO_HW retune bug commit 45145b67f5895ff92207cffd74e65460a87920b2 upstream. Commit 7e07222 breaks DVBFE_ALGO_HW tuning after a retune is requested, which causes bad tuning on my TBS 6920. [ 0.769091] pci 0000:06:00.0: [14f1:8852] type 0 class 0x000400 [ 19.733530] CORE cx23885[0]: subsystem: 6920:8888, board: TurboSight TBS 6920 [card=14,autodetected] [ 762.824912] cx24116_load_firmware: FW version 1.23.86.1 7e0722215a510921cbb73ab4c37477d4dcb91bf8 [media] dvb-core: Don't pass DVBv3 parameters on tune() fops Although re_tune is set to true when FESTATE_RETUNE occurs, it is never set back to false which the old code used to do when !FESTATE_RETUNE. This patch sets re_tune to false if !(state & FESTATE_RETUNE). $ szap-s2 -a 2 "Channel 5" reading channels from file '/home/simon/.szap/channels.conf' zapping to 247 'Channel 5': delivery DVB-S, modulation QPSK sat 0, frequency 10964 MHz H, symbolrate 22000000, coderate 5/6, rolloff 0.35 vpid 0x092a, apid 0x092b, sid 0x092d using '/dev/dvb/adapter2/frontend0' and '/dev/dvb/adapter2/demux0' status 1f | signal cf40 | snr 0000 | ber 00000000 | unc 00000000 | FE_HAS_LOCK status 1f | signal cf40 | snr eccd | ber 00000000 | unc 00000000 | FE_HAS_LOCK status 1f | signal cf40 | snr 0000 | ber 00000000 | unc 00000000 | FE_HAS_LOCK status 1f | signal cf40 | snr 0000 | ber 00000000 | unc 00000000 | FE_HAS_LOCK status 1f | signal cf40 | snr eccd | ber 00000000 | unc 00000000 | FE_HAS_LOCK status 1f | signal cf40 | snr 0000 | ber 00000000 | unc 00000000 | FE_HAS_LOCK status 1f | signal cf40 | snr 0000 | ber 00000000 | unc 00000000 | FE_HAS_LOCK status 1f | signal cf40 | snr eb33 | ber 00000000 | unc 00000000 | FE_HAS_LOCK status 1f | signal cf40 | snr eccd | ber 00000000 | unc 00000000 | FE_HAS_LOCK status 1f | signal cf40 | snr eccd | ber 00000000 | unc 00000000 | FE_HAS_LOCK status 1f | signal cf40 | snr 0000 | ber 00000000 | unc 00000000 | FE_HAS_LOCK status 1f | signal cf40 | snr eccd | ber 00000000 | unc 00000000 | FE_HAS_LOCK status 1f | signal cf40 | snr eccd | ber 00000000 | unc 00000000 | FE_HAS_LOCK status 1f | signal cf40 | snr 0000 | ber 00000000 | unc 00000000 | FE_HAS_LOCK status 1f | signal cec0 | snr eccd | ber 00000000 | unc 00000000 | FE_HAS_LOCK status 1f | signal cec0 | snr 0000 | ber 00000000 | unc 00000000 | FE_HAS_LOCK Signed-off-by: Simon Arlott Signed-off-by: Mauro Carvalho Chehab commit 72043dfc657fa79898ec740fc7387b0efd767422 Author: Chris Rankin Date: Fri Apr 6 18:38:18 2012 -0300 media: dvb_frontend: regression fix: userspace ABI broken for xine commit 556a0442e08a8bc8541587a349cbf26ed14ec6de upstream. The commit e399ce77e6e has broken the DVB ABI for xine: The problem is that xine is expecting every event after a successful FE_SET_FRONTEND ioctl to have a non-zero frequency parameter, regardless of whether the tuning process has LOCKed yet. What used to happen is that the events inherited the initial tuning parameters from the FE_SET_FRONTEND call. However, the fepriv->parameters_out struct is now not initialised until the status contains the FE_HAS_LOCK bit. You might argue that this behaviour is intentional, except that if an application other than xine uses the DVB adapter and manages to set the parameters_out.frequency field to something other than zero, then xine no longer has any problems until either the adapter is replugged or the kernel modules reloaded. This can only mean that the fepriv->parameters_out struct still contains the (stale) tuning information from the previous application. Signed-off-by: Chris Rankin Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman commit 4b06fc96136303af61cd835bb1504f50cb23a615 Author: Stephen Warren Date: Thu Apr 5 23:11:16 2012 -0600 ASoC: tegra: fix i2s compilation when !CONFIG_DEBUG_FS commit 8abe05c6eb358967f16bce8a02c88d57c82cfbd6 upstream. Commit d4a2eca "ASoC: Tegra I2S: Remove dependency on pdev->id" changed the prototype of tegra_i2s_debug_add, but didn't update the dummy inline used when !CONFIG_DEBUG_FS. Fix that. Signed-off-by: Stephen Warren Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman commit 3ea212aa78fda0c2892595da96adc315da361225 Author: Kuninori Morimoto Date: Wed Apr 4 23:28:01 2012 -0700 ASoC: ak4642: fixup: mute needs +1 step commit 1f99e44cf059d2ed43c5a0724fa738b83800f725 upstream. ak4642 out_tlv is +12.0dB to -115.0 dB, and it supports mute. But current settings didn't care +1 step for mute. This patch adds it Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman commit c313cb6abc8ae377319b6f3b09cb39d71b663b2f Author: Laurent Pinchart Date: Tue Mar 27 05:51:00 2012 -0300 uvcvideo: Fix race-related crash in uvc_video_clock_update() commit ed0ee0ce0a3224dab5caa088a5f8b6df25924276 upstream. The driver frees the clock samples buffer before stopping the video buffers queue. If a DQBUF call arrives in-between, uvc_video_clock_update() will be called with a NULL clock samples buffer, leading to a crash. This occurs very frequently when using the webcam with the flash browser plugin. Move clock initialization/cleanup to uvc_video_enable() in order to free the clock samples buffer after the queue is stopped. Make sure the clock is reset at resume time to avoid miscalculating timestamps. Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman commit 44bf24730750a6270352352ad81b1e4c92ebd151 Author: Dan Williams Date: Fri Mar 23 13:36:42 2012 -0700 ioat: fix size of 'completion' for Xen commit 275029353953c2117941ade84f02a2303912fad1 upstream. Starting with v3.2 Jonathan reports that Xen crashes loading the ioatdma driver. A debug run shows: ioatdma 0000:00:16.4: desc[0]: (0x300cc7000->0x300cc7040) cookie: 0 flags: 0x2 ctl: 0x29 (op: 0 int_en: 1 compl: 1) ... ioatdma 0000:00:16.4: ioat_get_current_completion: phys_complete: 0xcc7000 ...which shows that in this environment GFP_KERNEL memory may be backed by a 64-bit dma address. This breaks the driver's assumption that an unsigned long should be able to contain the physical address for descriptor memory. Switch to dma_addr_t which beyond being the right size, is the true type for the data i.e. an io-virtual address inidicating the engine's last processed descriptor. Reported-by: Jonathan Nieder Reported-by: William Dauchy Tested-by: William Dauchy Tested-by: Dave Jiang Signed-off-by: Dan Williams Signed-off-by: Greg Kroah-Hartman commit 6e8a4b90444918039d29d411087a76a6ef6d0893 Author: Guan Xin Date: Mon Mar 26 04:11:46 2012 +0000 USB: Add Motorola Rokr E6 Id to the USBNet driver "zaurus" commit a2daf263107ba3eb6db33931881731fa51c95045 upstream. Added Vendor/Device Id of Motorola Rokr E6 (22b8:6027) so it can be recognized by the "zaurus" USBNet driver. Applies to Linux 3.2.13 and 2.6.39.4. Signed-off-by: Guan Xin Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman commit ecfd65893d4a411b29d7ed019100ef0b17b774cb Author: Nishanth Menon Date: Wed Feb 22 20:03:45 2012 -0600 mfd: Clear twl6030 IRQ status register only once commit 3f8349e6e98ba0455437724589072523865eae5e upstream. TWL6030 family of PMIC use a shadow interrupt status register while kernel processes the current interrupt event. However, any write(0 or 1) to register INT_STS_A, INT_STS_B or INT_STS_C clears all 3 interrupt status registers. Since clear of the interrupt is done on 32k clk, depending on I2C bus speed, we could in-adverently clear the status of a interrupt status pending on shadow register in the current implementation. This is due to the fact that multi-byte i2c write operation into three seperate status register could result in multiple load and clear of status and result in lost interrupts. Instead, doing a single byte write to INT_STS_A register with 0x0 will clear all three interrupt status registers without the related risk. Acked-by: Santosh Shilimkar Signed-off-by: Nishanth Menon Signed-off-by: Samuel Ortiz Signed-off-by: Greg Kroah-Hartman commit 1b41960c84ce5045cf5556678223bbe93a94497d Author: Salman Qazi Date: Fri Mar 9 16:41:01 2012 -0800 sched/x86: Fix overflow in cyc2ns_offset commit 9993bc635d01a6ee7f6b833b4ee65ce7c06350b1 upstream. When a machine boots up, the TSC generally gets reset. However, when kexec is used to boot into a kernel, the TSC value would be carried over from the previous kernel. The computation of cycns_offset in set_cyc2ns_scale is prone to an overflow, if the machine has been up more than 208 days prior to the kexec. The overflow happens when we multiply *scale, even though there is enough room to store the final answer. We fix this issue by decomposing tsc_now into the quotient and remainder of division by CYC2NS_SCALE_FACTOR and then performing the multiplication separately on the two components. Refactor code to share the calculation with the previous fix in __cycles_2_ns(). Signed-off-by: Salman Qazi Acked-by: John Stultz Acked-by: Peter Zijlstra Cc: Paul Turner Cc: john stultz Link: http://lkml.kernel.org/r/20120310004027.19291.88460.stgit@dungbeetle.mtv.corp.google.com Signed-off-by: Ingo Molnar Cc: Mike Galbraith Signed-off-by: Greg Kroah-Hartman commit 8bc8e9b14ba8c76a403478c0ad7b434be88a852b Author: Sachin Prabhu Date: Thu Mar 22 16:46:28 2012 +0000 Fix length of buffer copied in __nfs4_get_acl_uncached commit 20e0fa98b751facf9a1101edaefbc19c82616a68 upstream. _copy_from_pages() used to copy data from the temporary buffer to the user passed buffer is passed the wrong size parameter when copying data. res.acl_len contains both the bitmap and acl lenghts while acl_len contains the acl length after adjusting for the bitmap size. Signed-off-by: Sachin Prabhu Signed-off-by: Trond Myklebust Cc: Josh Boyer Signed-off-by: Greg Kroah-Hartman commit 4cc93da01185838336d188a2c219ebd1c38eb676 Author: Lee, Chun-Yi Date: Fri Mar 23 12:36:44 2012 +0800 acer-wmi: No wifi rfkill on Sony machines commit 5719b81988f3c24ff694dc3a37e35b35630a3966 upstream. The wireless rfkill should charged by sony-laptop but not acer-wmi. So, add Sony's SNY5001 acpi device to blacklist in acer-wmi. Tested on Sony Vaio Cc: Carlos Corbacho Cc: Matthew Garrett Cc: Mattia Dongili Cc: Dimitris N Tested-by: Dimitris N Signed-off-by: Lee, Chun-Yi Signed-off-by: Matthew Garrett Signed-off-by: Greg Kroah-Hartman commit e38de58c0b5aa4b047d60338d714dadcd401207b Author: Greg Kroah-Hartman Date: Tue Apr 10 16:04:49 2012 -0700 Revert "x86/ioapic: Add register level checks to detect bogus io-apic entries" This reverts commit a998dc2fa76f496d2944f0602b920d1d10d7467d [73d63d038ee9f769f5e5b46792d227fe20e442c5 upstream] It causes problems, so needs to be reverted from 3.2-stable for now. Reported-by: Konrad Rzeszutek Wilk Cc: Jon Dufresne Cc: Suresh Siddha Cc: Cc: Josh Boyer Cc: Ingo Molnar Cc: Teck Choon Giam Cc: Ben Guthro Signed-off-by: Greg Kroah-Hartman commit def81951735b03781b5e775a3f95c8fadf1a9b4b Author: Stanislaw Gruszka Date: Tue Mar 13 16:11:27 2012 +0100 iwlegacy: do not nulify il->vif on reset commit 883a649b737cdbe3ede7e50f3f939fd706ed5c4e upstream. This il->vif is dereferenced in different part of iwlegacy code, so do not nullify it. This should fix random crashes observed in companion with microcode errors i.e. crash in il3945_config_ap(). Additionally this should address also WARNING: at drivers/net/wireless/iwlegacy/common.c:4656 il_mac_remove_interface at least one of the possible reasons of that warning. Signed-off-by: Stanislaw Gruszka Signed-off-by: John W. Linville Signed-off-by: Greg Kroah-Hartman commit ba0aa95727fe064e8edbb1523829c520994bca95 Author: Tetsuo Handa Date: Wed Feb 29 21:53:22 2012 +0900 TOMOYO: Fix mount flags checking order. commit df91e49477a9be15921cb2854e1d12a3bdb5e425 upstream. Userspace can pass in arbitrary combinations of MS_* flags to mount(). If both MS_BIND and one of MS_SHARED/MS_PRIVATE/MS_SLAVE/MS_UNBINDABLE are passed, device name which should be checked for MS_BIND was not checked because MS_SHARED/MS_PRIVATE/MS_SLAVE/MS_UNBINDABLE had higher priority than MS_BIND. If both one of MS_BIND/MS_MOVE and MS_REMOUNT are passed, device name which should not be checked for MS_REMOUNT was checked because MS_BIND/MS_MOVE had higher priority than MS_REMOUNT. Fix these bugs by changing priority to MS_REMOUNT -> MS_BIND -> MS_SHARED/MS_PRIVATE/MS_SLAVE/MS_UNBINDABLE -> MS_MOVE as with do_mount() does. Also, unconditionally return -EINVAL if more than one of MS_SHARED/MS_PRIVATE/MS_SLAVE/MS_UNBINDABLE is passed so that TOMOYO will not generate inaccurate audit logs, for commit 7a2e8a8f "VFS: Sanity check mount flags passed to change_mnt_propagation()" clarified that these flags must be exclusively passed. Signed-off-by: Tetsuo Handa Signed-off-by: James Morris Signed-off-by: Greg Kroah-Hartman commit cea910408015eeb834f675deebd96145def2d6ef Author: David Rientjes Date: Mon Apr 9 16:56:18 2012 -0700 android, lowmemorykiller: remove task handoff notifier commit 83dbbdbb38666e20a75fad2294cf1df77c52f121 upstream. The task handoff notifier leaks task_struct since it never gets freed after the callback returns NOTIFY_OK, which means it is responsible for doing so. It turns out the lowmemorykiller actually doesn't need this notifier at all. It's used to prevent unnecessary killing by waiting for a thread to exit as a result of lowmem_shrink(), however, it's possible to do this in the same way the kernel oom killer works by setting TIF_MEMDIE and avoid killing if we're still waiting for it to exit. The kernel oom killer will already automatically set TIF_MEMDIE for threads that are attempting to allocate memory that have a fatal signal. The thread selected by lowmem_shrink() will have such a signal after the lowmemorykiller sends it a SIGKILL, so this won't result in an unnecessary use of memory reserves for the thread to exit. This has the added benefit that we don't have to rely on CONFIG_PROFILING to prevent needlessly killing tasks. Reported-by: Werner Landgraf Signed-off-by: David Rientjes Acked-by: Colin Cross Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman commit 10e55efe0d1d536312906e3685973febf3ecf07b Author: Axel Lin Date: Wed Jan 11 17:27:16 2012 +0800 mfd: Fix section mismatch warning for da9052-spi commit e536b62095301271d974983044a011c29fcb2ea2 upstream. Add __devinit annotation for da9052_spi_probe to fix below build warning: WARNING: drivers/built-in.o(.text+0x349b4): Section mismatch in reference from the function da9052_spi_probe() to the function .devinit.text:da9052_device_init() The function da9052_spi_probe() references the function __devinit da9052_device_init(). This is often because da9052_spi_probe lacks a __devinit annotation or the annotation of da9052_device_init is wrong. Also add __devexit annotation for da9052_spi_remove because we have __devexit_p around it in the remove callback. Signed-off-by: Axel Lin Signed-off-by: Samuel Ortiz Signed-off-by: Greg Kroah-Hartman commit 7edfce8502b19f2183fa81555cc4d0c869a24f47 Author: Frank Rowand Date: Mon Apr 9 17:59:03 2012 -0700 modpost: Fix modpost license checking of vmlinux.o commit 258f742635360175564e9470eb060ff4d4b984e7 upstream. Commit f02e8a6596b7 ("module: Sort exported symbols") sorts symbols placing each of them in its own elf section. This sorting and merging into the canonical sections are done by the linker. Unfortunately modpost to generate Module.symvers file parses vmlinux.o (which is not linked yet) and all modules object files (which aren't linked yet). These aren't sanitized by the linker yet. That breaks modpost that can't detect license properly for modules. This patch makes modpost aware of the new exported symbols structure. [ This above is a slightly corrected version of the explanation of the problem, copied from commit 62a2635610db ("modpost: Fix modpost's license checking V3"). That commit fixed the problem for module object files, but not for vmlinux.o. This patch fixes modpost for vmlinux.o. ] Signed-off-by: Frank Rowand Signed-off-by: Alessio Igor Bogani Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman commit 7c31d609fd06b5cf3353aacd2c394b06a06e757a Author: Stephen Warren Date: Wed Apr 4 15:48:33 2012 -0600 regmap: prevent division by zero in rbtree_show commit c04c1b9ee8f30c7a3a25e20e406247003f634ebe upstream. If there are no nodes in the cache, nodes will be 0, so calculating "registers / nodes" will cause division by zero. Signed-off-by: Stephen Warren Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman commit 9aa06b85e000ef2fcba2b8dfa3e57eb809e99026 Author: Kees Cook Date: Wed Apr 4 11:40:19 2012 -0700 sysctl: fix write access to dmesg_restrict/kptr_restrict commit 620f6e8e855d6d447688a5f67a4e176944a084e8 upstream. Commit bfdc0b4 adds code to restrict access to dmesg_restrict, however, it incorrectly alters kptr_restrict rather than dmesg_restrict. The original patch from Richard Weinberger (https://lkml.org/lkml/2011/3/14/362) alters dmesg_restrict as expected, and so the patch seems to have been misapplied. This adds the CAP_SYS_ADMIN check to both dmesg_restrict and kptr_restrict, since both are sensitive. Reported-by: Phillip Lougher Signed-off-by: Kees Cook Acked-by: Serge Hallyn Acked-by: Richard Weinberger Signed-off-by: James Morris Signed-off-by: Greg Kroah-Hartman commit 9fb1fd78804e9c0e477aafa69cd4d31b0a7ef5f0 Author: Mark Rustad Date: Tue Apr 3 10:24:52 2012 -0700 tcm_fc: Do not free tpg structure during wq allocation failure commit 06383f10c49f507220594a455c6491ca6f8c94ab upstream. Avoid freeing a registered tpg structure if an alloc_workqueue call fails. This fixes a bug where the failure was leaking memory associated with se_portal_group setup during the original core_tpg_register() call. Signed-off-by: Mark Rustad Acked-by: Kiran Patil Signed-off-by: Nicholas Bellinger Signed-off-by: Greg Kroah-Hartman commit c63d7f685447174639431744c7b0e1884f2a3742 Author: Mark Rustad Date: Tue Apr 3 10:24:41 2012 -0700 tcm_fc: Add abort flag for gracefully handling exchange timeout commit e1c4038282c7586c3544542b37872c434669d3ac upstream. Add abort flag and use it to terminate processing when an exchange is timed out or is reset. The abort flag is used in place of the transport_generic_free_cmd function call in the reset and timeout cases, because calling that function in that context would free memory that was in use. The aborted flag allows the lifetime to be managed in a more normal way, while truncating the processing. This change eliminates a source of memory corruption which manifested in a variety of ugly ways. (nab: Drop unused struct fc_exch *ep in ft_recv_seq) Signed-off-by: Mark Rustad Acked-by: Kiran Patil Signed-off-by: Nicholas Bellinger Signed-off-by: Greg Kroah-Hartman commit ac96adba1ac5899a5665a22768fdbe6b88656362 Author: Ludovic Desroches Date: Wed Mar 28 12:28:33 2012 +0200 mmc: atmel-mci: correct data timeout computation commit 66292ad92c6d3f2f1c137a1c826b331ca8595dfd upstream. The HSMCI operates at a rate of up to Master Clock divided by two. Moreover previous calculation can cause overflows and so wrong timeouts. Signed-off-by: Ludovic Desroches Acked-by: Nicolas Ferre Signed-off-by: Chris Ball Signed-off-by: Greg Kroah-Hartman commit 56d6515e51207145a9ee999c2373cb0c2ffd95c8 Author: Alf Høgemark Date: Wed Apr 4 12:27:09 2012 -0400 mmc: sdhci-dove: Fix compile error by including module.h commit 8c2fc8e413ecc2c96b696e28d4eb1bc6cee8dc84 upstream. This patch fixes a compile error in drivers/mmc/host/sdhci-dove.c by including the linux/module.h file. Signed-off-by: Alf Høgemark Signed-off-by: Chris Ball Signed-off-by: Greg Kroah-Hartman commit 5ee469cecc8e73d3d871d02acc863cbf6a9b9c8e Author: Rafael J. Wysocki Date: Sun Apr 1 00:34:58 2012 -0400 mmc: sdio: Use empty system suspend/resume callbacks at the bus level commit e841a7c69b708eeaf784fd517978006e8319b03a upstream. Neil Brown reports that commit 35cd133c PM: Run the driver callback directly if the subsystem one is not there breaks suspend for his libertas wifi, because SDIO has a protocol where the suspend method can return -ENOSYS and this means "There is no point in suspending, just turn me off". Moreover, the suspend methods provided by SDIO drivers are not supposed to be called by the PM core or bus-level suspend routines (which aren't presend for SDIO). Instead, when the SDIO core gets to suspend the device's ancestor, it calls the device driver's suspend function, catches the ENOSYS, and turns the device off. The commit above breaks the SDIO core's assumption that the device drivers' callbacks won't be executed if it doesn't provide any bus-level callbacks. If fact, however, this assumption has never been really satisfied, because device class or device type suspend might very well use the driver's callback even without that commit. The simplest way to address this problem is to make the SDIO core tell the PM core to ignore driver callbacks, for example by providing no-operation suspend/resume callbacks at the bus level for it, which is implemented by this change. Reported-and-tested-by: Neil Brown Signed-off-by: Rafael J. Wysocki Signed-off-by: Chris Ball Signed-off-by: Greg Kroah-Hartman commit 2efbdf28a6e9f4d87cb8f338116792f65ff793c5 Author: Nicolas Ferre Date: Wed Mar 28 11:56:28 2012 +0200 ARM: at91/USB host: specify and handle properly vbus_pin_active_low commit cca0355a09b1bfe9f8985285199a346e13cacf39 upstream. Due to an error while handling vbus_pin_active_low in ohci-at91 driver, the specification of this property was not good in devices/board files. Signed-off-by: Nicolas Ferre Acked-by: Jean-Christophe PLAGNIOL-VILLARD Signed-off-by: Greg Kroah-Hartman commit 11a960f55d1d76fbf3cdb92f6553c0f1d09594e9 Author: Nicolas Ferre Date: Wed Mar 21 14:38:55 2012 +0100 USB: ohci-at91: fix vbus_pin_active_low handling commit 1e7caf8bcf1b49eae152ad7cf442775472dd587c upstream. The information is not properly taken into account for {get|set}_power() functions. Signed-off-by: Nicolas Ferre Acked-by: Jean-Christophe PLAGNIOL-VILLARD Acked-by: Alan Stern Signed-off-by: Greg Kroah-Hartman commit 49c8ca7ade694f65de205adc08c23a710244b6b0 Author: Pavel Shilovsky Date: Wed Mar 28 21:56:19 2012 +0400 CIFS: Fix VFS lock usage for oplocked files commit 66189be74ff5f9f3fd6444315b85be210d07cef2 upstream. We can deadlock if we have a write oplock and two processes use the same file handle. In this case the first process can't unlock its lock if the second process blocked on the lock in the same time. Fix it by using posix_lock_file rather than posix_lock_file_wait under cinode->lock_mutex. If we request a blocking lock and posix_lock_file indicates that there is another lock that prevents us, wait untill that lock is released and restart our call. Acked-by: Jeff Layton Signed-off-by: Pavel Shilovsky Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman commit c9f568f1a99794aa7b749828c41fb7cdf55fe435 Author: Jason Wessel Date: Fri Mar 23 09:35:05 2012 -0500 x86,kgdb: Fix DEBUG_RODATA limitation using text_poke() commit 3751d3e85cf693e10e2c47c03c8caa65e171099b upstream. There has long been a limitation using software breakpoints with a kernel compiled with CONFIG_DEBUG_RODATA going back to 2.6.26. For this particular patch, it will apply cleanly and has been tested all the way back to 2.6.36. The kprobes code uses the text_poke() function which accommodates writing a breakpoint into a read-only page. The x86 kgdb code can solve the problem similarly by overriding the default breakpoint set/remove routines and using text_poke() directly. The x86 kgdb code will first attempt to use the traditional probe_kernel_write(), and next try using a the text_poke() function. The break point install method is tracked such that the correct break point removal routine will get called later on. Cc: x86@kernel.org Cc: Thomas Gleixner Cc: Ingo Molnar Cc: H. Peter Anvin Inspried-by: Masami Hiramatsu Signed-off-by: Jason Wessel Signed-off-by: Greg Kroah-Hartman commit 3c608af0c2643a9f17fef2f1cfa2a43a97bdf8a4 Author: Jason Wessel Date: Thu Mar 29 17:41:24 2012 -0500 kgdbts: (2 of 2) fix single step awareness to work correctly with SMP commit 23bbd8e346f1ef3fc1219c79cea53d8d52b207d8 upstream. The do_fork and sys_open tests have never worked properly on anything other than a UP configuration with the kgdb test suite. This is because the test suite did not fully implement the behavior of a real debugger. A real debugger tracks the state of what thread it asked to single step and can correctly continue other threads of execution or conditionally stop while waiting for the original thread single step request to return. Below is a simple method to cause a fatal kernel oops with the kgdb test suite on a 2 processor ARM system: while [ 1 ] ; do ls > /dev/null 2> /dev/null; done& while [ 1 ] ; do ls > /dev/null 2> /dev/null; done& echo V1I1F100 > /sys/module/kgdbts/parameters/kgdbts Very soon after starting the test the kernel will start warning with messages like: kgdbts: BP mismatch c002487c expected c0024878 ------------[ cut here ]------------ WARNING: at drivers/misc/kgdbts.c:317 check_and_rewind_pc+0x9c/0xc4() [] (check_and_rewind_pc+0x9c/0xc4) [] (validate_simple_test+0x3c/0xc4) [] (run_simple_test+0x1e8/0x274) The kernel will eventually recovers, but the test suite has completely failed to test anything useful. This patch implements behavior similar to a real debugger that does not rely on hardware single stepping by using only software planted breakpoints. In order to mimic a real debugger, the kgdb test suite now tracks the most recent thread that was continued (cont_thread_id), with the intent to single step just this thread. When the response to the single step request stops in a different thread that hit the original break point that thread will now get continued, while the debugger waits for the thread with the single step pending. Here is a high level description of the sequence of events. cont_instead_of_sstep = 0; 1) set breakpoint at do_fork 2) continue 3) Save the thread id where we stop to cont_thread_id 4) Remove breakpoint at do_fork 5) Reset the PC if needed depending on kernel exception type 6) soft single step 7) Check where we stopped if current thread != cont_thread_id { if (here for more than 2 times for the same thead) { ### must be a really busy system, start test again ### goto step 1 } goto step 5 } else { cont_instead_of_sstep = 0; } 8) clean up and run test again if needed 9) Clear out any threads that were waiting on a break point at the point in time the test is ended with get_cont_catch(). This happens sometimes because breakpoints are used in place of single stepping and some threads could have been in the debugger exception handling queue because breakpoints were hit concurrently on different CPUs. This also means we wait at least one second before unplumbing the debugger connection at the very end, so as respond to any debug threads waiting to be serviced. Signed-off-by: Jason Wessel Signed-off-by: Greg Kroah-Hartman commit 1d6091eb1a9b7a6ce75a333c907cde4b15222bde Author: Jason Wessel Date: Thu Mar 29 17:41:24 2012 -0500 kgdbts: (1 of 2) fix single step awareness to work correctly with SMP commit 486c5987a00a89d56c2c04c506417ef8f823ca2e upstream. The do_fork and sys_open tests have never worked properly on anything other than a UP configuration with the kgdb test suite. This is because the test suite did not fully implement the behavior of a real debugger. A real debugger tracks the state of what thread it asked to single step and can correctly continue other threads of execution or conditionally stop while waiting for the original thread single step request to return. Below is a simple method to cause a fatal kernel oops with the kgdb test suite on a 4 processor x86 system: while [ 1 ] ; do ls > /dev/null 2> /dev/null; done& while [ 1 ] ; do ls > /dev/null 2> /dev/null; done& while [ 1 ] ; do ls > /dev/null 2> /dev/null; done& while [ 1 ] ; do ls > /dev/null 2> /dev/null; done& echo V1I1F1000 > /sys/module/kgdbts/parameters/kgdbts Very soon after starting the test the kernel will oops with a message like: kgdbts: BP mismatch 3b7da66480 expected ffffffff8106a590 WARNING: at drivers/misc/kgdbts.c:303 check_and_rewind_pc+0xe0/0x100() Call Trace: [] check_and_rewind_pc+0xe0/0x100 [] validate_simple_test+0x25/0xc0 [] run_simple_test+0x107/0x2c0 [] kgdbts_put_char+0x18/0x20 The warn will turn to a hard kernel crash shortly after that because the pc will not get properly rewound to the right value after hitting a breakpoint leading to a hard lockup. This change is broken up into 2 pieces because archs that have hw single stepping (2.6.26 and up) need different changes than archs that do not have hw single stepping (3.0 and up). This change implements the correct behavior for an arch that supports hw single stepping. A minor defect was fixed where sys_open should be do_sys_open for the sys_open break point test. This solves the problem of running a 64 bit with a 32 bit user space. The sys_open() never gets called when using the 32 bit file system for the kgdb testsuite because the 32 bit binaries invoke the compat_sys_open() call leading to the test never completing. In order to mimic a real debugger, the kgdb test suite now tracks the most recent thread that was continued (cont_thread_id), with the intent to single step just this thread. When the response to the single step request stops in a different thread that hit the original break point that thread will now get continued, while the debugger waits for the thread with the single step pending. Here is a high level description of the sequence of events. cont_instead_of_sstep = 0; 1) set breakpoint at do_fork 2) continue 3) Save the thread id where we stop to cont_thread_id 4) Remove breakpoint at do_fork 5) Reset the PC if needed depending on kernel exception type 6) if (cont_instead_of_sstep) { continue } else { single step } 7) Check where we stopped if current thread != cont_thread_id { cont_instead_of_sstep = 1; goto step 5 } else { cont_instead_of_sstep = 0; } 8) clean up and run test again if needed Signed-off-by: Jason Wessel Signed-off-by: Greg Kroah-Hartman commit 6053b1e9ee29eb6daff652086ae06d2c577308a8 Author: Jason Wessel Date: Thu Mar 29 06:55:44 2012 -0500 kgdbts: Fix kernel oops with CONFIG_DEBUG_RODATA commit 456ca7ff24841bf2d2a2dfd690fe7d42ef70d932 upstream. On x86 the kgdb test suite will oops when the kernel is compiled with CONFIG_DEBUG_RODATA and you run the tests after boot time. This is regression has existed since 2.6.26 by commit: b33cb815 (kgdbts: Use HW breakpoints with CONFIG_DEBUG_RODATA). The test suite can use hw breakpoints for all the tests, but it has to execute the hardware breakpoint specific tests first in order to determine that the hw breakpoints actually work. Specifically the very first test causes an oops: # echo V1I1 > /sys/module/kgdbts/parameters/kgdbts kgdb: Registered I/O driver kgdbts. kgdbts:RUN plant and detach test Entering kdb (current=0xffff880017aa9320, pid 1078) on processor 0 due to Keyboard Entry [0]kdb> kgdbts: ERROR PUT: end of test buffer on 'plant_and_detach_test' line 1 expected OK got $E14#aa WARNING: at drivers/misc/kgdbts.c:730 run_simple_test+0x151/0x2c0() [...oops clipped...] This commit re-orders the running of the tests and puts the RODATA check into its own function so as to correctly avoid the kernel oops by detecting and using the hw breakpoints. Signed-off-by: Jason Wessel Signed-off-by: Greg Kroah-Hartman commit 28cd59a8278065cc77e8b630b184b64d643da4ec Author: Jason Wessel Date: Wed Mar 21 10:17:03 2012 -0500 kgdb,debug_core: pass the breakpoint struct instead of address and memory commit 98b54aa1a2241b59372468bd1e9c2d207bdba54b upstream. There is extra state information that needs to be exposed in the kgdb_bpt structure for tracking how a breakpoint was installed. The debug_core only uses the the probe_kernel_write() to install breakpoints, but this is not enough for all the archs. Some arch such as x86 need to use text_poke() in order to install a breakpoint into a read only page. Passing the kgdb_bpt structure to kgdb_arch_set_breakpoint() and kgdb_arch_remove_breakpoint() allows other archs to set the type variable which indicates how the breakpoint was installed. Signed-off-by: Jason Wessel Signed-off-by: Greg Kroah-Hartman commit dff2f8b03d16e976aac685dd8b7adbfa4cc730a6 Author: Rafael J. Wysocki Date: Wed Mar 28 23:30:28 2012 +0200 PM / Sleep: Mitigate race between the freezer and request_firmware() commit 247bc03742545fec2f79939a3b9f738392a0f7b4 upstream. There is a race condition between the freezer and request_firmware() such that if request_firmware() is run on one CPU and freeze_processes() is run on another CPU and usermodehelper_disable() called by it succeeds to grab umhelper_sem for writing before usermodehelper_read_trylock() called from request_firmware() acquires it for reading, the request_firmware() will fail and trigger a WARN_ON() complaining that it was called at a wrong time. However, in fact, it wasn't called at a wrong time and freeze_processes() simply happened to be executed simultaneously. To avoid this race, at least in some cases, modify usermodehelper_read_trylock() so that it doesn't fail if the freezing of tasks has just started and hasn't been completed yet. Instead, during the freezing of tasks, it will try to freeze the task that has called it so that it can wait until user space is thawed without triggering the scary warning. For this purpose, change usermodehelper_disabled so that it can take three different values, UMH_ENABLED (0), UMH_FREEZING and UMH_DISABLED. The first one means that usermode helpers are enabled, the last one means "hard disable" (i.e. the system is not ready for usermode helpers to be used) and the second one is reserved for the freezer. Namely, when freeze_processes() is started, it sets usermodehelper_disabled to UMH_FREEZING which tells usermodehelper_read_trylock() that it shouldn't fail just yet and should call try_to_freeze() if woken up and cannot return immediately. This way all freezable tasks that happen to call request_firmware() right before freeze_processes() is started and lose the race for umhelper_sem with it will be frozen and will sleep until thaw_processes() unsets usermodehelper_disabled. [For the non-freezable callers of request_firmware() the race for umhelper_sem against freeze_processes() is unfortunately unavoidable.] Reported-by: Stephen Boyd Signed-off-by: Rafael J. Wysocki Acked-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 7b9643c970c77db6ab8cc7760b7e2cc2e4daface Author: Rafael J. Wysocki Date: Wed Mar 28 23:30:21 2012 +0200 PM / Sleep: Move disabling of usermode helpers to the freezer commit 1e73203cd1157a03facc41ffb54050f5b28e55bd upstream. The core suspend/hibernation code calls usermodehelper_disable() to avoid race conditions between the freezer and the starting of usermode helpers and each code path has to do that on its own. However, it is always called right before freeze_processes() and usermodehelper_enable() is always called right after thaw_processes(). For this reason, to avoid code duplication and to make the connection between usermodehelper_disable() and the freezer more visible, make freeze_processes() call it and remove the direct usermodehelper_disable() and usermodehelper_enable() calls from all suspend/hibernation code paths. Signed-off-by: Rafael J. Wysocki Acked-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 9bd3f435bb77d55c195b254d5c7f1f21e6a0669a Author: Rafael J. Wysocki Date: Wed Mar 28 23:30:14 2012 +0200 PM / Hibernate: Disable usermode helpers right before freezing tasks commit 7b5179ac14dbad945647ac9e76bbbf14ed9e0dbe upstream. There is no reason to call usermodehelper_disable() before creating memory bitmaps in hibernate() and software_resume(), so call it right before freeze_processes(), in accordance with the other suspend and hibernation code. Consequently, call usermodehelper_enable() right after the thawing of tasks rather than after freeing the memory bitmaps. Signed-off-by: Rafael J. Wysocki Acked-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 327acb4361452fc79e4f2f38f366f9baa55e3676 Author: Alan Stern Date: Mon Mar 26 22:46:52 2012 +0200 PM / Runtime: don't forget to wake up waitqueue on failure commit f2791d733a2f06997b573d1a3cfde21e6f529826 upstream. This patch (as1535) fixes a bug in the runtime PM core. When a runtime suspend attempt completes, whether successfully or not, the device's power.wait_queue is supposed to be signalled. But this doesn't happen in the failure pathway of rpm_suspend() when another autosuspend attempt is rescheduled. As a result, a task can get stuck indefinitely on the wait queue (I have seen this happen in testing). The patch fixes the problem by moving the wake_up_all() call up near the start of the failure code. Signed-off-by: Alan Stern Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman commit 91cb632cd8d0a1649d088a50e752459d1e8b3d79 Author: Rafael J. Wysocki Date: Wed Mar 28 23:30:02 2012 +0200 firmware_class: Do not warn that system is not ready from async loads commit 9b78c1da60b3c62ccdd1509f0902ad19ceaf776b upstream. If firmware is requested asynchronously, by calling request_firmware_nowait(), there is no reason to fail the request (and warn the user) when the system is (presumably temporarily) unready to handle it (because user space is not available yet or frozen). For this reason, introduce an alternative routine for read-locking umhelper_sem, usermodehelper_read_lock_wait(), that will wait for usermodehelper_disabled to be unset (possibly with a timeout) and make request_firmware_work_func() use it instead of usermodehelper_read_trylock(). Accordingly, modify request_firmware() so that it uses usermodehelper_read_trylock() to acquire umhelper_sem and remove the code related to that lock from _request_firmware(). Signed-off-by: Rafael J. Wysocki Acked-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 4aaf8189db4a00e133afbb0e538e8c4f5551a833 Author: Rafael J. Wysocki Date: Wed Mar 28 23:29:55 2012 +0200 firmware_class: Split _request_firmware() into three functions, v2 commit 811fa4004485dec8977176bf605a5b0508ee206c upstream. Split _request_firmware() into three functions, _request_firmware_prepare() doing preparatory work that need not be done under umhelper_sem, _request_firmware_cleanup() doing the post-error cleanup and _request_firmware() carrying out the remaining operations. This change is requisite for moving the acquisition of umhelper_sem from _request_firmware() to the callers, which is going to be done subsequently. Signed-off-by: Rafael J. Wysocki Acked-by: Greg Kroah-Hartman Reviewed-by: Stephen Boyd Signed-off-by: Greg Kroah-Hartman commit 1cbfac52d7ccb45e3a3ea1941ed626997143456c Author: Rafael J. Wysocki Date: Wed Mar 28 23:29:45 2012 +0200 firmware_class: Rework usermodehelper check commit fe2e39d8782d885755139304d8dba0b3e5bfa878 upstream. Instead of two functions, read_lock_usermodehelper() and usermodehelper_is_disabled(), used in combination, introduce usermodehelper_read_trylock() that will only return with umhelper_sem held if usermodehelper_disabled is unset (and will return -EAGAIN otherwise) and make _request_firmware() use it. Rename read_unlock_usermodehelper() to usermodehelper_read_unlock() to follow the naming convention of the new function. Signed-off-by: Rafael J. Wysocki Acked-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit bff4969b619c9a78356eaad56a3d6f4d1ea3a87f Author: Daniel Vetter Date: Sat Mar 24 23:51:30 2012 +0100 drm/i915: quirk away broken OpRegion VBT commit 25e341cfc33d94435472983825163e97fe370a6c upstream. Somehow the BIOS manages to screw things up when copying the VBT around, because the one we scrap from the VBIOS rom actually works. Tested-by: Markus Heinz Acked-by: Chris Wilson Reviewed-by: Rodrigo Vivi Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=28812 Signed-Off-by: Daniel Vetter Signed-off-by: Greg Kroah-Hartman commit 234f78a683e30d6d4628846fde4a822c0e385529 Author: Sean Paul Date: Fri Mar 23 08:52:58 2012 -0400 drm/i915: Add lock on drm_helper_resume_force_mode commit 927a2f119e8235238a2fc64871051b16c9bdae75 upstream. i915_drm_thaw was not locking the mode_config lock when calling drm_helper_resume_force_mode. When there were multiple wake sources, this caused FDI training failure on SNB which in turn corrupted the display. Signed-off-by: Sean Paul Reviewed-by: Chris Wilson Signed-Off-by: Daniel Vetter Signed-off-by: Greg Kroah-Hartman commit 1fd673688ee1643a8b8e285dd29028940b4968a4 Author: Chris Wilson Date: Thu Mar 22 15:00:50 2012 +0000 drm/i915: Sanitize BIOS debugging bits from PIPECONF commit f47166d2b0001fcb752b40c5a2d4db986dfbea68 upstream. Quoting the BSpec from time immemorial: PIPEACONF, bits 28:27: Frame Start Delay (Debug) Used to delay the frame start signal that is sent to the display planes. Care must be taken to insure that there are enough lines during VBLANK to support this setting. An instance of the BIOS leaving these bits set was found in the wild, where it caused our modesetting to go all squiffy and skewiff. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47271 Reported-and-tested-by: Eva Wang Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=43012 Reported-and-tested-by: Carl Richell Signed-off-by: Chris Wilson Signed-off-by: Daniel Vetter Signed-off-by: Greg Kroah-Hartman commit ab9da3326bda367eb661dc25cbb5e0b42aa2834b Author: Jesse Barnes Date: Tue Mar 20 10:59:09 2012 -0700 drm/i915: treat src w & h as fixed point in sprite handling code commit b4db1e35ac59c144965f517bc575a0d75b60b03f upstream. This was missed when we converted the source values to 16.16 fixed point. Signed-off-by: Jesse Barnes Tested-by: Chris Wilson Signed-off-by: Daniel Vetter Signed-off-by: Greg Kroah-Hartman commit 40c47fc408d25e6700be1f15822f253caa53b36e Author: Anisse Astier Date: Wed Mar 7 18:36:35 2012 +0100 drm/i915: no-lvds quirk on MSI DC500 commit 97effadb65ed08809e1720c8d3ee80b73a93665c upstream. This hardware doesn't have an LVDS, it's a desktop box. Fix incorrect LVDS detection. Signed-off-by: Anisse Astier Acked-by: Chris Wilson Signed-off-by: Daniel Vetter Signed-off-by: Greg Kroah-Hartman commit 64e699d925d9ce1e458e57706750aa4bdeebfd50 Author: Alex Deucher Date: Thu Mar 29 19:04:08 2012 -0400 drm/radeon/kms: fix fans after resume commit 402976fe51b2d1a58a29ba06fa1ca5ace3a4cdcd upstream. On pre-R600 asics, the SpeedFanControl table is not executed as part of ASIC_Init as it is on newer asics. Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=29412 Signed-off-by: Alex Deucher Reviewed-by: Michel Dänzer Signed-off-by: Dave Airlie Signed-off-by: Greg Kroah-Hartman commit c6595bf672e42bb6e4a11b6f39b58baa14a41c4f Author: Chris Wilson Date: Mon Mar 26 21:15:53 2012 +0100 drm: Validate requested virtual size against allocated fb size commit 62fb376e214d3c1bfdf6fbb77dac162f6da04d7e upstream. mplayer -vo fbdev tries to create a screen that is twice as tall as the allocated framebuffer for "doublebuffering". By default, and all in-tree users, only sufficient memory is allocated and mapped to satisfy the smallest framebuffer and the virtual size is no larger than the actual. For these users, we should therefore reject any userspace request to create a screen that requires a buffer larger than the framebuffer originally allocated. References: https://bugs.freedesktop.org/show_bug.cgi?id=38138 Signed-off-by: Chris Wilson Reviewed-by: Daniel Vetter Signed-off-by: Dave Airlie Signed-off-by: Greg Kroah-Hartman commit 90f1820ee60b216248ba35f3c447349bede2a4d7 Author: Rajkumar Manoharan Date: Thu Mar 15 06:08:04 2012 +0530 ath9k: fix max noise floor threshold commit 2ee0a07028d2cde6e131b73f029dae2b93c50f3a upstream. Currently the maximum noise floor limit is set as too high (-60dB). The assumption of having a higher threshold limit is that it would help de-sensitize the receiver (reduce phy errors) from continuous interference. But when we have a bursty interference where there are collisions and then free air time and if the receiver is desensitized too much, it will miss the normal packets too. Lets make use of chips specific min, nom and max limits always. This patch helps to improve the connection stability in congested networks. Cc: Paul Stewart Tested-by: Gary Morain Signed-off-by: Madhan Jaganathan Signed-off-by: Rajkumar Manoharan Signed-off-by: John W. Linville Signed-off-by: Greg Kroah-Hartman commit eb641120479de7ee703fabb5e6ee0ec7947474ba Author: Larry Finger Date: Mon Mar 26 09:59:48 2012 -0500 rtlwifi: rtl8192ce: rtl8192cu: rtl8192de: Fix low-gain setting when scanning commit 643c61e119459e9d750087b7b34be94491efebf9 upstream. In https://bugzilla.redhat.com/show_bug.cgi?id=770207, slowdowns of driver rtl8192ce are reported. One fix (commit a9b89e2) has already been applied, and it helped, but the maximum RX speed would still drop to 1 Mbps. As in the previous fix, the initial gain was determined to be the problem; however, the problem arises from a setting of the gain when scans are started. Driver rtl8192de also has the same code structure - this one is fixed as well. Reported-and-Tested-by: Ivan Pesin Signed-off-by: Larry Finger Signed-off-by: John W. Linville Signed-off-by: Greg Kroah-Hartman commit 26122d741decf22de810c1f6e7ef614db97ba1ad Author: Stanislaw Gruszka Date: Mon Mar 19 16:00:26 2012 +0100 mac80211: fix possible tid_rx->reorder_timer use after free commit d72308bff5c2fa207949a5925b020bce74495e33 upstream. Is possible that we will arm the tid_rx->reorder_timer after del_timer_sync() in ___ieee80211_stop_rx_ba_session(). We need to stop timer after RCU grace period finish, so move it to ieee80211_free_tid_rx(). Timer will not be armed again, as rcu_dereference(sta->ampdu_mlme.tid_rx[tid]) will return NULL. Debug object detected problem with the following warning: ODEBUG: free active (active state 0) object type: timer_list hint: sta_rx_agg_reorder_timer_expired+0x0/0xf0 [mac80211] Bug report (with all warning messages): https://bugzilla.redhat.com/show_bug.cgi?id=804007 Reported-by: "jan p. springer" Signed-off-by: Stanislaw Gruszka Signed-off-by: John W. Linville Signed-off-by: Greg Kroah-Hartman commit d89e8755daca2a1e2b1608d0a0dfc3d5990bb50e Author: Geert Uytterhoeven Date: Sun Mar 18 13:21:38 2012 +0100 m68k/mac: Add missing platform check before registering platform devices commit 6cfeba53911d6d2f17ebbd1246893557d5ff5aeb upstream. On multi-platform kernels, the Mac platform devices should be registered when running on Mac only. Else it may crash later. Signed-off-by: Geert Uytterhoeven Signed-off-by: Greg Kroah-Hartman commit adf679a9a0e7d19a0e0b8ff020896e43d26af687 Author: Steven Rostedt Date: Tue Mar 27 10:43:28 2012 -0400 tracing: Fix ent_size in trace output commit 12b5da349a8b94c9dbc3430a6bc42eabd9eaf50b upstream. When reading the trace file, the records of each of the per_cpu buffers are examined to find the next event to print out. At the point of looking at the event, the size of the event is recorded. But if the first event is chosen, the other events in the other CPU buffers will reset the event size that is stored in the iterator descriptor, causing the event size passed to the output functions to be incorrect. In most cases this is not a problem, but for the case of stack traces, it is. With the change to the stack tracing to record a dynamic number of back traces, the output depends on the size of the entry instead of the fixed 8 back traces. When the entry size is not correct, the back traces would not be fully printed. Note, reading from the per-cpu trace files were not affected. Reported-by: Thomas Gleixner Tested-by: Thomas Gleixner Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman commit 441b586ad8b5dbfbb15f985742b77ad726c7d550 Author: Wolfgang Mauerer Date: Thu Mar 22 11:18:20 2012 +0100 tracing: Fix ftrace stack trace entries commit 01de982abf8c9e10fc3089e10585cd2cc914bdab upstream. 8 hex characters tell only half the tale for 64 bit CPUs, so use the appropriate length. Link: http://lkml.kernel.org/r/1332411501-8059-2-git-send-email-wolfgang.mauerer@siemens.com Signed-off-by: Wolfgang Mauerer Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman commit 23ee5a026c32c20cd65fb058c468e30300e84d2d Author: Jiang Liu Date: Fri Mar 30 23:11:33 2012 +0800 genirq: Adjust irq thread affinity on IRQ_SET_MASK_OK_NOCOPY return value commit f5cb92ac82d06cb583c1f66666314c5c0a4d7913 upstream. irq_move_masked_irq() checks the return code of chip->irq_set_affinity() only for 0, but IRQ_SET_MASK_OK_NOCOPY is also a valid return code, which is there to avoid a redundant copy of the cpumask. But in case of IRQ_SET_MASK_OK_NOCOPY we not only avoid the redundant copy, we also fail to adjust the thread affinity of an eventually threaded interrupt handler. Handle IRQ_SET_MASK_OK (==0) and IRQ_SET_MASK_OK_NOCOPY(==1) return values correctly by checking the valid return values seperately. Signed-off-by: Jiang Liu Cc: Jiang Liu Cc: Keping Chen Link: http://lkml.kernel.org/r/1333120296-13563-2-git-send-email-jiang.liu@huawei.com Signed-off-by: Thomas Gleixner Signed-off-by: Greg Kroah-Hartman commit c5d9eb6ac86bbc738f497c4a518b802c5fe87a95 Author: Jan Beulich Date: Thu Mar 8 09:41:25 2012 +0000 modpost: fix ALL_INIT_DATA_SECTIONS commit 9aaf440f8fabcebf9ea79a62ccf4c212e6544b49 upstream. This was lacking a comma between two supposed to be separate strings. Signed-off-by: Jan Beulich Signed-off-by: Michal Marek Signed-off-by: Greg Kroah-Hartman commit d16d8234037facbd1128053c82494dc0c505e4b0 Author: Julian Anastasov Date: Thu Feb 23 22:40:43 2012 +0200 ACPICA: Fix regression in FADT revision checks commit 3e80acd1af40fcd91a200b0416a7616b20c5d647 upstream. commit 64b3db22c04586997ab4be46dd5a5b99f8a2d390 (2.6.39), "Remove use of unreliable FADT revision field" causes regression for old P4 systems because now cst_control and other fields are not reset to 0. The effect is that acpi_processor_power_init will notice cst_control != 0 and a write to CST_CNT register is performed that should not happen. As result, the system oopses after the "No _CST, giving up" message, sometimes in acpi_ns_internalize_name, sometimes in acpi_ns_get_type, usually at random places. May be during migration to CPU 1 in acpi_processor_get_throttling. Every one of these settings help to avoid this problem: - acpi=off - processor.nocst=1 - maxcpus=1 The fix is to update acpi_gbl_FADT.header.length after the original value is used to check for old revisions. https://bugzilla.kernel.org/show_bug.cgi?id=42700 https://bugzilla.redhat.com/show_bug.cgi?id=727865 Signed-off-by: Julian Anastasov Acked-by: Bob Moore Signed-off-by: Len Brown Cc: Jonathan Nieder Cc: Josh Boyer Signed-off-by: Greg Kroah-Hartman commit aa8d847d50f36deea21019df1056ec3aefc17aaf Author: Yinghai Lu Date: Sat Mar 3 13:29:20 2012 -0800 PNPACPI: Fix device ref leaking in acpi_pnp_match commit 89e96ada572fb216e582dbe3f64e1a6939a37f74 upstream. During testing pci root bus removal, found some root bus bridge is not freed. If booting with pnpacpi=off, those hostbridge could be freed without problem. It turns out that some devices reference are not released during acpi_pnp_match. that match should not hold one device ref during every calling. Add pu_device calling before returning. Signed-off-by: Yinghai Lu Signed-off-by: Len Brown Signed-off-by: Greg Kroah-Hartman commit 18f96105c7335bb7e661ec6e6e046ea613d5afe3 Author: Andi Kleen Date: Mon Feb 6 08:17:11 2012 -0800 ACPI: Do cpufreq clamping for throttling per package v2 commit 2815ab92ba3ab27556212cc306288dc95692824b upstream. On Intel CPUs the processor typically uses the highest frequency set by any logical CPU. When the system overheats Linux first forces the frequency to the lowest available one to lower the temperature. However this was done only per logical CPU, which means all logical CPUs in a package would need to go through this before the frequency is actually lowered. Worse this delay actually prevents real throttling, because the real throttle code only proceeds when the lowest frequency is already reached. So when a throttle event happens force the lowest frequency for all CPUs in the package where it happened. The per CPU state is now kept per package, not per logical CPU. An alternative would be to do it per cpufreq unit, but since we want to bring down the temperature of the complete chip it's better to do it for all. In principle it may even make sense to do it for all CPUs, but I kept it on the package for now. With this change the frequency is actually lowered, which in terms also allows real throttling to proceed. I also removed an unnecessary per cpu variable initialization. v2: Fix package mapping Signed-off-by: Andi Kleen Signed-off-by: Len Brown Signed-off-by: Greg Kroah-Hartman commit a833953aa02dd4410cd50f0372614ebdab780281 Author: Brian Norris Date: Tue Jan 31 00:06:03 2012 -0800 mtd: m25p80: set writebufsize commit b54f47c8bcfc5f766bf13ec31bd7dd1d4726d33b upstream. Using UBI on m25p80 can give messages like: UBI error: io_init: bad write buffer size 0 for 1 min. I/O unit We need to initialize writebufsize; I think "page_size" is the correct "bufsize", although I'm not sure. Comments? Signed-off-by: Brian Norris Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse Signed-off-by: Greg Kroah-Hartman commit 5dd9d848008097e1fba8c924721be4ccdcbe3c47 Author: Artem Bityutskiy Date: Fri Feb 3 09:53:28 2012 +0200 mtd: lart: initialize writebufsize commit fcc44a07dae0af16e84e93425fc8afe642ddc603 upstream. The writebufsize concept was introduce by commit "0e4ca7e mtd: add writebufsize field to mtd_info struct" and it represents the maximum amount of data the device writes to the media at a time. This is an important parameter for UBIFS which is used during recovery and which basically defines how big a corruption caused by a power cut can be. Set writebufsize to 4 because this drivers writes at max 4 bytes at a time. Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse Signed-off-by: Greg Kroah-Hartman commit a7159affc43fb69613049e7c5be5fa8b717cfee4 Author: Artem Bityutskiy Date: Fri Feb 3 09:32:44 2012 +0200 mtd: block2mtd: initialize writebufsize commit b604387411ec6a072e95910099262616edd2bd2f upstream. The writebufsize concept was introduce by commit "0e4ca7e mtd: add writebufsize field to mtd_info struct" and it represents the maximum amount of data the device writes to the media at a time. This is an important parameter for UBIFS which is used during recovery and which basically defines how big a corruption caused by a power cut can be. However, we forgot to set this parameter for block2mtd. Set it to PAGE_SIZE because this is actually the amount of data we write at a time. Signed-off-by: Artem Bityutskiy Acked-by: Joern Engel Signed-off-by: David Woodhouse Signed-off-by: Greg Kroah-Hartman commit 62dfbb1478ce745bbea43e3cd29d4baf2b110df4 Author: Artem Bityutskiy Date: Fri Feb 3 09:44:32 2012 +0200 mtd: docg3: initialize writebufsize commit 82c4c58d6f1a78e8de875272a19ab9220b8066aa upstream. The writebufsize concept was introduce by commit "0e4ca7e mtd: add writebufsize field to mtd_info struct" and it represents the maximum amount of data the device writes to the media at a time. This is an important parameter for UBIFS which is used during recovery and which basically defines how big a corruption caused by a power cut can be. Set it to be equivalent to mtd->writesize because this is the maximum amount of data the driver writes at a time. Signed-off-by: Artem Bityutskiy Acked-by: Robert Jarzmik Signed-off-by: David Woodhouse Signed-off-by: Greg Kroah-Hartman commit 7559bf677abab694aa62b8867a458e69d751f4a3 Author: Artem Bityutskiy Date: Fri Feb 3 09:42:39 2012 +0200 mtd: doc2001: initialize writebufsize commit cca84b569ebe3372b28949e00b0a3a17f87e2970 upstream. The writebufsize concept was introduce by commit "0e4ca7e mtd: add writebufsize field to mtd_info struct" and it represents the maximum amount of data the device writes to the media at a time. This is an important parameter for UBIFS which is used during recovery and which basically defines how big a corruption caused by a power cut can be. Set it to be equivalent to mtd->writesize because this is the maximum amount of data the driver writes at a time. Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse Signed-off-by: Greg Kroah-Hartman commit a064a3d176532addb3e0c9850aa26982c95560f6 Author: Artem Bityutskiy Date: Fri Feb 3 09:38:43 2012 +0200 mtd: doc2000: initialize writebufsize commit cd1986a3c111f7ed597619705290fa52a975014f upstream. The writebufsize concept was introduce by commit "0e4ca7e mtd: add writebufsize field to mtd_info struct" and it represents the maximum amount of data the device writes to the media at a time. This is an important parameter for UBIFS which is used during recovery and which basically defines how big a corruption caused by a power cut can be. Set it to be equivalent to mtd->writesize because this is the maximum amount of data the driver writes at a time. Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse Signed-off-by: Greg Kroah-Hartman commit 5293db847835996e861ded8c267b9727abf54677 Author: Artem Bityutskiy Date: Fri Feb 3 09:43:14 2012 +0200 mtd: doc2001plus: initialize writebufsize commit 71f60fbebf0f18dd4e855335a009efda251b1697 upstream. The writebufsize concept was introduce by commit "0e4ca7e mtd: add writebufsize field to mtd_info struct" and it represents the maximum amount of data the device writes to the media at a time. This is an important parameter for UBIFS which is used during recovery and which basically defines how big a corruption caused by a power cut can be. Set it to be equivalent to mtd->writesize because this is the maximum amount of data the driver writes at a time. Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse Signed-off-by: Greg Kroah-Hartman commit aafe00d9de8cb7aa356bb6059061b0fdd6c25411 Author: Artem Bityutskiy Date: Fri Feb 3 10:16:50 2012 +0200 mtd: sst25l: initialize writebufsize commit c4cc625ea5958d065c21cc0fcea29e9ed8f3d2bc upstream. The writebufsize concept was introduce by commit "0e4ca7e mtd: add writebufsize field to mtd_info struct" and it represents the maximum amount of data the device writes to the media at a time. This is an important parameter for UBIFS which is used during recovery and which basically defines how big a corruption caused by a power cut can be. Set writebufsize to the flash page size because it is the maximum amount of data it writes at a time. Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse Signed-off-by: Greg Kroah-Hartman commit 5cdfb035c8bcbf7a37e503efd79b1207076b3288 Author: Wolfram Sang Date: Tue Jan 31 13:10:43 2012 +0100 mtd: nand: gpmi: use correct member for checking NAND_BBT_USE_FLASH commit 5289966ea576a062b80319975b31b661c196ff9d upstream. This has been moved from .options to .bbt_options meanwhile. So, it currently checks for something totally different (NAND_OWN_BUFFERS) and decides according to that. Artem Bityutskiy: the options were moved in a40f734 mtd: nand: consolidate redundant flash-based BBT flags Artem Bityutskiy: CCing -stable Signed-off-by: Wolfram Sang Acked-by: Huang Shijie Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse Signed-off-by: Greg Kroah-Hartman commit d028ae367d05966d4c811515c53f9f59de1fc79f Author: Daniel Schwierzeck Date: Thu Feb 23 17:59:49 2012 +0100 mtd: mips: lantiq: reintroduce support for cmdline partitions commit bf011f2ed53d587fdd8148c173c4f09ed77bdf1a upstream. Since commit ca97dec2ab5c87e9fbdf7e882e1820004a3966fa the command line parsing of MTD partitions does not work anymore. Signed-off-by: Daniel Schwierzeck Signed-off-by: John Crispin Signed-off-by: Artem Bityutskiy Acked-by: John Crispin Signed-off-by: David Woodhouse Signed-off-by: Greg Kroah-Hartman commit 2d391c635443517af9fcc60dff3cbfa62bdaf68a Author: Marc Kleine-Budde Date: Wed Feb 8 20:24:29 2012 +0100 mtd: ixp4xx: oops in ixp4xx_flash_probe commit a3c1e3b732b3708a80e4035b9d845f3f7c7dd0c9 upstream. In commit "c797533 mtd: abstract last MTD partition parser argument" the third argument of "mtd_device_parse_register()" changed from start address of the MTD device to a pointer to a struct. The "ixp4xx_flash_probe()" function was not converted properly, causing an oops during boot. This patch fixes the problem by filling the needed information into a "struct mtd_part_parser_data" and passing it to "mtd_device_parse_register()". Signed-off-by: Marc Kleine-Budde Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse Signed-off-by: Greg Kroah-Hartman commit 11b604c87d574d65c18b7da541b204d8b7f07eae Author: Mark Brown Date: Wed Mar 21 13:22:40 2012 +0000 ASoC: wm8994: Update WM8994 DCS calibration commit e16605855d58803fe0608417150c7a618b4f8243 upstream. Based on latest production information. Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman commit 17c7ceb39193493ccf12d489fdfdaf2cdccb0099 Author: Takashi Iwai Date: Thu Mar 22 14:36:50 2012 +0100 ALSA: hda/realtek - Fix ADC assignment with a shared HP/Mic pin commit 26acaf08556a3c64ebf8ea3654b51e6acbb0a26c upstream. The recent Realtek driver tries to assign an extra input via the headphone plug when only a single input source is found. The code worked on Samsung Q1, but it broke ASUS 1015 where the mic is a digital-mic and only a specific ADC works. This patch fixes the assignment of ADC in the shared mic/hp case. Instead of assuming the single ADC at first, reduce the ADCs after trying to assign both mic and HP pins. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=42973 Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman commit 887192b45178fe51e125cb007a69cb3752b332e1 Author: Kenth Eriksson Date: Tue Mar 27 22:05:54 2012 +0000 Fix non TBI PHY access; a bad merge undid bug fix in a previous commit. [ Upstream commit 464b57da56910c8737ede75ad820b9a7afc46b3e ] The merge done in commit b26e478f undid bug fix in commit c3e072f8 ("net: fsl_pq_mdio: fix non tbi phy access"), with the result that non TBI (e.g. MDIO) PHYs cannot be accessed. Signed-off-by: Kenth Eriksson Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman commit 5516666ab0db19cf6fba61ed15d5ee172917e918 Author: Rabin Vincent Date: Thu Mar 29 07:15:15 2012 +0000 net: usb: cdc_eem: fix mtu [ Upstream commit 78fb72f7936c01d5b426c03a691eca082b03f2b9 ] Make CDC EEM recalculate the hard_mtu after adjusting the hard_header_len. Without this, usbnet adjusts the MTU down to 1494 bytes, and the host is unable to receive standard 1500-byte frames from the device. Tested with the Linux USB Ethernet gadget. Cc: Oliver Neukum Signed-off-by: Rabin Vincent Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman commit 7812e2d03ff18c46c423c47bc83ff1cba1289dab Author: danborkmann@iogearbox.net Date: Tue Mar 27 22:47:43 2012 +0000 rose_dev: fix memcpy-bug in rose_set_mac_address [ Upstream commit 81213b5e8ae68e204aa7a3f83c4f9100405dbff9 ] If both addresses equal, nothing needs to be done. If the device is down, then we simply copy the new address to dev->dev_addr. If the device is up, then we add another loopback device with the new address, and if that does not fail, we remove the loopback device with the old address. And only then, we update the dev->dev_addr. Signed-off-by: Daniel Borkmann Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman commit c2a26a9d9dca0999963acfa78dd54e725b854385 Author: Lino Sanfilippo Date: Fri Mar 30 07:28:59 2012 +0000 sky2: dont overwrite settings for PHY Quick link [ Upstream commit 2240eb4ae3dc4acff20d1a8947c441c451513e37 ] This patch corrects a bug in function sky2_open() of the Marvell Yukon 2 driver in which the settings for PHY quick link are overwritten. Signed-off-by: Lino Sanfilippo Acked-by: Stephen Hemminger Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman commit 5d755a70796b85c9bcf4d8c0fee1b5c8febbfe5c Author: Matt Carlson Date: Mon Apr 2 09:01:40 2012 +0000 tg3: Fix 5717 serdes powerdown problem [ Upstream commit 085f1afc56619bda424941412fdeaff1e32c21dc ] If port 0 of a 5717 serdes device powers down, it hides the phy from port 1. This patch works around the problem by keeping port 0's phy powered up. Signed-off-by: Matt Carlson Signed-off-by: Michael Chan Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman commit e453806dd082976d3f1dc5ab51e171205cce28ff Author: Andreas Mohr Date: Sun Apr 1 12:35:00 2012 +0000 via-rhine: fix wait-bit inversion. [ Upstream commit 3f8c91a7398b9266fbe7abcbe4bd5dffef907643 ] Bug appeared in a384a33bb1c9ec2d99db2046b41f57023fa7d77b ("via-rhine: RHINE_WAIT_FOR macro removal). It can be noticed during suspend/resume. Signed-off-by: Andreas Mohr Acked-by: Francois Romieu Cc: David Lv Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman commit c6940ac7015f234d0c525e16c6a38e4495c077a1 Author: Feiran Zhuang Date: Wed Mar 28 23:27:00 2012 +0000 x86 bpf_jit: fix a bug in emitting the 16-bit immediate operand of AND [ Upstream commit 1d24fb3684f347226747c6b11ea426b7b992694e ] When K >= 0xFFFF0000, AND needs the two least significant bytes of K as its operand, but EMIT2() gives it the least significant byte of K and 0x2. EMIT() should be used here to replace EMIT2(). Signed-off-by: Feiran Zhuang Acked-by: Eric Dumazet Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman