3.2.56-rc1 review
Subsystems (3)
cover 3.2.56-rc1 review
This is the start of the stable review cycle for the 3.2.56 release. There are 200 patches in this series, which will be posted as responses to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed Apr 02 00:00:00 UTC 2014. Anything received after that time might be too late.
A combined patch relative to 3.2.55 will be posted as an additional response to this. A shortlog and diffstat can be found below.
Ben.
-------------
Aisheng Dong (1):
mmc: sdhci: fix lockdep error in tuning routine
[2b35bd83467df6f8284b9148d6f768148c3a5e5f]
Al Viro (2):
hpfs: deadlock and race in directory lseek()
[31abdab9c11bb1694ecd1476a7edbe8e964d94ac]
ocfs2 syncs the wrong range...
[1b56e98990bcdbb20b9fab163654b9315bf158e8]
Alan Stern (4):
USB: EHCI: add delay during suspend to prevent erroneous wakeups
[3e8d6d85adedc59115a564c0a54b36e42087c4d9]
usb-storage: add unusual-devs entry for BlackBerry 9000
[c5637e5119c43452a00e27c274356b072263ecbb]
usb-storage: enable multi-LUN scanning when needed
[823d12c95c666fa7ab7dad208d735f6bc6afabdc]
usb-storage: restrict bcdDevice range for Super Top in Cypress ATACB
[a9c143c82608bee2a36410caa56d82cd86bdc7fa]
Aleksander Morgado (1):
USB: serial: option: blacklist interface 4 for Cinterion PHS8 and PXS8
[12df84d4a80278a5b1abfec3206795291da52fc9]
Alex Deucher (4):
drm/radeon/DCE4+: clear bios scratch dpms bit (v2)
[6802d4bad83f50081b2788698570218aaff8d10e]
drm/radeon: disable ss on DP for DCE3.x
[d8e24525094200601236fa64a54cf73e3d682f2e]
drm/radeon: set the full cache bit for fences on r7xx+
[d45b964a22cad962d3ede1eba8d24f5cee7b2a92]
drm/radeon: warn users when hw_i2c is enabled (v2)
[d195178297de9a91246519dbfa98952b70f9a9b6]
Alex Williamson (1):
intel-iommu: fix off-by-one in pagetable freeing
[08336fd218e087cc4fcc458e6b6dcafe8702b098]
Amitkumar Karwar (1):
mwifiex: copy AP's HT capability info correctly
[c99b1861c232e1f641f13b8645e0febb3712cc71]
Andy Grover (1):
target/iscsi: Fix network portal creation race
[ee291e63293146db64668e8d65eb35c97e8324f4]
Anton Blanchard (2):
net: unix socket code abuses csum_partial
[0a13404dd3bf4ea870e3d96270b5a382edca85c0]
powerpc: Align p_dyn, p_rela and p_st symbols
[a5b2cf5b1af424ee3dd9e3ce6d5cea18cb927e67]
Arnd Bergmann (1):
vmxnet3: fix building without CONFIG_PCI_MSI
[0a8d8c446b5429d15ff2d48f46e00d8a08552303]
Benjamin Herrenschmidt (1):
of: Fix address decoding on Bimini and js2x machines
[6dd18e4684f3d188277bbbc27545248487472108]
Bjorn Helgaas (1):
PCI: Enable INTx if BIOS left them disabled
[1f42db786b14a31bf807fc41ee5583a00c08fcb1]
Bjørn Mork (1):
usb: ftdi_sio: add Mindstorms EV3 console adapter
[67847baee056892dc35efb9c3fd05ae7f075588c]
Boaz Harrosh (1):
ore: Fix wrong math in allocation of per device BIO
[aad560b7f63b495f48a7232fd086c5913a676e6f]
Borislav Petkov (2):
EDAC: Correct workqueue setup path
[cb6ef42e516cb8948f15e4b70dc03af8020050a2]
rtc-cmos: Add an alarm disable quirk
[d5a1c7e3fc38d9c7d629e1e47f32f863acbdec3d]
Chen Gang (1):
avr32: Makefile: add '-D__linux__' flag for gcc-4.4.7 use
[8d80390cfc9434d5aa4fb9e5f9768a66b30cb8a6]Chris Mason (1):
Btrfs: setup inode location during btrfs_init_inode_locked
[90d3e592e99b8e374ead2b45148abf506493a959]
Chuansheng Liu (1):
genirq: Remove racy waitqueue_active check
[c685689fd24d310343ac33942e9a54a974ae9c43]
Clemens Ladisch (2):
ALSA: oxygen: Xonar DG(X): modify DAC routing
[1f91ecc14deea9461aca93273d78871ec4d98fcd]
ALSA: usb-audio: work around KEF X300A firmware bug
[624aef494f86ed0c58056361c06347ad62b26806]
Colin Cross (1):
timekeeping: fix 32-bit overflow in get_monotonic_boottime
[ec145babe754f9ea1079034a108104b6001e001c]
Colin Leitner (1):
USB: ftdi_sio: added CS5 quirk for broken smartcard readers
[c1f15196ac3b541d084dc80a8fbd8a74c6a0bd44]
Dan Carpenter (1):
KVM: return an error code in kvm_vm_ioctl_register_coalesced_mmio()
[aac5c4226e7136c331ed384c25d5560204da10a0]
Dan Williams (2):
[SCSI] isci: fix reset timeout handling
[ddfadd7736b677de2d4ca2cd5b4b655368c85a7a]
ioat: fix tasklet tear down
[da87ca4d4ca101f177fffd84f1f0a5e4c0343557]
Daniel Borkmann (2):
net: sctp: fix sctp_connectx abi for ia32 emulation/compat mode
[ffd5939381c609056b33b7585fb05a77b4c695f3]
net: sctp: fix sctp_sf_do_5_1D_ce to verify if we/peer is AUTH capable
[ec0223ec48a90cb605244b45f7c62de856403729]
Daniel J Blueman (1):
x86/amd/numa: Fix northbridge quirk to assign correct NUMA node
[847d7970defb45540735b3fb4e88471c27cacd85]
Dave Jones (1):
[media] mxl111sf: Fix compile when CONFIG_DVB_USB_MXL111SF is unset
[13e1b87c986100169b0695aeb26970943665eda9]
Dave Young (1):
x86/efi: Fix off-by-one bug in EFI Boot Services reservation
[a7f84f03f660d93574ac88835d056c0d6468aebe]
David Rientjes (1):
mm, oom: base root bonus on current usage
[778c14affaf94a9e4953179d3e13a544ccce7707]
David Sterba (1):
btrfs: restrict snapshotting to own subvolumes
[d024206133ce21936b3d5780359afc00247655b7]
David Vrabel (2):
xen-blkfront: handle backend CLOSED without CLOSING
[3661371701e714f0cea4120f6a365340858fb4e4]
xen: install xen/gntdev.h and xen/gntalloc.h
[564eb714f5f09ac733c26860d5f0831f213fbdf1]
Denis V. Lunev (1):
ata: enable quirk from jmicron JMB350 for JMB394
[efb9e0f4f43780f0ae0c6428d66bd03e805c7539]
Emil Goode (1):
usbnet: remove generic hard_header_len check
[eb85569fe2d06c2fbf4de7b66c263ca095b397aa]
Emmanuel Grumbach (1):
mac80211: fix AP powersave TX vs. wakeup race
[1d147bfa64293b2723c4fec50922168658e613ba]
Eric Paris (1):
SELinux: bigendian problems with filename trans rules
[9085a6422900092886da8c404e1c5340c4ff1cbf]
Eric W. Biederman (1):
fs/file.c:fdtable: avoid triggering OOMs from alloc_fdmem
[96c7a2ff21501691587e1ae969b83cbec8b78e08]
Geert Uytterhoeven (1):
TTY: pmac_zilog, check existence of ports in pmz_console_init()
[dc1dc2f8a5dd863bf2e79f338fc3ae29e99c683a]
George McCollister (1):
sched: Fix double normalization of vruntime
[791c9e0292671a3bfa95286bb5c08129d8605618]
Giridhar Malavali (1):
[SCSI] qla2xxx: Poll during initialization for ISP25xx and ISP83xx
[b77ed25c9f8402e8b3e49e220edb4ef09ecfbb53]
Guenter Roeck (1):
hwmon: (max1668) Fix writing the minimum temperature
[500a91571f0a5d0d3242d83802ea2fd1faccc66e]
H Hartley Sweeten (1):
staging: comedi: adv_pci1710: fix analog output readback value
[1e85c1ea1ff2a60659e790ef8ec76c7339445841]
Hans de Goede (1):
ACPI / video: Filter the _BCL table for duplicate brightness values
[bd8ba20597f0cfef3ef65c3fd2aa92ab23d4c8e1]
Harald Freudenberger (3):
crypto: s390 - fix concurrency issue in aes-ctr mode
[0519e9ad89e5cd6e6b08398f57c6a71d9580564c]
crypto: s390 - fix des and des3_ede cbc concurrency issue
[adc3fcf1552b6e406d172fd9690bbd1395053d13]
crypto: s390 - fix des and des3_ede ctr concurrency issue
[ee97dc7db4cbda33e4241c2d85b42d1835bc8a35]
Hartmut Knaack (1):
staging:iio:ad799x fix error_free_irq which was freeing an irq that may not have been requested
[38408d056188be29a6c4e17f3703c796551bb330]
Helge Deller (1):
nfs: fix do_div() warning by instead using sector_div()
[3873d064b8538686bbbd4b858dc8a07db1f7f43a]
Ian Abbott (2):
staging: comedi: pcmuio: fix possible NULL deref on detach
[2fd2bdfccae61efe18f6b92b6a45fbf936d75b48]
staging: comedi: ssv_dnp: correct insn_bits result
[f6b316bcd8c421acd6fa5a6e18b4c846ecb9d965]
Ira Weiny (1):
IB/qib: Fix QP check when looping back to/from QP1
[6e0ea9e6cbcead7fa8c76e3e3b9de4a50c5131c5]
Jan Glauber (1):
s390/crypto: Don't panic after crypto instruction failures
[36eb2caa7bace31b7868a57f77cb148e58d1c9f9]
Jan Kara (2):
ocfs2: fix quota file corruption
[15c34a760630ca2c803848fba90ca0646a9907dd]
quota: Fix race between dqput() and dquot_scan_active()
[1362f4ea20fa63688ba6026e586d9746ff13a846]
Jan Moskyto Matejka (1):
Modpost: fixed USB alias generation for ranges including 0x9 and 0xA
[03b56329f9bb5a1cb73d7dc659d529a9a9bf3acc]Jani Nikula (2):
drm/i915/dp: add native aux defer retry limit
[f51a44b9a6c4982cc25bfb3727de9bb893621ebc]
drm/i915/dp: increase native aux defer retry timeout
[04eada25d1f72efdecd32d702706594f81de65d5]
Jason Wang (1):
virtio-net: alloc big buffers also when guest can receive UFO
[0e7ede80d929ff0f830c44a543daa1acd590c749]
Jean Delvare (2):
i7300_edac: Fix device reference count
[75135da0d68419ef8a925f4c1d5f63d8046e314d]
i7core_edac: Fix PCI device reference count
[c0f5eeed0f4cef4f05b74883a7160e7edde58b6a]
Jens Axboe (1):
block: add cond_resched() to potentially long running ioctl discard loop
[c8123f8c9cb517403b51aa41c3c46ff5e10b2c17]
Jianguo Wu (1):
mm/hugetlb: check for pte NULL pointer in __page_check_address()
[98398c32f6687ee1e1f3ae084effb4b75adb0747]
Jiri Bohac (1):
bonding: 802.3ad: make aggregator_identifier bond-private
[163c8ff30dbe473abfbb24a7eac5536c87f3baa9]
Joe Thornber (1):
dm space map common: make sure new space is used during extend
[12c91a5c2d2a8e8cc40a9552313e1e7b0a2d9ee3]
Joerg Dorchain (1):
USB: ftdi_sio: add Cressi Leonardo PID
[6dbd46c849e071e6afc1e0cad489b0175bca9318]
Johan Hovold (2):
USB: cypress_m8: fix ring-indicator detection and reporting
[440ebadeae9298d7de3d4d105342691841ec88d0]
USB: pl2303: fix data corruption on termios updates
[623c8263376c0b8a4b0c220232e7313d762cd0cc]
Johannes Berg (3):
iwlwifi: fix TX status for aggregated packets
[143582c6847cb285b361804c613127c25de60ca4]
mac80211: clear sequence/fragment number in QoS-null frames
[864a6040f395464003af8dd0d8ca86fed19866d4]
mac80211: fix fragmentation code, particularly for encryption
[338f977f4eb441e69bb9a46eaa0ac715c931a67f]
Josh Triplett (1):
turbostat: Use GCC's CPUID functions to support PIC
[2b92865e648ce04a39fda4f903784a5d01ecb0dc]
Julius Werner (2):
usb: Add device quirk for Logitech HD Pro Webcams C920 and C930e
[e0429362ab15c46ea4d64c3f8c9e0933e48a143a]
usb: Make DELAY_INIT quirk wait 100ms between Get Configuration requests
[d86db25e53fa69e3e97f3b55dd82a70689787c5d]
K. Y. Srinivasan (1):
Drivers: hv: vmbus: Don't timeout during the initial connection with host
[269f979467cf49f2ea8132316c1f00f8c9678f7c]
KOSAKI Motohiro (2):
mm: __set_page_dirty uses spin_lock_irqsave instead of spin_lock_irq
[227d53b397a32a7614667b3ecaf1d89902fb6c12]
mm: __set_page_dirty_nobuffers() uses spin_lock_irqsave() instead of spin_lock_irq()
[a85d9df1ea1d23682a0ed1e100e6965006595d06]
Kieran Clancy (1):
ACPI / EC: Clear stale EC events on Samsung systems
[ad332c8a45330d170bb38b95209de449b31cd1b4]
Kleber Sacilotto de Souza (1):
of: fix PCI bus match for PCIe slots
[14e2abb732e485ee57d9d5b2cb8884652238e5c1]
Konrad Rzeszutek Wilk (1):
intel_idle: Check cpu_idle_get_driver() for NULL before dereferencing it.
[3735d524da64b70b41c764359da36f88aded3610]
Krzysztof Kozlowski (1):
power: max17040: Fix NULL pointer dereference when there is no platform_data
[ac323d8d807060f7c95a685a9fe861e7b6300993]
Lai Jiangshan (1):
workqueue: ensure @task is valid across kthread_stop()
[5bdfff96c69a4d5ab9c49e60abf9e070ecd2acbb]
Lan Tianyu (1):
ACPI / processor: Rework processor throttling with work_on_cpu()
[f3ca4164529b875374c410193bbbac0ee960895f]
Larry Finger (4):
rtlwifi: Set the link state
[619ce76f8bb850b57032501a39f26aa6c6731c70]
rtlwifi: rtl8192cu: Add new device ID
[f87f960b2fb802f26ee3b00c19320e57a9c583ff]
rtlwifi: rtl8192cu: Fix some code in RF handling
[e9b0784bb9de3152e787ee779868c626b137fb3b]
staging: r8712u: Set device type to wlan
[3a21f00a5002b14e4aab52aef59d33ed28468a13]
Lars Poeschel (1):
tty: n_gsm: Fix for modems with brk in modem status control
[3ac06b905655b3ef2fd2196bab36e4587e1e4e4f]
Lars-Peter Clausen (1):
ASoC: adau1701: Fix ADAU1701_SEROCTL_WORD_LEN_16 constant
[e20970ada3f699c113fe64b04492af083d11a7d8]Laurent Dufour (1):
powerpc/crashdump : Fix page frame number check in copy_oldmem_page
[f5295bd8ea8a65dc5eac608b151386314cb978f1]
Levente Kurusa (1):
ahci: disable NCQ on Samsung pci-e SSDs on macbooks
[67809f85d31eac600f6b28defa5386c9d2a13b1d]
Li Zefan (2):
cpuset: fix a race condition in __cpuset_node_allowed_softwall()
[99afb0fd5f05aac467ffa85c36778fec4396209b]
slub: Fix calculation of cpu slabs
[8afb1474db4701d1ab80cd8251137a3260e6913e]
Linus Walleij (1):
dma: ste_dma40: don't dereference free:d descriptor
[e9baa9d9d520fb0e24cca671e430689de2d4a4b2]
Ludovic Desroches (1):
mmc: atmel-mci: fix timeout errors in SDIO mode when using DMA
[66b512eda74d59b17eac04c4da1b38d82059e6c9]
Lukasz Dorau (1):
[SCSI] isci: correct erroneous for_each_isci_host macro
[c59053a23d586675c25d789a7494adfdc02fba57]
Maciej Żenczykowski (1):
net: fix 'ip rule' iif/oif device rename
[946c032e5a53992ea45e062ecb08670ba39b99e3]
Malcolm Priestley (1):
staging: vt6656: [BUG] BBvUpdatePreEDThreshold Always set sensitivity on bScanning
[8f248dae133668bfb8e9379b4b3f0571c858b24a]
Marc Kleine-Budde (3):
can: flexcan: fix shutdown: first disable chip, then all interrupts
[5be93bdda64e85450598c6e97f79fb8f6acf30e0]
can: flexcan: flexcan_open(): fix error path if flexcan_chip_start() fails
[7e9e148af01ef388efb6e2490805970be4622792]
can: flexcan: flexcan_remove(): add missing netif_napi_del()
[d96e43e8fce28cf97df576a07af9d65657a41a6f]
Marcelo Tosatti (1):
KVM: x86: limit PIT timer frequency
[9ed96e87c5748de4c2807ef17e81287c7304186c]
Mark Brown (1):
ACPI / init: Flag use of ACPI and ACPI idioms for power supplies to regulator API
[49a12877d2777cadcb838981c3c4f5a424aef310]
Martijn de Gouw (1):
cifs: set MAY_SIGN when sec=krb5
[0b7bc84000d71f3647ca33ab1bf5bd928535c846]
Mauro Carvalho Chehab (1):
[media] dib8000: make 32 bits read atomic
[5ac64ba12aca3bef18e61c866583155a3bbf81c4]
Michael Chan (1):
tg3: Don't check undefined error bits in RXBD
[d7b95315cc7f441418845a165ee56df723941487]
Michael Grzeschik (1):
mtd: mxc_nand: remove duplicated ecc_stats counting
[0566477762f9e174e97af347ee9c865f908a5647]
Michael Holzheu (1):
s390/dump: Fix dump memory detection
[d7736ff5be31edaa4fe5ab62810c64529a24b149]
Michel Dänzer (1):
radeon/pm: Guard access to rdev->pm.power_state array
[370169516e736edad3b3c5aa49858058f8b55195]Michele Baldessari (1):
libata: add ATA_HORKAGE_BROKEN_FPDMA_AA quirk for Seagate Momentus SpinPoint M8 (2BA30001)
[b28a613e9138e4b3a64649bd60b13436f4b4b49b]
Mihai Caraman (1):
KVM: PPC: e500: Fix bad address type in deliver_tlb_misss()
[70713fe315ed14cd1bb07d1a7f33e973d136ae3d]
Mike Marciniszyn (1):
IB/qib: Add missing serdes init sequence
[2f75e12c4457a9b3d042c0a0d748fa198dc2ffaf]
Mikhail Zolotaryov (1):
USB: Nokia 502 is an unusual device
[0e16114f2db4838251fb64f3b550996ad3585890]
Miklos Szeredi (1):
fuse: fix pipe_buf_operations
[28a625cbc2a14f17b83e47ef907b2658576a32aa]
Mikulas Patocka (5):
alpha: fix broken network checksum
[0ef38d70d4118b2ce1a538d14357be5ff9dc2bbd]
dm sysfs: fix a module unload race
[2995fa78e423d7193f3b57835f6c1c75006a0315]
dm: wait until embedded kobject is released before destroying a device
[be35f486108227e10fe5d96fd42fb2b344c59983]
hpfs: remember free space
[2cbe5c76fc5e38e9af4b709593146e4b8272b69e]
time: Fix overflow when HZ is smaller than 60
[80d767d770fd9c697e434fd080c2db7b5c60c6dd]
Neil Horman (1):
vmxnet3: fix netpoll race condition
[d25f06ea466ea521b563b76661180b4e44714ae6]
NeilBrown (2):
lockd: send correct lock when granting a delayed lock.
[2ec197db1a56c9269d75e965f14c344b58b2a4f6]
md/raid5: fix long-standing problem with bitmap handling on write failure.
[9f97e4b128d2ea90a5f5063ea0ee3b0911f4c669]
Nithin Sujir (1):
tg3: Fix deadlock in tg3_change_mtu()
[c6993dfd7db9b0c6b7ca7503a56fda9236a4710f]
Oleg Nesterov (1):
md/raid5: Fix CPU hotplug callback registration
[789b5e0315284463617e106baad360cb9e8db3ac]
Oleksij Rempel (1):
ath9k_htc: Do not support PowerSave by default
[6bca610d97b6139a1d7598b8009da9d339daa50f]
Olivier Langlois (1):
rtlwifi: rtl8192ce: Fix too long disable of IRQs
[f78bccd79ba3cd9d9664981b501d57bdb81ab8a4]
Paul Bolle (1):
raw: test against runtime value of max_raw_minors
[5bbb2ae3d6f896f8d2082d1eceb6131c2420b7cf]Paul E. McKenney (2):
jiffies: Avoid undefined behavior from signed overflow
[5a581b367b5df0531265311fc681c2abd377e5e6]
printk: Fix scheduling-while-atomic problem in console_cpu_notify()
[85eae82a0855d49852b87deac8653e4ebc8b291f]
Paul Gortmaker (1):
avr32: fix missing module.h causing build failure in mimc200/fram.c
[5745d6a41a4f4aec29e2ccd591c6fb09ed73a955]
Paul Mackerras (1):
powerpc: Make sure "cache" directory is removed when offlining cpu
[91b973f90c1220d71923e7efe1e61f5329806380]
Paul Moore (1):
selinux: process labeled IPsec TCP SYN-ACK packets properly in selinux_ip_postroute()
[5c6c26813a209e7075baf908e3ad81c1a9d389e8]
Peter Chen (1):
usb: ehci: add freescale imx28 special write register method
[feffe09f510c475df082546815f9e4a573f6a233]
Peter Oberparleiter (1):
x86, hweight: Fix BUG when booting with CONFIG_GCOV_PROFILE_ALL=y
[6583327c4dd55acbbf2a6f25e775b28b3abf9a42]
Peter Zijlstra (2):
perf/x86: Fix event scheduling
[26e61e8939b1fe8729572dabe9a9e97d930dd4f6]
perf: Fix hotplug splat
[e3703f8cdfcf39c25c4338c3ad8e68891cca3731]
Prarit Bhargava (1):
x86: Add check for number of available vectors before CPU down
[da6139e49c7cb0f4251265cb5243b8d220adb48d]
Radim Krčmář (1):
KVM: SVM: fix cr8 intercept window
[596f3142d2b7be307a1652d59e7b93adab918437]
Rahul Bedarkar (1):
USB: serial: add support for iBall 3.5G connect usb modem
[7d5c1b9c7cb5ec8e52b1adc65c484a923a8ea6c3]
Ralf Baechle (1):
MIPS: Fix potencial corruption
[a16dad7763420a3b46cff1e703a9070827796cfc]
Raymond Wanyoike (1):
usb: option: blacklist ZTE MF667 net interface
[3635c7e2d59f7861afa6fa5e87e2a58860ff514d]
Roman Volkov (1):
ALSA: oxygen: Xonar DG(X): capture from I2S channel 1, not 2
[3dd77654fb1d7f68b9739f3039bad8dbbc0739f8]
Sebastian Andrzej Siewior (1):
parport: parport_pc: remove double PCI ID for NetMos
[d6a484520c5572a4170fa915109ccfc0c38f5008]
Shane Huang (1):
i2c: piix4: Add support for AMD ML and CZ SMBus changes
[032f708bc4f6da868ec49dac48ddf3670d8035d3]
Stanislaw Gruszka (3):
ath9k: protect tid->sched check
[21f8aaee0c62708654988ce092838aa7df4d25d8]
rtl8187: fix regression on MIPS without coherent DMA
[b6213e413a4e0c66548153516b074df14f9d08e0]
usb: ehci: fix deadlock when threadirqs option is used
[a1227f3c1030e96ebc51d677d2f636268845c5fb]Stephen Smalley (1):
SELinux: Fix kernel BUG on empty security contexts.
[2172fa709ab32ca60e86179dc67d0857be8e2c98]
Stephen Warren (1):
serial: 8250: enable UART_BUG_NOMSR for Tegra
[3685f19e07802ec4207b52465c408f185b66490e]
Steven Noonan (1):
compiler/gcc4: Make quirk for asm_volatile_goto() unconditional
[a9f180345f5378ac87d80ed0bea55ba421d83859]
Steven Rostedt (5):
ftrace: Fix synchronization location disabling and freeing ftrace_ops
[a4c35ed241129dd142be4cadb1e5a474a56d5464]
ftrace: Have function graph only trace based on global_ops filters
[23a8e8441a0a74dd612edf81dc89d1600bc0a3d1]
ftrace: Use schedule_on_each_cpu() as a heavy synchronize_sched()
[7614c3dc74733dff4b0e774f7a894b9ea6ec508c]
ring-buffer: Fix first commit on sub-buffer having non-zero delta
[d651aa1d68a2f0a7ee65697b04c6a92f8c0a12f2]
tracing: Do not add event files for modules that fail tracepoints
[45ab2813d40d88fc575e753c38478de242d03f88]
Sujith Manoharan (2):
ath9k: Do not support PowerSave by default
[8298383c2cd5a6d0639f1bb1781fba181bd20154]
ath9k: Fix ETSI compliance for AR9462 2.0
[b3050248c167871ca52cfdb2ce78aa2460249346]
Takashi Iwai (9):
ALSA: Enable CONFIG_ZONE_DMA for smaller PCI DMA masks
[80ab8eae70e51d578ebbeb228e0f7a562471b8b7]
ALSA: hda/realtek - Avoid invalid COEFs for ALC271X
[d3c56568f43807135f2c2a09582a69f809f0d8b7]
ALSA: rme9652: fix a missing comma in channel_map_9636_ds[]
[770bd4bf2e664939a9dacd3d26ec9ff7a3933210]
ALSA: usb-audio: Add quirk for Logitech Webcam C500
[e805ca8b0a9b6c91099c0eaa4b160a1196a4ae25]
ASoC: sta32x: Fix array access overflow
[025c3fa9256d4c54506b7a29dc3befac54f5c68d]
ASoC: sta32x: Fix wrong enum for limiter2 release rate
[b3619b288b621e63f66908045f48495869a996a6]
ASoC: wm8770: Fix wrong number of enum items
[7a6c0a58dc824523966f212c76322d47c5b0e6fe]
[media] saa7134: Fix unlocked snd_pcm_stop() call
[e6355ad7b1c6f70e2f48ae159f5658b441ccff95]
hp_accel: Add a new PnP ID HPQ6007 for new HP laptops
[b0ad4ff35d479a46a3b995a299db9aeb097acfce]Tejun Heo (3):
cgroup: update cgroup_enable_task_cg_lists() to grab siglock
[532de3fc72adc2a6525c4d53c07bf81e1732083d]
libata: disable LPM for some WD SATA-I devices
[ecd75ad514d73efc1bbcc5f10a13566c3ace5f53]
sata_sil: apply MOD15WRITE quirk to TOSHIBA MK2561GSYN
[9f9c47f00ce99329b1a82e2ac4f70f0fe3db549c]
Tetsuo Handa (1):
SELinux: Fix memory leak upon loading policy
[8ed814602876bec9bad2649ca17f34b499357a1c]
Theodore Ts'o (1):
ext4: don't leave i_crtime.tv_sec uninitialized
[19ea80603715d473600cd993b9987bc97d042e02]
Tony Breeds (1):
powerpc/le: Ensure that the 'stop-self' RTAS token is handled correctly
[41dd03a94c7d408d2ef32530545097f7d1befe5c]
Trond Myklebust (2):
NFSv4: OPEN must handle the NFS4ERR_IO return code correctly
[c7848f69ec4a8c03732cde5c949bd2aa711a9f4b]
SUNRPC: Fix races in xs_nospace()
[06ea0bfe6e6043cb56a78935a19f6f8ebc636226]
Ulrich Hahn (1):
USB: ftdi_sio: add Tagsys RFID Reader IDs
[76f24e3f39a1a94bab0d54e98899d64abcd9f69c]
Vijaya Mohan Guvva (1):
[SCSI] bfa: Chinook quad port 16G FC HBA claim issue
[dcaf9aed995c2b2a49fb86bbbcfa2f92c797ab5d]
Ville Syrjälä (2):
drm/i915: Add intel_ring_cachline_align()
[753b1ad4a281b0663329409d410243e91825c323]
drm/i915: Prevent MI_DISPLAY_FLIP straddling two cachelines on IVB
[f66fab8e1cd6b3127ba4c5c0d11539fbe1de1e36]
Vinayak Kale (1):
ARM: 7957/1: add DSB after icache flush in __flush_icache_all()
[39544ac9df20f73e49fc6b9ac19ff533388c82c0]
Wang Shilong (1):
Btrfs: handle EAGAIN case properly in btrfs_drop_snapshot()
[90515e7f5d7d24cbb2a4038a3f1b5cfa2921aa17]
Weijie Yang (1):
mm/swap: fix race on swap_info reuse between swapoff and swapon
[f893ab41e4dae2fe8991faf5d86d029068d1ef3a]
Weston Andros Adamson (2):
nfs4.1: properly handle ENOTSUP in SECINFO_NO_NAME
[78b19bae0813bd6f921ca58490196abd101297bd]
sunrpc: Fix infinite loop in RPC state machine
[6ff33b7dd0228b7d7ed44791bbbc98b03fd15d9d]
Will Deacon (2):
ARM: 7953/1: mm: ensure TLB invalidation is complete before enabling MMU
[bae0ca2bc550d1ec6a118fb8f2696f18c4da3d8e]
ARM: 7955/1: spinlock: ensure we have a compiler barrier before sev
[7c8746a9eb287642deaad0e7c2cdf482dce5e4be]
Yegor Yefremov (2):
serial: add support for 200 v3 series Titan card
[48c0247d7b7bf58abb85a39021099529df365c4d]
serial: add support for 400 and 800 v3 series Titan cards
[1e9deb118ed76b9df89d189f27a06522a03cf743]
ZHAO Gang (1):
b43: fix the wrong assignment of status.freq in b43_rx()
[64e5acb09ca6b50c97299cff9ef51299470b29f2]
Алексей Крамаренко (1):
USB: serial: ftdi_sio: add id for Z3X Box device
[e1466ad5b1aeda303f9282463d55798d2eda218c]
张君 (1):
usb: option: add new zte 3g modem pids to option driver
[4d90b819ae4c7ea8fd5e2bb7edc68c0f334be2e4]
Documentation/filesystems/proc.txt | 4 +- Documentation/i2c/busses/i2c-piix4 | 2 +- Makefile | 4 +- arch/alpha/lib/csum_partial_copy.c | 9 +- arch/arm/include/asm/cacheflush.h | 1 + arch/arm/include/asm/spinlock.h | 15 +-- arch/arm/mm/proc-v6.S | 3 +- arch/arm/mm/proc-v7.S | 2 +- arch/avr32/Makefile | 2 +- arch/avr32/boards/mimc200/fram.c | 1 + arch/mips/mm/c-r4k.c | 11 --- arch/powerpc/kernel/cacheinfo.c | 3 + arch/powerpc/kernel/crash_dump.c | 8 +- arch/powerpc/kernel/reloc_64.S | 1 + arch/powerpc/kvm/e500_tlb.c | 2 +- arch/powerpc/platforms/pseries/hotplug-cpu.c | 22 ++--- arch/s390/crypto/aes_s390.c | 79 +++++++++++----- arch/s390/crypto/des_s390.c | 103 ++++++++++++++------- arch/s390/crypto/ghash_s390.c | 21 +++-- arch/s390/crypto/sha_common.c | 9 +- arch/s390/mm/page-states.c | 10 ++ arch/x86/include/asm/irq.h | 1 + arch/x86/kernel/cpu/perf_event.c | 3 + arch/x86/kernel/irq.c | 70 ++++++++++++++ arch/x86/kernel/quirks.c | 2 +- arch/x86/kernel/smpboot.c | 5 + arch/x86/kvm/i8254.c | 18 ++++ arch/x86/kvm/lapic.c | 3 - arch/x86/kvm/svm.c | 6 +- arch/x86/kvm/x86.c | 3 + arch/x86/kvm/x86.h | 2 + arch/x86/platform/efi/efi.c | 2 +- block/blk-lib.c | 8 ++ drivers/acpi/bus.c | 9 ++ drivers/acpi/ec.c | 64 +++++++++++++ drivers/acpi/processor_throttling.c | 69 +++++++------- drivers/acpi/video.c | 8 +- drivers/ata/ahci.c | 14 +++ drivers/ata/libata-core.c | 28 ++++++ drivers/ata/libata-pmp.c | 7 +- drivers/ata/libata-scsi.c | 18 +++- drivers/ata/sata_sil.c | 1 + drivers/block/xen-blkfront.c | 5 +- drivers/char/raw.c | 2 +- drivers/dma/ioat/dma.c | 46 +++++++-- drivers/dma/ioat/dma.h | 1 + drivers/dma/ioat/dma_v2.c | 11 +-- drivers/dma/ioat/dma_v3.c | 3 + drivers/dma/ste_dma40.c | 4 +- drivers/edac/edac_mc.c | 11 ++- drivers/edac/i7300_edac.c | 38 ++++---- drivers/edac/i7core_edac.c | 9 +- drivers/gpu/drm/i915/intel_display.c | 14 +++ drivers/gpu/drm/i915/intel_dp.c | 19 ++-- drivers/gpu/drm/i915/intel_ringbuffer.c | 21 +++++ drivers/gpu/drm/i915/intel_ringbuffer.h | 1 + drivers/gpu/drm/radeon/atombios_crtc.c | 5 +- drivers/gpu/drm/radeon/r600.c | 14 +-- drivers/gpu/drm/radeon/r600d.h | 1 + drivers/gpu/drm/radeon/radeon_atombios.c | 4 + drivers/gpu/drm/radeon/radeon_i2c.c | 3 + drivers/gpu/drm/radeon/radeon_pm.c | 6 +- drivers/hv/connection.c | 12 +-- drivers/hwmon/max1668.c | 2 +- drivers/i2c/busses/Kconfig | 1 + drivers/i2c/busses/i2c-piix4.c | 26 +++++- drivers/idle/intel_idle.c | 3 +- drivers/infiniband/hw/qib/qib_iba7322.c | 5 + drivers/infiniband/hw/qib/qib_ud.c | 9 +- drivers/iommu/intel-iommu.c | 2 +- drivers/md/Kconfig | 4 + drivers/md/Makefile | 1 + drivers/md/dm-builtin.c | 49 ++++++++++ drivers/md/dm-sysfs.c | 5 +- drivers/md/dm.c | 11 +-- drivers/md/dm.h | 17 ++++ drivers/md/persistent-data/dm-space-map-common.c | 6 +- drivers/md/raid5.c | 91 +++++++++--------- drivers/media/dvb/dvb-usb/mxl111sf-tuner.h | 2 +- drivers/media/dvb/frontends/dib8000.c | 33 +++++-- drivers/media/video/saa7134/saa7134-alsa.c | 2 + drivers/mmc/host/atmel-mci.c | 13 ++- drivers/mmc/host/sdhci.c | 17 ++-- drivers/mtd/nand/mxc_nand.c | 1 - drivers/net/bonding/bond_3ad.c | 6 +- drivers/net/bonding/bond_3ad.h | 1 + drivers/net/can/flexcan.c | 13 ++- drivers/net/ethernet/broadcom/tg3.c | 7 +- drivers/net/ethernet/broadcom/tg3.h | 6 +- drivers/net/usb/gl620a.c | 4 + drivers/net/usb/mcs7830.c | 5 +- drivers/net/usb/net1080.c | 4 + drivers/net/usb/rndis_host.c | 4 + drivers/net/usb/smsc75xx.c | 4 + drivers/net/usb/smsc95xx.c | 4 + drivers/net/usb/usbnet.c | 25 ++--- drivers/net/virtio_net.c | 3 +- drivers/net/vmxnet3/vmxnet3_drv.c | 19 +++- .../net/wireless/ath/ath9k/ar9462_2p0_initvals.h | 4 +- drivers/net/wireless/ath/ath9k/htc_drv_init.c | 8 +- drivers/net/wireless/ath/ath9k/init.c | 8 +- drivers/net/wireless/ath/ath9k/xmit.c | 8 +- drivers/net/wireless/b43/xmit.c | 4 +- drivers/net/wireless/iwlwifi/iwl-agn-tx.c | 16 +++- drivers/net/wireless/mwifiex/11n.c | 3 +- drivers/net/wireless/rtl818x/rtl8187/rtl8187.h | 10 +- drivers/net/wireless/rtlwifi/core.c | 1 + drivers/net/wireless/rtlwifi/rtl8192ce/hw.c | 18 +++- drivers/net/wireless/rtlwifi/rtl8192cu/rf.c | 29 +++--- drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 1 + drivers/of/address.c | 9 +- drivers/parport/parport_pc.c | 10 +- drivers/pci/pci.c | 10 ++ drivers/platform/x86/hp_accel.c | 1 + drivers/power/max17040_battery.c | 5 +- drivers/rtc/rtc-cmos.c | 52 ++++++++++- drivers/scsi/bfa/bfad.c | 6 +- drivers/scsi/isci/host.h | 5 +- drivers/scsi/isci/port_config.c | 7 -- drivers/scsi/isci/task.c | 2 +- drivers/scsi/qla2xxx/qla_def.h | 3 +- drivers/staging/comedi/drivers/adv_pci1710.c | 17 +++- drivers/staging/comedi/drivers/pcmuio.c | 12 +-- drivers/staging/comedi/drivers/ssv_dnp.c | 6 +- drivers/staging/iio/adc/ad799x_core.c | 3 +- drivers/staging/rtl8712/usb_intf.c | 5 + drivers/staging/vt6656/baseband.c | 3 - drivers/target/iscsi/iscsi_target.c | 34 ++++--- drivers/tty/n_gsm.c | 11 +++ drivers/tty/serial/8250.c | 4 + drivers/tty/serial/8250_pci.c | 20 ++++ drivers/tty/serial/pmac_zilog.c | 3 + drivers/usb/core/config.c | 4 + drivers/usb/core/quirks.c | 4 + drivers/usb/host/ehci-hcd.c | 13 ++- drivers/usb/host/ehci-hub.c | 26 +++++- drivers/usb/host/ehci.h | 18 +++- drivers/usb/serial/cypress_m8.h | 2 +- drivers/usb/serial/ftdi_sio.c | 23 ++++- drivers/usb/serial/ftdi_sio_ids.h | 19 ++++ drivers/usb/serial/option.c | 21 ++++- drivers/usb/serial/pl2303.c | 33 +++++-- drivers/usb/storage/Kconfig | 4 +- drivers/usb/storage/scsiglue.c | 4 + drivers/usb/storage/unusual_cypress.h | 2 +- drivers/usb/storage/unusual_devs.h | 14 +++ fs/btrfs/extent-tree.c | 2 +- fs/btrfs/inode.c | 18 ++-- fs/btrfs/ioctl.c | 15 ++- fs/buffer.c | 6 +- fs/cifs/connect.c | 3 +- fs/exofs/ore.c | 37 +++++--- fs/ext4/ext4.h | 2 + fs/file.c | 2 +- fs/fuse/dev.c | 22 +---- fs/hpfs/alloc.c | 66 ++++++++++++- fs/hpfs/dir.c | 10 +- fs/hpfs/hpfs_fn.h | 2 +- fs/hpfs/super.c | 32 +++++-- fs/lockd/svclock.c | 8 ++ fs/nfs/blocklayout/extents.c | 2 +- fs/nfs/nfs4proc.c | 4 +- fs/nfs/nfs4xdr.c | 47 ++++++---- fs/ocfs2/file.c | 8 +- fs/ocfs2/quota_global.c | 27 ++++-- fs/ocfs2/quota_local.c | 4 - fs/quota/dquot.c | 14 ++- fs/splice.c | 18 ++++ include/linux/compiler-gcc4.h | 6 +- include/linux/jiffies.h | 8 +- include/linux/libata.h | 2 + include/linux/pipe_fs_i.h | 2 + include/linux/tracepoint.h | 6 ++ include/scsi/osd_ore.h | 1 + include/xen/Kbuild | 2 + kernel/cgroup.c | 5 + kernel/cpuset.c | 2 +- kernel/events/core.c | 12 +-- kernel/irq/manage.c | 2 +- kernel/printk.c | 1 - kernel/sched_fair.c | 8 +- kernel/time/jiffies.c | 6 ++ kernel/time/timekeeping.c | 2 +- kernel/trace/ftrace.c | 81 ++++++++++++++-- kernel/trace/ring_buffer.c | 7 ++ kernel/trace/trace_events.c | 10 ++ kernel/tracepoint.c | 7 +- kernel/workqueue.c | 7 ++ lib/Makefile | 1 + mm/oom_kill.c | 2 +- mm/page-writeback.c | 5 +- mm/rmap.c | 4 + mm/slub.c | 8 +- mm/swapfile.c | 11 ++- net/core/fib_rules.c | 7 ++ net/core/skbuff.c | 32 +------ net/mac80211/sta_info.c | 5 + net/mac80211/sta_info.h | 7 +- net/mac80211/tx.c | 17 +++- net/sctp/sm_statefuns.c | 7 ++ net/sctp/socket.c | 41 ++++++-- net/sunrpc/clnt.c | 8 +- net/sunrpc/xprtsock.c | 6 +- net/unix/af_unix.c | 4 +- scripts/mod/file2alias.c | 4 +- security/selinux/hooks.c | 42 +++++++-- security/selinux/ss/policydb.c | 22 ++++- security/selinux/ss/services.c | 4 + sound/pci/Kconfig | 12 +++ sound/pci/hda/patch_realtek.c | 3 + sound/pci/oxygen/xonar_dg.c | 12 ++- sound/pci/rme9652/rme9652.c | 2 +- sound/soc/codecs/adau1701.c | 2 +- sound/soc/codecs/sta32x.c | 74 +++++++-------- sound/soc/codecs/wm8770.c | 4 +- sound/usb/mixer.c | 1 + sound/usb/mixer_maps.c | 9 ++ tools/power/x86/turbostat/turbostat.c | 11 ++- virt/kvm/coalesced_mmio.c | 8 +- 219 files changed, 1989 insertions(+), 725 deletions(-)
Signature · 2 lines
Ben Hutchings friends: People who know you well, but like you anyway.
PATCH 1/200 rtlwifi: Set the link state
3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Larry Finger <[email protected]>
commit 619ce76f8bb850b57032501a39f26aa6c6731c70 upstream.
The present code fails to set the linked state when an interface is added.
--- drivers/net/wireless/rtlwifi/core.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/rtlwifi/core.c +1 -0
@@ -131,6 +131,7 @@ static int rtl_op_add_interface(struct i rtlpriv->cfg->maps [RTL_IBSS_INT_MASKS]); } + mac->link_state =MAC80211_LINKED ;break ;case NL80211_IFTYPE_ADHOC : RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD,
PATCH 2/200 rtlwifi: rtl8192cu: Fix some code in RF handling
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Larry Finger <[email protected]>
commit e9b0784bb9de3152e787ee779868c626b137fb3b upstream.
--- drivers/net/wireless/rtlwifi/rtl8192cu/rf.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-)
drivers/net/wireless/rtlwifi/rtl8192cu/rf.c +16 -13
@@ -85,17 +85,15 @@ void rtl92cu_phy_rf6052_set_cck_txpower(if (mac->act_scanning) { tx_agc[RF90_PATH_A ] =0x3f3f3f3f ; tx_agc[RF90_PATH_B ] =0x3f3f3f3f ; -if (turbo_scanoff) { -for (idx1 =RF90_PATH_A ; idx1 <=RF90_PATH_B ; idx1++) { - tx_agc[idx1] = ppowerlevel[idx1] | - (ppowerlevel[idx1] <<8 ) | - (ppowerlevel[idx1] <<16 ) | - (ppowerlevel[idx1] <<24 ); -if (rtlhal->interface ==INTF_USB ) { -if (tx_agc[idx1] >0x20 && - rtlefuse->external_pa) - tx_agc[idx1] =0x20 ; - } +for (idx1 =RF90_PATH_A ; idx1 <=RF90_PATH_B ; idx1++) { + tx_agc[idx1] = ppowerlevel[idx1] | + (ppowerlevel[idx1] <<8 ) | + (ppowerlevel[idx1] <<16 ) | + (ppowerlevel[idx1] <<24 ); +if (rtlhal->interface ==INTF_USB ) { +if (tx_agc[idx1] >0x20 && + rtlefuse->external_pa) + tx_agc[idx1] =0x20 ; } } }else {
@@ -107,7 +105,7 @@ void rtl92cu_phy_rf6052_set_cck_txpower( TXHIGHPWRLEVEL_LEVEL2) { tx_agc[RF90_PATH_A ] =0x00000000 ; tx_agc[RF90_PATH_B ] =0x00000000 ; - } else{ + } else {for (idx1 =RF90_PATH_A ; idx1 <=RF90_PATH_B ; idx1++) { tx_agc[idx1] = ppowerlevel[idx1] | (ppowerlevel[idx1] << 8) |
@@ -380,7 +378,12 @@ static void _rtl92c_write_ofdm_power_reg regoffset == RTXAGC_B_MCS07_MCS04) regoffset =0xc98 ;for (i =0 ; i <3 ; i++) { - writeVal = (writeVal >6 ) ? (writeVal -6 ) :0 ; +if (i !=2 ) + writeVal = (writeVal >8 ) ? + (writeVal -8 ) :0 ; +else + writeVal = (writeVal >6 ) ? + (writeVal -6 ) :0 ;rtl_write_byte (rtlpriv, (u32)(regoffset + i), (u8 )writeVal); }
PATCH 3/200 NFSv4: OPEN must handle the NFS4ERR_IO return code correctly
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
commit c7848f69ec4a8c03732cde5c949bd2aa711a9f4b upstream.
decode_op_hdr() cannot distinguish between an XDR decoding error and the perfectly valid errorcode NFS4ERR_IO. This is normally not a problem, but for the particular case of OPEN, we need to be able to increment the NFSv4 open sequence id when the server returns a valid response.
--- fs/nfs/nfs4xdr.c | 47 +++++++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 16 deletions(-)
fs/nfs/nfs4xdr.c +31 -16
@@ -3056,7 +3056,8 @@ out_overflow:return -EIO ; } -static int decode_op_hdr (struct xdr_stream *xdr,enum nfs_opnum4 expected) +static bool __decode_op_hdr (struct xdr_stream *xdr,enum nfs_opnum4 expected, +int *nfs_retval) {__be32 *p;uint32_t opnum;
@@ -3066,19 +3067,32 @@ static int decode_op_hdr(struct xdr_streif (unlikely (!p)) goto out_overflow; opnum =be32_to_cpup (p++); -if (opnum != expected) { -dprintk ("nfs: Server returned operation" -" %d but we issued a request for %d\n" , - opnum, expected); -return -EIO ; - } +if (unlikely (opnum != expected)) + goto out_bad_operation; nfserr =be32_to_cpup (p); -if (nfserr !=NFS_OK ) -return nfs4_stat_to_errno (nfserr); -return 0 ; +if (nfserr ==NFS_OK ) + *nfs_retval =0 ; +else + *nfs_retval =nfs4_stat_to_errno (nfserr); +return true; +out_bad_operation: +dprintk ("nfs: Server returned operation" +" %d but we issued a request for %d\n" , + opnum, expected); + *nfs_retval = -EREMOTEIO ; +return false; out_overflow:print_overflow_msg (__func__, xdr); -return -EIO ; + *nfs_retval = -EIO ; +return false; +} + +static int decode_op_hdr (struct xdr_stream *xdr,enum nfs_opnum4 expected) +{ +int retval; + +__decode_op_hdr (xdr, expected, &retval); +return retval; }/* Dummy routine */
@@ -4744,11 +4758,12 @@ static int decode_open(struct xdr_streamuint32_t savewords, bmlen, i;int status; - status =decode_op_hdr (xdr,OP_OPEN ); -if (status != -EIO ) -nfs_increment_open_seqid (status, res->seqid); -if (!status) - status =decode_stateid (xdr, &res->stateid); +if (!__decode_op_hdr (xdr,OP_OPEN , &status)) +return status; +nfs_increment_open_seqid (status, res->seqid); +if (status) +return status; + status =decode_stateid (xdr, &res->stateid);if (unlikely (status))return status;
PATCH 4/200 selinux: process labeled IPsec TCP SYN-ACK packets properly in selinux_ip_postroute()
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Paul Moore <[email protected]>
commit 5c6c26813a209e7075baf908e3ad81c1a9d389e8 upstream.
Due to difficulty in arriving at the proper security label for TCP SYN-ACK packets in selinux_ip_postroute(), we need to check packets while/before they are undergoing XFRM transforms instead of waiting until afterwards so that we can determine the correct security label.
[bwh: Backported to 3.2:
s/selinux_peerlbl_enabled()/netlbl_enabled() || selinux_xfrm_enabled()/]
--- security/selinux/hooks.c | 42 +++++++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 7 deletions(-)
security/selinux/hooks.c +35 -7
@@ -4676,22 +4676,31 @@ static unsigned int selinux_ip_postroute* as fast and as clean as possible. */ if (!selinux_policycap_netpeer)return selinux_ip_postroute_compat (skb, ifindex, family); + + secmark_active =selinux_secmark_enabled (); + peerlbl_active =netlbl_enabled () ||selinux_xfrm_enabled (); +if (!secmark_active && !peerlbl_active) +return NF_ACCEPT ; + + sk = skb->sk; +#ifdef CONFIG_XFRM /* If skb->dst->xfrm is non-NULL then the packet is undergoing an IPsec * packet transformation so allow the packet to pass without any checks * since we'll have another chance to perform access control checks * when the packet is on it's final way out. * NOTE: there appear to be some IPv6 multicast cases where skb->dst -* is NULL, in this case go ahead and apply access control. */ -if (skb_dst (skb) !=NULL &&skb_dst (skb)->xfrm !=NULL ) +* is NULL, in this case go ahead and apply access control. +* NOTE: if this is a local socket (skb->sk != NULL) that is in the +* TCP listening state we cannot wait until the XFRM processing +* is done as we will miss out on the SA label if we do; +* unfortunately, this means more work, but it is only once per +* connection. */ +if (skb_dst (skb) !=NULL &&skb_dst (skb)->xfrm !=NULL && + !(sk !=NULL && sk->sk_state ==TCP_LISTEN ))return NF_ACCEPT ;#endif - secmark_active =selinux_secmark_enabled (); - peerlbl_active =netlbl_enabled () ||selinux_xfrm_enabled (); -if (!secmark_active && !peerlbl_active) -return NF_ACCEPT ; - sk = skb->sk;if (sk ==NULL ) {/* Without an associated socket the packet is either coming * from the kernel or it is being forwarded; check the packet
@@ -4719,6 +4728,25 @@ static unsigned int selinux_ip_postroutestruct sk_security_struct *sksec = sk->sk_security;if (selinux_skb_peerlbl_sid (skb, family, &skb_sid))return NF_DROP ; +/* At this point, if the returned skb peerlbl is SECSID_NULL +* and the packet has been through at least one XFRM +* transformation then we must be dealing with the "final" +* form of labeled IPsec packet; since we've already applied +* all of our access controls on this packet we can safely +* pass the packet. */ +if (skb_sid ==SECSID_NULL ) { +switch (family) { +case PF_INET : +if (IPCB (skb)->flags &IPSKB_XFRM_TRANSFORMED ) +return NF_ACCEPT ; +break ; +case PF_INET6 : +if (IP6CB (skb)->flags &IP6SKB_XFRM_TRANSFORMED ) +return NF_ACCEPT ; +default : +return NF_DROP_ERR (-ECONNREFUSED ); + } + }if (selinux_conn_sid (sksec->sid, skb_sid, &peer_sid))return NF_DROP ; secmark_perm =PACKET__SEND ;
PATCH 5/200 parport: parport_pc: remove double PCI ID for NetMos
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <[email protected]>
commit d6a484520c5572a4170fa915109ccfc0c38f5008 upstream.
In commit 85747f ("PATCH] parport: add NetMOS 9805 support") Max added the PCI ID for NetMOS 9805 based on a Debian bug report from 2k4 which was at the v2.4.26 time frame. The patch made into 2.6.14. Shortly before that patch akpm merged commit 296d3c783b ("[PATCH] Support NetMOS based PCI cards providing serial and parallel ports") which made into v2.6.9-rc1.
Now we have two different entries for the same PCI id.
I have here the NetMos 9805 which claims to support SPP/EPP/ECP mode. This patch takes Max's entry for titan_1284p1 (base != -1 specifies the ioport for ECP mode) and replaces akpm's entry for netmos_9805 which specified -1 (=none). Both share the same PCI-ID (my card has subsystem 0x1000 / 0x0020 so it should match PCI_ANY).
While here I also drop the entry for titan_1284p2 which is the same as netmos_9815.
--- drivers/parport/parport_pc.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/parport/parport_pc.c +2 -8
@@ -2875,8 +2875,6 @@ enum parport_pc_pci_cards { syba_2p_epp, syba_1p_ecp, titan_010l, - titan_1284p1, - titan_1284p2, avlab_1p, avlab_2p, oxsemi_952,
@@ -2935,8 +2933,6 @@ static struct parport_pc_pci { /* syba_2p_epp AP138B */ { 2, { { 0, 0x078 }, { 0, 0x178 }, } }, /* syba_1p_ecp W83787 */ { 1, { { 0, 0x078 }, } }, /* titan_010l */ { 1, { { 3, -1 }, } }, - /* titan_1284p1 */ { 1, { { 0, 1 }, } }, - /* titan_1284p2 */ { 2, { { 0, 1 }, { 2, 3 }, } }, /* avlab_1p */ { 1, { { 0, 1}, } }, /* avlab_2p */ { 2, { { 0, 1}, { 2, 3 },} }, /* The Oxford Semi cards are unusual: 954 doesn't support ECP,
@@ -2952,8 +2948,8 @@ static struct parport_pc_pci { /* netmos_9705 */ { 1, { { 0, -1 }, } }, /* netmos_9715 */ { 2, { { 0, 1 }, { 2, 3 },} }, /* netmos_9755 */ { 2, { { 0, 1 }, { 2, 3 },} }, - /* netmos_9805 */ { 1, { { 0, -1 }, } }, - /* netmos_9815 */ { 2, { { 0, -1 }, { 2, -1 }, } }, + /* netmos_9805 */ { 1, { { 0, 1 }, } }, + /* netmos_9815 */ { 2, { { 0, 1 }, { 2, 3 }, } }, /* netmos_9901 */ { 1, { { 0, -1 }, } }, /* netmos_9865 */ { 1, { { 0, -1 }, } }, /* quatech_sppxp100 */ { 1, { { 0, 1 }, } },
@@ -2997,8 +2993,6 @@ static const struct pci_device_id parpor PCI_ANY_ID, PCI_ANY_ID, 0, 0, syba_1p_ecp }, { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_010L, PCI_ANY_ID, PCI_ANY_ID, 0, 0, titan_010l }, - { 0x9710, 0x9805, 0x1000, 0x0010, 0, 0, titan_1284p1 }, - { 0x9710, 0x9815, 0x1000, 0x0020, 0, 0, titan_1284p2 },/* PCI_VENDOR_ID_AVLAB/Intek21 has another bunch of cards ...*/ /* AFAVLAB_TK9902 */ { 0x14db, 0x2120, PCI_ANY_ID, PCI_ANY_ID, 0, 0, avlab_1p},
PATCH 6/200 staging: vt6656: [BUG] BBvUpdatePreEDThreshold Always set sensitivity on bScanning
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Malcolm Priestley <[email protected]>
commit 8f248dae133668bfb8e9379b4b3f0571c858b24a upstream.
byBBPreEDIndex value is initially 0, this means that from cold BBvUpdatePreEDThreshold is never set.
This means that sensitivity may be in an ambiguous state, failing to scan any wireless points or at least distant ones.
--- drivers/staging/vt6656/baseband.c | 3 --- 1 file changed, 3 deletions(-)
drivers/staging/vt6656/baseband.c +0 -3
@@ -1656,7 +1656,6 @@ BBvUpdatePreEDThreshold(if ( bScanning ) {// need Max sensitivity //RSSI -69, -70,.... -if (pDevice->byBBPreEDIndex ==0 )break ; pDevice->byBBPreEDIndex =0 ;ControlvWriteByte (pDevice,MESSAGE_REQUEST_BBREG ,0xC9 ,0x00 );//CR201(0xC9) ControlvWriteByte (pDevice,MESSAGE_REQUEST_BBREG ,0xCE ,0x30 );//CR206(0xCE)
@@ -1799,7 +1798,6 @@ BBvUpdatePreEDThreshold(if ( bScanning ) {// need Max sensitivity //RSSI -69, -70, ... -if (pDevice->byBBPreEDIndex ==0 )break ; pDevice->byBBPreEDIndex =0 ;ControlvWriteByte (pDevice,MESSAGE_REQUEST_BBREG ,0xC9 ,0x00 );//CR201(0xC9) ControlvWriteByte (pDevice,MESSAGE_REQUEST_BBREG ,0xCE ,0x24 );//CR206(0xCE)
@@ -1951,7 +1949,6 @@ BBvUpdatePreEDThreshold(case RF_VT3342A0 ://RobertYu:20060627, testing table if ( bScanning ) {// need Max sensitivity //RSSI -67, -68, ... -if (pDevice->byBBPreEDIndex ==0 )break ; pDevice->byBBPreEDIndex =0 ;ControlvWriteByte (pDevice,MESSAGE_REQUEST_BBREG ,0xC9 ,0x00 );//CR201(0xC9) ControlvWriteByte (pDevice,MESSAGE_REQUEST_BBREG ,0xCE ,0x38 );//CR206(0xCE)
PATCH 7/200 bfa: Chinook quad port 16G FC HBA claim issue
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Vijaya Mohan Guvva <[email protected]>
commit dcaf9aed995c2b2a49fb86bbbcfa2f92c797ab5d upstream.
Bfa driver crash is observed while pushing the firmware on to chinook quad port card due to uninitialized bfi_image_ct2 access which gets initialized only for CT2 ASIC based cards after request_firmware(). For quard port chinook (CT2 ASIC based), bfi_image_ct2 is not getting initialized as there is no check for chinook PCI device ID before request_firmware and instead bfi_image_cb is initialized as it is the default case for card type check.
This patch includes changes to read the right firmware for quad port chinook.
--- drivers/scsi/bfa/bfad.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/scsi/bfa/bfad.c +4 -2
@@ -1613,7 +1613,7 @@ out:static u32 *bfad_load_fwimg (struct pci_dev *pdev) { -if (pdev->device ==BFA_PCI_DEVICE_ID_CT2 ) { +if (bfa_asic_id_ct2 (pdev->device)) {if (bfi_image_ct2_size ==0 )bfad_read_firmware (pdev, &bfi_image_ct2, &bfi_image_ct2_size,BFAD_FW_FILE_CT2 );
@@ -1623,12 +1623,14 @@ bfad_load_fwimg(struct pci_dev *pdev)bfad_read_firmware (pdev, &bfi_image_ct, &bfi_image_ct_size,BFAD_FW_FILE_CT );return bfi_image_ct; - }else { + }else if (bfa_asic_id_cb (pdev->device)) {if (bfi_image_cb_size ==0 )bfad_read_firmware (pdev, &bfi_image_cb, &bfi_image_cb_size,BFAD_FW_FILE_CB );return bfi_image_cb; } + +return NULL ; } static void
PATCH 8/200 usb: option: add new zte 3g modem pids to option driver
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: 张君 <[email protected]>
commit 4d90b819ae4c7ea8fd5e2bb7edc68c0f334be2e4 upstream.
--- drivers/usb/serial/option.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/usb/serial/option.c +11 -0
@@ -1461,6 +1461,17 @@ static const struct usb_device_id option .driver_info = (kernel_ulong_t)&net_intf3_blacklist }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0178, 0xff, 0xff, 0xff), .driver_info = (kernel_ulong_t)&net_intf3_blacklist }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xffe9, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff8b, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff8c, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff8d, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff8e, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff8f, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff90, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff91, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff92, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff93, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff94, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) },
PATCH 9/200 dib8000: make 32 bits read atomic
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Mauro Carvalho Chehab <[email protected]>
commit 5ac64ba12aca3bef18e61c866583155a3bbf81c4 upstream.
As the dvb-frontend kthread can be called anytime, it can race with some get status ioctl. So, it seems better to avoid one to race with the other while reading a 32 bits register.
I can't see any other reason for having a mutex there at I2C, except to provide such kind of protection, as the I2C core already has a mutex to protect I2C transfers.
Note: instead of this approach, it could eventually remove the dib8000 specific mutex for it, and either group the 4 ops into one xfer or to manually control the I2C mutex. The main advantage of the current approach is that the changes are smaller and more puntual.
--- drivers/media/dvb/frontends/dib8000.c | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-)
drivers/media/dvb/frontends/dib8000.c +25 -8
@@ -114,15 +114,10 @@ static u16 dib8000_i2c_read16(struct i2creturn ret; } -static u16 dib8000_read_word (struct dib8000_state *state,u16 reg) +static u16 __dib8000_read_word (struct dib8000_state *state,u16 reg) {u16 ret; -if (mutex_lock_interruptible (&state->i2c_buffer_lock) <0 ) { -dprintk ("could not acquire lock" ); -return 0 ; - } - state->i2c_write_buffer[0 ] = reg >>8 ; state->i2c_write_buffer[1 ] = reg &0xff ;
@@ -140,6 +135,21 @@ static u16 dib8000_read_word(struct dib8dprintk ("i2c read error on %d" , reg); ret = (state->i2c_read_buffer[0 ] <<8 ) | state->i2c_read_buffer[1 ]; + +return ret; +} + +static u16 dib8000_read_word (struct dib8000_state *state,u16 reg) +{ +u16 ret; + +if (mutex_lock_interruptible (&state->i2c_buffer_lock) <0 ) { +dprintk ("could not acquire lock" ); +return 0 ; + } + + ret =__dib8000_read_word (state, reg); +mutex_unlock (&state->i2c_buffer_lock);return ret;
@@ -149,8 +159,15 @@ static u32 dib8000_read32(struct dib8000 {u16 rw[2 ]; - rw[0 ] =dib8000_read_word (state, reg +0 ); - rw[1 ] =dib8000_read_word (state, reg +1 ); +if (mutex_lock_interruptible (&state->i2c_buffer_lock) <0 ) { +dprintk ("could not acquire lock" ); +return 0 ; + } + + rw[0 ] =__dib8000_read_word (state, reg +0 ); + rw[1 ] =__dib8000_read_word (state, reg +1 ); + +mutex_unlock (&state->i2c_buffer_lock);return ((rw[0 ] <<16 ) | (rw[1 ])); }
PATCH 10/200 serial: add support for 400 and 800 v3 series Titan cards
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Yegor Yefremov <[email protected]>
commit 1e9deb118ed76b9df89d189f27a06522a03cf743 upstream.
add support for 400Hv3, 410Hv3 and 800Hv3
--- drivers/tty/serial/8250_pci.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/tty/serial/8250_pci.c +16 -0
@@ -1147,6 +1147,10 @@ pci_xr17c154_setup(struct serial_private#define PCI_DEVICE_ID_TITAN_800E 0xA014#define PCI_DEVICE_ID_TITAN_200EI 0xA016#define PCI_DEVICE_ID_TITAN_200EISI 0xA017 +#define PCI_DEVICE_ID_TITAN_400V3 0xA310 +#define PCI_DEVICE_ID_TITAN_410V3 0xA312 +#define PCI_DEVICE_ID_TITAN_800V3 0xA314 +#define PCI_DEVICE_ID_TITAN_800V3B 0xA315#define PCI_DEVICE_ID_OXSEMI_16PCI958 0x9538#define PCIE_DEVICE_ID_NEO_2_OX_IBM 0x00F6#define PCI_DEVICE_ID_PLX_CRONYX_OMEGA 0xc001
@@ -3465,6 +3469,18 @@ static struct pci_device_id serial_pci_t {PCI_VENDOR_ID_TITAN ,PCI_DEVICE_ID_TITAN_200EISI ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 , pbn_oxsemi_2_4000000 }, + { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400V3, +PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 , + pbn_b0_4_921600 }, + { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_410V3, +PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 , + pbn_b0_4_921600 }, + { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800V3, +PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 , + pbn_b0_4_921600 }, + { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800V3B, +PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 , + pbn_b0_4_921600 }, { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_550, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
PATCH 11/200 serial: add support for 200 v3 series Titan card
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Yegor Yefremov <[email protected]>
commit 48c0247d7b7bf58abb85a39021099529df365c4d upstream.
--- drivers/tty/serial/8250_pci.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/tty/serial/8250_pci.c +4 -0
@@ -1147,6 +1147,7 @@ pci_xr17c154_setup(struct serial_private#define PCI_DEVICE_ID_TITAN_800E 0xA014#define PCI_DEVICE_ID_TITAN_200EI 0xA016#define PCI_DEVICE_ID_TITAN_200EISI 0xA017 +#define PCI_DEVICE_ID_TITAN_200V3 0xA306#define PCI_DEVICE_ID_TITAN_400V3 0xA310#define PCI_DEVICE_ID_TITAN_410V3 0xA312#define PCI_DEVICE_ID_TITAN_800V3 0xA314
@@ -3469,6 +3470,9 @@ static struct pci_device_id serial_pci_t {PCI_VENDOR_ID_TITAN ,PCI_DEVICE_ID_TITAN_200EISI ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 , pbn_oxsemi_2_4000000 }, + { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200V3, +PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 , + pbn_b0_bt_2_921600 }, { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400V3,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 , pbn_b0_4_921600 },
PATCH 12/200 x86/efi: Fix off-by-one bug in EFI Boot Services reservation
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Dave Young <[email protected]>
commit a7f84f03f660d93574ac88835d056c0d6468aebe upstream.
Current code check boot service region with kernel text region by:
start+size >= __pa_symbol(_text)
The end of the above region should be start + size - 1 instead.
I see this problem in ovmf + Fedora 19 grub boot:
text start: 1000000 md start: 800000 md size: 800000
--- arch/x86/platform/efi/efi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/platform/efi/efi.c +1 -1
@@ -424,7 +424,7 @@ void __init efi_reserve_boot_services(vo* - Not within any part of the kernel * - Not the bios reserved area */ -if ((start+size >=virt_to_phys (_text) +if ((start + size >virt_to_phys (_text) && start <=virt_to_phys (_end)) || !e820_all_mapped (start, start+size,E820_RAM ) || memblock_x86_check_reserved_size(&start, &size,
PATCH 13/200 rtc-cmos: Add an alarm disable quirk
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Borislav Petkov <[email protected]>
commit d5a1c7e3fc38d9c7d629e1e47f32f863acbdec3d upstream.
41c7f7424259f ("rtc: Disable the alarm in the hardware (v2)") added the functionality to disable the RTC wake alarm when shutting down the box.
However, there are at least two b0rked BIOSes we know about:
https://bugzilla.novell.com/show_bug.cgi?id=812592
https://bugzilla.novell.com/show_bug.cgi?id=805740
where, when wakeup alarm is enabled in the BIOS, the machine reboots automatically right after shutdown, regardless of what wakeup time is programmed.
Bisecting the issue lead to this patch so disable its functionality with a DMI quirk only for those boxes.
--- drivers/rtc/rtc-cmos.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-)
drivers/rtc/rtc-cmos.c +51 -1
@@ -34,11 +34,11 @@#include <linux/interrupt.h> #include <linux/spinlock.h> #include <linux/platform_device.h> -#include <linux/mod_devicetable.h> #include <linux/log2.h> #include <linux/pm.h> #include <linux/of.h> #include <linux/of_platform.h> +#include <linux/dmi.h> /* this is for "generic access to PC-style RTC" using CMOS_READ/CMOS_WRITE */ #include <asm-generic/rtc.h>
@@ -377,6 +377,51 @@ static int cmos_set_alarm(struct devicereturn 0 ; } +/* +* Do not disable RTC alarm on shutdown - workaround for b0rked BIOSes. +*/ +static bool alarm_disable_quirk; + +static int __init set_alarm_disable_quirk (const struct dmi_system_id *id) +{ + alarm_disable_quirk = true; +pr_info ("rtc-cmos: BIOS has alarm-disable quirk. " ); +pr_info ("RTC alarms disabled\n" ); +return 0 ; +} + +static const struct dmi_system_id rtc_quirks[]__initconst = { +/* https://bugzilla.novell.com/show_bug.cgi?id=805740 */ + { + .callback = set_alarm_disable_quirk, + .ident ="IBM Truman" , + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"TOSHIBA" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"4852570" ), + }, + }, +/* https://bugzilla.novell.com/show_bug.cgi?id=812592 */ + { + .callback = set_alarm_disable_quirk, + .ident ="Gigabyte GA-990XA-UD3" , + .matches = { +DMI_MATCH (DMI_SYS_VENDOR , +"Gigabyte Technology Co., Ltd." ), +DMI_MATCH (DMI_PRODUCT_NAME ,"GA-990XA-UD3" ), + }, + }, +/* http://permalink.gmane.org/gmane.linux.kernel/1604474 */ + { + .callback = set_alarm_disable_quirk, + .ident ="Toshiba Satellite L300" , + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"TOSHIBA" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"Satellite L300" ), + }, + }, + {} +}; +static int cmos_alarm_irq_enable (struct device *dev,unsigned int enabled) {struct cmos_rtc *cmos =dev_get_drvdata (dev);
@@ -385,6 +430,9 @@ static int cmos_alarm_irq_enable(structif (!is_valid_irq (cmos->irq))return -EINVAL ; +if (alarm_disable_quirk) +return 0 ; +spin_lock_irqsave (&rtc_lock, flags);if (enabled)
@@ -1166,6 +1214,8 @@ static int __init cmos_init(void) platform_driver_registered = true; } +dmi_check_system (rtc_quirks); +if (retval ==0 )return 0 ;
PATCH 14/200 slub: Fix calculation of cpu slabs
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Li Zefan <[email protected]>
commit 8afb1474db4701d1ab80cd8251137a3260e6913e upstream.
/sys/kernel/slab/:t-0000048 # cat cpu_slabs
231 N0=16 N1=215
/sys/kernel/slab/:t-0000048 # cat slabs
145 N0=36 N1=109
See, the number of slabs is smaller than that of cpu slabs.
The bug was introduced by commit 49e2258586b423684f03c278149ab46d8f8b6700 ("slub: per cpu cache for partial pages").
We should use page->pages instead of page->pobjects when calculating the number of cpu partial slabs. This also fixes the mapping of slabs and nodes.
As there's no variable storing the number of total/active objects in cpu partial slabs, and we don't have user interfaces requiring those statistics, I just add WARN_ON for those cases.
--- mm/slub.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
mm/slub.c +7 -1
@@ -4483,7 +4483,13 @@ static ssize_t show_slab_objects(struct page = c->partial;if (page) { - x = page->pobjects; + node =page_to_nid (page); +if (flags &SO_TOTAL ) +WARN_ON_ONCE (1 ); +else if (flags &SO_OBJECTS ) +WARN_ON_ONCE (1 ); +else + x = page->pages; total += x; nodes[node] += x; }
PATCH 15/200 mtd: mxc_nand: remove duplicated ecc_stats counting
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Michael Grzeschik <[email protected]>
commit 0566477762f9e174e97af347ee9c865f908a5647 upstream.
The ecc_stats.corrected count variable will already be incremented in the above framework-layer just after this callback.
--- drivers/mtd/nand/mxc_nand.c | 1 - 1 file changed, 1 deletion(-)
drivers/mtd/nand/mxc_nand.c +0 -1
@@ -596,7 +596,6 @@ static int mxc_nand_correct_data_v2_v3(s ecc_stat >>=4 ; }while (--no_subpages); - mtd->ecc_stats.corrected += ret;pr_debug ("%d Symbol Correctable RS-ECC Error\n" , ret);return ret;
PATCH 16/200 USB: pl2303: fix data corruption on termios updates
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 623c8263376c0b8a4b0c220232e7313d762cd0cc upstream.
Some PL2303 devices are known to lose bytes if you change serial settings even to the same values as before. Avoid this by comparing the encoded settings with the previsouly used ones before configuring the device.
The common case was fixed by commit bf5e5834bffc6 ("pl2303: Fix mode switching regression"), but this problem was still possible to trigger, for instance, by using the TCSETS2-interface to repeatedly request 115201 baud, which gets mapped to 115200 and thus always triggers a settings update.
--- drivers/usb/serial/pl2303.c | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-)
drivers/usb/serial/pl2303.c +25 -8
@@ -153,6 +153,8 @@ struct pl2303_private {u8 line_control;u8 line_status;enum pl2303_type type; + +u8 line_settings[7 ]; }; static int pl2303_vendor_read(__u16 value, __u16 index,
@@ -266,10 +268,6 @@ static void pl2303_set_termios(struct ttdbg ("%s - port %d" , __func__, port->number); -/* The PL2303 is reported to lose bytes if you change -serial settings even to the same values as before. Thus -we actually need to filter in this specific case */ -if (old_termios && !tty_termios_hw_change (tty->termios, old_termios))return ;
@@ -407,10 +405,29 @@ static void pl2303_set_termios(struct ttdbg ("%s - parity = none" , __func__); } - i =usb_control_msg (serial->dev,usb_sndctrlpipe (serial->dev,0 ), -SET_LINE_REQUEST ,SET_LINE_REQUEST_TYPE , -0 ,0 , buf,7 ,100 ); -dbg ("0x21:0x20:0:0 %d" , i); +/* +* Some PL2303 are known to lose bytes if you change serial settings +* even to the same values as before. Thus we actually need to filter +* in this specific case. +* +* Note that the tty_termios_hw_change check above is not sufficient +* as a previously requested baud rate may differ from the one +* actually used (and stored in old_termios). +* +* NOTE: No additional locking needed for line_settings as it is +* only used in set_termios, which is serialised against itself. +*/ +if (!old_termios ||memcmp (buf, priv->line_settings,7 )) { + i =usb_control_msg (serial->dev, +usb_sndctrlpipe (serial->dev,0 ), +SET_LINE_REQUEST ,SET_LINE_REQUEST_TYPE , +0 ,0 , buf,7 ,100 ); + +dbg ("0x21:0x20:0:0 %d" , i); + +if (i ==7 ) +memcpy (priv->line_settings, buf,7 ); + }/* change control lines if we are switching to or from B0 */ spin_lock_irqsave (&priv->lock, flags);
PATCH 17/200 USB: serial: add support for iBall 3.5G connect usb modem
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Rahul Bedarkar <[email protected]>
commit 7d5c1b9c7cb5ec8e52b1adc65c484a923a8ea6c3 upstream.
Add support for iBall 3.5G connect usb modem.
$lsusb
Bus 002 Device 006: ID 1c9e:9605 OMEGA TECHNOLOGY
$usb-devices
T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 6 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=1c9e ProdID=9605 Rev=00.00 S: Manufacturer=USB Modem S: Product=USB Modem S: SerialNumber=1234567890ABCDEF C: #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#= 4 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
--- drivers/usb/serial/option.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/serial/option.c +4 -0
@@ -325,6 +325,9 @@ static void option_instat_callback(struc* It seems to contain a Qualcomm QSC6240/6290 chipset */ #define FOUR_G_SYSTEMS_PRODUCT_W14 0x9603 +/* iBall 3.5G connect wireless modem */ +#define IBALL_3_5G_CONNECT 0x9605 +/* Zoom */ #define ZOOM_PRODUCT_4597 0x9607
@@ -1520,6 +1523,7 @@ static const struct usb_device_id option .driver_info = (kernel_ulong_t)&four_g_w14_blacklist }, { USB_DEVICE(LONGCHEER_VENDOR_ID, ZOOM_PRODUCT_4597) }, + { USB_DEVICE(LONGCHEER_VENDOR_ID, IBALL_3_5G_CONNECT) }, { USB_DEVICE(HAIER_VENDOR_ID, HAIER_PRODUCT_CE100) },/* Pirelli */ { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_C100_1)},
PATCH 18/200 USB: Nokia 502 is an unusual device
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Mikhail Zolotaryov <[email protected]>
commit 0e16114f2db4838251fb64f3b550996ad3585890 upstream.
The USB storage operation of Nokia Asha 502 Dual SIM smartphone running Asha Platform 1.1.1 is unreliable in respect of data consistency (i.e. transfered files are corrupted). A similar issue is described here:
http://discussions.nokia.com/t5/Asha-and-other-Nokia-Series-30/Nokia-301-USB-transfers-and-corrupted-files/td-p/1974170
The workaround is (MAX_SECTORS_64):
rmmod usb_storage && modprobe usb_storage quirks=0421:06aa:m
The patch adds the tested device to the unusual list permanently.
--- drivers/usb/storage/unusual_devs.h | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/usb/storage/unusual_devs.h +7 -0
@@ -226,6 +226,13 @@ UNUSUAL_DEV( 0x0421, 0x0495, 0x0370, 0x USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_MAX_SECTORS_64 ), +/* Patch submitted by Mikhail Zolotaryov <[email protected]> */ +UNUSUAL_DEV( 0x0421, 0x06aa, 0x1110, 0x1110, + "Nokia", + "502", + USB_SC_DEVICE, USB_PR_DEVICE, NULL, + US_FL_MAX_SECTORS_64 ), +#ifdef NO_SDDR09 UNUSUAL_DEV( 0x0436, 0x0005, 0x0100, 0x0100, "Microtech",
PATCH 19/200 USB: cypress_m8: fix ring-indicator detection and reporting
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 440ebadeae9298d7de3d4d105342691841ec88d0 upstream.
Fix ring-indicator (RI) status-bit definition, which was defined as CTS, effectively preventing RI-changes from being detected while reporting false RI status.
This bug predates git.
--- drivers/usb/serial/cypress_m8.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/serial/cypress_m8.h +1 -1
@@ -63,7 +63,7 @@#define UART_DSR 0x20/* data set ready - flow control - device to host */ #define CONTROL_RTS 0x10/* request to send - flow control - host to device */ #define UART_CTS 0x10/* clear to send - flow control - device to host */ -#define UART_RI 0x10/* ring indicator - modem - device to host */ +#define UART_RI 0x80/* ring indicator - modem - device to host */ #define UART_CD 0x40/* carrier detect - modem - device to host */ #define CYP_ERROR 0x08/* received from input report - device to host */ /* Note - the below has nothing to do with the "feature report" reset */
PATCH 20/200 ALSA: rme9652: fix a missing comma in channel_map_9636_ds[]
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 770bd4bf2e664939a9dacd3d26ec9ff7a3933210 upstream.
The lack of comma leads to the wrong channel for an SPDIF channel. Unfortunately this wasn't caught by compiler because it's still a valid expression.
--- sound/pci/rme9652/rme9652.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/rme9652/rme9652.c +1 -1
@@ -285,7 +285,7 @@ static char channel_map_9636_ds[26] = {/* ADAT channels are remapped */ 1 ,3 ,5 ,7 ,9 ,11 ,13 ,15 ,/* channels 8 and 9 are S/PDIF */ -24 ,25 +24 ,25 ,/* others don't exist */ -1 ,-1 ,-1 ,-1 ,-1 ,-1 ,-1 ,-1 ,-1 ,-1 ,-1 ,-1 ,-1 ,-1 ,-1 };
PATCH 21/200 sunrpc: Fix infinite loop in RPC state machine
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Weston Andros Adamson <[email protected]>
commit 6ff33b7dd0228b7d7ed44791bbbc98b03fd15d9d upstream.
When a task enters call_refreshresult with status 0 from call_refresh and !rpcauth_uptodatecred(task) it enters call_refresh again with no rate-limiting or max number of retries.
Instead of trying forever, make use of the retry path that other errors use.
This only seems to be possible when the crrefresh callback is gss_refresh_null, which only happens when destroying the context.
To reproduce:
1) mount with sec=krb5 (or sec=sys with krb5 negotiated for non FSID specific operations).
2) reboot - the client will be stuck and will need to be hard rebooted
BUG: soft lockup - CPU#0 stuck for 22s! [kworker/0:2:46] Modules linked in: rpcsec_gss_krb5 nfsv4 nfs fscache ppdev crc32c_intel aesni_intel aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd serio_raw i2c_piix4 i2c_core e1000 parport_pc parport shpchp nfsd auth_rpcgss oid_registry exportfs nfs_acl lockd sunrpc autofs4 mptspi scsi_transport_spi mptscsih mptbase ata_generic floppy irq event stamp: 195724 hardirqs last enabled at (195723): [<ffffffff814a925c>] restore_args+0x0/0x30 hardirqs last disabled at (195724): [<ffffffff814b0a6a>] apic_timer_interrupt+0x6a/0x80 softirqs last enabled at (195722): [<ffffffff8103f583>] __do_softirq+0x1df/0x276 softirqs last disabled at (195717): [<ffffffff8103f852>] irq_exit+0x53/0x9a CPU: 0 PID: 46 Comm: kworker/0:2 Not tainted 3.13.0-rc3-branch-dros_testing+ #4 Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/31/2013 Workqueue: rpciod rpc_async_schedule [sunrpc] task: ffff8800799c4260 ti: ffff880079002000 task.ti: ffff880079002000 RIP: 0010:[<ffffffffa0064fd4>] [<ffffffffa0064fd4>] __rpc_execute+0x8a/0x362 [sunrpc] RSP: 0018:ffff880079003d18 EFLAGS: 00000246 RAX: 0000000000000005 RBX: 0000000000000007 RCX: 0000000000000007 RDX: 0000000000000007 RSI: ffff88007aecbae8 RDI: ffff8800783d8900 RBP: ffff880079003d78 R08: ffff88006e30e9f8 R09: ffffffffa005a3d7 R10: ffff88006e30e7b0 R11: ffff8800783d8900 R12: ffffffffa006675e R13: ffff880079003ce8 R14: ffff88006e30e7b0 R15: ffff8800783d8900 FS: 0000000000000000(0000) GS:ffff88007f200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f3072333000 CR3: 0000000001a0b000 CR4: 00000000001407f0 Stack: ffff880079003d98 0000000000000246 0000000000000000 ffff88007a9a4830 ffff880000000000 ffffffff81073f47 ffff88007f212b00 ffff8800799c4260 ffff8800783d8988 ffff88007f212b00 ffffe8ffff604800 0000000000000000 Call Trace: [<ffffffff81073f47>] ? trace_hardirqs_on_caller+0x145/0x1a1 [<ffffffffa00652d3>] rpc_async_schedule+0x27/0x32 [sunrpc] [<ffffffff81052974>] process_one_work+0x211/0x3a5 [<ffffffff810528d5>] ? process_one_work+0x172/0x3a5 [<ffffffff81052eeb>] worker_thread+0x134/0x202 [<ffffffff81052db7>] ? rescuer_thread+0x280/0x280 [<ffffffff81052db7>] ? rescuer_thread+0x280/0x280 [<ffffffff810584a0>] kthread+0xc9/0xd1 [<ffffffff810583d7>] ? __kthread_parkme+0x61/0x61 [<ffffffff814afd6c>] ret_from_fork+0x7c/0xb0 [<ffffffff810583d7>] ? __kthread_parkme+0x61/0x61 Code: e8 87 63 fd e0 c6 05 10 dd 01 00 01 48 8b 43 70 4c 8d 6b 70 45 31 e4 a8 02 0f 85 d5 02 00 00 4c 8b 7b 48 48 c7 43 48 00 00 00 00 <4c> 8b 4b 50 4d 85 ff 75 0c 4d 85 c9 4d 89 cf 0f 84 32 01 00 00
And the output of "rpcdebug -m rpc -s all":
RPC: 61 call_refresh (status 0) RPC: 61 call_refresh (status 0) RPC: 61 refreshing RPCSEC_GSS cred ffff88007a413cf0 RPC: 61 refreshing RPCSEC_GSS cred ffff88007a413cf0 RPC: 61 call_refreshresult (status 0) RPC: 61 refreshing RPCSEC_GSS cred ffff88007a413cf0 RPC: 61 call_refreshresult (status 0) RPC: 61 refreshing RPCSEC_GSS cred ffff88007a413cf0 RPC: 61 call_refresh (status 0) RPC: 61 call_refreshresult (status 0) RPC: 61 call_refresh (status 0) RPC: 61 call_refresh (status 0) RPC: 61 refreshing RPCSEC_GSS cred ffff88007a413cf0 RPC: 61 call_refreshresult (status 0) RPC: 61 call_refresh (status 0) RPC: 61 refreshing RPCSEC_GSS cred ffff88007a413cf0 RPC: 61 call_refresh (status 0) RPC: 61 refreshing RPCSEC_GSS cred ffff88007a413cf0 RPC: 61 refreshing RPCSEC_GSS cred ffff88007a413cf0 RPC: 61 call_refreshresult (status 0) RPC: 61 call_refresh (status 0) RPC: 61 call_refresh (status 0) RPC: 61 call_refresh (status 0) RPC: 61 call_refresh (status 0) RPC: 61 call_refreshresult (status 0) RPC: 61 refreshing RPCSEC_GSS cred ffff88007a413cf0
--- net/sunrpc/clnt.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
net/sunrpc/clnt.c +6 -2
@@ -1002,9 +1002,13 @@ call_refreshresult(struct rpc_task *task task->tk_action = call_refresh;switch (status) {case 0 : -if (rpcauth_uptodatecred (task)) +if (rpcauth_uptodatecred (task)) { task->tk_action = call_allocate; -return ; +return ; + } +/* Use rate-limiting and a max number of retries if refresh +* had status 0 but failed to update the cred. +*/ case -ETIMEDOUT :rpc_delay (task,3 *HZ );case -EAGAIN :
PATCH 22/200 SELinux: Fix memory leak upon loading policy
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Tetsuo Handa <[email protected]>
commit 8ed814602876bec9bad2649ca17f34b499357a1c upstream.
Hello.
I got below leak with linux-3.10.0-54.0.1.el7.x86_64 .
[ 681.903890] kmemleak: 5538 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
Below is a patch, but I don't know whether we need special handing for undoing ebitmap_set_bit() call.
----------
Quoted 1 line
Quoted 1 line
Quoted 1 line
From
fe97527a90fe95e2239dfbaa7558f0ed559c0992Mon Sep 17 00:00:00 2001
From: Tetsuo Handa <[email protected]>
Date: Mon, 6 Jan 2014 16:30:21 +0900
Subject: [PATCH] SELinux: Fix memory leak upon loading policy
Commit 2463c26d "SELinux: put name based create rules in a hashtable" did not check return value from hashtab_insert() in filename_trans_read(). It leaks memory if hashtab_insert() returns error.
unreferenced object 0xffff88005c9160d0 (size 8):
comm "systemd", pid 1, jiffies 4294688674 (age 235.265s)
hex dump (first 8 bytes):
57 0b 00 00 6b 6b 6b a5 W...kkk.
backtrace:
[<ffffffff816604ae>] kmemleak_alloc+0x4e/0xb0
[<ffffffff811cba5e>] kmem_cache_alloc_trace+0x12e/0x360
[<ffffffff812aec5d>] policydb_read+0xd1d/0xf70
[<ffffffff812b345c>] security_load_policy+0x6c/0x500
[<ffffffff812a623c>] sel_write_load+0xac/0x750
[<ffffffff811eb680>] vfs_write+0xc0/0x1f0
[<ffffffff811ec08c>] SyS_write+0x4c/0xa0
[<ffffffff81690419>] system_call_fastpath+0x16/0x1b
[<ffffffffffffffff>] 0xffffffffffffffffHowever, we should not return EEXIST error to the caller, or the systemd will show below message and the boot sequence freezes.
systemd[1]: Failed to load SELinux policy. Freezing.
--- security/selinux/ss/policydb.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
security/selinux/ss/policydb.c +13 -1
@@ -1914,7 +1914,19 @@ static int filename_trans_read(struct poif (rc) goto out; -hashtab_insert (p->filename_trans, ft, otype); + rc =hashtab_insert (p->filename_trans, ft, otype); +if (rc) { +/* +* Do not return -EEXIST to the caller, or the system +* will not boot. +*/ +if (rc != -EEXIST ) + goto out; +/* But free memory to avoid memory leak. */ +kfree (ft); +kfree (name); +kfree (otype); + } }hash_eval (p->filename_trans,"filenametr" );return 0 ;
PATCH 23/200 drm/radeon: warn users when hw_i2c is enabled (v2)
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit d195178297de9a91246519dbfa98952b70f9a9b6 upstream.
The hw i2c engines are disabled by default as the current implementation is still experimental. Print a warning when users enable it so that it's obvious when the option is enabled.
v2: check for non-0 rather than 1
--- drivers/gpu/drm/radeon/radeon_i2c.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/radeon/radeon_i2c.c +3 -0
@@ -998,6 +998,9 @@ void radeon_i2c_destroy(struct radeon_i2/* Add the default buses */ void radeon_i2c_init (struct radeon_device *rdev) { +if (radeon_hw_i2c) +DRM_INFO ("hw_i2c forced on, you may experience display detection problems!\n" ); +if (rdev->is_atom_bios)radeon_atombios_i2c_init (rdev);else
PATCH 24/200 USB: ftdi_sio: added CS5 quirk for broken smartcard readers
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Colin Leitner <[email protected]>
commit c1f15196ac3b541d084dc80a8fbd8a74c6a0bd44 upstream.
Genuine FTDI chips support only CS7/8. A previous fix in commit 8704211f65a2 ("USB: ftdi_sio: fixed handling of unsupported CSIZE setting") enforced this limitation and reported it back to userspace.
However, certain types of smartcard readers depend on specific driver behaviour that requests 0 data bits (not 5) to change into a different operating mode if CS5 has been set.
This patch reenables this behaviour for all FTDI devices.
Tagged to be added to stable, because it affects a lot of users of embedded systems which rely on these readers to work properly.
--- drivers/usb/serial/ftdi_sio.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
drivers/usb/serial/ftdi_sio.c +15 -2
@@ -2193,10 +2193,20 @@ static void ftdi_set_termios(struct tty_ }/* -* All FTDI UART chips are limited to CS7/8. We won't pretend to +* All FTDI UART chips are limited to CS7/8. We shouldn't pretend to * support CS5/6 and revert the CSIZE setting instead. +* +* CS5 however is used to control some smartcard readers which abuse +* this limitation to switch modes. Original FTDI chips fall back to +* eight data bits. +* +* TODO: Implement a quirk to only allow this with mentioned +* readers. One I know of (Argolis Smartreader V1) +* returns "USB smartcard server" as iInterface string. +* The vendor didn't bother with a custom VID/PID of +* course. */ -if ((C_CSIZE (tty) !=CS8 ) && (C_CSIZE (tty) !=CS7 )) { +if (C_CSIZE (tty) ==CS6 ) {dev_warn (&port->dev,"requested CSIZE setting not supported\n" ); termios->c_cflag &= ~CSIZE ;
@@ -2243,6 +2253,9 @@ no_skip: urb_value |=FTDI_SIO_SET_DATA_PARITY_NONE ; }switch (cflag &CSIZE ) { +case CS5 : +dev_dbg (&port->dev,"Setting CS5 quirk\n" ); +break ;case CS7 : urb_value |=7 ;dev_dbg (&port->dev,"Setting CS7\n" );
PATCH 25/200 serial: 8250: enable UART_BUG_NOMSR for Tegra
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Warren <[email protected]>
commit 3685f19e07802ec4207b52465c408f185b66490e upstream.
Tegra chips have 4 or 5 identical UART modules embedded. UARTs C..E have their MODEM-control signals tied off to a static state. However UARTs A and B can optionally route those signals to/from package pins, depending on the exact pinmux configuration.
When these signals are not routed to package pins, false interrupts may trigger either temporarily, or permanently, all while not showing up in the IIR; it will read as NO_INT. This will eventually lead to the UART IRQ being disabled due to unhandled interrupts. When this happens, the kernel may print e.g.:
irq 68: nobody cared (try booting with the "irqpoll" option)
In order to prevent this, enable UART_BUG_NOMSR. This prevents UART_IER_MSI from being enabled, which prevents the false interrupts from triggering.
In practice, this is not needed under any of the following conditions:
* On Tegra chips after Tegra30, since the HW bug has apparently been fixed.
* On UARTs C..E since their MODEM control signals are tied to the correct static state which doesn't trigger the issue.
* On UARTs A..B if the MODEM control signals are routed out to package pins, since they will then carry valid signals.
However, we ignore these exceptions for now, since they are only relevant if a board actually hooks up more than a 4-wire UART, and no currently supported board does this. If we ever support a board that does, we can refine the algorithm that enables UART_BUG_NOMSR to take those exceptions into account, and/or read a flag from DT/... that indicates that the board has hooked up and pinmux'd more than a 4-wire UART.
[bwh: Backported to 3.2:
- Adjust filename
- s/port->/up->port./]
--- drivers/tty/serial/8250.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/tty/serial/8250.c +4 -0
@@ -2701,6 +2701,10 @@ static void serial8250_config_port(strucif (up->port.type ==PORT_16550A && up->port.iotype ==UPIO_AU ) up->bugs |=UART_BUG_NOMSR ; +/* HW bugs may trigger IRQ while IIR == NO_INT */ +if (up->port.type ==PORT_TEGRA ) + up->bugs |=UART_BUG_NOMSR ; +if (up->port.type !=PORT_UNKNOWN && flags &UART_CONFIG_IRQ )autoconfig_irq (up);
PATCH 26/200 dm: wait until embedded kobject is released before destroying a device
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <[email protected]>
commit be35f486108227e10fe5d96fd42fb2b344c59983 upstream.
There may be other parts of the kernel holding a reference on the dm kobject. We must wait until all references are dropped before deallocating the mapped_device structure.
The dm_kobject_release method signals that all references are dropped via completion. But dm_kobject_release doesn't free the kobject (which is embedded in the mapped_device structure).
This is the sequence of operations:
* when destroying a DM device, call kobject_put from dm_sysfs_exit
* wait until all users stop using the kobject, when it happens the release method is called
* the release method signals the completion and should return without delay
* the dm device removal code that waits on the completion continues
* the dm device removal code drops the dm_mod reference the device had
* the dm device removal code frees the mapped_device structure that contains the kobject
Using kobject this way should avoid the module unload race that was mentioned at the beginning of this thread:
https://lkml.org/lkml/2014/1/4/83
--- drivers/md/dm-sysfs.c | 10 +++++++++- drivers/md/dm.c | 11 +++++++++++ drivers/md/dm.h | 2 ++ 3 files changed, 22 insertions(+), 1 deletion(-)
drivers/md/dm-sysfs.c +9 -1
@@ -79,6 +79,11 @@ static const struct sysfs_ops dm_sysfs_o .show = dm_attr_show, }; +static void dm_kobject_release (struct kobject *kobj) +{ +complete (dm_get_completion_from_kobject (kobj)); +} +/* * dm kobject is embedded in mapped_device structure * no need to define release function here
@@ -86,6 +91,7 @@ static const struct sysfs_ops dm_sysfs_ostatic struct kobj_type dm_ktype = { .sysfs_ops = &dm_sysfs_ops, .default_attrs = dm_attrs, + .release = dm_kobject_release, };/*
@@ -104,5 +110,7 @@ int dm_sysfs_init(struct mapped_device **/ void dm_sysfs_exit (struct mapped_device *md) { -kobject_put (dm_kobject (md)); +struct kobject *kobj =dm_kobject (md); +kobject_put (kobj); +wait_for_completion (dm_get_completion_from_kobject (kobj)); }
drivers/md/dm.c +11 -0
@@ -195,6 +195,9 @@ struct mapped_device {/* sysfs handle */ struct kobject kobj; +/* wait until the kobject is released */ +struct completion kobj_completion; +/* zero-length flush that will be cloned and submitted to targets */ struct bio flush_bio; };
@@ -1891,6 +1894,7 @@ static struct mapped_device *alloc_dev(iinit_waitqueue_head (&md->wait);INIT_WORK (&md->work, dm_wq_work);init_waitqueue_head (&md->eventq); +init_completion (&md->kobj_completion); md->disk->major = _major; md->disk->first_minor = minor;
@@ -2705,6 +2709,13 @@ struct mapped_device *dm_get_from_kobjecreturn md; } +struct completion *dm_get_completion_from_kobject (struct kobject *kobj) +{ + struct mapped_device *md = container_of(kobj, struct mapped_device, kobj); + +return &md->kobj_completion; +} +int dm_suspended_md (struct mapped_device *md) {return test_bit (DMF_SUSPENDED , &md->flags);
drivers/md/dm.h +2 -0
@@ -15,6 +15,7 @@#include <linux/list.h> #include <linux/blkdev.h> #include <linux/hdreg.h> +#include <linux/completion.h> /* * Suspend feature flags
@@ -123,6 +124,7 @@ int dm_sysfs_init(struct mapped_device *void dm_sysfs_exit (struct mapped_device *md);struct kobject *dm_kobject (struct mapped_device *md);struct mapped_device *dm_get_from_kobject (struct kobject *kobj); +struct completion *dm_get_completion_from_kobject (struct kobject *kobj);/* * Targets for linear and striped mappings
PATCH 27/200 dm space map common: make sure new space is used during extend
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Joe Thornber <[email protected]>
commit 12c91a5c2d2a8e8cc40a9552313e1e7b0a2d9ee3 upstream.
When extending a low level space map we should update nr_blocks at the start so the new space is used for the index entries.
Otherwise extend can fail, e.g.: sm_metadata_extend call sequence that fails:
-> sm_ll_extend
-> dm_tm_new_block -> dm_sm_new_block -> sm_bootstrap_new_block
=> returns -ENOSPC because smm->begin == smm->ll.nr_blocks--- drivers/md/persistent-data/dm-space-map-common.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/md/persistent-data/dm-space-map-common.c +5 -1
@@ -244,6 +244,10 @@ int sm_ll_extend(struct ll_disk *ll, dm_return -EINVAL ; } +/* +* We need to set this before the dm_tm_new_block() call below. +*/ + ll->nr_blocks = nr_blocks;for (i = old_blocks; i < blocks; i++) {struct dm_block *b;struct disk_index_entry idx;
@@ -251,6 +255,7 @@ int sm_ll_extend(struct ll_disk *ll, dm_ r =dm_tm_new_block (ll->tm, &dm_sm_bitmap_validator, &b);if (r <0 )return r; + idx.blocknr =cpu_to_le64 (dm_block_location (b)); r =dm_tm_unlock (ll->tm, b);
@@ -265,7 +270,6 @@ int sm_ll_extend(struct ll_disk *ll, dm_return r; } - ll->nr_blocks = nr_blocks;return 0 ; }
PATCH 28/200 ASoC: adau1701: Fix ADAU1701_SEROCTL_WORD_LEN_16 constant
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Lars-Peter Clausen <[email protected]>
commit e20970ada3f699c113fe64b04492af083d11a7d8 upstream.
The driver defines ADAU1701_SEROCTL_WORD_LEN_16 as 0x10 while it should be b10, so 0x2. This patch fixes it.
--- sound/soc/codecs/adau1701.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/adau1701.c +1 -1
@@ -64,7 +64,7 @@#define ADAU1701_SEROCTL_WORD_LEN_24 0x0000#define ADAU1701_SEROCTL_WORD_LEN_20 0x0001 -#define ADAU1701_SEROCTL_WORD_LEN_16 0x0010 +#define ADAU1701_SEROCTL_WORD_LEN_16 0x0002#define ADAU1701_SEROCTL_WORD_LEN_MASK 0x0003#define ADAU1701_AUXNPOW_VBPD 0x40
PATCH 29/200 radeon/pm: Guard access to rdev->pm.power_state array
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Michel Dänzer <[email protected]>
commit 370169516e736edad3b3c5aa49858058f8b55195 upstream.
It's never allocated on systems without an ATOMBIOS or COMBIOS ROM.
Should fix an oops I encountered while resetting the GPU after a lockup on my PowerBook with an RV350.
--- drivers/gpu/drm/radeon/radeon_pm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/radeon_pm.c +4 -2
@@ -573,8 +573,10 @@ void radeon_pm_resume(struct radeon_devi rdev->pm.current_clock_mode_index =0 ; rdev->pm.current_sclk = rdev->pm.default_sclk; rdev->pm.current_mclk = rdev->pm.default_mclk; - rdev->pm.current_vddc = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0 ].voltage.voltage; - rdev->pm.current_vddci = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0 ].voltage.vddci; +if (rdev->pm.power_state) { + rdev->pm.current_vddc = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0 ].voltage.voltage; + rdev->pm.current_vddci = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0 ].voltage.vddci; + }if (rdev->pm.pm_method ==PM_METHOD_DYNPM && rdev->pm.dynpm_state ==DYNPM_STATE_SUSPENDED ) { rdev->pm.dynpm_state =DYNPM_STATE_ACTIVE ;
PATCH 30/200 staging: r8712u: Set device type to wlan
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Larry Finger <[email protected]>
commit 3a21f00a5002b14e4aab52aef59d33ed28468a13 upstream.
The latest version of NetworkManager does not recognize the device as wireless without this change.
--- drivers/staging/rtl8712/usb_intf.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/staging/rtl8712/usb_intf.c +5 -0
@@ -363,6 +363,10 @@ static u8 key_2char2num(u8 hch, u8 lch)return (hex_to_bin (hch) <<4 ) |hex_to_bin (lch); } +static const struct device_type wlan_type = { + .name ="wlan" , +}; +/* * drv_init() - a device potentially for us *
@@ -398,6 +402,7 @@ static int r871xu_drv_init(struct usb_in padapter->pusb_intf = pusb_intf;usb_set_intfdata (pusb_intf, pnetdev);SET_NETDEV_DEV (pnetdev, &pusb_intf->dev); + pnetdev->dev.type = &wlan_type;/* step 2. */ padapter->dvobj_init = &r8712_usb_dvobj_init; padapter->dvobj_deinit = &r8712_usb_dvobj_deinit;
PATCH 31/200 ALSA: Enable CONFIG_ZONE_DMA for smaller PCI DMA masks
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 80ab8eae70e51d578ebbeb228e0f7a562471b8b7 upstream.
The PCI devices with DMA masks smaller than 32bit should enable CONFIG_ZONE_DMA. Since the recent change of page allocator, page allocations via dma_alloc_coherent() with the limited DMA mask bits may fail more frequently, ended up with no available buffers, when CONFIG_ZONE_DMA isn't enabled. With CONFIG_ZONE_DMA, the system has much more chance to obtain such pages.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=68221
--- sound/pci/Kconfig | 12 ++++++++++++ 1 file changed, 12 insertions(+)
sound/pci/Kconfig +12 -0
@@ -30,6 +30,7 @@ config SND_ALS300 select SND_PCM select SND_AC97_CODEC select SND_OPL3_LIB + select ZONE_DMA help Say 'Y' or 'M' to include support for Avance Logic ALS300/ALS300+
@@ -54,6 +55,7 @@ config SND_ALI5451 tristate "ALi M5451 PCI Audio Controller" select SND_MPU401_UART select SND_AC97_CODEC + select ZONE_DMA help Say Y here to include support for the integrated AC97 sound device on motherboards using the ALi M5451 Audio Controller
@@ -158,6 +160,7 @@ config SND_AZT3328 select SND_PCM select SND_RAWMIDI select SND_AC97_CODEC + select ZONE_DMA help Say Y here to include support for Aztech AZF3328 (PCI168) soundcards.
@@ -463,6 +466,7 @@ config SND_EMU10K1 select SND_HWDEP select SND_RAWMIDI select SND_AC97_CODEC + select ZONE_DMA help Say Y to include support for Sound Blaster PCI 512, Live!, Audigy and E-mu APS (partially supported) soundcards.
@@ -478,6 +482,7 @@ config SND_EMU10K1X tristate "Emu10k1X (Dell OEM Version)" select SND_AC97_CODEC select SND_RAWMIDI + select ZONE_DMA help Say Y here to include support for the Dell OEM version of the Sound Blaster Live!.
@@ -511,6 +516,7 @@ config SND_ES1938 select SND_OPL3_LIB select SND_MPU401_UART select SND_AC97_CODEC + select ZONE_DMA help Say Y here to include support for soundcards based on ESS Solo-1 (ES1938, ES1946, ES1969) chips.
@@ -522,6 +528,7 @@ config SND_ES1968 tristate "ESS ES1968/1978 (Maestro-1/2/2E)" select SND_MPU401_UART select SND_AC97_CODEC + select ZONE_DMA help Say Y here to include support for soundcards based on ESS Maestro 1/2/2E chips.
@@ -602,6 +609,7 @@ config SND_ICE1712 select SND_MPU401_UART select SND_AC97_CODEC select BITREVERSE + select ZONE_DMA help Say Y here to include support for soundcards based on the ICE1712 (Envy24) chip.
@@ -688,6 +696,7 @@ config SND_LX6464ES config SND_MAESTRO3 tristate "ESS Allegro/Maestro3" select SND_AC97_CODEC + select ZONE_DMA help Say Y here to include support for soundcards based on ESS Maestro 3 (Allegro) chips.
@@ -782,6 +791,7 @@ config SND_SIS7019 tristate "SiS 7019 Audio Accelerator" depends on X86 && !X86_64 select SND_AC97_CODEC + select ZONE_DMA help Say Y here to include support for the SiS 7019 Audio Accelerator.
@@ -793,6 +803,7 @@ config SND_SONICVIBES select SND_OPL3_LIB select SND_MPU401_UART select SND_AC97_CODEC + select ZONE_DMA help Say Y here to include support for soundcards based on the S3 SonicVibes chip.
@@ -804,6 +815,7 @@ config SND_TRIDENT tristate "Trident 4D-Wave DX/NX; SiS 7018" select SND_MPU401_UART select SND_AC97_CODEC + select ZONE_DMA help Say Y here to include support for soundcards based on Trident 4D-Wave DX/NX or SiS 7018 chips.
PATCH 32/200 staging:iio:ad799x fix error_free_irq which was freeing an irq that may not have been requested
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Hartmut Knaack <[email protected]>
commit 38408d056188be29a6c4e17f3703c796551bb330 upstream.
Only free an IRQ in error_free_irq, if it has been requested previously.
--- drivers/staging/iio/adc/ad799x_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/iio/adc/ad799x_core.c +2 -1
@@ -873,7 +873,8 @@ static int __devinit ad799x_probe(structreturn 0 ; error_free_irq: -free_irq (client->irq, indio_dev); +if (client->irq >0 ) +free_irq (client->irq, indio_dev); error_cleanup_ring:ad799x_ring_cleanup (indio_dev); error_disable_reg:
PATCH 33/200 mmc: atmel-mci: fix timeout errors in SDIO mode when using DMA
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Ludovic Desroches <[email protected]>
commit 66b512eda74d59b17eac04c4da1b38d82059e6c9 upstream.
With some SDIO devices, timeout errors can happen when reading data. To solve this issue, the DMA transfer has to be activated before sending the command to the device. This order is incorrect in PDC mode. So we have to take care if we are using DMA or PDC to know when to send the MMC command.
--- drivers/mmc/host/atmel-mci.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/mmc/host/atmel-mci.c +12 -1
@@ -1014,11 +1014,22 @@ static void atmci_start_request(struct a iflags |=ATMCI_CMDRDY ; cmd = mrq->cmd; cmdflags =atmci_prepare_command (slot->mmc, cmd); -atmci_send_command (host, cmd, cmdflags); + +/* +* DMA transfer should be started before sending the command to avoid +* unexpected errors especially for read operations in SDIO mode. +* Unfortunately, in PDC mode, command has to be sent before starting +* the transfer. +*/ +if (host->submit_data != &atmci_submit_data_dma) +atmci_send_command (host, cmd, cmdflags);if (data) host->submit_data (host, data); +if (host->submit_data == &atmci_submit_data_dma) +atmci_send_command (host, cmd, cmdflags); +if (mrq->stop) { host->stop_cmdr =atmci_prepare_command (slot->mmc, mrq->stop); host->stop_cmdr |=ATMCI_CMDR_STOP_XFER ;
PATCH 34/200 ftrace: Use schedule_on_each_cpu() as a heavy synchronize_sched()
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Steven Rostedt <[email protected]>
commit 7614c3dc74733dff4b0e774f7a894b9ea6ec508c upstream.
The function tracer uses preempt_disable/enable_notrace() for synchronization between reading registered ftrace_ops and unregistering them.
Most of the ftrace_ops are global permanent structures that do not require this synchronization. That is, ops may be added and removed from the hlist but are never freed, and wont hurt if a synchronization is missed.
But this is not true for dynamically created ftrace_ops or control_ops, which are used by the perf function tracing.
The problem here is that the function tracer can be used to trace kernel/user context switches as well as going to and from idle. Basically, it can be used to trace blind spots of the RCU subsystem. This means that even though preempt_disable() is done, a synchronize_sched() will ignore CPUs that haven't made it out of user space or idle. These can include functions that are being traced just before entering or exiting the kernel sections.
To implement the RCU synchronization, instead of using synchronize_sched() the use of schedule_on_each_cpu() is performed. This means that when a dynamically allocated ftrace_ops, or a control ops is being unregistered, all CPUs must be touched and execute a ftrace_sync() stub function via the work queues. This will rip CPUs out from idle or in dynamic tick mode. This only happens when a user disables perf function tracing or other dynamically allocated function tracers, but it allows us to continue to debug RCU and context tracking with function tracing.
--- kernel/trace/ftrace.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)
kernel/trace/ftrace.c +16 -1
@@ -283,6 +283,17 @@ static int __register_ftrace_function(streturn 0 ; } +static void ftrace_sync (struct work_struct *work) +{ +/* +* This function is just a stub to implement a hard force +* of synchronize_sched(). This requires synchronizing +* tasks even in userspace and idle. +* +* Yes, function tracing is rude. +*/ +} +static int __unregister_ftrace_function (struct ftrace_ops *ops) {int ret;
@@ -311,9 +322,13 @@ static int __unregister_ftrace_function(/* * Dynamic ops may be freed, we must make sure that all * callers are done before leaving this function. +* +* Again, normal synchronize_sched() is not good enough. +* We need to do a hard force of sched synchronization. */ if (ops->flags &FTRACE_OPS_FL_DYNAMIC ) -synchronize_sched (); +schedule_on_each_cpu (ftrace_sync); +return 0 ; }
PATCH 35/200 ftrace: Fix synchronization location disabling and freeing ftrace_ops
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: "Steven Rostedt (Red Hat)" <[email protected]>
commit a4c35ed241129dd142be4cadb1e5a474a56d5464 upstream.
The synchronization needed after ftrace_ops are unregistered must happen after the callback is disabled from becing called by functions.
The current location happens after the function is being removed from the internal lists, but not after the function callbacks were disabled, leaving the functions susceptible of being called after their callbacks are freed.
This affects perf and any externel users of function tracing (LTTng and SystemTap).
--- kernel/trace/ftrace.c | 58 ++++++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 26 deletions(-)
kernel/trace/ftrace.c +18 -11
@@ -319,17 +319,6 @@ static int __unregister_ftrace_function(if (ftrace_enabled)update_ftrace_function (); -/* -* Dynamic ops may be freed, we must make sure that all -* callers are done before leaving this function. -* -* Again, normal synchronize_sched() is not good enough. -* We need to do a hard force of sched synchronization. -*/ -if (ops->flags &FTRACE_OPS_FL_DYNAMIC ) -schedule_on_each_cpu (ftrace_sync); - -return 0 ; }
@@ -1790,6 +1779,24 @@ static int ftrace_shutdown(struct ftracereturn 0 ;ftrace_run_update_code (command); + +/* +* Dynamic ops may be freed, we must make sure that all +* callers are done before leaving this function. +* The same goes for freeing the per_cpu data of the control +* ops. +* +* Again, normal synchronize_sched() is not good enough. +* We need to do a hard force of sched synchronization. +* This is because we use preempt_disable() to do RCU, but +* the function tracers can be called where RCU is not watching +* (like before user_exit()). We can not rely on the RCU +* infrastructure to do the synchronization, thus we must do it +* ourselves. +*/ +if (ops->flags & (FTRACE_OPS_FL_DYNAMIC )) +schedule_on_each_cpu (ftrace_sync); +return 0 ; }
PATCH 36/200 rtlwifi: rtl8192cu: Add new device ID
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Larry Finger <[email protected]>
commit f87f960b2fb802f26ee3b00c19320e57a9c583ff upstream.
--- drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/rtlwifi/rtl8192cu/sw.c +1 -0
@@ -316,6 +316,7 @@ static struct usb_device_id rtl8192c_usb {RTL_USB_DEVICE(0x0bda, 0x5088, rtl92cu_hal_cfg)}, /*Thinkware-CC&C*/ {RTL_USB_DEVICE(0x0df6, 0x0052, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/ {RTL_USB_DEVICE(0x0df6, 0x005c, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/ + {RTL_USB_DEVICE(0x0df6, 0x0077, rtl92cu_hal_cfg)}, /*Sitecom-WLA2100V2*/ {RTL_USB_DEVICE(0x0eb0, 0x9071, rtl92cu_hal_cfg)}, /*NO Brand - Etop*/ {RTL_USB_DEVICE(0x4856, 0x0091, rtl92cu_hal_cfg)}, /*NetweeN - Feixun*//* HP - Lite-On ,8188CUS Slim Combo */
PATCH 37/200 nfs4.1: properly handle ENOTSUP in SECINFO_NO_NAME
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Weston Andros Adamson <[email protected]>
commit 78b19bae0813bd6f921ca58490196abd101297bd upstream.
Don't check for -NFS4ERR_NOTSUPP, it's already been mapped to -ENOTSUPP by nfs4_stat_to_errno.
This allows the client to mount v4.1 servers that don't support SECINFO_NO_NAME by falling back to the "guess and check" method of nfs4_find_root_sec.
--- fs/nfs/nfs4proc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/nfs/nfs4proc.c +2 -2
@@ -6197,7 +6197,7 @@ nfs41_proc_secinfo_no_name(struct nfs_seswitch (err) {case 0 :case -NFS4ERR_WRONGSEC : -case -NFS4ERR_NOTSUPP : +case -ENOTSUPP : goto out;default : err =nfs4_handle_exception (server, err, &exception);
@@ -6229,7 +6229,7 @@ nfs41_find_root_sec(struct nfs_server *s* Fall back on "guess and check" method if * the server doesn't support SECINFO_NO_NAME */ -if (err == -NFS4ERR_WRONGSEC || err == -NFS4ERR_NOTSUPP ) { +if (err == -NFS4ERR_WRONGSEC || err == -ENOTSUPP ) { err =nfs4_find_root_sec (server, fhandle, info); goto out_freepage; }
PATCH 38/200 usb: ehci: add freescale imx28 special write register method
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Peter Chen <[email protected]>
commit feffe09f510c475df082546815f9e4a573f6a233 upstream.
According to Freescale imx28 Errata, "ENGR119653 USB: ARM to USB register error issue", All USB register write operations must use the ARM SWP instruction. So, we implement a special ehci_write for imx28.
Discussion for it at below:
http://marc.info/?l=linux-usb&m=137996395529294&w=2
Without this patcheset, imx28 works unstable at high AHB bus loading. If the bus loading is not high, the imx28 usb can work well at the most of time. There is a IC errata for this problem, usually, we consider IC errata is a problem not a new feature, and this workaround is needed for that, so we need to add them to stable tree 3.11+.
--- drivers/usb/host/ehci.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
drivers/usb/host/ehci.h +17 -1
@@ -147,6 +147,7 @@ struct ehci_hcd { /* one per controlle unsigned use_dummy_qh:1; /* AMD Frame List table quirk*/ unsigned has_synopsys_hc_bug:1; /* Synopsys HC */ unsigned frame_index_bug:1; /* MosChip (AKA NetMos) */ + unsigned imx28_write_fix:1; /* For Freescale i.MX28 *//* required for usb32 quirk */ #define OHCI_CTRL_HCFS (3 << 6)
@@ -654,6 +655,18 @@ static inline unsigned int ehci_readl(co#endif } +#ifdef CONFIG_SOC_IMX28 +static inline void imx28_ehci_writel (const unsigned int val, +volatile __u32 __iomem *addr) +{ + __asm__ ("swp %0, %0, [%1]" : :"r" (val),"r" (addr)); +} +#else +static inline void imx28_ehci_writel (const unsigned int val, +volatile __u32 __iomem *addr) +{ +} +#endif static inline void ehci_writel (const struct ehci_hcd *ehci,const unsigned int val,__u32 __iomem *regs) {
@@ -662,7 +675,10 @@ static inline void ehci_writel(const str writel_be(val, regs) :writel (val, regs);#else -writel (val, regs); +if (ehci->imx28_write_fix) +imx28_ehci_writel (val, regs); +else +writel (val, regs);#endif }
PATCH 39/200 dm sysfs: fix a module unload race
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <[email protected]>
commit 2995fa78e423d7193f3b57835f6c1c75006a0315 upstream.
This reverts commit be35f48610 ("dm: wait until embedded kobject is released before destroying a device") and provides an improved fix.
The kobject release code that calls the completion must be placed in a non-module file, otherwise there is a module unload race (if the process calling dm_kobject_release is preempted and the DM module unloaded after the completion is triggered, but before dm_kobject_release returns).
To fix this race, this patch moves the completion code to dm-builtin.c which is always compiled directly into the kernel if BLK_DEV_DM is selected.
The patch introduces a new dm_kobject_holder structure, its purpose is to keep the completion and kobject in one place, so that it can be accessed from non-module code without the need to export the layout of struct mapped_device to that code.
[bwh: Backported to 3.2:
- Adjust context
- Remove paranoid check of container_of() result in dm_get_from_kobject(), which would now be incorrect
- Include <linux/export.h> in dm-builtin.c, included indirectly upstream]
---
drivers/md/Kconfig +4 -0
@@ -185,8 +185,12 @@ config MD_FAULTY In unsure, say N. +config BLK_DEV_DM_BUILTIN + boolean + config BLK_DEV_DM tristate "Device mapper support" + select BLK_DEV_DM_BUILTIN ---help--- Device-mapper is a low level volume manager. It works by allowing people to specify mappings for ranges of logical sectors. Various
drivers/md/Makefile +1 -0
@@ -28,6 +28,7 @@ obj-$(CONFIG_MD_MULTIPATH) += multipath. obj-$(CONFIG_MD_FAULTY) += faulty.o obj-$(CONFIG_BLK_DEV_MD) += md-mod.o obj-$(CONFIG_BLK_DEV_DM) += dm-mod.o +obj-$(CONFIG_BLK_DEV_DM_BUILTIN) += dm-builtin.o obj-$(CONFIG_DM_BUFIO) += dm-bufio.o obj-$(CONFIG_DM_CRYPT) += dm-crypt.o obj-$(CONFIG_DM_DELAY) += dm-delay.o
drivers/md/dm-builtin.c new file +49 -0
49 lines not on this page · raw message
drivers/md/dm-sysfs.c +0 -5
@@ -79,11 +79,6 @@ static const struct sysfs_ops dm_sysfs_o .show = dm_attr_show, }; -static void dm_kobject_release (struct kobject *kobj) -{ -complete (dm_get_completion_from_kobject (kobj)); -} -/* * dm kobject is embedded in mapped_device structure * no need to define release function here
drivers/md/dm.c +5 -17
@@ -192,11 +192,8 @@ struct mapped_device {/* forced geometry settings */ struct hd_geometry geometry; -/* sysfs handle */ -struct kobject kobj; - -/* wait until the kobject is released */ -struct completion kobj_completion; +/* kobject and completion */ +struct dm_kobject_holder kobj_holder;/* zero-length flush that will be cloned and submitted to targets */ struct bio flush_bio;
@@ -1894,7 +1891,7 @@ static struct mapped_device *alloc_dev(iinit_waitqueue_head (&md->wait);INIT_WORK (&md->work, dm_wq_work);init_waitqueue_head (&md->eventq); -init_completion (&md->kobj_completion); +init_completion (&md->kobj_holder.completion); md->disk->major = _major; md->disk->first_minor = minor;
@@ -2686,7 +2683,7 @@ struct gendisk *dm_disk(struct mapped_destruct kobject *dm_kobject (struct mapped_device *md) { -return &md->kobj; +return &md->kobj_holder.kobj; }/*
@@ -2697,9 +2694,7 @@ struct mapped_device *dm_get_from_kobjec {struct mapped_device *md; - md = container_of(kobj, struct mapped_device, kobj); -if (&md->kobj != kobj) -return NULL ; + md = container_of(kobj, struct mapped_device, kobj_holder.kobj);if (test_bit (DMF_FREEING , &md->flags) ||dm_deleting_md (md))
@@ -2709,13 +2704,6 @@ struct mapped_device *dm_get_from_kobjecreturn md; } -struct completion *dm_get_completion_from_kobject (struct kobject *kobj) -{ - struct mapped_device *md = container_of(kobj, struct mapped_device, kobj); - -return &md->kobj_completion; -} -int dm_suspended_md (struct mapped_device *md) {return test_bit (DMF_SUSPENDED , &md->flags);
drivers/md/dm.h +16 -1
@@ -16,6 +16,7 @@#include <linux/blkdev.h> #include <linux/hdreg.h> #include <linux/completion.h> +#include <linux/kobject.h> /* * Suspend feature flags
@@ -120,11 +121,25 @@ void dm_interface_exit(void);/* * sysfs interface */ +struct dm_kobject_holder { +struct kobject kobj; +struct completion completion; +}; + +static inline struct completion *dm_get_completion_from_kobject (struct kobject *kobj) +{ + return &container_of(kobj, struct dm_kobject_holder, kobj)->completion; +} +int dm_sysfs_init (struct mapped_device *md);void dm_sysfs_exit (struct mapped_device *md);struct kobject *dm_kobject (struct mapped_device *md);struct mapped_device *dm_get_from_kobject (struct kobject *kobj); -struct completion *dm_get_completion_from_kobject (struct kobject *kobj); + +/* +* The kobject helper +*/ +void dm_kobject_release (struct kobject *kobj);/* * Targets for linear and striped mappings
PATCH 40/200 KVM: x86: limit PIT timer frequency
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Marcelo Tosatti <[email protected]>
commit 9ed96e87c5748de4c2807ef17e81287c7304186c upstream.
Limit PIT timer frequency similarly to the limit applied by LAPIC timer.
[bwh: Backported to 3.2:
- Adjust context
- s/ps->period/pt->period/]
--- arch/x86/kvm/i8254.c | 18 ++++++++++++++++++ arch/x86/kvm/lapic.c | 3 --- arch/x86/kvm/x86.c | 3 +++ arch/x86/kvm/x86.h | 2 ++ 4 files changed, 23 insertions(+), 3 deletions(-)
arch/x86/kvm/i8254.c +18 -0
@@ -38,6 +38,7 @@#include "irq.h" #include "i8254.h" +#include "x86.h" #ifndef CONFIG_X86_64 #define mod_64 (x, y) ((x) - (y) * div64_u64(x, y))
@@ -364,6 +365,23 @@ static void create_pit_timer(struct kvmatomic_set (&pt->pending,0 ); ps->irq_ack =1 ; +/* +* Do not allow the guest to program periodic timers with small +* interval, since the hrtimers are not throttled by the host +* scheduler. +*/ +if (ps->is_periodic) { +s64 min_period = min_timer_period_us *1000LL ; + +if (pt->period < min_period) { +pr_info_ratelimited ( +"kvm: requested %lld ns " +"i8254 timer period limited to %lld ns\n" , + pt->period, min_period); + pt->period = min_period; + } + } +hrtimer_start (&pt->timer,ktime_add_ns (ktime_get (), interval),HRTIMER_MODE_ABS ); }
arch/x86/kvm/lapic.c +0 -3
@@ -68,9 +68,6 @@#define VEC_POS (v) ((v) & (32 - 1))#define REG_POS (v) (((v) >> 5) << 4) -static unsigned int min_timer_period_us =500 ; -module_param (min_timer_period_us, uint,S_IRUGO |S_IWUSR ); -static inline u32 apic_get_reg (struct kvm_lapic *apic,int reg_off) {return *((u32 *) (apic->regs + reg_off));
arch/x86/kvm/x86.c +3 -0
@@ -92,6 +92,9 @@ EXPORT_SYMBOL_GPL(kvm_x86_ops);int ignore_msrs =0 ;module_param_named (ignore_msrs, ignore_msrs, bool,S_IRUGO |S_IWUSR ); +unsigned int min_timer_period_us =500 ; +module_param (min_timer_period_us, uint,S_IRUGO |S_IWUSR ); +bool kvm_has_tsc_control;EXPORT_SYMBOL_GPL (kvm_has_tsc_control);u32 kvm_max_guest_tsc_khz;
arch/x86/kvm/x86.h +2 -0
@@ -125,4 +125,6 @@ int kvm_write_guest_virt_system(struct x gva_t addr, void *val, unsigned int bytes, struct x86_exception *exception); +extern unsigned int min_timer_period_us; +#endif
PATCH 41/200 md/raid5: fix long-standing problem with bitmap handling on write failure.
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: NeilBrown <[email protected]>
commit 9f97e4b128d2ea90a5f5063ea0ee3b0911f4c669 upstream.
Before a write starts we set a bit in the write-intent bitmap. When the write completes we clear that bit if the write was successful to all devices. However if the write wasn't fully successful we should not clear the bit. If the faulty drive is subsequently re-added, the fact that the bit is still set ensure that we will re-write the data that is missing.
This logic is mediated by the STRIPE_DEGRADED flag - we only clear the bitmap bit when this flag is not set.
Currently we correctly set the flag if a write starts when some devices are failed or missing. But we do *not* set the flag if some device failed during the write attempt.
This is wrong and can result in clearing the bit inappropriately.
So: set the flag when a write fails.
This bug has been present since bitmaps were introduces, so the fix is suitable for any -stable kernel.
--- drivers/md/raid5.c | 1 + 1 file changed, 1 insertion(+)
drivers/md/raid5.c +1 -0
@@ -1693,6 +1693,7 @@ static void raid5_end_write_request(stru }if (!uptodate) { +set_bit (STRIPE_DEGRADED , &sh->state);set_bit (WriteErrorSeen, &conf->disks[i].rdev->flags);set_bit (R5_WriteError, &sh->dev[i].flags); } else if (is_badblock(conf->disks[i].rdev, sh->sector, STRIPE_SECTORS,
PATCH 42/200 x86: Add check for number of available vectors before CPU down
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Prarit Bhargava <[email protected]>
commit da6139e49c7cb0f4251265cb5243b8d220adb48d upstream.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=64791
When a cpu is downed on a system, the irqs on the cpu are assigned to other cpus. It is possible, however, that when a cpu is downed there aren't enough free vectors on the remaining cpus to account for the vectors from the cpu that is being downed.
This results in an interesting "overflow" condition where irqs are "assigned" to a CPU but are not handled.
For example, when downing cpus on a 1-64 logical processor system:
<snip>
[ 232.021745] smpboot: CPU 61 is now offline [ 238.480275] smpboot: CPU 62 is now offline [ 245.991080] ------------[ cut here ]------------ [ 245.996270] WARNING: CPU: 0 PID: 0 at net/sched/sch_generic.c:264 dev_watchdog+0x246/0x250() [ 246.005688] NETDEV WATCHDOG: p786p1 (ixgbe): transmit queue 0 timed out [ 246.013070] Modules linked in: lockd sunrpc iTCO_wdt iTCO_vendor_support sb_edac ixgbe microcode e1000e pcspkr joydev edac_core lpc_ich ioatdma ptp mdio mfd_core i2c_i801 dca pps_core i2c_core wmi acpi_cpufreq isci libsas scsi_transport_sas [ 246.037633] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.12.0+ #14 [ 246.044451] Hardware name: Intel Corporation S4600LH ........../SVRBD-ROW_T, BIOS SE5C600.86B.01.08.0003.022620131521 02/26/2013 [ 246.057371] 0000000000000009 ffff88081fa03d40 ffffffff8164fbf6 ffff88081fa0ee48 [ 246.065728] ffff88081fa03d90 ffff88081fa03d80 ffffffff81054ecc ffff88081fa13040 [ 246.074073] 0000000000000000 ffff88200cce0000 0000000000000040 0000000000000000 [ 246.082430] Call Trace: [ 246.085174] <IRQ> [<ffffffff8164fbf6>] dump_stack+0x46/0x58 [ 246.091633] [<ffffffff81054ecc>] warn_slowpath_common+0x8c/0xc0 [ 246.098352] [<ffffffff81054fb6>] warn_slowpath_fmt+0x46/0x50 [ 246.104786] [<ffffffff815710d6>] dev_watchdog+0x246/0x250 [ 246.110923] [<ffffffff81570e90>] ? dev_deactivate_queue.constprop.31+0x80/0x80 [ 246.119097] [<ffffffff8106092a>] call_timer_fn+0x3a/0x110 [ 246.125224] [<ffffffff8106280f>] ? update_process_times+0x6f/0x80 [ 246.132137] [<ffffffff81570e90>] ? dev_deactivate_queue.constprop.31+0x80/0x80 [ 246.140308] [<ffffffff81061db0>] run_timer_softirq+0x1f0/0x2a0 [ 246.146933] [<ffffffff81059a80>] __do_softirq+0xe0/0x220 [ 246.152976] [<ffffffff8165fedc>] call_softirq+0x1c/0x30 [ 246.158920] [<ffffffff810045f5>] do_softirq+0x55/0x90 [ 246.164670] [<ffffffff81059d35>] irq_exit+0xa5/0xb0 [ 246.170227] [<ffffffff8166062a>] smp_apic_timer_interrupt+0x4a/0x60 [ 246.177324] [<ffffffff8165f40a>] apic_timer_interrupt+0x6a/0x70 [ 246.184041] <EOI> [<ffffffff81505a1b>] ? cpuidle_enter_state+0x5b/0xe0 [ 246.191559] [<ffffffff81505a17>] ? cpuidle_enter_state+0x57/0xe0 [ 246.198374] [<ffffffff81505b5d>] cpuidle_idle_call+0xbd/0x200 [ 246.204900] [<ffffffff8100b7ae>] arch_cpu_idle+0xe/0x30 [ 246.210846] [<ffffffff810a47b0>] cpu_startup_entry+0xd0/0x250 [ 246.217371] [<ffffffff81646b47>] rest_init+0x77/0x80 [ 246.223028] [<ffffffff81d09e8e>] start_kernel+0x3ee/0x3fb [ 246.229165] [<ffffffff81d0989f>] ? repair_env_string+0x5e/0x5e [ 246.235787] [<ffffffff81d095a5>] x86_64_start_reservations+0x2a/0x2c [ 246.242990] [<ffffffff81d0969f>] x86_64_start_kernel+0xf8/0xfc [ 246.249610] ---[ end trace fb74fdef54d79039 ]--- [ 246.254807] ixgbe 0000:c2:00.0 p786p1: initiating reset due to tx timeout [ 246.262489] ixgbe 0000:c2:00.0 p786p1: Reset adapter Last login: Mon Nov 11 08:35:14 from 10.18.17.119 [root@(none) ~]# [ 246.792676] ixgbe 0000:c2:00.0 p786p1: detected SFP+: 5 [ 249.231598] ixgbe 0000:c2:00.0 p786p1: NIC Link is Up 10 Gbps, Flow Control: RX/TX [ 246.792676] ixgbe 0000:c2:00.0 p786p1: detected SFP+: 5 [ 249.231598] ixgbe 0000:c2:00.0 p786p1: NIC Link is Up 10 Gbps, Flow Control: RX/TX
(last lines keep repeating. ixgbe driver is dead until module reload.)
If the downed cpu has more vectors than are free on the remaining cpus on the system, it is possible that some vectors are "orphaned" even though they are assigned to a cpu. In this case, since the ixgbe driver had a watchdog, the watchdog fired and notified that something was wrong.
This patch adds a function, check_vectors(), to compare the number of vectors on the CPU going down and compares it to the number of vectors available on the system. If there aren't enough vectors for the CPU to go down, an error is returned and propogated back to userspace.
v2: Do not need to look at percpu irqs
v3: Need to check affinity to prevent counting of MSIs in IOAPIC Lowest
Priority Mode
v4: Additional changes suggested by Gong Chen.
v5/v6/v7/v8: Updated comment text
---
arch/x86/include/asm/irq.h +1 -0
@@ -25,6 +25,7 @@ extern void irq_ctx_init(int cpu);#ifdef CONFIG_HOTPLUG_CPU #include <linux/cpumask.h> +extern int check_irq_vectors_for_cpu_disable (void );extern void fixup_irqs (void );extern void irq_force_complete_move (int );#endif
arch/x86/kernel/irq.c +70 -0
76 lines not on this page · raw message
arch/x86/kernel/smpboot.c +5 -0
@@ -1278,6 +1278,7 @@ void cpu_disable_common(void)int native_cpu_disable (void ) {int cpu =smp_processor_id (); +int ret;/* * Perhaps use cpufreq to drop frequency, but that could go
@@ -1290,6 +1291,10 @@ int native_cpu_disable(void)if (cpu ==0 )return -EBUSY ; + ret =check_irq_vectors_for_cpu_disable (); +if (ret) +return ret; +clear_local_APIC ();cpu_disable_common ();
PATCH 43/200 libata: disable LPM for some WD SATA-I devices
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <[email protected]>
commit ecd75ad514d73efc1bbcc5f10a13566c3ace5f53 upstream.
For some reason, some early WD drives spin up and down drives erratically when the link is put into slumber mode which can reduce the life expectancy of the device significantly. Unfortunately, we don't have full list of devices and given the nature of the issue it'd be better to err on the side of false positives than the other way around. Let's disable LPM on all WD devices which match one of the known problematic model prefixes and are SATA-I.
As horkage list doesn't support matching SATA capabilities, this is implemented as two horkages - WD_BROKEN_LPM and NOLPM. The former is set for the known prefixes and sets the latter if the matched device is SATA-I.
Note that this isn't optimal as this disables all LPM operations and partial link power state reportedly works fine on these; however, the way LPM is implemented in libata makes it difficult to precisely map libata LPM setting to specific link power state. Well, these devices are already fairly outdated. Let's just disable whole LPM for now.
References: https://bugzilla.kernel.org/show_bug.cgi?id=57211
[bwh: Backported to 3.2:
- Adjust context
- Use literal 76 instead of ATA_ID_SATA_CAPABILITY]
--- drivers/ata/libata-core.c | 27 +++++++++++++++++++++++++++ drivers/ata/libata-scsi.c | 18 +++++++++++++++--- include/linux/libata.h | 2 ++ 3 files changed, 44 insertions(+), 3 deletions(-)
drivers/ata/libata-core.c +27 -0
@@ -2188,6 +2188,16 @@ int ata_dev_configure(struct ata_deviceif (rc)return rc; +/* some WD SATA-1 drives have issues with LPM, turn on NOLPM for them */ +if ((dev->horkage &ATA_HORKAGE_WD_BROKEN_LPM ) && + (id[76 ] &0xe ) ==0x2 ) + dev->horkage |=ATA_HORKAGE_NOLPM ; + +if (dev->horkage &ATA_HORKAGE_NOLPM ) { +ata_dev_warn (dev,"LPM support broken, forcing max_power\n" ); + dev->link->ap->target_lpm_policy =ATA_LPM_MAX_POWER ; + } +/* let ACPI work its magic */ rc =ata_acpi_on_devcfg (dev);if (rc)
@@ -4143,6 +4153,23 @@ static const struct ata_blacklist_entry { "PIONEER DVD-RW DVR-212D", NULL, ATA_HORKAGE_NOSETXFER }, { "PIONEER DVD-RW DVR-216D", NULL, ATA_HORKAGE_NOSETXFER }, +/* +* Some WD SATA-I drives spin up and down erratically when the link +* is put into the slumber mode. We don't have full list of the +* affected devices. Disable LPM if the device matches one of the +* known prefixes and is SATA-1. As a side effect LPM partial is +* lost too. +* +* https://bugzilla.kernel.org/show_bug.cgi?id=57211 +*/ + { "WDC WD800JD-*", NULL, ATA_HORKAGE_WD_BROKEN_LPM }, + { "WDC WD1200JD-*", NULL, ATA_HORKAGE_WD_BROKEN_LPM }, + { "WDC WD1600JD-*", NULL, ATA_HORKAGE_WD_BROKEN_LPM }, + { "WDC WD2000JD-*", NULL, ATA_HORKAGE_WD_BROKEN_LPM }, + { "WDC WD2500JD-*", NULL, ATA_HORKAGE_WD_BROKEN_LPM }, + { "WDC WD3000JD-*", NULL, ATA_HORKAGE_WD_BROKEN_LPM }, + { "WDC WD3200JD-*", NULL, ATA_HORKAGE_WD_BROKEN_LPM }, + /* End Marker */ { } };
drivers/ata/libata-scsi.c +15 -3
@@ -111,12 +111,14 @@ static const char *ata_lpm_policy_names[ [ATA_LPM_MIN_POWER] = "min_power", }; -static ssize_t ata_scsi_lpm_store (struct device *dev, +static ssize_t ata_scsi_lpm_store (struct device *device,struct device_attribute *attr,const char *buf,size_t count) { -struct Scsi_Host *shost =class_to_shost (dev); +struct Scsi_Host *shost =class_to_shost (device);struct ata_port *ap =ata_shost_to_port (shost); +struct ata_link *link; +struct ata_device *dev;enum ata_lpm_policy policy;unsigned long flags;
@@ -132,10 +134,20 @@ static ssize_t ata_scsi_lpm_store(structreturn -EINVAL ;spin_lock_irqsave (ap->lock, flags); + +ata_for_each_link (link, ap,EDGE ) { +ata_for_each_dev (dev, &ap->link,ENABLED ) { +if (dev->horkage &ATA_HORKAGE_NOLPM ) { + count = -EOPNOTSUPP ; + goto out_unlock; + } + } + } + ap->target_lpm_policy = policy;ata_port_schedule_eh (ap); +out_unlock:spin_unlock_irqrestore (ap->lock, flags); -return count; }
include/linux/libata.h +2 -0
@@ -393,6 +393,8 @@ enum {ATA_HORKAGE_BROKEN_FPDMA_AA = (1 <<15 ),/* skip AA */ ATA_HORKAGE_DUMP_ID = (1 <<16 ),/* dump IDENTIFY data */ ATA_HORKAGE_MAX_SEC_LBA48 = (1 <<17 ),/* Set max sects to 65535 */ +ATA_HORKAGE_NOLPM = (1 <<20 ),/* don't use LPM */ +ATA_HORKAGE_WD_BROKEN_LPM = (1 <<21 ),/* some WDs have broken LPM */ /* DMA mask for user DMA control: User visible values; DO NOT renumber */
PATCH 44/200 mmc: sdhci: fix lockdep error in tuning routine
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Aisheng Dong <[email protected]>
commit 2b35bd83467df6f8284b9148d6f768148c3a5e5f upstream.
The sdhci_execute_tuning routine gets lock separately by disable_irq(host->irq);spin_lock(&host->lock);
It will cause the following lockdep error message since the &host->lock could also be got in irq context.
Use spin_lock_irqsave/spin_unlock_restore instead to get rid of this error message.
[ INFO: inconsistent lock state ]
3.13.0-rc1+ #287 Not tainted
---------------------------------
inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
kworker/u2:1/33 [HC0[0]:SC0[0]:HE1:SE1] takes:
(&(&host->lock)->rlock){?.-...}, at: [<8045f7f4>] sdhci_execute_tuning+0x4c/0x710
{IN-HARDIRQ-W} state was registered at:
[<8005f030>] mark_lock+0x140/0x6ac [<80060760>] __lock_acquire+0xb30/0x1cbc [<800620d0>] lock_acquire+0x70/0x84 [<8061d1c8>] _raw_spin_lock+0x30/0x40 [<804605cc>] sdhci_irq+0x24/0xa68 [<8006b1d4>] handle_irq_event_percpu+0x54/0x18c [<8006b350>] handle_irq_event+0x44/0x64 [<8006e50c>] handle_fasteoi_irq+0xa0/0x170 [<8006a8f0>] generic_handle_irq+0x30/0x44 [<8000f238>] handle_IRQ+0x54/0xbc [<8000864c>] gic_handle_irq+0x30/0x64 [<80013024>] __irq_svc+0x44/0x5c [<80329bf4>] dev_vprintk_emit+0x50/0x58 [<80329c24>] dev_printk_emit+0x28/0x30 [<80329fec>] __dev_printk+0x4c/0x90 [<8032a180>] dev_err+0x3c/0x48 [<802dd4f0>] _regulator_get+0x158/0x1cc [<802dd5b4>] regulator_get_optional+0x18/0x1c [<80461df4>] sdhci_add_host+0x42c/0xbd8 [<80464820>] sdhci_esdhc_imx_probe+0x378/0x67c [<8032ee88>] platform_drv_probe+0x20/0x50 [<8032d48c>] driver_probe_device+0x118/0x234 [<8032d690>] __driver_attach+0x9c/0xa0 [<8032b89c>] bus_for_each_dev+0x68/0x9c [<8032cf44>] driver_attach+0x20/0x28 [<8032cbc8>] bus_add_driver+0x148/0x1f4 [<8032dce0>] driver_register+0x80/0x100 [<8032ee54>] __platform_driver_register+0x50/0x64 [<8084b094>] sdhci_esdhc_imx_driver_init+0x18/0x20 [<80008980>] do_one_initcall+0x108/0x16c [<8081cca4>] kernel_init_freeable+0x10c/0x1d0 [<80611b28>] kernel_init+0x10/0x120 [<8000e9c8>] ret_from_fork+0x14/0x2c irq event stamp: 805 hardirqs last enabled at (805): [<8061d43c>] _raw_spin_unlock_irqrestore+0x38/0x4c hardirqs last disabled at (804): [<8061d2c8>] _raw_spin_lock_irqsave+0x24/0x54 softirqs last enabled at (570): [<8002b824>] __do_softirq+0x1c4/0x290 softirqs last disabled at (561): [<8002bcf4>] irq_exit+0xb4/0x10c
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(&(&host->lock)->rlock);
<Interrupt>
lock(&(&host->lock)->rlock);*** DEADLOCK ***
2 locks held by kworker/u2:1/33:
#0: (kmmcd){.+.+..}, at: [<8003db18>] process_one_work+0x128/0x468
#1: ((&(&host->detect)->work)){+.+...}, at: [<8003db18>] process_one_work+0x128/0x468
stack backtrace: CPU: 0 PID: 33 Comm: kworker/u2:1 Not tainted 3.13.0-rc1+ #287 Workqueue: kmmcd mmc_rescan Backtrace: [<80012160>] (dump_backtrace+0x0/0x10c) from [<80012438>] (show_stack+0x18/0x1c) r6:bfad0900 r5:00000000 r4:8088ecc8 r3:bfad0900 [<80012420>] (show_stack+0x0/0x1c) from [<806169ec>] (dump_stack+0x84/0x9c) [<80616968>] (dump_stack+0x0/0x9c) from [<806147b4>] (print_usage_bug+0x260/0x2d0) r5:8076ba88 r4:80977410 [<80614554>] (print_usage_bug+0x0/0x2d0) from [<8005f0d0>] (mark_lock+0x1e0/0x6ac) r9:8005e678 r8:00000000 r7:bfad0900 r6:00001015 r5:bfad0cd0
r4:00000002
[<8005eef0>] (mark_lock+0x0/0x6ac) from [<80060234>] (__lock_acquire+0x604/0x1cbc) [<8005fc30>] (__lock_acquire+0x0/0x1cbc) from [<800620d0>] (lock_acquire+0x70/0x84) [<80062060>] (lock_acquire+0x0/0x84) from [<8061d1c8>] (_raw_spin_lock+0x30/0x40)
r7:00000000 r6:bfb63000 r5:00000000 r4:bfb60568
[<8061d198>] (_raw_spin_lock+0x0/0x40) from [<8045f7f4>] (sdhci_execute_tuning+0x4c/0x710)
r4:bfb60000
[<8045f7a8>] (sdhci_execute_tuning+0x0/0x710) from [<80453454>] (mmc_sd_init_card+0x5f8/0x660) [<80452e5c>] (mmc_sd_init_card+0x0/0x660) from [<80453748>] (mmc_attach_sd+0xb4/0x180)
r9:bf92d400 r8:8065f364 r7:00061a80 r6:bfb60000 r5:8065f358
r4:bfb60000
[<80453694>] (mmc_attach_sd+0x0/0x180) from [<8044d9f8>] (mmc_rescan+0x284/0x2f0)
r5:8065f358 r4:bfb602f8
[<8044d774>] (mmc_rescan+0x0/0x2f0) from [<8003db94>] (process_one_work+0x1a4/0x468)
r8:00000000 r7:bfb55eb0 r6:bf80dc00 r5:bfb602f8 r4:bfb35980
r3:8044d774
[<8003d9f0>] (process_one_work+0x0/0x468) from [<8003e850>] (worker_thread+0x118/0x3e0) [<8003e738>] (worker_thread+0x0/0x3e0) from [<80044de0>] (kthread+0xd4/0xf0) [<80044d0c>] (kthread+0x0/0xf0) from [<8000e9c8>] (ret_from_fork+0x14/0x2c)
r7:00000000 r6:00000000 r5:80044d0c r4:bfb37b40
[bwh: Backported to 3.2:
- Adjust context
- There's no platform_execute_tuning hook]
--- drivers/mmc/host/sdhci.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-)
drivers/mmc/host/sdhci.c +6 -11
@@ -1670,12 +1670,12 @@ static int sdhci_execute_tuning(struct mint tuning_loop_counter =MAX_TUNING_LOOP ;unsigned long timeout;int err =0 ; +unsigned long flags; host =mmc_priv (mmc);sdhci_runtime_pm_get (host); -disable_irq (host->irq); -spin_lock (&host->lock); +spin_lock_irqsave (&host->lock, flags); ctrl =sdhci_readw (host,SDHCI_HOST_CONTROL2 );
@@ -1689,8 +1689,7 @@ static int sdhci_execute_tuning(struct m (host->flags & SDHCI_SDR50_NEEDS_TUNING))) ctrl |= SDHCI_CTRL_EXEC_TUNING; else { -spin_unlock (&host->lock); -enable_irq (host->irq); +spin_unlock_irqrestore (&host->lock, flags);sdhci_runtime_pm_put (host);return 0 ; }
@@ -1752,15 +1751,12 @@ static int sdhci_execute_tuning(struct m host->cmd =NULL ; host->mrq =NULL ; -spin_unlock (&host->lock); -enable_irq (host->irq); - +spin_unlock_irqrestore (&host->lock, flags);/* Wait for Buffer Read Ready interrupt */ wait_event_interruptible_timeout (host->buf_ready_int, (host->tuning_done ==1 ),msecs_to_jiffies (50 )); -disable_irq (host->irq); -spin_lock (&host->lock); +spin_lock_irqsave (&host->lock, flags);if (!host->tuning_done) { pr_info(DRIVER_NAME ": Timeout waiting for "
@@ -1833,8 +1829,7 @@ out: err =0 ;sdhci_clear_set_irqs (host,SDHCI_INT_DATA_AVAIL , ier); -spin_unlock (&host->lock); -enable_irq (host->irq); +spin_unlock_irqrestore (&host->lock, flags);sdhci_runtime_pm_put (host);return err;
PATCH 45/200 turbostat: Use GCC's CPUID functions to support PIC
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Josh Triplett <[email protected]>
commit 2b92865e648ce04a39fda4f903784a5d01ecb0dc upstream.
turbostat uses inline assembly to call cpuid. On 32-bit x86, on systems that have certain security features enabled by default that make -fPIC the default, this causes a build error:
turbostat.c: In function ‘check_cpuid’:
turbostat.c:1906:2: error: PIC register clobbered by ‘ebx’ in ‘asm’
asm("cpuid" : "=a" (fms), "=c" (ecx), "=d" (edx) : "a" (1) : "ebx"); ^
GCC provides a header cpuid.h, containing a __get_cpuid function that works with both PIC and non-PIC. (On PIC, it saves and restores ebx around the cpuid instruction.) Use that instead.
--- tools/power/x86/turbostat/turbostat.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
tools/power/x86/turbostat/turbostat.c +6 -5
@@ -32,6 +32,7 @@#include <dirent.h> #include <string.h> #include <ctype.h> +#include <cpuid.h> #define MSR_TSC 0x10#define MSR_NEHALEM_PLATFORM_INFO 0xCE
@@ -847,7 +848,7 @@ void check_cpuid() eax = ebx = ecx = edx =0 ; - asm("cpuid" :"=a" (max_level),"=b" (ebx),"=c" (ecx),"=d" (edx) :"a" (0 )); +__get_cpuid (0 , &max_level, &ebx, &ecx, &edx);if (ebx ==0x756e6547 && edx ==0x49656e69 && ecx ==0x6c65746e ) genuine_intel =1 ;
@@ -856,7 +857,7 @@ void check_cpuid()fprintf (stderr,"%.4s%.4s%.4s " , (char *)&ebx, (char *)&edx, (char *)&ecx); - asm("cpuid" :"=a" (fms),"=c" (ecx),"=d" (edx) :"a" (1 ) :"ebx" ); +__get_cpuid (1 , &fms, &ebx, &ecx, &edx); family = (fms >>8 ) &0xf ; model = (fms >>4 ) &0xf ; stepping = fms &0xf ;
@@ -878,7 +879,7 @@ void check_cpuid()* This check is valid for both Intel and AMD. */ ebx = ecx = edx =0 ; - asm("cpuid" :"=a" (max_level),"=b" (ebx),"=c" (ecx),"=d" (edx) :"a" (0x80000000 )); +__get_cpuid (0x80000000 , &max_level, &ebx, &ecx, &edx);if (max_level <0x80000007 ) {fprintf (stderr,"CPUID: no invariant TSC (max_level 0x%x)\n" , max_level);
@@ -889,7 +890,7 @@ void check_cpuid()* Non-Stop TSC is advertised by CPUID.EAX=0x80000007: EDX.bit8 * this check is valid for both Intel and AMD */ - asm("cpuid" :"=a" (eax),"=b" (ebx),"=c" (ecx),"=d" (edx) :"a" (0x80000007 )); +__get_cpuid (0x80000007 , &eax, &ebx, &ecx, &edx); has_invariant_tsc = edx & (1 <<8 );if (!has_invariant_tsc) {
@@ -902,7 +903,7 @@ void check_cpuid()* this check is valid for both Intel and AMD */ - asm("cpuid" :"=a" (eax),"=b" (ebx),"=c" (ecx),"=d" (edx) :"a" (0x6 )); +__get_cpuid (0x6 , &eax, &ebx, &ecx, &edx); has_aperf = ecx & (1 <<0 );if (!has_aperf) {fprintf (stderr,"No APERF MSR\n" );
PATCH 46/200 drm/radeon: disable ss on DP for DCE3.x
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit d8e24525094200601236fa64a54cf73e3d682f2e upstream.
Seems to cause problems with certain DP monitors.
Bug:
https://bugs.freedesktop.org/show_bug.cgi?id=40699
--- drivers/gpu/drm/radeon/atombios_crtc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/atombios_crtc.c +4 -1
@@ -956,10 +956,13 @@ static void atombios_crtc_set_pll(struct ss_enabled =radeon_atombios_get_ppll_ss_info (rdev, &ss,ATOM_DP_SS_ID1 ); - }else + }else { ss_enabled =radeon_atombios_get_ppll_ss_info (rdev, &ss,ATOM_DP_SS_ID1 ); + } +/* disable spread spectrum on DCE3 DP */ + ss_enabled = false; }break ;case ATOM_ENCODER_MODE_LVDS :
PATCH 47/200 drm/radeon: set the full cache bit for fences on r7xx+
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit d45b964a22cad962d3ede1eba8d24f5cee7b2a92 upstream.
Needed to properly flush the read caches for fences.
[bwh: Backported to 3.2:
- Adjust context
- s/\bring\b/rdev/]
---
drivers/gpu/drm/radeon/r600.c +8 -6
@@ -2315,14 +2315,18 @@ int r600_ring_test(struct radeon_devicevoid r600_fence_ring_emit (struct radeon_device *rdev,struct radeon_fence *fence) { +u32 cp_coher_cntl =PACKET3_TC_ACTION_ENA |PACKET3_VC_ACTION_ENA | +PACKET3_SH_ACTION_ENA ; + +if (rdev->family >=CHIP_RV770 ) + cp_coher_cntl |=PACKET3_FULL_CACHE_ENA ; +if (rdev->wb.use_event) {u64 addr = rdev->wb.gpu_addr +R600_WB_EVENT_OFFSET + (u64)(rdev->fence_drv.scratch_reg - rdev->scratch.reg_base);/* flush read cache over gart */ radeon_ring_write (rdev,PACKET3 (PACKET3_SURFACE_SYNC ,3 )); -radeon_ring_write (rdev,PACKET3_TC_ACTION_ENA | -PACKET3_VC_ACTION_ENA | -PACKET3_SH_ACTION_ENA ); +radeon_ring_write (rdev, cp_coher_cntl);radeon_ring_write (rdev,0xFFFFFFFF );radeon_ring_write (rdev,0 );radeon_ring_write (rdev,10 );/* poll interval */
@@ -2336,9 +2340,7 @@ void r600_fence_ring_emit(struct radeon_ }else {/* flush read cache over gart */ radeon_ring_write (rdev,PACKET3 (PACKET3_SURFACE_SYNC ,3 )); -radeon_ring_write (rdev,PACKET3_TC_ACTION_ENA | -PACKET3_VC_ACTION_ENA | -PACKET3_SH_ACTION_ENA ); +radeon_ring_write (rdev, cp_coher_cntl);radeon_ring_write (rdev,0xFFFFFFFF );radeon_ring_write (rdev,0 );radeon_ring_write (rdev,10 );/* poll interval */
drivers/gpu/drm/radeon/r600d.h +1 -0
@@ -838,6 +838,7 @@#define PACKET3_INDIRECT_BUFFER 0x32#define PACKET3_SURFACE_SYNC 0x43# define PACKET3_CB0_DEST_BASE_ENA (1 << 6) +# define PACKET3_FULL_CACHE_ENA (1 << 20)/* r7xx+ only */ # define PACKET3_TC_ACTION_ENA (1 << 23)# define PACKET3_VC_ACTION_ENA (1 << 24)# define PACKET3_CB_ACTION_ENA (1 << 25)
PATCH 48/200 hp_accel: Add a new PnP ID HPQ6007 for new HP laptops
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit b0ad4ff35d479a46a3b995a299db9aeb097acfce upstream.
The DriveGuard chips on the new HP laptops are with a new PnP ID "HPQ6007". It should be compatible with older chips.
--- drivers/platform/x86/hp_accel.c | 1 + 1 file changed, 1 insertion(+)
drivers/platform/x86/hp_accel.c +1 -0
@@ -77,6 +77,7 @@ static inline void delayed_sysfs_set(strstatic struct acpi_device_id lis3lv02d_device_ids[] = { {"HPQ0004" ,0 },/* HP Mobile Data Protection System PNP */ {"HPQ6000" ,0 },/* HP Mobile Data Protection System PNP */ + {"HPQ6007" ,0 },/* HP Mobile Data Protection System PNP */ {"" ,0 }, };MODULE_DEVICE_TABLE (acpi, lis3lv02d_device_ids);
PATCH 49/200 intel-iommu: fix off-by-one in pagetable freeing
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Alex Williamson <[email protected]>
commit 08336fd218e087cc4fcc458e6b6dcafe8702b098 upstream.
dma_pte_free_level() has an off-by-one error when checking whether a pte is completely covered by a range. Take for example the case of attempting to free pfn 0x0 - 0x1ff, ie. 512 entries covering the first 2M superpage.
The level_size() is 0x200 and we test:
static void dma_pte_free_level(...
...
if (!(0 > 0 || 0x1ff < 0 + 0x200)) {
...
}Clearly the 2nd test is true, which means we fail to take the branch to clear and free the pagetable entry. As a result, we're leaking pagetables and failing to install new pages over the range.
This was found with a PCI device assigned to a QEMU guest using vfio-pci without a VGA device present. The first 1M of guest address space is mapped with various combinations of 4K pages, but eventually the range is entirely freed and replaced with a 2M contiguous mapping. intel-iommu errors out with something like:
ERROR: DMA PTE for vPFN 0x0 already set (to 5c2b8003 not 849c00083)
In this case 5c2b8003 is the pointer to the previous leaf page that was neither freed nor cleared and 849c00083 is the superpage entry that we're trying to replace it with.
--- drivers/iommu/intel-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/intel-iommu.c +1 -1
@@ -884,7 +884,7 @@ static void dma_pte_free_level(struct dm/* If range covers entire pagetable, free it */ if (!(start_pfn > level_pfn || - last_pfn < level_pfn +level_size (level))) { + last_pfn < level_pfn +level_size (level) -1 )) {dma_clear_pte (pte);domain_flush_cache (domain, pte,sizeof (*pte));free_pgtable_page (level_pte);
PATCH 50/200 fuse: fix pipe_buf_operations
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Miklos Szeredi <[email protected]>
commit 28a625cbc2a14f17b83e47ef907b2658576a32aa upstream.
Having this struct in module memory could Oops when if the module is unloaded while the buffer still persists in a pipe.
Since sock_pipe_buf_ops is essentially the same as fuse_dev_pipe_buf_steal merge them into nosteal_pipe_buf_ops (this is the same as default_pipe_buf_ops except stealing the page from the buffer is not allowed).
--- fs/fuse/dev.c | 22 +++++----------------- fs/splice.c | 18 ++++++++++++++++++ include/linux/pipe_fs_i.h | 2 ++ net/core/skbuff.c | 32 +------------------------------- 4 files changed, 26 insertions(+), 48 deletions(-)
fs/fuse/dev.c +5 -17
@@ -1199,22 +1199,6 @@ static ssize_t fuse_dev_read(struct kiocreturn fuse_dev_do_read (fc, file, &cs,iov_length (iov, nr_segs)); } -static int fuse_dev_pipe_buf_steal (struct pipe_inode_info *pipe, -struct pipe_buffer *buf) -{ -return 1 ; -} - -static const struct pipe_buf_operations fuse_dev_pipe_buf_ops = { - .can_merge =0 , - .map = generic_pipe_buf_map, - .unmap = generic_pipe_buf_unmap, - .confirm = generic_pipe_buf_confirm, - .release = generic_pipe_buf_release, - .steal = fuse_dev_pipe_buf_steal, - .get = generic_pipe_buf_get, -}; -static ssize_t fuse_dev_splice_read (struct file *in,loff_t *ppos,struct pipe_inode_info *pipe,size_t len,unsigned int flags)
@@ -1261,7 +1245,11 @@ static ssize_t fuse_dev_splice_read(stru buf->page = bufs[page_nr].page; buf->offset = bufs[page_nr].offset; buf->len = bufs[page_nr].len; - buf->ops = &fuse_dev_pipe_buf_ops; +/* +* Need to be careful about this. Having buf->ops in module +* code can Oops if the buffer persists after module unload. +*/ + buf->ops = &nosteal_pipe_buf_ops; pipe->nrbufs++; page_nr++;
fs/splice.c +18 -0
@@ -554,6 +554,24 @@ static const struct pipe_buf_operations .get = generic_pipe_buf_get, }; +static int generic_pipe_buf_nosteal (struct pipe_inode_info *pipe, +struct pipe_buffer *buf) +{ +return 1 ; +} + +/* Pipe buffer operations for a socket and similar. */ +const struct pipe_buf_operations nosteal_pipe_buf_ops = { + .can_merge =0 , + .map = generic_pipe_buf_map, + .unmap = generic_pipe_buf_unmap, + .confirm = generic_pipe_buf_confirm, + .release = generic_pipe_buf_release, + .steal = generic_pipe_buf_nosteal, + .get = generic_pipe_buf_get, +}; +EXPORT_SYMBOL (nosteal_pipe_buf_ops); +static ssize_t kernel_readv (struct file *file,const struct iovec *vec,unsigned long vlen,loff_t offset) {
include/linux/pipe_fs_i.h +2 -0
@@ -160,6 +160,8 @@ int generic_pipe_buf_confirm(struct pipeint generic_pipe_buf_steal (struct pipe_inode_info *,struct pipe_buffer *);void generic_pipe_buf_release (struct pipe_inode_info *,struct pipe_buffer *); +extern const struct pipe_buf_operations nosteal_pipe_buf_ops; +/* for F_SETPIPE_SZ and F_GETPIPE_SZ */ long pipe_fcntl (struct file *,unsigned int ,unsigned long arg);struct pipe_inode_info *get_pipe_info (struct file *file);
net/core/skbuff.c +1 -31
@@ -74,36 +74,6 @@static struct kmem_cache *skbuff_head_cache__read_mostly ;static struct kmem_cache *skbuff_fclone_cache__read_mostly ; -static void sock_pipe_buf_release (struct pipe_inode_info *pipe, -struct pipe_buffer *buf) -{ -put_page (buf->page); -} - -static void sock_pipe_buf_get (struct pipe_inode_info *pipe, -struct pipe_buffer *buf) -{ -get_page (buf->page); -} - -static int sock_pipe_buf_steal (struct pipe_inode_info *pipe, -struct pipe_buffer *buf) -{ -return 1 ; -} - - -/* Pipe buffer operations for a socket. */ -static const struct pipe_buf_operations sock_pipe_buf_ops = { - .can_merge =0 , - .map = generic_pipe_buf_map, - .unmap = generic_pipe_buf_unmap, - .confirm = generic_pipe_buf_confirm, - .release = sock_pipe_buf_release, - .steal = sock_pipe_buf_steal, - .get = sock_pipe_buf_get, -}; -/* * Keep out-of-line to prevent kernel bloat. * __builtin_return_address is not used because it is not always
@@ -1665,7 +1635,7 @@ int skb_splice_bits(struct sk_buff *skb, .partial = partial, .nr_pages_max = MAX_SKB_FRAGS, .flags = flags, - .ops = &sock_pipe_buf_ops, + .ops = &nosteal_pipe_buf_ops, .spd_release = sock_spd_release, };struct sk_buff *frag_iter;
PATCH 51/200 IB/qib: Fix QP check when looping back to/from QP1
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Ira Weiny <[email protected]>
commit 6e0ea9e6cbcead7fa8c76e3e3b9de4a50c5131c5 upstream.
The GSI QP type is compatible with and should be allowed to send data to/from any UD QP. This was found when testing ibacm on the same node as an SA.
--- drivers/infiniband/hw/qib/qib_ud.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/infiniband/hw/qib/qib_ud.c +8 -1
@@ -57,13 +57,20 @@ static void qib_ud_loopback(struct qib_qstruct qib_sge *sge;struct ib_wc wc;u32 length; +enum ib_qp_type sqptype, dqptype; qp =qib_lookup_qpn (ibp, swqe->wr.wr.ud.remote_qpn);if (!qp) { ibp->n_pkt_drops++;return ; } -if (qp->ibqp.qp_type != sqp->ibqp.qp_type || + + sqptype = sqp->ibqp.qp_type ==IB_QPT_GSI ? +IB_QPT_UD : sqp->ibqp.qp_type; + dqptype = qp->ibqp.qp_type ==IB_QPT_GSI ? +IB_QPT_UD : qp->ibqp.qp_type; + +if (dqptype != sqptype || !(ib_qib_state_ops[qp->state] &QIB_PROCESS_RECV_OK )) { ibp->n_pkt_drops++; goto drop;
PATCH 52/200 ore: Fix wrong math in allocation of per device BIO
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Boaz Harrosh <[email protected]>
commit aad560b7f63b495f48a7232fd086c5913a676e6f upstream.
At IO preparation we calculate the max pages at each device and allocate a BIO per device of that size. The calculation was wrong on some unaligned corner cases offset/length combination and would make prepare return with -ENOMEM. This would be bad for pnfs-objects that would in that case IO through MDS. And fatal for exofs were it would fail writes with EIO.
Fix it by doing the proper math, that will work in all cases. (I ran a test with all possible offset/length combinations this time round).
Also when reading we do not need to allocate for the parity units since we jump over them.
Also lower the max_io_length to take into account the parity pages so not to allocate BIOs bigger than PAGE_SIZE
--- fs/exofs/ore.c | 37 +++++++++++++++++++++++++------------ include/scsi/osd_ore.h | 1 + 2 files changed, 26 insertions(+), 12 deletions(-)
fs/exofs/ore.c +25 -12
@@ -103,7 +103,7 @@ int ore_verify_layout(unsigned total_com layout->max_io_length = (BIO_MAX_PAGES_KMALLOC *PAGE_SIZE - layout->stripe_unit) * - layout->group_width; + (layout->group_width - layout->parity);if (layout->parity) {unsigned stripe_length = (layout->group_width - layout->parity) *
@@ -286,7 +286,8 @@ int ore_get_rw_state(struct ore_layoutif (length) {ore_calc_stripe_info (layout, offset, length, &ios->si); ios->length = ios->si.length; - ios->nr_pages = (ios->length +PAGE_SIZE -1 ) /PAGE_SIZE ; + ios->nr_pages = ((ios->offset & (PAGE_SIZE -1 )) + + ios->length +PAGE_SIZE -1 ) /PAGE_SIZE ;if (layout->parity)_ore_post_alloc_raid_stuff (ios); }
@@ -536,6 +537,7 @@ void ore_calc_stripe_info(struct ore_layu64 H = LmodS -G *T ;u32 N =div_u64 (H ,U ); +u32 Nlast;/* "H - (N * U)" is just "H % U" so it's bound to u32 */ u32 C = (u32)(H - (N *U )) / stripe_unit +G * group_width;
@@ -568,6 +570,10 @@ void ore_calc_stripe_info(struct ore_lay si->length =T -H ;if (si->length > length) si->length = length; + + Nlast =div_u64 (H + si->length +U -1 ,U ); + si->maxdevUnits = Nlast -N ; + si->M =M ; }EXPORT_SYMBOL (ore_calc_stripe_info);
@@ -583,13 +589,16 @@ int _ore_add_stripe_unit(struct ore_io_sint ret;if (per_dev->bio ==NULL ) { -unsigned pages_in_stripe = ios->layout->group_width * - (ios->layout->stripe_unit /PAGE_SIZE ); -unsigned nr_pages = ios->nr_pages * ios->layout->group_width / - (ios->layout->group_width - - ios->layout->parity); -unsigned bio_size = (nr_pages + pages_in_stripe) / - ios->layout->group_width; +unsigned bio_size; + +if (!ios->reading) { + bio_size = ios->si.maxdevUnits; + }else { + bio_size = (ios->si.maxdevUnits +1 ) * + (ios->layout->group_width - ios->layout->parity) / + ios->layout->group_width; + } + bio_size *= (ios->layout->stripe_unit /PAGE_SIZE ); per_dev->bio =bio_kmalloc (GFP_KERNEL , bio_size);if (unlikely (!per_dev->bio)) {
@@ -609,8 +618,12 @@ int _ore_add_stripe_unit(struct ore_io_s added_len =bio_add_pc_page (q, per_dev->bio, pages[pg], pglen, pgbase);if (unlikely (pglen != added_len)) { -ORE_DBGMSG ("Failed bio_add_pc_page bi_vcnt=%u\n" , - per_dev->bio->bi_vcnt); +/* If bi_vcnt == bi_max then this is a SW BUG */ +ORE_DBGMSG ("Failed bio_add_pc_page bi_vcnt=0x%x " +"bi_max=0x%x BIO_MAX=0x%x cur_len=0x%x\n" , + per_dev->bio->bi_vcnt, + per_dev->bio->bi_max_vecs, +BIO_MAX_PAGES_KMALLOC , cur_len); ret = -ENOMEM ; goto out; }
@@ -1099,7 +1112,7 @@ int ore_truncate(struct ore_layout *layo size_attr->attr = g_attr_logical_length; size_attr->attr.val_ptr = &size_attr->newsize; -ORE_DBGMSG ("trunc(0x%llx) obj_offset=0x%llx dev=%d\n" , +ORE_DBGMSG2 ("trunc(0x%llx) obj_offset=0x%llx dev=%d\n" ,_LLU (oc->comps->obj.id),_LLU (obj_size), i); ret =_truncate_mirrors (ios, i * ios->layout->mirrors_p1, &size_attr->attr);
include/scsi/osd_ore.h +1 -0
@@ -101,6 +101,7 @@ struct ore_striping_info {unsigned unit_off;unsigned cur_pg;unsigned cur_comp; +unsigned maxdevUnits; };struct ore_io_state ;
PATCH 53/200 b43: fix the wrong assignment of status.freq in b43_rx()
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: ZHAO Gang <[email protected]>
commit 64e5acb09ca6b50c97299cff9ef51299470b29f2 upstream.
Use the right function to update frequency value.
If rx skb is probe response or beacon, the wrong frequency value can cause problem that bss info can't be updated when it should be.
and driver conversion")
--- drivers/net/wireless/b43/xmit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/b43/xmit.c +2 -2
@@ -819,10 +819,10 @@ void b43_rx(struct b43_wldev *dev, struc* channel number in b43. */ if (chanstat &B43_RX_CHAN_5GHZ ) { status.band =IEEE80211_BAND_5GHZ ; - status.freq =b43_freq_to_channel_5ghz (chanid); + status.freq =b43_channel_to_freq_5ghz (chanid); }else { status.band =IEEE80211_BAND_2GHZ ; - status.freq =b43_freq_to_channel_2ghz (chanid); + status.freq =b43_channel_to_freq_2ghz (chanid); }break ;default :
PATCH 54/200 i2c: piix4: Add support for AMD ML and CZ SMBus changes
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Shane Huang <[email protected]>
commit 032f708bc4f6da868ec49dac48ddf3670d8035d3 upstream.
The locations of SMBus register base address and enablement bit are changed from AMD ML, which need this patch to be supported.
[bwh: Backported to 3.2:
- Adjust context
- Aux bus support is not included]
---
Documentation/i2c/busses/i2c-piix4 +1 -1
@@ -8,7 +8,7 @@ Supported adapters: Datasheet: Only available via NDA from ServerWorks * ATI IXP200, IXP300, IXP400, SB600, SB700 and SB800 southbridges Datasheet: Not publicly available - * AMD Hudson-2, CZ + * AMD Hudson-2, ML, CZ Datasheet: Not publicly available * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge Datasheet: Publicly available at the SMSC website http://www.smsc.com
drivers/i2c/busses/Kconfig +1 -0
@@ -137,6 +137,7 @@ config I2C_PIIX4 ATI SB700 ATI SB800 AMD Hudson-2 + AMD ML AMD CZ Serverworks OSB4 Serverworks CSB5
drivers/i2c/busses/i2c-piix4.c +22 -4
@@ -22,7 +22,7 @@ Intel PIIX4, 440MX Serverworks OSB4, CSB5, CSB6, HT-1000, HT-1100 ATI IXP200, IXP300, IXP400, SB600, SB700, SB800 - AMD Hudson-2, CZ + AMD Hudson-2, ML, CZ SMSC Victory66 Note: we assume there can only be one device, with one SMBus interface.
@@ -231,7 +231,8 @@ static int __devinit piix4_setup_sb800(s const struct pci_device_id *id) {unsigned short smba_idx =0xcd6 ; -u8 smba_en_lo, smba_en_hi, i2ccfg, i2ccfg_offset =0x10 , smb_en =0x2c ; +u8 smba_en_lo, smba_en_hi, smb_en, smb_en_status; +u8 i2ccfg, i2ccfg_offset =0x10 ;/* SB800 and later SMBus does not support forcing address */ if (force || force_addr) {
@@ -241,6 +242,16 @@ static int __devinit piix4_setup_sb800(s }/* Determine the address of the SMBus areas */ +if ((PIIX4_dev->vendor ==PCI_VENDOR_ID_AMD && + PIIX4_dev->device ==PCI_DEVICE_ID_AMD_HUDSON2_SMBUS && + PIIX4_dev->revision >=0x41 ) || + (PIIX4_dev->vendor ==PCI_VENDOR_ID_AMD && + PIIX4_dev->device ==0x790b && + PIIX4_dev->revision >=0x49 )) + smb_en =0x00 ; +else + smb_en =0x2c ; +if (!request_region (smba_idx,2 ,"smba_idx" )) {dev_err (&PIIX4_dev->dev,"SMBus base address index region " "0x%x already in use!\n" , smba_idx);
@@ -252,13 +263,20 @@ static int __devinit piix4_setup_sb800(s smba_en_hi =inb_p (smba_idx +1 );release_region (smba_idx,2 ); -if ((smba_en_lo &1 ) ==0 ) { +if (!smb_en) { + smb_en_status = smba_en_lo &0x10 ; + piix4_smba = smba_en_hi <<8 ; + }else { + smb_en_status = smba_en_lo &0x01 ; + piix4_smba = ((smba_en_hi <<8 ) | smba_en_lo) &0xffe0 ; + } + +if (!smb_en_status) {dev_err (&PIIX4_dev->dev,"Host SMBus controller not enabled!\n" );return -ENODEV ; } - piix4_smba = ((smba_en_hi <<8 ) | smba_en_lo) &0xffe0 ;if (acpi_check_region (piix4_smba,SMBIOSIZE , piix4_driver.name))return -ENODEV ;
PATCH 55/200 KVM: PPC: e500: Fix bad address type in deliver_tlb_misss()
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Mihai Caraman <[email protected]>
commit 70713fe315ed14cd1bb07d1a7f33e973d136ae3d upstream.
Use gva_t instead of unsigned int for eaddr in deliver_tlb_miss().
--- arch/powerpc/kvm/e500_tlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kvm/e500_tlb.c +1 -1
@@ -481,7 +481,7 @@ static inline void kvmppc_e500_priv_rele }static inline void kvmppc_e500_deliver_tlb_miss (struct kvm_vcpu *vcpu, -unsigned int eaddr,int as) +gva_t eaddr,int as) {struct kvmppc_vcpu_e500 *vcpu_e500 =to_e500 (vcpu);unsigned int victim, pidsel, tsized;
PATCH 56/200 Btrfs: handle EAGAIN case properly in btrfs_drop_snapshot()
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Wang Shilong <[email protected]>
commit 90515e7f5d7d24cbb2a4038a3f1b5cfa2921aa17 upstream.
We may return early in btrfs_drop_snapshot(), we shouldn't call btrfs_std_err() for this case, fix it.
--- fs/btrfs/extent-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/extent-tree.c +1 -1
@@ -6725,7 +6725,7 @@ out:*/ if (root_dropped == false)btrfs_add_dead_root (root); -if (err) +if (err && err != -EAGAIN )btrfs_std_error (root->fs_info, err);return ; }
PATCH 57/200 btrfs: restrict snapshotting to own subvolumes
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: David Sterba <[email protected]>
commit d024206133ce21936b3d5780359afc00247655b7 upstream.
Currently, any user can snapshot any subvolume if the path is accessible and thus indirectly create and keep files he does not own under his direcotries. This is not possible with traditional directories.
In security context, a user can snapshot root filesystem and pin any potentially buggy binaries, even if the updates are applied.
All the snapshots are visible to the administrator, so it's possible to verify if there are suspicious snapshots.
Another more practical problem is that any user can pin the space used by eg. root and cause ENOSPC.
Original report:
https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/484786
[bwh: Backported to 3.2:
- Adjust context
- Use the same cleanup code for success and error cases, as done upstream in commit ecd188159efa
('switch btrfs_ioctl_snap_create_transid() to fget_light()')]
---
fs/btrfs/ioctl.c +10 -5
@@ -1327,12 +1327,17 @@ static noinline int btrfs_ioctl_snap_creprintk (KERN_INFO "btrfs: Snapshot src from " "another FS\n" ); ret = -EINVAL ; -fput (src_file); - goto out; + }else if (!inode_owner_or_capable (src_inode)) { +/* +* Subvolume creation is not restricted, but snapshots +* are limited to own subvolumes only +*/ + ret = -EPERM ; + }else { + ret =btrfs_mksubvol (&file->f_path, name, namelen, +BTRFS_I (src_inode)->root, + transid, readonly); } - ret =btrfs_mksubvol (&file->f_path, name, namelen, -BTRFS_I (src_inode)->root, - transid, readonly);fput (src_file); } out:
PATCH 58/200 ACPI / init: Flag use of ACPI and ACPI idioms for power supplies to regulator API
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <[email protected]>
commit 49a12877d2777cadcb838981c3c4f5a424aef310 upstream.
There is currently no facility in ACPI to express the hookup of voltage regulators, the expectation is that the regulators that exist in the system will be handled transparently by firmware if they need software control at all. This means that if for some reason the regulator API is enabled on such a system it should assume that any supplies that devices need are provided by the system at all relevant times without any software intervention.
Tell the regulator core to make this assumption by calling regulator_has_full_constraints(). Do this as soon as we know we are using ACPI so that the information is available to the regulator core as early as possible. This will cause the regulator core to pretend that there is an always on regulator supplying any supply that is requested but that has not otherwise been mapped which is the behaviour expected on a system with ACPI.
Should the ability to specify regulators be added in future revisions of ACPI then once we have support for ACPI mappings in the kernel the same assumptions will apply. It is also likely that systems will default to a mode of operation which does not require any interpretation of these mappings in order to be compatible with existing operating system releases so it should remain safe to make these assumptions even if the mappings exist but are not supported by the kernel.
--- drivers/acpi/bus.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/acpi/bus.c +9 -0
@@ -33,6 +33,7 @@#include <linux/proc_fs.h> #include <linux/acpi.h> #include <linux/slab.h> +#include <linux/regulator/machine.h> #ifdef CONFIG_X86 #include <asm/mpspec.h> #endif
@@ -917,6 +918,14 @@ void __init acpi_early_init(void) goto error0; } +/* +* If the system is using ACPI then we can be reasonably +* confident that any regulators are managed by the firmware +* so tell the regulator core it has everything it needs to +* know. +*/ +regulator_has_full_constraints (); +return ; error0:
PATCH 59/200 powerpc: Make sure "cache" directory is removed when offlining cpu
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Paul Mackerras <[email protected]>
commit 91b973f90c1220d71923e7efe1e61f5329806380 upstream.
The code in remove_cache_dir() is supposed to remove the "cache" subdirectory from the sysfs directory for a CPU when that CPU is being offlined. It tries to do this by calling kobject_put() on the kobject for the subdirectory. However, the subdirectory only gets removed once the last reference goes away, and the reference being put here may well not be the last reference. That means that the "cache" subdirectory may still exist when the offlining operation has finished. If the same CPU subsequently gets onlined, the code tries to add a new "cache" subdirectory. If the old subdirectory has not yet been removed, we get a WARN_ON in the sysfs code, with stack trace, and an error message printed on the console. Further, we ultimately end up with an online cpu with no "cache" subdirectory.
This fixes it by doing an explicit kobject_del() at the point where we want the subdirectory to go away. kobject_del() removes the sysfs directory even though the object still exists in memory. The object will get freed at some point in the future. A subsequent onlining operation can create a new sysfs directory, even if the old object still exists in memory, without causing any problems.
--- arch/powerpc/kernel/cacheinfo.c | 3 +++ 1 file changed, 3 insertions(+)
arch/powerpc/kernel/cacheinfo.c +3 -0
@@ -788,6 +788,9 @@ static void remove_cache_dir(struct cach {remove_index_dirs (cache_dir); +/* Remove cache dir from sysfs */ +kobject_del (cache_dir->kobj); +kobject_put (cache_dir->kobj);kfree (cache_dir);
PATCH 60/200 Btrfs: setup inode location during btrfs_init_inode_locked
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mason <[email protected]>
commit 90d3e592e99b8e374ead2b45148abf506493a959 upstream.
We have a race during inode init because the BTRFS_I(inode)->location is setup after the inode hash table lock is dropped. btrfs_find_actor uses the location field, so our search might not find an existing inode in the hash table if we race with the inode init code.
This commit changes things to setup the location field sooner. Also the find actor now uses only the location objectid to match inodes. For inode hashing, we just need a unique and stable test, it doesn't have to reflect the inode numbers we show to userland.
[bwh: Backported to 3.2:
- No hashval in btrfs_iget_locked()]
--- fs/btrfs/inode.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
fs/btrfs/inode.c +9 -9
@@ -56,7 +56,7 @@#include "inode-map.h" struct btrfs_iget_args { -u64 ino; +struct btrfs_key *location;struct btrfs_root *root; };
@@ -3847,7 +3847,9 @@ again:static int btrfs_init_locked_inode (struct inode *inode,void *p) {struct btrfs_iget_args *args = p; - inode->i_ino = args->ino; + inode->i_ino = args->location->objectid; +memcpy (&BTRFS_I (inode)->location, args->location, +sizeof (*args->location));BTRFS_I (inode)->root = args->root;btrfs_set_inode_space_info (args->root, inode);return 0 ;
@@ -3856,20 +3858,20 @@ static int btrfs_init_locked_inode(strucstatic int btrfs_find_actor (struct inode *inode,void *opaque) {struct btrfs_iget_args *args = opaque; -return args->ino ==btrfs_ino (inode) && +return args->location->objectid ==BTRFS_I (inode)->location.objectid && args->root ==BTRFS_I (inode)->root; }static struct inode *btrfs_iget_locked (struct super_block *s, -u64 objectid, +struct btrfs_key *location,struct btrfs_root *root) {struct inode *inode;struct btrfs_iget_args args; - args.ino = objectid; + args.location = location; args.root = root; - inode =iget5_locked (s, objectid, btrfs_find_actor, + inode =iget5_locked (s, location->objectid, btrfs_find_actor, btrfs_init_locked_inode, (void *)&args);return inode;
@@ -3883,13 +3885,11 @@ struct inode *btrfs_iget(struct super_bl {struct inode *inode; - inode =btrfs_iget_locked (s, location->objectid, root); + inode =btrfs_iget_locked (s, location, root);if (!inode)return ERR_PTR (-ENOMEM );if (inode->i_state &I_NEW ) { -BTRFS_I (inode)->root = root; -memcpy (&BTRFS_I (inode)->location, location,sizeof (*location));btrfs_read_locked_inode (inode);if (!is_bad_inode (inode)) {inode_tree_add (inode);
PATCH 61/200 drm/radeon/DCE4+: clear bios scratch dpms bit (v2)
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 6802d4bad83f50081b2788698570218aaff8d10e upstream.
The BlankCrtc table in some DCE8 boards has some logic shortcuts for the vbios when this bit is set. Clear it for driver use.
v2: fix typo
Bug:
https://bugs.freedesktop.org/show_bug.cgi?id=73420
--- drivers/gpu/drm/radeon/radeon_atombios.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/radeon/radeon_atombios.c +4 -0
@@ -2735,6 +2735,10 @@ void radeon_atom_initialize_bios_scratch/* tell the bios not to handle mode switching */ bios_6_scratch |=ATOM_S6_ACC_BLOCK_DISPLAY_SWITCH ; +/* clear the vbios dpms state */ +if (ASIC_IS_DCE4 (rdev)) + bios_2_scratch &= ~ATOM_S2_DEVICE_DPMS_STATE ; +if (rdev->family >=CHIP_R600 ) {WREG32 (R600_BIOS_2_SCRATCH , bios_2_scratch);WREG32 (R600_BIOS_6_SCRATCH , bios_6_scratch);
PATCH 62/200 KVM: return an error code in kvm_vm_ioctl_register_coalesced_mmio()
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit aac5c4226e7136c331ed384c25d5560204da10a0 upstream.
If kvm_io_bus_register_dev() fails then it returns success but it should return an error code.
I also did a little cleanup like removing an impossible NULL test.
--- virt/kvm/coalesced_mmio.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
virt/kvm/coalesced_mmio.c +2 -6
@@ -148,17 +148,13 @@ int kvm_vm_ioctl_register_coalesced_mmiolist_add_tail (&dev->list, &kvm->coalesced_zones);mutex_unlock (&kvm->slots_lock); -return ret; +return 0 ; out_free_dev:mutex_unlock (&kvm->slots_lock); -kfree (dev); -if (dev ==NULL ) -return -ENXIO ; - -return 0 ; +return ret; } int kvm_vm_ioctl_unregister_coalesced_mmio(struct kvm *kvm,
PATCH 63/200 target/iscsi: Fix network portal creation race
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Andy Grover <[email protected]>
commit ee291e63293146db64668e8d65eb35c97e8324f4 upstream.
When creating network portals rapidly, such as when restoring a configuration, LIO's code to reuse existing portals can return a false negative if the thread hasn't run yet and set np_thread_state to ISCSI_NP_THREAD_ACTIVE. This causes an error in the network stack when attempting to bind to the same address/port.
This patch sets NP_THREAD_ACTIVE before the np is placed on g_np_list, so even if the thread hasn't run yet, iscsit_get_np will return the existing np.
Also, convert np_lock -> np_mutex + hold across adding new net portal to g_np_list to prevent a race where two threads may attempt to create the same network portal, resulting in one of them failing.
(nab: Add missing mutex_unlocks in iscsit_add_np failure paths) (DanC: Fix incorrect spin_unlock -> spin_unlock_bh)
--- drivers/target/iscsi/iscsi_target.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-)
drivers/target/iscsi/iscsi_target.c +21 -13
@@ -50,7 +50,7 @@static LIST_HEAD (g_tiqn_list);static LIST_HEAD (g_np_list);static DEFINE_SPINLOCK (tiqn_lock); -static DEFINE_SPINLOCK (np_lock); +static DEFINE_MUTEX (np_lock);static struct idr tiqn_idr;struct idr sess_idr;
@@ -262,6 +262,9 @@ int iscsit_deaccess_np(struct iscsi_np *return 0 ; } +/* +* Called with mutex np_lock held +*/ static struct iscsi_np *iscsit_get_np (struct __kernel_sockaddr_storage *sockaddr,int network_transport)
@@ -272,11 +275,10 @@ static struct iscsi_np *iscsit_get_np(int ip_match =0 ;u16 port; -spin_lock_bh (&np_lock);list_for_each_entry (np, &g_np_list, np_list) { -spin_lock (&np->np_thread_lock); +spin_lock_bh (&np->np_thread_lock);if (np->np_thread_state !=ISCSI_NP_THREAD_ACTIVE ) { -spin_unlock (&np->np_thread_lock); +spin_unlock_bh (&np->np_thread_lock);continue ; }
@@ -309,13 +311,11 @@ static struct iscsi_np *iscsit_get_np(* while iscsi_tpg_add_network_portal() is called. */ np->np_exports++; -spin_unlock (&np->np_thread_lock); -spin_unlock_bh (&np_lock); +spin_unlock_bh (&np->np_thread_lock);return np; } -spin_unlock (&np->np_thread_lock); +spin_unlock_bh (&np->np_thread_lock); } -spin_unlock_bh (&np_lock);return NULL ; }
@@ -329,16 +329,22 @@ struct iscsi_np *iscsit_add_np(struct sockaddr_in6 *sock_in6;struct iscsi_np *np;int ret; + +mutex_lock (&np_lock); +/* * Locate the existing struct iscsi_np if already active.. */ np =iscsit_get_np (sockaddr, network_transport); -if (np) +if (np) { +mutex_unlock (&np_lock);return np; + } np =kzalloc (sizeof (struct iscsi_np ),GFP_KERNEL );if (!np) {pr_err ("Unable to allocate memory for struct iscsi_np\n" ); +mutex_unlock (&np_lock);return ERR_PTR (-ENOMEM ); }
@@ -361,6 +367,7 @@ struct iscsi_np *iscsit_add_np( ret =iscsi_target_setup_login_socket (np, sockaddr);if (ret !=0 ) {kfree (np); +mutex_unlock (&np_lock);return ERR_PTR (ret); }
@@ -369,6 +376,7 @@ struct iscsi_np *iscsit_add_np(pr_err ("Unable to create kthread: iscsi_np\n" ); ret =PTR_ERR (np->np_thread);kfree (np); +mutex_unlock (&np_lock);return ERR_PTR (ret); }/*
@@ -379,10 +387,10 @@ struct iscsi_np *iscsit_add_np(* point because iscsi_np has not been added to g_np_list yet. */ np->np_exports =1 ; + np->np_thread_state =ISCSI_NP_THREAD_ACTIVE ; -spin_lock_bh (&np_lock);list_add_tail (&np->np_list, &g_np_list); -spin_unlock_bh (&np_lock); +mutex_unlock (&np_lock); pr_debug("CORE[0] - Added Network Portal: %s:%hu on %s\n", np->np_ip, np->np_port, (np->np_network_transport == ISCSI_TCP) ?
@@ -453,9 +461,9 @@ int iscsit_del_np(struct iscsi_np *np) }iscsit_del_np_comm (np); -spin_lock_bh (&np_lock); +mutex_lock (&np_lock);list_del (&np->np_list); -spin_unlock_bh (&np_lock); +mutex_unlock (&np_lock); pr_debug("CORE[0] - Removed Network Portal: %s:%hu on %s\n", np->np_ip, np->np_port, (np->np_network_transport == ISCSI_TCP) ?
PATCH 64/200 s390/crypto: Don't panic after crypto instruction failures
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Jan Glauber <[email protected]>
commit 36eb2caa7bace31b7868a57f77cb148e58d1c9f9 upstream.
Remove the BUG_ON's that check for failure or incomplete results of the s390 hardware crypto instructions. Rather report the errors as -EIO to the crypto layer.
--- arch/s390/crypto/aes_s390.c | 18 ++++++++++++------ arch/s390/crypto/des_s390.c | 12 ++++++++---- arch/s390/crypto/ghash_s390.c | 21 +++++++++++++-------- arch/s390/crypto/sha_common.c | 9 ++++++--- 4 files changed, 39 insertions(+), 21 deletions(-)
arch/s390/crypto/aes_s390.c +12 -6
@@ -324,7 +324,8 @@ static int ecb_aes_crypt(struct blkcipheu8 *in = walk->src.virt.addr; ret =crypt_s390_km (func, param, out, in, n); -BUG_ON ((ret <0 ) || (ret != n)); +if (ret <0 || ret != n) +return -EIO ; nbytes &=AES_BLOCK_SIZE -1 ; ret =blkcipher_walk_done (desc, walk, nbytes);
@@ -463,7 +464,8 @@ static int cbc_aes_crypt(struct blkcipheu8 *in = walk->src.virt.addr; ret =crypt_s390_kmc (func, ¶m, out, in, n); -BUG_ON ((ret <0 ) || (ret != n)); +if (ret <0 || ret != n) +return -EIO ; nbytes &=AES_BLOCK_SIZE -1 ; ret =blkcipher_walk_done (desc, walk, nbytes);
@@ -636,7 +638,8 @@ static int xts_aes_crypt(struct blkciphememcpy (pcc_param.tweak, walk->iv,sizeof (pcc_param.tweak));memcpy (pcc_param.key, xts_ctx->pcc_key,32 ); ret =crypt_s390_pcc (func, &pcc_param.key[offset]); -BUG_ON (ret <0 ); +if (ret <0 ) +return -EIO ;memcpy (xts_param.key, xts_ctx->key,32 );memcpy (xts_param.init, pcc_param.xts,16 );
@@ -647,7 +650,8 @@ static int xts_aes_crypt(struct blkciphe in = walk->src.virt.addr; ret =crypt_s390_km (func, &xts_param.key[offset], out, in, n); -BUG_ON (ret <0 || ret != n); +if (ret <0 || ret != n) +return -EIO ; nbytes &=AES_BLOCK_SIZE -1 ; ret =blkcipher_walk_done (desc, walk, nbytes);
@@ -781,7 +785,8 @@ static int ctr_aes_crypt(struct blkciphecrypto_inc (ctrblk + i,AES_BLOCK_SIZE ); } ret =crypt_s390_kmctr (func, sctx->key, out, in, n, ctrblk); -BUG_ON (ret <0 || ret != n); +if (ret <0 || ret != n) +return -EIO ;if (n >AES_BLOCK_SIZE )memcpy (ctrblk, ctrblk + n -AES_BLOCK_SIZE ,AES_BLOCK_SIZE );
@@ -800,7 +805,8 @@ static int ctr_aes_crypt(struct blkciphe in = walk->src.virt.addr; ret =crypt_s390_kmctr (func, sctx->key, buf, in,AES_BLOCK_SIZE , ctrblk); -BUG_ON (ret <0 || ret !=AES_BLOCK_SIZE ); +if (ret <0 || ret !=AES_BLOCK_SIZE ) +return -EIO ;memcpy (out, buf, nbytes);crypto_inc (ctrblk,AES_BLOCK_SIZE ); ret =blkcipher_walk_done (desc, walk,0 );
arch/s390/crypto/des_s390.c +8 -4
@@ -95,7 +95,8 @@ static int ecb_desall_crypt(struct blkciu8 *in = walk->src.virt.addr; ret =crypt_s390_km (func, key, out, in, n); -BUG_ON ((ret <0 ) || (ret != n)); +if (ret <0 || ret != n) +return -EIO ; nbytes &=DES_BLOCK_SIZE -1 ; ret =blkcipher_walk_done (desc, walk, nbytes);
@@ -121,7 +122,8 @@ static int cbc_desall_crypt(struct blkciu8 *in = walk->src.virt.addr; ret =crypt_s390_kmc (func, iv, out, in, n); -BUG_ON ((ret <0 ) || (ret != n)); +if (ret <0 || ret != n) +return -EIO ; nbytes &=DES_BLOCK_SIZE -1 ; ret =blkcipher_walk_done (desc, walk, nbytes);
@@ -394,7 +396,8 @@ static int ctr_desall_crypt(struct blkcicrypto_inc (ctrblk + i,DES_BLOCK_SIZE ); } ret =crypt_s390_kmctr (func, ctx->key, out, in, n, ctrblk); -BUG_ON ((ret <0 ) || (ret != n)); +if (ret <0 || ret != n) +return -EIO ;if (n >DES_BLOCK_SIZE )memcpy (ctrblk, ctrblk + n -DES_BLOCK_SIZE ,DES_BLOCK_SIZE );
@@ -412,7 +415,8 @@ static int ctr_desall_crypt(struct blkci in = walk->src.virt.addr; ret =crypt_s390_kmctr (func, ctx->key, buf, in,DES_BLOCK_SIZE , ctrblk); -BUG_ON (ret <0 || ret !=DES_BLOCK_SIZE ); +if (ret <0 || ret !=DES_BLOCK_SIZE ) +return -EIO ;memcpy (out, buf, nbytes);crypto_inc (ctrblk,DES_BLOCK_SIZE ); ret =blkcipher_walk_done (desc, walk,0 );
arch/s390/crypto/ghash_s390.c +13 -8
@@ -72,14 +72,16 @@ static int ghash_update(struct shash_desif (!dctx->bytes) { ret =crypt_s390_kimd (KIMD_GHASH , ctx, buf,GHASH_BLOCK_SIZE ); -BUG_ON (ret !=GHASH_BLOCK_SIZE ); +if (ret !=GHASH_BLOCK_SIZE ) +return -EIO ; } } n = srclen & ~(GHASH_BLOCK_SIZE -1 );if (n) { ret =crypt_s390_kimd (KIMD_GHASH , ctx, src, n); -BUG_ON (ret != n); +if (ret != n) +return -EIO ; src += n; srclen -= n; }
@@ -92,7 +94,7 @@ static int ghash_update(struct shash_desreturn 0 ; } -static void ghash_flush (struct ghash_ctx *ctx,struct ghash_desc_ctx *dctx) +static int ghash_flush (struct ghash_ctx *ctx,struct ghash_desc_ctx *dctx) {u8 *buf = dctx->buffer;int ret;
@@ -103,21 +105,24 @@ static void ghash_flush(struct ghash_ctxmemset (pos,0 , dctx->bytes); ret =crypt_s390_kimd (KIMD_GHASH , ctx, buf,GHASH_BLOCK_SIZE ); -BUG_ON (ret !=GHASH_BLOCK_SIZE ); +if (ret !=GHASH_BLOCK_SIZE ) +return -EIO ; } dctx->bytes =0 ; +return 0 ; }static int ghash_final (struct shash_desc *desc,u8 *dst) {struct ghash_desc_ctx *dctx =shash_desc_ctx (desc);struct ghash_ctx *ctx =crypto_shash_ctx (desc->tfm); +int ret; -ghash_flush (ctx, dctx); -memcpy (dst, ctx->icv,GHASH_BLOCK_SIZE ); - -return 0 ; + ret =ghash_flush (ctx, dctx); +if (!ret) +memcpy (dst, ctx->icv,GHASH_BLOCK_SIZE ); +return ret; }static struct shash_alg ghash_alg = {
arch/s390/crypto/sha_common.c +6 -3
@@ -36,7 +36,8 @@ int s390_sha_update(struct shash_desc *dif (index) {memcpy (ctx->buf + index, data, bsize - index); ret =crypt_s390_kimd (ctx->func, ctx->state, ctx->buf, bsize); -BUG_ON (ret != bsize); +if (ret != bsize) +return -EIO ; data += bsize - index; len -= bsize - index; index =0 ;
@@ -46,7 +47,8 @@ int s390_sha_update(struct shash_desc *dif (len >= bsize) { ret =crypt_s390_kimd (ctx->func, ctx->state, data, len & ~(bsize -1 )); -BUG_ON (ret != (len & ~(bsize -1 ))); +if (ret != (len & ~(bsize -1 ))) +return -EIO ; data += ret; len -= ret; }
@@ -88,7 +90,8 @@ int s390_sha_final(struct shash_desc *dememcpy (ctx->buf + end -8 , &bits,sizeof (bits)); ret =crypt_s390_kimd (ctx->func, ctx->state, ctx->buf, end); -BUG_ON (ret != end); +if (ret != end) +return -EIO ;/* copy digest to out */ memcpy (out, ctx->state,crypto_shash_digestsize (desc->tfm));
PATCH 65/200 crypto: s390 - fix concurrency issue in aes-ctr mode
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Harald Freudenberger <[email protected]>
commit 0519e9ad89e5cd6e6b08398f57c6a71d9580564c upstream.
The aes-ctr mode uses one preallocated page without any concurrency protection. When multiple threads run aes-ctr encryption or decryption this can lead to data corruption.
The patch introduces locking for the page and a fallback solution with slower en/decryption performance in concurrency situations.
--- arch/s390/crypto/aes_s390.c | 65 ++++++++++++++++++++++++++++++++------------- 1 file changed, 46 insertions(+), 19 deletions(-)
arch/s390/crypto/aes_s390.c +46 -19
@@ -25,6 +25,7 @@#include <linux/err.h> #include <linux/module.h> #include <linux/init.h> +#include <linux/spinlock.h> #include "crypt_s390.h" #define AES_KEYLEN_128 1
@@ -32,6 +33,7 @@#define AES_KEYLEN_256 4static u8 *ctrblk; +static DEFINE_SPINLOCK (ctrblk_lock);static char keylen_flag;struct s390_aes_ctx {
@@ -760,43 +762,67 @@ static int ctr_aes_set_key(struct cryptoreturn aes_set_key (tfm, in_key, key_len); } +static unsigned int __ctrblk_init (u8 *ctrptr,unsigned int nbytes) +{ +unsigned int i, n; + +/* only use complete blocks, max. PAGE_SIZE */ + n = (nbytes >PAGE_SIZE ) ?PAGE_SIZE : nbytes & ~(AES_BLOCK_SIZE -1 ); +for (i =AES_BLOCK_SIZE ; i < n; i +=AES_BLOCK_SIZE ) { +memcpy (ctrptr + i, ctrptr + i -AES_BLOCK_SIZE , +AES_BLOCK_SIZE ); +crypto_inc (ctrptr + i,AES_BLOCK_SIZE ); + } +return n; +} +static int ctr_aes_crypt (struct blkcipher_desc *desc,long func,struct s390_aes_ctx *sctx,struct blkcipher_walk *walk) {int ret =blkcipher_walk_virt_block (desc, walk,AES_BLOCK_SIZE ); -unsigned int i, n, nbytes; -u8 buf[AES_BLOCK_SIZE ]; -u8 *out, *in; +unsigned int n, nbytes; +u8 buf[AES_BLOCK_SIZE ], ctrbuf[AES_BLOCK_SIZE ]; +u8 *out, *in, *ctrptr = ctrbuf;if (!walk->nbytes)return ret; -memcpy (ctrblk, walk->iv,AES_BLOCK_SIZE ); +if (spin_trylock (&ctrblk_lock)) + ctrptr = ctrblk; + +memcpy (ctrptr, walk->iv,AES_BLOCK_SIZE );while ((nbytes = walk->nbytes) >=AES_BLOCK_SIZE ) { out = walk->dst.virt.addr; in = walk->src.virt.addr;while (nbytes >=AES_BLOCK_SIZE ) { -/* only use complete blocks, max. PAGE_SIZE */ - n = (nbytes >PAGE_SIZE ) ?PAGE_SIZE : - nbytes & ~(AES_BLOCK_SIZE -1 ); -for (i =AES_BLOCK_SIZE ; i < n; i +=AES_BLOCK_SIZE ) { -memcpy (ctrblk + i, ctrblk + i -AES_BLOCK_SIZE , -AES_BLOCK_SIZE ); -crypto_inc (ctrblk + i,AES_BLOCK_SIZE ); - } - ret =crypt_s390_kmctr (func, sctx->key, out, in, n, ctrblk); -if (ret <0 || ret != n) +if (ctrptr == ctrblk) + n =__ctrblk_init (ctrptr, nbytes); +else + n =AES_BLOCK_SIZE ; + ret =crypt_s390_kmctr (func, sctx->key, out, in, + n, ctrptr); +if (ret <0 || ret != n) { +if (ctrptr == ctrblk) +spin_unlock (&ctrblk_lock);return -EIO ; + }if (n >AES_BLOCK_SIZE ) -memcpy (ctrblk, ctrblk + n -AES_BLOCK_SIZE , +memcpy (ctrptr, ctrptr + n -AES_BLOCK_SIZE ,AES_BLOCK_SIZE ); -crypto_inc (ctrblk,AES_BLOCK_SIZE ); +crypto_inc (ctrptr,AES_BLOCK_SIZE ); out += n; in += n; nbytes -= n; } ret =blkcipher_walk_done (desc, walk, nbytes); } +if (ctrptr == ctrblk) { +if (nbytes) +memcpy (ctrbuf, ctrptr,AES_BLOCK_SIZE ); +else +memcpy (walk->iv, ctrptr,AES_BLOCK_SIZE ); +spin_unlock (&ctrblk_lock); + }/* * final block may be < AES_BLOCK_SIZE, copy only nbytes */
@@ -804,14 +830,15 @@ static int ctr_aes_crypt(struct blkciphe out = walk->dst.virt.addr; in = walk->src.virt.addr; ret =crypt_s390_kmctr (func, sctx->key, buf, in, -AES_BLOCK_SIZE , ctrblk); +AES_BLOCK_SIZE , ctrbuf);if (ret <0 || ret !=AES_BLOCK_SIZE )return -EIO ;memcpy (out, buf, nbytes); -crypto_inc (ctrblk,AES_BLOCK_SIZE ); +crypto_inc (ctrbuf,AES_BLOCK_SIZE ); ret =blkcipher_walk_done (desc, walk,0 ); +memcpy (walk->iv, ctrbuf,AES_BLOCK_SIZE ); } -memcpy (walk->iv, ctrblk,AES_BLOCK_SIZE ); +return ret; }
PATCH 66/200 crypto: s390 - fix des and des3_ede cbc concurrency issue
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Harald Freudenberger <[email protected]>
commit adc3fcf1552b6e406d172fd9690bbd1395053d13 upstream.
In s390 des and des3_ede cbc mode the iv value is not protected against concurrency access and modifications from another running en/decrypt operation which is using the very same tfm struct instance. This fix copies the iv to the local stack before the crypto operation and stores the value back when done.
--- arch/s390/crypto/des_s390.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-)
arch/s390/crypto/des_s390.c +14 -12
@@ -106,29 +106,35 @@ static int ecb_desall_crypt(struct blkci }static int cbc_desall_crypt (struct blkcipher_desc *desc,long func, -u8 *iv,struct blkcipher_walk *walk) +struct blkcipher_walk *walk) { +struct s390_des_ctx *ctx =crypto_blkcipher_ctx (desc->tfm);int ret =blkcipher_walk_virt (desc, walk);unsigned int nbytes = walk->nbytes; +struct { +u8 iv[DES_BLOCK_SIZE ]; +u8 key[DES3_KEY_SIZE ]; + } param;if (!nbytes) goto out; -memcpy (iv, walk->iv,DES_BLOCK_SIZE ); +memcpy (param.iv, walk->iv,DES_BLOCK_SIZE ); +memcpy (param.key, ctx->key,DES3_KEY_SIZE );do {/* only use complete blocks */ unsigned int n = nbytes & ~(DES_BLOCK_SIZE -1 );u8 *out = walk->dst.virt.addr;u8 *in = walk->src.virt.addr; - ret =crypt_s390_kmc (func, iv, out, in, n); + ret =crypt_s390_kmc (func, ¶m, out, in, n);if (ret <0 || ret != n)return -EIO ; nbytes &=DES_BLOCK_SIZE -1 ; ret =blkcipher_walk_done (desc, walk, nbytes); }while ((nbytes = walk->nbytes)); -memcpy (walk->iv, iv,DES_BLOCK_SIZE ); +memcpy (walk->iv, param.iv,DES_BLOCK_SIZE ); out:return ret;
@@ -181,22 +187,20 @@ static int cbc_des_encrypt(struct blkcip struct scatterlist *dst, struct scatterlist *src, unsigned int nbytes) { - struct s390_des_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); struct blkcipher_walk walk;blkcipher_walk_init (&walk, dst, src, nbytes); -return cbc_desall_crypt (desc,KMC_DEA_ENCRYPT , ctx->iv, &walk); +return cbc_desall_crypt (desc,KMC_DEA_ENCRYPT , &walk); }static int cbc_des_decrypt (struct blkcipher_desc *desc,struct scatterlist *dst,struct scatterlist *src,unsigned int nbytes) { -struct s390_des_ctx *ctx =crypto_blkcipher_ctx (desc->tfm);struct blkcipher_walk walk;blkcipher_walk_init (&walk, dst, src, nbytes); -return cbc_desall_crypt (desc,KMC_DEA_DECRYPT , ctx->iv, &walk); +return cbc_desall_crypt (desc,KMC_DEA_DECRYPT , &walk); } static struct crypto_alg cbc_des_alg = {
@@ -333,22 +337,20 @@ static int cbc_des3_encrypt(struct blkci struct scatterlist *dst, struct scatterlist *src, unsigned int nbytes) { - struct s390_des_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); struct blkcipher_walk walk;blkcipher_walk_init (&walk, dst, src, nbytes); -return cbc_desall_crypt (desc,KMC_TDEA_192_ENCRYPT , ctx->iv, &walk); +return cbc_desall_crypt (desc,KMC_TDEA_192_ENCRYPT , &walk); }static int cbc_des3_decrypt (struct blkcipher_desc *desc,struct scatterlist *dst,struct scatterlist *src,unsigned int nbytes) { -struct s390_des_ctx *ctx =crypto_blkcipher_ctx (desc->tfm);struct blkcipher_walk walk;blkcipher_walk_init (&walk, dst, src, nbytes); -return cbc_desall_crypt (desc,KMC_TDEA_192_DECRYPT , ctx->iv, &walk); +return cbc_desall_crypt (desc,KMC_TDEA_192_DECRYPT , &walk); } static struct crypto_alg cbc_des3_alg = {
PATCH 67/200 crypto: s390 - fix des and des3_ede ctr concurrency issue
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Harald Freudenberger <[email protected]>
commit ee97dc7db4cbda33e4241c2d85b42d1835bc8a35 upstream.
In s390 des and 3des ctr mode there is one preallocated page used to speed up the en/decryption. This page is not protected against concurrent usage and thus there is a potential of data corruption with multiple threads.
The fix introduces locking/unlocking the ctr page and a slower fallback solution at concurrency situations.
--- arch/s390/crypto/des_s390.c | 69 +++++++++++++++++++++++++++++++-------------- 1 file changed, 48 insertions(+), 21 deletions(-)
arch/s390/crypto/des_s390.c +48 -21
@@ -25,6 +25,7 @@#define DES3_KEY_SIZE (3 * DES_KEY_SIZE)static u8 *ctrblk; +static DEFINE_SPINLOCK (ctrblk_lock);struct s390_des_ctx {u8 iv[DES_BLOCK_SIZE ];
@@ -376,54 +377,80 @@ static struct crypto_alg cbc_des3_alg = } }; +static unsigned int __ctrblk_init (u8 *ctrptr,unsigned int nbytes) +{ +unsigned int i, n; + +/* align to block size, max. PAGE_SIZE */ + n = (nbytes >PAGE_SIZE ) ?PAGE_SIZE : nbytes & ~(DES_BLOCK_SIZE -1 ); +for (i =DES_BLOCK_SIZE ; i < n; i +=DES_BLOCK_SIZE ) { +memcpy (ctrptr + i, ctrptr + i -DES_BLOCK_SIZE ,DES_BLOCK_SIZE ); +crypto_inc (ctrptr + i,DES_BLOCK_SIZE ); + } +return n; +} +static int ctr_desall_crypt (struct blkcipher_desc *desc,long func, -struct s390_des_ctx *ctx,struct blkcipher_walk *walk) +struct s390_des_ctx *ctx, +struct blkcipher_walk *walk) {int ret =blkcipher_walk_virt_block (desc, walk,DES_BLOCK_SIZE ); -unsigned int i, n, nbytes; -u8 buf[DES_BLOCK_SIZE ]; -u8 *out, *in; +unsigned int n, nbytes; +u8 buf[DES_BLOCK_SIZE ], ctrbuf[DES_BLOCK_SIZE ]; +u8 *out, *in, *ctrptr = ctrbuf; + +if (!walk->nbytes) +return ret; -memcpy (ctrblk, walk->iv,DES_BLOCK_SIZE ); +if (spin_trylock (&ctrblk_lock)) + ctrptr = ctrblk; + +memcpy (ctrptr, walk->iv,DES_BLOCK_SIZE );while ((nbytes = walk->nbytes) >=DES_BLOCK_SIZE ) { out = walk->dst.virt.addr; in = walk->src.virt.addr;while (nbytes >=DES_BLOCK_SIZE ) { -/* align to block size, max. PAGE_SIZE */ - n = (nbytes >PAGE_SIZE ) ?PAGE_SIZE : - nbytes & ~(DES_BLOCK_SIZE -1 ); -for (i =DES_BLOCK_SIZE ; i < n; i +=DES_BLOCK_SIZE ) { -memcpy (ctrblk + i, ctrblk + i -DES_BLOCK_SIZE , -DES_BLOCK_SIZE ); -crypto_inc (ctrblk + i,DES_BLOCK_SIZE ); - } - ret =crypt_s390_kmctr (func, ctx->key, out, in, n, ctrblk); -if (ret <0 || ret != n) +if (ctrptr == ctrblk) + n =__ctrblk_init (ctrptr, nbytes); +else + n =DES_BLOCK_SIZE ; + ret =crypt_s390_kmctr (func, ctx->key, out, in, + n, ctrptr); +if (ret <0 || ret != n) { +if (ctrptr == ctrblk) +spin_unlock (&ctrblk_lock);return -EIO ; + }if (n >DES_BLOCK_SIZE ) -memcpy (ctrblk, ctrblk + n -DES_BLOCK_SIZE , +memcpy (ctrptr, ctrptr + n -DES_BLOCK_SIZE ,DES_BLOCK_SIZE ); -crypto_inc (ctrblk,DES_BLOCK_SIZE ); +crypto_inc (ctrptr,DES_BLOCK_SIZE ); out += n; in += n; nbytes -= n; } ret =blkcipher_walk_done (desc, walk, nbytes); } - +if (ctrptr == ctrblk) { +if (nbytes) +memcpy (ctrbuf, ctrptr,DES_BLOCK_SIZE ); +else +memcpy (walk->iv, ctrptr,DES_BLOCK_SIZE ); +spin_unlock (&ctrblk_lock); + }/* final block may be < DES_BLOCK_SIZE, copy only nbytes */ if (nbytes) { out = walk->dst.virt.addr; in = walk->src.virt.addr; ret =crypt_s390_kmctr (func, ctx->key, buf, in, -DES_BLOCK_SIZE , ctrblk); +DES_BLOCK_SIZE , ctrbuf);if (ret <0 || ret !=DES_BLOCK_SIZE )return -EIO ;memcpy (out, buf, nbytes); -crypto_inc (ctrblk,DES_BLOCK_SIZE ); +crypto_inc (ctrbuf,DES_BLOCK_SIZE ); ret =blkcipher_walk_done (desc, walk,0 ); +memcpy (walk->iv, ctrbuf,DES_BLOCK_SIZE ); } -memcpy (walk->iv, ctrblk,DES_BLOCK_SIZE );return ret; }
PATCH 68/200 mm, oom: base root bonus on current usage
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: David Rientjes <[email protected]>
commit 778c14affaf94a9e4953179d3e13a544ccce7707 upstream.
A 3% of system memory bonus is sometimes too excessive in comparison to other processes.
With commit a63d83f427fb ("oom: badness heuristic rewrite"), the OOM killer tries to avoid killing privileged tasks by subtracting 3% of overall memory (system or cgroup) from their per-task consumption. But as a result, all root tasks that consume less than 3% of overall memory are considered equal, and so it only takes 33+ privileged tasks pushing the system out of memory for the OOM killer to do something stupid and kill dhclient or other root-owned processes. For example, on a 32G machine it can't tell the difference between the 1M agetty and the 10G fork bomb member.
The changelog describes this 3% boost as the equivalent to the global overcommit limit being 3% higher for privileged tasks, but this is not the same as discounting 3% of overall memory from _every privileged task individually_ during OOM selection.
Replace the 3% of system memory bonus with a 3% of current memory usage bonus.
By giving root tasks a bonus that is proportional to their actual size, they remain comparable even when relatively small. In the example above, the OOM killer will discount the 1M agetty's 256 badness points down to 179, and the 10G fork bomb's 262144 points down to 183500 points and make the right choice, instead of discounting both to 0 and killing agetty because it's first in the task list.
[bwh: Backported to 3.2: existing code changes 'points' directly rather
than using 'adj' variable]
--- Documentation/filesystems/proc.txt | 4 ++-- mm/oom_kill.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
Documentation/filesystems/proc.txt +2 -2
@@ -1293,8 +1293,8 @@ may allocate from based on an estimation For example, if a task is using all allowed memory, its badness score will be 1000. If it is using half of its allowed memory, its score will be 500. -There is an additional factor included in the badness score: root -processes are given 3% extra memory over other tasks. +There is an additional factor included in the badness score: the current memory +and swap usage is discounted by 3% for root processes. The amount of "allowed" memory depends on the context in which the oom killer was called. If it is due to the memory assigned to the allocating task's cpuset
mm/oom_kill.c +1 -1
@@ -213,7 +213,7 @@ unsigned int oom_badness(struct task_str* implementation used by LSMs. */ if (has_capability_noaudit (p,CAP_SYS_ADMIN )) - points -=30 ; + points -= (points *3 ) /100 ;/* * /proc/pid/oom_score_adj ranges from -1000 to +1000 such that it may
PATCH 69/200 ata: enable quirk from jmicron JMB350 for JMB394
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: "Denis V. Lunev" <[email protected]>
commit efb9e0f4f43780f0ae0c6428d66bd03e805c7539 upstream.
Without the patch the kernel generates the following error.
ata11.15: SATA link up 1.5 Gbps (SStatus 113 SControl 310) ata11.15: Port Multiplier vendor mismatch '0x197b' != '0x123' ata11.15: PMP revalidation failed (errno=-19) ata11.15: failed to recover PMP after 5 tries, giving up
This patch helps to bypass this error and the device becomes functional.
--- drivers/ata/libata-pmp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/ata/libata-pmp.c +5 -2
@@ -447,8 +447,11 @@ static void sata_pmp_quirks(struct ata_p* otherwise. Don't try hard to recover it. */ ap->pmp_link[ap->nr_pmp_links -1 ].flags |=ATA_LFLAG_NO_RETRY ; - }else if (vendor ==0x197b && devid ==0x2352 ) { -/* chip found in Thermaltake BlackX Duet, jmicron JMB350? */ + }else if (vendor ==0x197b && (devid ==0x2352 || devid ==0x0325 )) { +/* +* 0x2352: found in Thermaltake BlackX Duet, jmicron JMB350? +* 0x0325: jmicron JMB394. +*/ ata_for_each_link (link, ap,EDGE ) {/* SRST breaks detection and disks get misclassified * LPM disabled to avoid potential problems
PATCH 70/200 alpha: fix broken network checksum
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <[email protected]>
commit 0ef38d70d4118b2ce1a538d14357be5ff9dc2bbd upstream.
The patch 3ddc5b46a8e90f3c9251338b60191d0a804b0d92 breaks networking on alpha (there is a follow-up fix 5cfe8f1ba5eebe6f4b6e5858cdb1a5be4f3272a6, but networking is still broken even with the second patch).
The patch 3ddc5b46a8e90f3c9251338b60191d0a804b0d92 makes csum_partial_copy_from_user check the pointer with access_ok. However, csum_partial_copy_from_user is called also from csum_partial_copy_nocheck and csum_partial_copy_nocheck is called on kernel pointers and it is supposed not to check pointer validity.
This bug results in ssh session hangs if the system is loaded and bulk data are printed to ssh terminal.
This patch fixes csum_partial_copy_nocheck to call set_fs(KERNEL_DS), so that access_ok in csum_partial_copy_from_user accepts kernel-space addresses.
--- arch/alpha/lib/csum_partial_copy.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
arch/alpha/lib/csum_partial_copy.c +7 -2
@@ -373,6 +373,11 @@ csum_partial_copy_from_user(const void ___wsum csum_partial_copy_nocheck (const void *src,void *dst,int len,__wsum sum) { -return csum_partial_copy_from_user ((__force const void __user *)src, - dst, len, sum,NULL ); +__wsum checksum; +mm_segment_t oldfs =get_fs (); +set_fs (KERNEL_DS ); + checksum =csum_partial_copy_from_user ((__force const void __user *)src, + dst, len, sum,NULL ); +set_fs (oldfs); +return checksum; }
PATCH 71/200 power: max17040: Fix NULL pointer dereference when there is no platform_data
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
commit ac323d8d807060f7c95a685a9fe861e7b6300993 upstream.
Fix NULL pointer dereference of "chip->pdata" if platform_data was not supplied to the driver.
The driver during probe stored the pointer to the platform_data:
chip->pdata = client->dev.platform_data;
Later it was dereferenced in max17040_get_online() and max17040_get_status().
If platform_data was not supplied, the NULL pointer exception would happen:
[ 6.626094] Unable to handle kernel of a at virtual address 00000000 [ 6.628557] pgd = c0004000 [ 6.632868] [00000000] *pgd=66262564 [ 6.634636] Unable to handle kernel paging request at virtual address e6262000 [ 6.642014] pgd = de468000 [ 6.644700] [e6262000] *pgd=00000000 [ 6.648265] Internal error: Oops: 5 [#1] PREEMPT SMP ARM [ 6.653552] Modules linked in: [ 6.656598] CPU: 0 PID: 31 Comm: kworker/0:1 Not tainted 3.10.14-02717-gc58b4b4 #505 [ 6.664334] Workqueue: events max17040_work [ 6.668488] task: dfa11b80 ti: df9f6000 task.ti: df9f6000 [ 6.673873] PC is at show_pte+0x80/0xb8 [ 6.677687] LR is at show_pte+0x3c/0xb8 [ 6.681503] pc : [<c001b7b8>] lr : [<c001b774>] psr: 600f0113 [ 6.681503] sp : df9f7d58 ip : 600f0113 fp : 00000009 [ 6.692965] r10: 00000000 r9 : 00000000 r8 : dfa11b80 [ 6.698171] r7 : df9f7ea0 r6 : e6262000 r5 : 00000000 r4 : 00000000 [ 6.704680] r3 : 00000000 r2 : e6262000 r1 : 600f0193 r0 : c05b3750 [ 6.711194] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel [ 6.718485] Control: 10c53c7d Table: 5e46806a DAC: 00000015 [ 6.724218] Process kworker/0:1 (pid: 31, stack limit = 0xdf9f6238) [ 6.730465] Stack: (0xdf9f7d58 to 0xdf9f8000) [ 6.914325] [<c001b7b8>] (show_pte+0x80/0xb8) from [<c047107c>] (__do_kernel_fault.part.9+0x44/0x74) [ 6.923425] [<c047107c>] (__do_kernel_fault.part.9+0x44/0x74) from [<c001bb7c>] (do_page_fault+0x2c4/0x360) [ 6.933144] [<c001bb7c>] (do_page_fault+0x2c4/0x360) from [<c0008400>] (do_DataAbort+0x34/0x9c) [ 6.941825] [<c0008400>] (do_DataAbort+0x34/0x9c) from [<c000e5d8>] (__dabt_svc+0x38/0x60) [ 6.950058] Exception stack(0xdf9f7ea0 to 0xdf9f7ee8) [ 6.955099] 7ea0: df0c1790 00000000 00000002 00000000 df0c1794 df0c1790 df0c1790 00000042 [ 6.963271] 7ec0: df0c1794 00000001 00000000 00000009 00000000 df9f7ee8 c0306268 c0306270 [ 6.971419] 7ee0: a00f0113 ffffffff [ 6.974902] [<c000e5d8>] (__dabt_svc+0x38/0x60) from [<c0306270>] (max17040_work+0x8c/0x144) [ 6.983317] [<c0306270>] (max17040_work+0x8c/0x144) from [<c003f364>] (process_one_work+0x138/0x440) [ 6.992429] [<c003f364>] (process_one_work+0x138/0x440) from [<c003fa64>] (worker_thread+0x134/0x3b8) [ 7.001628] [<c003fa64>] (worker_thread+0x134/0x3b8) from [<c00454bc>] (kthread+0xa4/0xb0) [ 7.009875] [<c00454bc>] (kthread+0xa4/0xb0) from [<c000eb28>] (ret_from_fork+0x14/0x2c) [ 7.017943] Code: e1a03005 e2422480 e0826104 e59f002c (e7922104) [ 7.024017] ---[ end trace 73bc7006b9cc5c79 ]---
--- drivers/power/max17040_battery.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/power/max17040_battery.c +3 -2
@@ -148,7 +148,7 @@ static void max17040_get_online(struct i {struct max17040_chip *chip =i2c_get_clientdata (client); -if (chip->pdata->battery_online) +if (chip->pdata && chip->pdata->battery_online) chip->online = chip->pdata->battery_online ();else chip->online =1 ;
@@ -158,7 +158,8 @@ static void max17040_get_status(struct i {struct max17040_chip *chip =i2c_get_clientdata (client); -if (!chip->pdata->charger_online || !chip->pdata->charger_enable) { +if (!chip->pdata || !chip->pdata->charger_online + || !chip->pdata->charger_enable) { chip->status =POWER_SUPPLY_STATUS_UNKNOWN ;return ; }
PATCH 72/200 sata_sil: apply MOD15WRITE quirk to TOSHIBA MK2561GSYN
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <[email protected]>
commit 9f9c47f00ce99329b1a82e2ac4f70f0fe3db549c upstream.
It's a bit odd to see a newer device showing mod15write; however, the reported behavior is highly consistent and other factors which could contribute seem to have been verified well enough. Also, both sata_sil itself and the drive are fairly outdated at this point making the risk of this change fairly low. It is possible, probably likely, that other drive models in the same family have the same problem; however, for now, let's just add the specific model which was tested.
References: http://lkml.kernel.org/g/[email protected]
--- drivers/ata/sata_sil.c | 1 + 1 file changed, 1 insertion(+)
drivers/ata/sata_sil.c +1 -0
@@ -157,6 +157,7 @@ static const struct sil_drivelist { { "ST380011ASL", SIL_QUIRK_MOD15WRITE }, { "ST3120022ASL", SIL_QUIRK_MOD15WRITE }, { "ST3160021ASL", SIL_QUIRK_MOD15WRITE }, + { "TOSHIBA MK2561GSYN", SIL_QUIRK_MOD15WRITE }, { "Maxtor 4D060H3", SIL_QUIRK_UDMA5MAX }, { } };
PATCH 73/200 mxl111sf: Fix compile when CONFIG_DVB_USB_MXL111SF is unset
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Dave Jones <[email protected]>
commit 13e1b87c986100169b0695aeb26970943665eda9 upstream.
Fix the following build error:
drivers/media/usb/dvb-usb-v2/
mxl111sf-tuner.h:72:9: error: expected ‘;’, ‘,’ or ‘)’ before ‘struct’
struct mxl111sf_tuner_config *cfg)
--- drivers/media/dvb/dvb-usb/mxl111sf-tuner.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/dvb/dvb-usb/mxl111sf-tuner.h +1 -1
@@ -69,7 +69,7 @@ struct dvb_frontend *mxl111sf_tuner_atta#else static inline struct dvb_frontend *mxl111sf_tuner_attach (struct dvb_frontend *fe, - struct mxl111sf_state *mxl_state +struct mxl111sf_state *mxl_state,struct mxl111sf_tuner_config *cfg) {printk (KERN_WARNING "%s: driver disabled by Kconfig\n" , __func__);
PATCH 74/200 s390/dump: Fix dump memory detection
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Michael Holzheu <[email protected]>
commit d7736ff5be31edaa4fe5ab62810c64529a24b149 upstream.
Dumps created by kdump or zfcpdump can contain invalid memory holes when dumping z/VM systems that have memory pressure.
For example:
# zgetdump -i /proc/vmcore. Memory map: 0000000000000000 - 0000000000bfffff (12 MB) 0000000000e00000 - 00000000014fffff (7 MB) 000000000bd00000 - 00000000f3bfffff (3711 MB)
The memory detection function find_memory_chunks() issues tprot to find valid memory chunks. In case of CMM it can happen that pages are marked as unstable via set_page_unstable() in arch_free_page(). If z/VM has released that pages, tprot returns -EFAULT and indicates a memory hole.
So fix this and switch off CMM in case of kdump or zfcpdump.
--- arch/s390/mm/page-states.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/s390/mm/page-states.c +10 -0
@@ -12,6 +12,8 @@#include <linux/mm.h> #include <linux/gfp.h> #include <linux/init.h> +#include <asm/setup.h> +#include <asm/ipl.h> #define ESSA_SET_STABLE 1#define ESSA_SET_UNUSED 2
@@ -41,6 +43,14 @@ void __init cmma_init(void)if (!cmma_flag)return ; +/* +* Disable CMM for dump, otherwise the tprot based memory +* detection can fail because of unstable pages. +*/ +if (OLDMEM_BASE || ipl_info.type ==IPL_TYPE_FCP_DUMP ) { + cmma_flag =0 ; +return ; + } asmvolatile (" .insn rrf,0xb9ab0000,%1,%1,0,0\n" "0: la %0,0\n"
PATCH 75/200 ath9k_htc: Do not support PowerSave by default
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Oleksij Rempel <[email protected]>
commit 6bca610d97b6139a1d7598b8009da9d339daa50f upstream.
It is a copy/paste of patch provided by Sujith for ath9k.
"Even though we make sure PowerSave is not enabled by default by disabling the flag, WIPHY_FLAG_PS_ON_BY_DEFAULT on init, PS could be enabled by userspace based on various factors like battery usage etc. Since PS in ath9k is just broken and has been untested for years, remove support for it, but allow a user to explicitly enable it using a module parameter."
--- drivers/net/wireless/ath/ath9k/htc_drv_init.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/htc_drv_init.c +7 -1
@@ -28,6 +28,10 @@ int htc_modparam_nohwcrypt;module_param_named (nohwcrypt, htc_modparam_nohwcrypt, int,0444 );MODULE_PARM_DESC (nohwcrypt,"Disable hardware encryption" ); +static int ath9k_ps_enable; +module_param_named (ps_enable, ath9k_ps_enable, int,0444 ); +MODULE_PARM_DESC (ps_enable,"Enable WLAN PowerSave" ); +#define CHAN2G (_freq, _idx) { \ .center_freq = (_freq), \ .hw_value = (_idx), \
@@ -729,11 +733,13 @@ static void ath9k_set_hw_capab(struct atIEEE80211_HW_SPECTRUM_MGMT |IEEE80211_HW_HAS_RATE_CONTROL |IEEE80211_HW_RX_INCLUDES_FCS | -IEEE80211_HW_SUPPORTS_PS |IEEE80211_HW_PS_NULLFUNC_STACK |IEEE80211_HW_REPORTS_TX_ACK_STATUS |IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING ; +if (ath9k_ps_enable) + hw->flags |=IEEE80211_HW_SUPPORTS_PS ; + hw->wiphy->interface_modes =BIT (NL80211_IFTYPE_STATION ) | BIT(NL80211_IFTYPE_ADHOC) |
PATCH 76/200 ath9k: Do not support PowerSave by default
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Sujith Manoharan <[email protected]>
commit 8298383c2cd5a6d0639f1bb1781fba181bd20154 upstream.
Even though we make sure PowerSave is not enabled by default by disabling the flag, WIPHY_FLAG_PS_ON_BY_DEFAULT on init, PS could be enabled by userspace based on various factors like battery usage etc. Since PS in ath9k is just broken and has been untested for years, remove support for it, but allow a user to explicitly enable it using a module parameter.
--- drivers/net/wireless/ath/ath9k/init.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/init.c +7 -1
@@ -44,6 +44,10 @@ static int ath9k_btcoex_enable;module_param_named (btcoex_enable, ath9k_btcoex_enable, int,0444 );MODULE_PARM_DESC (btcoex_enable,"Enable wifi-BT coexistence" ); +static int ath9k_ps_enable; +module_param_named (ps_enable, ath9k_ps_enable, int,0444 ); +MODULE_PARM_DESC (ps_enable,"Enable WLAN PowerSave" ); +bool is_ath9k_unloaded;/* We use the hw_value as an index into our private channel structure */
@@ -671,11 +675,13 @@ void ath9k_set_hw_capab(struct ath_softc hw->flags =IEEE80211_HW_RX_INCLUDES_FCS |IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING |IEEE80211_HW_SIGNAL_DBM | -IEEE80211_HW_SUPPORTS_PS |IEEE80211_HW_PS_NULLFUNC_STACK |IEEE80211_HW_SPECTRUM_MGMT |IEEE80211_HW_REPORTS_TX_ACK_STATUS ; +if (ath9k_ps_enable) + hw->flags |=IEEE80211_HW_SUPPORTS_PS ; +if (sc->sc_ah->caps.hw_caps &ATH9K_HW_CAP_HT ) hw->flags |=IEEE80211_HW_AMPDU_AGGREGATION ;
PATCH 77/200 usb: ftdi_sio: add Mindstorms EV3 console adapter
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Bjørn Mork <[email protected]>
commit 67847baee056892dc35efb9c3fd05ae7f075588c upstream.
--- drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio_ids.h | 1 + 2 files changed, 2 insertions(+)
drivers/usb/serial/ftdi_sio.c +1 -0
@@ -163,6 +163,7 @@ static struct usb_device_id id_table_com { USB_DEVICE(FTDI_VID, FTDI_CANUSB_PID) }, { USB_DEVICE(FTDI_VID, FTDI_CANDAPTER_PID) }, { USB_DEVICE(FTDI_VID, FTDI_NXTCAM_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_EV3CON_PID) }, { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_0_PID) }, { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_1_PID) }, { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_2_PID) },
drivers/usb/serial/ftdi_sio_ids.h +1 -0
@@ -50,6 +50,7 @@#define TI_XDS100V2_PID 0xa6d0#define FTDI_NXTCAM_PID 0xABB8/* NXTCam for Mindstorms NXT */ +#define FTDI_EV3CON_PID 0xABB9/* Mindstorms EV3 Console Adapter */ /* US Interface Navigator (http://www.usinterface.com/) */ #define FTDI_USINT_CAT_PID 0xb810/* Navigator CAT and 2nd PTT lines */
PATCH 78/200 usb-storage: restrict bcdDevice range for Super Top in Cypress ATACB
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit a9c143c82608bee2a36410caa56d82cd86bdc7fa upstream.
The Cypress ATACB unusual-devs entry for the Super Top SATA bridge causes problems. Although it was originally reported only for bcdDevice = 0x160, its range was much larger. This resulted in a bug report for bcdDevice 0x220, so the range was capped at 0x219. Now Milan reports errors with bcdDevice 0x150.
Therefore this patch restricts the range to just 0x160.
--- drivers/usb/storage/unusual_cypress.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/storage/unusual_cypress.h +1 -1
@@ -31,7 +31,7 @@ UNUSUAL_DEV( 0x04b4, 0x6831, 0x0000, 0x "Cypress ISD-300LP", USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0), -UNUSUAL_DEV (0x14cd ,0x6116 ,0x0000 ,0x0219 , +UNUSUAL_DEV (0x14cd ,0x6116 ,0x0160 ,0x0160 ,"Super Top" ,"USB 2.0 SATA BRIDGE" , USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0),
PATCH 79/200 usb-storage: add unusual-devs entry for BlackBerry 9000
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit c5637e5119c43452a00e27c274356b072263ecbb upstream.
This patch adds an unusual-devs entry for the BlackBerry 9000. This fixes Bugzilla #22442.
--- drivers/usb/storage/unusual_devs.h | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/usb/storage/unusual_devs.h +7 -0
@@ -1441,6 +1441,13 @@ UNUSUAL_DEV( 0x0f88, 0x042e, 0x0100, 0x0 USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_FIX_CAPACITY ), +/* Reported by Moritz Moeller-Herrmann <[email protected]> */ +UNUSUAL_DEV (0x0fca ,0x8004 ,0x0201 ,0x0201 , +"Research In Motion" , +"BlackBerry Bold 9000" , +USB_SC_DEVICE ,USB_PR_DEVICE ,NULL , +US_FL_MAX_SECTORS_64 ), +/* Reported by Michael Stattmann <[email protected]> */ UNUSUAL_DEV( 0x0fce, 0xd008, 0x0000, 0x0000, "Sony Ericsson",
PATCH 80/200 usb-storage: enable multi-LUN scanning when needed
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit 823d12c95c666fa7ab7dad208d735f6bc6afabdc upstream.
People sometimes create their own custom-configured kernels and forget to enable CONFIG_SCSI_MULTI_LUN. This causes problems when they plug in a USB storage device (such as a card reader) with more than one LUN.
Fortunately, we can tell fairly easily when a storage device claims to have more than one LUN. When that happens, this patch asks the SCSI layer to probe all the LUNs automatically, regardless of the config setting.
The patch also updates the Kconfig help text for usb-storage, explaining that CONFIG_SCSI_MULTI_LUN may be necessary.
[bwh: Backported to 3.2:
- Adjust context
- slave_alloc() already has a us_data pointer]
---
drivers/usb/storage/Kconfig +3 -1
@@ -19,7 +19,9 @@ config USB_STORAGE This option depends on 'SCSI' support being enabled, but you probably also need 'SCSI device support: SCSI disk support' - (BLK_DEV_SD) for most USB storage devices. + (BLK_DEV_SD) for most USB storage devices. Some devices also + will require 'Probe all LUNs on each SCSI device' + (SCSI_MULTI_LUN). To compile this driver as a module, choose M here: the module will be called usb-storage.
drivers/usb/storage/scsiglue.c +4 -0
@@ -116,6 +116,10 @@ static int slave_alloc (struct scsi_deviif (us->subclass ==USB_SC_UFI ) sdev->sdev_target->pdt_1f_for_no_lun =1 ; +/* Tell the SCSI layer if we know there is more than one LUN */ +if (us->protocol ==USB_PR_BULK && us->max_lun >0 ) + sdev->sdev_bflags |=BLIST_FORCELUN ; +return 0 ; }
PATCH 81/200 ALSA: hda/realtek - Avoid invalid COEFs for ALC271X
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit d3c56568f43807135f2c2a09582a69f809f0d8b7 upstream.
We've seen often problems after suspend/resume on Acer Aspire One AO725 with ALC271X codec as reported in kernel bugzilla, and it turned out that some COEFs doesn't work and triggers the codec communication stall.
Since these magic COEF setups are specific to ALC269VB for some PLL configurations, the machine works even without these manual adjustment. So, let's simply avoid applying them for ALC271X.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=52181
--- sound/pci/hda/patch_realtek.c | 3 +++ 1 file changed, 3 insertions(+)
sound/pci/hda/patch_realtek.c +3 -0
@@ -5157,6 +5157,9 @@ static int alc269_fill_coef(struct hda_cif (spec->codec_variant !=ALC269_TYPE_ALC269VB )return 0 ; +/* ALC271X doesn't seem to support these COEFs (bko#52181) */ +if (!strcmp (codec->chip_name,"ALC271X" )) +return 0 ;if ((alc_get_coef0 (codec) &0x00ff ) <0x015 ) {alc_write_coef_idx (codec,0xf ,0x960b );
PATCH 82/200 of: Fix address decoding on Bimini and js2x machines
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Herrenschmidt <[email protected]>
commit 6dd18e4684f3d188277bbbc27545248487472108 upstream.
Commit:
e38c0a1fbc5803cbacdaac0557c70ac8ca5152e7
of/address: Handle #address-cells > 2 specially
broke real time clock access on Bimini, js2x, and similar powerpc machines using the "maple" platform. That code was indirectly relying on the old (broken) behaviour of the translation for the hypertransport to ISA bridge.
This fixes it by treating hypertransport as a PCI bus
--- drivers/of/address.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/of/address.c +6 -2
@@ -97,8 +97,12 @@ static unsigned int of_bus_default_get_fstatic int of_bus_pci_match (struct device_node *np) { -/* "vci" is for the /chaos bridge on 1st-gen PCI powermacs */ -return !strcmp (np->type,"pci" ) || !strcmp (np->type,"vci" ); +/* +* "vci" is for the /chaos bridge on 1st-gen PCI powermacs +* "ht" is hypertransport +*/ +return !strcmp (np->type,"pci" ) || !strcmp (np->type,"vci" ) || + !strcmp (np->type,"ht" ); } static void of_bus_pci_count_cells(struct device_node *np,
PATCH 83/200 of: fix PCI bus match for PCIe slots
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Kleber Sacilotto de Souza <[email protected]>
commit 14e2abb732e485ee57d9d5b2cb8884652238e5c1 upstream.
On IBM pseries systems the device_type device-tree property of a PCIe bridge contains the string "pciex". The of_bus_pci_match() function was looking only for "pci" on this property, so in such cases the bus matching code was falling back to the default bus, causing problems on functions that should be using "assigned-addresses" for region address translation. This patch fixes the problem by also looking for "pciex" on the PCI bus match function.
v2: added comment
--- drivers/of/address.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/of/address.c +3 -2
@@ -98,11 +98,12 @@ static unsigned int of_bus_default_get_fstatic int of_bus_pci_match (struct device_node *np) {/* +* "pciex" is PCI Express * "vci" is for the /chaos bridge on 1st-gen PCI powermacs * "ht" is hypertransport */ -return !strcmp (np->type,"pci" ) || !strcmp (np->type,"vci" ) || - !strcmp (np->type,"ht" ); +return !strcmp (np->type,"pci" ) || !strcmp (np->type,"pciex" ) || + !strcmp (np->type,"vci" ) || !strcmp (np->type,"ht" ); } static void of_bus_pci_count_cells(struct device_node *np,
PATCH 84/200 SELinux: Fix kernel BUG on empty security contexts.
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Smalley <[email protected]>
commit 2172fa709ab32ca60e86179dc67d0857be8e2c98 upstream.
Setting an empty security context (length=0) on a file will lead to incorrectly dereferencing the type and other fields of the security context structure, yielding a kernel BUG. As a zero-length security context is never valid, just reject all such security contexts whether coming from userspace via setxattr or coming from the filesystem upon a getxattr request by SELinux.
Setting a security context value (empty or otherwise) unknown to SELinux in the first place is only possible for a root process (CAP_MAC_ADMIN), and, if running SELinux in enforcing mode, only if the corresponding SELinux mac_admin permission is also granted to the domain by policy. In Fedora policies, this is only allowed for specific domains such as livecd for setting down security contexts that are not defined in the build host policy.
Reproducer:
su
setenforce 0
touch foo
setfattr -n security.selinux foo
Caveat:
Relabeling or removing foo after doing the above may not be possible without booting with SELinux disabled. Any subsequent access to foo after doing the above will also trigger the BUG.
BUG output from Matthew Thode:
[ 473.893141] ------------[ cut here ]------------ [ 473.962110] kernel BUG at security/selinux/ss/services.c:654! [ 473.995314] invalid opcode: 0000 [#6] SMP [ 474.027196] Modules linked in: [ 474.058118] CPU: 0 PID: 8138 Comm: ls Tainted: G D I 3.13.0-grsec #1 [ 474.116637] Hardware name: Supermicro X8ST3/X8ST3, BIOS 2.0 07/29/10 [ 474.149768] task: ffff8805f50cd010 ti: ffff8805f50cd488 task.ti: ffff8805f50cd488 [ 474.183707] RIP: 0010:[<ffffffff814681c7>] [<ffffffff814681c7>] context_struct_compute_av+0xce/0x308 [ 474.219954] RSP: 0018:ffff8805c0ac3c38 EFLAGS: 00010246 [ 474.252253] RAX: 0000000000000000 RBX: ffff8805c0ac3d94 RCX: 0000000000000100 [ 474.287018] RDX: ffff8805e8aac000 RSI: 00000000ffffffff RDI: ffff8805e8aaa000 [ 474.321199] RBP: ffff8805c0ac3cb8 R08: 0000000000000010 R09: 0000000000000006 [ 474.357446] R10: 0000000000000000 R11: ffff8805c567a000 R12: 0000000000000006 [ 474.419191] R13: ffff8805c2b74e88 R14: 00000000000001da R15: 0000000000000000 [ 474.453816] FS: 00007f2e75220800(0000) GS:ffff88061fc00000(0000) knlGS:0000000000000000 [ 474.489254] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 474.522215] CR2: 00007f2e74716090 CR3: 00000005c085e000 CR4: 00000000000207f0 [ 474.556058] Stack: [ 474.584325] ffff8805c0ac3c98 ffffffff811b549b ffff8805c0ac3c98 ffff8805f1190a40 [ 474.618913] ffff8805a6202f08 ffff8805c2b74e88 00068800d0464990 ffff8805e8aac860 [ 474.653955] ffff8805c0ac3cb8 000700068113833a ffff880606c75060 ffff8805c0ac3d94 [ 474.690461] Call Trace: [ 474.723779] [<ffffffff811b549b>] ? lookup_fast+0x1cd/0x22a [ 474.778049] [<ffffffff81468824>] security_compute_av+0xf4/0x20b [ 474.811398] [<ffffffff8196f419>] avc_compute_av+0x2a/0x179 [ 474.843813] [<ffffffff8145727b>] avc_has_perm+0x45/0xf4 [ 474.875694] [<ffffffff81457d0e>] inode_has_perm+0x2a/0x31 [ 474.907370] [<ffffffff81457e76>] selinux_inode_getattr+0x3c/0x3e [ 474.938726] [<ffffffff81455cf6>] security_inode_getattr+0x1b/0x22 [ 474.970036] [<ffffffff811b057d>] vfs_getattr+0x19/0x2d [ 475.000618] [<ffffffff811b05e5>] vfs_fstatat+0x54/0x91 [ 475.030402] [<ffffffff811b063b>] vfs_lstat+0x19/0x1b [ 475.061097] [<ffffffff811b077e>] SyS_newlstat+0x15/0x30 [ 475.094595] [<ffffffff8113c5c1>] ? __audit_syscall_entry+0xa1/0xc3 [ 475.148405] [<ffffffff8197791e>] system_call_fastpath+0x16/0x1b [ 475.179201] Code: 00 48 85 c0 48 89 45 b8 75 02 0f 0b 48 8b 45 a0 48 8b 3d 45 d0 b6 00 8b 40 08 89 c6 ff ce e8 d1 b0 06 00 48 85 c0 49 89 c7 75 02 <0f> 0b 48 8b 45 b8 4c 8b 28 eb 1e 49 8d 7d 08 be 80 01 00 00 e8 [ 475.255884] RIP [<ffffffff814681c7>] context_struct_compute_av+0xce/0x308 [ 475.296120] RSP <ffff8805c0ac3c38> [ 475.328734] ---[ end trace f076482e9d754adc ]---
--- security/selinux/ss/services.c | 4 ++++ 1 file changed, 4 insertions(+)
security/selinux/ss/services.c +4 -0
@@ -1229,6 +1229,10 @@ static int security_context_to_sid_core(struct context context;int rc =0 ; +/* An empty security context is never valid. */ +if (!scontext_len) +return -EINVAL ; +if (!ss_initialized) {int i;
PATCH 85/200 USB: ftdi_sio: add Tagsys RFID Reader IDs
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Ulrich Hahn <[email protected]>
commit 76f24e3f39a1a94bab0d54e98899d64abcd9f69c upstream.
Adding two more IDs to the ftdi_sio usb serial driver. It now connects Tagsys RFID readers.
There might be more IDs out there for other Tagsys models.
--- drivers/usb/serial/ftdi_sio.c | 2 ++ drivers/usb/serial/ftdi_sio_ids.h | 6 ++++++ 2 files changed, 8 insertions(+)
drivers/usb/serial/ftdi_sio.c +2 -0
@@ -203,6 +203,8 @@ static struct usb_device_id id_table_com { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) }, { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) }, + { USB_DEVICE(FTDI_VID, FTDI_TAGSYS_LP101_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_TAGSYS_P200X_PID) }, { USB_DEVICE(FTDI_VID, FTDI_LENZ_LIUSB_PID) }, { USB_DEVICE(FTDI_VID, FTDI_XF_632_PID) }, { USB_DEVICE(FTDI_VID, FTDI_XF_634_PID) },
drivers/usb/serial/ftdi_sio_ids.h +6 -0
@@ -364,6 +364,12 @@/* Sprog II (Andrew Crosland's SprogII DCC interface) */ #define FTDI_SPROG_II 0xF0C8 +/* +* Two of the Tagsys RFID Readers +*/ +#define FTDI_TAGSYS_LP101_PID 0xF0E9/* Tagsys L-P101 RFID*/ +#define FTDI_TAGSYS_P200X_PID 0xF0EE/* Tagsys Medio P200x RFID*/ +/* an infrared receiver for user access control with IR tags */ #define FTDI_PIEGROUP_PID 0xF208/* Product Id */
PATCH 86/200 mac80211: fix fragmentation code, particularly for encryption
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
commit 338f977f4eb441e69bb9a46eaa0ac715c931a67f upstream.
The "new" fragmentation code (since my rewrite almost 5 years ago) erroneously sets skb->len rather than using skb_trim() to adjust the length of the first fragment after copying out all the others. This leaves the skb tail pointer pointing to after where the data originally ended, and thus causes the encryption MIC to be written at that point, rather than where it belongs: immediately after the data.
The impact of this is that if software encryption is done, then
a) encryption doesn't work for the first fragment, the connection becomes unusable as the first fragment will never be properly verified at the receiver, the MIC is practically guaranteed to be wrong
b) we leak up to 8 bytes of plaintext (!) of the packet out into the air
This is only mitigated by the fact that many devices are capable of doing encryption in hardware, in which case this can't happen as the tail pointer is irrelevant in that case. Additionally, fragmentation is not used very frequently and would normally have to be configured manually.
Fix this by using skb_trim() properly.
--- net/mac80211/tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/tx.c +1 -1
@@ -884,7 +884,7 @@ static int ieee80211_fragment(struct iee pos += fraglen; } - skb->len = hdrlen + per_fragm; +skb_trim (skb, hdrlen + per_fragm);return 0 ; }
PATCH 87/200 time: Fix overflow when HZ is smaller than 60
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <[email protected]>
commit 80d767d770fd9c697e434fd080c2db7b5c60c6dd upstream.
When compiling for the IA-64 ski emulator, HZ is set to 32 because the emulation is slow and we don't want to waste too many cycles processing timers. Alpha also has an option to set HZ to 32.
This causes integer underflow inkernel/time/jiffies.c:kernel/time/jiffies.c:66:2: warning: large integer implicitly truncated to unsigned type [-Woverflow]
.mult = NSEC_PER_JIFFY << JIFFIES_SHIFT, /* details above */
^
This patch reduces the JIFFIES_SHIFT value to avoid the overflow.
--- kernel/time/jiffies.c | 6 ++++++ 1 file changed, 6 insertions(+)
kernel/time/jiffies.c +6 -0
@@ -51,7 +51,13 @@* HZ shrinks, so values greater than 8 overflow 32bits when * HZ=100. */ +#if HZ <34 +#define JIFFIES_SHIFT 6 +#elif HZ <67 +#define JIFFIES_SHIFT 7 +#else #define JIFFIES_SHIFT 8 +#endif static cycle_t jiffies_read (struct clocksource *cs) {
PATCH 88/200 x86, hweight: Fix BUG when booting with CONFIG_GCOV_PROFILE_ALL=y
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Peter Oberparleiter <[email protected]>
commit 6583327c4dd55acbbf2a6f25e775b28b3abf9a42 upstream.
Commit d61931d89b, "x86: Add optimized popcnt variants" introduced compile flag -fcall-saved-rdi for lib/hweight.c. When combined with options -fprofile-arcs and -O2, this flag causes gcc to generate broken constructor code. As a result, a 64 bit x86 kernel compiled with CONFIG_GCOV_PROFILE_ALL=y prints message "gcov: could not create file" and runs into sproadic BUGs during boot.
The gcc people indicate that these kinds of problems are endemic when using ad hoc calling conventions. It is therefore best to treat any file compiled with ad hoc calling conventions as an isolated environment and avoid things like profiling or coverage analysis, since those subsystems assume a "normal" calling conventions.
This patch avoids the bug by excluding lib/hweight.o from coverage profiling.
--- lib/Makefile | 1 + 1 file changed, 1 insertion(+)
lib/Makefile +1 -0
@@ -40,6 +40,7 @@ obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock lib-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o +GCOV_PROFILE_hweight.o := n CFLAGS_hweight.o = $(subst $(quote),,$(CONFIG_ARCH_HWEIGHT_CFLAGS)) obj-$(CONFIG_GENERIC_HWEIGHT) += hweight.o
PATCH 89/200 mm/swap: fix race on swap_info reuse between swapoff and swapon
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Weijie Yang <[email protected]>
commit f893ab41e4dae2fe8991faf5d86d029068d1ef3a upstream.
swapoff clear swap_info's SWP_USED flag prematurely and free its resources after that. A concurrent swapon will reuse this swap_info while its previous resources are not cleared completely.
These late freed resources are:
- p->percpu_cluster
- swap_cgroup_ctrl[type]
- block_device setting
- inode->i_flags &= ~S_SWAPFILE
This patch clears the SWP_USED flag after all its resources are freed, so that swapon can reuse this swap_info by alloc_swap_info() safely.
--- mm/swapfile.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
mm/swapfile.c +10 -1
@@ -1649,7 +1649,6 @@ SYSCALL_DEFINE1(swapoff, const char __us p->max =0 ; swap_map = p->swap_map; p->swap_map =NULL ; - p->flags =0 ;spin_unlock (&swap_lock);mutex_unlock (&swapon_mutex);vfree (swap_map);
@@ -1667,6 +1666,16 @@ SYSCALL_DEFINE1(swapoff, const char __usmutex_unlock (&inode->i_mutex); }filp_close (swap_file,NULL ); + +/* +* Clear the SWP_USED flag after all resources are freed so that swapon +* can reuse this swap_info in alloc_swap_info() safely. It is ok to +* not hold p->lock after we cleared its SWP_WRITEOK. +*/ +spin_lock (&swap_lock); + p->flags =0 ; +spin_unlock (&swap_lock); + err =0 ;atomic_inc (&proc_poll_event);wake_up_interruptible (&proc_poll_wait);
PATCH 90/200 mm: __set_page_dirty_nobuffers() uses spin_lock_irqsave() instead of spin_lock_irq()
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: KOSAKI Motohiro <[email protected]>
commit a85d9df1ea1d23682a0ed1e100e6965006595d06 upstream.
During aio stress test, we observed the following lockdep warning. This mean AIO+numa_balancing is currently deadlockable.
The problem is, aio_migratepage disable interrupt, but __set_page_dirty_nobuffers unintentionally enable it again.
Generally, all helper function should use spin_lock_irqsave() instead of spin_lock_irq() because they don't know caller at all.
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(&(&ctx->completion_lock)->rlock);
<Interrupt>
lock(&(&ctx->completion_lock)->rlock);
*** DEADLOCK ***
dump_stack+0x19/0x1b
print_usage_bug+0x1f7/0x208
mark_lock+0x21d/0x2a0
mark_held_locks+0xb9/0x140
trace_hardirqs_on_caller+0x105/0x1d0
trace_hardirqs_on+0xd/0x10
_raw_spin_unlock_irq+0x2c/0x50
__set_page_dirty_nobuffers+0x8c/0xf0
migrate_page_copy+0x434/0x540
aio_migratepage+0xb1/0x140
move_to_new_page+0x7d/0x230
migrate_pages+0x5e5/0x700
migrate_misplaced_page+0xbc/0xf0
do_numa_page+0x102/0x190
handle_pte_fault+0x241/0x970
handle_mm_fault+0x265/0x370
__do_page_fault+0x172/0x5a0
do_page_fault+0x1a/0x70
page_fault+0x28/0x30--- mm/page-writeback.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
mm/page-writeback.c +3 -2
@@ -1776,11 +1776,12 @@ int __set_page_dirty_nobuffers(struct paif (!TestSetPageDirty (page)) {struct address_space *mapping =page_mapping (page);struct address_space *mapping2; +unsigned long flags;if (!mapping)return 1 ; -spin_lock_irq (&mapping->tree_lock); +spin_lock_irqsave (&mapping->tree_lock, flags); mapping2 =page_mapping (page);if (mapping2) {/* Race with truncate? */ BUG_ON (mapping2 != mapping);
@@ -1789,7 +1790,7 @@ int __set_page_dirty_nobuffers(struct paradix_tree_tag_set (&mapping->page_tree,page_index (page),PAGECACHE_TAG_DIRTY ); } -spin_unlock_irq (&mapping->tree_lock); +spin_unlock_irqrestore (&mapping->tree_lock, flags);if (mapping->host) {/* !PageAnon && !swapper_space */ __mark_inode_dirty (mapping->host,I_DIRTY_PAGES );
PATCH 91/200 mm: __set_page_dirty uses spin_lock_irqsave instead of spin_lock_irq
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: KOSAKI Motohiro <[email protected]>
commit 227d53b397a32a7614667b3ecaf1d89902fb6c12 upstream.
To use spin_{un}lock_irq is dangerous if caller disabled interrupt. During aio buffer migration, we have a possibility to see the following call stack.
aio_migratepage [disable interrupt]
migrate_page_copy
clear_page_dirty_for_io
set_page_dirty
__set_page_dirty_buffers
__set_page_dirty
spin_lock_irq
This mean, current aio migration is a deadlockable. spin_lock_irqsave is a safer alternative and we should use it.
--- fs/buffer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/buffer.c +4 -2
@@ -663,14 +663,16 @@ EXPORT_SYMBOL(mark_buffer_dirty_inode);static void __set_page_dirty (struct page *page,struct address_space *mapping,int warn) { -spin_lock_irq (&mapping->tree_lock); +unsigned long flags; + +spin_lock_irqsave (&mapping->tree_lock, flags);if (page->mapping) {/* Race with truncate? */ WARN_ON_ONCE (warn && !PageUptodate (page));account_page_dirtied (page, mapping);radix_tree_tag_set (&mapping->page_tree,page_index (page),PAGECACHE_TAG_DIRTY ); } -spin_unlock_irq (&mapping->tree_lock); +spin_unlock_irqrestore (&mapping->tree_lock, flags);__mark_inode_dirty (mapping->host,I_DIRTY_PAGES ); }
PATCH 92/200 Drivers: hv: vmbus: Don't timeout during the initial connection with host
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: "K. Y. Srinivasan" <[email protected]>
commit 269f979467cf49f2ea8132316c1f00f8c9678f7c upstream.
When the guest attempts to connect with the host when there may already be a connection with the host (as would be the case during the kdump/kexec path), it is difficult to guarantee timely response from the host. Starting with WS2012 R2, the host supports this ability to re-connect with the host (explicitly to support kexec). Prior to responding to the guest, the host needs to ensure that device states based on the previous connection to the host have been properly torn down. This may introduce unbounded delays. To deal with this issue, don't do a timed wait during the initial connect with the host.
--- drivers/hv/connection.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
drivers/hv/connection.c +1 -11
@@ -45,7 +45,6 @@ struct vmbus_connection vmbus_connectionint vmbus_connect (void ) {int ret =0 ; -int t;struct vmbus_channel_msginfo *msginfo =NULL ;struct vmbus_channel_initiate_contact *msg;unsigned long flags;
@@ -132,16 +131,7 @@ int vmbus_connect(void) }/* Wait for the connection response */ - t =wait_for_completion_timeout (&msginfo->waitevent,5 *HZ ); -if (t ==0 ) { -spin_lock_irqsave (&vmbus_connection.channelmsg_lock, - flags); -list_del (&msginfo->msglistentry); -spin_unlock_irqrestore (&vmbus_connection.channelmsg_lock, - flags); - ret = -ETIMEDOUT ; - goto cleanup; - } +wait_for_completion (&msginfo->waitevent);spin_lock_irqsave (&vmbus_connection.channelmsg_lock, flags);list_del (&msginfo->msglistentry);
PATCH 93/200 raw: test against runtime value of max_raw_minors
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Paul Bolle <[email protected]>
commit 5bbb2ae3d6f896f8d2082d1eceb6131c2420b7cf upstream.
bind_get() checks the device number it is called with. It uses MAX_RAW_MINORS for the upper bound. But MAX_RAW_MINORS is set at compile time while the actual number of raw devices can be set at runtime. This means the test can either be too strict or too lenient. And if the test ends up being too lenient bind_get() might try to access memory beyond what was allocated for "raw_devices".
So check against the runtime value (max_raw_minors) in this function.
--- drivers/char/raw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/raw.c +1 -1
@@ -190,7 +190,7 @@ static int bind_get(int number, dev_t *dstruct raw_device_data *rawdev;struct block_device *bdev; -if (number <=0 || number >=MAX_RAW_MINORS ) +if (number <=0 || number >= max_raw_minors)return -EINVAL ; rawdev = &raw_devices[number];
PATCH 94/200 tty: n_gsm: Fix for modems with brk in modem status control
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Lars Poeschel <[email protected]>
commit 3ac06b905655b3ef2fd2196bab36e4587e1e4e4f upstream.
3GPP TS 07.10 states in section 5.4.6.3.7:
"The length byte contains the value 2 or 3 ... depending on the break signal." The break byte is optional and if it is sent, the length is
3. In fact the driver was not able to work with modems that send this break byte in their modem status control message. If the modem just sends the break byte if it is really set, then weird things might happen.
The code for deconding the modem status to the internal linux presentation in gsm_process_modem has already a big comment about this 2 or 3 byte length thing and it is already able to decode the brk, but the code calling the gsm_process_modem function in gsm_control_modem does not encode it and hand it over the right way. This patch fixes this.
Without this fix if the modem sends the brk byte in it's modem status control message the driver will hang when opening a muxed channel.
--- drivers/tty/n_gsm.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/tty/n_gsm.c +11 -0
@@ -1090,6 +1090,7 @@ static void gsm_control_modem(struct gsm {unsigned int addr =0 ;unsigned int modem =0 ; +unsigned int brk =0 ;struct gsm_dlci *dlci;int len = clen;u8 *dp = data;
@@ -1116,6 +1117,16 @@ static void gsm_control_modem(struct gsmif (len ==0 )return ; } + len--; +if (len >0 ) { +while (gsm_read_ea (&brk, *dp++) ==0 ) { + len--; +if (len ==0 ) +return ; + } + modem <<=7 ; + modem |= (brk &0x7f ); + } tty =tty_port_tty_get (&dlci->port);gsm_process_modem (tty, dlci, modem, clen);if (tty) {
PATCH 95/200 staging: comedi: adv_pci1710: fix analog output readback value
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: H Hartley Sweeten <[email protected]>
commit 1e85c1ea1ff2a60659e790ef8ec76c7339445841 upstream.
The last value written to a analog output channel is cached in the private data of this driver for readback.
Currently, the wrong value is cached in the (*insn_write) functions. The current code stores the data[n] value for readback afer the loop has written all the values. At this time 'n' points past the end of the data array.
Fix the functions by using a local variable to hold the data being written to the analog output channel. This variable is then used after the loop is complete to store the readback value. The current value is retrieved before the loop in case no values are actually written..
--- drivers/staging/comedi/drivers/adv_pci1710.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
drivers/staging/comedi/drivers/adv_pci1710.c +12 -5
@@ -414,6 +414,7 @@ static int pci171x_insn_write_ao(structstruct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) { + unsigned int val;int n, chan, range, ofs; chan =CR_CHAN (insn->chanspec);
@@ -429,11 +430,14 @@ static int pci171x_insn_write_ao(structoutw (devpriv->da_ranges, dev->iobase + PCI171x_DAREF); ofs = PCI171x_DA1; } + val = devpriv->ao_data[chan]; -for (n =0 ; n < insn->n; n++) -outw (data[n], dev->iobase + ofs); +for (n =0 ; n < insn->n; n++) { + val = data[n]; +outw (val, dev->iobase + ofs); + } - devpriv->ao_data[chan] = data[n]; + devpriv->ao_data[chan] = val;return n;
@@ -582,6 +586,7 @@ static int pci1720_insn_write_ao(structstruct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) { + unsigned int val;int n, rangereg, chan; chan =CR_CHAN (insn->chanspec);
@@ -591,13 +596,15 @@ static int pci1720_insn_write_ao(structoutb (rangereg, dev->iobase +PCI1720_RANGE ); devpriv->da_ranges = rangereg; } + val = devpriv->ao_data[chan];for (n =0 ; n < insn->n; n++) { -outw (data[n], dev->iobase +PCI1720_DA0 + (chan <<1 )); + val = data[n]; +outw (val, dev->iobase +PCI1720_DA0 + (chan <<1 ));outb (0 , dev->iobase +PCI1720_SYNCOUT );/* update outputs */ } - devpriv->ao_data[chan] = data[n]; + devpriv->ao_data[chan] = val;return n; }
PATCH 96/200 xen-blkfront: handle backend CLOSED without CLOSING
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: David Vrabel <[email protected]>
commit 3661371701e714f0cea4120f6a365340858fb4e4 upstream.
Backend drivers shouldn't transistion to CLOSED unless the frontend is CLOSED. If a backend does transition to CLOSED too soon then the frontend may not see the CLOSING state and will not properly shutdown.
So, treat an unexpected backend CLOSED state the same as CLOSING.
--- drivers/block/xen-blkfront.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/block/xen-blkfront.c +4 -1
@@ -1281,13 +1281,16 @@ static void blkback_changed(struct xenbucase XenbusStateReconfiguring:case XenbusStateReconfigured:case XenbusStateUnknown: -case XenbusStateClosed:break ;case XenbusStateConnected:blkfront_connect (info);break ; +case XenbusStateClosed: +if (dev->state == XenbusStateClosed) +break ; +/* Missed the backend's Closing state -- fallthrough */ case XenbusStateClosing:blkfront_closing (info);break ;
PATCH 97/200 Modpost: fixed USB alias generation for ranges including 0x9 and 0xA
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Jan Moskyto Matejka <[email protected]>
commit 03b56329f9bb5a1cb73d7dc659d529a9a9bf3acc upstream.
Commit afe2dab4f6 ("USB: add hex/bcd detection to usb modalias generation") changed the routine that generates alias ranges. Before that change, only digits 0-9 were supported; the commit tried to fix the case when the range includes higher values than 0x9.
Unfortunately, the commit didn't fix the case when the range includes both 0x9 and 0xA, meaning that the final range must look like [x-9A-y] where x <= 0x9 and y >= 0xA -- instead the [x-9A-x] range was produced.
Modprobe doesn't complain as it sees no difference between no-match and bad-pattern results of fnmatch().
Fixing this simple bug to fix the aliases.
Also changing the hardcoded beginning of the range to uppercase as all the other letters are also uppercase in the device version numbers.
Fortunately, this affects only the dvb-usb-dib0700 module, AFAIK.
--- scripts/mod/file2alias.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/mod/file2alias.c +2 -2
@@ -130,8 +130,8 @@ static void do_usb_entry(struct usb_devi range_lo <0x9 ?"[%X-9" :"[%X" , range_lo);sprintf (alias +strlen (alias), - range_hi >0xA ?"a-%X]" :"%X]" , - range_lo); + range_hi >0xA ?"A-%X]" :"%X]" , + range_hi); } }if (bcdDevice_initial_digits < (sizeof (id->bcdDevice_lo) *2 -1 ))
PATCH 98/200 ARM: 7953/1: mm: ensure TLB invalidation is complete before enabling MMU
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <[email protected]>
commit bae0ca2bc550d1ec6a118fb8f2696f18c4da3d8e upstream.
During __v{6,7}_setup, we invalidate the TLBs since we are about to enable the MMU on return to head.S. Unfortunately, without a subsequent dsb instruction, the invalidation is not guaranteed to have completed by the time we write to the sctlr, potentially exposing us to junk/stale translations cached in the TLB.
This patch reworks the init functions so that the dsb used to ensure completion of cache/predictor maintenance is also used to ensure completion of the TLB invalidation.
--- arch/arm/mm/proc-v6.S | 3 ++- arch/arm/mm/proc-v7.S | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
arch/arm/mm/proc-v6.S +2 -1
@@ -199,7 +199,6 @@ __v6_setup: mcr p15, 0, r0, c7, c14, 0 @ clean+invalidate D cache mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache mcr p15, 0, r0, c7, c15, 0 @ clean+invalidate cache - mcr p15, 0, r0, c7, c10, 4 @ drain write buffer #ifdef CONFIG_MMU mcr p15, 0, r0, c8, c7, 0 @ invalidate I + D TLBs mcr p15, 0, r0, c2, c0, 2 @ TTB control register
@@ -209,6 +208,8 @@ __v6_setup: ALT_UP(orr r8, r8, #TTB_FLAGS_UP) mcr p15, 0, r8, c2, c0, 1 @ load TTB1 #endif /* CONFIG_MMU */ + mcr p15, 0, r0, c7, c10, 4 @ drain write buffer and + @ complete invalidations adr r5, v6_crval ldmia r5, {r5, r6} #ifdef CONFIG_CPU_ENDIAN_BE8
arch/arm/mm/proc-v7.S +1 -1
@@ -368,7 +368,6 @@ __v7_setup: 3: mov r10, #0 mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate - dsb #ifdef CONFIG_MMU mcr p15, 0, r10, c8, c7, 0 @ invalidate I + D TLBs mcr p15, 0, r10, c2, c0, 2 @ TTB control register
@@ -382,6 +381,7 @@ __v7_setup: mcr p15, 0, r5, c10, c2, 0 @ write PRRR mcr p15, 0, r6, c10, c2, 1 @ write NMRR #endif + dsb @ Complete invalidations #ifndef CONFIG_ARM_THUMBEE mrc p15, 0, r0, c0, c1, 0 @ read ID_PFR0 for ThumbEE and r0, r0, #(0xf << 12) @ ThumbEE enabled field
PATCH 99/200 ARM: 7955/1: spinlock: ensure we have a compiler barrier before sev
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <[email protected]>
commit 7c8746a9eb287642deaad0e7c2cdf482dce5e4be upstream.
When unlocking a spinlock, we require the following, strictly ordered sequence of events:
<barrier> /* dmb */ <unlock> <barrier> /* dsb */ <sev>
Whilst the code does indeed reflect this in terms of the architecture, the final <barrier> + <sev> have been contracted into a single inline asm without a "memory" clobber, therefore the compiler is at liberty to reorder the unlock to the end of the above sequence. In such a case, a waiting CPU may be woken up before the lock has been unlocked, leading to extremely poor performance.
This patch reworks the dsb_sev() function to make use of the dsb() macro and ensure ordering against the unlock.
--- arch/arm/include/asm/spinlock.h | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-)
arch/arm/include/asm/spinlock.h +3 -12
@@ -44,18 +44,9 @@static inline void dsb_sev (void ) { -#if __LINUX_ARM_ARCH__ >=7 - __asm__ __volatile__ ( -"dsb\n" -SEV - ); -#else - __asm__ __volatile__ ( -"mcr p15, 0, %0, c7, c10, 4\n" -SEV - : :"r" (0 ) - ); -#endif + +dsb (); + __asm__(SEV); }/*
PATCH 100/200 fs/file.c:fdtable: avoid triggering OOMs from alloc_fdmem
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: "Eric W. Biederman" <[email protected]>
commit 96c7a2ff21501691587e1ae969b83cbec8b78e08 upstream.
Recently due to a spike in connections per second memcached on 3 separate boxes triggered the OOM killer from accept. At the time the OOM killer was triggered there was 4GB out of 36GB free in zone 1. The problem was that alloc_fdtable was allocating an order 3 page (32KiB) to hold a bitmap, and there was sufficient fragmentation that the largest page available was 8KiB.
I find the logic that PAGE_ALLOC_COSTLY_ORDER can't fail pretty dubious but I do agree that order 3 allocations are very likely to succeed.
There are always pathologies where order > 0 allocations can fail when there are copious amounts of free memory available. Using the pigeon hole principle it is easy to show that it requires 1 page more than 50% of the pages being free to guarantee an order 1 (8KiB) allocation will succeed, 1 page more than 75% of the pages being free to guarantee an order 2 (16KiB) allocation will succeed and 1 page more than 87.5% of the pages being free to guarantee an order 3 allocate will succeed.
A server churning memory with a lot of small requests and replies like memcached is a common case that if anything can will skew the odds against large pages being available.
Therefore let's not give external applications a practical way to kill linux server applications, and specify __GFP_NORETRY to the kmalloc in alloc_fdmem. Unless I am misreading the code and by the time the code reaches should_alloc_retry in __alloc_pages_slowpath (where __GFP_NORETRY becomes signification). We have already tried everything reasonable to allocate a page and the only thing left to do is wait. So not waiting and falling back to vmalloc immediately seems like the reasonable thing to do even if there wasn't a chance of triggering the OOM killer.
--- fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/file.c +1 -1
@@ -47,7 +47,7 @@ static void *alloc_fdmem(unsigned int si* vmalloc() if the allocation size will be considered "large" by the VM. */ if (size <= (PAGE_SIZE <<PAGE_ALLOC_COSTLY_ORDER )) { -void *data =kmalloc (size,GFP_KERNEL |__GFP_NOWARN); +void *data =kmalloc (size,GFP_KERNEL |__GFP_NOWARN|__GFP_NORETRY);if (data !=NULL )return data; }
PATCH 101/200 SUNRPC: Fix races in xs_nospace()
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
commit 06ea0bfe6e6043cb56a78935a19f6f8ebc636226 upstream.
When a send failure occurs due to the socket being out of buffer space, we call xs_nospace() in order to have the RPC task wait until the socket has drained enough to make it worth while trying again. The current patch fixes a race in which the socket is drained before we get round to setting up the machinery in xs_nospace(), and which is reported to cause hangs.
--- net/sunrpc/xprtsock.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
net/sunrpc/xprtsock.c +5 -1
@@ -501,6 +501,7 @@ static int xs_nospace(struct rpc_task *tstruct rpc_rqst *req = task->tk_rqstp;struct rpc_xprt *xprt = req->rq_xprt; struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); +struct sock *sk = transport->inet;int ret = -EAGAIN ; dprintk("RPC: %5u xmit incomplete (%u left of %u)\n",
@@ -518,7 +519,7 @@ static int xs_nospace(struct rpc_task *t* window size */ set_bit (SOCK_NOSPACE , &transport->sock->flags); - transport->inet->sk_write_pending++; + sk->sk_write_pending++;/* ...and wait for more buffer space */ xprt_wait_for_buffer_space (task, xs_nospace_callback); }
@@ -528,6 +529,9 @@ static int xs_nospace(struct rpc_task *t }spin_unlock_bh (&xprt->transport_lock); + +/* Race breaker in case memory is freed before above code is called */ + sk->sk_write_space (sk);return ret; }
PATCH 102/200 xen: install xen/gntdev.h and xen/gntalloc.h
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: David Vrabel <[email protected]>
commit 564eb714f5f09ac733c26860d5f0831f213fbdf1 upstream.
xen/gntdev.h and xen/gntalloc.h both provide userspace ABIs so they should be installed.
---
include/xen/Kbuild +2 -0
@@ -1,2 +1,4 @@ header-y += evtchn.h +header-y += gntalloc.h +header-y += gntdev.h header-y += privcmd.h
PATCH 103/200 ring-buffer: Fix first commit on sub-buffer having non-zero delta
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: "Steven Rostedt (Red Hat)" <[email protected]>
commit d651aa1d68a2f0a7ee65697b04c6a92f8c0a12f2 upstream.
Each sub-buffer (buffer page) has a full 64 bit timestamp. The events on that page use a 27 bit delta against that timestamp in order to save on bits written to the ring buffer. If the time between events is larger than what the 27 bits can hold, a "time extend" event is added to hold the entire 64 bit timestamp again and the events after that hold a delta from that timestamp.
As a "time extend" is always paired with an event, it is logical to just allocate the event with the time extend, to make things a bit more efficient.
Unfortunately, when the pairing code was written, it removed the "delta = 0" from the first commit on a page, causing the events on the page to be slightly skewed.
--- kernel/trace/ring_buffer.c | 7 +++++++ 1 file changed, 7 insertions(+)
kernel/trace/ring_buffer.c +7 -0
@@ -2040,6 +2040,13 @@ __rb_reserve_next(struct ring_buffer_per write &=RB_WRITE_MASK ; tail = write - length; +/* +* If this is the first commit on the page, then it has the same +* timestamp as the page itself. +*/ +if (!tail) + delta =0 ; +/* See if we shot pass the end of this buffer page */ if (unlikely (write >BUF_PAGE_SIZE )) return rb_move_tail(cpu_buffer, length, tail,
PATCH 104/200 drm/i915: Add intel_ring_cachline_align()
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Ville Syrjälä <[email protected]>
commit 753b1ad4a281b0663329409d410243e91825c323 upstream.
intel_ring_cachline_align() emits MI_NOOPs until the ring tail is aligned to a cacheline boundary.
--- drivers/gpu/drm/i915/intel_ringbuffer.c | 21 +++++++++++++++++++++ drivers/gpu/drm/i915/intel_ringbuffer.h | 1 + 2 files changed, 22 insertions(+)
drivers/gpu/drm/i915/intel_ringbuffer.c +21 -0
@@ -1213,6 +1213,27 @@ int intel_ring_begin(struct intel_ring_breturn 0 ; } +/* Align the ring tail to a cacheline boundary */ +int intel_ring_cacheline_align (struct intel_ring_buffer *ring) +{ +int num_dwords = (64 - (ring->tail &63 )) /sizeof (uint32_t ); +int ret; + +if (num_dwords ==0 ) +return 0 ; + + ret =intel_ring_begin (ring, num_dwords); +if (ret) +return ret; + +while (num_dwords--) +intel_ring_emit (ring,MI_NOOP ); + +intel_ring_advance (ring); + +return 0 ; +} +void intel_ring_advance (struct intel_ring_buffer *ring) { ring->tail &= ring->size -1 ;
drivers/gpu/drm/i915/intel_ringbuffer.h +1 -0
@@ -174,6 +174,7 @@ static inline int intel_wait_ring_idle(s }int __must_check intel_ring_begin (struct intel_ring_buffer *ring,int n); +int __must_check intel_ring_cacheline_align (struct intel_ring_buffer *ring);static inline void intel_ring_emit (struct intel_ring_buffer *ring,u32 data)
PATCH 105/200 drm/i915: Prevent MI_DISPLAY_FLIP straddling two cachelines on IVB
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Ville Syrjälä <[email protected]>
commit f66fab8e1cd6b3127ba4c5c0d11539fbe1de1e36 upstream.
According to BSpec the entire MI_DISPLAY_FLIP packet must be contained in a single cacheline. Make sure that happens.
v2: Use intel_ring_begin_cacheline_safe()
v3: Use intel_ring_cacheline_align() (Chris)
Cc: Bjoern C <[email protected]>
Cc: Alexandru DAMIAN <[email protected]>
Cc: Enrico Tagliavini <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74053
--- drivers/gpu/drm/i915/intel_display.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/gpu/drm/i915/intel_display.c +14 -0
@@ -7252,6 +7252,20 @@ static int intel_gen7_queue_flip(struct goto err_unpin; } +/* +* BSpec MI_DISPLAY_FLIP for IVB: +* "The full packet must be contained within the same cache line." +* +* Currently the LRI+SRM+MI_DISPLAY_FLIP all fit within the same +* cacheline, if we ever start emitting more commands before +* the MI_DISPLAY_FLIP we may need to first emit everything else, +* then do the cacheline alignment, and finally emit the +* MI_DISPLAY_FLIP. +*/ + ret =intel_ring_cacheline_align (ring); +if (ret) + goto err_unpin; + ret =intel_ring_begin (ring,4 );if (ret) goto err_unpin;
PATCH 106/200 usb: option: blacklist ZTE MF667 net interface
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Raymond Wanyoike <[email protected]>
commit 3635c7e2d59f7861afa6fa5e87e2a58860ff514d upstream.
Interface #5 of 19d2:1270 is a net interface which has been submitted to the qmi_wwan driver so consequently remove it from the option driver.
--- drivers/usb/serial/option.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/serial/option.c +2 -1
@@ -1376,7 +1376,8 @@ static const struct usb_device_id option { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1267, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1268, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1269, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1270, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1270, 0xff, 0xff, 0xff), + .driver_info = (kernel_ulong_t)&net_intf5_blacklist }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1271, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1272, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1273, 0xff, 0xff, 0xff) },
PATCH 107/200 block: add cond_resched() to potentially long running ioctl discard loop
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <[email protected]>
commit c8123f8c9cb517403b51aa41c3c46ff5e10b2c17 upstream.
When mkfs issues a full device discard and the device only supports discards of a smallish size, we can loop in blkdev_issue_discard() for a long time. If preempt isn't enabled, this can turn into a softlock situation and the kernel will start complaining.
Add an explicit cond_resched() at the end of the loop to avoid that.
--- block/blk-lib.c | 8 ++++++++ 1 file changed, 8 insertions(+)
block/blk-lib.c +8 -0
@@ -101,6 +101,14 @@ int blkdev_issue_discard(struct block_deatomic_inc (&bb.done);submit_bio (type, bio); + +/* +* We can loop for a long time in here, if someone does +* full device discards (like mkfs). Be nice and allow +* us to schedule out to avoid softlocking if preempt +* is disabled. +*/ +cond_resched (); }/* Wait for bios in-flight */
PATCH 108/200 md/raid5: Fix CPU hotplug callback registration
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Oleg Nesterov <[email protected]>
commit 789b5e0315284463617e106baad360cb9e8db3ac upstream.
Subsystems that want to register CPU hotplug callbacks, as well as perform initialization for the CPUs that are already online, often do it as shown below:
get_online_cpus(); for_each_online_cpu(cpu) init_cpu(cpu); register_cpu_notifier(&foobar_cpu_notifier); put_online_cpus();
This is wrong, since it is prone to ABBA deadlocks involving the cpu_add_remove_lock and the cpu_hotplug.lock (when running concurrently with CPU hotplug operations).
Interestingly, the raid5 code can actually prevent double initialization and hence can use the following simplified form of callback registration:
register_cpu_notifier(&foobar_cpu_notifier); get_online_cpus(); for_each_online_cpu(cpu) init_cpu(cpu); put_online_cpus();
A hotplug operation that occurs between registering the notifier and calling get_online_cpus(), won't disrupt anything, because the code takes care to perform the memory allocations only once.
So reorganize the code in raid5 this way to fix the deadlock with callback registration.
[Srivatsa: Fixed the unregister_cpu_notifier() deadlock, added the free_scratch_buffer() helper to condense code further and wrote the changelog.]
--- drivers/md/raid5.c | 90 ++++++++++++++++++++++++++---------------------------- 1 file changed, 44 insertions(+), 46 deletions(-)
drivers/md/raid5.c +44 -46
@@ -4450,23 +4450,43 @@ raid5_size(struct mddev *mddev, sector_treturn sectors * (raid_disks - conf->max_degraded); } +static void free_scratch_buffer (struct r5conf *conf,struct raid5_percpu *percpu) +{ +safe_put_page (percpu->spare_page); +kfree (percpu->scribble); + percpu->spare_page =NULL ; + percpu->scribble =NULL ; +} + +static int alloc_scratch_buffer (struct r5conf *conf,struct raid5_percpu *percpu) +{ +if (conf->level ==6 && !percpu->spare_page) + percpu->spare_page =alloc_page (GFP_KERNEL ); +if (!percpu->scribble) + percpu->scribble =kmalloc (conf->scribble_len,GFP_KERNEL ); + +if (!percpu->scribble || (conf->level ==6 && !percpu->spare_page)) { +free_scratch_buffer (conf, percpu); +return -ENOMEM ; + } + +return 0 ; +} +static void raid5_free_percpu (struct r5conf *conf) { -struct raid5_percpu *percpu;unsigned long cpu;if (!conf->percpu)return ; -get_online_cpus (); -for_each_possible_cpu (cpu) { - percpu =per_cpu_ptr (conf->percpu, cpu); -safe_put_page (percpu->spare_page); -kfree (percpu->scribble); - }#ifdef CONFIG_HOTPLUG_CPU unregister_cpu_notifier (&conf->cpu_notify);#endif + +get_online_cpus (); +for_each_possible_cpu (cpu) +free_scratch_buffer (conf,per_cpu_ptr (conf->percpu, cpu));put_online_cpus ();free_percpu (conf->percpu);
@@ -4492,15 +4512,7 @@ static int raid456_cpu_notify(struct notswitch (action) {case CPU_UP_PREPARE :case CPU_UP_PREPARE_FROZEN : -if (conf->level ==6 && !percpu->spare_page) - percpu->spare_page =alloc_page (GFP_KERNEL ); -if (!percpu->scribble) - percpu->scribble =kmalloc (conf->scribble_len,GFP_KERNEL ); - -if (!percpu->scribble || - (conf->level ==6 && !percpu->spare_page)) { -safe_put_page (percpu->spare_page); -kfree (percpu->scribble); +if (alloc_scratch_buffer (conf, percpu)) {pr_err ("%s: failed memory allocation for cpu%ld\n" , __func__, cpu);return notifier_from_errno (-ENOMEM );
@@ -4508,10 +4520,7 @@ static int raid456_cpu_notify(struct notbreak ;case CPU_DEAD :case CPU_DEAD_FROZEN : -safe_put_page (percpu->spare_page); -kfree (percpu->scribble); - percpu->spare_page =NULL ; - percpu->scribble =NULL ; +free_scratch_buffer (conf,per_cpu_ptr (conf->percpu, cpu));break ;default :break ;
@@ -4523,40 +4532,29 @@ static int raid456_cpu_notify(struct notstatic int raid5_alloc_percpu (struct r5conf *conf) {unsigned long cpu; -struct page *spare_page; -struct raid5_percpu __percpu *allcpus; -void *scribble; -int err; +int err =0 ; - allcpus = alloc_percpu(struct raid5_percpu); -if (!allcpus) + conf->percpu = alloc_percpu(struct raid5_percpu); +if (!conf->percpu)return -ENOMEM ; - conf->percpu = allcpus; + +#ifdef CONFIG_HOTPLUG_CPU + conf->cpu_notify.notifier_call = raid456_cpu_notify; + conf->cpu_notify.priority =0 ; + err =register_cpu_notifier (&conf->cpu_notify); +if (err) +return err; +#endif get_online_cpus (); - err =0 ;for_each_present_cpu (cpu) { -if (conf->level ==6 ) { - spare_page =alloc_page (GFP_KERNEL ); -if (!spare_page) { - err = -ENOMEM ; -break ; - } -per_cpu_ptr (conf->percpu, cpu)->spare_page = spare_page; - } - scribble =kmalloc (conf->scribble_len,GFP_KERNEL ); -if (!scribble) { - err = -ENOMEM ; + err =alloc_scratch_buffer (conf,per_cpu_ptr (conf->percpu, cpu)); +if (err) { +pr_err ("%s: failed memory allocation for cpu%ld\n" , + __func__, cpu);break ; } -per_cpu_ptr (conf->percpu, cpu)->scribble = scribble; } -#ifdef CONFIG_HOTPLUG_CPU - conf->cpu_notify.notifier_call = raid456_cpu_notify; - conf->cpu_notify.priority =0 ; -if (err ==0 ) - err =register_cpu_notifier (&conf->cpu_notify); -#endif put_online_cpus ();return err;
PATCH 109/200 compiler/gcc4: Make quirk for asm_volatile_goto() unconditional
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Steven Noonan <[email protected]>
commit a9f180345f5378ac87d80ed0bea55ba421d83859 upstream.
I started noticing problems with KVM guest destruction on Linux 3.12+, where guest memory wasn't being cleaned up. I bisected it down to the commit introducing the new 'asm goto'-based atomics, and found this quirk was later applied to those.
Unfortunately, even with GCC 4.8.2 (which ostensibly fixed the known 'asm goto' bug) I am still getting some kind of miscompilation. If I enable the asm_volatile_goto quirk for my compiler, KVM guests are destroyed correctly and the memory is cleaned up.
So make the quirk unconditional for now, until bug is found and fixed.
--- include/linux/compiler-gcc4.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
include/linux/compiler-gcc4.h +1 -5
@@ -39,11 +39,7 @@* * (asm goto is automatically volatile - the naming reflects this.) */ -#if GCC_VERSION <=40801 -# define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) -#else -# define asm_volatile_goto(x...) do { asm goto(x); } while (0) -#endif +#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)#if __GNUC_MINOR__ >=5 /*
PATCH 110/200 drm/i915/dp: increase native aux defer retry timeout
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Jani Nikula <[email protected]>
commit 04eada25d1f72efdecd32d702706594f81de65d5 upstream.
Give more slack to sink devices before retrying on native aux defer. AFAICT the 100 us timeout was not based on the DP spec.
--- drivers/gpu/drm/i915/intel_dp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +2 -2
@@ -500,7 +500,7 @@ intel_dp_aux_native_write(struct intel_dif ((ack &AUX_NATIVE_REPLY_MASK ) ==AUX_NATIVE_REPLY_ACK )break ;else if ((ack &AUX_NATIVE_REPLY_MASK ) ==AUX_NATIVE_REPLY_DEFER ) -udelay (100 ); +usleep_range (400 ,500 );else return -EIO ; }
@@ -549,7 +549,7 @@ intel_dp_aux_native_read(struct intel_dpreturn ret -1 ; }else if ((ack &AUX_NATIVE_REPLY_MASK ) ==AUX_NATIVE_REPLY_DEFER ) -udelay (100 ); +usleep_range (400 ,500 );else return -EIO ; }
PATCH 111/200 drm/i915/dp: add native aux defer retry limit
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Jani Nikula <[email protected]>
commit f51a44b9a6c4982cc25bfb3727de9bb893621ebc upstream.
Retrying indefinitely places too much trust on the aux implementation of the sink devices.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71267
--- drivers/gpu/drm/i915/intel_dp.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +11 -4
@@ -483,6 +483,7 @@ intel_dp_aux_native_write(struct intel_duint8_t msg[20 ];int msg_bytes;uint8_t ack; +int retry;intel_dp_check_edp (intel_dp);if (send_bytes >16 )
@@ -493,18 +494,20 @@ intel_dp_aux_native_write(struct intel_d msg[3 ] = send_bytes -1 ;memcpy (&msg[4 ], send, send_bytes); msg_bytes = send_bytes +4 ; -for (;;) { +for (retry =0 ; retry <7 ; retry++) { ret =intel_dp_aux_ch (intel_dp, msg, msg_bytes, &ack,1 );if (ret <0 )return ret;if ((ack &AUX_NATIVE_REPLY_MASK ) ==AUX_NATIVE_REPLY_ACK ) -break ; +return send_bytes;else if ((ack &AUX_NATIVE_REPLY_MASK ) ==AUX_NATIVE_REPLY_DEFER )usleep_range (400 ,500 );else return -EIO ; } -return send_bytes; + +DRM_ERROR ("too many retries, giving up\n" ); +return -EIO ; }/* Write a single byte to the aux channel in native mode */
@@ -526,6 +529,7 @@ intel_dp_aux_native_read(struct intel_dpint reply_bytes;uint8_t ack;int ret; +int retry;intel_dp_check_edp (intel_dp); msg[0 ] =AUX_NATIVE_READ <<4 ;
@@ -536,7 +540,7 @@ intel_dp_aux_native_read(struct intel_dp msg_bytes =4 ; reply_bytes = recv_bytes +1 ; -for (;;) { +for (retry =0 ; retry <7 ; retry++) { ret =intel_dp_aux_ch (intel_dp, msg, msg_bytes, reply, reply_bytes);if (ret ==0 )
@@ -553,6 +557,9 @@ intel_dp_aux_native_read(struct intel_dpelse return -EIO ; } + +DRM_ERROR ("too many retries, giving up\n" ); +return -EIO ; } static int
PATCH 112/200 lockd: send correct lock when granting a delayed lock.
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: NeilBrown <[email protected]>
commit 2ec197db1a56c9269d75e965f14c344b58b2a4f6 upstream.
If an NFS client attempts to get a lock (using NLM) and the lock is not available, the server will remember the request and when the lock becomes available it will send a GRANT request to the client to provide the lock.
If the client already held an adjacent lock, the GRANT callback will report the union of the existing and new locks, which can confuse the client.
This happens because __posix_lock_file (called by vfs_lock_file) updates the passed-in file_lock structure when adjacent or over-lapping locks are found.
To avoid this problem we take a copy of the two fields that can be changed (fl_start and fl_end) before the call and restore them afterwards.
An alternate would be to allocate a 'struct file_lock', initialise it, use locks_copy_lock() to take a copy, then locks_release_private() after the vfs_lock_file() call. But that is a lot more work.
--
v1 had a couple of issues (large on-stack struct and didn't really work properly). This version is much better tested.
--- fs/lockd/svclock.c | 8 ++++++++ 1 file changed, 8 insertions(+)
fs/lockd/svclock.c +8 -0
@@ -741,6 +741,7 @@ nlmsvc_grant_blocked(struct nlm_block *bstruct nlm_file *file = block->b_file;struct nlm_lock *lock = &block->b_call->a_args.lock;int error; +loff_t fl_start, fl_end;dprintk ("lockd: grant blocked lock %p\n" , block);
@@ -758,9 +759,16 @@ nlmsvc_grant_blocked(struct nlm_block *b }/* Try the lock operation again */ +/* vfs_lock_file() can mangle fl_start and fl_end, but we need +* them unchanged for the GRANT_MSG +*/ lock->fl.fl_flags |=FL_SLEEP ; + fl_start = lock->fl.fl_start; + fl_end = lock->fl.fl_end; error =vfs_lock_file (file->f_file,F_SETLK , &lock->fl,NULL ); lock->fl.fl_flags &= ~FL_SLEEP ; + lock->fl.fl_start = fl_start; + lock->fl.fl_end = fl_end;switch (error) {case 0 :
PATCH 113/200 rtlwifi: rtl8192ce: Fix too long disable of IRQs
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Olivier Langlois <[email protected]>
commit f78bccd79ba3cd9d9664981b501d57bdb81ab8a4 upstream.
rtl8192ce is disabling for too long the local interrupts during hw initiatialisation when performing scans
The observable symptoms in dmesg can be:
- underruns from ALSA playback
- clock freezes (tstamps do not change for several dmesg entries until irqs are finaly reenabled):
[ 250.817669] rtlwifi:rtl_op_config():<0-0-0> 0x100 [ 250.817685] rtl8192ce:_rtl92ce_phy_set_rf_power_state():<0-1-0> IPS Set eRf nic enable [ 250.817732] rtl8192ce:_rtl92ce_init_mac():<0-1-0> reg0xec:18051d59:11 [ 250.817796] rtl8192ce:_rtl92ce_init_mac():<0-1-0> reg0xec:18051d59:11 [ 250.817910] rtl8192ce:_rtl92ce_init_mac():<0-1-0> reg0xec:18051d59:11 [ 250.818024] rtl8192ce:_rtl92ce_init_mac():<0-1-0> reg0xec:18051d59:11 [ 250.818139] rtl8192ce:_rtl92ce_init_mac():<0-1-0> reg0xec:18051d59:11 [ 250.818253] rtl8192ce:_rtl92ce_init_mac():<0-1-0> reg0xec:18051d59:11 [ 250.818367] rtl8192ce:_rtl92ce_init_mac():<0-1-0> reg0xec:18051d59:11 [ 250.818472] rtl8192ce:_rtl92ce_init_mac():<0-1-0> reg0xec:18051d59:11 [ 250.818472] rtl8192ce:_rtl92ce_init_mac():<0-1-0> reg0xec:18051d59:11 [ 250.818472] rtl8192ce:_rtl92ce_init_mac():<0-1-0> reg0xec:18051d59:11 [ 250.818472] rtl8192ce:_rtl92ce_init_mac():<0-1-0> reg0xec:18051d59:11 [ 250.818472] rtl8192ce:_rtl92ce_init_mac():<0-1-0> reg0xec:98053f15:10 [ 250.818472] rtl8192ce:rtl92ce_sw_led_on():<0-1-0> LedAddr:4E ledpin=1 [ 250.818472] rtl8192c_common:rtl92c_download_fw():<0-1-0> Firmware Version(49), Signature(0x88c1),Size(32) [ 250.818472] rtl8192ce:rtl92ce_enable_hw_security_config():<0-1-0> PairwiseEncAlgorithm = 0 GroupEncAlgorithm = 0 [ 250.818472] rtl8192ce:rtl92ce_enable_hw_security_config():<0-1-0> The SECR-value cc [ 250.818472] rtl8192c_common:rtl92c_dm_check_txpower_tracking_thermal_meter():<0-1-0> Schedule TxPowerTracking direct call!! [ 250.818472] rtl8192c_common:rtl92c_dm_txpower_tracking_callback_thermalmeter():<0-1-0> rtl92c_dm_txpower_tracking_callback_thermalmeter [ 250.818472] rtl8192c_common:rtl92c_dm_txpower_tracking_callback_thermalmeter():<0-1-0> Readback Thermal Meter = 0xe pre thermal meter 0xf eeprom_thermalmeter 0xf [ 250.818472] rtl8192c_common:rtl92c_dm_txpower_tracking_callback_thermalmeter():<0-1-0> Initial pathA ele_d reg0xc80 = 0x40000000, ofdm_index=0xc [ 250.818472] rtl8192c_common:rtl92c_dm_txpower_tracking_callback_thermalmeter():<0-1-0> Initial reg0xa24 = 0x90e1317, cck_index=0xc, ch14 0 [ 250.818472] rtl8192c_common:rtl92c_dm_txpower_tracking_callback_thermalmeter():<0-1-0> Readback Thermal Meter = 0xe pre thermal meter 0xf eeprom_thermalmeter 0xf delta 0x1 delta_lck 0x0 delta_iqk 0x0 [ 250.818472] rtl8192c_common:rtl92c_dm_txpower_tracking_callback_thermalmeter():<0-1-0> <=== [ 250.818472] rtl8192c_common:rtl92c_dm_initialize_txpower_tracking_thermalmeter():<0-1-0> pMgntInfo->txpower_tracking = 1 [ 250.818472] rtl8192ce:rtl92ce_led_control():<0-1-0> ledaction 3 [ 250.818472] rtl8192ce:rtl92ce_sw_led_on():<0-1-0> LedAddr:4E ledpin=1 [ 250.818472] rtlwifi:rtl_ips_nic_on():<0-1-0> before spin_unlock_irqrestore [ 251.154656] PCM: Lost interrupts? [Q]-0 (stream=0, delta=15903, new_hw_ptr=293408, old_hw_ptr=277505)
The exact code flow that causes that is:
1. wpa_supplicant send a start_scan request to the nl80211 driver
2. mac80211 module call rtl_op_config with IEEE80211_CONF_CHANGE_IDLE
3. rtl_ips_nic_on is called which disable local irqs
4. rtl92c_phy_set_rf_power_state() is called
5. rtl_ps_enable_nic() is called and hw_init()is executed and then the interrupts on the device are enabled
A good solution could be to refactor the code to avoid calling rtl92ce_hw_init() with the irqs disabled but a quick and dirty solution that has proven to work is
to reenable the irqs during the function rtl92ce_hw_init().
I think that it is safe doing so since the device interrupt will only be enabled after the init function succeed.
--- drivers/net/wireless/rtlwifi/rtl8192ce/hw.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
drivers/net/wireless/rtlwifi/rtl8192ce/hw.c +16 -2
@@ -905,14 +905,26 @@ int rtl92ce_hw_init(struct ieee80211_hwbool is92c;int err;u8 tmp_u1b; +unsigned long flags; rtlpci->being_init_adapter = true; + +/* Since this function can take a very long time (up to 350 ms) +* and can be called with irqs disabled, reenable the irqs +* to let the other devices continue being serviced. +* +* It is safe doing so since our own interrupts will only be enabled +* in a subsequent step. +*/ +local_save_flags (flags); +local_irq_enable (); + rtlpriv->intf_ops->disable_aspm (hw); rtstatus =_rtl92ce_init_mac (hw);if (rtstatus != true) {RT_TRACE (rtlpriv,COMP_ERR ,DBG_EMERG , ("Init MAC failed\n" )); err =1 ; -return err; + goto exit; } err =rtl92c_download_fw (hw);
@@ -922,7 +934,7 @@ int rtl92ce_hw_init(struct ieee80211_hw "without FW now..\n")); err =1 ; rtlhal->fw_ready = false; -return err; + goto exit; }else { rtlhal->fw_ready = true; }
@@ -985,6 +997,8 @@ int rtl92ce_hw_init(struct ieee80211_hwRT_TRACE (rtlpriv,COMP_INIT ,DBG_TRACE , ("under 1.5V\n" )); }rtl92c_dm_init (hw); +exit: +local_irq_restore (flags); rtlpci->being_init_adapter = false;return err; }
PATCH 114/200 MIPS: Fix potencial corruption
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Ralf Baechle <[email protected]>
commit a16dad7763420a3b46cff1e703a9070827796cfc upstream.
Normally r4k_dma_cache_inv should only ever be called with cacheline aligned addresses. If however, it isn't there is the theoretical possibility of data corruption. There is no correct way of handling this and anyway, it should only happen if the DMA API is used incorrectly so drop
There is a different corruption scenario with these CACHE instructions removed but again there is no way of handling this correctly and it can be triggered only through incorrect use of the DMA API.
So just get rid of the complexity.
--- arch/mips/mm/c-r4k.c | 11 ----------- 1 file changed, 11 deletions(-)
arch/mips/mm/c-r4k.c +0 -11
@@ -633,9 +633,6 @@ static void r4k_dma_cache_inv(unsigned lif (size >= scache_size)r4k_blast_scache ();else { -unsigned long lsize =cpu_scache_line_size (); -unsigned long almask = ~(lsize -1 ); -/* * There is no clearly documented alignment requirement * for the cache instruction on MIPS processors and
@@ -644,9 +641,6 @@ static void r4k_dma_cache_inv(unsigned l* hit ops with insufficient alignment. Solved by * aligning the address to cache line size. */ -cache_op (Hit_Writeback_Inv_SD, addr & almask); -cache_op (Hit_Writeback_Inv_SD, - (addr + size -1 ) & almask);blast_inv_scache_range (addr, addr + size); }__sync ();
@@ -656,12 +650,7 @@ static void r4k_dma_cache_inv(unsigned lif (cpu_has_safe_index_cacheops && size >= dcache_size) {r4k_blast_dcache (); }else { -unsigned long lsize =cpu_dcache_line_size (); -unsigned long almask = ~(lsize -1 ); -R4600_HIT_CACHEOP_WAR_IMPL ; -cache_op (Hit_Writeback_Inv_D, addr & almask); -cache_op (Hit_Writeback_Inv_D, (addr + size -1 ) & almask);blast_inv_dcache_range (addr, addr + size); }
PATCH 115/200 rtl8187: fix regression on MIPS without coherent DMA
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Stanislaw Gruszka <[email protected]>
commit b6213e413a4e0c66548153516b074df14f9d08e0 upstream.
This patch fixes regression caused by commit a16dad77634 "MIPS: Fix potencial corruption". That commit fixes one corruption scenario in cost of adding another one, which actually start to cause crashes on Yeeloong laptop when rtl8187 driver is used.
For correct DMA read operation on machines without DMA coherence, kernel have to invalidate cache, such it will refill later with new data that device wrote to memory, when that data is needed to process. We can only invalidate full cache line. Hence when cache line includes both dma buffer and some other data (written in cache, but not yet in main memory), the other data can not hit memory due to invalidation. That happen on rtl8187 where struct rtl8187_priv fields are located just before and after small buffers that are passed to USB layer and DMA is performed on them.
To fix the problem we align buffers and reserve space after them to make them match cache line.
This patch does not resolve all possible MIPS problems entirely, for that we have to assure that we always map cache aligned buffers for DMA, what can be complex or even not possible. But patch fixes visible and reproducible regression and seems other possible corruptions do not happen in practice, since Yeeloong laptop works stable without rtl8187 driver.
Bug report:
https://bugzilla.kernel.org/show_bug.cgi?id=54391
--- drivers/net/wireless/rtl818x/rtl8187/rtl8187.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/net/wireless/rtl818x/rtl8187/rtl8187.h +8 -2
@@ -15,6 +15,8 @@#ifndef RTL8187_H #define RTL8187_H +#include <linux/cache.h> +#include "rtl818x.h" #include "leds.h"
@@ -131,7 +133,10 @@ struct rtl8187_priv {u8 aifsn[4 ];u8 rfkill_mask;struct { -__le64 buf; +union { +__le64 buf; +u8 dummy1[L1_CACHE_BYTES ]; + }____cacheline_aligned ;struct sk_buff_head queue; } b_tx_status;/* This queue is used by both -b and non-b devices */ struct mutex io_mutex;
@@ -139,7 +144,8 @@ struct rtl8187_priv {u8 bits8;__le16 bits16;__le32 bits32; - } *io_dmabuf; +u8 dummy2[L1_CACHE_BYTES ]; + } *io_dmabuf____cacheline_aligned ;bool rfkill_off; };
PATCH 116/200 IB/qib: Add missing serdes init sequence
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Mike Marciniszyn <[email protected]>
commit 2f75e12c4457a9b3d042c0a0d748fa198dc2ffaf upstream.
Research has shown that commit a77fcf895046 ("IB/qib: Use a single txselect module parameter for serdes tuning") missed a key serdes init sequence.
This patch add that sequence.
--- drivers/infiniband/hw/qib/qib_iba7322.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/infiniband/hw/qib/qib_iba7322.c +5 -0
@@ -2279,6 +2279,11 @@ static int qib_7322_bringup_serdes(strucqib_write_kreg_port (ppd, krp_ibcctrl_a, ppd->cpspec->ibcctrl_a);qib_write_kreg (dd, kr_scratch,0ULL ); +/* ensure previous Tx parameters are not still forced */ +qib_write_kreg_port (ppd, krp_tx_deemph_override, +SYM_MASK (IBSD_TX_DEEMPHASIS_OVERRIDE_0 , + reset_tx_deemphasis_override)); +if (qib_compat_ddr_negotiate) { ppd->cpspec->ibdeltainprog =1 ; ppd->cpspec->ibsymsnap = read_7322_creg32_port(ppd,
PATCH 117/200 EDAC: Correct workqueue setup path
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Borislav Petkov <[email protected]>
commit cb6ef42e516cb8948f15e4b70dc03af8020050a2 upstream.
We're using edac_mc_workq_setup() both on the init path, when we load an edac driver and when we change the polling period (edac_mc_reset_delay_period) through /sys/.../edac_mc_poll_msec.
On that second path we don't need to init the workqueue which has been initialized already.
Thanks to Tejun for workqueue insights.
--- drivers/edac/edac_mc.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/edac/edac_mc.c +7 -4
@@ -323,7 +323,8 @@ static void edac_mc_workq_function(struc* * called with the mem_ctls_mutex held */ -static void edac_mc_workq_setup (struct mem_ctl_info *mci,unsigned msec) +static void edac_mc_workq_setup (struct mem_ctl_info *mci,unsigned msec, +bool init) {debugf0 ("%s()\n" , __func__);
@@ -331,7 +332,9 @@ static void edac_mc_workq_setup(struct mif (mci->op_state !=OP_RUNNING_POLL )return ; -INIT_DELAYED_WORK (&mci->work, edac_mc_workq_function); +if (init) +INIT_DELAYED_WORK (&mci->work, edac_mc_workq_function); +queue_delayed_work (edac_workqueue, &mci->work,msecs_to_jiffies (msec)); }
@@ -391,7 +394,7 @@ void edac_mc_reset_delay_period(int valulist_for_each (item, &mc_devices) { mci = list_entry(item, struct mem_ctl_info, link); -edac_mc_workq_setup (mci, (unsigned long ) value); +edac_mc_workq_setup (mci, value, false); }mutex_unlock (&mem_ctls_mutex);
@@ -539,7 +542,7 @@ int edac_mc_add_mc(struct mem_ctl_info */* This instance is NOW RUNNING */ mci->op_state =OP_RUNNING_POLL ; -edac_mc_workq_setup (mci,edac_mc_get_poll_msec ()); +edac_mc_workq_setup (mci,edac_mc_get_poll_msec (), true); }else { mci->op_state =OP_RUNNING_INTERRUPT ; }
PATCH 118/200 PCI: Enable INTx if BIOS left them disabled
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Bjorn Helgaas <[email protected]>
commit 1f42db786b14a31bf807fc41ee5583a00c08fcb1 upstream.
Some firmware leaves the Interrupt Disable bit set even if the device uses INTx interrupts. Clear Interrupt Disable so we get those interrupts.
Based on the report mentioned below, if the user selects the "EHCI only" option in the Intel Baytrail BIOS, the EHCI device is handed off to the OS with the PCI_COMMAND_INTX_DISABLE bit set.
--- drivers/pci/pci.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/pci/pci.c +10 -0
@@ -1078,6 +1078,8 @@ EXPORT_SYMBOL_GPL(pci_load_and_free_savestatic int do_pci_enable_device (struct pci_dev *dev,int bars) {int err; +u16 cmd; +u8 pin; err =pci_set_power_state (dev,PCI_D0 );if (err <0 && err != -EIO )
@@ -1087,6 +1089,14 @@ static int do_pci_enable_device(struct preturn err;pci_fixup_device (pci_fixup_enable, dev); +pci_read_config_byte (dev,PCI_INTERRUPT_PIN , &pin); +if (pin) { +pci_read_config_word (dev,PCI_COMMAND , &cmd); +if (cmd &PCI_COMMAND_INTX_DISABLE ) +pci_write_config_word (dev,PCI_COMMAND , + cmd & ~PCI_COMMAND_INTX_DISABLE ); + } +return 0 ; }
PATCH 119/200 ext4: don't leave i_crtime.tv_sec uninitialized
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Theodore Ts'o <[email protected]>
commit 19ea80603715d473600cd993b9987bc97d042e02 upstream.
If the i_crtime field is not present in the inode, don't leave the field uninitialized.
--- fs/ext4/ext4.h | 2 ++ 1 file changed, 2 insertions(+)
fs/ext4/ext4.h +2 -0
@@ -745,6 +745,8 @@ do { \if (EXT4_FITS_IN_INODE (raw_inode, einode, xtime)) \ (einode)->xtime.tv_sec = \ (signed )le32_to_cpu ((raw_inode)->xtime); \ +else \ + (einode)->xtime.tv_sec =0 ; \ if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime ## _extra)) \ext4_decode_extra_time (&(einode)->xtime, \ raw_inode->xtime ## _extra); \
PATCH 120/200 dma: ste_dma40: don't dereference free:d descriptor
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <[email protected]>
commit e9baa9d9d520fb0e24cca671e430689de2d4a4b2 upstream.
It appears that in the DMA40 driver the DMA tasklet will very often dereference memory for a descriptor just free:d from the DMA40 slab. Nothing happens because no other part of the driver has yet had a chance to claim this memory, but it's really nasty to dereference free:d memory, so let's check the flag before the descriptor is free and store it in a bool variable.
--- drivers/dma/ste_dma40.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/dma/ste_dma40.c +3 -1
@@ -1202,6 +1202,7 @@ static void dma_tasklet(unsigned long dastruct d40_chan *d40c = (struct d40_chan *) data;struct d40_desc *d40d;unsigned long flags; +bool callback_active;dma_async_tx_callback callback;void *callback_param;
@@ -1225,6 +1226,7 @@ static void dma_tasklet(unsigned long da }/* Callback to client */ + callback_active = !!(d40d->txd.flags &DMA_PREP_INTERRUPT ); callback = d40d->txd.callback; callback_param = d40d->txd.callback_param;
@@ -1249,7 +1251,7 @@ static void dma_tasklet(unsigned long daspin_unlock_irqrestore (&d40c->lock, flags); -if (callback && (d40d->txd.flags &DMA_PREP_INTERRUPT )) +if (callback_active && callback)callback (callback_param);return ;
PATCH 121/200 ALSA: usb-audio: work around KEF X300A firmware bug
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Clemens Ladisch <[email protected]>
commit 624aef494f86ed0c58056361c06347ad62b26806 upstream.
When the driver tries to access Function Unit 10, the KEF X300A speakers' firmware apparently locks up, making even PCM streaming impossible. Work around this by ignoring this FU.
--- sound/usb/mixer_maps.c | 9 +++++++++ 1 file changed, 9 insertions(+)
sound/usb/mixer_maps.c +9 -0
@@ -304,6 +304,11 @@ static struct usbmix_name_map hercules_u { 0 } /* terminator */ }; +static const struct usbmix_name_map kef_x300a_map[] = { + {10 ,NULL },/* firmware locks up (?) when we try to access this FU */ + {0 } +}; +/* * Control map entries */
@@ -371,6 +376,10 @@ static struct usbmix_ctl_map usbmix_ctl_ .map = scratch_live_map, .ignore_ctl_error = 1, }, + { + .id = USB_ID(0x27ac, 0x1000), + .map = kef_x300a_map, + }, { 0 } /* terminator */ };
PATCH 122/200 avr32: fix missing module.h causing build failure in mimc200/fram.c
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Paul Gortmaker <[email protected]>
commit 5745d6a41a4f4aec29e2ccd591c6fb09ed73a955 upstream.
Causing this:
In file included from arch/avr32/boards/mimc200/fram.c:13:include/linux/miscdevice.h:51: error: field 'list' has incomplete type include/linux/miscdevice.h:55: error: expected specifier-qualifier-list before 'mode_t' arch/avr32/boards/mimc200/fram.c:42: error: 'THIS_MODULE' undeclared here (not in a function)
--- arch/avr32/boards/mimc200/fram.c | 1 + 1 file changed, 1 insertion(+)
arch/avr32/boards/mimc200/fram.c +1 -0
@@ -11,6 +11,7 @@#define FRAM_VERSION "1.0"#include <linux/miscdevice.h> +#include <linux/module.h> #include <linux/proc_fs.h> #include <linux/mm.h> #include <linux/io.h>
PATCH 123/200 avr32: Makefile: add '-D__linux__' flag for gcc-4.4.7 use
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Chen Gang <[email protected]>
commit 8d80390cfc9434d5aa4fb9e5f9768a66b30cb8a6 upstream.
For avr32 cross compiler, do not define '__linux__' internally, so it will cause issue with allmodconfig.
The related error:
CC [M] fs/coda/psdev.o
In file included from include/linux/coda.h:64,
from fs/coda/psdev.c:45:
include/uapi/linux/coda.h:221: error: expected specifier-qualifier-list before 'u_quad_t'
The related toolchain version (which only download, not re-compile):
[root@gchen linux-next]# /upstream/toolchain/download/avr32-gnu-toolchain-linux_x86/bin/avr32-gcc -v
Using built-in specs.
Target: avr32
Configured with: /data2/home/toolsbuild/jenkins-knuth/workspace/avr32-gnu-toolchain/src/gcc/configure --target=avr32 --host=i686-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/home/toolsbuild/jenkins-knuth/workspace/avr32-gnu-toolchain/avr32-gnu-toolchain-linux_x86 --enable-languages=c,c++ --disable-nls --disable-libssp --disable-libstdcxx-pch --with-dwarf2 --enable-version-specific-runtime-libs --disable-shared --enable-doc --with-mpfr-lib=/home/toolsbuild/jenkins-knuth/workspace/avr32-gnu-toolchain/avr32-gnu-toolchain-linux_x86/lib --with-mpfr-include=/home/toolsbuild/jenkins-knuth/workspace/avr32-gnu-toolchain/avr32-gnu-toolchain-linux_x86/include --with-gmp=/home/toolsbuild/jenkins-knuth/workspace/avr32-gnu-toolchain/avr32-gnu-toolchain-linux_x86 --with-mpc=/home/toolsbuild/jenkins-knuth/workspace/avr32-gnu-toolchain/avr32-gnu-toolchain-linux_x86 --enable-__cxa_atexit --disable-shared --with-newlib --with-pkgversion=AVR_32_bit_GNU_Toolchain_3.4.2_435 --with-bugurl=http://www
.atmel.com/avr
Thread model: single
gcc version 4.4.7 (AVR_32_bit_GNU_Toolchain_3.4.2_435)
--- arch/avr32/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/avr32/Makefile +1 -1
@@ -11,7 +11,7 @@ all: uImage vmlinux.elf KBUILD_DEFCONFIG := atstk1002_defconfig -KBUILD_CFLAGS += -pipe -fno-builtin -mno-pic +KBUILD_CFLAGS += -pipe -fno-builtin -mno-pic -D__linux__ KBUILD_AFLAGS += -mrelax -mno-pic KBUILD_CFLAGS_MODULE += -mno-relax LDFLAGS_vmlinux += --relax
PATCH 124/200 ARM: 7957/1: add DSB after icache flush in __flush_icache_all()
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Vinayak Kale <[email protected]>
commit 39544ac9df20f73e49fc6b9ac19ff533388c82c0 upstream.
Add DSB after icache flush to complete the cache maintenance operation.
--- arch/arm/include/asm/cacheflush.h | 1 + 1 file changed, 1 insertion(+)
arch/arm/include/asm/cacheflush.h +1 -0
@@ -202,6 +202,7 @@ extern void copy_to_user_page(struct vm_static inline void __flush_icache_all (void ) {__flush_icache_preferred (); +dsb (); }#define flush_cache_all () __cpuc_flush_kern_all()
PATCH 125/200 ahci: disable NCQ on Samsung pci-e SSDs on macbooks
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Levente Kurusa <[email protected]>
commit 67809f85d31eac600f6b28defa5386c9d2a13b1d upstream.
Samsung's pci-e SSDs with device ID 0x1600 which are found on some macbooks time out on NCQ commands. Blacklist NCQ on the device so that the affected machines can at least boot.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=60731
--- drivers/ata/ahci.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/ata/ahci.c +14 -0
@@ -61,6 +61,7 @@ enum board_ids {/* board IDs by feature in alphabetical order */ board_ahci, board_ahci_ign_iferr, + board_ahci_noncq, board_ahci_nosntf, board_ahci_yes_fbs,
@@ -123,6 +124,13 @@ static const struct ata_port_info ahci_p .udma_mask = ATA_UDMA6, .port_ops = &ahci_ops, }, + [board_ahci_noncq] = { + AHCI_HFLAGS (AHCI_HFLAG_NO_NCQ), + .flags = AHCI_FLAG_COMMON, + .pio_mask = ATA_PIO4, + .udma_mask = ATA_UDMA6, + .port_ops = &ahci_ops, + }, [board_ahci_nosntf] = { AHCI_HFLAGS (AHCI_HFLAG_NO_SNTF),
@@ -458,6 +466,12 @@ static const struct pci_device_id ahci_p { PCI_VDEVICE(ASMEDIA, 0x0611), board_ahci }, /* ASM1061 */ { PCI_VDEVICE(ASMEDIA, 0x0612), board_ahci }, /* ASM1062 */ +/* +* Samsung SSDs found on some macbooks. NCQ times out. +* https://bugzilla.kernel.org/show_bug.cgi?id=60731 +*/ + { PCI_VDEVICE(SAMSUNG, 0x1600), board_ahci_noncq }, +/* Enmotus */ { PCI_DEVICE(0x1c44, 0x8000), board_ahci },
PATCH 126/200 USB: EHCI: add delay during suspend to prevent erroneous wakeups
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit 3e8d6d85adedc59115a564c0a54b36e42087c4d9 upstream.
High-speed USB connections revert back to full-speed signalling when the device goes into suspend. This takes several milliseconds, and during that time it's not possible to tell reliably whether the device has been disconnected.
On some platforms, the Wake-On-Disconnect circuitry gets confused during this intermediate state. It generates a false wakeup signal, which can prevent the controller from going to sleep.
To avoid this problem, this patch adds a 5-ms delay to the ehci_bus_suspend() routine if any ports have to switch over to full-speed signalling. (Actually, the delay was already present for devices using a particular kind of PHY power management; the patch merely causes the delay to be used more widely.)
[bwh: Backported to 3.2:
- Adjust context
- s/has_tdi_phy_lpm/has_hostpc/
- Always re-lock ehci->lock after the sleep]
---
drivers/usb/host/ehci-hub.c +23 -3
@@ -207,6 +207,7 @@ static int ehci_bus_suspend (struct usb_int port;int mask;int changed; +bool fs_idle_delay;ehci_dbg (ehci,"suspend root hub\n" );
@@ -249,6 +250,7 @@ static int ehci_bus_suspend (struct usb_ ehci->bus_suspended =0 ; ehci->owned_ports =0 ; changed =0 ; + fs_idle_delay = false; port =HCS_N_PORTS (ehci->hcs_params);while (port--) {u32 __iomem *reg = &ehci->regs->port_status [port];
@@ -279,16 +281,34 @@ static int ehci_bus_suspend (struct usb_if (t1 != t2) {ehci_vdbg (ehci,"port %d, %08x -> %08x\n" , port +1 , t1, t2); +/* +* On some controllers, Wake-On-Disconnect will +* generate false wakeup signals until the bus +* switches over to full-speed idle. For their +* sake, add a delay if we need one. +*/ +if ((t2 &PORT_WKDISC_E ) && +ehci_port_speed (ehci, t2) == +USB_PORT_STAT_HIGH_SPEED ) + fs_idle_delay = true;ehci_writel (ehci, t2, reg); changed =1 ; } } +spin_unlock_irq (&ehci->lock); + +if ((changed && ehci->has_hostpc) || fs_idle_delay) { +/* +* Wait for HCD to enter low-power mode or for the bus +* to switch to full-speed idle. +*/ +usleep_range (5000 ,5500 ); + } + +spin_lock_irq (&ehci->lock);if (changed && ehci->has_hostpc) { -spin_unlock_irq (&ehci->lock); -msleep (5 );/* 5 ms for HCD to enter low-power mode */ spin_lock_irq (&ehci->lock); - port =HCS_N_PORTS (ehci->hcs_params);while (port--) {u32 __iomem *hostpc_reg;
PATCH 127/200 USB: serial: option: blacklist interface 4 for Cinterion PHS8 and PXS8
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Aleksander Morgado <[email protected]>
commit 12df84d4a80278a5b1abfec3206795291da52fc9 upstream.
This interface is to be handled by the qmi_wwan driver.
--- drivers/usb/serial/option.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/serial/option.c +2 -1
@@ -1546,7 +1546,8 @@ static const struct usb_device_id option/* Cinterion */ { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_E) }, { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_P) }, - { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PH8) }, + { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PH8), + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AHXX) }, { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PLXX), .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
PATCH 128/200 workqueue: ensure @task is valid across kthread_stop()
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Lai Jiangshan <[email protected]>
commit 5bdfff96c69a4d5ab9c49e60abf9e070ecd2acbb upstream.
When a kworker should die, the kworkre is notified through WORKER_DIE flag instead of kthread_should_stop(). This, IIRC, is primarily to keep the test synchronized inside worker_pool lock. WORKER_DIE is first set while holding pool->lock, the lock is dropped and kthread_stop() is called.
Unfortunately, this means that there's a slight chance that the target kworker may see WORKER_DIE before kthread_stop() finishes and exits and frees the target task before or during kthread_stop().
Fix it by pinning the target task before setting WORKER_DIE and putting it after kthread_stop() is done.
tj: Improved patch description and comment. Moved pinning above
WORKER_DIE for better signify what it's protecting.
--- kernel/workqueue.c | 7 +++++++ 1 file changed, 7 insertions(+)
kernel/workqueue.c +7 -0
@@ -1474,12 +1474,19 @@ static void destroy_worker(struct workerif (worker->flags &WORKER_IDLE ) gcwq->nr_idle--; +/* +* Once WORKER_DIE is set, the kworker may destroy itself at any +* point. Pin to ensure the task stays until we're done with it. +*/ +get_task_struct (worker->task); +list_del_init (&worker->entry); worker->flags |=WORKER_DIE ;spin_unlock_irq (&gcwq->lock);kthread_stop (worker->task); +put_task_struct (worker->task);kfree (worker);spin_lock_irq (&gcwq->lock);
PATCH 129/200 cgroup: update cgroup_enable_task_cg_lists() to grab siglock
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <[email protected]>
commit 532de3fc72adc2a6525c4d53c07bf81e1732083d upstream.
Currently, there's nothing preventing cgroup_enable_task_cg_lists() from missing set PF_EXITING and race against cgroup_exit(). Depending on the timing, cgroup_exit() may finish with the task still linked on css_set leading to list corruption. Fix it by grabbing siglock in cgroup_enable_task_cg_lists() so that PF_EXITING is guaranteed to be visible.
This whole on-demand cg_list optimization is extremely fragile and has ample possibility to lead to bugs which can cause things like once-a-year oops during boot. I'm wondering whether the better approach would be just adding "cgroup_disable=all" handling which disables the whole cgroup rather than tempting fate with this on-demand craziness.
--- kernel/cgroup.c | 5 +++++ 1 file changed, 5 insertions(+)
kernel/cgroup.c +5 -0
@@ -2785,9 +2785,14 @@ static void cgroup_enable_task_cg_lists(* We should check if the process is exiting, otherwise * it will race with cgroup_exit() in that the list * entry won't be deleted though the process has exited. +* Do it while holding siglock so that we don't end up +* racing against cgroup_exit(). */ +spin_lock_irq (&p->sighand->siglock);if (!(p->flags &PF_EXITING ) &&list_empty (&p->cg_list))list_add (&p->cg_list, &p->cgroups->tasks); +spin_unlock_irq (&p->sighand->siglock); +task_unlock (p); }while_each_thread (g, p);write_unlock (&css_set_lock);
PATCH 130/200 hwmon: (max1668) Fix writing the minimum temperature
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Guenter Roeck <[email protected]>
commit 500a91571f0a5d0d3242d83802ea2fd1faccc66e upstream.
When trying to set the minimum temperature, the driver was erroneously writing the maximum temperature into the chip.
--- drivers/hwmon/max1668.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/max1668.c +1 -1
@@ -243,7 +243,7 @@ static ssize_t set_temp_min(struct devic data->temp_min[index] =SENSORS_LIMIT (temp/1000 ,-128 ,127 );if (i2c_smbus_write_byte_data (client,MAX1668_REG_LIML_WR (index), - data->temp_max[index])) + data->temp_min[index])) count = -EIO ;mutex_unlock (&data->update_lock);
PATCH 131/200 ASoC: sta32x: Fix array access overflow
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 025c3fa9256d4c54506b7a29dc3befac54f5c68d upstream.
Preset EQ enum of sta32x codec driver declares too many number of items and it may lead to the access over the actual array size.
Use SOC_ENUM_SINGLE_DECL() helper and it's automatically fixed.
--- sound/soc/codecs/sta32x.c | 72 +++++++++++++++++++++++------------------------ 1 file changed, 36 insertions(+), 36 deletions(-)
sound/soc/codecs/sta32x.c +36 -36
@@ -143,42 +143,42 @@ static const unsigned int sta32x_limiter 13, 16, TLV_DB_SCALE_ITEM(-1500, 300, 0), }; -static const struct soc_enum sta32x_drc_ac_enum = -SOC_ENUM_SINGLE (STA32X_CONFD ,STA32X_CONFD_DRC_SHIFT , -2 , sta32x_drc_ac); -static const struct soc_enum sta32x_auto_eq_enum = -SOC_ENUM_SINGLE (STA32X_AUTO1 ,STA32X_AUTO1_AMEQ_SHIFT , -3 , sta32x_auto_eq_mode); -static const struct soc_enum sta32x_auto_gc_enum = -SOC_ENUM_SINGLE (STA32X_AUTO1 ,STA32X_AUTO1_AMGC_SHIFT , -4 , sta32x_auto_gc_mode); -static const struct soc_enum sta32x_auto_xo_enum = -SOC_ENUM_SINGLE (STA32X_AUTO2 ,STA32X_AUTO2_XO_SHIFT , -16 , sta32x_auto_xo_mode); -static const struct soc_enum sta32x_preset_eq_enum = -SOC_ENUM_SINGLE (STA32X_AUTO3 ,STA32X_AUTO3_PEQ_SHIFT , -32 , sta32x_preset_eq_mode); -static const struct soc_enum sta32x_limiter_ch1_enum = -SOC_ENUM_SINGLE (STA32X_C1CFG , STA32X_CxCFG_LS_SHIFT, -3 , sta32x_limiter_select); -static const struct soc_enum sta32x_limiter_ch2_enum = -SOC_ENUM_SINGLE (STA32X_C2CFG , STA32X_CxCFG_LS_SHIFT, -3 , sta32x_limiter_select); -static const struct soc_enum sta32x_limiter_ch3_enum = -SOC_ENUM_SINGLE (STA32X_C3CFG , STA32X_CxCFG_LS_SHIFT, -3 , sta32x_limiter_select); -static const struct soc_enum sta32x_limiter1_attack_rate_enum = -SOC_ENUM_SINGLE (STA32X_L1AR , STA32X_LxA_SHIFT, -16 , sta32x_limiter_attack_rate); -static const struct soc_enum sta32x_limiter2_attack_rate_enum = -SOC_ENUM_SINGLE (STA32X_L2AR , STA32X_LxA_SHIFT, -16 , sta32x_limiter_attack_rate); -static const struct soc_enum sta32x_limiter1_release_rate_enum = -SOC_ENUM_SINGLE (STA32X_L1AR , STA32X_LxR_SHIFT, -16 , sta32x_limiter_release_rate); -static const struct soc_enum sta32x_limiter2_release_rate_enum = -SOC_ENUM_SINGLE (STA32X_L2AR , STA32X_LxR_SHIFT, -16 , sta32x_limiter_release_rate); +static SOC_ENUM_SINGLE_DECL(sta32x_drc_ac_enum, + STA32X_CONFD, STA32X_CONFD_DRC_SHIFT, + sta32x_drc_ac); +static SOC_ENUM_SINGLE_DECL(sta32x_auto_eq_enum, + STA32X_AUTO1, STA32X_AUTO1_AMEQ_SHIFT, + sta32x_auto_eq_mode); +static SOC_ENUM_SINGLE_DECL(sta32x_auto_gc_enum, + STA32X_AUTO1, STA32X_AUTO1_AMGC_SHIFT, + sta32x_auto_gc_mode); +static SOC_ENUM_SINGLE_DECL(sta32x_auto_xo_enum, + STA32X_AUTO2, STA32X_AUTO2_XO_SHIFT, + sta32x_auto_xo_mode); +static SOC_ENUM_SINGLE_DECL(sta32x_preset_eq_enum, + STA32X_AUTO3, STA32X_AUTO3_PEQ_SHIFT, + sta32x_preset_eq_mode); +static SOC_ENUM_SINGLE_DECL(sta32x_limiter_ch1_enum, + STA32X_C1CFG, STA32X_CxCFG_LS_SHIFT, + sta32x_limiter_select); +static SOC_ENUM_SINGLE_DECL(sta32x_limiter_ch2_enum, + STA32X_C2CFG, STA32X_CxCFG_LS_SHIFT, + sta32x_limiter_select); +static SOC_ENUM_SINGLE_DECL(sta32x_limiter_ch3_enum, + STA32X_C3CFG, STA32X_CxCFG_LS_SHIFT, + sta32x_limiter_select); +static SOC_ENUM_SINGLE_DECL(sta32x_limiter1_attack_rate_enum, + STA32X_L1AR, STA32X_LxA_SHIFT, + sta32x_limiter_attack_rate); +static SOC_ENUM_SINGLE_DECL(sta32x_limiter2_attack_rate_enum, + STA32X_L2AR, STA32X_LxA_SHIFT, + sta32x_limiter_attack_rate); +static SOC_ENUM_SINGLE_DECL(sta32x_limiter1_release_rate_enum, + STA32X_L1AR, STA32X_LxR_SHIFT, + sta32x_limiter_release_rate); +static SOC_ENUM_SINGLE_DECL(sta32x_limiter2_release_rate_enum, + STA32X_L2AR, STA32X_LxR_SHIFT, + sta32x_limiter_release_rate);/* byte array controls for setting biquad, mixer, scaling coefficients; * for biquads all five coefficients need to be set in one go,
PATCH 132/200 ACPI / video: Filter the _BCL table for duplicate brightness values
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit bd8ba20597f0cfef3ef65c3fd2aa92ab23d4c8e1 upstream.
Some devices have duplicate entries in there brightness levels table, ie on my Dell Latitude E6430 the table looks like this:
[ 3.686060] acpi backlight index 0, val 80 [ 3.686095] acpi backlight index 1, val 50 [ 3.686122] acpi backlight index 2, val 5 [ 3.686147] acpi backlight index 3, val 5 [ 3.686172] acpi backlight index 4, val 5 [ 3.686197] acpi backlight index 5, val 5 [ 3.686223] acpi backlight index 6, val 5 [ 3.686248] acpi backlight index 7, val 5 [ 3.686273] acpi backlight index 8, val 6 [ 3.686332] acpi backlight index 9, val 7 [ 3.686356] acpi backlight index 10, val 8 [ 3.686380] acpi backlight index 11, val 9
etc.
Notice that brightness values 0-5 are all mapped to 5. This means that if userspace writes any value between 0 and 5 to the brightness sysfs attribute and then reads it, it will always return 0, which is somewhat unexpected.
This is a problem for ie gnome-settings-daemon, which uses read-modify-write logic when the users presses the brightness up or down keys. This is done this way to take brightness changes from other sources into account.
On this specific laptop what happens once the brightness has been set to 0, is that gsd reads 0, adds 5, writes 5, and on the next brightness up key press again reads 0, so things get stuck at the lowest brightness setting.
Filtering out the duplicate table entries, makes any write to brightness read back as the written value as one would expect, fixing this.
--- drivers/acpi/video.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/acpi/video.c +7 -1
@@ -646,6 +646,7 @@ acpi_video_init_brightness(struct acpi_vunion acpi_object *o;struct acpi_video_device_brightness *br =NULL ;int result = -EINVAL ; +u32 value;if (!ACPI_SUCCESS (acpi_video_device_lcd_query_levels (device, &obj))) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Could not query available "
@@ -676,7 +677,12 @@ acpi_video_init_brightness(struct acpi_v printk(KERN_ERR PREFIX "Invalid data\n");continue ; } - br->levels[count] = (u32 ) o->integer.value; + value = (u32 ) o->integer.value; +/* Skip duplicate entries */ +if (count >2 && br->levels[count -1 ] == value) +continue ; + + br->levels[count] = value;if (br->levels[count] > max_level) max_level = br->levels[count];
PATCH 133/200 ASoC: wm8770: Fix wrong number of enum items
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 7a6c0a58dc824523966f212c76322d47c5b0e6fe upstream.
wm8770 codec driver defines ain_enum with a wrong number of items.
Use SOC_ENUM_DOUBLE_DECL() macro and it's automatically fixed.
--- sound/soc/codecs/wm8770.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/wm8770.c +2 -2
@@ -163,8 +163,8 @@ static const char *ain_text[] = {"AIN5" ,"AIN6" ,"AIN7" ,"AIN8" }; -static const struct soc_enum ain_enum = -SOC_ENUM_DOUBLE (WM8770_ADCMUX ,0 ,4 ,8 , ain_text); +static SOC_ENUM_DOUBLE_DECL(ain_enum, + WM8770_ADCMUX, 0, 4, ain_text);static const struct snd_kcontrol_new ain_mux =SOC_DAPM_ENUM ("Capture Mux" , ain_enum);
PATCH 134/200 mac80211: fix AP powersave TX vs. wakeup race
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Emmanuel Grumbach <[email protected]>
commit 1d147bfa64293b2723c4fec50922168658e613ba upstream.
There is a race between the TX path and the STA wakeup: while a station is sleeping, mac80211 buffers frames until it wakes up, then the frames are transmitted. However, the RX and TX path are concurrent, so the packet indicating wakeup can be processed while a packet is being transmitted.
This can lead to a situation where the buffered frames list is emptied on the one side, while a frame is being added on the other side, as the station is still seen as sleeping in the TX path.
As a result, the newly added frame will not be send anytime soon. It might be sent much later (and out of order) when the station goes to sleep and wakes up the next time.
Additionally, it can lead to the crash below.
Fix all this by synchronising both paths with a new lock. Both path are not fastpath since they handle PS situations.
In a later patch we'll remove the extra skb queue locks to reduce locking overhead.
BUG: unable to handle kernel NULL pointer dereference at 000000b0 IP: [<ff6f1791>] ieee80211_report_used_skb+0x11/0x3e0 [mac80211] *pde = 00000000 Oops: 0000 [#1] SMP DEBUG_PAGEALLOC EIP: 0060:[<ff6f1791>] EFLAGS: 00210282 CPU: 1 EIP is at ieee80211_report_used_skb+0x11/0x3e0 [mac80211] EAX: e5900da0 EBX: 00000000 ECX: 00000001 EDX: 00000000 ESI: e41d00c0 EDI: e5900da0 EBP: ebe458e4 ESP: ebe458b0 DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 CR0: 8005003b CR2: 000000b0 CR3: 25a78000 CR4: 000407d0 DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000 DR6: ffff0ff0 DR7: 00000400 Process iperf (pid: 3934, ti=ebe44000 task=e757c0b0 task.ti=ebe44000) iwlwifi 0000:02:00.0: I iwl_pcie_enqueue_hcmd Sending command LQ_CMD (#4e), seq: 0x0903, 92 bytes at 3[3]:9 Stack: e403b32c ebe458c4 00200002 00200286 e403b338 ebe458cc c10960bb e5900da0 ff76a6ec ebe458d8 00000000 e41d00c0 e5900da0 ebe458f0 ff6f1b75 e403b210 ebe4598c ff723dc1 00000000 ff76a6ec e597c978 e403b758 00000002 00000002 Call Trace: [<ff6f1b75>] ieee80211_free_txskb+0x15/0x20 [mac80211] [<ff723dc1>] invoke_tx_handlers+0x1661/0x1780 [mac80211] [<ff7248a5>] ieee80211_tx+0x75/0x100 [mac80211] [<ff7249bf>] ieee80211_xmit+0x8f/0xc0 [mac80211] [<ff72550e>] ieee80211_subif_start_xmit+0x4fe/0xe20 [mac80211] [<c149ef70>] dev_hard_start_xmit+0x450/0x950 [<c14b9aa9>] sch_direct_xmit+0xa9/0x250 [<c14b9c9b>] __qdisc_run+0x4b/0x150 [<c149f732>] dev_queue_xmit+0x2c2/0xca0
--- net/mac80211/sta_info.c | 4 ++++ net/mac80211/sta_info.h | 7 +++---- net/mac80211/tx.c | 15 +++++++++++++++ 3 files changed, 22 insertions(+), 4 deletions(-)
net/mac80211/sta_info.c +4 -0
@@ -292,6 +292,7 @@ struct sta_info *sta_info_alloc(struct ireturn NULL ;spin_lock_init (&sta->lock); +spin_lock_init (&sta->ps_lock);INIT_WORK (&sta->drv_unblock_wk, sta_unblock);INIT_WORK (&sta->ampdu_mlme.work, ieee80211_ba_session_work);mutex_init (&sta->ampdu_mlme.mtx);
@@ -1141,6 +1142,8 @@ void ieee80211_sta_ps_deliver_wakeup(strskb_queue_head_init (&pending); +/* sync with ieee80211_tx_h_unicast_ps_buf */ +spin_lock (&sta->ps_lock);/* Send all buffered frames to the station */ for (ac =0 ; ac <IEEE80211_NUM_ACS ; ac++) {int count =skb_queue_len (&pending), tmp;
@@ -1160,6 +1163,7 @@ void ieee80211_sta_ps_deliver_wakeup(str }ieee80211_add_pending_skbs_fn (local, &pending, clear_sta_ps_flags, sta); +spin_unlock (&sta->ps_lock); local->total_ps_buffered -= buffered;
net/mac80211/sta_info.h +3 -4
@@ -216,6 +216,7 @@ struct sta_ampdu_mlme {* @drv_unblock_wk: used for driver PS unblocking * @listen_interval: listen interval of this station, when we're acting as AP * @_flags: STA flags, see &enum ieee80211_sta_info_flags, do not use directly +* @ps_lock: used for powersave (when mac80211 is the AP) related locking * @ps_tx_buf: buffers (per AC) of frames to transmit to this station * when it leaves power saving state or polls * @tx_filtered: buffers (per AC) of frames we already tried to
@@ -284,10 +285,8 @@ struct sta_info {/* use the accessors defined below */ unsigned long _flags; -/* -* STA powersave frame queues, no more than the internal -* locking required. -*/ +/* STA powersave lock and frame queues */ +spinlock_t ps_lock;struct sk_buff_head ps_tx_buf[IEEE80211_NUM_ACS ];struct sk_buff_head tx_filtered[IEEE80211_NUM_ACS ];unsigned long driver_buffered_tids;
net/mac80211/tx.c +15 -0
@@ -464,6 +464,20 @@ ieee80211_tx_h_unicast_ps_buf(struct iee#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ if (tx->local->total_ps_buffered >=TOTAL_MAX_TX_BUFFER )purge_old_ps_buffers (tx->local); + +/* sync with ieee80211_sta_ps_deliver_wakeup */ +spin_lock (&sta->ps_lock); +/* +* STA woke up the meantime and all the frames on ps_tx_buf have +* been queued to pending queue. No reordering can happen, go +* ahead and Tx the packet. +*/ +if (!test_sta_flag (sta,WLAN_STA_PS_STA ) && + !test_sta_flag (sta,WLAN_STA_PS_DRIVER )) { +spin_unlock (&sta->ps_lock); +return TX_CONTINUE ; + } +if (skb_queue_len (&sta->ps_tx_buf[ac]) >=STA_MAX_TX_BUFFER ) {struct sk_buff *old =skb_dequeue (&sta->ps_tx_buf[ac]);#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
@@ -480,6 +494,7 @@ ieee80211_tx_h_unicast_ps_buf(struct iee info->control.vif = &tx->sdata->vif; info->flags |=IEEE80211_TX_INTFL_NEED_TXPROCESSING ;skb_queue_tail (&sta->ps_tx_buf[ac], tx->skb); +spin_unlock (&sta->ps_lock);if (!timer_pending (&local->sta_cleanup)) mod_timer(&local->sta_cleanup,
PATCH 135/200 SELinux: bigendian problems with filename trans rules
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Eric Paris <[email protected]>
commit 9085a6422900092886da8c404e1c5340c4ff1cbf upstream.
When writing policy via /sys/fs/selinux/policy I wrote the type and class of filename trans rules in CPU endian instead of little endian. On x86_64 this works just fine, but it means that on big endian arch's like ppc64 and s390 userspace reads the policy and converts it from le32_to_cpu. So the values are all screwed up. Write the values in le format like it should have been to start.
--- security/selinux/ss/policydb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
security/selinux/ss/policydb.c +4 -4
@@ -3214,10 +3214,10 @@ static int filename_write_helper(void *kif (rc)return rc; - buf[0 ] = ft->stype; - buf[1 ] = ft->ttype; - buf[2 ] = ft->tclass; - buf[3 ] = otype->otype; + buf[0 ] =cpu_to_le32 (ft->stype); + buf[1 ] =cpu_to_le32 (ft->ttype); + buf[2 ] =cpu_to_le32 (ft->tclass); + buf[3 ] =cpu_to_le32 (otype->otype); rc =put_entry (buf,sizeof (u32),4 , fp);if (rc)
PATCH 136/200 ath9k: protect tid->sched check
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Stanislaw Gruszka <[email protected]>
commit 21f8aaee0c62708654988ce092838aa7df4d25d8 upstream.
We check tid->sched without a lock taken on ath_tx_aggr_sleep(). That is race condition which can result of doing list_del(&tid->list) twice (second time with poisoned list node) and cause crash like shown below:
[424271.637220] BUG: unable to handle kernel paging request at 00100104 [424271.637328] IP: [<f90fc072>] ath_tx_aggr_sleep+0x62/0xe0 [ath9k] ... [424271.639953] Call Trace: [424271.639998] [<f90f6900>] ? ath9k_get_survey+0x110/0x110 [ath9k] [424271.640083] [<f90f6942>] ath9k_sta_notify+0x42/0x50 [ath9k] [424271.640177] [<f809cfef>] sta_ps_start+0x8f/0x1c0 [mac80211] [424271.640258] [<c10f730e>] ? free_compound_page+0x2e/0x40 [424271.640346] [<f809e915>] ieee80211_rx_handlers+0x9d5/0x2340 [mac80211] [424271.640437] [<c112f048>] ? kmem_cache_free+0x1d8/0x1f0 [424271.640510] [<c1345a84>] ? kfree_skbmem+0x34/0x90 [424271.640578] [<c10fc23c>] ? put_page+0x2c/0x40 [424271.640640] [<c1345a84>] ? kfree_skbmem+0x34/0x90 [424271.640706] [<c1345a84>] ? kfree_skbmem+0x34/0x90 [424271.640787] [<f809dde3>] ? ieee80211_rx_handlers_result+0x73/0x1d0 [mac80211] [424271.640897] [<f80a07a0>] ieee80211_prepare_and_rx_handle+0x520/0xad0 [mac80211] [424271.641009] [<f809e22d>] ? ieee80211_rx_handlers+0x2ed/0x2340 [mac80211] [424271.641104] [<c13846ce>] ? ip_output+0x7e/0xd0 [424271.641182] [<f80a1057>] ieee80211_rx+0x307/0x7c0 [mac80211] [424271.641266] [<f90fa6ee>] ath_rx_tasklet+0x88e/0xf70 [ath9k] [424271.641358] [<f80a0f2c>] ? ieee80211_rx+0x1dc/0x7c0 [mac80211] [424271.641445] [<f90f82db>] ath9k_tasklet+0xcb/0x130 [ath9k]
Bug report:
https://bugzilla.kernel.org/show_bug.cgi?id=70551
[bwh: Backported to 3.2:
- Adjust context
- Use spin_unlock_bh() directly]
--- drivers/net/wireless/ath/ath9k/xmit.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath9k/xmit.c +5 -3
@@ -1176,14 +1176,16 @@ void ath_tx_aggr_sleep(struct ieee80211_for (tidno =0 , tid = &an->tid[tidno]; tidno <WME_NUM_TID ; tidno++, tid++) { -if (!tid->sched) -continue ; - ac = tid->ac; txq = ac->txq;spin_lock_bh (&txq->axq_lock); +if (!tid->sched) { +spin_unlock_bh (&txq->axq_lock); +continue ; + } + buffered = !skb_queue_empty (&tid->buf_q); tid->sched = false;
PATCH 137/200 ath9k: Fix ETSI compliance for AR9462 2.0
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Sujith Manoharan <[email protected]>
commit b3050248c167871ca52cfdb2ce78aa2460249346 upstream.
The minimum CCA power threshold values have to be adjusted for existing cards to be in compliance with new regulations. Newer cards will make use of the values obtained from EEPROM, support for this was added earlier. To make sure that cards that are already in use and don't have proper values in EEPROM, do not violate regulations, use the initvals instead.
--- drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h +2 -2
@@ -55,7 +55,7 @@ static const u32 ar9462_2p0_baseband_pos {0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3039605e, 0x33795d5e}, {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c}, - {0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce}, + {0x00009e20, 0x000003a5, 0x000003a5, 0x000003a5, 0x000003a5}, {0x00009e2c, 0x0000001c, 0x0000001c, 0x00000021, 0x00000021}, {0x00009e3c, 0xcf946220, 0xcf946220, 0xcfd5c782, 0xcfd5c782}, {0x00009e44, 0xfe321e27, 0xfe321e27, 0xfe291e27, 0xfe291e27},
@@ -85,7 +85,7 @@ static const u32 ar9462_2p0_baseband_pos {0x0000ae04, 0x001c0000, 0x001c0000, 0x001c0000, 0x00100000}, {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x0000ae1c, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c}, - {0x0000ae20, 0x000001b5, 0x000001b5, 0x000001ce, 0x000001ce}, + {0x0000ae20, 0x000001a6, 0x000001a6, 0x000001aa, 0x000001aa}, {0x0000b284, 0x00000000, 0x00000000, 0x00000550, 0x00000550}, };
PATCH 138/200 quota: Fix race between dqput() and dquot_scan_active()
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <[email protected]>
commit 1362f4ea20fa63688ba6026e586d9746ff13a846 upstream.
Currently last dqput() can race with dquot_scan_active() causing it to call callback for an already deactivated dquot. The race is as follows:
CPU1 CPU2
dqput()
spin_lock(&dq_list_lock);
if (atomic_read(&dquot->dq_count) > 1) {
- not taken
if (test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) {
spin_unlock(&dq_list_lock);
->release_dquot(dquot);
if (atomic_read(&dquot->dq_count) > 1)
- not taken
dquot_scan_active()
spin_lock(&dq_list_lock);
if (!test_bit(DQ_ACTIVE_B, &dquot->dq_flags))
- not taken
atomic_inc(&dquot->dq_count);
spin_unlock(&dq_list_lock);
- proceeds to release dquot
ret = fn(dquot, priv);
- called for inactive dquotFix the problem by making sure possible ->release_dquot() is finished by the time we call the callback and new calls to it will notice reference dquot_scan_active() has taken and bail out.
--- fs/quota/dquot.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
fs/quota/dquot.c +11 -3
@@ -580,9 +580,17 @@ int dquot_scan_active(struct super_blockdqstats_inc (DQST_LOOKUPS );dqput (old_dquot); old_dquot = dquot; - ret =fn (dquot, priv); -if (ret <0 ) - goto out; +/* +* ->release_dquot() can be racing with us. Our reference +* protects us from new calls to it so just wait for any +* outstanding call and recheck the DQ_ACTIVE_B after that. +*/ +wait_on_dquot (dquot); +if (test_bit (DQ_ACTIVE_B , &dquot->dq_flags)) { + ret =fn (dquot, priv); +if (ret <0 ) + goto out; + }spin_lock (&dq_list_lock);/* We are safe to continue now because our dquot could not * be moved out of the inuse list while we hold the reference */
PATCH 139/200 i7core_edac: Fix PCI device reference count
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Jean Delvare <[email protected]>
commit c0f5eeed0f4cef4f05b74883a7160e7edde58b6a upstream.
The reference count changes done by pci_get_device can be a little misleading when the usage diverges from the most common scheme. The reference count of the device passed as the last parameter is always decreased, even if the function returns no new device. So if we are going to try alternative device IDs, we must manually increment the device reference count before each retry. If we don't, we end up decreasing the reference count, and after a few modprobe/rmmod cycles the PCI devices will vanish.
In other words and as Alan put it: without this fix the EDAC code corrupts the PCI device list.
This fixes kernel bug #50491:
https://bugzilla.kernel.org/show_bug.cgi?id=50491
--- drivers/edac/i7core_edac.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/edac/i7core_edac.c +7 -2
@@ -1365,14 +1365,19 @@ static int i7core_get_onedevice(struct p* is at addr 8086:2c40, instead of 8086:2c41. So, we need * to probe for the alternate address in case of failure */ -if (dev_descr->dev_id ==PCI_DEVICE_ID_INTEL_I7_NONCORE && !pdev) +if (dev_descr->dev_id ==PCI_DEVICE_ID_INTEL_I7_NONCORE && !pdev) { +pci_dev_get (*prev);/* pci_get_device will put it */ pdev =pci_get_device (PCI_VENDOR_ID_INTEL ,PCI_DEVICE_ID_INTEL_I7_NONCORE_ALT , *prev); + } -if (dev_descr->dev_id ==PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE && !pdev) +if (dev_descr->dev_id ==PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE && + !pdev) { +pci_dev_get (*prev);/* pci_get_device will put it */ pdev =pci_get_device (PCI_VENDOR_ID_INTEL ,PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE_ALT , *prev); + }if (!pdev) {if (*prev) {
PATCH 140/200 i7300_edac: Fix device reference count
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Jean Delvare <[email protected]>
commit 75135da0d68419ef8a925f4c1d5f63d8046e314d upstream.
pci_get_device() decrements the reference count of "from" (last argument) so when we break off the loop successfully we have only one device reference - and we don't know which device we have. If we want a reference to each device, we must take them explicitly and let the pci_get_device() walk complete to avoid duplicate references.
This is serious, as over-putting device references will cause the device to eventually disappear. Without this fix, the kernel crashes after a few insmod/rmmod cycles.
Tested on an Intel S7000FC4UR system with a 7300 chipset.
--- drivers/edac/i7300_edac.c | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-)
drivers/edac/i7300_edac.c +20 -18
@@ -962,33 +962,35 @@ static int __devinit i7300_get_devices(s/* Attempt to 'get' the MCH register we want */ pdev =NULL ; -while (!pvt->pci_dev_16_1_fsb_addr_map || - !pvt->pci_dev_16_2_fsb_err_regs) { - pdev =pci_get_device (PCI_VENDOR_ID_INTEL , -PCI_DEVICE_ID_INTEL_I7300_MCH_ERR , pdev); -if (!pdev) { -/* End of list, leave */ -i7300_printk (KERN_ERR , -"'system address,Process Bus' " -"device not found:" -"vendor 0x%x device 0x%x ERR funcs " -"(broken BIOS?)\n" , -PCI_VENDOR_ID_INTEL , -PCI_DEVICE_ID_INTEL_I7300_MCH_ERR ); - goto error; - } - +while ((pdev =pci_get_device (PCI_VENDOR_ID_INTEL , +PCI_DEVICE_ID_INTEL_I7300_MCH_ERR , + pdev))) {/* Store device 16 funcs 1 and 2 */ switch (PCI_FUNC (pdev->devfn)) {case 1 : - pvt->pci_dev_16_1_fsb_addr_map = pdev; +if (!pvt->pci_dev_16_1_fsb_addr_map) + pvt->pci_dev_16_1_fsb_addr_map = +pci_dev_get (pdev);break ;case 2 : - pvt->pci_dev_16_2_fsb_err_regs = pdev; +if (!pvt->pci_dev_16_2_fsb_err_regs) + pvt->pci_dev_16_2_fsb_err_regs = +pci_dev_get (pdev);break ; } } +if (!pvt->pci_dev_16_1_fsb_addr_map || + !pvt->pci_dev_16_2_fsb_err_regs) { +/* At least one device was not found */ +i7300_printk (KERN_ERR , +"'system address,Process Bus' device not found:" +"vendor 0x%x device 0x%x ERR funcs (broken BIOS?)\n" , +PCI_VENDOR_ID_INTEL , +PCI_DEVICE_ID_INTEL_I7300_MCH_ERR ); + goto error; + } + debugf1("System Address, processor bus- PCI Bus ID: %s %x:%x\n", pci_name(pvt->pci_dev_16_0_fsb_ctlr), pvt->pci_dev_16_0_fsb_ctlr->vendor,
PATCH 141/200 ioat: fix tasklet tear down
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Dan Williams <[email protected]>
commit da87ca4d4ca101f177fffd84f1f0a5e4c0343557 upstream.
Since commit 77873803363c "net_dma: mark broken" we no longer pin dma engines active for the network-receive-offload use case. As a result the ->free_chan_resources() that occurs after the driver self test no longer has a NET_DMA induced ->alloc_chan_resources() to back it up. A late firing irq can lead to ksoftirqd spinning indefinitely due to the tasklet_disable() performed by ->free_chan_resources(). Only ->alloc_chan_resources() can clear this condition in affected kernels.
This problem has been present since commit 3e037454bcfa "I/OAT: Add support for MSI and MSI-X" in 2.6.24, but is now exposed. Given the NET_DMA use case is deprecated we can revisit moving the driver to use threaded irqs. For now, just tear down the irq and tasklet properly by:
1/ Disable the irq from triggering the tasklet
2/ Disable the irq from re-arming
3/ Flush inflight interrupts
4/ Flush the timer
5/ Flush inflight tasklets
References:
https://lkml.org/lkml/2014/1/27/282
https://lkml.org/lkml/2014/2/19/672
[bwh: Backported to 3.2:
- Adjust context
- As there is no ioatdma_device::irq_mode member, check pci_dev::msix_enabled instead]
---
drivers/dma/ioat/dma.c +39 -7
@@ -75,7 +75,8 @@ static irqreturn_t ioat_dma_do_interrupt attnstatus =readl (instance->reg_base +IOAT_ATTNSTATUS_OFFSET );for_each_set_bit (bit, &attnstatus,BITS_PER_LONG ) { chan =ioat_chan_by_index (instance, bit); -tasklet_schedule (&chan->cleanup_task); +if (test_bit (IOAT_RUN , &chan->state)) +tasklet_schedule (&chan->cleanup_task); }writeb (intrctrl, instance->reg_base +IOAT_INTRCTRL_OFFSET );
@@ -91,7 +92,8 @@ static irqreturn_t ioat_dma_do_interrupt {struct ioat_chan_common *chan = data; -tasklet_schedule (&chan->cleanup_task); +if (test_bit (IOAT_RUN , &chan->state)) +tasklet_schedule (&chan->cleanup_task);return IRQ_HANDLED ; }
@@ -113,7 +115,6 @@ void ioat_init_channel(struct ioatdma_de chan->timer.function = device->timer_fn; chan->timer.data = data;tasklet_init (&chan->cleanup_task, device->cleanup_fn, data); -tasklet_disable (&chan->cleanup_task); }/**
@@ -356,13 +357,43 @@ static int ioat1_dma_alloc_chan_resourcewritel (((u64 ) chan->completion_dma) >>32 , chan->reg_base +IOAT_CHANCMP_OFFSET_HIGH ); -tasklet_enable (&chan->cleanup_task); +set_bit (IOAT_RUN , &chan->state);ioat1_dma_start_null_desc (ioat);/* give chain to dma device */ dev_dbg (to_dev (chan),"%s: allocated %d descriptors\n" , __func__, ioat->desccount);return ioat->desccount; } +void ioat_stop (struct ioat_chan_common *chan) +{ +struct ioatdma_device *device = chan->device; +struct pci_dev *pdev = device->pdev; +int chan_id =chan_num (chan); + +/* 1/ stop irq from firing tasklets +* 2/ stop the tasklet from re-arming irqs +*/ +clear_bit (IOAT_RUN , &chan->state); + +/* flush inflight interrupts */ +#ifdef CONFIG_PCI_MSI +if (pdev->msix_enabled) { +struct msix_entry *msix = &device->msix_entries[chan_id]; +synchronize_irq (msix->vector); + } else +#endif +synchronize_irq (pdev->irq); + +/* flush inflight timers */ +del_timer_sync (&chan->timer); + +/* flush inflight tasklet runs */ +tasklet_kill (&chan->cleanup_task); + +/* final cleanup now that everything is quiesced and can't re-arm */ + device->cleanup_fn ((unsigned long ) &chan->common); +} +/** * ioat1_dma_free_chan_resources - release all the descriptors * @chan: the channel to be cleaned
@@ -381,9 +412,7 @@ static void ioat1_dma_free_chan_resourceif (ioat->desccount ==0 )return ; -tasklet_disable (&chan->cleanup_task); -del_timer_sync (&chan->timer); -ioat1_cleanup (ioat); +ioat_stop (chan);/* Delay 100ms after reset to allow internal DMA logic to quiesce * before removing DMA descriptor resources.
@@ -528,8 +557,11 @@ ioat1_dma_prep_memcpy(struct dma_chan *cstatic void ioat1_cleanup_event (unsigned long data) {struct ioat_dma_chan *ioat =to_ioat_chan ((void *) data); +struct ioat_chan_common *chan = &ioat->base;ioat1_cleanup (ioat); +if (!test_bit (IOAT_RUN , &chan->state)) +return ;writew (IOAT_CHANCTRL_RUN , ioat->base.reg_base +IOAT_CHANCTRL_OFFSET ); }
drivers/dma/ioat/dma.h +1 -0
@@ -344,6 +344,7 @@ bool ioat_cleanup_preamble(struct ioat_c dma_addr_t *phys_complete);void ioat_kobject_add (struct ioatdma_device *device,struct kobj_type *type);void ioat_kobject_del (struct ioatdma_device *device); +void ioat_stop (struct ioat_chan_common *chan);extern const struct sysfs_ops ioat_sysfs_ops;extern struct ioat_sysfs_entry ioat_version_attr;extern struct ioat_sysfs_entry ioat_cap_attr;
drivers/dma/ioat/dma_v2.c +5 -6
@@ -189,8 +189,11 @@ static void ioat2_cleanup(struct ioat2_dvoid ioat2_cleanup_event (unsigned long data) {struct ioat2_dma_chan *ioat =to_ioat2_chan ((void *) data); +struct ioat_chan_common *chan = &ioat->base;ioat2_cleanup (ioat); +if (!test_bit (IOAT_RUN , &chan->state)) +return ;writew (IOAT_CHANCTRL_RUN , ioat->base.reg_base +IOAT_CHANCTRL_OFFSET ); }
@@ -542,10 +545,10 @@ int ioat2_alloc_chan_resources(struct dm ioat->issued =0 ; ioat->tail =0 ; ioat->alloc_order = order; +set_bit (IOAT_RUN , &chan->state);spin_unlock_bh (&ioat->prep_lock);spin_unlock_bh (&chan->cleanup_lock); -tasklet_enable (&chan->cleanup_task);ioat2_start_null_desc (ioat);/* check that we got off the ground */
@@ -555,7 +558,6 @@ int ioat2_alloc_chan_resources(struct dm }while (i++ <20 && !is_ioat_active (status) && !is_ioat_idle (status));if (is_ioat_active (status) ||is_ioat_idle (status)) { -set_bit (IOAT_RUN , &chan->state);return 1 << ioat->alloc_order; }else {u32 chanerr =readl (chan->reg_base +IOAT_CHANERR_OFFSET );
@@ -798,11 +800,8 @@ void ioat2_free_chan_resources(struct dmif (!ioat->ring)return ; -tasklet_disable (&chan->cleanup_task); -del_timer_sync (&chan->timer); - device->cleanup_fn ((unsigned long ) c); +ioat_stop (chan); device->reset_hw (chan); -clear_bit (IOAT_RUN , &chan->state);spin_lock_bh (&chan->cleanup_lock);spin_lock_bh (&ioat->prep_lock);
drivers/dma/ioat/dma_v3.c +3 -0
@@ -325,8 +325,11 @@ static void ioat3_cleanup(struct ioat2_dstatic void ioat3_cleanup_event (unsigned long data) {struct ioat2_dma_chan *ioat =to_ioat2_chan ((void *) data); +struct ioat_chan_common *chan = &ioat->base;ioat3_cleanup (ioat); +if (!test_bit (IOAT_RUN , &chan->state)) +return ;writew (IOAT_CHANCTRL_RUN , ioat->base.reg_base +IOAT_CHANCTRL_OFFSET ); }
PATCH 142/200 ACPI / processor: Rework processor throttling with work_on_cpu()
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Lan Tianyu <[email protected]>
commit f3ca4164529b875374c410193bbbac0ee960895f upstream.
acpi_processor_set_throttling() uses set_cpus_allowed_ptr() to make sure that the (struct acpi_processor)->acpi_processor_set_throttling() callback will run on the right CPU. However, the function may be called from a worker thread already bound to a different CPU in which case that won't work.
Make acpi_processor_set_throttling() use work_on_cpu() as appropriate instead of abusing set_cpus_allowed_ptr().
--- drivers/acpi/processor_throttling.c | 69 +++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 37 deletions(-)
drivers/acpi/processor_throttling.c +32 -37
@@ -59,6 +59,12 @@ struct throttling_tstate {int target_state;/* target T-state */ }; +struct acpi_processor_throttling_arg { +struct acpi_processor *pr; +int target_state; +bool force; +}; +#define THROTTLING_PRECHANGE (1)#define THROTTLING_POSTCHANGE (2)
@@ -1063,16 +1069,24 @@ static int acpi_processor_set_throttlingreturn 0 ; } +static long acpi_processor_throttling_fn (void *data) +{ +struct acpi_processor_throttling_arg *arg = data; +struct acpi_processor *pr = arg->pr; + +return pr->throttling.acpi_processor_set_throttling (pr, + arg->target_state, arg->force); +} +int acpi_processor_set_throttling (struct acpi_processor *pr,int state,bool force) { -cpumask_var_t saved_mask;int ret =0 ;unsigned int i;struct acpi_processor *match_pr;struct acpi_processor_throttling *p_throttling; +struct acpi_processor_throttling_arg arg;struct throttling_tstate t_state; -cpumask_var_t online_throttling_cpus;if (!pr)return -EINVAL ;
@@ -1083,14 +1097,6 @@ int acpi_processor_set_throttling(structif ((state <0 ) || (state > (pr->throttling.state_count -1 )))return -EINVAL ; -if (!alloc_cpumask_var (&saved_mask,GFP_KERNEL )) -return -ENOMEM ; - -if (!alloc_cpumask_var (&online_throttling_cpus,GFP_KERNEL )) { -free_cpumask_var (saved_mask); -return -ENOMEM ; - } -if (cpu_is_offline (pr->id)) {/* * the cpu pointed by pr->id is offline. Unnecessary to change
@@ -1099,17 +1105,15 @@ int acpi_processor_set_throttling(structreturn -ENODEV ; } -cpumask_copy (saved_mask, ¤t->cpus_allowed); t_state.target_state = state; p_throttling = &(pr->throttling); -cpumask_and (online_throttling_cpus, cpu_online_mask, - p_throttling->shared_cpu_map); +/* * The throttling notifier will be called for every * affected cpu in order to get one proper T-state. * The notifier event is THROTTLING_PRECHANGE. */ -for_each_cpu (i, online_throttling_cpus) { +for_each_cpu_and (i, cpu_online_mask, p_throttling->shared_cpu_map) { t_state.cpu = i;acpi_processor_throttling_notifier (THROTTLING_PRECHANGE , &t_state);
@@ -1121,21 +1125,18 @@ int acpi_processor_set_throttling(struct* it can be called only for the cpu pointed by pr. */ if (p_throttling->shared_type ==DOMAIN_COORD_TYPE_SW_ANY ) { -/* FIXME: use work_on_cpu() */ -if (set_cpus_allowed_ptr (current,cpumask_of (pr->id))) { -/* Can't migrate to the pr->id CPU. Exit */ - ret = -ENODEV ; - goto exit; - } - ret = p_throttling->acpi_processor_set_throttling (pr, - t_state.target_state, force); + arg.pr = pr; + arg.target_state = state; + arg.force = force; + ret =work_on_cpu (pr->id, acpi_processor_throttling_fn, &arg); }else {/* * When the T-state coordination is SW_ALL or HW_ALL, * it is necessary to set T-state for every affected * cpus. */ -for_each_cpu (i, online_throttling_cpus) { +for_each_cpu_and (i, cpu_online_mask, + p_throttling->shared_cpu_map) { match_pr =per_cpu (processors, i);/* * If the pointer is invalid, we will report the
@@ -1156,13 +1157,12 @@ int acpi_processor_set_throttling(struct "on CPU %d\n", i));continue ; } - t_state.cpu = i; -/* FIXME: use work_on_cpu() */ -if (set_cpus_allowed_ptr (current,cpumask_of (i))) -continue ; - ret = match_pr->throttling. -acpi_processor_set_throttling ( - match_pr, t_state.target_state, force); + + arg.pr = match_pr; + arg.target_state = state; + arg.force = force; + ret =work_on_cpu (pr->id, acpi_processor_throttling_fn, + &arg); } }/*
@@ -1171,17 +1171,12 @@ int acpi_processor_set_throttling(struct* affected cpu to update the T-states. * The notifier event is THROTTLING_POSTCHANGE */ -for_each_cpu (i, online_throttling_cpus) { +for_each_cpu_and (i, cpu_online_mask, p_throttling->shared_cpu_map) { t_state.cpu = i;acpi_processor_throttling_notifier (THROTTLING_POSTCHANGE , &t_state); } -/* restore the previous state */ -/* FIXME: use work_on_cpu() */ -set_cpus_allowed_ptr (current, saved_mask); -exit: -free_cpumask_var (online_throttling_cpus); -free_cpumask_var (saved_mask); +return ret; }
PATCH 143/200 USB: serial: ftdi_sio: add id for Z3X Box device
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Алексей Крамаренко
<[email protected]>
commit e1466ad5b1aeda303f9282463d55798d2eda218c upstream.
Custom VID/PID for Z3X Box device, popular tool for cellphone flashing.
--- drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio_ids.h | 6 ++++++ 2 files changed, 7 insertions(+)
drivers/usb/serial/ftdi_sio.c +1 -0
@@ -917,6 +917,7 @@ static struct usb_device_id id_table_com { USB_DEVICE(FTDI_VID, FTDI_LUMEL_PD12_PID) },/* Crucible Devices */ { USB_DEVICE(FTDI_VID, FTDI_CT_COMET_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_Z3X_PID) }, { }, /* Optional parameter entry */ { } /* Terminating entry */ };
drivers/usb/serial/ftdi_sio_ids.h +6 -0
@@ -1314,3 +1314,9 @@* Manufacturer: Crucible Technologies */ #define FTDI_CT_COMET_PID 0x8e08 + +/* +* Product: Z3X Box +* Manufacturer: Smart GSM Team +*/ +#define FTDI_Z3X_PID 0x0011
PATCH 144/200 USB: ftdi_sio: add Cressi Leonardo PID
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Joerg Dorchain <[email protected]>
commit 6dbd46c849e071e6afc1e0cad489b0175bca9318 upstream.
Hello,
the following patch adds an entry for the PID of a Cressi Leonardo diving computer interface to kernel 3.13.0.
It is detected as FT232RL.
Works with subsurface.
--- drivers/usb/serial/ftdi_sio.c | 2 ++ drivers/usb/serial/ftdi_sio_ids.h | 6 ++++++ 2 files changed, 8 insertions(+)
drivers/usb/serial/ftdi_sio.c +2 -0
@@ -918,6 +918,8 @@ static struct usb_device_id id_table_com/* Crucible Devices */ { USB_DEVICE(FTDI_VID, FTDI_CT_COMET_PID) }, { USB_DEVICE(FTDI_VID, FTDI_Z3X_PID) }, +/* Cressi Devices */ + { USB_DEVICE(FTDI_VID, FTDI_CRESSI_PID) }, { }, /* Optional parameter entry */ { } /* Terminating entry */ };
drivers/usb/serial/ftdi_sio_ids.h +6 -0
@@ -1320,3 +1320,9 @@* Manufacturer: Smart GSM Team */ #define FTDI_Z3X_PID 0x0011 + +/* +* Product: Cressi PC Interface +* Manufacturer: Cressi +*/ +#define FTDI_CRESSI_PID 0x87d0
PATCH 145/200 usb: ehci: fix deadlock when threadirqs option is used
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Stanislaw Gruszka <[email protected]>
commit a1227f3c1030e96ebc51d677d2f636268845c5fb upstream.
ehci_irq() and ehci_hrtimer_func() can deadlock on ehci->lock when threadirqs option is used. To prevent the deadlock use spin_lock_irqsave() in ehci_irq().
This change can be reverted when hrtimer callbacks become threaded.
--- drivers/usb/host/ehci-hcd.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/usb/host/ehci-hcd.c +10 -3
@@ -807,8 +807,15 @@ static irqreturn_t ehci_irq (struct usb_struct ehci_hcd *ehci =hcd_to_ehci (hcd);u32 status, masked_status, pcd_status =0 , cmd;int bh; +unsigned long flags; -spin_lock (&ehci->lock); +/* +* For threadirqs option we use spin_lock_irqsave() variant to prevent +* deadlock with ehci hrtimer callback, because hrtimer callbacks run +* in interrupt context even when threadirqs is specified. We can go +* back to spin_lock() variant when hrtimer callbacks become threaded. +*/ +spin_lock_irqsave (&ehci->lock, flags); status =ehci_readl (ehci, &ehci->regs->status);
@@ -826,7 +833,7 @@ static irqreturn_t ehci_irq (struct usb_/* Shared IRQ? */ if (!masked_status ||unlikely (ehci->rh_state ==EHCI_RH_HALTED )) { -spin_unlock (&ehci->lock); +spin_unlock_irqrestore (&ehci->lock, flags);return IRQ_NONE ; }
@@ -929,7 +936,7 @@ dead:if (bh)ehci_work (ehci); -spin_unlock (&ehci->lock); +spin_unlock_irqrestore (&ehci->lock, flags);if (pcd_status)usb_hcd_poll_rh_status (hcd);return IRQ_HANDLED ;
PATCH 146/200 ASoC: sta32x: Fix wrong enum for limiter2 release rate
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit b3619b288b621e63f66908045f48495869a996a6 upstream.
There is a typo in the Limiter2 Release Rate control, a wrong enum for Limiter1 is assigned. It must point to Limiter2.
Spotted by a compile warning:
In file included from sound/soc/codecs/sta32x.c:34:0:sound/soc/codecs/sta32x.c:223:29: warning: ‘sta32x_limiter2_release_rate_enum’ defined but not used [-Wunused-variable]
static SOC_ENUM_SINGLE_DECL(sta32x_limiter2_release_rate_enum,
^
include/sound/soc.h:275:18: note: in definition of macro ‘SOC_ENUM_DOUBLE_DECL’
struct soc_enum name = SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, \
^
sound/soc/codecs/sta32x.c:223:8: note: in expansion of macro ‘SOC_ENUM_SINGLE_DECL’
static SOC_ENUM_SINGLE_DECL(sta32x_limiter2_release_rate_enum,
^--- sound/soc/codecs/sta32x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/sta32x.c +1 -1
@@ -350,7 +350,7 @@ SOC_SINGLE_TLV("Treble Tone Control", STSOC_ENUM ("Limiter1 Attack Rate (dB/ms)" , sta32x_limiter1_attack_rate_enum),SOC_ENUM ("Limiter2 Attack Rate (dB/ms)" , sta32x_limiter2_attack_rate_enum),SOC_ENUM ("Limiter1 Release Rate (dB/ms)" , sta32x_limiter1_release_rate_enum), -SOC_ENUM ("Limiter2 Release Rate (dB/ms)" , sta32x_limiter1_release_rate_enum), +SOC_ENUM ("Limiter2 Release Rate (dB/ms)" , sta32x_limiter2_release_rate_enum),/* depending on mode, the attack/release thresholds have * two different enum definitions; provide both
PATCH 147/200 iwlwifi: fix TX status for aggregated packets
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
commit 143582c6847cb285b361804c613127c25de60ca4 upstream.
Only the first packet is currently handled correctly, but then all others are assumed to have failed which is problematic. Fix this, marking them all successful instead (since if they're not then the firmware will have transmitted them as single frames.)
This fixes the lost packet reporting.
Also do a tiny variable scoping cleanup.
[bwh: Backported to 3.2:
- Drop the mvm part
- Adjust filename, context]
---
drivers/net/wireless/iwlwifi/iwl-agn-tx.c +11 -5
@@ -854,8 +854,6 @@ int iwlagn_rx_reply_compressed_ba(structstruct iwl_compressed_ba_resp *ba_resp = &pkt->u.compressed_ba;struct iwl_ht_agg *agg;struct sk_buff_head reclaimed_skbs; -struct ieee80211_tx_info *info; -struct ieee80211_hdr *hdr;struct sk_buff *skb;unsigned long flags;int sta_id;
@@ -941,24 +939,32 @@ int iwlagn_rx_reply_compressed_ba(struct 0, &reclaimed_skbs); freed =0 ;while (!skb_queue_empty (&reclaimed_skbs)) { +struct ieee80211_hdr *hdr; +struct ieee80211_tx_info *info; skb =__skb_dequeue (&reclaimed_skbs); - hdr = (struct ieee80211_hdr *)skb->data; + hdr = (void *)skb->data; + info =IEEE80211_SKB_CB (skb);if (ieee80211_is_data_qos (hdr->frame_control)) freed++;else WARN_ON_ONCE (1 ); - info =IEEE80211_SKB_CB (skb);kmem_cache_free (priv->tx_cmd_pool, (info->driver_data[1 ])); +memset (&info->status,0 ,sizeof (info->status)); +/* Packet was transmitted successfully, failures come as single +* frames because before failing a frame the firmware transmits +* it without aggregation at least once. +*/ + info->flags |=IEEE80211_TX_STAT_ACK ; +if (freed ==1 ) {/* this is the first skb we deliver in this batch */ /* put the rate scaling data there */ info =IEEE80211_SKB_CB (skb);memset (&info->status,0 ,sizeof (info->status)); - info->flags |=IEEE80211_TX_STAT_ACK ; info->flags |=IEEE80211_TX_STAT_AMPDU ; info->status.ampdu_ack_len = ba_resp->txed_2_done; info->status.ampdu_len = ba_resp->txed;
PATCH 148/200 genirq: Remove racy waitqueue_active check
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Chuansheng Liu <[email protected]>
commit c685689fd24d310343ac33942e9a54a974ae9c43 upstream.
We hit one rare case below:
T1 calling disable_irq(), but hanging at synchronize_irq() always;
The corresponding irq thread is in sleeping state; And all CPUs are in idle state;
After analysis, we found there is one possible scenerio which causes T1 is waiting there forever:
CPU0 CPU1
synchronize_irq()
wait_event()
spin_lock()
atomic_dec_and_test(&threads_active)
insert the __wait into queue
spin_unlock()
if(waitqueue_active)
atomic_read(&threads_active)
wake_up()Here after inserted the __wait into queue on CPU0, and before test if queue is empty on CPU1, there is no barrier, it maybe cause it is not visible for CPU1 immediately, although CPU0 has updated the queue list.
It is similar for CPU0 atomic_read() threads_active also.
So we'd need one smp_mb() before waitqueue_active.that, but removing the waitqueue_active() check solves it as wel l and it makes things simple and clear.
---
kernel/irq/manage.c +1 -1
@@ -819,7 +819,7 @@ static int irq_thread(void *data) wake =atomic_dec_and_test (&desc->threads_active); -if (wake &&waitqueue_active (&desc->wait_for_threads)) +if (wake)wake_up (&desc->wait_for_threads); }
PATCH 149/200 sched: Fix double normalization of vruntime
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: George McCollister <[email protected]>
commit 791c9e0292671a3bfa95286bb5c08129d8605618 upstream.
dequeue_entity() is called when p->on_rq and sets se->on_rq = 0 which appears to guarentee that the !se->on_rq condition is met. If the task has done set_current_state(TASK_INTERRUPTIBLE) without schedule() the second condition will be met and vruntime will be incorrectly adjusted twice.
In certain cases this can result in the task's vruntime never increasing past the vruntime of other tasks on the CFS' run queue, starving them of CPU time.
This patch changes switched_from_fair() to use !p->on_rq instead of !se->on_rq.
I'm able to cause a task with a priority of 120 to starve all other tasks with the same priority on an ARM platform running 3.2.51-rt72 PREEMPT RT by writing one character at time to a serial tty (16550 UART) in a tight loop. I'm also able to verify making this change corrects the problem on that platform and kernel version.
--- kernel/sched_fair.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/sched_fair.c +4 -4
@@ -4953,15 +4953,15 @@ static void switched_from_fair(struct rqstruct cfs_rq *cfs_rq =cfs_rq_of (se);/* -* Ensure the task's vruntime is normalized, so that when its +* Ensure the task's vruntime is normalized, so that when it's * switched back to the fair class the enqueue_entity(.flags=0) will * do the right thing. * -* If it was on_rq, then the dequeue_entity(.flags=0) will already -* have normalized the vruntime, if it was !on_rq, then only when +* If it's on_rq, then the dequeue_entity(.flags=0) will already +* have normalized the vruntime, if it's !on_rq, then only when * the task is sleeping will it still have non-normalized vruntime. */ -if (!se->on_rq && p->state !=TASK_RUNNING ) { +if (!p->on_rq && p->state !=TASK_RUNNING ) {/* * Fix up our vruntime so that the current sleep doesn't * cause 'unlimited' sleep bonus.
PATCH 150/200 perf/x86: Fix event scheduling
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <[email protected]>
commit 26e61e8939b1fe8729572dabe9a9e97d930dd4f6 upstream.
Vince "Super Tester" Weaver reported a new round of syscall fuzzing (Trinity) failures, with perf WARN_ON()s triggering. He also provided traces of the failures.
This is I think the relevant bit:
> pec_1076_warn-2804 [000] d... 147.926153: x86_pmu_disable: x86_pmu_disable
> pec_1076_warn-2804 [000] d... 147.926153: x86_pmu_state: Events: {
> pec_1076_warn-2804 [000] d... 147.926156: x86_pmu_state: 0: state: .R config: ffffffffffffffff ( (null))
> pec_1076_warn-2804 [000] d... 147.926158: x86_pmu_state: 33: state: AR config: 0 (ffff88011ac99800)
> pec_1076_warn-2804 [000] d... 147.926159: x86_pmu_state: }
> pec_1076_warn-2804 [000] d... 147.926160: x86_pmu_state: n_events: 1, n_added: 0, n_txn: 1
> pec_1076_warn-2804 [000] d... 147.926161: x86_pmu_state: Assignment: {
> pec_1076_warn-2804 [000] d... 147.926162: x86_pmu_state: 0->33 tag: 1 config: 0 (ffff88011ac99800)
> pec_1076_warn-2804 [000] d... 147.926163: x86_pmu_state: }
> pec_1076_warn-2804 [000] d... 147.926166: collect_events: Adding event: 1 (ffff880119ec8800)So we add the insn:p event (fd[23]).
At this point we should have:
n_events = 2, n_added = 1, n_txn = 1
> pec_1076_warn-2804 [000] d... 147.926170: collect_events: Adding event: 0 (ffff8800c9e01800) > pec_1076_warn-2804 [000] d... 147.926172: collect_events: Adding event: 4 (ffff8800cbab2c00)
We try and add the {BP,cycles,br_insn} group (fd[3], fd[4], fd[15]). These events are 0:cycles and 4:br_insn, the BP event isn't x86_pmu so that's not visible.
group_sched_in() pmu->start_txn() /* nop - BP pmu */ event_sched_in() event->pmu->add()
So here we should end up with:
0: n_events = 3, n_added = 2, n_txn = 2
4: n_events = 4, n_added = 3, n_txn = 3
But seeing the below state on x86_pmu_enable(), the must have failed, because the 0 and 4 events aren't there anymore.
Looking at group_sched_in(), since the BP is the leader, its event_sched_in() must have succeeded, for otherwise we would not have seen the sibling adds.
But since neither 0 or 4 are in the below state; their event_sched_in() must have failed; but I don't see why, the complete state: 0,0,1:p,4 fits perfectly fine on a core2.
However, since we try and schedule 4 it means the 0 event must have succeeded! Therefore the 4 event must have failed, its failure will have put group_sched_in() into the fail path, which will call:
event_sched_out() event->pmu->del()
on 0 and the BP event.
Now x86_pmu_del() will reduce n_events; but it will not reduce n_added; giving what we see below:
n_event = 2, n_added = 2, n_txn = 2
> pec_1076_warn-2804 [000] d... 147.926177: x86_pmu_enable: x86_pmu_enable
> pec_1076_warn-2804 [000] d... 147.926177: x86_pmu_state: Events: {
> pec_1076_warn-2804 [000] d... 147.926179: x86_pmu_state: 0: state: .R config: ffffffffffffffff ( (null))
> pec_1076_warn-2804 [000] d... 147.926181: x86_pmu_state: 33: state: AR config: 0 (ffff88011ac99800)
> pec_1076_warn-2804 [000] d... 147.926182: x86_pmu_state: }
> pec_1076_warn-2804 [000] d... 147.926184: x86_pmu_state: n_events: 2, n_added: 2, n_txn: 2
> pec_1076_warn-2804 [000] d... 147.926184: x86_pmu_state: Assignment: {
> pec_1076_warn-2804 [000] d... 147.926186: x86_pmu_state: 0->33 tag: 1 config: 0 (ffff88011ac99800)
> pec_1076_warn-2804 [000] d... 147.926188: x86_pmu_state: 1->0 tag: 1 config: 1 (ffff880119ec8800)
> pec_1076_warn-2804 [000] d... 147.926188: x86_pmu_state: }
> pec_1076_warn-2804 [000] d... 147.926190: x86_pmu_enable: S0: hwc->idx: 33, hwc->last_cpu: 0, hwc->last_tag: 1 hwc->state: 0So the problem is that x86_pmu_del(), when called from a group_sched_in() that fails (for whatever reason), and without x86_pmu TXN support (because the leader is !x86_pmu), will corrupt the n_added state.
--- arch/x86/kernel/cpu/perf_event.c | 3 +++ 1 file changed, 3 insertions(+)
arch/x86/kernel/cpu/perf_event.c +3 -0
@@ -971,6 +971,9 @@ static void x86_pmu_del(struct perf_evenfor (i =0 ; i < cpuc->n_events; i++) {if (event == cpuc->event_list[i]) { +if (i >= cpuc->n_events - cpuc->n_added) + --cpuc->n_added; +if (x86_pmu.put_event_constraints) x86_pmu.put_event_constraints (cpuc, event);
PATCH 151/200 perf: Fix hotplug splat
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <[email protected]>
commit e3703f8cdfcf39c25c4338c3ad8e68891cca3731 upstream.
Drew Richardson reported that he could make the kernel go *boom* when hotplugging while having perf events active.
It turned out that when you have a group event, the code in __perf_event_exit_context() fails to remove the group siblings from the context.
We then proceed with destroying and freeing the event, and when you re-plug the CPU and try and add another event to that CPU, things go *boom* because you've still got dead entries there.
--- kernel/events/core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
kernel/events/core.c +6 -6
@@ -7101,14 +7101,14 @@ static void perf_pmu_rotate_stop(structstatic void __perf_event_exit_context (void *__info) {struct perf_event_context *ctx = __info; -struct perf_event *event, *tmp; +struct perf_event *event;perf_pmu_rotate_stop (ctx->pmu); -list_for_each_entry_safe (event, tmp, &ctx->pinned_groups, group_entry) -__perf_remove_from_context (event); -list_for_each_entry_safe (event, tmp, &ctx->flexible_groups, group_entry) +rcu_read_lock (); +list_for_each_entry_rcu (event, &ctx->event_list, event_entry)__perf_remove_from_context (event); +rcu_read_unlock (); }static void perf_event_exit_cpu_context (int cpu)
@@ -7132,11 +7132,11 @@ static void perf_event_exit_cpu(int cpu) {struct swevent_htable *swhash = &per_cpu (swevent_htable, cpu); +perf_event_exit_cpu_context (cpu); +mutex_lock (&swhash->hlist_mutex);swevent_hlist_release (swhash);mutex_unlock (&swhash->hlist_mutex); - -perf_event_exit_cpu_context (cpu); }#else static inline void perf_event_exit_cpu (int cpu) { }
PATCH 152/200 cpuset: fix a race condition in __cpuset_node_allowed_softwall()
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Li Zefan <[email protected]>
commit 99afb0fd5f05aac467ffa85c36778fec4396209b upstream.
It's not safe to access task's cpuset after releasing task_lock(). Holding callback_mutex won't help.
--- kernel/cpuset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/cpuset.c +1 -1
@@ -2366,9 +2366,9 @@ int __cpuset_node_allowed_softwall(int ntask_lock (current); cs =nearest_hardwall_ancestor (task_cs (current)); + allowed =node_isset (node, cs->mems_allowed);task_unlock (current); - allowed =node_isset (node, cs->mems_allowed);mutex_unlock (&callback_mutex);return allowed; }
PATCH 153/200 powerpc/le: Ensure that the 'stop-self' RTAS token is handled correctly
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Tony Breeds <[email protected]>
commit 41dd03a94c7d408d2ef32530545097f7d1befe5c upstream.
Currently we're storing a host endian RTAS token in rtas_stop_self_args.token. We then pass that directly to rtas. This is fine on big endian however on little endian the token is not what we expect.
This will typically result in hitting:
panic("Alas, I survived.\n");To fix this we always use the stop-self token in host order and always convert it to be32 before passing this to rtas.
--- arch/powerpc/platforms/pseries/hotplug-cpu.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
arch/powerpc/platforms/pseries/hotplug-cpu.c +11 -11
@@ -35,12 +35,7 @@#include "offline_states.h" /* This version can't take the spinlock, because it never returns */ -static struct rtas_args rtas_stop_self_args = { - .token =RTAS_UNKNOWN_SERVICE , - .nargs =0 , - .nret =1 , - .rets = &rtas_stop_self_args.args[0 ], -}; +static int rtas_stop_self_token =RTAS_UNKNOWN_SERVICE ; static DEFINE_PER_CPU(enum cpu_state_vals, preferred_offline_state) =CPU_STATE_OFFLINE ;
@@ -93,15 +88,20 @@ void set_default_offline_state(int cpu)static void rtas_stop_self (void ) { -struct rtas_args *args = &rtas_stop_self_args; +struct rtas_args args = { + .token =cpu_to_be32 (rtas_stop_self_token), + .nargs =0 , + .nret =1 , + .rets = &args.args[0 ], + };local_irq_disable (); -BUG_ON (args->token ==RTAS_UNKNOWN_SERVICE ); +BUG_ON (rtas_stop_self_token ==RTAS_UNKNOWN_SERVICE );printk ("cpu %u (hwid %u) Ready to die...\n" ,smp_processor_id (),hard_smp_processor_id ()); -enter_rtas (__pa (args)); +enter_rtas (__pa (&args));panic ("Alas, I survived.\n" ); }
@@ -384,10 +384,10 @@ static int __init pseries_cpu_hotplug_in } } - rtas_stop_self_args.token =rtas_token ("stop-self" ); + rtas_stop_self_token =rtas_token ("stop-self" ); qcss_tok =rtas_token ("query-cpu-stopped-state" ); -if (rtas_stop_self_args.token ==RTAS_UNKNOWN_SERVICE || +if (rtas_stop_self_token ==RTAS_UNKNOWN_SERVICE || qcss_tok ==RTAS_UNKNOWN_SERVICE ) {printk (KERN_INFO "CPU Hotplug not supported by firmware " "- disabling.\n" );
PATCH 154/200 powerpc/crashdump : Fix page frame number check in copy_oldmem_page
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Laurent Dufour <[email protected]>
commit f5295bd8ea8a65dc5eac608b151386314cb978f1 upstream.
In copy_oldmem_page, the current check using max_pfn and min_low_pfn to decide if the page is backed or not, is not valid when the memory layout is not continuous.
This happens when running as a QEMU/KVM guest, where RTAS is mapped higher in the memory. In that case max_pfn points to the end of RTAS, and a hole between the end of the kdump kernel and RTAS is not backed by PTEs. As a consequence, the kdump kernel is crashing in copy_oldmem_page when accessing in a direct way the pages in that hole.
This fix relies on the memblock's service memblock_is_region_memory to check if the read page is part or not of the directly accessible memory.
--- arch/powerpc/kernel/crash_dump.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
arch/powerpc/kernel/crash_dump.c +5 -3
@@ -108,17 +108,19 @@ ssize_t copy_oldmem_page(unsigned long p size_t csize, unsigned long offset, int userbuf) { void *vaddr; +phys_addr_t paddr;if (!csize)return 0 ; csize =min_t (size_t, csize,PAGE_SIZE ); + paddr = pfn <<PAGE_SHIFT ; -if ((min_low_pfn < pfn) && (pfn < max_pfn)) { - vaddr =__va (pfn <<PAGE_SHIFT ); +if (memblock_is_region_memory (paddr, csize)) { + vaddr =__va (paddr); csize =copy_oldmem_vaddr (vaddr, buf, csize, offset, userbuf); }else { - vaddr =__ioremap (pfn <<PAGE_SHIFT ,PAGE_SIZE ,0 ); + vaddr =__ioremap (paddr,PAGE_SIZE ,0 ); csize =copy_oldmem_vaddr (vaddr, buf, csize, offset, userbuf);iounmap (vaddr); }
PATCH 155/200 can: flexcan: fix shutdown: first disable chip, then all interrupts
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Marc Kleine-Budde <[email protected]>
commit 5be93bdda64e85450598c6e97f79fb8f6acf30e0 upstream.
When shutting down the CAN interface (ifconfig canX down) during high CAN bus loads, the CAN core might hang and freeze the whole CPU.
This patch fixes the shutdown sequence by first disabling the CAN core then disabling all interrupts.
--- drivers/net/can/flexcan.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/can/flexcan.c +5 -3
@@ -777,14 +777,16 @@ static void flexcan_chip_stop(struct netstruct flexcan_regs __iomem *regs = priv->base;u32 reg; -/* Disable all interrupts */ -flexcan_write (0 , ®s->imask1); -/* Disable + halt module */ reg =flexcan_read (®s->mcr); reg |=FLEXCAN_MCR_MDIS |FLEXCAN_MCR_HALT ;flexcan_write (reg, ®s->mcr); +/* Disable all interrupts */ +flexcan_write (0 , ®s->imask1); +flexcan_write (priv->reg_ctrl_default & ~FLEXCAN_CTRL_ERR_ALL , + ®s->ctrl); +flexcan_transceiver_switch (priv,0 ); priv->can.state =CAN_STATE_STOPPED ;
PATCH 156/200 can: flexcan: flexcan_open(): fix error path if flexcan_chip_start() fails
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Marc Kleine-Budde <[email protected]>
commit 7e9e148af01ef388efb6e2490805970be4622792 upstream.
If flexcan_chip_start() in flexcan_open() fails, the interrupt is not freed, this patch adds the missing cleanup.
--- drivers/net/can/flexcan.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/can/flexcan.c +3 -1
@@ -811,12 +811,14 @@ static int flexcan_open(struct net_devic/* start chip and queuing */ err =flexcan_chip_start (dev);if (err) - goto out_close; + goto out_free_irq;napi_enable (&priv->napi);netif_start_queue (dev);return 0 ; + out_free_irq: +free_irq (dev->irq, dev); out_close:close_candev (dev); out:
PATCH 157/200 can: flexcan: flexcan_remove(): add missing netif_napi_del()
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Marc Kleine-Budde <[email protected]>
commit d96e43e8fce28cf97df576a07af9d65657a41a6f upstream.
This patch adds the missing netif_napi_del() to the flexcan_remove() function.
---
drivers/net/can/flexcan.c +1 -0
@@ -1027,6 +1027,7 @@ static int __devexit flexcan_remove(strustruct resource *mem;unregister_flexcandev (dev); +netif_napi_del (&priv->napi);platform_set_drvdata (pdev,NULL );iounmap (priv->base);
PATCH 158/200 tracing: Do not add event files for modules that fail tracepoints
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: "Steven Rostedt (Red Hat)" <[email protected]>
commit 45ab2813d40d88fc575e753c38478de242d03f88 upstream.
If a module fails to add its tracepoints due to module tainting, do not create the module event infrastructure in the debugfs directory. As the events will not work and worse yet, they will silently fail, making the user wonder why the events they enable do not display anything.
Having a warning on module load and the events not visible to the users will make the cause of the problem much clearer.
--- include/linux/tracepoint.h | 6 ++++++ kernel/trace/trace_events.c | 10 ++++++++++ kernel/tracepoint.c | 7 ++++++- 3 files changed, 22 insertions(+), 1 deletion(-)
include/linux/tracepoint.h +6 -0
@@ -60,6 +60,12 @@ struct tp_module {unsigned int num_tracepoints;struct tracepoint *const *tracepoints_ptrs; }; +bool trace_module_has_bad_taint (struct module *mod); +#else +static inline bool trace_module_has_bad_taint (struct module *mod) +{ +return false; +}#endif /* CONFIG_MODULES */ struct tracepoint_iter {
kernel/trace/trace_events.c +10 -0
@@ -1345,6 +1345,16 @@ static void trace_module_add_events(strustruct ftrace_module_file_ops *file_ops =NULL ;struct ftrace_event_call **call, **start, **end; +if (!mod->num_trace_events) +return ; + +/* Don't add infrastructure for mods without tracepoints */ +if (trace_module_has_bad_taint (mod)) { +pr_err ("%s: module has bad taint, not creating trace events\n" , + mod->name); +return ; + } + start = mod->trace_events; end = mod->trace_events + mod->num_trace_events;
kernel/tracepoint.c +6 -1
@@ -628,6 +628,11 @@ void tracepoint_iter_reset(struct tracepEXPORT_SYMBOL_GPL (tracepoint_iter_reset);#ifdef CONFIG_MODULES +bool trace_module_has_bad_taint (struct module *mod) +{ +return mod->taints & ~((1 <<TAINT_OOT_MODULE ) | (1 <<TAINT_CRAP )); +} +static int tracepoint_module_coming (struct module *mod) {struct tp_module *tp_mod, *iter;
@@ -638,7 +643,7 @@ static int tracepoint_module_coming(stru* module headers (for forced load), to make sure we don't cause a crash. * Staging and out-of-tree GPL modules are fine. */ -if (mod->taints & ~((1 <<TAINT_OOT_MODULE ) | (1 <<TAINT_CRAP ))) +if (trace_module_has_bad_taint (mod))return 0 ;mutex_lock (&tracepoints_mutex); tp_mod =kmalloc (sizeof (struct tp_module ),GFP_KERNEL );
PATCH 159/200 ocfs2: fix quota file corruption
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <[email protected]>
commit 15c34a760630ca2c803848fba90ca0646a9907dd upstream.
Global quota files are accessed from different nodes. Thus we cannot cache offset of quota structure in the quota file after we drop our node reference count to it because after that moment quota structure may be freed and reallocated elsewhere by a different node resulting in corruption of quota file.
Fix the problem by clearing dq_off when we are releasing dquot structure. We also remove the DB_READ_B handling because it is useless - DQ_ACTIVE_B is set iff DQ_READ_B is set.
--- fs/ocfs2/quota_global.c | 27 +++++++++++++++++---------- fs/ocfs2/quota_local.c | 4 ---- 2 files changed, 17 insertions(+), 14 deletions(-)
fs/ocfs2/quota_global.c +17 -10
@@ -712,6 +712,12 @@ static int ocfs2_release_dquot(struct dq*/ if (status <0 )mlog_errno (status); +/* +* Clear dq_off so that we search for the structure in quota file next +* time we acquire it. The structure might be deleted and reallocated +* elsewhere by another node while our dquot structure is on freelist. +*/ + dquot->dq_off =0 ;clear_bit (DQ_ACTIVE_B , &dquot->dq_flags); out_trans:ocfs2_commit_trans (osb, handle);
@@ -750,16 +756,17 @@ static int ocfs2_acquire_dquot(struct dq status =ocfs2_lock_global_qf (info,1 );if (status <0 ) goto out; -if (!test_bit (DQ_READ_B , &dquot->dq_flags)) { - status =ocfs2_qinfo_lock (info,0 ); -if (status <0 ) - goto out_dq; - status =qtree_read_dquot (&info->dqi_gi, dquot); -ocfs2_qinfo_unlock (info,0 ); -if (status <0 ) - goto out_dq; - } -set_bit (DQ_READ_B , &dquot->dq_flags); + status =ocfs2_qinfo_lock (info,0 ); +if (status <0 ) + goto out_dq; +/* +* We always want to read dquot structure from disk because we don't +* know what happened with it while it was on freelist. +*/ + status =qtree_read_dquot (&info->dqi_gi, dquot); +ocfs2_qinfo_unlock (info,0 ); +if (status <0 ) + goto out_dq;OCFS2_DQUOT (dquot)->dq_use_count++;OCFS2_DQUOT (dquot)->dq_origspace = dquot->dq_dqb.dqb_curspace;
fs/ocfs2/quota_local.c +0 -4
@@ -1300,10 +1300,6 @@ int ocfs2_local_release_dquot(handle_t *ocfs2_journal_dirty (handle, od->dq_chunk->qc_headerbh); out: -/* Clear the read bit so that next time someone uses this -* dquot he reads fresh info from disk and allocates local -* dquot structure */ -clear_bit (DQ_READ_B , &dquot->dq_flags);return status; }
PATCH 160/200 ALSA: usb-audio: Add quirk for Logitech Webcam C500
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit e805ca8b0a9b6c91099c0eaa4b160a1196a4ae25 upstream.
Logitech C500 (046d:0807) needs the same workaround like other Logitech Webcams.
--- sound/usb/mixer.c | 1 + 1 file changed, 1 insertion(+)
sound/usb/mixer.c +1 -0
@@ -831,6 +831,7 @@ static void volume_control_quirks(struct }break ; +case USB_ID (0x046d ,0x0807 ):/* Logitech Webcam C500 */ case USB_ID (0x046d ,0x0808 ):case USB_ID (0x046d ,0x0809 ):case USB_ID (0x046d ,0x081b ):/* HD Webcam c310 */
PATCH 161/200 mac80211: clear sequence/fragment number in QoS-null frames
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
commit 864a6040f395464003af8dd0d8ca86fed19866d4 upstream.
Avoid leaking data by sending uninitialized memory and setting an invalid (non-zero) fragment number (the sequence number is ignored anyway) by setting the seq_ctrl field to zero.
---
net/mac80211/sta_info.c +1 -0
@@ -1211,6 +1211,7 @@ static void ieee80211_send_null_responsememcpy (nullfunc->addr1, sta->sta.addr,ETH_ALEN );memcpy (nullfunc->addr2, sdata->vif.addr,ETH_ALEN );memcpy (nullfunc->addr3, sdata->vif.addr,ETH_ALEN ); + nullfunc->seq_ctrl =0 ; skb->priority = tid;skb_set_queue_mapping (skb, ieee802_1d_to_ac[tid]);
PATCH 162/200 ACPI / EC: Clear stale EC events on Samsung systems
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Kieran Clancy <[email protected]>
commit ad332c8a45330d170bb38b95209de449b31cd1b4 upstream.
A number of Samsung notebooks (530Uxx/535Uxx/540Uxx/550Pxx/900Xxx/etc) continue to log events during sleep (lid open/close, AC plug/unplug, battery level change), which accumulate in the EC until a buffer fills. After the buffer is full (tests suggest it holds 8 events), GPEs stop being triggered for new events. This state persists on wake or even on power cycle, and prevents new events from being registered until the EC is manually polled.
This is the root cause of a number of bugs, including AC not being detected properly, lid close not triggering suspend, and low ambient light not triggering the keyboard backlight. The bug also seemed to be responsible for performance issues on at least one user's machine.
Juan Manuel Cabo found the cause of bug and the workaround of polling the EC manually on wake.
The loop which clears the stale events is based on an earlier patch by Lan Tianyu (see referenced attachment).
This patch:
- Adds a function acpi_ec_clear() which polls the EC for stale _Q events at most ACPI_EC_CLEAR_MAX (currently 100) times. A warning is logged if this limit is reached.
- Adds a flag EC_FLAGS_CLEAR_ON_RESUME which is set to 1 if the DMI system vendor is Samsung. This check could be replaced by several more specific DMI vendor/product pairs, but it's likely that the bug affects more Samsung products than just the five series mentioned above. Further, it should not be harmful to run acpi_ec_clear() on systems without the bug; it will return immediately after finding no data waiting.
- Runs acpi_ec_clear() on initialisation (boot), from acpi_ec_add()
- Runs acpi_ec_clear() on wake, from acpi_ec_unblock_transactions()
References: https://bugzilla.kernel.org/show_bug.cgi?id=44161
References: https://bugzilla.kernel.org/show_bug.cgi?id=45461
References: https://bugzilla.kernel.org/show_bug.cgi?id=57271
References: https://bugzilla.kernel.org/attachment.cgi?id=126801
[bwh: Backported to 3.2:
- Adjust context
- s/ec->mutex/ec->lock/]
--- drivers/acpi/ec.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+)
drivers/acpi/ec.c +64 -0
@@ -70,6 +70,8 @@ enum ec_command {#define ACPI_EC_DELAY 500/* Wait 500ms max. during EC ops */ #define ACPI_EC_UDELAY_GLK 1000/* Wait 1ms max. to get global lock */ #define ACPI_EC_MSI_UDELAY 550/* Wait 550us for MSI EC */ +#define ACPI_EC_CLEAR_MAX 100/* Maximum number of events to query +* when trying to clear the EC */ enum {EC_FLAGS_QUERY_PENDING ,/* Query is pending */
@@ -123,6 +125,7 @@ EXPORT_SYMBOL(first_ec);static int EC_FLAGS_MSI ;/* Out-of-spec MSI controller */ static int EC_FLAGS_VALIDATE_ECDT ;/* ASUStec ECDTs need to be validated */ static int EC_FLAGS_SKIP_DSDT_SCAN ;/* Not all BIOS survive early DSDT scan */ +static int EC_FLAGS_CLEAR_ON_RESUME ;/* Needs acpi_ec_clear() on boot/resume */ /* -------------------------------------------------------------------------- Transaction Management
@@ -449,6 +452,29 @@ int ec_transaction(u8 command,EXPORT_SYMBOL (ec_transaction); +static int acpi_ec_query_unlocked (struct acpi_ec *ec,u8 *data); + +/* +* Clears stale _Q events that might have accumulated in the EC. +* Run with locked ec mutex. +*/ +static void acpi_ec_clear (struct acpi_ec *ec) +{ +int i, status; +u8 value =0 ; + +for (i =0 ; i <ACPI_EC_CLEAR_MAX ; i++) { + status =acpi_ec_query_unlocked (ec, &value); +if (status || !value) +break ; + } + +if (unlikely (i ==ACPI_EC_CLEAR_MAX )) +pr_warn ("Warning: Maximum of %d stale EC events cleared\n" , i); +else +pr_info ("%d stale EC events cleared\n" , i); +} +void acpi_ec_block_transactions (void ) {struct acpi_ec *ec = first_ec;
@@ -472,6 +498,10 @@ void acpi_ec_unblock_transactions(void)mutex_lock (&ec->lock);/* Allow transactions to be carried out again */ clear_bit (EC_FLAGS_BLOCKED , &ec->flags); + +if (EC_FLAGS_CLEAR_ON_RESUME ) +acpi_ec_clear (ec); +mutex_unlock (&ec->lock); }
@@ -828,6 +858,13 @@ static int acpi_ec_add(struct acpi_devic/* EC is fully operational, allow queries */ clear_bit (EC_FLAGS_QUERY_PENDING , &ec->flags); + +/* Clear stale _Q events if hardware might require that */ +if (EC_FLAGS_CLEAR_ON_RESUME ) { +mutex_lock (&ec->lock); +acpi_ec_clear (ec); +mutex_unlock (&ec->lock); + }return ret; }
@@ -929,6 +966,30 @@ static int ec_enlarge_storm_threshold(coreturn 0 ; } +/* +* On some hardware it is necessary to clear events accumulated by the EC during +* sleep. These ECs stop reporting GPEs until they are manually polled, if too +* many events are accumulated. (e.g. Samsung Series 5/9 notebooks) +* +* https://bugzilla.kernel.org/show_bug.cgi?id=44161 +* +* Ideally, the EC should also be instructed NOT to accumulate events during +* sleep (which Windows seems to do somehow), but the interface to control this +* behaviour is not known at this time. +* +* Models known to be affected are Samsung 530Uxx/535Uxx/540Uxx/550Pxx/900Xxx, +* however it is very likely that other Samsung models are affected. +* +* On systems which don't accumulate _Q events during sleep, this extra check +* should be harmless. +*/ +static int ec_clear_on_resume (const struct dmi_system_id *id) +{ +pr_debug ("Detected system needing EC poll on resume.\n" ); +EC_FLAGS_CLEAR_ON_RESUME =1 ; +return 0 ; +} +static struct dmi_system_id __initdata ec_dmi_table[] = { { ec_skip_dsdt_scan,"Compal JFL92" , {
@@ -968,6 +1029,9 @@ static struct dmi_system_id __initdata e ec_validate_ecdt, "ASUS hardware", {DMI_MATCH (DMI_SYS_VENDOR ,"ASUSTek Computer Inc." ), DMI_MATCH(DMI_PRODUCT_NAME, "L4R"),}, NULL}, + { + ec_clear_on_resume, "Samsung hardware", { + DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD.")}, NULL}, {}, };
PATCH 163/200 mwifiex: copy AP's HT capability info correctly
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Amitkumar Karwar <[email protected]>
commit c99b1861c232e1f641f13b8645e0febb3712cc71 upstream.
While preparing association request, intersection of device's HT capability information and corresponding fields advertised by AP is used.
This patch fixes an error while copying this field from AP's beacon.
--- drivers/net/wireless/mwifiex/11n.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/wireless/mwifiex/11n.c +1 -2
@@ -343,8 +343,7 @@ mwifiex_cmd_append_11n_tlv(struct mwifie ht_cap->header.len =cpu_to_le16 (sizeof (struct ieee80211_ht_cap ));memcpy ((u8 *) ht_cap +sizeof (struct mwifiex_ie_types_header ), - (u8 *) bss_desc->bcn_ht_cap + -sizeof (struct ieee_types_header ), + (u8 *)bss_desc->bcn_ht_cap,le16_to_cpu (ht_cap->header.len));mwifiex_fill_cap_info (priv, radio_type, ht_cap);
PATCH 164/200 net: unix socket code abuses csum_partial
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Anton Blanchard <[email protected]>
commit 0a13404dd3bf4ea870e3d96270b5a382edca85c0 upstream.
The unix socket code is using the result of csum_partial to hash into a lookup table:
unix_hash_fold(csum_partial(sunaddr, len, 0));
csum_partial is only guaranteed to produce something that can be folded into a checksum, as its prototype explains:
* returns a 32-bit number suitable for feeding into itself
* or csum_tcpudp_magic
The 32bit value should not be used directly.
Depending on the alignment, the ppc64 csum_partial will return different 32bit partial checksums that will fold into the same 16bit checksum.
This difference causes the following testcase (courtesy of Gustavo) to sometimes fail:
#include <sys/socket.h>
#include <stdio.h>
int main()
{
int fd = socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC, 0);
int i = 1;
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &i, 4);
struct sockaddr addr;
addr.sa_family = AF_LOCAL;
bind(fd, &addr, 2);
listen(fd, 128);
struct sockaddr_storage ss;
socklen_t sslen = (socklen_t)sizeof(ss);
getsockname(fd, (struct sockaddr*)&ss, &sslen);
fd = socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC, 0);
if (connect(fd, (struct sockaddr*)&ss, sslen) == -1){
perror(NULL);
return 1;
}
printf("OK\n");
return 0;
}As suggested by davem, fix this by using csum_fold to fold the partial 32bit checksum into a 16bit checksum before using it.
---
net/unix/af_unix.c +2 -2
@@ -149,8 +149,8 @@ static inline void unix_set_secdata(strustatic inline unsigned unix_hash_fold (__wsum n) { -unsigned hash = (__force unsigned )n; - hash ^= hash>>16 ; +unsigned int hash = (__force unsigned int )csum_fold (n); + hash ^= hash>>8 ;return hash&(UNIX_HASH_SIZE -1 ); }
PATCH 165/200 powerpc: Align p_dyn, p_rela and p_st symbols
In reply to Ben Hutchings3.2.56-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Anton Blanchard <[email protected]>
commit a5b2cf5b1af424ee3dd9e3ce6d5cea18cb927e67 upstream.
The 64bit relocation code places a few symbols in the text segment. These symbols are only 4 byte aligned where they need to be 8 byte aligned. Add an explicit alignment.
--- arch/powerpc/kernel/reloc_64.S | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/kernel/reloc_64.S +1 -0
@@ -81,6 +81,7 @@ _GLOBAL(relocate) 6: blr +.balign 8 p_dyn: .llong __dynamic_start - 0b p_rela: .llong __rela_dyn_start - 0b p_st: .llong _stext - 0b