3.12.50-stable review
Subsystems (3)
cover 3.12.50-stable review
This is the start of the stable review cycle for the 3.12.50 release. There are 123 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri Oct 30 09:39:16 CET 2015. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
http://kernel.org/pub/linux/kernel/people/jirislaby/stable-review/patch-3.12.50-rc1.xz
and the diffstat can be found below.
thanks,
js
===============
Aaron Conole (2):
af_unix: Convert the unix_sk macro to an inline function for type
safety
af_unix: return data from multiple SKBs on recv() with MSG_PEEK flag
Alexander Couzens (1):
l2tp: protect tunnel->del_work by ref_count
Andreas Schwab (1):
m68k: Define asmlinkage_protect
Andrew Morton (1):
Input: zhenhua - ensure we have BITREVERSE
Andrey Vagin (1):
net/unix: fix logic about sk_peek_offset
Andy Lutomirski (2):
x86/nmi/64: Fix a paravirt stack-clobbering bug in the NMI code x86/paravirt: Replace the paravirt nop with a bona fide empty function
Andy Shevchenko (1):
dmaengine: dw: properly read DWC_PARAMS register
Ard Biesheuvel (1):
ARM: 8429/1: disable GCC SRA optimization
Arnaldo Carvalho de Melo (2):
perf hists: Update the column width for the "srcline" sort key perf header: Fixup reading of HEADER_NRCPUS feature
Ben Hutchings (1):
genirq: Fix race in register_irq_proc()
Ben Skeggs (1):
drm/nouveau/fbcon: take runpm reference when userspace has an open fd
Benjamin Tissoires (1):
HID: quirks: add QUIRK_NOGET for an other TPV touchscreen
Bin Liu (2):
usb: musb: cppi41: improve rx channel abort routine
usb: musb: fix cppi channel teardown for isoch transfer
Charles Keepax (1):
asix: Do full reset during ax88772_bind
Chris Mason (1):
btrfs: fix use after free iterating extrefs
Christoph Hellwig (1):
3w-9xxx: don't unmap bounce buffered commands
Daniel Lezcano (1):
ARM: ux500: cpuidle: fix section mismatch
Daniel Vetter (1):
drm: Reject DRI1 hw lock ioctl functions for kms drivers
Dave Airlie (1):
drm/qxl: only report first monitor as connected if we have no state
Dave Kleikamp (1):
crypto: sparc - initialize blkcipher.ivsize
David Woodhouse (1):
x86/platform: Fix Geode LX timekeeping in the generic x86 build
Dirk Müller (1):
Use WARN_ON_ONCE for missing X86_FEATURE_NRIPS
Eric Dumazet (1):
net: add pfmemalloc check in sk_add_backlog()
Fabiano Fidêncio (1):
drm/qxl: recreate the primary surface when the bo is not primary
Felix Fietkau (1):
ath9k: declare required extra tx headroom
Filipe Manana (2):
Btrfs: fix read corruption of compressed and shared extents
Btrfs: update fix for read corruption of compressed and shared extents
Grazvydas Ignotas (1):
ARM: dts: omap5-uevm.dts: fix i2c5 pinctrl offsets
Guenter Roeck (2):
hwmon: (nct6775) Swap STEP_UP_TIME and STEP_DOWN_TIME registers for
most chips
spi: Fix documentation of spi_alloc_master()
Guillaume Nault (1):
ppp: don't override sk->sk_state in pppoe_flush_dev()
Hans Verkuil (1):
[media] usbvision: fix locking error
Henrik Rydberg (1):
HID: apple: Add support for the 2015 Macbook Pro
Huang Rui (1):
usb: core: implement AMD remote wakeup quirk
Ilya Dryomov (1):
rbd: fix double free on rbd_dev->header_name
James Hogan (1):
MIPS: dma-default: Fix 32-bit fall back to GFP_DMA
Jan H. Schönherr (1):
sched: Fix cpu_active_mask/cpu_online_mask race
Jan Kara (1):
jbd2: avoid infinite loop when destroying aborted journal
Jann Horn (1):
security: fix typo in security_task_prctl
Jason Wang (1):
kvm: fix zero length mmio searching
Jeff Mahoney (1):
btrfs: skip waiting on ordered range for special files
Jenny Derzhavetz (1):
iser-target: remove command with state ISTATE_REMOVE
Jiri Slaby (1):
Revert "USB: Add device quirk for ASUS T100 Base Station keyboard"
Joe Perches (1):
ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings
Joe Stringer (1):
netfilter: nf_conntrack: Support expectations in different zones
Joe Thornber (2):
dm btree: add ref counting ops for the leaves of top level btrees dm cache: fix NULL pointer when switching from cleaner policy
Joerg Roedel (1):
iommu/amd: Handle integer overflow in dma_ops_area_alloc
Johan Hovold (1):
USB: whiteheat: fix potential null-deref at probe
John Flatness (1):
ALSA: hda - Apply SPDIF pin ctl to MacBookPro 12,1
Joonsoo Kim (1):
mm/slab: fix unexpected index mapping result of
kmalloc_size(INDEX_NODE+1)
Julian Anastasov (2):
ipvs: do not use random local source address for tunnels
ipvs: fix crash with sync protocol v0 and FTP
Kan Liang (1):
perf stat: Get correct cpu id for print_aggr
Li Jun (1):
usb: chipidea: debug: add runtime pm for register access
Linus Torvalds (1):
Initialize msg/shm IPC objects before doing ipc_addid()
Liu.Zhao (1):
USB: option: add ZTE PIDs
Macpaul Lin (1):
USB: Add OTG PET device to TPL
Mark Brown (2):
regmap: debugfs: Ensure we don't underflow when printing access masks
regmap: debugfs: Don't bother actually printing when calculating max
length
Mark Salyzyn (1):
arm64: readahead: fault retry breaks mmap file read random detection
Martin Schwidefsky (1):
s390/3270: redraw screen on unsolicited device end
Mathias Nyman (4):
xhci: Workaround for PME stuck issues in Intel xhci
xhci: rework cycle bit checking for new dequeue pointers
xhci: change xhci 1.0 only restrictions to support xhci 1.1
usb: Use the USB_SS_MULT() macro to get the burst multiplier.
Mel Gorman (1):
mm: hugetlbfs: skip shared VMAs when unmapping private pages to
satisfy a fault
Michal Hocko (1):
scsi: fix scsi_error_handler vs. scsi_host_dev_release race
Michel Stam (1):
asix: Don't reset PHY on if_up for ASIX 88772
Mika Westerberg (1):
i2c: designware: Do not use parameters from ACPI on Dell Inspiron 7348
Mike Snitzer (1):
dm thin: fix missing pool reference count decrement in pool_ctr error
path
Mikulas Patocka (1):
dm raid: fix round up of default region size
Nicholas Mc Guire (1):
[media] gscpa_m5602: use msecs_to_jiffies for conversions
Nobuhiro Iwamatsu (3):
[media] v4l: vsp1: Fix VI6_DPR_ROUTE_FXA_MASK macro [media] v4l: vsp1: Fix VI6_DPR_ROUTE_FP_MASK macro [media] v4l: vsp1: Fix VI6_WPF_SZCLIP_SIZE_MASK macro
Noel Power (1):
client MUST ignore EncryptionKeyLength if CAP_EXTENDED_SECURITY is set
Oliver Neukum (1):
Revert "USB: quirks: add touchscreen that is dazzeled by remote
wakeup"
Pablo Neira Ayuso (1):
netfilter: ctnetlink: put back references to master ct and expect
objects
Paul Bolle (1):
windfarm: decrement client count when unregistering
Paul E. McKenney (1):
rcu: Reject memory-order-induced stall-warning false positives
Peter Seiderer (1):
cifs: use server timestamp for ntlmv2 authentication
Peter Zijlstra (4):
arch: Clean up asm/barrier.h implementations using
asm-generic/barrier.h
arch: Move smp_mb__{before,after}_atomic_{inc,dec}.h into asm/atomic.h arc,hexagon: Delete asm/barrier.h
sched/core: Fix TASK_DEAD race in finish_task_switch()
Philipp Hachtmann (1):
USB: symbolserial: Correct transferred data size
Pravin B Shelar (2):
skbuff: Fix skb checksum flag on skb pull
skbuff: Fix skb checksum partial check.
Reyad Attiyat (1):
usb: xhci: Add support for URB_ZERO_PACKET to bulk/sg transfers
Richard Weinberger (1):
UBI: Validate data_size
Robert Jarzmik (2):
ASoC: pxa: pxa2xx-ac97: fix dma requestor lines
ASoC: fix broken pxa SoC support
Robert Schlabbach (1):
usb: core: Fix USB 3.0 devices lost in NOTATTACHED state after a hub
port reset
Roger Quadros (1):
usb: xhci: Clear XHCI_STATE_DYING on start
Russell King (2):
ARM: fix Thumb2 signal handling when ARMv6 is enabled
crypto: ahash - ensure statesize is non-zero
Sabrina Dubroca (1):
net: add length argument to skb_copy_and_csum_datagram_iovec
Shaohua Li (2):
x86/apic: Serialize LVTT and TSC_DEADLINE writes
workqueue: make sure delayed work run in local cpu
Stefan Assmann (1):
Input: psmouse - add small delay for IBM trackpoint pass-through mode
Stephen Smalley (1):
x86/mm: Set NX on gap between __ex_table and rodata
Steve French (1):
disabling oplocks/leases via module parm enable_oplocks broken for
SMB3
Sudip Mukherjee (2):
Input: serio - fix blocking of parport
Input: omap4-keypad - fix memory leak
T.J. Purtell (1):
ARM: 7880/1: Clear the IT state independent of the Thumb-2 mode
Takashi Iwai (2):
ALSA: hda - Control SPDIF out pin on MacBookPro 11,2
ALSA: synth: Fix conflicting OSS device registration on AWE32
Tan, Jui Nee (1):
spi: spi-pxa2xx: Check status register to determine if SSSR_TINT is
disabled
Teunis van Beelen (1):
USB: usbtmc: add device quirk for Rigol DS6104
Vincent Palatin (1):
usb: Add device quirk for Logitech PTZ cameras
Vitaly Kuznetsov (1):
x86/xen: Support kexec/kdump in HVM guests by doing a soft reset
Will Deacon (1):
arm64: errata: use KBUILD_CFLAGS_MODULE for erratum #843419
Wolfram Sang (2):
i2c: rcar: enable RuntimePM before registering to the core
i2c: s3c2410: enable RuntimePM before registering to the core
Yao-Wen Mao (1):
USB: Add reset-resume quirk for two Plantronics usb headphones.
Yitian Bu (1):
ASoC: dwc: correct irq clear method
[email protected] (1):
staging: speakup: fix speakup-r regression
shengyong (1):
UBI: return ENOSPC if no enough space available
arch/alpha/include/asm/barrier.h | 25 +---- arch/arc/include/asm/Kbuild | 1 + arch/arc/include/asm/atomic.h | 5 + arch/arc/include/asm/barrier.h | 42 ------- arch/arm/Makefile | 8 ++ arch/arm/boot/dts/omap5-uevm.dts | 4 +- arch/arm/kernel/signal.c | 19 +++- arch/arm64/Makefile | 2 +- arch/arm64/mm/fault.c | 1 + arch/avr32/include/asm/barrier.h | 17 +-- arch/blackfin/include/asm/barrier.h | 18 +-- arch/cris/include/asm/Kbuild | 1 + arch/cris/include/asm/barrier.h | 25 ----- arch/frv/include/asm/barrier.h | 8 +- arch/hexagon/include/asm/Kbuild | 1 + arch/hexagon/include/asm/atomic.h | 6 +- arch/hexagon/include/asm/barrier.h | 41 ------- arch/m32r/include/asm/barrier.h | 80 +------------- arch/m68k/include/asm/barrier.h | 14 +-- arch/m68k/include/asm/linkage.h | 30 +++++ arch/microblaze/include/asm/Kbuild | 1 + arch/microblaze/include/asm/barrier.h | 27 ----- arch/mips/mm/dma-default.c | 2 +- arch/mn10300/include/asm/Kbuild | 1 + arch/mn10300/include/asm/barrier.h | 37 ------- arch/parisc/include/asm/Kbuild | 1 + arch/parisc/include/asm/barrier.h | 35 ------ arch/score/include/asm/Kbuild | 1 + arch/score/include/asm/barrier.h | 16 --- arch/sh/include/asm/barrier.h | 21 +--- arch/sparc/crypto/aes_glue.c | 2 + arch/sparc/crypto/camellia_glue.c | 1 + arch/sparc/crypto/des_glue.c | 2 + arch/sparc/include/asm/barrier_32.h | 12 +- arch/tile/include/asm/barrier.h | 68 +----------- arch/unicore32/include/asm/barrier.h | 11 +- arch/x86/kernel/apic/apic.c | 7 ++ arch/x86/kernel/entry_64.S | 16 ++- arch/x86/kernel/paravirt.c | 16 ++- arch/x86/kernel/tsc.c | 17 +-- arch/x86/kvm/svm.c | 2 +- arch/x86/mm/init_64.c | 2 +- arch/x86/xen/enlighten.c | 23 ++++ arch/xtensa/include/asm/barrier.h | 9 +- crypto/ahash.c | 3 +- drivers/base/regmap/regmap-debugfs.c | 5 +- drivers/block/rbd.c | 1 - drivers/cpuidle/cpuidle-ux500.c | 2 +- drivers/dma/dw/core.c | 4 +- drivers/gpu/drm/drm_lock.c | 6 + drivers/gpu/drm/nouveau/nouveau_fbcon.c | 24 ++++ drivers/gpu/drm/qxl/qxl_display.c | 14 ++- drivers/hid/hid-apple.c | 6 + drivers/hid/hid-core.c | 6 + drivers/hid/hid-ids.h | 6 +- drivers/hid/usbhid/hid-quirks.c | 3 +- drivers/hwmon/nct6775.c | 16 ++- drivers/i2c/busses/i2c-designware-platdrv.c | 20 ++++ drivers/i2c/busses/i2c-rcar.c | 7 +- drivers/i2c/busses/i2c-s3c2410.c | 8 +- drivers/infiniband/ulp/isert/ib_isert.c | 9 +- drivers/input/joystick/Kconfig | 1 + drivers/input/keyboard/omap4-keypad.c | 2 +- drivers/input/mouse/psmouse-base.c | 4 + drivers/input/serio/parkbd.c | 1 + drivers/iommu/amd_iommu.c | 8 +- drivers/macintosh/windfarm_core.c | 2 +- drivers/md/dm-cache-policy-cleaner.c | 2 +- drivers/md/dm-raid.c | 3 +- drivers/md/dm-thin.c | 2 +- drivers/md/persistent-data/dm-btree-internal.h | 6 + drivers/md/persistent-data/dm-btree-remove.c | 12 +- drivers/md/persistent-data/dm-btree-spine.c | 37 +++++++ drivers/md/persistent-data/dm-btree.c | 7 +- drivers/media/platform/vsp1/vsp1_regs.h | 6 +- drivers/media/usb/gspca/m5602/m5602_s5k83a.c | 2 +- drivers/media/usb/usbvision/usbvision-video.c | 2 +- drivers/mtd/ubi/io.c | 5 + drivers/mtd/ubi/vtbl.c | 1 + drivers/mtd/ubi/wl.c | 1 + drivers/net/ppp/pppoe.c | 1 - drivers/net/usb/asix_devices.c | 16 +-- drivers/net/wireless/ath/ath9k/init.c | 1 + drivers/s390/char/con3270.c | 4 + drivers/s390/char/tty3270.c | 4 + drivers/scsi/3w-9xxx.c | 28 +++-- drivers/scsi/scsi_error.c | 11 +- drivers/spi/spi-pxa2xx.c | 4 + drivers/spi/spi.c | 3 +- drivers/staging/speakup/fakekey.c | 1 + drivers/usb/chipidea/debug.c | 6 + drivers/usb/class/usbtmc.c | 1 + drivers/usb/core/config.c | 5 +- drivers/usb/core/hcd-pci.c | 3 + drivers/usb/core/hub.c | 82 ++++++-------- drivers/usb/core/otg_whitelist.h | 5 + drivers/usb/core/quirks.c | 59 +++++++++- drivers/usb/host/pci-quirks.c | 12 ++ drivers/usb/host/xhci-mem.c | 6 +- drivers/usb/host/xhci-pci.c | 30 +++++ drivers/usb/host/xhci-ring.c | 145 ++++++++++++++++--------- drivers/usb/host/xhci.c | 11 +- drivers/usb/host/xhci.h | 1 + drivers/usb/musb/musb_cppi41.c | 15 ++- drivers/usb/serial/option.c | 24 ++++ drivers/usb/serial/symbolserial.c | 18 ++- drivers/usb/serial/whiteheat.c | 31 ++++++ fs/btrfs/backref.c | 8 +- fs/btrfs/extent_io.c | 80 +++++++++++--- fs/btrfs/inode.c | 3 +- fs/cifs/cifsencrypt.c | 52 ++++++++- fs/cifs/cifssmb.c | 5 +- fs/cifs/smb2ops.c | 8 +- fs/jbd2/checkpoint.c | 39 ++++++- fs/jbd2/commit.c | 2 +- fs/jbd2/journal.c | 11 +- include/asm-generic/barrier.h | 42 ++++--- include/linux/jbd2.h | 3 +- include/linux/security.h | 2 +- include/linux/skbuff.h | 6 +- include/linux/usb/hcd.h | 3 + include/linux/usb/quirks.h | 7 +- include/net/af_unix.h | 6 +- include/net/sock.h | 8 ++ include/xen/interface/sched.h | 8 ++ ipc/msg.c | 14 +-- ipc/shm.c | 12 +- ipc/util.c | 8 +- kernel/irq/proc.c | 19 +++- kernel/rcutree.c | 45 +++++++- kernel/sched/core.c | 18 ++- kernel/sched/sched.h | 5 +- kernel/workqueue.c | 8 +- mm/hugetlb.c | 8 ++ mm/slab.c | 13 ++- net/core/datagram.c | 6 +- net/core/ethtool.c | 2 +- net/core/skbuff.c | 9 +- net/ipv4/tcp_input.c | 2 +- net/ipv4/udp.c | 2 +- net/ipv6/raw.c | 2 +- net/ipv6/udp.c | 3 +- net/l2tp/l2tp_core.c | 11 +- net/netfilter/ipvs/ip_vs_sync.c | 2 +- net/netfilter/ipvs/ip_vs_xmit.c | 1 - net/netfilter/nf_conntrack_expect.c | 3 +- net/netfilter/nf_conntrack_netlink.c | 5 - net/rxrpc/ar-recvmsg.c | 3 +- net/unix/af_unix.c | 16 ++- sound/arm/Kconfig | 15 +-- sound/pci/hda/patch_cirrus.c | 57 +++++++++- sound/soc/dwc/designware_i2s.c | 4 +- sound/soc/pxa/Kconfig | 2 - sound/soc/pxa/pxa2xx-ac97.c | 4 +- sound/synth/emux/emux_oss.c | 3 +- tools/perf/builtin-stat.c | 5 +- tools/perf/util/header.c | 4 +- tools/perf/util/hist.c | 3 + virt/kvm/kvm_main.c | 19 +++- 159 files changed, 1221 insertions(+), 854 deletions(-) delete mode 100644 arch/arc/include/asm/barrier.h delete mode 100644 arch/cris/include/asm/barrier.h delete mode 100644 arch/hexagon/include/asm/barrier.h delete mode 100644 arch/microblaze/include/asm/barrier.h delete mode 100644 arch/mn10300/include/asm/barrier.h delete mode 100644 arch/parisc/include/asm/barrier.h delete mode 100644 arch/score/include/asm/barrier.h
Signature · 1 line
2.6.2
PATCH 1/123 x86/nmi/64: Fix a paravirt stack-clobbering bug in the NMI code
From: Andy Lutomirski <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 83c133cf11fb0e68a51681447e372489f052d40e upstream.
The NMI entry code that switches to the normal kernel stack needs to be very careful not to clobber any extra stack slots on the NMI stack. The code is fine under the assumption that SWAPGS is just a normal instruction, but that assumption isn't really true. Use SWAPGS_UNSAFE_STACK instead.
This is part of a fix for some random crashes that Sasha saw.
--- arch/x86/kernel/entry_64.S | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/x86/kernel/entry_64.S +4 -1
@@ -1727,9 +1727,12 @@ ENTRY(nmi) * we don't want to enable interrupts, because then we'll end * up in an awkward situation in which IRQs are on but NMIs * are off. + * + * We also must not push anything to the stack before switching + * stacks lest we corrupt the "NMI executing" variable. */ - SWAPGS + SWAPGS_UNSAFE_STACK cld movq %rsp, %rdx movq PER_CPU_VAR(kernel_stack), %rsp
Signature · 1 line
2.6.2
PATCH 2/123 x86/paravirt: Replace the paravirt nop with a bona fide empty function
From: Andy Lutomirski <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit fc57a7c68020dcf954428869eafd934c0ab1536f upstream.
PARAVIRT_ADJUST_EXCEPTION_FRAME generates this code (using nmi as an example, trimmed for readability):
ff 15 00 00 00 00 callq *0x0(%rip) # 2796 <nmi+0x6>
2792: R_X86_64_PC32 pv_irq_ops+0x2cThat's a call through a function pointer to regular C function that does nothing on native boots, but that function isn't protected against kprobes, isn't marked notrace, and is certainly not guaranteed to preserve any registers if the compiler is feeling perverse. This is bad news for a CLBR_NONE operation.
Of course, if everything works correctly, once paravirt ops are patched, it gets nopped out, but what if we hit this code before paravirt ops are patched in? This can potentially cause breakage that is very difficult to debug.
A more subtle failure is possible here, too: if _paravirt_nop uses the stack at all (even just to push RBP), it will overwrite the "NMI executing" variable if it's called in the NMI prologue.
The Xen case, perhaps surprisingly, is fine, because it's already written in asm.
Fix all of the cases that default to paravirt_nop (including adjust_exception_frame) with a big hammer: replace paravirt_nop with an asm function that is just a ret instruction.
The Xen case may have other problems, so document them.
This is part of a fix for some random crashes that Sasha saw.
--- arch/x86/kernel/entry_64.S | 11 +++++++++++ arch/x86/kernel/paravirt.c | 16 ++++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-)
arch/x86/kernel/entry_64.S +11 -0
@@ -1675,7 +1675,18 @@ END(error_exit) /* runs on exception stack */ ENTRY(nmi) INTR_FRAME + /* + * Fix up the exception frame if we're on Xen. + * PARAVIRT_ADJUST_EXCEPTION_FRAME is guaranteed to push at most + * one value to the stack on native, so it may clobber the rdx + * scratch slot, but it won't clobber any of the important + * slots past it. + * + * Xen is a different story, because the Xen frame itself overlaps + * the "NMI executing" variable. + */ PARAVIRT_ADJUST_EXCEPTION_FRAME + /* * We allow breakpoints in NMIs. If a breakpoint occurs, then * the iretq it performs will take us out of NMI context.
arch/x86/kernel/paravirt.c +12 -4
@@ -40,10 +40,18 @@#include <asm/timer.h> #include <asm/special_insns.h> -/* nop stub */ -void _paravirt_nop (void ) -{ -} +/* +* nop stub, which must not clobber anything *including the stack* to +* avoid confusing the entry prologues. +*/ +extern void _paravirt_nop (void ); +asm (".pushsection .entry.text, \"ax\"\n" +".global _paravirt_nop\n" +"_paravirt_nop:\n\t" +"ret\n\t" +".size _paravirt_nop, . - _paravirt_nop\n\t" +".type _paravirt_nop, @function\n\t" +".popsection" );/* identity function, which can be inlined */ u32 _paravirt_ident_32 (u32 x)
Signature · 1 line
2.6.2
PATCH 3/123 jbd2: avoid infinite loop when destroying aborted journal
In reply to Jiri SlabyFrom: Jan Kara <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 841df7df196237ea63233f0f9eaa41db53afd70f upstream.
Commit 6f6a6fda2945 "jbd2: fix ocfs2 corrupt when updating journal superblock fails" changed jbd2_cleanup_journal_tail() to return EIO when the journal is aborted. That makes logic in jbd2_log_do_checkpoint() bail out which is fine, except that jbd2_journal_destroy() expects jbd2_log_do_checkpoint() to always make a progress in cleaning the journal. Without it jbd2_journal_destroy() just loops in an infinite loop.
Fix jbd2_journal_destroy() to cleanup journal checkpoint lists of jbd2_log_do_checkpoint() fails with error.
--- fs/jbd2/checkpoint.c | 39 +++++++++++++++++++++++++++++++++------ fs/jbd2/commit.c | 2 +- fs/jbd2/journal.c | 11 ++++++++++- include/linux/jbd2.h | 3 ++- 4 files changed, 46 insertions(+), 9 deletions(-)
fs/jbd2/checkpoint.c +33 -6
@@ -475,14 +475,15 @@ int jbd2_cleanup_journal_tail(journal_t *journal)* journal_clean_one_cp_list * * Find all the written-back checkpoint buffers in the given list and -* release them. +* release them. If 'destroy' is set, clean all buffers unconditionally. * * Called with the journal locked. * Called with j_list_lock held. * Returns number of buffers reaped (for debug) */ -static int journal_clean_one_cp_list (struct journal_head *jh,int *released) +static int journal_clean_one_cp_list (struct journal_head *jh,bool destroy, +int *released) {struct journal_head *last_jh;struct journal_head *next_jh = jh;
@@ -496,7 +497,10 @@ static int journal_clean_one_cp_list(struct journal_head *jh, int *released) do { jh = next_jh; next_jh = jh->b_cpnext; - ret = __try_to_free_cp_buf(jh); + if (!destroy) + ret = __try_to_free_cp_buf(jh); + else + ret = __jbd2_journal_remove_checkpoint(jh) + 1; if (ret) { freed++; if (ret == 2) {
@@ -521,13 +525,14 @@ static int journal_clean_one_cp_list(struct journal_head *jh, int *released)* journal_clean_checkpoint_list * * Find all the written-back checkpoint buffers in the journal and release them. +* If 'destroy' is set, release all buffers unconditionally. * * Called with the journal locked. * Called with j_list_lock held. * Returns number of buffers reaped (for debug) */ -int __jbd2_journal_clean_checkpoint_list (journal_t *journal) +int __jbd2_journal_clean_checkpoint_list (journal_t *journal,bool destroy) {transaction_t *transaction, *last_transaction, *next_transaction;int ret =0 ;
@@ -543,7 +548,7 @@ int __jbd2_journal_clean_checkpoint_list(journal_t *journal) transaction = next_transaction; next_transaction = transaction->t_cpnext; ret +=journal_clean_one_cp_list (transaction-> - t_checkpoint_list, &released); + t_checkpoint_list, destroy, &released);/* * This function only frees up some memory if possible so we * dont have an obligation to finish processing. Bail out if
@@ -559,7 +564,7 @@ int __jbd2_journal_clean_checkpoint_list(journal_t *journal)* we can possibly see not yet submitted buffers on io_list */ ret +=journal_clean_one_cp_list (transaction-> - t_checkpoint_io_list, &released); + t_checkpoint_io_list, destroy, &released);if (need_resched ()) goto out; }while (transaction != last_transaction);
@@ -568,6 +573,28 @@ out: }/* +* Remove buffers from all checkpoint lists as journal is aborted and we just +* need to free memory +*/ +void jbd2_journal_destroy_checkpoint (journal_t *journal) +{ +/* +* We loop because __jbd2_journal_clean_checkpoint_list() may abort +* early due to a need of rescheduling. +*/ +while (1 ) { +spin_lock (&journal->j_list_lock); +if (!journal->j_checkpoint_transactions) { +spin_unlock (&journal->j_list_lock); +break ; + } +__jbd2_journal_clean_checkpoint_list (journal, true); +spin_unlock (&journal->j_list_lock); +cond_resched (); + } +} + +/* * journal_remove_checkpoint: called after a buffer has been committed * to disk (either by being write-back flushed to disk, or being * committed to the log).
fs/jbd2/commit.c +1 -1
@@ -510,7 +510,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)* frees some memory */ spin_lock (&journal->j_list_lock); -__jbd2_journal_clean_checkpoint_list (journal); +__jbd2_journal_clean_checkpoint_list (journal, false);spin_unlock (&journal->j_list_lock);jbd_debug (3 ,"JBD2: commit phase 1\n" );
fs/jbd2/journal.c +10 -1
@@ -1710,8 +1710,17 @@ int jbd2_journal_destroy(journal_t *journal)while (journal->j_checkpoint_transactions !=NULL ) {spin_unlock (&journal->j_list_lock);mutex_lock (&journal->j_checkpoint_mutex); -jbd2_log_do_checkpoint (journal); + err =jbd2_log_do_checkpoint (journal);mutex_unlock (&journal->j_checkpoint_mutex); +/* +* If checkpointing failed, just free the buffers to avoid +* looping forever +*/ +if (err) { +jbd2_journal_destroy_checkpoint (journal); +spin_lock (&journal->j_list_lock); +break ; + }spin_lock (&journal->j_list_lock); }
include/linux/jbd2.h +2 -1
@@ -1042,8 +1042,9 @@ void jbd2_update_log_tail(journal_t *journal, tid_t tid, unsigned long block);extern void jbd2_journal_commit_transaction (journal_t *);/* Checkpoint list management */ -int __jbd2_journal_clean_checkpoint_list (journal_t *journal); +int __jbd2_journal_clean_checkpoint_list (journal_t *journal,bool destroy);int __jbd2_journal_remove_checkpoint (struct journal_head *); +void jbd2_journal_destroy_checkpoint (journal_t *journal);void __jbd2_journal_insert_checkpoint (struct journal_head *,transaction_t *);
Signature · 1 line
2.6.2
PATCH 4/123 rcu: Reject memory-order-induced stall-warning false positives
In reply to Jiri SlabyFrom: "Paul E. McKenney" <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 26cdfedf6a902345f8604ea8e0b7dd2566b37a46 upstream.
If a system is idle from an RCU perspective for longer than specified by CONFIG_RCU_CPU_STALL_TIMEOUT, and if one CPU starts a grace period just as a second checks for CPU stalls, and if this second CPU happens to see the old value of rsp->jiffies_stall, it will incorrectly report a CPU stall. This is quite rare, but apparently occurs deterministically on systems with about 6TB of memory.
This commit therefore orders accesses to the data used to determine whether or not a CPU stall is in progress. Grace-period initialization and cleanup first increments rsp->completed to mark the end of the previous grace period, then records the current jiffies in rsp->gp_start, then records the jiffies at which a stall can be expected to occur in rsp->jiffies_stall, and finally increments rsp->gpnum to mark the start of the new grace period. Now, this ordering by itself does not prevent false positives. For example, if grace-period initialization was delayed between recording rsp->gp_start and rsp->jiffies_stall, the CPU stall warning code might still see an old value of rsp->jiffies_stall.
Therefore, this commit also orders the CPU stall warning accesses as well, loading rsp->gpnum and jiffies, then rsp->jiffies_stall, then rsp->gp_start, and finally rsp->completed. This ordering means that the false-positive scenario in the previous paragraph would result in rsp->completed being greater than or equal to rsp->gpnum, which is never valid for a CPU stall, allowing the false positive to be rejected. Furthermore, any fetch that gets an old value of rsp->jiffies_stall must also get an old value of rsp->gpnum, which will again be rejected by the comparison of rsp->gpnum and rsp->completed. Situations where rsp->gp_start is later than rsp->jiffies_stall are also rejected, as are situations where jiffies is less than rsp->jiffies_stall.
Although use of unsynchronized accesses means that there are likely still some false-positive scenarios (synchronization has proven to be a very bad idea on large systems), this should get rid of a large class of these scenarios.
--- kernel/rcutree.c | 45 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-)
kernel/rcutree.c +40 -5
@@ -802,8 +802,11 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp,static void record_gp_stall_check_time (struct rcu_state *rsp) { - rsp->gp_start = jiffies; - rsp->jiffies_stall = jiffies +rcu_jiffies_till_stall_check (); +unsigned long j =ACCESS_ONCE (jiffies); + + rsp->gp_start = j; +smp_wmb ();/* Record start time before stall time. */ + rsp->jiffies_stall = j +rcu_jiffies_till_stall_check (); }/*
@@ -932,17 +935,48 @@ static void print_cpu_stall(struct rcu_state *rsp)static void check_cpu_stall (struct rcu_state *rsp,struct rcu_data *rdp) { +unsigned long completed; +unsigned long gpnum; +unsigned long gps;unsigned long j;unsigned long js;struct rcu_node *rnp; -if (rcu_cpu_stall_suppress) +if (rcu_cpu_stall_suppress || !rcu_gp_in_progress (rsp))return ; j =ACCESS_ONCE (jiffies); + +/* +* Lots of memory barriers to reject false positives. +* +* The idea is to pick up rsp->gpnum, then rsp->jiffies_stall, +* then rsp->gp_start, and finally rsp->completed. These values +* are updated in the opposite order with memory barriers (or +* equivalent) during grace-period initialization and cleanup. +* Now, a false positive can occur if we get an new value of +* rsp->gp_start and a old value of rsp->jiffies_stall. But given +* the memory barriers, the only way that this can happen is if one +* grace period ends and another starts between these two fetches. +* Detect this by comparing rsp->completed with the previous fetch +* from rsp->gpnum. +* +* Given this check, comparisons of jiffies, rsp->jiffies_stall, +* and rsp->gp_start suffice to forestall false positives. +*/ + gpnum =ACCESS_ONCE (rsp->gpnum); +smp_rmb ();/* Pick up ->gpnum first... */ js =ACCESS_ONCE (rsp->jiffies_stall); +smp_rmb ();/* ...then ->jiffies_stall before the rest... */ + gps =ACCESS_ONCE (rsp->gp_start); +smp_rmb ();/* ...and finally ->gp_start before ->completed. */ + completed =ACCESS_ONCE (rsp->completed); +if (ULONG_CMP_GE (completed, gpnum) || +ULONG_CMP_LT (j, js) || +ULONG_CMP_GE (gps, js)) +return ;/* No stall or GP completed since entering function. */ rnp = rdp->mynode;if (rcu_gp_in_progress (rsp) && - (ACCESS_ONCE (rnp->qsmask) & rdp->grpmask) &&ULONG_CMP_GE (j, js)) { + (ACCESS_ONCE (rnp->qsmask) & rdp->grpmask)) {/* We haven't checked in, so go dump stack. */ print_cpu_stall (rsp);
@@ -1331,9 +1365,10 @@ static int rcu_gp_init(struct rcu_state *rsp) }/* Advance to a new grace period and initialize state. */ +record_gp_stall_check_time (rsp); +smp_wmb ();/* Record GP times before starting GP. */ rsp->gpnum++;trace_rcu_grace_period (rsp->name, rsp->gpnum,TPS ("start" )); -record_gp_stall_check_time (rsp);raw_spin_unlock_irq (&rnp->lock);/* Exclude any concurrent CPU-hotplug operations. */
Signature · 1 line
2.6.2
PATCH 5/123 sched: Fix cpu_active_mask/cpu_online_mask race
In reply to Jiri SlabyFrom: Jan H. Schönherr <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit dd9d3843755da95f63dd3a376f62b3e45c011210 upstream.
There is a race condition in SMP bootup code, which may result in
WARNING: CPU: 0 PID: 1 at kernel/workqueue.c:4418
workqueue_cpu_up_callback()or
kernel BUG at kernel/smpboot.c:135!
It can be triggered with a bit of luck in Linux guests running on busy hosts.
CPU0 CPUn ==== ==== _cpu_up() __cpu_up() start_secondary() set_cpu_online() cpumask_set_cpu(cpu, to_cpumask(cpu_online_bits)); cpu_notify(CPU_ONLINE) <do stuff, see below> cpumask_set_cpu(cpu, to_cpumask(cpu_active_bits));
During the various CPU_ONLINE callbacks CPUn is online but not active. Several things can go wrong at that point, depending on the scheduling of tasks on CPU0.
Variant 1:
cpu_notify(CPU_ONLINE)
workqueue_cpu_up_callback()
rebind_workers()
set_cpus_allowed_ptr()
This call fails because it requires an active CPU; rebind_workers() ends with a warning:
WARNING: CPU: 0 PID: 1 at kernel/workqueue.c:4418
workqueue_cpu_up_callback()Variant 2:
cpu_notify(CPU_ONLINE)
smpboot_thread_call()
smpboot_unpark_threads()
..
__kthread_unpark()
__kthread_bind()
wake_up_state()
..
select_task_rq()
select_fallback_rq() The ->wake_cpu of the unparked thread is not allowed, making a call to select_fallback_rq() necessary. Then, select_fallback_rq() cannot find an allowed, active CPU and promptly resets the allowed CPUs, so that the task in question ends up on CPU0.
When those unparked tasks are eventually executed, they run immediately into a BUG:
kernel BUG at kernel/smpboot.c:135!
Just changing the order in which the online/active bits are set (and adding some memory barriers), would solve the two issues above. However, it would change the order of operations back to the one before commit 6acbfb96976f ("sched: Fix hotplug vs. set_cpus_allowed_ptr()"), thus, reintroducing that particular problem.
Going further back into history, we have at least the following commits touching this topic:
- commit 2baab4e90495 ("sched: Fix select_fallback_rq() vs cpu_active/cpu_online")
- commit 5fbd036b552f ("sched: Cleanup cpu_active madness")
Together, these give us the following non-working solutions:
- secondary CPU sets active before online, because active is assumed to
be a subset of online;
- secondary CPU sets online before active, because the primary CPU
assumes that an online CPU is also active;
- secondary CPU sets online and waits for primary CPU to set active, because it might deadlock.
Commit 875ebe940d77 ("powerpc/smp: Wait until secondaries are active & online") introduces an arch-specific solution to this arch-independent problem.
Now, go for a more general solution without explicit waiting and simply set active twice: once on the secondary CPU after online was set and once on the primary CPU after online was seen.
set_cpus_allowed_ptr()")
--- kernel/sched/core.c | 8 ++++++++ 1 file changed, 8 insertions(+)
kernel/sched/core.c +8 -0
@@ -4729,6 +4729,14 @@ static int sched_cpu_active(struct notifier_block *nfb, unsigned long action, void *hcpu) {switch (action & ~CPU_TASKS_FROZEN ) { +case CPU_ONLINE : +/* +* At this point a starting CPU has marked itself as online via +* set_cpu_online(). But it might not yet have marked itself +* as active, which is essential from here on. +* +* Thus, fall-through and help the starting CPU along. +*/ case CPU_DOWN_FAILED :set_cpu_active ((long )hcpu, true);return NOTIFY_OK ;
Signature · 1 line
2.6.2
PATCH 6/123 xhci: Workaround for PME stuck issues in Intel xhci
In reply to Jiri SlabyFrom: Mathias Nyman <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit b8cb91e058cd0c0f02059c1207293c5b31d350fa upstream.
The xhci in Intel Sunrisepoint and Cherryview platforms need a driver workaround for a Stuck PME that might either block PME events in suspend, or create spurious PME events preventing runtime suspend.
Workaround is to clear a internal PME flag, BIT(28) in a vendor specific PMCTRL register at offset 0x80a4, in both suspend resume callbacks
Without this, xhci connected usb devices might never be able to wake up the system from suspend, or prevent device from going to suspend (xhci d3)
--- drivers/usb/host/xhci-pci.c | 30 ++++++++++++++++++++++++++++++ drivers/usb/host/xhci.h | 1 + 2 files changed, 31 insertions(+)
drivers/usb/host/xhci-pci.c +30 -0
@@ -37,6 +37,9 @@#define PCI_DEVICE_ID_INTEL_LYNXPOINT_XHCI 0x8c31#define PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI 0x9c31 +#define PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI 0x22b5 +#define PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_XHCI 0xa12f +#define PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_XHCI 0x9d2fstatic const char hcd_name[] ="xhci_hcd" ;
@@ -129,6 +132,12 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) pdev->device == PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI) { xhci->quirks |=XHCI_SPURIOUS_REBOOT ; } +if (pdev->vendor ==PCI_VENDOR_ID_INTEL && + (pdev->device ==PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_XHCI || + pdev->device ==PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_XHCI || + pdev->device ==PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI )) { + xhci->quirks |=XHCI_PME_STUCK_QUIRK ; + }if (pdev->vendor ==PCI_VENDOR_ID_ETRON && pdev->device ==PCI_DEVICE_ID_ASROCK_P67 ) { xhci->quirks |=XHCI_RESET_ON_RESUME ;
@@ -143,6 +152,21 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) xhci->quirks |=XHCI_RESET_ON_RESUME ; } +/* +* Make sure PME works on some Intel xHCI controllers by writing 1 to clear +* the Internal PME flag bit in vendor specific PMCTRL register at offset 0x80a4 +*/ +static void xhci_pme_quirk (struct xhci_hcd *xhci) +{ +u32 val; +void __iomem *reg; + + reg = (void __iomem *) xhci->cap_regs +0x80a4 ; + val =readl (reg); +writel (val |BIT (28 ), reg); +readl (reg); +} +/* called during probe() after chip reset completes */ static int xhci_pci_setup (struct usb_hcd *hcd) {
@@ -269,6 +293,9 @@ static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup)if (xhci_compliance_mode_recovery_timer_quirk_check ()) pdev->no_d3cold = true; +if (xhci->quirks &XHCI_PME_STUCK_QUIRK ) +xhci_pme_quirk (xhci); +return xhci_suspend (xhci, do_wakeup); }
@@ -299,6 +326,9 @@ static int xhci_pci_resume(struct usb_hcd *hcd, bool hibernated)if (pdev->vendor ==PCI_VENDOR_ID_INTEL )usb_enable_intel_xhci_ports (pdev); +if (xhci->quirks &XHCI_PME_STUCK_QUIRK ) +xhci_pme_quirk (xhci); + retval =xhci_resume (xhci, hibernated);return retval; }
drivers/usb/host/xhci.h +1 -0
@@ -1554,6 +1554,7 @@ struct xhci_hcd {#define XHCI_PLAT (1 << 16)#define XHCI_SLOW_SUSPEND (1 << 17)#define XHCI_SPURIOUS_WAKEUP (1 << 18) +#define XHCI_PME_STUCK_QUIRK (1 << 20)unsigned int num_active_eps;unsigned int limit_active_eps;/* There are two roothubs to keep track of bus suspend info for */
Signature · 1 line
2.6.2
PATCH 7/123 xhci: rework cycle bit checking for new dequeue pointers
In reply to Jiri SlabyFrom: Mathias Nyman <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 365038d83313951d6ace15342eb24624bbef1666 upstream.
When we manually need to move the TR dequeue pointer we need to set the correct cycle bit as well. Previously we used the trb pointer from the last event received as a base, but this was changed in
commit 1f81b6d22a59 ("usb: xhci: Prefer endpoint context dequeue pointer") to use the dequeue pointer from the endpoint context instead
It turns out some Asmedia controllers advance the dequeue pointer stored in the endpoint context past the event triggering TRB, and this messed up the way the cycle bit was calculated.
Instead of adding a quirk or complicating the already hard to follow cycle bit code, the whole cycle bit calculation is now simplified and adapted to handle event and endpoint context dequeue pointer differences.
[js] do not touch find_trb_seg, it is still in use in other portions
of the code
--- drivers/usb/host/xhci-ring.c | 75 +++++++++++++++++++++++--------------------- drivers/usb/host/xhci.c | 3 ++ 2 files changed, 42 insertions(+), 36 deletions(-)
drivers/usb/host/xhci-ring.c +39 -36
@@ -554,9 +554,12 @@ void xhci_find_new_dequeue_state(struct xhci_hcd *xhci,struct xhci_virt_device *dev = xhci->devs[slot_id];struct xhci_virt_ep *ep = &dev->eps[ep_index];struct xhci_ring *ep_ring; -struct xhci_generic_trb *trb; +struct xhci_segment *new_seg; +union xhci_trb *new_deq;dma_addr_t addr;u64 hw_dequeue; +bool cycle_found = false; +bool td_last_trb_found = false; ep_ring =xhci_triad_to_transfer_ring (xhci, slot_id, ep_index, stream_id);
@@ -581,45 +584,45 @@ void xhci_find_new_dequeue_state(struct xhci_hcd *xhci, hw_dequeue =le64_to_cpu (ep_ctx->deq); } -/* Find virtual address and segment of hardware dequeue pointer */ - state->new_deq_seg = ep_ring->deq_seg; - state->new_deq_ptr = ep_ring->dequeue; -while (xhci_trb_virt_to_dma (state->new_deq_seg, state->new_deq_ptr) - != (dma_addr_t)(hw_dequeue & ~0xf )) { -next_trb (xhci, ep_ring, &state->new_deq_seg, - &state->new_deq_ptr); -if (state->new_deq_ptr == ep_ring->dequeue) { -WARN_ON (1 ); -return ; - } - } + new_seg = ep_ring->deq_seg; + new_deq = ep_ring->dequeue; + state->new_cycle_state = hw_dequeue &0x1 ; +/* -* Find cycle state for last_trb, starting at old cycle state of -* hw_dequeue. If there is only one segment ring, find_trb_seg() will -* return immediately and cannot toggle the cycle state if this search -* wraps around, so add one more toggle manually in that case. +* We want to find the pointer, segment and cycle state of the new trb +* (the one after current TD's last_trb). We know the cycle state at +* hw_dequeue, so walk the ring until both hw_dequeue and last_trb are +* found. */ - state->new_cycle_state = hw_dequeue &0x1 ; -if (ep_ring->first_seg == ep_ring->first_seg->next && - cur_td->last_trb < state->new_deq_ptr) - state->new_cycle_state ^=0x1 ; +do { +if (!cycle_found &&xhci_trb_virt_to_dma (new_seg, new_deq) + == (dma_addr_t)(hw_dequeue & ~0xf )) { + cycle_found = true; +if (td_last_trb_found) +break ; + } +if (new_deq == cur_td->last_trb) + td_last_trb_found = true; - state->new_deq_ptr = cur_td->last_trb; -xhci_dbg_trace (xhci, trace_xhci_dbg_cancel_urb, -"Finding segment containing last TRB in TD." ); - state->new_deq_seg =find_trb_seg (state->new_deq_seg, - state->new_deq_ptr, &state->new_cycle_state); -if (!state->new_deq_seg) { -WARN_ON (1 ); -return ; - } +if (cycle_found && +TRB_TYPE_LINK_LE32 (new_deq->generic.field[3 ]) && + new_deq->generic.field[3 ] &cpu_to_le32 (LINK_TOGGLE )) + state->new_cycle_state ^=0x1 ; + +next_trb (xhci, ep_ring, &new_seg, &new_deq); + +/* Search wrapped around, bail out */ +if (new_deq == ep->ring->dequeue) { +xhci_err (xhci,"Error: Failed finding new dequeue state\n" ); + state->new_deq_seg =NULL ; + state->new_deq_ptr =NULL ; +return ; + } + + }while (!cycle_found || !td_last_trb_found); -/* Increment to find next TRB after last_trb. Cycle if appropriate. */ - trb = &state->new_deq_ptr->generic; -if (TRB_TYPE_LINK_LE32 (trb->field[3 ]) && - (trb->field[3 ] &cpu_to_le32 (LINK_TOGGLE ))) - state->new_cycle_state ^=0x1 ; -next_trb (xhci, ep_ring, &state->new_deq_seg, &state->new_deq_ptr); + state->new_deq_seg = new_seg; + state->new_deq_ptr = new_deq;/* Don't update the ring cycle state for the producer (us). */ xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,
drivers/usb/host/xhci.c +3 -0
@@ -2902,6 +2902,9 @@ void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci, ep_index, ep->stopped_stream, ep->stopped_td, &deq_state); +if (!deq_state.new_deq_ptr || !deq_state.new_deq_seg) +return ; +/* HW with the reset endpoint quirk will use the saved dequeue state to * issue a configure endpoint command later. */
Signature · 1 line
2.6.2
PATCH 8/123 usb: core: Fix USB 3.0 devices lost in NOTATTACHED state after a hub port reset
In reply to Jiri SlabyFrom: Robert Schlabbach <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit fb6d1f7df5d25299fd7b3e84b72b8851d3634764 upstream.
Fix USB 3.0 devices lost in NOTATTACHED state after a hub port reset.
Dissolve the function hub_port_finish_reset() completely and divide the actions to be taken into those which need to be done after each reset attempt and those which need to be done after the full procedure is complete, and place them in the appropriate places in hub_port_reset(). Also, remove an unneeded forward declaration of hub_port_reset().
Verbose Problem Description:
USB 3.0 devices may be "lost for good" during a hub port reset. This makes Linux unable to boot from USB 3.0 devices in certain constellations of host controllers and devices, because the USB device is lost during initialization, preventing the rootfs from being mounted.
The underlying problem is that in the affected constellations, during the processing inside hub_port_reset(), the hub link state goes from 0 to SS.inactive after the initial reset, and back to 0 again only after the following "warm" reset.
However, hub_port_finish_reset() is called after each reset attempt and sets the state the connected USB device based on the "preliminary" status of the hot reset to USB_STATE_NOTATTACHED due to SS.inactive, yet when the following warm reset is complete and hub_port_finish_reset() is called again, its call to set the device to USB_STATE_DEFAULT is blocked by usb_set_device_state() which does not allow taking USB devices out of USB_STATE_NOTATTACHED state.
Thanks to Alan Stern for guiding me to the proper solution and how to submit it.
--- drivers/usb/core/hub.c | 82 ++++++++++++++++++++------------------------------ 1 file changed, 33 insertions(+), 49 deletions(-)
drivers/usb/core/hub.c +33 -49
@@ -2539,9 +2539,6 @@ static unsigned hub_is_wusb(struct usb_hub *hub)#define HUB_LONG_RESET_TIME 200#define HUB_RESET_TIMEOUT 800 -static int hub_port_reset (struct usb_hub *hub,int port1, -struct usb_device *udev,unsigned int delay,bool warm); -/* Is a USB 3.0 port in the Inactive or Complinance Mode state? * Port worm reset is required to recover */
@@ -2622,44 +2619,6 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1,return 0 ; } -static void hub_port_finish_reset (struct usb_hub *hub,int port1, -struct usb_device *udev,int *status) -{ -switch (*status) { -case 0 : -/* TRSTRCY = 10 ms; plus some extra */ -msleep (10 +40 ); -if (udev) { -struct usb_hcd *hcd =bus_to_hcd (udev->bus); - -update_devnum (udev,0 ); -/* The xHC may think the device is already reset, -* so ignore the status. -*/ -if (hcd->driver->reset_device) - hcd->driver->reset_device (hcd, udev); - } -/* FALL THROUGH */ -case -ENOTCONN : -case -ENODEV : -usb_clear_port_feature (hub->hdev, - port1,USB_PORT_FEAT_C_RESET ); -if (hub_is_superspeed (hub->hdev)) { -usb_clear_port_feature (hub->hdev, port1, -USB_PORT_FEAT_C_BH_PORT_RESET ); -usb_clear_port_feature (hub->hdev, port1, -USB_PORT_FEAT_C_PORT_LINK_STATE ); -usb_clear_port_feature (hub->hdev, port1, -USB_PORT_FEAT_C_CONNECTION ); - } -if (udev) -usb_set_device_state (udev, *status - ?USB_STATE_NOTATTACHED - :USB_STATE_DEFAULT ); -break ; - } -} -/* Handle port reset and port warm(BH) reset (for USB3 protocol ports) */ static int hub_port_reset (struct usb_hub *hub,int port1,struct usb_device *udev,unsigned int delay,bool warm)
@@ -2682,13 +2641,10 @@ static int hub_port_reset(struct usb_hub *hub, int port1,* If the caller hasn't explicitly requested a warm reset, * double check and see if one is needed. */ - status =hub_port_status (hub, port1, - &portstatus, &portchange); -if (status <0 ) - goto done; - -if (hub_port_warm_reset_required (hub, portstatus)) - warm = true; +if (hub_port_status (hub, port1, &portstatus, &portchange) ==0 ) +if (hub_port_warm_reset_required (hub, + portstatus)) + warm = true; }/* Reset the port */
@@ -2713,11 +2669,19 @@ static int hub_port_reset(struct usb_hub *hub, int port1,/* Check for disconnect or reset */ if (status ==0 || status == -ENOTCONN || status == -ENODEV ) { -hub_port_finish_reset (hub, port1, udev, &status); +usb_clear_port_feature (hub->hdev, port1, +USB_PORT_FEAT_C_RESET );if (!hub_is_superspeed (hub->hdev)) goto done; +usb_clear_port_feature (hub->hdev, port1, +USB_PORT_FEAT_C_BH_PORT_RESET ); +usb_clear_port_feature (hub->hdev, port1, +USB_PORT_FEAT_C_PORT_LINK_STATE ); +usb_clear_port_feature (hub->hdev, port1, +USB_PORT_FEAT_C_CONNECTION ); +/* * If a USB 3.0 device migrates from reset to an error * state, re-issue the warm reset.
@@ -2751,6 +2715,26 @@ static int hub_port_reset(struct usb_hub *hub, int port1, port1); done: +if (status ==0 ) { +/* TRSTRCY = 10 ms; plus some extra */ +msleep (10 +40 ); +if (udev) { +struct usb_hcd *hcd =bus_to_hcd (udev->bus); + +update_devnum (udev,0 ); +/* The xHC may think the device is already reset, +* so ignore the status. +*/ +if (hcd->driver->reset_device) + hcd->driver->reset_device (hcd, udev); + +usb_set_device_state (udev,USB_STATE_DEFAULT ); + } + }else { +if (udev) +usb_set_device_state (udev,USB_STATE_NOTATTACHED ); + } +if (!hub_is_superspeed (hub->hdev))up_read (&ehci_cf_port_reset_rwsem);
Signature · 1 line
2.6.2
PATCH 9/123 USB: usbtmc: add device quirk for Rigol DS6104
In reply to Jiri SlabyFrom: Teunis van Beelen <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit f50420223071b6ff4b586308f5c27eec54694a81 upstream.
Recently we purchased the Rigol DS6104 and when I try to operate it from my Linux pc, everything works well with the default usbtmc driver, except when I want to download a big datachunk like a screenshot. This bitmapfile has a size of 1152054 bytes but I receive a smaller file and no new packets can be read.
When I took a look at the driver source, I found this "Rigol quirk" and I added the id of the new DS series oscilloscopes to this list. I compiled it and loaded the new driver and now everything seems to work fine.
--- drivers/usb/class/usbtmc.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/class/usbtmc.c +1 -0
@@ -110,6 +110,7 @@ struct usbtmc_ID_rigol_quirk {static const struct usbtmc_ID_rigol_quirk usbtmc_id_quirk[] = { {0x1ab1 ,0x0588 }, + {0x1ab1 ,0x04b0 }, {0 ,0 } };
Signature · 1 line
2.6.2
Re: [PATCH 3.12 009/123] USB: usbtmc: add device quirk for Rigol DS6104
Recently there was a firmware update for the Rigol DS6000 series that seems to solve the need for the "Rigol quirk".
After a quick check, it looks like the scope now works well with and without the patch.
I need to do some more testing though...
What do you suggest, we put it on hold, we wait?
How much time do we have? Let me know.
Kind Regards,
Teunis van Beelen
Quoted 41 lines · Jiri Slaby
From: Teunis van Beelen <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit
f50420223071b6ff4b586308f5c27eec54694a81upstream.Recently we purchased the Rigol DS6104 and when I try to operate it from my Linux pc, everything works well with the default usbtmc driver, except when I want to download a big datachunk like a screenshot. This bitmapfile has a size of 1152054 bytes but I receive a smaller file and no new packets can be read.
When I took a look at the driver source, I found this "Rigol quirk" and I added the id of the new DS series oscilloscopes to this list. I compiled it and loaded the new driver and now everything seems to work fine.
Signed-off-by Teunis van Beelen <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>Signed-off-by Jiri Slaby <[email protected]>--- drivers/usb/class/usbtmc.c | 1 + 1 file changed, 1 insertion(+)drivers/usb/class/usbtmc.c +1
-1@@ -110,6 +110,7 @@ struct usbtmc_ID_rigol_quirk {static const struct usbtmc_ID_rigol_quirk usbtmc_id_quirk[] = { {0x1ab1 ,0x0588 }, + {0x1ab1 ,0x04b0 }, {0 ,0 } }; --2.6.2
Signature · 1 line
"C'è qualcosa nella nebbia! Qualcosa nella nebbia ha preso John Lee!"
PATCH 10/123 client MUST ignore EncryptionKeyLength if CAP_EXTENDED_SECURITY is set
In reply to Jiri SlabyFrom: Noel Power <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit f291095f340db986271e951e3891bb95624a93ea upstream.
[MS-SMB] 2.2.4.5.2.1 states:
"ChallengeLength (1 byte): When the CAP_EXTENDED_SECURITY bit is set,
the server MUST set this value to zero and clients MUST ignore this value."
--- fs/cifs/cifssmb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
fs/cifs/cifssmb.c +2 -3
@@ -629,9 +629,8 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses) server->negflavor =CIFS_NEGFLAVOR_UNENCAP ;memcpy (ses->server->cryptkey, pSMBr->u.EncryptionKey,CIFS_CRYPTO_KEY_SIZE ); - }else if ((pSMBr->hdr.Flags2 &SMBFLG2_EXT_SEC || - server->capabilities &CAP_EXTENDED_SECURITY ) && - (pSMBr->EncryptionKeyLength ==0 )) { + }else if (pSMBr->hdr.Flags2 &SMBFLG2_EXT_SEC || + server->capabilities &CAP_EXTENDED_SECURITY ) { server->negflavor =CIFS_NEGFLAVOR_EXTENDED ; rc =decode_ext_sec_blob (ses, pSMBr); }else if (server->sec_mode &SECMODE_PW_ENCRYPT ) {
Signature · 1 line
2.6.2
PATCH 11/123 iommu/amd: Handle integer overflow in dma_ops_area_alloc
In reply to Jiri SlabyFrom: Joerg Roedel <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit e6aabee05f41c9d18e0b92194819edd84f352ac9 upstream.
Handle this case to make sure boundary_size does not become 0 and trigger a BUG_ON later.
--- drivers/iommu/amd_iommu.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/iommu/amd_iommu.c +5 -3
@@ -1750,14 +1750,16 @@ static unsigned long dma_ops_area_alloc(struct device *dev,unsigned long next_bit = dom->next_address %APERTURE_RANGE_SIZE ;int max_index = dom->aperture_size >>APERTURE_RANGE_SHIFT ;int i = start >>APERTURE_RANGE_SHIFT ; -unsigned long boundary_size; +unsigned long boundary_size, mask;unsigned long address =-1 ;unsigned long limit; next_bit >>=PAGE_SHIFT ; - boundary_size =ALIGN (dma_get_seg_boundary (dev) +1 , -PAGE_SIZE ) >>PAGE_SHIFT ; + mask =dma_get_seg_boundary (dev); + + boundary_size = mask +1 ?ALIGN (mask +1 ,PAGE_SIZE ) >>PAGE_SHIFT : +1UL << (BITS_PER_LONG -PAGE_SHIFT );for (;i < max_index; ++i) {unsigned long offset = dom->aperture[i]->offset >>PAGE_SHIFT ;
Signature · 1 line
2.6.2
PATCH 12/123 s390/3270: redraw screen on unsolicited device end
In reply to Jiri SlabyFrom: Martin Schwidefsky <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 05bfd70bcdd3cd12c061cb77b73a11ba6f87379d upstream.
If a 3270 terminal is disconnected and later reconnected again, it gets an unsolicited device end. This is currently ignored and you have to hit the clear key to get the screen redrawn. Add an automatic full redraw of the screen for this case.
--- drivers/s390/char/con3270.c | 4 ++++ drivers/s390/char/tty3270.c | 4 ++++ 2 files changed, 8 insertions(+)
drivers/s390/char/con3270.c +4 -0
@@ -407,6 +407,10 @@ con3270_irq(struct con3270 *cp, struct raw3270_request *rq, struct irb *irb)else /* Normal end. Copy residual count. */ rq->rescnt = irb->scsw.cmd.count; + }else if (irb->scsw.cmd.dstat &DEV_STAT_DEV_END ) { +/* Interrupt without an outstanding request -> update all */ + cp->update_flags =CON_UPDATE_ALL ; +con3270_set_timer (cp,1 ); }return RAW3270_IO_DONE ; }
drivers/s390/char/tty3270.c +4 -0
@@ -662,6 +662,10 @@ tty3270_irq(struct tty3270 *tp, struct raw3270_request *rq, struct irb *irb)else /* Normal end. Copy residual count. */ rq->rescnt = irb->scsw.cmd.count; + }else if (irb->scsw.cmd.dstat &DEV_STAT_DEV_END ) { +/* Interrupt without an outstanding request -> update all */ + tp->update_flags =TTY_UPDATE_ALL ; +tty3270_set_timer (tp,1 ); }return RAW3270_IO_DONE ; }
Signature · 1 line
2.6.2
PATCH 13/123 Use WARN_ON_ONCE for missing X86_FEATURE_NRIPS
In reply to Jiri SlabyFrom: Dirk Müller <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit d2922422c48df93f3edff7d872ee4f3191fefb08 upstream.
The cpu feature flags are not ever going to change, so warning everytime can cause a lot of kernel log spam
(in our case more than 10GB/hour).
The warning seems to only occur when nested virtualization is enabled, so it's probably triggered by a KVM bug. This is a sensible and safe change anyway, and the KVM bug fix might not be suitable for stable releases anyway.
--- arch/x86/kvm/svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/svm.c +1 -1
@@ -496,7 +496,7 @@ static void skip_emulated_instruction(struct kvm_vcpu *vcpu)struct vcpu_svm *svm =to_svm (vcpu);if (svm->vmcb->control.next_rip !=0 ) { -WARN_ON (!static_cpu_has (X86_FEATURE_NRIPS )); +WARN_ON_ONCE (!static_cpu_has (X86_FEATURE_NRIPS )); svm->next_rip = svm->vmcb->control.next_rip; }
Signature · 1 line
2.6.2
PATCH 14/123 ARM: 7880/1: Clear the IT state independent of the Thumb-2 mode
In reply to Jiri SlabyFrom: "T.J. Purtell" <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 6ecf830e5029598732e04067e325d946097519cb upstream.
The ARM architecture reference specifies that the IT state bits in the PSR must be all zeros in ARM mode or behavior is unspecified. On the Qualcomm Snapdragon S4/Krait architecture CPUs the processor continues to consider the IT state bits while in ARM mode. This makes it so that some instructions are skipped by the CPU.
--- arch/arm/kernel/signal.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
arch/arm/kernel/signal.c +10 -4
@@ -375,12 +375,18 @@ setup_return(struct pt_regs *regs, struct ksignal *ksig,*/ thumb = handler &1 ; -if (thumb) { - cpsr |=PSR_T_BIT ;#if __LINUX_ARM_ARCH__ >=7 -/* clear the If-Then Thumb-2 execution state */ - cpsr &= ~PSR_IT_MASK ; +/* +* Clear the If-Then Thumb-2 execution state +* ARM spec requires this to be all 000s in ARM mode +* Snapdragon S4/Krait misbehaves on a Thumb=>ARM +* signal transition without this. +*/ + cpsr &= ~PSR_IT_MASK ;#endif + +if (thumb) { + cpsr |=PSR_T_BIT ; }else cpsr &= ~PSR_T_BIT ; }
Signature · 1 line
2.6.2
PATCH 15/123 net: add length argument to skb_copy_and_csum_datagram_iovec
In reply to Jiri SlabyFrom: Sabrina Dubroca <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
Without this length argument, we can read past the end of the iovec in memcpy_toiovec because we have no way of knowing the total length of the iovec's buffers.
This is needed for stable kernels where 89c22d8c3b27 ("net: Fix skb csum races when peeking") has been backported but that don't have the ioviter conversion, which is almost all the stable trees <= 3.18.
This also fixes a kernel crash for NFS servers when the client uses
-onfsvers=3,proto=udp to mount the export.
--- include/linux/skbuff.h | 3 ++- net/core/datagram.c | 6 +++++- net/ipv4/tcp_input.c | 2 +- net/ipv4/udp.c | 2 +- net/ipv6/raw.c | 2 +- net/ipv6/udp.c | 3 ++- net/rxrpc/ar-recvmsg.c | 3 ++- 7 files changed, 14 insertions(+), 7 deletions(-)
include/linux/skbuff.h +2 -1
@@ -2350,7 +2350,8 @@ extern int skb_copy_datagram_iovec(const struct sk_buff *from, int size);extern int skb_copy_and_csum_datagram_iovec (struct sk_buff *skb,int hlen, -struct iovec *iov); +struct iovec *iov, +int len); extern int skb_copy_datagram_from_iovec(struct sk_buff *skb, int offset, const struct iovec *from,
net/core/datagram.c +5 -1
@@ -796,6 +796,7 @@ EXPORT_SYMBOL(__skb_checksum_complete);* @skb: skbuff * @hlen: hardware length * @iov: io vector +* @len: amount of data to copy from skb to iov * * Caller _must_ check that skb will fit to this iovec. *
@@ -805,11 +806,14 @@ EXPORT_SYMBOL(__skb_checksum_complete);* can be modified! */ int skb_copy_and_csum_datagram_iovec (struct sk_buff *skb, -int hlen,struct iovec *iov) +int hlen,struct iovec *iov,int len) {__wsum csum;int chunk = skb->len - hlen; +if (chunk > len) + chunk = len; +if (!chunk)return 0 ;
net/ipv4/tcp_input.c +1 -1
@@ -4892,7 +4892,7 @@ static int tcp_copy_to_iovec(struct sock *sk, struct sk_buff *skb, int hlen) err =skb_copy_datagram_iovec (skb, hlen, tp->ucopy.iov, chunk); else err =skb_copy_and_csum_datagram_iovec (skb, hlen, - tp->ucopy.iov); + tp->ucopy.iov, chunk);if (!err) { tp->ucopy.len -= chunk;
net/ipv4/udp.c +1 -1
@@ -1245,7 +1245,7 @@ try_again:else { err =skb_copy_and_csum_datagram_iovec (skb,sizeof (struct udphdr ), - msg->msg_iov); + msg->msg_iov, copied);if (err == -EINVAL ) goto csum_copy_err;
net/ipv6/raw.c +1 -1
@@ -489,7 +489,7 @@ static int rawv6_recvmsg(struct kiocb *iocb, struct sock *sk, goto csum_copy_err; err =skb_copy_datagram_iovec (skb,0 , msg->msg_iov, copied); }else { - err =skb_copy_and_csum_datagram_iovec (skb,0 , msg->msg_iov); + err =skb_copy_and_csum_datagram_iovec (skb,0 , msg->msg_iov, copied);if (err == -EINVAL ) goto csum_copy_err; }
net/ipv6/udp.c +2 -1
@@ -410,7 +410,8 @@ try_again: err =skb_copy_datagram_iovec (skb,sizeof (struct udphdr ), msg->msg_iov, copied); else { - err =skb_copy_and_csum_datagram_iovec (skb,sizeof (struct udphdr ), msg->msg_iov); + err =skb_copy_and_csum_datagram_iovec (skb,sizeof (struct udphdr ), + msg->msg_iov, copied);if (err == -EINVAL ) goto csum_copy_err; }
net/rxrpc/ar-recvmsg.c +2 -1
@@ -185,7 +185,8 @@ int rxrpc_recvmsg(struct kiocb *iocb, struct socket *sock, msg->msg_iov, copy); }else { ret =skb_copy_and_csum_datagram_iovec (skb, offset, - msg->msg_iov); + msg->msg_iov, + copy);if (ret == -EINVAL ) goto csum_copy_error; }
Signature · 1 line
2.6.2
PATCH 16/123 ALSA: hda - Control SPDIF out pin on MacBookPro 11,2
In reply to Jiri SlabyFrom: Takashi Iwai <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 0c52db8cca7b033d03ebcda652158e2311d5ac64 upstream.
The SPDIF output MBP11,2 requires the pin control to be set/cleared for turning on/off the optical SPDIF. The red light turns off only when the corresponding pin control is cleared (or powered to D3).
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=64401
--- sound/pci/hda/patch_cirrus.c | 56 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-)
sound/pci/hda/patch_cirrus.c +55 -1
@@ -47,6 +47,10 @@ struct cs_spec { unsigned int spdif_present:1; unsigned int sense_b:1;hda_nid_t vendor_nid; + +/* for MBP SPDIF control */ +int (*spdif_sw_put)(struct snd_kcontrol *kcontrol, +struct snd_ctl_elem_value *ucontrol); };/* available models with CS420x */
@@ -331,10 +335,21 @@ static int cs_init(struct hda_codec *codec)return 0 ; } +static int cs_build_controls (struct hda_codec *codec) +{ +int err; + + err =snd_hda_gen_build_controls (codec); +if (err <0 ) +return err; +snd_hda_apply_fixup (codec,HDA_FIXUP_ACT_BUILD ); +return 0 ; +} +#define cs_free snd_hda_gen_freestatic const struct hda_codec_ops cs_patch_ops = { - .build_controls = snd_hda_gen_build_controls, + .build_controls = cs_build_controls, .build_pcms = snd_hda_gen_build_pcms, .init = cs_init, .free = cs_free,
@@ -601,12 +616,14 @@ static int patch_cs420x(struct hda_codec *codec)enum {CS4208_MAC_AUTO ,CS4208_MBA6 , +CS4208_MBP11 ,CS4208_GPIO0 , };static const struct hda_model_fixup cs4208_models[] = { { .id =CS4208_GPIO0 , .name ="gpio0" }, { .id =CS4208_MBA6 , .name ="mba6" }, + { .id =CS4208_MBP11 , .name ="mbp11" }, {} };
@@ -617,6 +634,7 @@ static const struct snd_pci_quirk cs4208_fixup_tbl[] = {/* codec SSID matching */ static const struct snd_pci_quirk cs4208_mac_fixup_tbl[] = { +SND_PCI_QUIRK (0x106b ,0x5e00 ,"MacBookPro 11,2" ,CS4208_MBP11 ),SND_PCI_QUIRK (0x106b ,0x7100 ,"MacBookAir 6,1" ,CS4208_MBA6 ),SND_PCI_QUIRK (0x106b ,0x7200 ,"MacBookAir 6,2" ,CS4208_MBA6 ), {}/* terminator */
@@ -648,6 +666,36 @@ static void cs4208_fixup_mac(struct hda_codec *codec,snd_hda_apply_fixup (codec, action); } +static int cs4208_spdif_sw_put (struct snd_kcontrol *kcontrol, +struct snd_ctl_elem_value *ucontrol) +{ +struct hda_codec *codec =snd_kcontrol_chip (kcontrol); +struct cs_spec *spec = codec->spec; +hda_nid_t pin = spec->gen.autocfg.dig_out_pins[0 ]; +int pinctl = ucontrol->value.integer.value[0 ] ?PIN_OUT :0 ; + +snd_hda_set_pin_ctl_cache (codec, pin, pinctl); +return spec->spdif_sw_put (kcontrol, ucontrol); +} + +/* hook the SPDIF switch */ +static void cs4208_fixup_spdif_switch (struct hda_codec *codec, +const struct hda_fixup *fix,int action) +{ +if (action ==HDA_FIXUP_ACT_BUILD ) { +struct cs_spec *spec = codec->spec; +struct snd_kcontrol *kctl; + +if (!spec->gen.autocfg.dig_out_pins[0 ]) +return ; + kctl =snd_hda_find_mixer_ctl (codec,"IEC958 Playback Switch" ); +if (!kctl) +return ; + spec->spdif_sw_put = kctl->put; + kctl->put = cs4208_spdif_sw_put; + } +} +static const struct hda_fixup cs4208_fixups[] = { [CS4208_MBA6 ] = { .type =HDA_FIXUP_PINS ,
@@ -655,6 +703,12 @@ static const struct hda_fixup cs4208_fixups[] = { .chained = true, .chain_id = CS4208_GPIO0, }, + [CS4208_MBP11] = { + .type = HDA_FIXUP_FUNC, + .v.func = cs4208_fixup_spdif_switch, + .chained = true, + .chain_id = CS4208_GPIO0, + }, [CS4208_GPIO0] = { .type = HDA_FIXUP_FUNC, .v.func = cs4208_fixup_gpio0,
Signature · 1 line
2.6.2
PATCH 17/123 kvm: fix zero length mmio searching
In reply to Jiri SlabyFrom: Jason Wang <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 8f4216c7d28976f7ec1b2bcbfa0a9f787133c45e upstream.
Currently, if we had a zero length mmio eventfd assigned on KVM_MMIO_BUS. It will never be found by kvm_io_bus_cmp() since it always compares the kvm_io_range() with the length that guest wrote. This will cause e.g for vhost, kick will be trapped by qemu userspace instead of vhost. Fixing this by using zero length if an iodevice is zero length.
--- virt/kvm/kvm_main.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
virt/kvm/kvm_main.c +17 -2
@@ -2813,10 +2813,25 @@ static void kvm_io_bus_destroy(struct kvm_io_bus *bus)static inline int kvm_io_bus_cmp (const struct kvm_io_range *r1,const struct kvm_io_range *r2) { -if (r1->addr < r2->addr) +gpa_t addr1 = r1->addr; +gpa_t addr2 = r2->addr; + +if (addr1 < addr2)return -1 ; -if (r1->addr + r1->len > r2->addr + r2->len) + +/* If r2->len == 0, match the exact address. If r2->len != 0, +* accept any overlapping write. Any order is acceptable for +* overlapping ranges, because kvm_io_bus_get_first_dev ensures +* we process all of them. +*/ +if (r2->len) { + addr1 += r1->len; + addr2 += r2->len; + } + +if (addr1 > addr2)return 1 ; +return 0 ; }
Signature · 1 line
2.6.2
PATCH 18/123 scsi: fix scsi_error_handler vs. scsi_host_dev_release race
In reply to Jiri SlabyFrom: Michal Hocko <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 537b604c8b3aa8b96fe35f87dd085816552e294c upstream.
b9d5c6b7ef57 ("[SCSI] cleanup setting task state in scsi_error_handler()") has introduced a race between scsi_error_handler and scsi_host_dev_release resulting in the hang when the device goes away because scsi_error_handler might miss a wake up:
CPU0 CPU1scsi_error_handler scsi_host_dev_release
kthread_stop()
kthread_should_stop()
test_bit(KTHREAD_SHOULD_STOP)
set_bit(KTHREAD_SHOULD_STOP) wake_up_process() wait_for_completion()
set_current_state(TASK_INTERRUPTIBLE)
schedule()
The most straightforward solution seems to be to invert the ordering of the set_current_state and kthread_should_stop.
The issue has been noticed during reboot test on a 3.0 based kernel but the current code seems to be affected in the same way.
--- drivers/scsi/scsi_error.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/scsi/scsi_error.c +10 -1
@@ -1906,8 +1906,17 @@ int scsi_error_handler(void *data)* We never actually get interrupted because kthread_run * disables signal delivery for the created thread. */ -while (!kthread_should_stop ()) { +while (true) { +/* +* The sequence in kthread_stop() sets the stop flag first +* then wakes the process. To avoid missed wakeups, the task +* should always be in a non running state before the stop +* flag is checked +*/ set_current_state (TASK_INTERRUPTIBLE ); +if (kthread_should_stop ()) +break ; +if ((shost->host_failed ==0 && shost->host_eh_scheduled ==0 ) || shost->host_failed != shost->host_busy) { SCSI_LOG_ERROR_RECOVERY(1,
Signature · 1 line
2.6.2
PATCH 19/123 iser-target: remove command with state ISTATE_REMOVE
In reply to Jiri SlabyFrom: Jenny Derzhavetz <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit a4c15cd957cbd728f685645de7a150df5912591a upstream.
As documented in iscsit_sequence_cmd:
/*
* Existing callers for iscsit_sequence_cmd() will silently
* ignore commands with CMDSN_LOWER_THAN_EXP, so force this
* return for CMDSN_MAXCMDSN_OVERRUN as well..
*/
We need to silently finish a command when it's in ISTATE_REMOVE. This fixes an teardown hang we were seeing where a mis-behaved initiator (triggered by allocation error injections) sent us a cmdsn which was lower than expected.
--- drivers/infiniband/ulp/isert/ib_isert.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/infiniband/ulp/isert/ib_isert.c +8 -1
@@ -2541,9 +2541,16 @@ isert_get_dataout(struct iscsi_conn *conn, struct iscsi_cmd *cmd, bool recovery)static int isert_immediate_queue (struct iscsi_conn *conn,struct iscsi_cmd *cmd,int state) { -int ret; +struct isert_cmd *isert_cmd =iscsit_priv_cmd (cmd); +int ret =0 ;switch (state) { +case ISTATE_REMOVE : +spin_lock_bh (&conn->cmd_lock); +list_del_init (&cmd->i_conn_node); +spin_unlock_bh (&conn->cmd_lock); +isert_put_cmd (isert_cmd, true); +break ;case ISTATE_SEND_NOPIN_WANT_RESPONSE : ret =isert_put_nopin (cmd, conn, false);break ;
Signature · 1 line
2.6.2
PATCH 20/123 perf hists: Update the column width for the "srcline" sort key
In reply to Jiri SlabyFrom: Arnaldo Carvalho de Melo <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit e8e6d37e73e6b950c891c780745460b87f4755b6 upstream.
When we introduce a new sort key, we need to update the hists__calc_col_len() function accordingly, otherwise the width will be limited to strlen(header).
We can't update it when obtaining a line value for a column (for instance, in sort__srcline_cmp()), because we reset it all when doing a resort (see hists__output_recalc_col_len()), so we need to, from what is in the hist_entry fields, set each of the column widths.
--- tools/perf/util/hist.c | 3 +++ 1 file changed, 3 insertions(+)
tools/perf/util/hist.c +3 -0
@@ -160,6 +160,9 @@ void hists__calc_col_len(struct hists *hists, struct hist_entry *h)hists__new_col_len (hists,HISTC_MEM_LVL ,21 +3 );hists__new_col_len (hists,HISTC_LOCAL_WEIGHT ,12 );hists__new_col_len (hists,HISTC_GLOBAL_WEIGHT ,12 ); + +if (h->srcline) +hists__new_col_len (hists,HISTC_SRCLINE ,strlen (h->srcline)); }void hists__output_recalc_col_len (struct hists *hists,int max_rows)
Signature · 1 line
2.6.2
PATCH 21/123 perf stat: Get correct cpu id for print_aggr
In reply to Jiri SlabyFrom: Kan Liang <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 601083cffb7cabdcc55b8195d732f0f7028570fa upstream.
print_aggr() fails to print per-core/per-socket statistics after commit 582ec0829b3d ("perf stat: Fix per-socket output bug for uncore events") if events have differnt cpus. Because in print_aggr(), aggr_get_id needs index (not cpu id) to find core/pkg id. Also, evsel cpu maps should be used to get aggregated id.
Here is an example:
Counting events cycles,uncore_imc_0/cas_count_read/. (Uncore event has cpumask 0,18)
$ perf stat -e cycles,uncore_imc_0/cas_count_read/ -C0,18 --per-core sleep 2
Without this patch, it failes to get CPU 18 result.
Performance counter stats for 'CPU(s) 0,18':
S0-C0 1 7526851 cycles S0-C0 1 1.05 MiB uncore_imc_0/cas_count_read/ S1-C0 0 <not counted> cycles S1-C0 0 <not counted> MiB uncore_imc_0/cas_count_read/
With this patch, it can get both CPU0 and CPU18 result.
Performance counter stats for 'CPU(s) 0,18':
S0-C0 1 6327768 cycles S0-C0 1 0.47 MiB uncore_imc_0/cas_count_read/ S1-C0 1 330228 cycles S1-C0 1 0.29 MiB uncore_imc_0/cas_count_read/
--- tools/perf/builtin-stat.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
tools/perf/builtin-stat.c +2 -3
@@ -945,7 +945,7 @@ static void abs_printout(int cpu, int nr, struct perf_evsel *evsel, double avg)static void print_aggr (char *prefix) {struct perf_evsel *counter; -int cpu, cpu2, s, s2, id, nr; +int cpu, s, s2, id, nr;u64 ena, run, val;if (!(aggr_map || aggr_get_id))
@@ -957,8 +957,7 @@ static void print_aggr(char *prefix) val = ena = run =0 ; nr =0 ;for (cpu =0 ; cpu <perf_evsel__nr_cpus (counter); cpu++) { - cpu2 =perf_evsel__cpus (counter)->map[cpu]; - s2 =aggr_get_id (evsel_list->cpus, cpu2); + s2 =aggr_get_id (perf_evsel__cpus (counter), cpu);if (s2 != id)continue ; val += counter->counts->cpu[cpu].val;
Signature · 1 line
2.6.2
PATCH 22/123 perf header: Fixup reading of HEADER_NRCPUS feature
In reply to Jiri SlabyFrom: Arnaldo Carvalho de Melo <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit caa470475d9b59eeff093ae650800d34612c4379 upstream.
The original patch introducing this header wrote the number of CPUs available and online in one order and then swapped those values when reading, fix it.
Before:
# perf record usleep 1 # perf report --header-only | grep 'nrcpus \(online\|avail\)' # nrcpus online : 4 # nrcpus avail : 4 # echo 0 > /sys/devices/system/cpu/cpu2/online # perf record usleep 1 # perf report --header-only | grep 'nrcpus \(online\|avail\)' # nrcpus online : 4 # nrcpus avail : 3 # echo 0 > /sys/devices/system/cpu/cpu1/online # perf record usleep 1 # perf report --header-only | grep 'nrcpus \(online\|avail\)' # nrcpus online : 4 # nrcpus avail : 2
After the fix, bringing back the CPUs online:
# perf report --header-only | grep 'nrcpus \(online\|avail\)' # nrcpus online : 2 # nrcpus avail : 4 # echo 1 > /sys/devices/system/cpu/cpu2/online # perf record usleep 1 # perf report --header-only | grep 'nrcpus \(online\|avail\)' # nrcpus online : 3 # nrcpus avail : 4 # echo 1 > /sys/devices/system/cpu/cpu1/online # perf record usleep 1 # perf report --header-only | grep 'nrcpus \(online\|avail\)' # nrcpus online : 4 # nrcpus avail : 4
--- tools/perf/util/header.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/util/header.c +2 -2
@@ -1718,7 +1718,7 @@ static int process_nrcpus(struct perf_file_section *section __maybe_unused,if (ph->needs_swap) nr =bswap_32 (nr); - ph->env.nr_cpus_online = nr; + ph->env.nr_cpus_avail = nr; ret =readn (fd, &nr,sizeof (nr));if (ret !=sizeof (nr))
@@ -1727,7 +1727,7 @@ static int process_nrcpus(struct perf_file_section *section __maybe_unused,if (ph->needs_swap) nr =bswap_32 (nr); - ph->env.nr_cpus_avail = nr; + ph->env.nr_cpus_online = nr;return 0 ; }
Signature · 1 line
2.6.2
PATCH 23/123 hwmon: (nct6775) Swap STEP_UP_TIME and STEP_DOWN_TIME registers for most chips
In reply to Jiri SlabyFrom: Guenter Roeck <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 728d29400488d54974d3317fe8a232b45fdb42ee upstream.
The STEP_UP_TIME and STEP_DOWN_TIME registers are swapped for all chips but NCT6775.
--- drivers/hwmon/nct6775.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/hwmon/nct6775.c +10 -6
@@ -348,6 +348,10 @@ static const u16 NCT6775_REG_TEMP_CRIT[ARRAY_SIZE(nct6775_temp_label) - 1]/* NCT6776 specific data */ +/* STEP_UP_TIME and STEP_DOWN_TIME regs are swapped for all chips but NCT6775 */ +#define NCT6776_REG_FAN_STEP_UP_TIME NCT6775_REG_FAN_STEP_DOWN_TIME +#define NCT6776_REG_FAN_STEP_DOWN_TIME NCT6775_REG_FAN_STEP_UP_TIME +static const s8 NCT6776_ALARM_BITS [] = {0 ,1 ,2 ,3 ,8 ,21 ,20 ,16 ,/* in0.. in7 */ 17 ,-1 ,-1 ,-1 ,-1 ,-1 ,-1 ,/* in8..in14 */
@@ -3492,8 +3496,8 @@ static int nct6775_probe(struct platform_device *pdev) data->REG_FAN_PULSES =NCT6776_REG_FAN_PULSES ; data->FAN_PULSE_SHIFT =NCT6775_FAN_PULSE_SHIFT ; data->REG_FAN_TIME[0 ] =NCT6775_REG_FAN_STOP_TIME ; - data->REG_FAN_TIME[1 ] =NCT6775_REG_FAN_STEP_UP_TIME ; - data->REG_FAN_TIME[2 ] =NCT6775_REG_FAN_STEP_DOWN_TIME ; + data->REG_FAN_TIME[1 ] =NCT6776_REG_FAN_STEP_UP_TIME ; + data->REG_FAN_TIME[2 ] =NCT6776_REG_FAN_STEP_DOWN_TIME ; data->REG_TOLERANCE_H =NCT6776_REG_TOLERANCE_H ; data->REG_PWM[0 ] =NCT6775_REG_PWM ; data->REG_PWM[1 ] =NCT6775_REG_FAN_START_OUTPUT ;
@@ -3562,8 +3566,8 @@ static int nct6775_probe(struct platform_device *pdev) data->REG_FAN_PULSES =NCT6779_REG_FAN_PULSES ; data->FAN_PULSE_SHIFT =NCT6775_FAN_PULSE_SHIFT ; data->REG_FAN_TIME[0 ] =NCT6775_REG_FAN_STOP_TIME ; - data->REG_FAN_TIME[1 ] =NCT6775_REG_FAN_STEP_UP_TIME ; - data->REG_FAN_TIME[2 ] =NCT6775_REG_FAN_STEP_DOWN_TIME ; + data->REG_FAN_TIME[1 ] =NCT6776_REG_FAN_STEP_UP_TIME ; + data->REG_FAN_TIME[2 ] =NCT6776_REG_FAN_STEP_DOWN_TIME ; data->REG_TOLERANCE_H =NCT6776_REG_TOLERANCE_H ; data->REG_PWM[0 ] =NCT6775_REG_PWM ; data->REG_PWM[1 ] =NCT6775_REG_FAN_START_OUTPUT ;
@@ -3636,8 +3640,8 @@ static int nct6775_probe(struct platform_device *pdev) data->REG_FAN_PULSES =NCT6779_REG_FAN_PULSES ; data->FAN_PULSE_SHIFT =NCT6775_FAN_PULSE_SHIFT ; data->REG_FAN_TIME[0 ] =NCT6775_REG_FAN_STOP_TIME ; - data->REG_FAN_TIME[1 ] =NCT6775_REG_FAN_STEP_UP_TIME ; - data->REG_FAN_TIME[2 ] =NCT6775_REG_FAN_STEP_DOWN_TIME ; + data->REG_FAN_TIME[1 ] =NCT6776_REG_FAN_STEP_UP_TIME ; + data->REG_FAN_TIME[2 ] =NCT6776_REG_FAN_STEP_DOWN_TIME ; data->REG_TOLERANCE_H =NCT6776_REG_TOLERANCE_H ; data->REG_PWM[0 ] =NCT6775_REG_PWM ; data->REG_PWM[1 ] =NCT6775_REG_FAN_START_OUTPUT ;
Signature · 1 line
2.6.2
PATCH 24/123 ARM: fix Thumb2 signal handling when ARMv6 is enabled
In reply to Jiri SlabyFrom: Russell King <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 9b55613f42e8d40d5c9ccb8970bde6af4764b2ab upstream.
When a kernel is built covering ARMv6 to ARMv7, we omit to clear the IT state when entering a signal handler. This can cause the first few instructions to be conditionally executed depending on the parent context.
In any case, the original test for >= ARMv7 is broken - ARMv6 can have Thumb-2 support as well, and an ARMv6T2 specific build would omit this code too.
Relax the test back to ARMv6 or greater. This results in us always clearing the IT state bits in the PSR, even on CPUs where these bits are reserved. However, they're reserved for the IT state, so this should cause no harm.
--- arch/arm/kernel/signal.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
arch/arm/kernel/signal.c +10 -5
@@ -375,12 +375,17 @@ setup_return(struct pt_regs *regs, struct ksignal *ksig,*/ thumb = handler &1 ; -#if __LINUX_ARM_ARCH__ >=7 +#if __LINUX_ARM_ARCH__ >=6 /* -* Clear the If-Then Thumb-2 execution state -* ARM spec requires this to be all 000s in ARM mode -* Snapdragon S4/Krait misbehaves on a Thumb=>ARM -* signal transition without this. +* Clear the If-Then Thumb-2 execution state. ARM spec +* requires this to be all 000s in ARM mode. Snapdragon +* S4/Krait misbehaves on a Thumb=>ARM signal transition +* without this. +* +* We must do this whenever we are running on a Thumb-2 +* capable CPU, which includes ARMv6T2. However, we elect +* to do this whenever we're on an ARMv6 or later CPU for +* simplicity. */ cpsr &= ~PSR_IT_MASK ;#endif
Signature · 1 line
2.6.2
PATCH 25/123 ARM: 8429/1: disable GCC SRA optimization
In reply to Jiri SlabyFrom: Ard Biesheuvel <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit a077224fd35b2f7fbc93f14cf67074fc792fbac2 upstream.
While working on the 32-bit ARM port of UEFI, I noticed a strange corruption in the kernel log. The following snprintf() statement (in drivers/firmware/efi/efi.c:efi_md_typeattr_format())
snprintf(pos, size, "|%3s|%2s|%2s|%2s|%3s|%2s|%2s|%2s|%2s]",
was producing the following output in the log:
| | | | | |WB|WT|WC|UC] | | | | | |WB|WT|WC|UC] | | | | | |WB|WT|WC|UC] |RUN| | | | |WB|WT|WC|UC]* |RUN| | | | |WB|WT|WC|UC]* | | | | | |WB|WT|WC|UC] |RUN| | | | |WB|WT|WC|UC]* | | | | | |WB|WT|WC|UC] |RUN| | | | | | | |UC] |RUN| | | | | | | |UC]
As it turns out, this is caused by incorrect code being emitted for the string() function in lib/vsprintf.c. The following code
if (!(spec.flags & LEFT)) {
while (len < spec.field_width--) {
if (buf < end)
*buf = ' ';
++buf;
}
}
for (i = 0; i < len; ++i) {
if (buf < end)
*buf = *s;
++buf; ++s;
}
while (len < spec.field_width--) {
if (buf < end)
*buf = ' ';
++buf;
}when called with len == 0, triggers an issue in the GCC SRA optimization pass (Scalar Replacement of Aggregates), which handles promotion of signed struct members incorrectly. This is a known but as yet unresolved issue.
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65932). In this particular case, it is causing the second while loop to be executed erroneously a single time, causing the additional space characters to be printed.
So disable the optimization by passing -fno-ipa-sra.
--- arch/arm/Makefile | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/arm/Makefile +8 -0
@@ -55,6 +55,14 @@ endif comma = , +# +# The Scalar Replacement of Aggregates (SRA) optimization pass in GCC 4.9 and +# later may result in code being generated that handles signed short and signed +# char struct members incorrectly. So disable it. +# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65932) +# +KBUILD_CFLAGS += $(call cc-option,-fno-ipa-sra) + # This selects which instruction set is used. # Note that GCC does not numerically define an architecture version # macro, but instead defines a whole series of macros which makes
Signature · 1 line
2.6.2
PATCH 26/123 windfarm: decrement client count when unregistering
In reply to Jiri SlabyFrom: Paul Bolle <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit fe2b592173ff0274e70dc44d1d28c19bb995aa7c upstream.
wf_unregister_client() increments the client count when a client unregisters. That is obviously incorrect. Decrement that client count instead.
--- drivers/macintosh/windfarm_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/macintosh/windfarm_core.c +1 -1
@@ -435,7 +435,7 @@ int wf_unregister_client(struct notifier_block *nb) {mutex_lock (&wf_lock);blocking_notifier_chain_unregister (&wf_client_list, nb); - wf_client_count++; + wf_client_count--;if (wf_client_count ==0 )wf_stop_thread ();mutex_unlock (&wf_lock);
Signature · 1 line
2.6.2
PATCH 27/123 ARM: dts: omap5-uevm.dts: fix i2c5 pinctrl offsets
In reply to Jiri SlabyFrom: Grazvydas Ignotas <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 1dbdad75074d16c3e3005180f81a01cdc04a7872 upstream.
The i2c5 pinctrl offsets are wrong. If the bootloader doesn't set the pins up, communication with tca6424a doesn't work (controller timeouts) and it is not possible to enable HDMI.
--- arch/arm/boot/dts/omap5-uevm.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/omap5-uevm.dts +2 -2
@@ -143,8 +143,8 @@ i2c5_pins: pinmux_i2c5_pins { pinctrl-single,pins = < - 0x184 (PIN_INPUT | MUX_MODE0) /* i2c5_scl */ - 0x186 (PIN_INPUT | MUX_MODE0) /* i2c5_sda */ + 0x186 (PIN_INPUT | MUX_MODE0) /* i2c5_scl */ + 0x188 (PIN_INPUT | MUX_MODE0) /* i2c5_sda */ >; };
Signature · 1 line
2.6.2
PATCH 28/123 dmaengine: dw: properly read DWC_PARAMS register
In reply to Jiri SlabyFrom: Andy Shevchenko <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 6bea0f6d1c47b07be88dfd93f013ae05fcb3d8bf upstream.
In case we have less than maximum allowed channels (8) and autoconfiguration is enabled the DWC_PARAMS read is wrong because it uses different arithmetic to what is needed for channel priority setup.
Re-do the caclulations properly. This now works on AVR32 board well.
--- drivers/dma/dw/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/dma/dw/core.c +2 -2
@@ -1585,7 +1585,6 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata)INIT_LIST_HEAD (&dw->dma.channels);for (i =0 ; i < nr_channels; i++) {struct dw_dma_chan *dwc = &dw->chan[i]; -int r = nr_channels - i -1 ; dwc->chan.device = &dw->dma;dma_cookie_init (&dwc->chan);
@@ -1597,7 +1596,7 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata)/* 7 is highest priority & 0 is lowest. */ if (pdata->chan_priority ==CHAN_PRIORITY_ASCENDING ) - dwc->priority = r; + dwc->priority = nr_channels - i -1 ;else dwc->priority = i;
@@ -1617,6 +1616,7 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata)/* Hardware configuration */ if (autocfg) {unsigned int dwc_params; +unsigned int r =DW_DMA_MAX_NR_CHANNELS - i -1 ;void __iomem *addr = chip->regs + r *sizeof (u32); dwc_params =dma_read_byaddr (addr,DWC_PARAMS );
Signature · 1 line
2.6.2
PATCH 29/123 x86/apic: Serialize LVTT and TSC_DEADLINE writes
In reply to Jiri SlabyFrom: Shaohua Li <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 5d7c631d926b59aa16f3c56eaeb83f1036c81dc7 upstream.
The APIC LVTT register is MMIO mapped but the TSC_DEADLINE register is an MSR. The write to the TSC_DEADLINE MSR is not serializing, so it's not guaranteed that the write to LVTT has reached the APIC before the TSC_DEADLINE MSR is written. In such a case the write to the MSR is ignored and as a consequence the local timer interrupt never fires.
The SDM decribes this issue for xAPIC and x2APIC modes. The serialization methods recommended by the SDM differ.
xAPIC:
"1. Memory-mapped write to LVT Timer Register, setting bits 18:17 to 10b.
2. WRMSR to the IA32_TSC_DEADLINE MSR a value much larger than current time-stamp counter.
3. If RDMSR of the IA32_TSC_DEADLINE MSR returns zero, go to step 2.
4. WRMSR to the IA32_TSC_DEADLINE MSR the desired deadline."
x2APIC:
"To allow for efficient access to the APIC registers in x2APIC mode,
the serializing semantics of WRMSR are relaxed when writing to the APIC registers. Thus, system software should not use 'WRMSR to APIC registers in x2APIC mode' as a serializing instruction. Read and write accesses to the APIC registers will occur in program order. A WRMSR to an APIC register may complete before all preceding stores are globally visible; software can prevent this by inserting a serializing instruction, an SFENCE, or an MFENCE before the WRMSR."
The xAPIC method is to just wait for the memory mapped write to hit the LVTT by checking whether the MSR write has reached the hardware. There is no reason why a proper MFENCE after the memory mapped write would not do the same. Andi Kleen confirmed that MFENCE is sufficient for the xAPIC case as well.
Issue MFENCE before writing to the TSC_DEADLINE MSR. This can be done unconditionally as all CPUs which have TSC_DEADLINE also have MFENCE support.
[ tglx: Massaged the changelog ]
--- arch/x86/kernel/apic/apic.c | 7 +++++++ 1 file changed, 7 insertions(+)
arch/x86/kernel/apic/apic.c +7 -0
@@ -351,6 +351,13 @@ static void __setup_APIC_LVTT(unsigned int clocks, int oneshot, int irqen)apic_write (APIC_LVTT , lvtt_value);if (lvtt_value &APIC_LVT_TIMER_TSCDEADLINE ) { +/* +* See Intel SDM: TSC-Deadline Mode chapter. In xAPIC mode, +* writing to the APIC LVTT and TSC_DEADLINE MSR isn't serialized. +* According to Intel, MFENCE can do the serialization here. +*/ + asmvolatile ("mfence" : : :"memory" ); +printk_once (KERN_DEBUG "TSC deadline timer enabled\n" );return ; }
Signature · 1 line
2.6.2
PATCH 30/123 x86/platform: Fix Geode LX timekeeping in the generic x86 build
In reply to Jiri SlabyFrom: David Woodhouse <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 03da3ff1cfcd7774c8780d2547ba0d995f7dc03d upstream.
In 2007, commit 07190a08eef36 ("Mark TSC on GeodeLX reliable") bypassed verification of the TSC on Geode LX. However, this code (now in the check_system_tsc_reliable() function in arch/x86/kernel/tsc.c) was only present if CONFIG_MGEODE_LX was set.
OpenWRT has recently started building its generic Geode target for Geode GX, not LX, to include support for additional platforms. This broke the timekeeping on LX-based devices, because the TSC wasn't marked as reliable:
https://dev.openwrt.org/ticket/20531
By adding a runtime check on is_geode_lx(), we can also include the fix if CONFIG_MGEODEGX1 or CONFIG_X86_GENERIC are set, thus fixing the problem.
--- arch/x86/kernel/tsc.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
arch/x86/kernel/tsc.c +10 -7
@@ -20,6 +20,7 @@#include <asm/hypervisor.h> #include <asm/nmi.h> #include <asm/x86_init.h> +#include <asm/geode.h> unsigned int __read_mostly cpu_khz;/* TSC clocks / usec, not used here */ EXPORT_SYMBOL (cpu_khz);
@@ -812,15 +813,17 @@ EXPORT_SYMBOL_GPL(mark_tsc_unstable);static void __init check_system_tsc_reliable (void ) { -#ifdef CONFIG_MGEODE_LX -/* RTSC counts during suspend */ +#if defined(CONFIG_MGEODEGX1 ) || defined(CONFIG_MGEODE_LX ) || defined(CONFIG_X86_GENERIC ) +if (is_geode_lx ()) { +/* RTSC counts during suspend */ #define RTSC_SUSP 0x100 -unsigned long res_low, res_high; +unsigned long res_low, res_high; -rdmsr_safe (MSR_GEODE_BUSCONT_CONF0 , &res_low, &res_high); -/* Geode_LX - the OLPC CPU has a very reliable TSC */ -if (res_low &RTSC_SUSP ) - tsc_clocksource_reliable =1 ; +rdmsr_safe (MSR_GEODE_BUSCONT_CONF0 , &res_low, &res_high); +/* Geode_LX - the OLPC CPU has a very reliable TSC */ +if (res_low &RTSC_SUSP ) + tsc_clocksource_reliable =1 ; + }#endif if (boot_cpu_has (X86_FEATURE_TSC_RELIABLE )) tsc_clocksource_reliable =1 ;
Signature · 1 line
2.6.2
PATCH 31/123 x86/mm: Set NX on gap between __ex_table and rodata
In reply to Jiri SlabyFrom: Stephen Smalley <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit ab76f7b4ab2397ffdd2f1eb07c55697d19991d10 upstream.
Unused space between the end of __ex_table and the start of rodata can be left W+x in the kernel page tables. Extend the setting of the NX bit to cover this gap by starting from text_end rather than rodata_start.
Before:
---[ High Kernel Mapping ]---
0xffffffff80000000-0xffffffff81000000 16M pmd 0xffffffff81000000-0xffffffff81600000 6M ro PSE GLB x pmd 0xffffffff81600000-0xffffffff81754000 1360K ro GLB x pte 0xffffffff81754000-0xffffffff81800000 688K RW GLB x pte 0xffffffff81800000-0xffffffff81a00000 2M ro PSE GLB NX pmd 0xffffffff81a00000-0xffffffff81b3b000 1260K ro GLB NX pte 0xffffffff81b3b000-0xffffffff82000000 4884K RW GLB NX pte 0xffffffff82000000-0xffffffff82200000 2M RW PSE GLB NX pmd
0xffffffff82200000-0xffffffffa0000000 478M pmd
After:
---[ High Kernel Mapping ]---
0xffffffff80000000-0xffffffff81000000 16M pmd 0xffffffff81000000-0xffffffff81600000 6M ro PSE GLB x pmd 0xffffffff81600000-0xffffffff81754000 1360K ro GLB x pte 0xffffffff81754000-0xffffffff81800000 688K RW GLB NX pte 0xffffffff81800000-0xffffffff81a00000 2M ro PSE GLB NX pmd 0xffffffff81a00000-0xffffffff81b3b000 1260K ro GLB NX pte 0xffffffff81b3b000-0xffffffff82000000 4884K RW GLB NX pte 0xffffffff82000000-0xffffffff82200000 2M RW PSE GLB NX pmd
0xffffffff82200000-0xffffffffa0000000 478M pmd
--- arch/x86/mm/init_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/mm/init_64.c +1 -1
@@ -1131,7 +1131,7 @@ void mark_rodata_ro(void)* has been zapped already via cleanup_highmem(). */ all_end =roundup ((unsigned long )_brk_end,PMD_SIZE ); -set_memory_nx (rodata_start, (all_end - rodata_start) >>PAGE_SHIFT ); +set_memory_nx (text_end, (all_end - text_end) >>PAGE_SHIFT );rodata_test ();
Signature · 1 line
2.6.2
PATCH 32/123 x86/xen: Support kexec/kdump in HVM guests by doing a soft reset
In reply to Jiri SlabyFrom: Vitaly Kuznetsov <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 0b34a166f291d255755be46e43ed5497cdd194f2 upstream.
Currently there is a number of issues preventing PVHVM Xen guests from doing successful kexec/kdump:
- Bound event channels.
- Registered vcpu_info.
- PIRQ/emuirq mappings.
- shared_info frame after XENMAPSPACE_shared_info operation.
- Active grant mappings.
Basically, newly booted kernel stumbles upon already set up Xen interfaces and there is no way to reestablish them. In Xen-4.7 a new feature called 'soft reset' is coming. A guest performing kexec/kdump operation is supposed to call SCHEDOP_shutdown hypercall with SHUTDOWN_soft_reset reason before jumping to new kernel. Hypervisor (with some help from toolstack) will do full domain cleanup (but keeping its memory and vCPU contexts intact) returning the guest to the state it had when it was first booted and thus allowing it to start over.
Doing SHUTDOWN_soft_reset on Xen hypervisors which don't support it is probably OK as by default all unknown shutdown reasons cause domain destroy with a message in toolstack log: 'Unknown shutdown reason code
5. Destroying domain.' which gives a clue to what the problem is and eliminates false expectations.
--- arch/x86/xen/enlighten.c | 23 +++++++++++++++++++++++ include/xen/interface/sched.h | 8 ++++++++ 2 files changed, 31 insertions(+)
arch/x86/xen/enlighten.c +23 -0
@@ -33,6 +33,10 @@#include <linux/memblock.h> #include <linux/edd.h> +#ifdef CONFIG_KEXEC_CORE +#include <linux/kexec.h> +#endif +#include <xen/xen.h> #include <xen/events.h> #include <xen/interface/xen.h>
@@ -1746,6 +1750,21 @@ static struct notifier_block xen_hvm_cpu_notifier = { .notifier_call = xen_hvm_cpu_notify, }; +#ifdef CONFIG_KEXEC_CORE +static void xen_hvm_shutdown (void ) +{ +native_machine_shutdown (); +if (kexec_in_progress) +xen_reboot (SHUTDOWN_soft_reset); +} + +static void xen_hvm_crash_shutdown (struct pt_regs *regs) +{ +native_machine_crash_shutdown (regs); +xen_reboot (SHUTDOWN_soft_reset); +} +#endif +static void __init xen_hvm_guest_init (void ) {init_hvm_pv_info ();
@@ -1762,6 +1781,10 @@ static void __init xen_hvm_guest_init(void) x86_init.irqs.intr_init = xen_init_IRQ;xen_hvm_init_time_ops ();xen_hvm_init_mmu_ops (); +#ifdef CONFIG_KEXEC_CORE + machine_ops.shutdown = xen_hvm_shutdown; + machine_ops.crash_shutdown = xen_hvm_crash_shutdown; +#endif }static uint32_t __init xen_hvm_platform (void )
include/xen/interface/sched.h +8 -0
@@ -107,5 +107,13 @@ struct sched_watchdog {#define SHUTDOWN_suspend 2/* Clean up, save suspend info, kill. */ #define SHUTDOWN_crash 3/* Tell controller we've crashed. */ #define SHUTDOWN_watchdog 4/* Restart because watchdog time expired. */ +/* +* Domain asked to perform 'soft reset' for it. The expected behavior is to +* reset internal Xen state for the domain returning it to the point where it +* was created but leaving the domain's memory contents and vCPU contexts +* intact. This will allow the domain to start over and set up all Xen specific +* interfaces again. +*/ +#define SHUTDOWN_soft_reset 5#endif /* __XEN_PUBLIC_SCHED_H__ */
Signature · 1 line
2.6.2
Re: [PATCH 3.12 032/123] x86/xen: Support kexec/kdump in HVM guests by doing a soft reset
On Wed, Oct 28, 2015 at 02:50:49PM +0100, Jiri Slaby wrote:
...
Quoted 4 lines
#include <
linux/memblock.h>
#include <linux/edd.h>+#ifdef
CONFIG_KEXEC_CORE
As already suggested by David Vrabel, this should be CONFIG_KEXEC for kernels <= 4.2, and not CONFIG_KEXEC_CORE.
Cheers,
--
Lu�s
Quoted 64 lines
arch/x86/xen/enlighten.c +22
-0+#include <linux/kexec.h> +#endif +#include <xen/xen.h> #include <xen/events.h> #include <xen/interface/xen.h> @@ -1746,6 +1750,21 @@ static struct notifier_block xen_hvm_cpu_notifier = { .notifier_call = xen_hvm_cpu_notify, }; +#ifdef CONFIG_KEXEC_CORE +static void xen_hvm_shutdown (void ) +{ +native_machine_shutdown (); +if (kexec_in_progress) +xen_reboot (SHUTDOWN_soft_reset); +} + +static void xen_hvm_crash_shutdown (struct pt_regs *regs) +{ +native_machine_crash_shutdown (regs); +xen_reboot (SHUTDOWN_soft_reset); +} +#endif +static void __init xen_hvm_guest_init (void ) {init_hvm_pv_info ();@@ -1762,6 +1781,10 @@ static void __init xen_hvm_guest_init(void) x86_init.irqs.intr_init = xen_init_IRQ;xen_hvm_init_time_ops ();xen_hvm_init_mmu_ops (); +#ifdef CONFIG_KEXEC_CORE + machine_ops.shutdown = xen_hvm_shutdown; + machine_ops.crash_shutdown = xen_hvm_crash_shutdown; +#endif }static uint32_t __init xen_hvm_platform (void )include/xen/interface/sched.h +8
-0@@ -107,5 +107,13 @@ struct sched_watchdog {#define SHUTDOWN_suspend 2/* Clean up, save suspend info, kill. */ #define SHUTDOWN_crash 3/* Tell controller we've crashed. */ #define SHUTDOWN_watchdog 4/* Restart because watchdog time expired. */ +/* +* Domain asked to perform 'soft reset' for it. The expected behavior is to +* reset internal Xen state for the domain returning it to the point where it +* was created but leaving the domain's memory contents and vCPU contexts +* intact. This will allow the domain to start over and set up all Xen specific +* interfaces again. +*/ +#define SHUTDOWN_soft_reset 5#endif /* __XEN_PUBLIC_SCHED_H__ */ Signature · 6 lines
2.6.2 -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3.12 032/123] x86/xen: Support kexec/kdump in HVM guests by doing a soft reset
Quoted 9 lines · Luis Henriques
On Wed, Oct 28, 2015 at 02:50:49PM +0100, Jiri Slaby wrote:
...Quoted 4 lines
#include <
linux/memblock.h>
#include <linux/edd.h>+#ifdef
CONFIG_KEXEC_COREAs already suggested by David Vrabel, this should be
CONFIG_KEXECfor kernels <= 4.2, and notCONFIG_KEXEC_CORE.
Fixed. Thanks!
Signature · 2 lines
js suse labs
PATCH 33/123 arch: Clean up asm/barrier.h implementations using asm-generic/barrier.h
In reply to Jiri SlabyFrom: Peter Zijlstra <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 93ea02bb84354370e51de803a9405f171f3edf88 upstream.
We're going to be adding a few new barrier primitives, and in order to avoid endless duplication make more agressive use of asm-generic/barrier.h.
Change the asm-generic/barrier.h such that it allows partial barrier definitions and fills out the rest with defaults.
There are a few architectures (m32r, m68k) that could probably do away with their barrier.h file entirely but are kept for now due to their unconventional nop() implementation.
--- arch/alpha/include/asm/barrier.h | 25 +++-------- arch/arc/include/asm/Kbuild | 1 + arch/avr32/include/asm/barrier.h | 17 +++----- arch/blackfin/include/asm/barrier.h | 18 +------- arch/cris/include/asm/Kbuild | 1 + arch/cris/include/asm/barrier.h | 25 ----------- arch/frv/include/asm/barrier.h | 8 +--- arch/hexagon/include/asm/Kbuild | 1 + arch/m32r/include/asm/barrier.h | 80 +---------------------------------- arch/m68k/include/asm/barrier.h | 14 +----- arch/microblaze/include/asm/Kbuild | 1 + arch/microblaze/include/asm/barrier.h | 27 ------------ arch/mn10300/include/asm/Kbuild | 1 + arch/mn10300/include/asm/barrier.h | 37 ---------------- arch/parisc/include/asm/Kbuild | 1 + arch/parisc/include/asm/barrier.h | 35 --------------- arch/score/include/asm/Kbuild | 1 + arch/score/include/asm/barrier.h | 16 ------- arch/sh/include/asm/barrier.h | 21 ++------- arch/sparc/include/asm/barrier_32.h | 12 +----- arch/tile/include/asm/barrier.h | 68 +---------------------------- arch/unicore32/include/asm/barrier.h | 11 +---- arch/xtensa/include/asm/barrier.h | 9 +--- include/asm-generic/barrier.h | 42 ++++++++++++------ 24 files changed, 58 insertions(+), 414 deletions(-) delete mode 100644 arch/cris/include/asm/barrier.h delete mode 100644 arch/microblaze/include/asm/barrier.h delete mode 100644 arch/mn10300/include/asm/barrier.h delete mode 100644 arch/parisc/include/asm/barrier.h delete mode 100644 arch/score/include/asm/barrier.h
arch/alpha/include/asm/barrier.h +5 -20
@@ -3,33 +3,18 @@#include <asm/compiler.h> -#define mb () \ -__asm__ __volatile__("mb": : :"memory") +#define mb () __asm__ __volatile__("mb": : :"memory") +#define rmb () __asm__ __volatile__("mb": : :"memory") +#define wmb () __asm__ __volatile__("wmb": : :"memory") -#define rmb () \ -__asm__ __volatile__("mb": : :"memory") - -#define wmb () \ -__asm__ __volatile__("wmb": : :"memory") - -#define read_barrier_depends () \ -__asm__ __volatile__("mb": : :"memory") +#define read_barrier_depends () __asm__ __volatile__("mb": : :"memory")#ifdef CONFIG_SMP #define __ASM_SMP_MB "\tmb\n" -#define smp_mb () mb() -#define smp_rmb () rmb() -#define smp_wmb () wmb() -#define smp_read_barrier_depends () read_barrier_depends()#else #define __ASM_SMP_MB -#define smp_mb () barrier() -#define smp_rmb () barrier() -#define smp_wmb () barrier() -#define smp_read_barrier_depends () do { } while (0)#endif -#define set_mb (var, value) \ -do { var = value; mb(); } while (0) +#include <asm-generic/barrier.h> #endif /* __BARRIER_H */
arch/arc/include/asm/Kbuild +1 -0
@@ -46,3 +46,4 @@ generic-y += ucontext.h generic-y += user.h generic-y += vga.h generic-y += xor.h +generic-y += barrier.h
arch/avr32/include/asm/barrier.h +5 -12
@@ -8,22 +8,15 @@#ifndef __ASM_AVR32_BARRIER_H#define __ASM_AVR32_BARRIER_H -#define nop () asm volatile("nop") - -#define mb () asm volatile("" : : : "memory") -#define rmb () mb() -#define wmb () asm volatile("sync 0" : : : "memory") -#define read_barrier_depends () do { } while(0) -#define set_mb (var, value) do { var = value; mb(); } while(0) +/* +* Weirdest thing ever.. no full barrier, but it has a write barrier! +*/ +#define wmb () asm volatile("sync 0" : : : "memory")#ifdef CONFIG_SMP # error "The AVR32 port does not support SMP" -#else -# define smp_mb () barrier() -# define smp_rmb () barrier() -# define smp_wmb () barrier() -# define smp_read_barrier_depends () do { } while(0)#endif +#include <asm-generic/barrier.h> #endif /* __ASM_AVR32_BARRIER_H */
arch/blackfin/include/asm/barrier.h +1 -17
@@ -23,26 +23,10 @@# define rmb () do { barrier(); smp_check_barrier(); } while (0)# define wmb () do { barrier(); smp_mark_barrier(); } while (0)# define read_barrier_depends () do { barrier(); smp_check_barrier(); } while (0) -#else -# define mb () barrier() -# define rmb () barrier() -# define wmb () barrier() -# define read_barrier_depends () do { } while (0)#endif -#else /* !CONFIG_SMP */ - -#define mb () barrier() -#define rmb () barrier() -#define wmb () barrier() -#define read_barrier_depends () do { } while (0) -#endif /* !CONFIG_SMP */ -#define smp_mb () mb() -#define smp_rmb () rmb() -#define smp_wmb () wmb() -#define set_mb (var, value) do { var = value; mb(); } while (0) -#define smp_read_barrier_depends () read_barrier_depends() +#include <asm-generic/barrier.h> #endif /* _BLACKFIN_BARRIER_H */
arch/cris/include/asm/Kbuild +1 -0
@@ -11,3 +11,4 @@ generic-y += module.h generic-y += trace_clock.h generic-y += vga.h generic-y += xor.h +generic-y += barrier.h
arch/cris/include/asm/barrier.h deleted +0 -25
@@ -1,25 +0,0 @@ -#ifndef __ASM_CRIS_BARRIER_H -#define __ASM_CRIS_BARRIER_H - -#define nop () __asm__ __volatile__ ("nop"); - -#define barrier () __asm__ __volatile__("": : :"memory") -#define mb () barrier() -#define rmb () mb() -#define wmb () mb() -#define read_barrier_depends () do { } while(0) -#define set_mb (var, value) do { var = value; mb(); } while (0) - -#ifdef CONFIG_SMP -#define smp_mb () mb() -#define smp_rmb () rmb() -#define smp_wmb () wmb() -#define smp_read_barrier_depends () read_barrier_depends() -#else -#define smp_mb () barrier() -#define smp_rmb () barrier() -#define smp_wmb () barrier() -#define smp_read_barrier_depends () do { } while(0) -#endif - -#endif /* __ASM_CRIS_BARRIER_H */
arch/frv/include/asm/barrier.h +1 -7
@@ -17,13 +17,7 @@#define mb () asm volatile ("membar" : : :"memory")#define rmb () asm volatile ("membar" : : :"memory")#define wmb () asm volatile ("membar" : : :"memory") -#define read_barrier_depends () do { } while (0) -#define smp_mb () barrier() -#define smp_rmb () barrier() -#define smp_wmb () barrier() -#define smp_read_barrier_depends () do {} while(0) -#define set_mb (var, value) \ - do { var = (value); barrier(); } while (0) +#include <asm-generic/barrier.h> #endif /* _ASM_BARRIER_H */
arch/hexagon/include/asm/Kbuild +1 -0
@@ -53,3 +53,4 @@ generic-y += types.h generic-y += ucontext.h generic-y += unaligned.h generic-y += xor.h +generic-y += barrier.h
arch/m32r/include/asm/barrier.h +1 -79
85 lines not on this page · raw message
arch/m68k/include/asm/barrier.h +1 -13
@@ -1,20 +1,8 @@#ifndef _M68K_BARRIER_H#define _M68K_BARRIER_H -/* -* Force strict CPU ordering. -* Not really required on m68k... -*/ #define nop () do { asm volatile ("nop"); barrier(); } while (0) -#define mb () barrier() -#define rmb () barrier() -#define wmb () barrier() -#define read_barrier_depends () ((void)0) -#define set_mb (var, value) ({ (var) = (value); wmb(); }) -#define smp_mb () barrier() -#define smp_rmb () barrier() -#define smp_wmb () barrier() -#define smp_read_barrier_depends () ((void)0) +#include <asm-generic/barrier.h> #endif /* _M68K_BARRIER_H */
arch/microblaze/include/asm/Kbuild +1 -0
@@ -3,3 +3,4 @@ generic-y += clkdev.h generic-y += exec.h generic-y += trace_clock.h generic-y += syscalls.h +generic-y += barrier.h
arch/microblaze/include/asm/barrier.h deleted +0 -27
@@ -1,27 +0,0 @@ -/* -* Copyright (C) 2006 Atmark Techno, Inc. -* -* This file is subject to the terms and conditions of the GNU General Public -* License. See the file "COPYING" in the main directory of this archive -* for more details. -*/ - -#ifndef _ASM_MICROBLAZE_BARRIER_H -#define _ASM_MICROBLAZE_BARRIER_H - -#define nop () asm volatile ("nop") - -#define smp_read_barrier_depends () do {} while (0) -#define read_barrier_depends () do {} while (0) - -#define mb () barrier() -#define rmb () mb() -#define wmb () mb() -#define set_mb (var, value) do { var = value; mb(); } while (0) -#define set_wmb (var, value) do { var = value; wmb(); } while (0) - -#define smp_mb () mb() -#define smp_rmb () rmb() -#define smp_wmb () wmb() - -#endif /* _ASM_MICROBLAZE_BARRIER_H */
arch/mn10300/include/asm/Kbuild +1 -0
@@ -2,3 +2,4 @@ generic-y += clkdev.h generic-y += exec.h generic-y += trace_clock.h +generic-y += barrier.h
arch/mn10300/include/asm/barrier.h deleted +0 -37
@@ -1,37 +0,0 @@ -/* MN10300 memory barrier definitions -* -* Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. -* Written by David Howells ([email protected]) -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public Licence -* as published by the Free Software Foundation; either version -* 2 of the Licence, or (at your option) any later version. -*/ -#ifndef _ASM_BARRIER_H -#define _ASM_BARRIER_H - -#define nop () asm volatile ("nop") - -#define mb () asm volatile ("": : :"memory") -#define rmb () mb() -#define wmb () asm volatile ("": : :"memory") - -#ifdef CONFIG_SMP -#define smp_mb () mb() -#define smp_rmb () rmb() -#define smp_wmb () wmb() -#define set_mb (var, value) do { xchg(&var, value); } while (0) -#else /* CONFIG_SMP */ -#define smp_mb () barrier() -#define smp_rmb () barrier() -#define smp_wmb () barrier() -#define set_mb (var, value) do { var = value; mb(); } while (0) -#endif /* CONFIG_SMP */ - -#define set_wmb (var, value) do { var = value; wmb(); } while (0) - -#define read_barrier_depends () do {} while (0) -#define smp_read_barrier_depends () do {} while (0) - -#endif /* _ASM_BARRIER_H */
arch/parisc/include/asm/Kbuild +1 -0
@@ -4,3 +4,4 @@ generic-y += word-at-a-time.h auxvec.h user.h cputime.h emergency-restart.h \ div64.h irq_regs.h kdebug.h kvm_para.h local64.h local.h param.h \ poll.h xor.h clkdev.h exec.h generic-y += trace_clock.h +generic-y += barrier.h
arch/parisc/include/asm/barrier.h deleted +0 -35
@@ -1,35 +0,0 @@ -#ifndef __PARISC_BARRIER_H -#define __PARISC_BARRIER_H - -/* -** This is simply the barrier() macro from linux/kernel.h but when serial.c -** uses tqueue.h uses smp_mb() defined using barrier(), linux/kernel.h -** hasn't yet been included yet so it fails, thus repeating the macro here. -** -** PA-RISC architecture allows for weakly ordered memory accesses although -** none of the processors use it. There is a strong ordered bit that is -** set in the O-bit of the page directory entry. Operating systems that -** can not tolerate out of order accesses should set this bit when mapping -** pages. The O-bit of the PSW should also be set to 1 (I don't believe any -** of the processor implemented the PSW O-bit). The PCX-W ERS states that -** the TLB O-bit is not implemented so the page directory does not need to -** have the O-bit set when mapping pages (section 3.1). This section also -** states that the PSW Y, Z, G, and O bits are not implemented. -** So it looks like nothing needs to be done for parisc-linux (yet). -** (thanks to chada for the above comment -ggg) -** -** The __asm__ op below simple prevents gcc/ld from reordering -** instructions across the mb() "call". -*/ -#define mb () __asm__ __volatile__("":::"memory")/* barrier() */ -#define rmb () mb() -#define wmb () mb() -#define smp_mb () mb() -#define smp_rmb () mb() -#define smp_wmb () mb() -#define smp_read_barrier_depends () do { } while(0) -#define read_barrier_depends () do { } while(0) - -#define set_mb (var, value) do { var = value; mb(); } while (0) - -#endif /* __PARISC_BARRIER_H */
arch/score/include/asm/Kbuild +1 -0
@@ -4,3 +4,4 @@ header-y += generic-y += clkdev.h generic-y += trace_clock.h generic-y += xor.h +generic-y += barrier.h
arch/score/include/asm/barrier.h deleted +0 -16
@@ -1,16 +0,0 @@ -#ifndef _ASM_SCORE_BARRIER_H -#define _ASM_SCORE_BARRIER_H - -#define mb () barrier() -#define rmb () barrier() -#define wmb () barrier() -#define smp_mb () barrier() -#define smp_rmb () barrier() -#define smp_wmb () barrier() - -#define read_barrier_depends () do {} while (0) -#define smp_read_barrier_depends () do {} while (0) - -#define set_mb (var, value) do {var = value; wmb(); } while (0) - -#endif /* _ASM_SCORE_BARRIER_H */
arch/sh/include/asm/barrier.h +3 -18
@@ -26,29 +26,14 @@#if defined(CONFIG_CPU_SH4A ) || defined(CONFIG_CPU_SH5 )#define mb () __asm__ __volatile__ ("synco": : :"memory")#define rmb () mb() -#define wmb () __asm__ __volatile__ ("synco": : :"memory") +#define wmb () mb()#define ctrl_barrier () __icbi(PAGE_OFFSET) -#define read_barrier_depends () do { } while(0)#else -#define mb () __asm__ __volatile__ ("": : :"memory") -#define rmb () mb() -#define wmb () __asm__ __volatile__ ("": : :"memory")#define ctrl_barrier () __asm__ __volatile__ ("nop;nop;nop;nop;nop;nop;nop;nop") -#define read_barrier_depends () do { } while(0) -#endif - -#ifdef CONFIG_SMP -#define smp_mb () mb() -#define smp_rmb () rmb() -#define smp_wmb () wmb() -#define smp_read_barrier_depends () read_barrier_depends() -#else -#define smp_mb () barrier() -#define smp_rmb () barrier() -#define smp_wmb () barrier() -#define smp_read_barrier_depends () do { } while(0)#endif #define set_mb (var, value) do { (void)xchg(&var, value); } while (0) +#include <asm-generic/barrier.h> +#endif /* __ASM_SH_BARRIER_H */
arch/sparc/include/asm/barrier_32.h +2 -10
@@ -1,15 +1,7 @@#ifndef __SPARC_BARRIER_H#define __SPARC_BARRIER_H -/* XXX Change this if we ever use a PSO mode kernel. */ -#define mb () __asm__ __volatile__ ("" : : : "memory") -#define rmb () mb() -#define wmb () mb() -#define read_barrier_depends () do { } while(0) -#define set_mb (__var, __value) do { __var = __value; mb(); } while(0) -#define smp_mb () __asm__ __volatile__("":::"memory") -#define smp_rmb () __asm__ __volatile__("":::"memory") -#define smp_wmb () __asm__ __volatile__("":::"memory") -#define smp_read_barrier_depends () do { } while(0) +#include <asm/processor.h> /* for nop() */ +#include <asm-generic/barrier.h> #endif /* !(__SPARC_BARRIER_H) */
arch/tile/include/asm/barrier.h +1 -67
80 lines not on this page · raw message
arch/unicore32/include/asm/barrier.h +1 -10
@@ -14,15 +14,6 @@#define dsb () __asm__ __volatile__ ("" : : : "memory")#define dmb () __asm__ __volatile__ ("" : : : "memory") -#define mb () barrier() -#define rmb () barrier() -#define wmb () barrier() -#define smp_mb () barrier() -#define smp_rmb () barrier() -#define smp_wmb () barrier() -#define read_barrier_depends () do { } while (0) -#define smp_read_barrier_depends () do { } while (0) - -#define set_mb (var, value) do { var = value; smp_mb(); } while (0) +#include <asm-generic/barrier.h> #endif /* __UNICORE_BARRIER_H__ */
arch/xtensa/include/asm/barrier.h +1 -8
@@ -9,21 +9,14 @@#ifndef _XTENSA_SYSTEM_H#define _XTENSA_SYSTEM_H -#define smp_read_barrier_depends () do { } while(0) -#define read_barrier_depends () do { } while(0) -#define mb () ({ __asm__ __volatile__("memw" : : : "memory"); })#define rmb () barrier()#define wmb () mb()#ifdef CONFIG_SMP #error smp_* not defined -#else -#define smp_mb () barrier() -#define smp_rmb () barrier() -#define smp_wmb () barrier()#endif -#define set_mb (var, value) do { var = value; mb(); } while (0) +#include <asm-generic/barrier.h> #endif /* _XTENSA_SYSTEM_H */
include/asm-generic/barrier.h +29 -13
68 lines not on this page · raw message
Signature · 1 line
2.6.2
PATCH 34/123 arch: Move smp_mb__{before,after}_atomic_{inc,dec}.h into asm/atomic.h
In reply to Jiri SlabyFrom: Peter Zijlstra <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 1de7da377bd880ff23917f78924d0e908329d978 upstream.
Move the barriers functions that depend on the atomic implementation into the atomic implementation.
--- arch/arc/include/asm/atomic.h | 5 +++++ arch/arc/include/asm/barrier.h | 5 ----- arch/hexagon/include/asm/atomic.h | 6 +++++- arch/hexagon/include/asm/barrier.h | 4 ---- 4 files changed, 10 insertions(+), 10 deletions(-)
arch/arc/include/asm/atomic.h +5 -0
@@ -190,6 +190,11 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)#endif /* !CONFIG_ARC_HAS_LLSC */ +#define smp_mb__before_atomic_dec () barrier() +#define smp_mb__after_atomic_dec () barrier() +#define smp_mb__before_atomic_inc () barrier() +#define smp_mb__after_atomic_inc () barrier() +/** * __atomic_add_unless - add unless the number is a given value * @v: pointer of type atomic_t
arch/arc/include/asm/barrier.h +0 -5
@@ -30,11 +30,6 @@#define smp_wmb () barrier()#endif -#define smp_mb__before_atomic_dec () barrier() -#define smp_mb__after_atomic_dec () barrier() -#define smp_mb__before_atomic_inc () barrier() -#define smp_mb__after_atomic_inc () barrier() -#define smp_read_barrier_depends () do { } while (0)#endif
arch/hexagon/include/asm/atomic.h +5 -1
@@ -160,8 +160,12 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u)#define atomic_sub_and_test (i, v) (atomic_sub_return(i, (v)) == 0)#define atomic_add_negative (i, v) (atomic_add_return(i, (v)) < 0) -#define atomic_inc_return (v) (atomic_add_return(1, v))#define atomic_dec_return (v) (atomic_sub_return(1, v)) +#define smp_mb__before_atomic_dec () barrier() +#define smp_mb__after_atomic_dec () barrier() +#define smp_mb__before_atomic_inc () barrier() +#define smp_mb__after_atomic_inc () barrier() +#endif
arch/hexagon/include/asm/barrier.h +0 -4
@@ -29,10 +29,6 @@#define smp_read_barrier_depends () barrier()#define smp_wmb () barrier()#define smp_mb () barrier() -#define smp_mb__before_atomic_dec () barrier() -#define smp_mb__after_atomic_dec () barrier() -#define smp_mb__before_atomic_inc () barrier() -#define smp_mb__after_atomic_inc () barrier()/* Set a value and use a memory barrier. Used by the scheduler somewhere. */ #define set_mb (var, value) \
Signature · 1 line
2.6.2
PATCH 35/123 arc,hexagon: Delete asm/barrier.h
In reply to Jiri SlabyFrom: Peter Zijlstra <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 2ab08ee9f0a4eba27c7c4ce0b6d5118e8a18554b upstream.
Both already use asm-generic/barrier.h as per their include/asm/Kbuild. Remove the stale files.
--- arch/arc/include/asm/barrier.h | 37 ------------------------------------- arch/hexagon/include/asm/barrier.h | 37 ------------------------------------- 2 files changed, 74 deletions(-) delete mode 100644 arch/arc/include/asm/barrier.h delete mode 100644 arch/hexagon/include/asm/barrier.h
arch/arc/include/asm/barrier.h deleted +0 -37
@@ -1,37 +0,0 @@ -/* -* Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -*/ - -#ifndef __ASM_BARRIER_H -#define __ASM_BARRIER_H - -#ifndef __ASSEMBLY__ - -/* TODO-vineetg: Need to see what this does, don't we need sync anywhere */ -#define mb () __asm__ __volatile__ ("" : : : "memory") -#define rmb () mb() -#define wmb () mb() -#define set_mb (var, value) do { var = value; mb(); } while (0) -#define set_wmb (var, value) do { var = value; wmb(); } while (0) -#define read_barrier_depends () mb() - -/* TODO-vineetg verify the correctness of macros here */ -#ifdef CONFIG_SMP -#define smp_mb () mb() -#define smp_rmb () rmb() -#define smp_wmb () wmb() -#else -#define smp_mb () barrier() -#define smp_rmb () barrier() -#define smp_wmb () barrier() -#endif - -#define smp_read_barrier_depends () do { } while (0) - -#endif - -#endif
arch/hexagon/include/asm/barrier.h deleted +0 -37
@@ -1,37 +0,0 @@ -/* -* Memory barrier definitions for the Hexagon architecture -* -* Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 and -* only version 2 as published by the Free Software Foundation. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -* 02110-1301, USA. -*/ - -#ifndef _ASM_BARRIER_H -#define _ASM_BARRIER_H - -#define rmb () barrier() -#define read_barrier_depends () barrier() -#define wmb () barrier() -#define mb () barrier() -#define smp_rmb () barrier() -#define smp_read_barrier_depends () barrier() -#define smp_wmb () barrier() -#define smp_mb () barrier() - -/* Set a value and use a memory barrier. Used by the scheduler somewhere. */ -#define set_mb (var, value) \ - do { var = value; mb(); } while (0) - -#endif /* _ASM_BARRIER_H */
Signature · 1 line
2.6.2
PATCH 36/123 sched/core: Fix TASK_DEAD race in finish_task_switch()
In reply to Jiri SlabyFrom: Peter Zijlstra <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 95913d97914f44db2b81271c2e2ebd4d2ac2df83 upstream.
So the problem this patch is trying to address is as follows:
CPU0 CPU1
context_switch(A, B)
ttwu(A)
LOCK A->pi_lock
A->on_cpu == 0
finish_task_switch(A)
prev_state = A->state <-.
WMB |
A->on_cpu = 0; |
UNLOCK rq0->lock |
| context_switch(C, A)
`-- A->state = TASK_DEAD
prev_state == TASK_DEAD
put_task_struct(A)
context_switch(A, C)
finish_task_switch(A)
A->state == TASK_DEAD
put_task_struct(A)The argument being that the WMB will allow the load of A->state on CPU0 to cross over and observe CPU1's store of A->state, which will then result in a double-drop and use-after-free.
Now the comment states (and this was true once upon a long time ago) that we need to observe A->state while holding rq->lock because that will order us against the wakeup; however the wakeup will not in fact acquire (that) rq->lock; it takes A->pi_lock these days.
We can obviously fix this by upgrading the WMB to an MB, but that is expensive, so we'd rather avoid that.
The alternative this patch takes is: smp_store_release(&A->on_cpu, 0), which avoids the MB on some archs, but not important ones like ARM.
--- kernel/sched/core.c | 10 +++++----- kernel/sched/sched.h | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-)
kernel/sched/core.c +5 -5
@@ -1873,11 +1873,11 @@ static void finish_task_switch(struct rq *rq, struct task_struct *prev)* If a task dies, then it sets TASK_DEAD in tsk->state and calls * schedule one last time. The schedule call will never return, and * the scheduled task must drop that reference. -* The test for TASK_DEAD must occur while the runqueue locks are -* still held, otherwise prev could be scheduled on another cpu, die -* there before we look at prev->state, and then the reference would -* be dropped twice. -* Manfred Spraul <[email protected]> +* +* We must observe prev->state before clearing prev->on_cpu (in +* finish_lock_switch), otherwise a concurrent wakeup can get prev +* running on another CPU and we could rave with its RUNNING -> DEAD +* transition, resulting in a double drop. */ prev_state = prev->state;vtime_task_switch (prev);
kernel/sched/sched.h +3 -2
@@ -845,9 +845,10 @@ static inline void finish_lock_switch(struct rq *rq, struct task_struct *prev)* After ->on_cpu is cleared, the task can be moved to a different CPU. * We must ensure this doesn't happen until the switch is completely * finished. +* +* Pairs with the control dependency and rmb in try_to_wake_up(). */ -smp_wmb (); - prev->on_cpu =0 ; +smp_store_release (&prev->on_cpu,0 );#endif #ifdef CONFIG_DEBUG_SPINLOCK /* this is a valid case when another task releases the spinlock */
Signature · 1 line
2.6.2
PATCH 37/123 spi: Fix documentation of spi_alloc_master()
In reply to Jiri SlabyFrom: Guenter Roeck <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit a394d635193b641f2c86ead5ada5b115d57c51f8 upstream.
Actually, spi_master_put() after spi_alloc_master() must _not_ be followed by kfree(). The memory is already freed with the call to spi_master_put() through spi_master_class, which registers a release function. Calling both spi_master_put() and kfree() results in often nasty (and delayed) crashes elsewhere in the kernel, often in the networking stack.
This reverts commit eb4af0f5349235df2e4a5057a72fc8962d00308a.
Link to patch and concerns: https://lkml.org/lkml/2012/9/3/269
or
http://lkml.iu.edu/hypermail/linux/kernel/1209.0/00790.html
Alexey Klimov: This revert becomes valid after 94c69f765f1b4a658d96905ec59928e3e3e07e6a when spi-imx.c has been fixed and there is no need to call kfree() so comment for spi_alloc_master() should be fixed.
--- drivers/spi/spi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/spi/spi.c +1 -2
@@ -1087,8 +1087,7 @@ static struct class spi_master_class = {* * The caller is responsible for assigning the bus number and initializing * the master's methods before calling spi_register_master(); and (after errors -* adding the device) calling spi_master_put() and kfree() to prevent a memory -* leak. +* adding the device) calling spi_master_put() to prevent a memory leak. */ struct spi_master *spi_alloc_master (struct device *dev,unsigned size) {
Signature · 1 line
2.6.2
PATCH 38/123 spi: spi-pxa2xx: Check status register to determine if SSSR_TINT is disabled
In reply to Jiri SlabyFrom: "Tan Jui Nee" <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 02bc933ebb59208f42c2e6305b2c17fd306f695d upstream.
On Intel Baytrail, there is case when interrupt handler get called, no SPI message is captured. The RX FIFO is indeed empty when RX timeout pending interrupt (SSSR_TINT) happens.
Use the BIOS version where both HSUART and SPI are on the same IRQ. Both drivers are using IRQF_SHARED when calling the request_irq function. When running two separate and independent SPI and HSUART application that generate data traffic on both components, user will see messages like below on the console:
pxa2xx-spi pxa2xx-spi.0: bad message state in interrupt handler
This commit will fix this by first checking Receiver Time-out Interrupt, if it is disabled, ignore the request and return without servicing.
--- drivers/spi/spi-pxa2xx.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/spi/spi-pxa2xx.c +4 -0
@@ -562,6 +562,10 @@ static irqreturn_t ssp_int(int irq, void *dev_id)if (!(sccr1_reg &SSCR1_TIE )) mask &= ~SSSR_TFS ; +/* Ignore RX timeout interrupt if it is disabled */ +if (!(sccr1_reg &SSCR1_TINTE )) + mask &= ~SSSR_TINT ; +if (!(status & mask))return IRQ_NONE ;
Signature · 1 line
2.6.2
PATCH 39/123 mm: hugetlbfs: skip shared VMAs when unmapping private pages to satisfy a fault
From: Mel Gorman <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 2f84a8990ebbe235c59716896e017c6b2ca1200f upstream.
SunDong reported the following on
https://bugzilla.kernel.org/show_bug.cgi?id=103841
I think I find a linux bug, I have the test cases is constructed. I can stable recurring problems in fedora22(4.0.4) kernel version, arch for x86_64. I construct transparent huge page, when the parent and child process with MAP_SHARE, MAP_PRIVATE way to access the same huge page area, it has the opportunity to lead to huge page copy on write failure, and then it will munmap the child corresponding mmap area, but then the child mmap area with VM_MAYSHARE attributes, child process munmap this area can trigger VM_BUG_ON in set_vma_resv_flags functions (vma - > vm_flags & VM_MAYSHARE).
There were a number of problems with the report (e.g. it's hugetlbfs that triggers this, not transparent huge pages) but it was fundamentally correct in that a VM_BUG_ON in set_vma_resv_flags() can be triggered that looks like this
vma ffff8804651fd0d0 start 00007fc474e00000 end 00007fc475e00000 next ffff8804651fd018 prev ffff8804651fd188 mm ffff88046b1b1800 prot 8000000000000027 anon_vma (null) vm_ops ffffffff8182a7a0 pgoff 0 file ffff88106bdb9800 private_data (null) flags: 0x84400fb(read|write|shared|mayread|maywrite|mayexec|mayshare|dontexpand|hugetlb) ------------ kernel BUG at mm/hugetlb.c:462! SMP Modules linked in: xt_pkttype xt_LOG xt_limit [..] CPU: 38 PID: 26839 Comm: map Not tainted 4.0.4-default #1 Hardware name: Dell Inc. PowerEdge R810/0TT6JF, BIOS 2.7.4 04/26/2012 set_vma_resv_flags+0x2d/0x30
The VM_BUG_ON is correct because private and shared mappings have different reservation accounting but the warning clearly shows that the VMA is shared.
When a private COW fails to allocate a new page then only the process that created the VMA gets the page -- all the children unmap the page. If the children access that data in the future then they get killed.
The problem is that the same file is mapped shared and private. During the COW, the allocation fails, the VMAs are traversed to unmap the other private pages but a shared VMA is found and the bug is triggered. This patch identifies such VMAs and skips them.
--- mm/hugetlb.c | 8 ++++++++ 1 file changed, 8 insertions(+)
mm/hugetlb.c +8 -0
@@ -2605,6 +2605,14 @@ static int unmap_ref_private(struct mm_struct *mm, struct vm_area_struct *vma,continue ;/* +* Shared VMAs have their own reserves and do not affect +* MAP_PRIVATE accounting but it is possible that a shared +* VMA is using the same page so check and skip such VMAs. +*/ +if (iter_vma->vm_flags &VM_MAYSHARE ) +continue ; + +/* * Unmap the page from other VMAs without their own reserves. * They get marked to be SIGKILLed if they fault in these * areas. This is because a future no-page fault on this VMA
Signature · 1 line
2.6.2
PATCH 40/123 ALSA: synth: Fix conflicting OSS device registration on AWE32
In reply to Jiri SlabyFrom: Takashi Iwai <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 225db5762dc1a35b26850477ffa06e5cd0097243 upstream.
When OSS emulation is loaded on ISA SB AWE32 chip, we get now kernel warnings like:
WARNING: CPU: 0 PID: 2791 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x51/0x80() sysfs: cannot create duplicate filename '/devices/isa/sbawe.0/sound/card0/seq-oss-0-0'
It's because both emux synth and opl3 drivers try to register their OSS device object with the same static index number 0. This hasn't been a big problem until the recent rewrite of device management code (that exposes sysfs at the same time), but it's been an obvious bug.
This patch works around it just by using a different index number of emux synth object. There can be a more elegant way to fix, but it's enough for now, as this code won't be touched so often, in anyway.
--- sound/synth/emux/emux_oss.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
sound/synth/emux/emux_oss.c +2 -1
@@ -69,7 +69,8 @@ snd_emux_init_seq_oss(struct snd_emux *emu)struct snd_seq_oss_reg *arg;struct snd_seq_device *dev; -if (snd_seq_device_new (emu->card,0 ,SNDRV_SEQ_DEV_ID_OSS , +/* using device#1 here for avoiding conflicts with OPL3 */ +if (snd_seq_device_new (emu->card,1 ,SNDRV_SEQ_DEV_ID_OSS ,sizeof (struct snd_seq_oss_reg ), &dev) <0 )return ;
Signature · 1 line
2.6.2
PATCH 41/123 ALSA: hda - Apply SPDIF pin ctl to MacBookPro 12,1
In reply to Jiri SlabyFrom: John Flatness <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit e8ff581f7ac2bc3b8886094b7ca635dcc4d1b0e9 upstream.
The MacBookPro 12,1 has the same setup as the 11 for controlling the status of the optical audio light. Simply apply the existing workaround to the subsystem ID for the 12,1.
[sorted the fixup entry by tiwai]
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=105401
--- sound/pci/hda/patch_cirrus.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_cirrus.c +1 -0
@@ -637,6 +637,7 @@ static const struct snd_pci_quirk cs4208_mac_fixup_tbl[] = {SND_PCI_QUIRK (0x106b ,0x5e00 ,"MacBookPro 11,2" ,CS4208_MBP11 ),SND_PCI_QUIRK (0x106b ,0x7100 ,"MacBookAir 6,1" ,CS4208_MBA6 ),SND_PCI_QUIRK (0x106b ,0x7200 ,"MacBookAir 6,2" ,CS4208_MBA6 ), + SND_PCI_QUIRK(0x106b, 0x7b00, "MacBookPro 12,1", CS4208_MBP11), {} /* terminator */ };
Signature · 1 line
2.6.2
PATCH 42/123 ASoC: pxa: pxa2xx-ac97: fix dma requestor lines
In reply to Jiri SlabyFrom: Robert Jarzmik <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 8811191fdf7ed02ee07cb8469428158572d355a2 upstream.
PCM receive and transmit DMA requestor lines were reverted, breaking the PCM playback interface for PXA platforms using the sound/soc/ variant instead of the sound/arm variant.
The commit below shows the inversion in the requestor lines.
--- sound/soc/pxa/pxa2xx-ac97.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/pxa/pxa2xx-ac97.c +2 -2
@@ -49,7 +49,7 @@ static struct snd_ac97_bus_ops pxa2xx_ac97_ops = { .reset = pxa2xx_ac97_cold_reset, }; -static unsigned long pxa2xx_ac97_pcm_stereo_in_req =12 ; +static unsigned long pxa2xx_ac97_pcm_stereo_in_req =11 ;static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_in = { .addr =__PREG (PCDR ), .addr_width =DMA_SLAVE_BUSWIDTH_4_BYTES ,
@@ -57,7 +57,7 @@ static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_in = { .filter_data = &pxa2xx_ac97_pcm_stereo_in_req, }; -static unsigned long pxa2xx_ac97_pcm_stereo_out_req =11 ; +static unsigned long pxa2xx_ac97_pcm_stereo_out_req =12 ;static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_out = { .addr =__PREG (PCDR ), .addr_width =DMA_SLAVE_BUSWIDTH_4_BYTES ,
Signature · 1 line
2.6.2
PATCH 43/123 ASoC: fix broken pxa SoC support
In reply to Jiri SlabyFrom: Robert Jarzmik <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 3c8f7710c1c44fb650bc29b6ef78ed8b60cfaa28 upstream.
The previous fix of pxa library support, which was introduced to fix the library dependency, broke the previous SoC behavior, where a machine code binding pxa2xx-ac97 with a coded relied on :
- sound/soc/pxa/pxa2xx-ac97.c
- sound/soc/codecs/XXX.c
For example, the mioa701_wm9713.c machine code is currently broken. The "select ARM" statement wrongly selects the soc/arm/pxa2xx-ac97 for compilation, as per an unfortunate fate SND_PXA2XX_AC97 is both declared in sound/arm/Kconfig and sound/soc/pxa/Kconfig.
Fix this by ensuring that SND_PXA2XX_SOC correctly triggers the correct pxa2xx-ac97 compilation.
--- sound/arm/Kconfig | 15 ++++++++------- sound/soc/pxa/Kconfig | 2 -- 2 files changed, 8 insertions(+), 9 deletions(-)
sound/arm/Kconfig +8 -7
@@ -9,6 +9,14 @@ menuconfig SND_ARM Drivers that are implemented on ASoC can be found in "ALSA for SoC audio support" section. +config SND_PXA2XX_LIB + tristate + select SND_AC97_CODEC if SND_PXA2XX_LIB_AC97 + select SND_DMAENGINE_PCM + +config SND_PXA2XX_LIB_AC97 + bool + if SND_ARM config SND_ARMAACI
@@ -21,13 +29,6 @@ config SND_PXA2XX_PCM tristate select SND_PCM -config SND_PXA2XX_LIB - tristate - select SND_AC97_CODEC if SND_PXA2XX_LIB_AC97 - -config SND_PXA2XX_LIB_AC97 - bool - config SND_PXA2XX_AC97 tristate "AC97 driver for the Intel PXA2xx chip" depends on ARCH_PXA
sound/soc/pxa/Kconfig +0 -2
@@ -1,7 +1,6 @@ config SND_PXA2XX_SOC tristate "SoC Audio for the Intel PXA2xx chip" depends on ARCH_PXA - select SND_ARM select SND_PXA2XX_LIB help Say Y or M if you want to add support for codecs attached to
@@ -24,7 +23,6 @@ config SND_PXA2XX_AC97 config SND_PXA2XX_SOC_AC97 tristate select AC97_BUS - select SND_ARM select SND_PXA2XX_LIB_AC97 select SND_SOC_AC97_BUS
Signature · 1 line
2.6.2
PATCH 44/123 ASoC: dwc: correct irq clear method
In reply to Jiri SlabyFrom: Yitian Bu <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 4873867e5f2bd90faad861dd94865099fc3140f3 upstream.
from Designware I2S datasheet, tx/rx XRUN irq is cleared by reading register TOR/ROR, rather than by writing into them.
--- sound/soc/dwc/designware_i2s.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/dwc/designware_i2s.c +2 -2
@@ -100,10 +100,10 @@ static inline void i2s_clear_irqs(struct dw_i2s_dev *dev, u32 stream)if (stream ==SNDRV_PCM_STREAM_PLAYBACK ) {for (i =0 ; i <4 ; i++) -i2s_write_reg (dev->i2s_base,TOR (i),0 ); +i2s_read_reg (dev->i2s_base,TOR (i)); }else {for (i =0 ; i <4 ; i++) -i2s_write_reg (dev->i2s_base,ROR (i),0 ); +i2s_read_reg (dev->i2s_base,ROR (i)); } }
Signature · 1 line
2.6.2
PATCH 45/123 btrfs: skip waiting on ordered range for special files
In reply to Jiri SlabyFrom: Jeff Mahoney <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit a30e577c96f59b1e1678ea5462432b09bf7d5cbc upstream.
In btrfs_evict_inode, we properly truncate the page cache for evicted inodes but then we call btrfs_wait_ordered_range for every inode as well. It's the right thing to do for regular files but results in incorrect behavior for device inodes for block devices.
filemap_fdatawrite_range gets called with inode->i_mapping which gets resolved to the block device inode before getting passed to wbc_attach_fdatawrite_inode and ultimately to inode_to_bdi. What happens next depends on whether there's an open file handle associated with the inode. If there is, we write to the block device, which is unexpected behavior. If there isn't, we through normally and inode->i_data is used. We can also end up racing against open/close which can result in crashes when i_mapping points to a block device inode that has been closed.
Since there can't be any page cache associated with special file inodes, it's safe to skip the btrfs_wait_ordered_range call entirely and avoid the problem.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=100911
--- fs/btrfs/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/btrfs/inode.c +2 -1
@@ -4516,7 +4516,8 @@ void btrfs_evict_inode(struct inode *inode) goto no_delete; }/* do we really want it for ->i_nlink > 0 and zero btrfs_root_refs? */ -btrfs_wait_ordered_range (inode,0 , (u64)-1 ); +if (!special_file (inode->i_mode)) +btrfs_wait_ordered_range (inode,0 , (u64)-1 );if (root->fs_info->log_root_recovering) { BUG_ON(test_bit(BTRFS_INODE_HAS_ORPHAN_ITEM,
Signature · 1 line
2.6.2
PATCH 46/123 Btrfs: fix read corruption of compressed and shared extents
In reply to Jiri SlabyFrom: Filipe Manana <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 005efedf2c7d0a270ffbe28d8997b03844f3e3e7 upstream.
If a file has a range pointing to a compressed extent, followed by another range that points to the same compressed extent and a read operation attempts to read both ranges (either completely or part of them), the pages that correspond to the second range are incorrectly filled with zeroes.
Consider the following example:
File layout
[0 - 8K] [8K - 24K]
| |
| |
points to extent X, points to extent X,
offset 4K, length of 8K offset 0, length 16K[extent X, compressed length = 4K uncompressed length = 16K]
If a readpages() call spans the 2 ranges, a single bio to read the extent is submitted - extent_io.c:submit_extent_page() would only create a new bio to cover the second range pointing to the extent if the extent it points to had a different logical address than the extent associated with the first range. This has a consequence of the compressed read end io handler (compression.c:end_compressed_bio_read()) finish once the extent is decompressed into the pages covering the first range, leaving the remaining pages (belonging to the second range) filled with zeroes (done by compression.c:btrfs_clear_biovec_end()).
So fix this by submitting the current bio whenever we find a range pointing to a compressed extent that was preceded by a range with a different extent map. This is the simplest solution for this corner case. Making the end io callback populate both ranges (or more, if we have multiple pointing to the same extent) is a much more complex solution since each bio is tightly coupled with a single extent map and the extent maps associated to the ranges pointing to the shared extent can have different offsets and lengths.
The following test case for fstests triggers the issue:
seq=basename $0
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
tmp=/tmp/$$
status=1 # failure is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup()
{
rm -f $tmp.*
}# get standard environment, filters and checks . ./common/rc . ./common/filter
# real QA test starts here _need_to_be_root _supported_fs btrfs _supported_os Linux _require_scratch _require_cloner
rm -f $seqres.full
test_clone_and_read_compressed_extent()
{
local mount_opts=$1 _scratch_mkfs >>$seqres.full 2>&1
_scratch_mount $mount_opts
# Create a test file with a single extent that is compressed (the # data we write into it is highly compressible no matter which # compression algorithm is used, zlib or lzo).
$XFS_IO_PROG -f -c "pwrite -S 0xaa 0K 4K" \
-c "pwrite -S 0xbb 4K 8K" \
-c "pwrite -S 0xcc 12K 4K" \
$SCRATCH_MNT/foo | _filter_xfs_io
# Now clone our extent into an adjacent offset. $CLONER_PROG -s $((4 * 1024)) -d $((16 * 1024)) -l $((8 * 1024)) \
$SCRATCH_MNT/foo $SCRATCH_MNT/foo
# Same as before but for this file we clone the extent into a lower # file offset.
$XFS_IO_PROG -f -c "pwrite -S 0xaa 8K 4K" \
-c "pwrite -S 0xbb 12K 8K" \
-c "pwrite -S 0xcc 20K 4K" \
$SCRATCH_MNT/bar | _filter_xfs_io
$CLONER_PROG -s $((12 * 1024)) -d 0 -l $((8 * 1024)) \
$SCRATCH_MNT/bar $SCRATCH_MNT/bar
echo "File digests before unmounting filesystem:" md5sum $SCRATCH_MNT/foo | _filter_scratch md5sum $SCRATCH_MNT/bar | _filter_scratch
# Evicting the inode or clearing the page cache before reading # again the file would also trigger the bug - reads were returning # all bytes in the range corresponding to the second reference to # the extent with a value of 0, but the correct data was persisted # (it was a bug exclusively in the read path). The issue happened # only if the same readpages() call targeted pages belonging to the # first and second ranges that point to the same compressed extent. _scratch_remount
echo "File digests after mounting filesystem again:" # Must match the same digests we got before. md5sum $SCRATCH_MNT/foo | _filter_scratch md5sum $SCRATCH_MNT/bar | _filter_scratch
}
echo -e "\nTesting with zlib compression..." test_clone_and_read_compressed_extent "-o compress=zlib"
_scratch_unmount
echo -e "\nTesting with lzo compression..." test_clone_and_read_compressed_extent "-o compress=lzo"
status=0
exit
--- fs/btrfs/extent_io.c | 65 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 57 insertions(+), 8 deletions(-)
fs/btrfs/extent_io.c +57 -8
@@ -2642,7 +2642,8 @@ static int submit_extent_page(int rw, struct extent_io_tree *tree,bio_end_io_t end_io_func, int mirror_num, unsigned long prev_bio_flags, - unsigned long bio_flags) + unsigned long bio_flags, + bool force_bio_submit) { int ret = 0;struct bio *bio;
@@ -2660,6 +2661,7 @@ static int submit_extent_page(int rw, struct extent_io_tree *tree, contig =bio_end_sector (bio) == sector;if (prev_bio_flags != bio_flags || !contig || + force_bio_submit ||merge_bio (rw, tree, page, offset, page_size, bio, bio_flags) ||bio_add_page (bio, page, page_size, offset) < page_size) { ret = submit_one_bio(rw, bio, mirror_num,
@@ -2751,7 +2753,8 @@ static int __do_readpage(struct extent_io_tree *tree,get_extent_t *get_extent, struct extent_map **em_cached, struct bio **bio, int mirror_num, - unsigned long *bio_flags, int rw) + unsigned long *bio_flags, int rw, + u64 *prev_em_start) { struct inode *inode = page->mapping->host;u64 start =page_offset (page);
@@ -2799,6 +2802,7 @@ static int __do_readpage(struct extent_io_tree *tree, }while (cur <= end) {unsigned long pnr = (last_byte >>PAGE_CACHE_SHIFT ) +1 ; +bool force_bio_submit = false;if (cur >= last_byte) {char *userpage;
@@ -2849,6 +2853,49 @@ static int __do_readpage(struct extent_io_tree *tree, block_start = em->block_start;if (test_bit (EXTENT_FLAG_PREALLOC , &em->flags)) block_start =EXTENT_MAP_HOLE ; + +/* +* If we have a file range that points to a compressed extent +* and it's followed by a consecutive file range that points to +* to the same compressed extent (possibly with a different +* offset and/or length, so it either points to the whole extent +* or only part of it), we must make sure we do not submit a +* single bio to populate the pages for the 2 ranges because +* this makes the compressed extent read zero out the pages +* belonging to the 2nd range. Imagine the following scenario: +* +* File layout +* [0 - 8K] [8K - 24K] +* | | +* | | +* points to extent X, points to extent X, +* offset 4K, length of 8K offset 0, length 16K +* +* [extent X, compressed length = 4K uncompressed length = 16K] +* +* If the bio to read the compressed extent covers both ranges, +* it will decompress extent X into the pages belonging to the +* first range and then it will stop, zeroing out the remaining +* pages that belong to the other range that points to extent X. +* So here we make sure we submit 2 bios, one for the first +* range and another one for the third range. Both will target +* the same physical extent from disk, but we can't currently +* make the compressed bio endio callback populate the pages +* for both ranges because each compressed bio is tightly +* coupled with a single extent map, and each range can have +* an extent map with a different offset value relative to the +* uncompressed data of our extent and different lengths. This +* is a corner case so we prioritize correctness over +* non-optimal behavior (submitting 2 bios for the same extent). +*/ +if (test_bit (EXTENT_FLAG_COMPRESSED , &em->flags) && + prev_em_start && *prev_em_start != (u64)-1 && + *prev_em_start != em->orig_start) + force_bio_submit = true; + +if (prev_em_start) + *prev_em_start = em->orig_start; +free_extent_map (em); em =NULL ;
@@ -2898,7 +2945,8 @@ static int __do_readpage(struct extent_io_tree *tree, bdev, bio, pnr, end_bio_extent_readpage, mirror_num, *bio_flags, - this_bio_flag); + this_bio_flag, + force_bio_submit);if (!ret) { nr++; *bio_flags = this_bio_flag;
@@ -2930,6 +2978,7 @@ static inline void __do_contiguous_readpages(struct extent_io_tree *tree,struct inode *inode;struct btrfs_ordered_extent *ordered;int index; +u64 prev_em_start = (u64)-1 ; inode = pages[0 ]->mapping->host;while (1 ) {
@@ -2945,7 +2994,7 @@ static inline void __do_contiguous_readpages(struct extent_io_tree *tree,for (index =0 ; index < nr_pages; index++) {__do_readpage (tree, pages[index], get_extent, em_cached, bio, - mirror_num, bio_flags, rw); + mirror_num, bio_flags, rw, &prev_em_start);page_cache_release (pages[index]); } }
@@ -3013,7 +3062,7 @@ static int __extent_read_full_page(struct extent_io_tree *tree, } ret =__do_readpage (tree, page, get_extent,NULL , bio, mirror_num, - bio_flags, rw); + bio_flags, rw,NULL );return ret; }
@@ -3039,7 +3088,7 @@ int extent_read_full_page_nolock(struct extent_io_tree *tree, struct page *page,int ret; ret =__do_readpage (tree, page, get_extent,NULL , &bio, mirror_num, - &bio_flags,READ ); + &bio_flags,READ ,NULL );if (bio) ret =submit_one_bio (READ , bio, mirror_num, bio_flags);return ret;
@@ -3308,7 +3357,7 @@ static int __extent_writepage(struct page *page, struct writeback_control *wbc, sector, iosize, pg_offset, bdev, &epd->bio, max_nr, end_bio_extent_writepage, - 0, 0, 0); + 0, 0, 0, false);if (ret)SetPageError (page); }
@@ -3479,7 +3528,7 @@ static int write_one_eb(struct extent_buffer *eb, ret =submit_extent_page (rw, eb->tree, p, offset >>9 ,PAGE_CACHE_SIZE ,0 , bdev, &epd->bio,-1 , end_bio_extent_buffer_writepage, -0 , epd->bio_flags, bio_flags); +0 , epd->bio_flags, bio_flags, false); epd->bio_flags = bio_flags;if (ret) {set_bit (EXTENT_BUFFER_IOERR , &eb->bflags);
Signature · 1 line
2.6.2
PATCH 47/123 Btrfs: update fix for read corruption of compressed and shared extents
In reply to Jiri SlabyFrom: Filipe Manana <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 808f80b46790f27e145c72112189d6a3be2bc884 upstream.
My previous fix in commit 005efedf2c7d ("Btrfs: fix read corruption of compressed and shared extents") was effective only if the compressed extents cover a file range with a length that is not a multiple of 16 pages. That's because the detection of when we reached a different range of the file that shares the same compressed extent as the previously processed range was done at extent_io.c:__do_contiguous_readpages(), which covers subranges with a length up to 16 pages, because extent_readpages() groups the pages in clusters no larger than 16 pages. So fix this by tracking the start of the previously processed file range's extent map at extent_readpages().
The following test case for fstests reproduces the issue:
seq=basename $0
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
tmp=/tmp/$$
status=1 # failure is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup()
{
rm -f $tmp.*
}# get standard environment, filters and checks . ./common/rc . ./common/filter
# real QA test starts here _need_to_be_root _supported_fs btrfs _supported_os Linux _require_scratch _require_cloner
rm -f $seqres.full
test_clone_and_read_compressed_extent()
{
local mount_opts=$1 _scratch_mkfs >>$seqres.full 2>&1
_scratch_mount $mount_opts
# Create our test file with a single extent of 64Kb that is going to # be compressed no matter which compression algo is used (zlib/lzo). $XFS_IO_PROG -f -c "pwrite -S 0xaa 0K 64K" \
$SCRATCH_MNT/foo | _filter_xfs_io
# Now clone the compressed extent into an adjacent file offset. $CLONER_PROG -s 0 -d $((64 * 1024)) -l $((64 * 1024)) \
$SCRATCH_MNT/foo $SCRATCH_MNT/foo
echo "File digest before unmount:"
md5sum $SCRATCH_MNT/foo | _filter_scratch
# Remount the fs or clear the page cache to trigger the bug in # btrfs. Because the extent has an uncompressed length that is a # multiple of 16 pages, all the pages belonging to the second range # of the file (64K to 128K), which points to the same extent as the # first range (0K to 64K), had their contents full of zeroes instead # of the byte 0xaa. This was a bug exclusively in the read path of # compressed extents, the correct data was stored on disk, btrfs # just failed to fill in the pages correctly. _scratch_remount
echo "File digest after remount:"
# Must match the digest we got before.
md5sum $SCRATCH_MNT/foo | _filter_scratch
}
echo -e "\nTesting with zlib compression..." test_clone_and_read_compressed_extent "-o compress=zlib"
_scratch_unmount
echo -e "\nTesting with lzo compression..." test_clone_and_read_compressed_extent "-o compress=lzo"
status=0
exit
--- fs/btrfs/extent_io.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
fs/btrfs/extent_io.c +11 -8
@@ -2973,12 +2973,12 @@ static inline void __do_contiguous_readpages(struct extent_io_tree *tree,get_extent_t *get_extent, struct extent_map **em_cached, struct bio **bio, int mirror_num, - unsigned long *bio_flags, int rw) + unsigned long *bio_flags, int rw, + u64 *prev_em_start) { struct inode *inode;struct btrfs_ordered_extent *ordered;int index; -u64 prev_em_start = (u64)-1 ; inode = pages[0 ]->mapping->host;while (1 ) {
@@ -2994,7 +2994,7 @@ static inline void __do_contiguous_readpages(struct extent_io_tree *tree,for (index =0 ; index < nr_pages; index++) {__do_readpage (tree, pages[index], get_extent, em_cached, bio, - mirror_num, bio_flags, rw, &prev_em_start); + mirror_num, bio_flags, rw, prev_em_start);page_cache_release (pages[index]); } }
@@ -3004,7 +3004,8 @@ static void __extent_readpages(struct extent_io_tree *tree, int nr_pages, get_extent_t *get_extent, struct extent_map **em_cached, struct bio **bio, int mirror_num, - unsigned long *bio_flags, int rw) + unsigned long *bio_flags, int rw, + u64 *prev_em_start) { u64 start = 0;u64 end =0 ;
@@ -3025,7 +3026,7 @@ static void __extent_readpages(struct extent_io_tree *tree, index - first_index, start, end, get_extent, em_cached, bio, mirror_num, bio_flags, - rw); + rw, prev_em_start); start = page_start; end = start +PAGE_CACHE_SIZE -1 ; first_index = index;
@@ -3036,7 +3037,8 @@ static void __extent_readpages(struct extent_io_tree *tree,__do_contiguous_readpages (tree, &pages[first_index], index - first_index, start, end, get_extent, em_cached, bio, - mirror_num, bio_flags, rw); + mirror_num, bio_flags, rw, + prev_em_start); } static int __extent_read_full_page(struct extent_io_tree *tree,
@@ -3931,6 +3933,7 @@ int extent_readpages(struct extent_io_tree *tree,struct page *page;struct extent_map *em_cached =NULL ;int nr =0 ; +u64 prev_em_start = (u64)-1 ;for (page_idx =0 ; page_idx < nr_pages; page_idx++) { page = list_entry(pages->prev, struct page, lru);
@@ -3947,12 +3950,12 @@ int extent_readpages(struct extent_io_tree *tree,if (nr <ARRAY_SIZE (pagepool))continue ;__extent_readpages (tree, pagepool, nr, get_extent, &em_cached, - &bio,0 , &bio_flags,READ ); + &bio,0 , &bio_flags,READ , &prev_em_start); nr =0 ; }if (nr)__extent_readpages (tree, pagepool, nr, get_extent, &em_cached, - &bio,0 , &bio_flags,READ ); + &bio,0 , &bio_flags,READ , &prev_em_start);if (em_cached)free_extent_map (em_cached);
Signature · 1 line
2.6.2
PATCH 48/123 dm btree: add ref counting ops for the leaves of top level btrees
In reply to Jiri SlabyFrom: Joe Thornber <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit b0dc3c8bc157c60b1d470163882be8c13e1950af upstream.
When using nested btrees, the top leaves of the top levels contain block addresses for the root of the next tree down. If we shadow a shared leaf node the leaf values (sub tree roots) should be incremented accordingly.
This is only an issue if there is metadata sharing in the top levels. Which only occurs if metadata snapshots are being used (as is possible with dm-thinp). And could result in a block from the thinp metadata snap being reused early, thus corrupting the thinp metadata snap.
--- drivers/md/persistent-data/dm-btree-internal.h | 6 +++++ drivers/md/persistent-data/dm-btree-remove.c | 12 +++------ drivers/md/persistent-data/dm-btree-spine.c | 37 ++++++++++++++++++++++++++ drivers/md/persistent-data/dm-btree.c | 7 +---- 4 files changed, 47 insertions(+), 15 deletions(-)
drivers/md/persistent-data/dm-btree-internal.h +6 -0
@@ -138,4 +138,10 @@ int lower_bound(struct btree_node *n, uint64_t key);extern struct dm_block_validator btree_node_validator; +/* +* Value type for upper levels of multi-level btrees. +*/ +extern void init_le64_type (struct dm_transaction_manager *tm, +struct dm_btree_value_type *vt); +#endif /* DM_BTREE_INTERNAL_H */
drivers/md/persistent-data/dm-btree-remove.c +3 -9
@@ -544,14 +544,6 @@ static int remove_raw(struct shadow_spine *s, struct dm_btree_info *info,return r; } -static struct dm_btree_value_type le64_type = { - .context =NULL , - .size =sizeof (__le64), - .inc =NULL , - .dec =NULL , - .equal =NULL -}; -int dm_btree_remove (struct dm_btree_info *info,dm_block_t root,uint64_t *keys,dm_block_t *new_root) {
@@ -559,12 +551,14 @@ int dm_btree_remove(struct dm_btree_info *info, dm_block_t root,int index =0 , r =0 ;struct shadow_spine spine;struct btree_node *n; +struct dm_btree_value_type le64_vt; +init_le64_type (info->tm, &le64_vt);init_shadow_spine (&spine, info);for (level =0 ; level < info->levels; level++) { r =remove_raw (&spine, info, (level == last_level ? - &info->value_type : &le64_type), + &info->value_type : &le64_vt), root, keys[level], (unsigned *)&index);if (r <0 )break ;
drivers/md/persistent-data/dm-btree-spine.c +37 -0
@@ -249,3 +249,40 @@ int shadow_root(struct shadow_spine *s) {return s->root; } + +static void le64_inc (void *context,const void *value_le) +{ +struct dm_transaction_manager *tm = context; +__le64 v_le; + +memcpy (&v_le, value_le,sizeof (v_le)); +dm_tm_inc (tm,le64_to_cpu (v_le)); +} + +static void le64_dec (void *context,const void *value_le) +{ +struct dm_transaction_manager *tm = context; +__le64 v_le; + +memcpy (&v_le, value_le,sizeof (v_le)); +dm_tm_dec (tm,le64_to_cpu (v_le)); +} + +static int le64_equal (void *context,const void *value1_le,const void *value2_le) +{ +__le64 v1_le, v2_le; + +memcpy (&v1_le, value1_le,sizeof (v1_le)); +memcpy (&v2_le, value2_le,sizeof (v2_le)); +return v1_le == v2_le; +} + +void init_le64_type (struct dm_transaction_manager *tm, +struct dm_btree_value_type *vt) +{ + vt->context = tm; + vt->size =sizeof (__le64); + vt->inc = le64_inc; + vt->dec = le64_dec; + vt->equal = le64_equal; +}
drivers/md/persistent-data/dm-btree.c +1 -6
@@ -667,12 +667,7 @@ static int insert(struct dm_btree_info *info, dm_block_t root,struct btree_node *n;struct dm_btree_value_type le64_type; - le64_type.context =NULL ; - le64_type.size =sizeof (__le64); - le64_type.inc =NULL ; - le64_type.dec =NULL ; - le64_type.equal =NULL ; - +init_le64_type (info->tm, &le64_type);init_shadow_spine (&spine, info);for (level =0 ; level < (info->levels -1 ); level++) {
Signature · 1 line
2.6.2
PATCH 49/123 USB: option: add ZTE PIDs
In reply to Jiri SlabyFrom: "Liu.Zhao" <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 19ab6bc5674a30fdb6a2436b068d19a3c17dc73e upstream.
This is intended to add ZTE device PIDs on kernel.
--- drivers/usb/serial/option.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
drivers/usb/serial/option.c +24 -0
@@ -276,6 +276,10 @@ static void option_instat_callback(struct urb *urb);#define ZTE_PRODUCT_MF622 0x0001#define ZTE_PRODUCT_MF628 0x0015#define ZTE_PRODUCT_MF626 0x0031 +#define ZTE_PRODUCT_ZM8620_X 0x0396 +#define ZTE_PRODUCT_ME3620_MBIM 0x0426 +#define ZTE_PRODUCT_ME3620_X 0x1432 +#define ZTE_PRODUCT_ME3620_L 0x1433#define ZTE_PRODUCT_AC2726 0xfff1#define ZTE_PRODUCT_CDMA_TECH 0xfffe#define ZTE_PRODUCT_AC8710T 0xffff
@@ -549,6 +553,18 @@ static const struct option_blacklist_info zte_mc2716_z_blacklist = { .sendsetup = BIT(1) | BIT(2) | BIT(3), }; +static const struct option_blacklist_info zte_me3620_mbim_blacklist = { + .reserved =BIT (2 ) |BIT (3 ) |BIT (4 ), +}; + +static const struct option_blacklist_info zte_me3620_xl_blacklist = { + .reserved =BIT (3 ) |BIT (4 ) |BIT (5 ), +}; + +static const struct option_blacklist_info zte_zm8620_x_blacklist = { + .reserved =BIT (3 ) |BIT (4 ) |BIT (5 ), +}; +static const struct option_blacklist_info huawei_cdc12_blacklist = { .reserved =BIT (1 ) |BIT (2 ), };
@@ -1579,6 +1595,14 @@ static const struct usb_device_id option_ids[] = { .driver_info = (kernel_ulong_t)&zte_ad3812_z_blacklist }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2716, 0xff, 0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_mc2716_z_blacklist }, + { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_ME3620_L), + .driver_info = (kernel_ulong_t)&zte_me3620_xl_blacklist }, + { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_ME3620_MBIM), + .driver_info = (kernel_ulong_t)&zte_me3620_mbim_blacklist }, + { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_ME3620_X), + .driver_info = (kernel_ulong_t)&zte_me3620_xl_blacklist }, + { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_ZM8620_X), + .driver_info = (kernel_ulong_t)&zte_zm8620_x_blacklist }, { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x01) }, { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x05) }, { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x86, 0x10) },
Signature · 1 line
2.6.2
PATCH 50/123 dm raid: fix round up of default region size
In reply to Jiri SlabyFrom: Mikulas Patocka <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 042745ee53a0a7c1f5aff191a4a24213c6dcfb52 upstream.
Commit 3a0f9aaee028 ("dm raid: round region_size to power of two") intended to make sure that the default region size is a power of two. However, the logic in that commit is incorrect and sets the variable region_size to 0 or 1, depending on whether min_region_size is a power of two.
Fix this logic, using roundup_pow_of_two(), so that region_size is properly rounded up to the next power of two.
--- drivers/md/dm-raid.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/md/dm-raid.c +1 -2
@@ -325,8 +325,7 @@ static int validate_region_size(struct raid_set *rs, unsigned long region_size)*/ if (min_region_size > (1 <<13 )) {/* If not a power of 2, make it the next power of 2 */ -if (min_region_size & (min_region_size -1 )) - region_size =1 <<fls (region_size); + region_size =roundup_pow_of_two (min_region_size);DMINFO ("Choosing default region size of %lu sectors" , region_size); }else {
Signature · 1 line
2.6.2
PATCH 51/123 netfilter: nf_conntrack: Support expectations in different zones
In reply to Jiri SlabyFrom: Joe Stringer <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 4b31814d20cbe5cd4ccf18089751e77a04afe4f2 upstream.
When zones were originally introduced, the expectation functions were all extended to perform lookup using the zone. However, insertion was not modified to check the zone. This means that two expectations which are intended to apply for different connections that have the same tuple but exist in different zones cannot both be tracked.
--- net/netfilter/nf_conntrack_expect.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/netfilter/nf_conntrack_expect.c +2 -1
@@ -202,7 +202,8 @@ static inline int expect_clash(const struct nf_conntrack_expect *a, a->mask.src.u3.all[count] & b->mask.src.u3.all[count]; } -return nf_ct_tuple_mask_cmp (&a->tuple, &b->tuple, &intersect_mask); +return nf_ct_tuple_mask_cmp (&a->tuple, &b->tuple, &intersect_mask) && +nf_ct_zone (a->master) ==nf_ct_zone (b->master); } static inline int expect_matches(const struct nf_conntrack_expect *a,
Signature · 1 line
2.6.2
PATCH 52/123 netfilter: ctnetlink: put back references to master ct and expect objects
In reply to Jiri SlabyFrom: Pablo Neira Ayuso <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 95dd8653de658143770cb0e55a58d2aab97c79d2 upstream.
We have to put back the references to the master conntrack and the expectation that we just created, otherwise we'll leak them.
--- net/netfilter/nf_conntrack_netlink.c | 5 ----- 1 file changed, 5 deletions(-)
net/netfilter/nf_conntrack_netlink.c +0 -5
@@ -2925,11 +2925,6 @@ ctnetlink_create_expect(struct net *net, u16 zone, } err =nf_ct_expect_related_report (exp, portid, report); -if (err <0 ) - goto err_exp; - -return 0 ; -err_exp:nf_ct_expect_put (exp); err_ct:nf_ct_put (ct);
Signature · 1 line
2.6.2
PATCH 53/123 disabling oplocks/leases via module parm enable_oplocks broken for SMB3
In reply to Jiri SlabyFrom: Steve French <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit e0ddde9d44e37fbc21ce893553094ecf1a633ab5 upstream.
leases (oplocks) were always requested for SMB2/SMB3 even when oplocks disabled in the cifs.ko module.
--- fs/cifs/smb2ops.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
fs/cifs/smb2ops.c +6 -2
@@ -49,9 +49,13 @@ change_conf(struct TCP_Server_Info *server)break ;default : server->echoes = true; - server->oplocks = true; +if (enable_oplocks) { + server->oplocks = true; + server->oplock_credits =1 ; + }else + server->oplocks = false; + server->echo_credits =1 ; - server->oplock_credits =1 ; } server->credits -= server->echo_credits + server->oplock_credits;return 0 ;
Signature · 1 line
2.6.2
PATCH 54/123 drm/qxl: only report first monitor as connected if we have no state
In reply to Jiri SlabyFrom: Dave Airlie <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 69e5d3f893e19613486f300fd6e631810338aa4b upstream.
If the server isn't new enough to give us state, report the first monitor as always connected, otherwise believe the server side.
--- drivers/gpu/drm/qxl/qxl_display.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/gpu/drm/qxl/qxl_display.c +7 -5
@@ -799,13 +799,15 @@ static enum drm_connector_status qxl_conn_detect(drm_connector_to_qxl_output (connector);struct drm_device *ddev = connector->dev;struct qxl_device *qdev = ddev->dev_private; -int connected; +bool connected = false;/* The first monitor is always connected */ - connected = (output->index ==0 ) || - (qdev->client_monitors_config && - qdev->client_monitors_config->count > output->index && -qxl_head_enabled (&qdev->client_monitors_config->heads[output->index])); +if (!qdev->client_monitors_config) { +if (output->index ==0 ) + connected = true; + }else + connected = qdev->client_monitors_config->count > output->index && +qxl_head_enabled (&qdev->client_monitors_config->heads[output->index]);DRM_DEBUG ("\n" ); return connected ? connector_status_connected
Signature · 1 line
2.6.2
PATCH 55/123 drm/qxl: recreate the primary surface when the bo is not primary
In reply to Jiri SlabyFrom: Fabiano Fidêncio <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 8d0d94015e96b8853c4f7f06eac3f269e1b3d866 upstream.
When disabling/enabling a crtc the primary area must be updated independently of which crtc has been disabled/enabled.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1264735
--- drivers/gpu/drm/qxl/qxl_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/qxl/qxl_display.c +1 -1
@@ -537,7 +537,7 @@ static int qxl_crtc_mode_set(struct drm_crtc *crtc, adjusted_mode->hdisplay, adjusted_mode->vdisplay); -if (qcrtc->index ==0 ) +if (bo->is_primary == false) recreate_primary = true;if (bo->surf.stride * bo->surf.height > qdev->vram_size) {
Signature · 1 line
2.6.2
PATCH 56/123 drm: Reject DRI1 hw lock ioctl functions for kms drivers
In reply to Jiri SlabyFrom: Daniel Vetter <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit da168d81b44898404d281d5dbe70154ab5f117c1 upstream.
I've done some extensive history digging across libdrm, mesa and xf86-video-{intel,nouveau,ati}. The only potential user of this with kms drivers I could find was ttmtest, which once used drmGetLock still. But that mistake was quickly fixed up. Even the intel xvmc library (which otherwise was really good with using dri1 stuff in kms mode) managed to never take the hw lock for dri2 (and hence kms).
Hence it should be save to unconditionally disallow this.
--- drivers/gpu/drm/drm_lock.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/drm_lock.c +6 -0
@@ -58,6 +58,9 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv)struct drm_master *master = file_priv->master;int ret =0 ; +if (drm_core_check_feature (dev,DRIVER_MODESET )) +return -EINVAL ; + ++file_priv->lock_count;if (lock->context ==DRM_KERNEL_CONTEXT ) {
@@ -151,6 +154,9 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv)struct drm_lock *lock = data;struct drm_master *master = file_priv->master; +if (drm_core_check_feature (dev,DRIVER_MODESET )) +return -EINVAL ; +if (lock->context ==DRM_KERNEL_CONTEXT ) {DRM_ERROR ("Process %d using kernel context %d\n" ,task_pid_nr (current), lock->context);
Signature · 1 line
2.6.2
PATCH 57/123 USB: whiteheat: fix potential null-deref at probe
In reply to Jiri SlabyFrom: Johan Hovold <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit cbb4be652d374f64661137756b8f357a1827d6a4 upstream.
Fix potential null-pointer dereference at probe by making sure that the required endpoints are present.
The whiteheat driver assumes there are at least five pairs of bulk endpoints, of which the final pair is used for the "command port". An attempt to bind to an interface with fewer bulk endpoints would currently lead to an oops.
Fixes CVE-2015-5257.
--- drivers/usb/serial/whiteheat.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
drivers/usb/serial/whiteheat.c +31 -0
@@ -81,6 +81,8 @@ static int whiteheat_firmware_download(struct usb_serial *serial,static int whiteheat_firmware_attach (struct usb_serial *serial);/* function prototypes for the Connect Tech WhiteHEAT serial converter */ +static int whiteheat_probe (struct usb_serial *serial, +const struct usb_device_id *id);static int whiteheat_attach (struct usb_serial *serial);static void whiteheat_release (struct usb_serial *serial);static int whiteheat_port_probe (struct usb_serial_port *port);
@@ -117,6 +119,7 @@ static struct usb_serial_driver whiteheat_device = { .description = "Connect Tech - WhiteHEAT", .id_table = id_table_std, .num_ports = 4, + .probe = whiteheat_probe, .attach = whiteheat_attach, .release = whiteheat_release, .port_probe = whiteheat_port_probe,
@@ -218,6 +221,34 @@ static int whiteheat_firmware_attach(struct usb_serial *serial)/***************************************************************************** * Connect Tech's White Heat serial driver functions *****************************************************************************/ + +static int whiteheat_probe (struct usb_serial *serial, +const struct usb_device_id *id) +{ +struct usb_host_interface *iface_desc; +struct usb_endpoint_descriptor *endpoint; +size_t num_bulk_in =0 ; +size_t num_bulk_out =0 ; +size_t min_num_bulk; +unsigned int i; + + iface_desc = serial->interface->cur_altsetting; + +for (i =0 ; i < iface_desc->desc.bNumEndpoints; i++) { + endpoint = &iface_desc->endpoint[i].desc; +if (usb_endpoint_is_bulk_in (endpoint)) + ++num_bulk_in; +if (usb_endpoint_is_bulk_out (endpoint)) + ++num_bulk_out; + } + + min_num_bulk =COMMAND_PORT +1 ; +if (num_bulk_in < min_num_bulk || num_bulk_out < min_num_bulk) +return -ENODEV ; + +return 0 ; +} +static int whiteheat_attach (struct usb_serial *serial) {struct usb_serial_port *command_port;
Signature · 1 line
2.6.2
PATCH 58/123 usb: xhci: Clear XHCI_STATE_DYING on start
In reply to Jiri SlabyFrom: Roger Quadros <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit e5bfeab0ad515b4f6df39fe716603e9dc6d3dfd0 upstream.
For whatever reason if XHCI died in the previous instant then it will never recover on the next xhci_start unless we clear the DYING flag.
--- drivers/usb/host/xhci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/host/xhci.c +2 -1
@@ -143,7 +143,8 @@ static int xhci_start(struct xhci_hcd *xhci)"waited %u microseconds.\n" , XHCI_MAX_HALT_USEC);if (!ret) - xhci->xhc_state &= ~XHCI_STATE_HALTED ; + xhci->xhc_state &= ~(XHCI_STATE_HALTED |XHCI_STATE_DYING ); +return ret; }
Signature · 1 line
2.6.2
PATCH 59/123 xhci: change xhci 1.0 only restrictions to support xhci 1.1
In reply to Jiri SlabyFrom: Mathias Nyman <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit dca7794539eff04b786fb6907186989e5eaaa9c2 upstream.
Some changes between xhci 0.96 and xhci 1.0 specifications forced us to check the hci version in code, some of these checks were implemented as hci_version == 1.0, which will not work with new xhci 1.1 controllers.
xhci 1.1 behaves similar to xhci 1.0 in these cases, so change these checks to hci_version >= 1.0
--- drivers/usb/host/xhci-mem.c | 6 +++--- drivers/usb/host/xhci-ring.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/usb/host/xhci-mem.c +3 -3
@@ -1402,10 +1402,10 @@ int xhci_endpoint_init(struct xhci_hcd *xhci,* use Event Data TRBs, and we don't chain in a link TRB on short * transfers, we're basically dividing by 1. * -* xHCI 1.0 specification indicates that the Average TRB Length should -* be set to 8 for control endpoints. +* xHCI 1.0 and 1.1 specification indicates that the Average TRB Length +* should be set to 8 for control endpoints. */ -if (usb_endpoint_xfer_control (&ep->desc) && xhci->hci_version ==0x100 ) +if (usb_endpoint_xfer_control (&ep->desc) && xhci->hci_version >=0x100 ) ep_ctx->tx_info |=cpu_to_le32 (AVG_TRB_LENGTH_FOR_EP (8 ));else ep_ctx->tx_info |=
drivers/usb/host/xhci-ring.c +2 -2
@@ -3537,8 +3537,8 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags,if (start_cycle ==0 ) field |=0x1 ; -/* xHCI 1.0 6.4.1.2.1: Transfer Type field */ -if (xhci->hci_version ==0x100 ) { +/* xHCI 1.0/1.1 6.4.1.2.1: Transfer Type field */ +if (xhci->hci_version >=0x100 ) {if (urb->transfer_buffer_length >0 ) {if (setup->bRequestType &USB_DIR_IN ) field |=TRB_TX_TYPE (TRB_DATA_IN );
Signature · 1 line
2.6.2
PATCH 60/123 usb: xhci: Add support for URB_ZERO_PACKET to bulk/sg transfers
In reply to Jiri SlabyFrom: Reyad Attiyat <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 4758dcd19a7d9ba9610b38fecb93f65f56f86346 upstream.
This commit checks for the URB_ZERO_PACKET flag and creates an extra zero-length td if the urb transfer length is a multiple of the endpoint's max packet length.
--- drivers/usb/host/xhci-ring.c | 66 ++++++++++++++++++++++++++++++++++---------- drivers/usb/host/xhci.c | 5 ++++ 2 files changed, 57 insertions(+), 14 deletions(-)
drivers/usb/host/xhci-ring.c +52 -14
@@ -3193,9 +3193,11 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags,struct xhci_td *td;struct scatterlist *sg;int num_sgs; -int trb_buff_len, this_sg_len, running_total; +int trb_buff_len, this_sg_len, running_total, ret;unsigned int total_packet_count; +bool zero_length_needed;bool first_trb; +int last_trb_num;u64 addr;bool more_trbs_coming;
@@ -3211,13 +3213,27 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags, total_packet_count =DIV_ROUND_UP (urb->transfer_buffer_length,usb_endpoint_maxp (&urb->ep->desc)); - trb_buff_len =prepare_transfer (xhci, xhci->devs[slot_id], + ret =prepare_transfer (xhci, xhci->devs[slot_id], ep_index, urb->stream_id, num_trbs, urb,0 , mem_flags); -if (trb_buff_len <0 ) -return trb_buff_len; +if (ret <0 ) +return ret; urb_priv = urb->hcpriv; + +/* Deal with URB_ZERO_PACKET - need one more td/trb */ + zero_length_needed = urb->transfer_flags &URB_ZERO_PACKET && + urb_priv->length ==2 ; +if (zero_length_needed) { + num_trbs++; +xhci_dbg (xhci,"Creating zero length td.\n" ); + ret =prepare_transfer (xhci, xhci->devs[slot_id], + ep_index, urb->stream_id, +1 , urb,1 , mem_flags); +if (ret <0 ) +return ret; + } + td = urb_priv->td[0 ];/*
@@ -3247,6 +3263,7 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags, trb_buff_len = urb->transfer_buffer_length; first_trb = true; + last_trb_num = zero_length_needed ?2 :1 ;/* Queue the first TRB, even if it's zero-length */ do { u32 field = 0;
@@ -3264,12 +3281,15 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags,/* Chain all the TRBs together; clear the chain bit in the last * TRB to indicate it's the last TRB in the chain. */ -if (num_trbs >1 ) { +if (num_trbs > last_trb_num) { field |=TRB_CHAIN ; - }else { -/* FIXME - add check for ZERO_PACKET flag before this */ + }else if (num_trbs == last_trb_num) { td->last_trb = ep_ring->enqueue; field |=TRB_IOC ; + }else if (zero_length_needed && num_trbs ==1 ) { + trb_buff_len =0 ; + urb_priv->td[1 ]->last_trb = ep_ring->enqueue; + field |=TRB_IOC ; }/* Only set interrupt on short packet for IN endpoints */
@@ -3331,7 +3351,7 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags,if (running_total + trb_buff_len > urb->transfer_buffer_length) trb_buff_len = urb->transfer_buffer_length - running_total; - }while (running_total < urb->transfer_buffer_length); + }while (num_trbs >0 );check_trb_math (urb, num_trbs, running_total); giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id,
@@ -3349,7 +3369,9 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,int num_trbs;struct xhci_generic_trb *start_trb;bool first_trb; +int last_trb_num;bool more_trbs_coming; +bool zero_length_needed;int start_cycle;u32 field, length_field;
@@ -3380,7 +3402,6 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, num_trbs++; running_total +=TRB_MAX_BUFF_SIZE ; } -/* FIXME: this doesn't deal with URB_ZERO_PACKET - need one more */ ret = prepare_transfer(xhci, xhci->devs[slot_id], ep_index, urb->stream_id,
@@ -3389,6 +3410,20 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,return ret; urb_priv = urb->hcpriv; + +/* Deal with URB_ZERO_PACKET - need one more td/trb */ + zero_length_needed = urb->transfer_flags &URB_ZERO_PACKET && + urb_priv->length ==2 ; +if (zero_length_needed) { + num_trbs++; +xhci_dbg (xhci,"Creating zero length td.\n" ); + ret =prepare_transfer (xhci, xhci->devs[slot_id], + ep_index, urb->stream_id, +1 , urb,1 , mem_flags); +if (ret <0 ) +return ret; + } + td = urb_priv->td[0 ];/*
@@ -3410,7 +3445,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, trb_buff_len = urb->transfer_buffer_length; first_trb = true; - + last_trb_num = zero_length_needed ?2 :1 ;/* Queue the first TRB, even if it's zero-length */ do { u32 remainder = 0;
@@ -3427,12 +3462,15 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,/* Chain all the TRBs together; clear the chain bit in the last * TRB to indicate it's the last TRB in the chain. */ -if (num_trbs >1 ) { +if (num_trbs > last_trb_num) { field |=TRB_CHAIN ; - }else { -/* FIXME - add check for ZERO_PACKET flag before this */ + }else if (num_trbs == last_trb_num) { td->last_trb = ep_ring->enqueue; field |=TRB_IOC ; + }else if (zero_length_needed && num_trbs ==1 ) { + trb_buff_len =0 ; + urb_priv->td[1 ]->last_trb = ep_ring->enqueue; + field |=TRB_IOC ; }/* Only set interrupt on short packet for IN endpoints */
@@ -3470,7 +3508,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, trb_buff_len = urb->transfer_buffer_length - running_total;if (trb_buff_len >TRB_MAX_BUFF_SIZE ) trb_buff_len =TRB_MAX_BUFF_SIZE ; - }while (running_total < urb->transfer_buffer_length); + }while (num_trbs >0 );check_trb_math (urb, num_trbs, running_total); giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id,
drivers/usb/host/xhci.c +5 -0
@@ -1319,6 +1319,11 @@ int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags)if (usb_endpoint_xfer_isoc (&urb->ep->desc)) size = urb->number_of_packets; +else if (usb_endpoint_is_bulk_out (&urb->ep->desc) && + urb->transfer_buffer_length >0 && + urb->transfer_flags &URB_ZERO_PACKET && + !(urb->transfer_buffer_length %usb_endpoint_maxp (&urb->ep->desc))) + size =2 ;else size =1 ;
Signature · 1 line
2.6.2
PATCH 61/123 Initialize msg/shm IPC objects before doing ipc_addid()
In reply to Jiri SlabyFrom: Linus Torvalds <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit b9a532277938798b53178d5a66af6e2915cb27cf upstream.
As reported by Dmitry Vyukov, we really shouldn't do ipc_addid() before having initialized the IPC object state. Yes, we initialize the IPC object in a locked state, but with all the lockless RCU lookup work, that IPC object lock no longer means that the state cannot be seen.
We already did this for the IPC semaphore code (see commit e8577d1f0329:
"ipc/sem.c: fully initialize sem_array before making it visible") but we clearly forgot about msg and shm.
--- ipc/msg.c | 14 +++++++------- ipc/shm.c | 12 ++++++------ ipc/util.c | 8 ++++---- 3 files changed, 17 insertions(+), 17 deletions(-)
ipc/msg.c +7 -7
@@ -202,13 +202,6 @@ static int newque(struct ipc_namespace *ns, struct ipc_params *params)return retval; } -/* ipc_addid() locks msq upon success. */ - id =ipc_addid (&msg_ids (ns), &msq->q_perm, ns->msg_ctlmni); -if (id <0 ) { -ipc_rcu_putref (msq, msg_rcu_free); -return id; - } - msq->q_stime = msq->q_rtime =0 ; msq->q_ctime =get_seconds (); msq->q_cbytes = msq->q_qnum =0 ;
@@ -218,6 +211,13 @@ static int newque(struct ipc_namespace *ns, struct ipc_params *params)INIT_LIST_HEAD (&msq->q_receivers);INIT_LIST_HEAD (&msq->q_senders); +/* ipc_addid() locks msq upon success. */ + id =ipc_addid (&msg_ids (ns), &msq->q_perm, ns->msg_ctlmni); +if (id <0 ) { +ipc_rcu_putref (msq, msg_rcu_free); +return id; + } +ipc_unlock_object (&msq->q_perm);rcu_read_unlock ();
ipc/shm.c +6 -6
@@ -545,12 +545,6 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)if (IS_ERR (file)) goto no_file; - id =ipc_addid (&shm_ids (ns), &shp->shm_perm, ns->shm_ctlmni); -if (id <0 ) { - error = id; - goto no_id; - } - shp->shm_cprid =task_tgid_vnr (current); shp->shm_lprid =0 ; shp->shm_atim = shp->shm_dtim =0 ;
@@ -560,6 +554,12 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params) shp->shm_file = file; shp->shm_creator = current; + id =ipc_addid (&shm_ids (ns), &shp->shm_perm, ns->shm_ctlmni); +if (id <0 ) { + error = id; + goto no_id; + } +/* * shmid gets reported as "inode#" in /proc/pid/maps. * proc-ps tools use this. Changing this will break them.
ipc/util.c +4 -4
@@ -292,6 +292,10 @@ int ipc_addid(struct ipc_ids* ids, struct kern_ipc_perm* new, int size)rcu_read_lock ();spin_lock (&new->lock); +current_euid_egid (&euid, &egid); + new->cuid = new->uid = euid; + new->gid = new->cgid = egid; + id =idr_alloc (&ids->ipcs_idr, new, (next_id <0 ) ?0 :ipcid_to_idx (next_id),0 ,GFP_NOWAIT );
@@ -304,10 +308,6 @@ int ipc_addid(struct ipc_ids* ids, struct kern_ipc_perm* new, int size) ids->in_use++; -current_euid_egid (&euid, &egid); - new->cuid = new->uid = euid; - new->gid = new->cgid = egid; -if (next_id <0 ) { new->seq = ids->seq++;if (ids->seq > ids->seq_max)
Signature · 1 line
2.6.2
PATCH 62/123 ipvs: do not use random local source address for tunnels
In reply to Jiri SlabyFrom: Julian Anastasov <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 4754957f04f5f368792a0eb7dab0ae89fb93dcfd upstream.
Michael Vallaly reports about wrong source address used in rare cases for tunneled traffic. Looks like __ip_vs_get_out_rt in 3.10+ is providing uninitialized dest_dst->dst_saddr.ip because ip_vs_dest_dst_alloc uses kmalloc. While we retry after seeing EINVAL from routing for data that does not look like valid local address, it still succeeded when this memory was previously used from other dests and with different local addresses. As result, we can use valid local address that is not suitable for our real server.
Fix it by providing 0.0.0.0 every time our cache is refreshed. By this way we will get preferred source address from routing.
--- net/netfilter/ipvs/ip_vs_xmit.c | 1 - 1 file changed, 1 deletion(-)
net/netfilter/ipvs/ip_vs_xmit.c +0 -1
@@ -129,7 +129,6 @@ static struct rtable *do_output_route4(struct net *net, __be32 daddr,memset (&fl4,0 ,sizeof (fl4)); fl4.daddr = daddr; - fl4.saddr = (rt_mode &IP_VS_RT_MODE_CONNECT ) ? *saddr :0 ; fl4.flowi4_flags = (rt_mode &IP_VS_RT_MODE_KNOWN_NH ) ?FLOWI_FLAG_KNOWN_NH :0 ;
Signature · 1 line
2.6.2
PATCH 63/123 ipvs: fix crash with sync protocol v0 and FTP
In reply to Jiri SlabyFrom: Julian Anastasov <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 56184858d1fc95c46723436b455cb7261cd8be6f upstream.
Fix crash in 3.5+ if FTP is used after switchingsync_version to 0.
--- net/netfilter/ipvs/ip_vs_sync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/ipvs/ip_vs_sync.c +1 -1
@@ -612,7 +612,7 @@ static void ip_vs_sync_conn_v0(struct net *net, struct ip_vs_conn *cp, pkts =atomic_add_return (1 , &cp->in_pkts); else pkts =sysctl_sync_threshold (ipvs); -ip_vs_sync_conn (net, cp->control, pkts); +ip_vs_sync_conn (net, cp, pkts); } }
Signature · 1 line
2.6.2
PATCH 64/123 cifs: use server timestamp for ntlmv2 authentication
In reply to Jiri SlabyFrom: Peter Seiderer <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 98ce94c8df762d413b3ecb849e2b966b21606d04 upstream.
Linux cifs mount with ntlmssp against an Mac OS X (Yosemite 10.10.5) share fails in case the clocks differ more than +/-2h:
digest-service: digest-request: od failed with 2 proto=ntlmv2
digest-service: digest-request: kdc failed with -1561745592 proto=ntlmv2
Fix this by (re-)using the given server timestamp for the ntlmv2 authentication (as Windows 7 does).
A related problem was also reported earlier by Namjae Jaen (see below):
Windows machine has extended security feature which refuse to allow authentication when there is time difference between server time and client time when ntlmv2 negotiation is used. This problem is prevalent in embedded enviornment where system time is set to default 1970.
Modern servers send the server timestamp in the TargetInfo Av_Pair structure in the challenge message [see MS-NLMP 2.2.2.1]
In [MS-NLMP 3.1.5.1.2] it is explicitly mentioned that the client must use the server provided timestamp if present OR current time if it is not
--- fs/cifs/cifsencrypt.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-)
fs/cifs/cifsencrypt.c +51 -1
@@ -441,6 +441,48 @@ find_domain_name(struct cifs_ses *ses, const struct nls_table *nls_cp)return 0 ; } +/* Server has provided av pairs/target info in the type 2 challenge +* packet and we have plucked it and stored within smb session. +* We parse that blob here to find the server given timestamp +* as part of ntlmv2 authentication (or local current time as +* default in case of failure) +*/ +static __le64 +find_timestamp (struct cifs_ses *ses) +{ +unsigned int attrsize; +unsigned int type; +unsigned int onesize =sizeof (struct ntlmssp2_name ); +unsigned char *blobptr; +unsigned char *blobend; +struct ntlmssp2_name *attrptr; + +if (!ses->auth_key.len || !ses->auth_key.response) +return 0 ; + + blobptr = ses->auth_key.response; + blobend = blobptr + ses->auth_key.len; + +while (blobptr + onesize < blobend) { + attrptr = (struct ntlmssp2_name *) blobptr; + type =le16_to_cpu (attrptr->type); +if (type ==NTLMSSP_AV_EOL ) +break ; + blobptr +=2 ;/* advance attr type */ + attrsize =le16_to_cpu (attrptr->length); + blobptr +=2 ;/* advance attr size */ +if (blobptr + attrsize > blobend) +break ; +if (type ==NTLMSSP_AV_TIMESTAMP ) { +if (attrsize ==sizeof (u64)) +return *((__le64 *)blobptr); + } + blobptr += attrsize;/* advance attr value */ + } + +return cpu_to_le64 (cifs_UnixTimeToNT (CURRENT_TIME )); +} +static int calc_ntlmv2_hash (struct cifs_ses *ses,char *ntlmv2_hash,const struct nls_table *nls_cp) {
@@ -630,6 +672,7 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp)struct ntlmv2_resp *buf;char ntlmv2_hash[16 ];unsigned char *tiblob =NULL ;/* target info blob */ +__le64 rsp_timestamp;if (ses->server->negflavor ==CIFS_NEGFLAVOR_EXTENDED ) {if (!ses->domainName) {
@@ -648,6 +691,12 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp) } } +/* Must be within 5 minutes of the server (or in range +/-2h +* in case of Mac OS X), so simply carry over server timestamp +* (as Windows 7 does) +*/ + rsp_timestamp =find_timestamp (ses); + baselen =CIFS_SESS_KEY_SIZE +sizeof (struct ntlmv2_resp ); tilen = ses->auth_key.len; tiblob = ses->auth_key.response;
@@ -664,7 +713,8 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp) (ses->auth_key.response +CIFS_SESS_KEY_SIZE ); buf->blob_signature =cpu_to_le32 (0x00000101 ); buf->reserved =0 ; - buf->time =cpu_to_le64 (cifs_UnixTimeToNT (CURRENT_TIME )); + buf->time = rsp_timestamp; +get_random_bytes (&buf->client_chal,sizeof (buf->client_chal)); buf->reserved2 =0 ;
Signature · 1 line
2.6.2
PATCH 65/123 regmap: debugfs: Ensure we don't underflow when printing access masks
In reply to Jiri SlabyFrom: Mark Brown <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit b763ec17ac762470eec5be8ebcc43e4f8b2c2b82 upstream.
If a read is attempted which is smaller than the line length then we may underflow the subtraction we're doing with the unsigned size_t type so move some of the calculation to be additions on the right hand side instead in order to avoid this.
--- drivers/base/regmap/regmap-debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/regmap/regmap-debugfs.c +1 -1
@@ -423,7 +423,7 @@ static ssize_t regmap_access_read_file(struct file *file,/* If we're in the region the user is trying to read */ if (p >= *ppos) {/* ...but not beyond it */ -if (buf_pos >= count -1 - tot_len) +if (buf_pos + tot_len +1 >= count)break ;/* Format the register */
Signature · 1 line
2.6.2
PATCH 66/123 regmap: debugfs: Don't bother actually printing when calculating max length
In reply to Jiri SlabyFrom: Mark Brown <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 176fc2d5770a0990eebff903ba680d2edd32e718 upstream.
The in kernel snprintf() will conveniently return the actual length of the printed string even if not given an output beffer at all so just do that rather than relying on the user to pass in a suitable buffer, ensuring that we don't need to worry if the buffer was truncated due to the size of the buffer passed in.
--- drivers/base/regmap/regmap-debugfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/base/regmap/regmap-debugfs.c +1 -2
@@ -23,8 +23,7 @@ static struct dentry *regmap_debugfs_root;/* Calculate the length of a fixed format */ static size_t regmap_calc_reg_len (int max_val,char *buf,size_t buf_size) { -snprintf (buf, buf_size,"%x" , max_val); -return strlen (buf); +return snprintf (NULL ,0 ,"%x" , max_val); } static ssize_t regmap_name_read_file(struct file *file,
Signature · 1 line
2.6.2
PATCH 67/123 security: fix typo in security_task_prctl
In reply to Jiri SlabyFrom: Jann Horn <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit b7f76ea2ef6739ee484a165ffbac98deb855d3d3 upstream.
--- include/linux/security.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/security.h +1 -1
@@ -2441,7 +2441,7 @@ static inline int security_task_prctl(int option, unsigned long arg2,unsigned long arg4, unsigned long arg5) { - return cap_task_prctl(option, arg2, arg3, arg3, arg5); + return cap_task_prctl(option, arg2, arg3, arg4, arg5); }static inline void security_task_to_inode (struct task_struct *p,struct inode *inode)
Signature · 1 line
2.6.2
PATCH 68/123 usb: Use the USB_SS_MULT() macro to get the burst multiplier.
In reply to Jiri SlabyFrom: Mathias Nyman <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit ff30cbc8da425754e8ab96904db1d295bd034f27 upstream.
Bits 1:0 of the bmAttributes are used for the burst multiplier. The rest of the bits used to be reserved (zero), but USB3.1 takes bit 7 into use.
Use the existing USB_SS_MULT() macro instead to make sure the mult value and hence max packet calculations are correct for USB3.1 devices.
Note that burst multiplier in bmAttributes is zero based and that the USB_SS_MULT() macro adds one.
--- drivers/usb/core/config.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/usb/core/config.c +3 -2
@@ -114,7 +114,7 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno, cfgno, inum, asnum, ep->desc.bEndpointAddress); ep->ss_ep_comp.bmAttributes =16 ; }else if (usb_endpoint_xfer_isoc (&ep->desc) && - desc->bmAttributes >2 ) { +USB_SS_MULT (desc->bmAttributes) >3 ) { dev_warn(ddev, "Isoc endpoint has Mult of %d in " "config %d interface %d altsetting %d ep %d: " "setting to 3\n", desc->bmAttributes + 1,
@@ -123,7 +123,8 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno, }if (usb_endpoint_xfer_isoc (&ep->desc)) - max_tx = (desc->bMaxBurst +1 ) * (desc->bmAttributes +1 ) * + max_tx = (desc->bMaxBurst +1 ) * + (USB_SS_MULT (desc->bmAttributes)) *usb_endpoint_maxp (&ep->desc);else if (usb_endpoint_xfer_int (&ep->desc)) max_tx = usb_endpoint_maxp(&ep->desc) *
Signature · 1 line
2.6.2
PATCH 69/123 usb: Add device quirk for Logitech PTZ cameras
In reply to Jiri SlabyFrom: Vincent Palatin <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 72194739f54607bbf8cfded159627a2015381557 upstream.
Add a device quirk for the Logitech PTZ Pro Camera and its sibling the ConferenceCam CC3000e Camera.
This fixes the failed camera enumeration on some boot, particularly on machines with fast CPU.
Tested by connecting a Logitech PTZ Pro Camera to a machine with a Haswell Core i7-4600U CPU @ 2.10GHz, and doing thousands of reboot cycles while recording the kernel logs and taking camera picture after each boot. Before the patch, more than 7% of the boots show some enumeration transfer failures and in a few of them, the kernel is giving up before actually enumerating the webcam. After the patch, the enumeration has been correct on every reboot.
--- drivers/usb/core/quirks.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/usb/core/quirks.c +7 -0
@@ -53,6 +53,13 @@ static const struct usb_device_id usb_quirk_list[] = { { USB_DEVICE(0x046d, 0x082d), .driver_info = USB_QUIRK_DELAY_INIT }, { USB_DEVICE(0x046d, 0x0843), .driver_info = USB_QUIRK_DELAY_INIT }, + /* Logitech ConferenceCam CC3000e */ + { USB_DEVICE(0x046d, 0x0847), .driver_info = USB_QUIRK_DELAY_INIT }, + { USB_DEVICE(0x046d, 0x0848), .driver_info = USB_QUIRK_DELAY_INIT }, + + /* Logitech PTZ Pro Camera */ + { USB_DEVICE(0x046d, 0x0853), .driver_info = USB_QUIRK_DELAY_INIT }, + /* Logitech Quickcam Fusion */ { USB_DEVICE(0x046d, 0x08c1), .driver_info = USB_QUIRK_RESET_RESUME },
Signature · 1 line
2.6.2
PATCH 70/123 USB: Add reset-resume quirk for two Plantronics usb headphones.
In reply to Jiri SlabyFrom: Yao-Wen Mao <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 8484bf2981b3d006426ac052a3642c9ce1d8d980 upstream.
These two headphones need a reset-resume quirk to properly resume to original volume level.
--- drivers/usb/core/quirks.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/usb/core/quirks.c +6 -0
@@ -84,6 +84,12 @@ static const struct usb_device_id usb_quirk_list[] = {/* Philips PSC805 audio device */ { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME }, + /* Plantronic Audio 655 DSP */ + { USB_DEVICE(0x047f, 0xc008), .driver_info = USB_QUIRK_RESET_RESUME }, + + /* Plantronic Audio 648 USB */ + { USB_DEVICE(0x047f, 0xc013), .driver_info = USB_QUIRK_RESET_RESUME }, + /* Artisman Watchdog Dongle */ { USB_DEVICE(0x04b4, 0x0526), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS },
Signature · 1 line
2.6.2
PATCH 71/123 MIPS: dma-default: Fix 32-bit fall back to GFP_DMA
In reply to Jiri SlabyFrom: James Hogan <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 53960059d56ecef67d4ddd546731623641a3d2d1 upstream.
If there is a DMA zone (usually 24bit = 16MB I believe), but no DMA32 zone, as is the case for some 32-bit kernels, then massage_gfp_flags() will cause DMA memory allocated for devices with a 32..63-bit coherent_dma_mask to fall back to using __GFP_DMA, even though there may only be 32-bits of physical address available anyway.
Correct that case to compare against a mask the size of phys_addr_t instead of always using a 64-bit mask.
Patchwork: https://patchwork.linux-mips.org/patch/9610/
--- arch/mips/mm/dma-default.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/mm/dma-default.c +1 -1
@@ -92,7 +92,7 @@ static gfp_t massage_gfp_flags(const struct device *dev, gfp_t gfp) else#endif #if defined(CONFIG_ZONE_DMA ) && !defined(CONFIG_ZONE_DMA32 ) -if (dev->coherent_dma_mask <DMA_BIT_MASK (64 )) +if (dev->coherent_dma_mask <DMA_BIT_MASK (sizeof (phys_addr_t) *8 )) dma_flag = __GFP_DMA; else#endif
Signature · 1 line
2.6.2
PATCH 72/123 UBI: Validate data_size
In reply to Jiri SlabyFrom: Richard Weinberger <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 281fda27673f833a01d516658a64d22a32c8e072 upstream.
Make sure that data_size is less than LEB size. Otherwise a handcrafted UBI image is able to trigger an out of bounds memory access in ubi_compare_lebs().
--- drivers/mtd/ubi/io.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/mtd/ubi/io.c +5 -0
@@ -931,6 +931,11 @@ static int validate_vid_hdr(const struct ubi_device *ubi, goto bad; } +if (data_size > ubi->leb_size) { +ubi_err ("bad data_size" ); + goto bad; + } +if (vol_type ==UBI_VID_STATIC ) {/* * Although from high-level point of view static volumes may
Signature · 1 line
2.6.2
PATCH 73/123 UBI: return ENOSPC if no enough space available
In reply to Jiri SlabyFrom: shengyong <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 7c7feb2ebfc9c0552c51f0c050db1d1a004faac5 upstream.
UBI: attaching mtd1 to ubi0
UBI: scanning is finished
UBI error: init_volumes: not enough PEBs, required 706, available 686 UBI error: ubi_wl_init: no enough physical eraseblocks (-20, need 1) UBI error: ubi_attach_mtd_dev: failed to attach mtd1, error -12 <= NOT ENOMEM UBI error: ubi_init: cannot attach mtd1
If available PEBs are not enough when initializing volumes, return -ENOSPC directly. If available PEBs are not enough when initializing WL, return -ENOSPC instead of -ENOMEM.
--- drivers/mtd/ubi/vtbl.c | 1 + drivers/mtd/ubi/wl.c | 1 + 2 files changed, 2 insertions(+)
drivers/mtd/ubi/vtbl.c +1 -0
@@ -651,6 +651,7 @@ static int init_volumes(struct ubi_device *ubi,if (ubi->corr_peb_count)ubi_err ("%d PEBs are corrupted and not used" , ubi->corr_peb_count); +return -ENOSPC ; } ubi->rsvd_pebs += reserved_pebs; ubi->avail_pebs -= reserved_pebs;
drivers/mtd/ubi/wl.c +1 -0
@@ -1978,6 +1978,7 @@ int ubi_wl_init(struct ubi_device *ubi, struct ubi_attach_info *ai)if (ubi->corr_peb_count)ubi_err ("%d PEBs are corrupted and not used" , ubi->corr_peb_count); + err = -ENOSPC ; goto out_free; } ubi->avail_pebs -= reserved_pebs;
Signature · 1 line
2.6.2
PATCH 74/123 arm64: readahead: fault retry breaks mmap file read random detection
In reply to Jiri SlabyFrom: Mark Salyzyn <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 569ba74a7ba69f46ce2950bf085b37fea2408385 upstream.
This is the arm64 portion of commit 45cac65b0fcd ("readahead: fault retry breaks mmap file read random detection"), which was absent from the initial port and has since gone unnoticed. The original commit says:
Quoted 7 lines
.fault now can retry. The retry can break state machine of .fault. In
filemap_fault, if page is miss,ra->mmap_missis increased. In the second try, since the page is in page cache now,ra->mmap_missis decreased. And these are done in one fault, so we can't detect random mmap file access.Add a new flag to indicate .fault is tried once. In the second try, skip
ra->mmap_missdecreasing. Thefilemap_faultstate machine is ok with it.
With this change, Mark reports that:
Quoted 2 lines
Random read improves by 250%, sequential read improves by 40%, and random write by 400% to an eMMC device with dm crypto wrapped around it.
--- arch/arm64/mm/fault.c | 1 + 1 file changed, 1 insertion(+)
arch/arm64/mm/fault.c +1 -0
@@ -278,6 +278,7 @@ retry:* starvation. */ mm_flags &= ~FAULT_FLAG_ALLOW_RETRY ; + mm_flags |=FAULT_FLAG_TRIED ; goto retry; } }
Signature · 1 line
2.6.2
PATCH 75/123 m68k: Define asmlinkage_protect
In reply to Jiri SlabyFrom: Andreas Schwab <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 8474ba74193d302e8340dddd1e16c85cc4b98caf upstream.
Make sure the compiler does not modify arguments of syscall functions. This can happen if the compiler generates a tailcall to another function. For example, without asmlinkage_protect sys_openat is compiled into this function:
sys_openat:
clr.l %d0 move.w 18(%sp),%d0 move.l %d0,16(%sp) jbra do_sys_open
Note how the fourth argument is modified in place, modifying the register %d4 that gets restored from this stack slot when the function returns to user-space. The caller may expect the register to be unmodified across system calls.
--- arch/m68k/include/asm/linkage.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
arch/m68k/include/asm/linkage.h +30 -0
@@ -4,4 +4,34 @@#define __ALIGN .align 4#define __ALIGN_STR ".align 4" +/* +* Make sure the compiler doesn't do anything stupid with the +* arguments on the stack - they are owned by the *caller*, not +* the callee. This just fools gcc into not spilling into them, +* and keeps it from doing tailcall recursion and/or using the +* stack slots for temporaries, since they are live and "used" +* all the way to the end of the function. +*/ +#define asmlinkage_protect(n, ret, args...) \ + __asmlinkage_protect##n(ret, ##args) +#define __asmlinkage_protect_n(ret, args...) \ + __asm__ __volatile__ ("" : "=r" (ret) : "0" (ret), ##args) +#define __asmlinkage_protect0 (ret) \ + __asmlinkage_protect_n(ret) +#define __asmlinkage_protect1 (ret, arg1) \ + __asmlinkage_protect_n(ret, "m" (arg1)) +#define __asmlinkage_protect2 (ret, arg1, arg2) \ + __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2)) +#define __asmlinkage_protect3 (ret, arg1, arg2, arg3) \ + __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2), "m" (arg3)) +#define __asmlinkage_protect4 (ret, arg1, arg2, arg3, arg4) \ + __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2), "m" (arg3), \ + "m" (arg4)) +#define __asmlinkage_protect5 (ret, arg1, arg2, arg3, arg4, arg5) \ + __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2), "m" (arg3), \ + "m" (arg4), "m" (arg5)) +#define __asmlinkage_protect6 (ret, arg1, arg2, arg3, arg4, arg5, arg6) \ + __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2), "m" (arg3), \ + "m" (arg4), "m" (arg5), "m" (arg6)) +#endif
Signature · 1 line
2.6.2
PATCH 76/123 genirq: Fix race in register_irq_proc()
In reply to Jiri SlabyFrom: Ben Hutchings <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 95c2b17534654829db428f11bcf4297c059a2a7e upstream.
Per-IRQ directories in procfs are created only when a handler is first added to the irqdesc, not when the irqdesc is created. In the case of a shared IRQ, multiple tasks can race to create a directory. This race condition seems to have been present forever, but is easier to hit with async probing.
--- kernel/irq/proc.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
kernel/irq/proc.c +17 -2
@@ -12,6 +12,7 @@#include <linux/seq_file.h> #include <linux/interrupt.h> #include <linux/kernel_stat.h> +#include <linux/mutex.h> #include "internals.h"
@@ -326,18 +327,29 @@ void register_handler_proc(unsigned int irq, struct irqaction *action)void register_irq_proc (unsigned int irq,struct irq_desc *desc) { +static DEFINE_MUTEX (register_lock);char name [MAX_NAMELEN ]; -if (!root_irq_dir || (desc->irq_data.chip == &no_irq_chip) || desc->dir) +if (!root_irq_dir || (desc->irq_data.chip == &no_irq_chip))return ; +/* +* irq directories are registered only when a handler is +* added, not when the descriptor is created, so multiple +* tasks might try to register at the same time. +*/ +mutex_lock (®ister_lock); + +if (desc->dir) + goto out_unlock; +memset (name,0 ,MAX_NAMELEN );sprintf (name,"%d" , irq);/* create /proc/irq/1234 */ desc->dir =proc_mkdir (name, root_irq_dir);if (!desc->dir) -return ; + goto out_unlock;#ifdef CONFIG_SMP /* create /proc/irq/<irq>/smp_affinity */
@@ -358,6 +370,9 @@ void register_irq_proc(unsigned int irq, struct irq_desc *desc)proc_create_data ("spurious" ,0444 , desc->dir, &irq_spurious_proc_fops, (void *)(long )irq); + +out_unlock: +mutex_unlock (®ister_lock); }void unregister_irq_proc (unsigned int irq,struct irq_desc *desc)
Signature · 1 line
2.6.2
PATCH 77/123 dm cache: fix NULL pointer when switching from cleaner policy
In reply to Jiri SlabyFrom: Joe Thornber <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 2bffa1503c5c06192eb1459180fac4416575a966 upstream.
The cleaner policy doesn't make use of the per cache block hint space in the metadata (unlike the other policies). When switching from the cleaner policy to mq or smq a NULL pointer crash (in dm_tm_new_block) was observed. The crash was caused by bugs in dm-cache-metadata.c when trying to skip creation of the hint btree.
The minimal fix is to change hint size for the cleaner policy to 4 bytes (only hint size supported).
--- drivers/md/dm-cache-policy-cleaner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/dm-cache-policy-cleaner.c +1 -1
@@ -434,7 +434,7 @@ static struct dm_cache_policy *wb_create(dm_cblock_t cache_size,static struct dm_cache_policy_type wb_policy_type = { .name ="cleaner" , .version = {1 ,0 ,0 }, - .hint_size =0 , + .hint_size =4 , .owner =THIS_MODULE , .create = wb_create };
Signature · 1 line
2.6.2
PATCH 78/123 staging: speakup: fix speakup-r regression
In reply to Jiri SlabyFrom: "[email protected]" <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit b1d562acc78f0af46de0dfe447410bc40bdb7ece upstream.
Here is a patch to make speakup-r work again.
It broke in 3.6 due to commit 4369c64c79a22b98d3b7eff9d089196cd878a10a "Input: Send events one packet at a time)
The problem was that the fakekey.c routine to fake a down arrow no longer functioned properly and putting the input_sync fixed it.
--- drivers/staging/speakup/fakekey.c | 1 + 1 file changed, 1 insertion(+)
drivers/staging/speakup/fakekey.c +1 -0
@@ -81,6 +81,7 @@ void speakup_fake_down_arrow(void)__this_cpu_write (reporting_keystroke, true);input_report_key (virt_keyboard,KEY_DOWN ,PRESSED );input_report_key (virt_keyboard,KEY_DOWN ,RELEASED ); +input_sync (virt_keyboard);__this_cpu_write (reporting_keystroke, false);/* reenable preemption */
Signature · 1 line
2.6.2
PATCH 79/123 mm/slab: fix unexpected index mapping result of kmalloc_size(INDEX_NODE+1)
In reply to Jiri SlabyFrom: Joonsoo Kim <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 03a2d2a3eafe4015412cf4e9675ca0e2d9204074 upstream.
Commit description is copied from the original post of this bug:
http://comments.gmane.org/gmane.linux.kernel.mm/135349
Kernels after v3.9 use kmalloc_size(INDEX_NODE + 1) to get the next larger cache size than the size index INDEX_NODE mapping. In kernels 3.9 and earlier we used malloc_sizes[INDEX_L3 + 1].cs_size.
However, sometimes we can't get the right output we expected via kmalloc_size(INDEX_NODE + 1), causing a BUG().
The mapping table in the latest kernel is like:
index = {0, 1, 2 , 3, 4, 5, 6, n}
size = {0, 96, 192, 8, 16, 32, 64, 2^n}
The mapping table before 3.10 is like this:
index = {0 , 1 , 2, 3, 4 , 5 , 6, n}
size = {32, 64, 96, 128, 192, 256, 512, 2^(n+3)}The problem on my mips64 machine is as follows:
(1) When configured DEBUG_SLAB && DEBUG_PAGEALLOC && DEBUG_LOCK_ALLOC && DEBUG_SPINLOCK, the sizeof(struct kmem_cache_node) will be "150", and the macro INDEX_NODE turns out to be "2": #define INDEX_NODE kmalloc_index(sizeof(struct kmem_cache_node))
(2) Then the result of kmalloc_size(INDEX_NODE + 1) is 8.
(3) Then "if(size >= kmalloc_size(INDEX_NODE + 1)" will lead to "size
= PAGE_SIZE".
(4) Then "if ((size >= (PAGE_SIZE >> 3))" test will be satisfied and
"flags |= CFLGS_OFF_SLAB" will be covered.
(5) if (flags & CFLGS_OFF_SLAB)" test will be satisfied and will go to "cachep->slabp_cache = kmalloc_slab(slab_size, 0u)", and the result here may be NULL while kernel bootup.
(6) Finally,"BUG_ON(ZERO_OR_NULL_PTR(cachep->slabp_cache));" causes the BUG info as the following shows (may be only mips64 has this problem):
This patch fixes the problem of kmalloc_size(INDEX_NODE + 1) and removes the BUG by adding 'size >= 256' check to guarantee that all necessary small sized slabs are initialized regardless sequence of slab size in mapping table.
--- mm/slab.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
mm/slab.c +10 -3
@@ -2304,9 +2304,16 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags) size +=BYTES_PER_WORD ; }#if FORCED_DEBUG && defined(CONFIG_DEBUG_PAGEALLOC ) -if (size >=kmalloc_size (INDEX_NODE +1 ) - && cachep->object_size >cache_line_size () - &&ALIGN (size, cachep->align) <PAGE_SIZE ) { +/* +* To activate debug pagealloc, off-slab management is necessary +* requirement. In early phase of initialization, small sized slab +* doesn't get initialized so it would not be possible. So, we need +* to check size >= 256. It guarantees that all necessary small +* sized slab is initialized in current slab initialization sequence. +*/ +if (!slab_early_init && size >=kmalloc_size (INDEX_NODE ) && + size >=256 && cachep->object_size >cache_line_size () && +ALIGN (size, cachep->align) <PAGE_SIZE ) { cachep->obj_offset +=PAGE_SIZE -ALIGN (size, cachep->align); size =PAGE_SIZE ; }
Signature · 1 line
2.6.2
PATCH 80/123 3w-9xxx: don't unmap bounce buffered commands
In reply to Jiri SlabyFrom: Christoph Hellwig <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 15e3d5a285ab9283136dba34bbf72886d9146706 upstream.
3w controller don't dma map small single SGL entry commands but instead bounce buffer them. Add a helper to identify these commands and don't call scsi_dma_unmap for them.
Based on an earlier patch from James Bottomley.
--- drivers/scsi/3w-9xxx.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-)
drivers/scsi/3w-9xxx.c +21 -7
@@ -225,6 +225,17 @@ static const struct file_operations twa_fops = { .llseek = noop_llseek, }; +/* +* The controllers use an inline buffer instead of a mapped SGL for small, +* single entry buffers. Note that we treat a zero-length transfer like +* a mapped SGL. +*/ +static bool twa_command_mapped (struct scsi_cmnd *cmd) +{ +return scsi_sg_count (cmd) !=1 || +scsi_bufflen (cmd) >=TW_MIN_SGL_LENGTH ; +} +/* This function will complete an aen request from the isr */ static int twa_aen_complete (TW_Device_Extension *tw_dev,int request_id) {
@@ -1351,7 +1362,8 @@ static irqreturn_t twa_interrupt(int irq, void *dev_instance) }/* Now complete the io */ -scsi_dma_unmap (cmd); +if (twa_command_mapped (cmd)) +scsi_dma_unmap (cmd); cmd->scsi_done (cmd); tw_dev->state[request_id] =TW_S_COMPLETED ;twa_free_request_id (tw_dev, request_id);
@@ -1594,7 +1606,8 @@ static int twa_reset_device_extension(TW_Device_Extension *tw_dev)struct scsi_cmnd *cmd = tw_dev->srb[i]; cmd->result = (DID_RESET <<16 ); -scsi_dma_unmap (cmd); +if (twa_command_mapped (cmd)) +scsi_dma_unmap (cmd); cmd->scsi_done (cmd); } }
@@ -1777,12 +1790,14 @@ static int twa_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_ retval =twa_scsiop_execute_scsi (tw_dev, request_id,NULL ,0 ,NULL );switch (retval) {case SCSI_MLQUEUE_HOST_BUSY : -scsi_dma_unmap (SCpnt); +if (twa_command_mapped (SCpnt)) +scsi_dma_unmap (SCpnt);twa_free_request_id (tw_dev, request_id);break ;case 1 : SCpnt->result = (DID_ERROR <<16 ); -scsi_dma_unmap (SCpnt); +if (twa_command_mapped (SCpnt)) +scsi_dma_unmap (SCpnt);done (SCpnt); tw_dev->state[request_id] =TW_S_COMPLETED ;twa_free_request_id (tw_dev, request_id);
@@ -1843,8 +1858,7 @@ static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id,/* Map sglist from scsi layer to cmd packet */ if (scsi_sg_count (srb)) { -if ((scsi_sg_count (srb) ==1 ) && - (scsi_bufflen (srb) <TW_MIN_SGL_LENGTH )) { +if (!twa_command_mapped (srb)) {if (srb->sc_data_direction ==DMA_TO_DEVICE || srb->sc_data_direction ==DMA_BIDIRECTIONAL ) scsi_sg_copy_to_buffer(srb,
@@ -1917,7 +1931,7 @@ static void twa_scsiop_execute_scsi_complete(TW_Device_Extension *tw_dev, int re {struct scsi_cmnd *cmd = tw_dev->srb[request_id]; -if (scsi_bufflen (cmd) <TW_MIN_SGL_LENGTH && +if (!twa_command_mapped (cmd) && (cmd->sc_data_direction ==DMA_FROM_DEVICE || cmd->sc_data_direction ==DMA_BIDIRECTIONAL )) {if (scsi_sg_count (cmd) ==1 ) {
Signature · 1 line
2.6.2
PATCH 81/123 l2tp: protect tunnel->del_work by ref_count
In reply to Jiri SlabyFrom: Alexander Couzens <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit 06a15f51cf3618e32a73871ee6a547ef7fd902b5 ]
There is a small chance that tunnel_free() is called before tunnel->del_work scheduled resulting in a zero pointer dereference.
--- net/l2tp/l2tp_core.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
net/l2tp/l2tp_core.c +9 -2
@@ -1438,7 +1438,7 @@ static void l2tp_tunnel_del_work(struct work_struct *work) tunnel = container_of(work, struct l2tp_tunnel, del_work); sk =l2tp_tunnel_sock_lookup (tunnel);if (!sk) -return ; + goto out; sock = sk->sk_socket;
@@ -1459,6 +1459,8 @@ static void l2tp_tunnel_del_work(struct work_struct *work) }l2tp_tunnel_sock_put (sk); +out: +l2tp_tunnel_dec_refcount (tunnel); }/* Create a socket for the tunnel, if one isn't set up by
@@ -1788,8 +1790,13 @@ EXPORT_SYMBOL_GPL(l2tp_tunnel_create);*/ int l2tp_tunnel_delete (struct l2tp_tunnel *tunnel) { +l2tp_tunnel_inc_refcount (tunnel);l2tp_tunnel_closeall (tunnel); -return (false ==queue_work (l2tp_wq, &tunnel->del_work)); +if (false ==queue_work (l2tp_wq, &tunnel->del_work)) { +l2tp_tunnel_dec_refcount (tunnel); +return 1 ; + } +return 0 ; }EXPORT_SYMBOL_GPL (l2tp_tunnel_delete);
Signature · 1 line
2.6.2
PATCH 82/123 af_unix: Convert the unix_sk macro to an inline function for type safety
In reply to Jiri SlabyFrom: Aaron Conole <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit 4613012db1d911f80897f9446a49de817b2c4c47 ]
As suggested by Eric Dumazet this change replaces the #define with a static inline function to enjoy complaints by the compiler when misusing the API.
--- include/net/af_unix.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
include/net/af_unix.h +5 -1
@@ -64,7 +64,11 @@ struct unix_sock {#define UNIX_GC_MAYBE_CYCLE 1struct socket_wq peer_wq; }; -#define unix_sk (__sk) ((struct unix_sock *)__sk) + +static inline struct unix_sock *unix_sk (struct sock *sk) +{ +return (struct unix_sock *)sk; +}#define peer_wait peer_wq.wait
Signature · 1 line
2.6.2
PATCH 83/123 af_unix: return data from multiple SKBs on recv() with MSG_PEEK flag
In reply to Jiri SlabyFrom: Aaron Conole <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit 9f389e35674f5b086edd70ed524ca0f287259725 ]
AF_UNIX sockets now return multiple skbs from recv() when MSG_PEEK flag is set.
This is referenced in kernel bugzilla #12323 @
https://bugzilla.kernel.org/show_bug.cgi?id=12323
As described both in the BZ and lkml thread @
http://lkml.org/lkml/2008/1/8/444 calling recv() with MSG_PEEK on an AF_UNIX socket only reads a single skb, where the desired effect is to return as much skb data has been queued, until hitting the recv buffer size (whichever comes first).
The modified MSG_PEEK path will now move to the next skb in the tree and jump to the again: label, rather than following the natural loop structure. This requires duplicating some of the loop head actions.
This was tested using the python socketpair python code attached to the bugzilla issue.
--- net/unix/af_unix.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
net/unix/af_unix.c +13 -1
@@ -2062,8 +2062,20 @@ again:if (UNIXCB (skb).fp) siocb->scm->fp =scm_fp_dup (UNIXCB (skb).fp); -sk_peek_offset_fwd (sk, chunk); +if (skip) { +sk_peek_offset_fwd (sk, chunk); + skip -= chunk; + } + +if (UNIXCB (skb).fp) +break ; + last = skb; +unix_state_lock (sk); + skb =skb_peek_next (skb, &sk->sk_receive_queue); +if (skb) + goto again; +unix_state_unlock (sk);break ; } }while (size);
Signature · 1 line
2.6.2
PATCH 84/123 net/unix: fix logic about sk_peek_offset
In reply to Jiri SlabyFrom: Andrey Vagin <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit e9193d60d363e4dff75ff6d43a48f22be26d59c7 ]
Now send with MSG_PEEK can return data from multiple SKBs.
Unfortunately we take into account the peek offset for each skb, that is wrong. We need to apply the peek offset only once.
In addition, the peek offset should be used only if MSG_PEEK is set.
--- net/unix/af_unix.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
net/unix/af_unix.c +7 -5
@@ -1954,6 +1954,11 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, goto out; } +if (flags &MSG_PEEK ) + skip =sk_peek_offset (sk, flags); +else + skip =0 ; + do { int chunk; struct sk_buff *skb, *last;
@@ -2000,7 +2005,6 @@ again:break ; } - skip =sk_peek_offset (sk, flags);while (skip >=unix_skb_len (skb)) { skip -=unix_skb_len (skb); last = skb;
@@ -2062,14 +2066,12 @@ again:if (UNIXCB (skb).fp) siocb->scm->fp =scm_fp_dup (UNIXCB (skb).fp); -if (skip) { -sk_peek_offset_fwd (sk, chunk); - skip -= chunk; - } +sk_peek_offset_fwd (sk, chunk);if (UNIXCB (skb).fp)break ; + skip =0 ; last = skb;unix_state_lock (sk); skb =skb_peek_next (skb, &sk->sk_receive_queue);
Signature · 1 line
2.6.2
PATCH 85/123 skbuff: Fix skb checksum flag on skb pull
In reply to Jiri SlabyFrom: Pravin B Shelar <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit 6ae459bdaaeebc632b16e54dcbabb490c6931d61 ]
VXLAN device can receive skb with checksum partial. But the checksum offset could be in outer header which is pulled on receive. This results in negative checksum offset for the skb. Such skb can cause the assert failure in skb_checksum_help(). Following patch fixes the bug by setting checksum-none while pulling outer header.
Following is the kernel panic msg from old kernel hitting the bug.
------------[ cut here ]------------ kernel BUG at net/core/dev.c:1906! RIP: 0010:[<ffffffff81518034>] skb_checksum_help+0x144/0x150 Call Trace: <IRQ> [<ffffffffa0164c28>] queue_userspace_packet+0x408/0x470 [openvswitch] [<ffffffffa016614d>] ovs_dp_upcall+0x5d/0x60 [openvswitch] [<ffffffffa0166236>] ovs_dp_process_packet_with_key+0xe6/0x100 [openvswitch] [<ffffffffa016629b>] ovs_dp_process_received_packet+0x4b/0x80 [openvswitch] [<ffffffffa016c51a>] ovs_vport_receive+0x2a/0x30 [openvswitch] [<ffffffffa0171383>] vxlan_rcv+0x53/0x60 [openvswitch] [<ffffffffa01734cb>] vxlan_udp_encap_recv+0x8b/0xf0 [openvswitch] [<ffffffff8157addc>] udp_queue_rcv_skb+0x2dc/0x3b0 [<ffffffff8157b56f>] __udp4_lib_rcv+0x1cf/0x6c0 [<ffffffff8157ba7a>] udp_rcv+0x1a/0x20 [<ffffffff8154fdbd>] ip_local_deliver_finish+0xdd/0x280 [<ffffffff81550128>] ip_local_deliver+0x88/0x90 [<ffffffff8154fa7d>] ip_rcv_finish+0x10d/0x370 [<ffffffff81550365>] ip_rcv+0x235/0x300 [<ffffffff8151ba1d>] __netif_receive_skb+0x55d/0x620 [<ffffffff8151c360>] netif_receive_skb+0x80/0x90 [<ffffffff81459935>] virtnet_poll+0x555/0x6f0 [<ffffffff8151cd04>] net_rx_action+0x134/0x290 [<ffffffff810683d8>] __do_softirq+0xa8/0x210 [<ffffffff8162fe6c>] call_softirq+0x1c/0x30 [<ffffffff810161a5>] do_softirq+0x65/0xa0 [<ffffffff810687be>] irq_exit+0x8e/0xb0 [<ffffffff81630733>] do_IRQ+0x63/0xe0 [<ffffffff81625f2e>] common_interrupt+0x6e/0x6e
--- include/linux/skbuff.h | 3 +++ 1 file changed, 3 insertions(+)
include/linux/skbuff.h +3 -0
@@ -2264,6 +2264,9 @@ static inline void skb_postpull_rcsum(struct sk_buff *skb, {if (skb->ip_summed ==CHECKSUM_COMPLETE ) skb->csum =csum_sub (skb->csum,csum_partial (start, len,0 )); +else if (skb->ip_summed ==CHECKSUM_PARTIAL && +skb_checksum_start_offset (skb) <= len) + skb->ip_summed =CHECKSUM_NONE ; }unsigned char *skb_pull_rcsum (struct sk_buff *skb,unsigned int len);
Signature · 1 line
2.6.2
PATCH 86/123 skbuff: Fix skb checksum partial check.
In reply to Jiri SlabyFrom: Pravin B Shelar <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit 31b33dfb0a144469dd805514c9e63f4993729a48 ]
Earlier patch 6ae459bda tried to detect void ckecksum partial skb by comparing pull length to checksum offset. But it does not work for all cases since checksum-offset depends on updates to skb->data.
Following patch fixes it by validating checksum start offset after skb-data pointer is updated. Negative value of checksum offset start means there is no need to checksum.
--- include/linux/skbuff.h | 2 +- net/core/skbuff.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-)
include/linux/skbuff.h +1 -1
@@ -2265,7 +2265,7 @@ static inline void skb_postpull_rcsum(struct sk_buff *skb,if (skb->ip_summed ==CHECKSUM_COMPLETE ) skb->csum =csum_sub (skb->csum,csum_partial (start, len,0 ));else if (skb->ip_summed ==CHECKSUM_PARTIAL && -skb_checksum_start_offset (skb) <= len) +skb_checksum_start_offset (skb) <0 ) skb->ip_summed =CHECKSUM_NONE ; }
net/core/skbuff.c +5 -4
@@ -2726,11 +2726,12 @@ EXPORT_SYMBOL(skb_append_datato_frags);*/ unsigned char *skb_pull_rcsum (struct sk_buff *skb,unsigned int len) { +unsigned char *data = skb->data; +BUG_ON (len > skb->len); - skb->len -= len; -BUG_ON (skb->len < skb->data_len); -skb_postpull_rcsum (skb, skb->data, len); -return skb->data += len; +__skb_pull (skb, len); +skb_postpull_rcsum (skb, data, len); +return skb->data; }EXPORT_SYMBOL_GPL (skb_pull_rcsum);
Signature · 1 line
2.6.2
PATCH 87/123 net: add pfmemalloc check in sk_add_backlog()
In reply to Jiri SlabyFrom: Eric Dumazet <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit c7c49b8fde26b74277188bdc6c9dca38db6fa35b ]
Greg reported crashes hitting the following check in __sk_backlog_rcv()
BUG_ON(!sock_flag(sk, SOCK_MEMALLOC));
The pfmemalloc bit is currently checked in sk_filter().
This works correctly for TCP, because sk_filter() is ran in tcp_v[46]_rcv() before hitting the prequeue or backlog checks.
For UDP or other protocols, this does not work, because the sk_filter() is ran from sock_queue_rcv_skb(), which might be called _after_ backlog queuing if socket is owned by user by the time packet is processed by softirq handler.
--- include/net/sock.h | 8 ++++++++ 1 file changed, 8 insertions(+)
include/net/sock.h +8 -0
@@ -788,6 +788,14 @@ static inline __must_check int sk_add_backlog(struct sock *sk, struct sk_buff *sif (sk_rcvqueues_full (sk, skb, limit))return -ENOBUFS ; +/* +* If the skb was allocated from pfmemalloc reserves, only +* allow SOCK_MEMALLOC sockets to use it as this socket is +* helping free memory +*/ +if (skb_pfmemalloc (skb) && !sock_flag (sk,SOCK_MEMALLOC )) +return -ENOMEM ; +__sk_add_backlog (sk, skb); sk->sk_backlog.len += skb->truesize;return 0 ;
Signature · 1 line
2.6.2
PATCH 88/123 ppp: don't override sk->sk_state in pppoe_flush_dev()
In reply to Jiri SlabyFrom: Guillaume Nault <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit e6740165b8f7f06d8caee0fceab3fb9d790a6fed ]
Since commit 2b018d57ff18 ("pppoe: drop PPPOX_ZOMBIEs in pppoe_release"), pppoe_release() calls dev_put(po->pppoe_dev) if sk is in the PPPOX_ZOMBIE state. But pppoe_flush_dev() can set sk->sk_state to PPPOX_ZOMBIE _and_ reset po->pppoe_dev to NULL. This leads to the following oops:
[ 570.140800] BUG: unable to handle kernel NULL pointer dereference at 00000000000004e0 [ 570.142931] IP: [<ffffffffa018c701>] pppoe_release+0x50/0x101 [pppoe] [ 570.144601] PGD 3d119067 PUD 3dbc1067 PMD 0 [ 570.144601] Oops: 0000 [#1] SMP [ 570.144601] Modules linked in: l2tp_ppp l2tp_netlink l2tp_core ip6_udp_tunnel udp_tunnel pppoe pppox ppp_generic slhc loop crc32c_intel ghash_clmulni_intel jitterentropy_rng sha256_generic hmac drbg ansi_cprng aesni_intel aes_x86_64 ablk_helper cryptd lrw gf128mul glue_helper acpi_cpufreq evdev serio_raw processor button ext4 crc16 mbcache jbd2 virtio_net virtio_blk virtio_pci virtio_ring virtio [ 570.144601] CPU: 1 PID: 15738 Comm: ppp-apitest Not tainted 4.2.0 #1 [ 570.144601] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Debian-1.8.2-1 04/01/2014 [ 570.144601] task: ffff88003d30d600 ti: ffff880036b60000 task.ti: ffff880036b60000 [ 570.144601] RIP: 0010:[<ffffffffa018c701>] [<ffffffffa018c701>] pppoe_release+0x50/0x101 [pppoe] [ 570.144601] RSP: 0018:ffff880036b63e08 EFLAGS: 00010202 [ 570.144601] RAX: 0000000000000000 RBX: ffff880034340000 RCX: 0000000000000206 [ 570.144601] RDX: 0000000000000006 RSI: ffff88003d30dd20 RDI: ffff88003d30dd20 [ 570.144601] RBP: ffff880036b63e28 R08: 0000000000000001 R09: 0000000000000000 [ 570.144601] R10: 00007ffee9b50420 R11: ffff880034340078 R12: ffff8800387ec780 [ 570.144601] R13: ffff8800387ec7b0 R14: ffff88003e222aa0 R15: ffff8800387ec7b0 [ 570.144601] FS: 00007f5672f48700(0000) GS:ffff88003fc80000(0000) knlGS:0000000000000000 [ 570.144601] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 570.144601] CR2: 00000000000004e0 CR3: 0000000037f7e000 CR4: 00000000000406a0 [ 570.144601] Stack: [ 570.144601] ffffffffa018f240 ffff8800387ec780 ffffffffa018f240 ffff8800387ec7b0 [ 570.144601] ffff880036b63e48 ffffffff812caabe ffff880039e4e000 0000000000000008 [ 570.144601] ffff880036b63e58 ffffffff812cabad ffff880036b63ea8 ffffffff811347f5 [ 570.144601] Call Trace: [ 570.144601] [<ffffffff812caabe>] sock_release+0x1a/0x75 [ 570.144601] [<ffffffff812cabad>] sock_close+0xd/0x11 [ 570.144601] [<ffffffff811347f5>] __fput+0xff/0x1a5 [ 570.144601] [<ffffffff811348cb>] ____fput+0x9/0xb [ 570.144601] [<ffffffff81056682>] task_work_run+0x66/0x90 [ 570.144601] [<ffffffff8100189e>] prepare_exit_to_usermode+0x8c/0xa7 [ 570.144601] [<ffffffff81001a26>] syscall_return_slowpath+0x16d/0x19b [ 570.144601] [<ffffffff813babb1>] int_ret_from_sys_call+0x25/0x9f [ 570.144601] Code: 48 8b 83 c8 01 00 00 a8 01 74 12 48 89 df e8 8b 27 14 e1 b8 f7 ff ff ff e9 b7 00 00 00 8a 43 12 a8 0b 74 1c 48 8b 83 a8 04 00 00 <48> 8b 80 e0 04 00 00 65 ff 08 48 c7 83 a8 04 00 00 00 00 00 00 [ 570.144601] RIP [<ffffffffa018c701>] pppoe_release+0x50/0x101 [pppoe] [ 570.144601] RSP <ffff880036b63e08> [ 570.144601] CR2: 00000000000004e0 [ 570.200518] ---[ end trace 46956baf17349563 ]---
pppoe_flush_dev() has no reason to override sk->sk_state with PPPOX_ZOMBIE. pppox_unbind_sock() already sets sk->sk_state to PPPOX_DEAD, which is the correct state given that sk is unbound and po->pppoe_dev is NULL.
--- drivers/net/ppp/pppoe.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/ppp/pppoe.c +0 -1
@@ -313,7 +313,6 @@ static void pppoe_flush_dev(struct net_device *dev)if (po->pppoe_dev == dev && sk->sk_state & (PPPOX_CONNECTED |PPPOX_BOUND |PPPOX_ZOMBIE )) {pppox_unbind_sock (sk); - sk->sk_state =PPPOX_ZOMBIE ; sk->sk_state_change (sk); po->pppoe_dev =NULL ;dev_put (dev);
Signature · 1 line
2.6.2
PATCH 89/123 ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings
In reply to Jiri SlabyFrom: Joe Perches <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit 077cb37fcf6f00a45f375161200b5ee0cd4e937b ]
It seems that kernel memory can leak into userspace by a kmalloc, ethtool_get_strings, then copy_to_user sequence.
Avoid this by using kcalloc to zero fill the copied buffer.
--- net/core/ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/ethtool.c +1 -1
@@ -1077,7 +1077,7 @@ static int ethtool_get_strings(struct net_device *dev, void __user *useraddr) gstrings.len = ret; - data =kmalloc (gstrings.len *ETH_GSTRING_LEN ,GFP_USER ); + data =kcalloc (gstrings.len,ETH_GSTRING_LEN ,GFP_USER );if (!data)return -ENOMEM ;
Signature · 1 line
2.6.2
PATCH 90/123 asix: Don't reset PHY on if_up for ASIX 88772
In reply to Jiri SlabyFrom: Michel Stam <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit 3cc81d85ee01e5a0b7ea2f4190e2ed1165f53c31 ]
I've noticed every time the interface is set to 'up,', the kernel reports that the link speed is set to 100 Mbps/Full Duplex, even when ethtool is used to set autonegotiation to 'off', half duplex, 10 Mbps.
It can be tested by:
ifconfig eth0 down
ethtool -s eth0 autoneg off speed 10 duplex half ifconfig eth0 up
Then checking 'dmesg' for the link speed.
--- drivers/net/usb/asix_devices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/usb/asix_devices.c +1 -1
@@ -891,7 +891,7 @@ static const struct driver_info ax88772_info = { .unbind = ax88772_unbind, .status = asix_status, .link_reset = ax88772_link_reset, - .reset = ax88772_reset, + .reset = ax88772_link_reset, .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_LINK_INTR | FLAG_MULTI_PACKET, .rx_fixup = asix_rx_fixup_common, .tx_fixup = asix_tx_fixup,
Signature · 1 line
2.6.2
PATCH 91/123 asix: Do full reset during ax88772_bind
In reply to Jiri SlabyFrom: Charles Keepax <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit 436c2a5036b6ffe813310df2cf327d3b69be0734 ]
commit 3cc81d85ee01 ("asix: Don't reset PHY on if_up for ASIX 88772") causes the ethernet on Arndale to no longer function. This appears to be because the Arndale ethernet requires a full reset before it will function correctly, however simply reverting the above patch causes problems with ethtool settings getting reset.
It seems the problem is that the ethernet is not properly reset during bind, and indeed the code in ax88772_bind that resets the device is a very small subset of the actual ax88772_reset function. This patch uses ax88772_reset in place of the existing reset code in ax88772_bind which removes some code duplication and fixes the ethernet on Arndale.
It is still possible that the original patch causes some issues with suspend and resume but that seems like a separate issue and I haven't had a chance to test that yet.
--- drivers/net/usb/asix_devices.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-)
drivers/net/usb/asix_devices.c +1 -13
@@ -466,19 +466,7 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)return ret; } - ret =asix_sw_reset (dev,AX_SWRESET_IPPD |AX_SWRESET_PRL ); -if (ret <0 ) -return ret; - -msleep (150 ); - - ret =asix_sw_reset (dev,AX_SWRESET_CLEAR ); -if (ret <0 ) -return ret; - -msleep (150 ); - - ret =asix_sw_reset (dev, embd_phy ?AX_SWRESET_IPRL :AX_SWRESET_PRTE ); +ax88772_reset (dev);/* Read PHYID register *AFTER* the PHY was reset properly */ phyid =asix_get_phyid (dev);
Signature · 1 line
2.6.2
PATCH 92/123 crypto: sparc - initialize blkcipher.ivsize
In reply to Jiri SlabyFrom: Dave Kleikamp <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit a66d7f724a96d6fd279bfbd2ee488def6b081bea upstream.
Some of the crypto algorithms write to the initialization vector, but no space has been allocated for it. This clobbers adjacent memory.
--- arch/sparc/crypto/aes_glue.c | 2 ++ arch/sparc/crypto/camellia_glue.c | 1 + arch/sparc/crypto/des_glue.c | 2 ++ 3 files changed, 5 insertions(+)
arch/sparc/crypto/aes_glue.c +2 -0
@@ -433,6 +433,7 @@ static struct crypto_alg algs[] = { { .blkcipher = { .min_keysize = AES_MIN_KEY_SIZE, .max_keysize = AES_MAX_KEY_SIZE, + .ivsize = AES_BLOCK_SIZE, .setkey = aes_set_key, .encrypt = cbc_encrypt, .decrypt = cbc_decrypt,
@@ -452,6 +453,7 @@ static struct crypto_alg algs[] = { { .blkcipher = { .min_keysize = AES_MIN_KEY_SIZE, .max_keysize = AES_MAX_KEY_SIZE, + .ivsize = AES_BLOCK_SIZE, .setkey = aes_set_key, .encrypt = ctr_crypt, .decrypt = ctr_crypt,
arch/sparc/crypto/camellia_glue.c +1 -0
@@ -274,6 +274,7 @@ static struct crypto_alg algs[] = { { .blkcipher = { .min_keysize = CAMELLIA_MIN_KEY_SIZE, .max_keysize = CAMELLIA_MAX_KEY_SIZE, + .ivsize = CAMELLIA_BLOCK_SIZE, .setkey = camellia_set_key, .encrypt = cbc_encrypt, .decrypt = cbc_decrypt,
arch/sparc/crypto/des_glue.c +2 -0
@@ -429,6 +429,7 @@ static struct crypto_alg algs[] = { { .blkcipher = { .min_keysize = DES_KEY_SIZE, .max_keysize = DES_KEY_SIZE, + .ivsize = DES_BLOCK_SIZE, .setkey = des_set_key, .encrypt = cbc_encrypt, .decrypt = cbc_decrypt,
@@ -485,6 +486,7 @@ static struct crypto_alg algs[] = { { .blkcipher = { .min_keysize = DES3_EDE_KEY_SIZE, .max_keysize = DES3_EDE_KEY_SIZE, + .ivsize = DES3_EDE_BLOCK_SIZE, .setkey = des3_ede_set_key, .encrypt = cbc3_encrypt, .decrypt = cbc3_decrypt,
Signature · 1 line
2.6.2
PATCH 93/123 crypto: ahash - ensure statesize is non-zero
In reply to Jiri SlabyFrom: Russell King <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 8996eafdcbad149ac0f772fb1649fbb75c482a6a upstream.
Unlike shash algorithms, ahash drivers must implement export and import as their descriptors may contain hardware state and cannot be exported as is. Unfortunately some ahash drivers did not provide them and end up causing crashes with algif_hash.
This patch adds a check to prevent these drivers from registering ahash algorithms until they are fixed.
--- crypto/ahash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
crypto/ahash.c +2 -1
@@ -462,7 +462,8 @@ static int ahash_prepare_alg(struct ahash_alg *alg)struct crypto_alg *base = &alg->halg.base;if (alg->halg.digestsize >PAGE_SIZE /8 || - alg->halg.statesize >PAGE_SIZE /8 ) + alg->halg.statesize >PAGE_SIZE /8 || + alg->halg.statesize ==0 )return -EINVAL ; base->cra_type = &crypto_ahash_type;
Signature · 1 line
2.6.2
PATCH 94/123 btrfs: fix use after free iterating extrefs
In reply to Jiri SlabyFrom: Chris Mason <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit dc6c5fb3b514221f2e9d21ee626a9d95d3418dff upstream.
The code for btrfs inode-resolve has never worked properly for files with enough hard links to trigger extrefs. It was trying to get the leaf out of a path after freeing the path:
btrfs_release_path(path); leaf = path->nodes[0]; item_size = btrfs_item_size_nr(leaf, slot);
The fix here is to use the extent buffer we cloned just a little higher up to avoid deadlocks caused by using the leaf in the path.
--- fs/btrfs/backref.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
fs/btrfs/backref.c +3 -5
@@ -1668,7 +1668,6 @@ static int iterate_inode_extrefs(u64 inum, struct btrfs_root *fs_root,int found =0 ;struct extent_buffer *eb;struct btrfs_inode_extref *extref; -struct extent_buffer *leaf;u32 item_size;u32 cur_offset;unsigned long ptr;
@@ -1693,9 +1692,8 @@ static int iterate_inode_extrefs(u64 inum, struct btrfs_root *fs_root,btrfs_set_lock_blocking_rw (eb,BTRFS_READ_LOCK );btrfs_release_path (path); - leaf = path->nodes[0 ]; - item_size =btrfs_item_size_nr (leaf, path->slots[0 ]); - ptr =btrfs_item_ptr_offset (leaf, path->slots[0 ]); + item_size =btrfs_item_size_nr (eb, path->slots[0 ]); + ptr =btrfs_item_ptr_offset (eb, path->slots[0 ]); cur_offset =0 ;while (cur_offset < item_size) {
@@ -1709,7 +1707,7 @@ static int iterate_inode_extrefs(u64 inum, struct btrfs_root *fs_root,if (ret)break ; - cur_offset +=btrfs_inode_extref_name_len (leaf, extref); + cur_offset +=btrfs_inode_extref_name_len (eb, extref); cur_offset +=sizeof (*extref); }btrfs_tree_read_unlock_blocking (eb);
Signature · 1 line
2.6.2
PATCH 95/123 arm64: errata: use KBUILD_CFLAGS_MODULE for erratum #843419
In reply to Jiri SlabyFrom: Will Deacon <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit b6dd8e0719c0d2d01429639a11b7bc2677de240c upstream.
Commit df057cc7b4fa ("arm64: errata: add module build workaround for erratum #843419") sets CFLAGS_MODULE to ensure that the large memory model is used by the compiler when building kernel modules.
However, CFLAGS_MODULE is an environment variable and intended to be overridden on the command line, which appears to be the case with the Ubuntu kernel packaging system, so use KBUILD_CFLAGS_MODULE instead.
--- arch/arm64/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/Makefile +1 -1
@@ -29,7 +29,7 @@ comma = , CHECKFLAGS += -D__aarch64__ ifeq ($(CONFIG_ARM64_ERRATUM_843419), y) -CFLAGS_MODULE += -mcmodel=large +KBUILD_CFLAGS_MODULE += -mcmodel=large endif # Default value
Signature · 1 line
2.6.2
PATCH 96/123 i2c: rcar: enable RuntimePM before registering to the core
In reply to Jiri SlabyFrom: Wolfram Sang <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 4f7effddf4549d57114289f273710f077c4c330a upstream.
The core may register clients attached to this master which may use funtionality from the master. So, RuntimePM must be enabled before, otherwise this will fail. While here, move drvdata, too.
--- drivers/i2c/busses/i2c-rcar.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/i2c/busses/i2c-rcar.c +4 -3
@@ -690,15 +690,16 @@ static int rcar_i2c_probe(struct platform_device *pdev)return ret; } +pm_runtime_enable (dev); +platform_set_drvdata (pdev, priv); + ret =i2c_add_numbered_adapter (adap);if (ret <0 ) {dev_err (dev,"reg adap failed: %d\n" , ret); +pm_runtime_disable (dev);return ret; } -pm_runtime_enable (dev); -platform_set_drvdata (pdev, priv); -dev_info (dev,"probed\n" );return 0 ;
Signature · 1 line
2.6.2
PATCH 97/123 i2c: s3c2410: enable RuntimePM before registering to the core
In reply to Jiri SlabyFrom: Wolfram Sang <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit eadd709f5d2e8aebb1b7bf49460e97a68d81a9b0 upstream.
The core may register clients attached to this master which may use funtionality from the master. So, RuntimePM must be enabled before, otherwise this will fail. While here, move drvdata, too.
--- drivers/i2c/busses/i2c-s3c2410.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/i2c/busses/i2c-s3c2410.c +5 -3
@@ -1151,17 +1151,19 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) i2c->adap.nr = i2c->pdata->bus_num; i2c->adap.dev.of_node = pdev->dev.of_node; +platform_set_drvdata (pdev, i2c); + +pm_runtime_enable (&pdev->dev); + ret =i2c_add_numbered_adapter (&i2c->adap);if (ret <0 ) {dev_err (&pdev->dev,"failed to add bus to i2c core\n" ); +pm_runtime_disable (&pdev->dev);s3c24xx_i2c_deregister_cpufreq (i2c);clk_unprepare (i2c->clk);return ret; } -platform_set_drvdata (pdev, i2c); - -pm_runtime_enable (&pdev->dev);pm_runtime_enable (&i2c->adap.dev);dev_info (&pdev->dev,"%s: S3C I2C adapter\n" ,dev_name (&i2c->adap.dev));
Signature · 1 line
2.6.2
PATCH 98/123 i2c: designware: Do not use parameters from ACPI on Dell Inspiron 7348
In reply to Jiri SlabyFrom: Mika Westerberg <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 56d4b8a24cef5d66f0d10ac778a520d3c2c68a48 upstream.
ACPI SSCN/FMCN methods were originally added because then the platform can provide the most accurate HCNT/LCNT values to the driver. However, this seems not to be true for Dell Inspiron 7348 where using these causes the touchpad to fail in boot:
i2c_hid i2c-DLL0675:00: failed to retrieve report from device. i2c_designware INT3433:00: i2c_dw_handle_tx_abort: lost arbitration i2c_hid i2c-DLL0675:00: failed to retrieve report from device. i2c_designware INT3433:00: controller timed out
The values received from ACPI are (in fast mode):
HCNT: 72
LCNT: 160
this translates to following timings (input clock is 100MHz on Broadwell):
tHIGH: 720 ns (spec min 600 ns)
tLOW: 1600 ns (spec min 1300 ns)
Bus period: 2920 ns (assuming 300 ns tf and tr)
Bus speed: 342.5 kHz
Both tHIGH and tLOW are within the I2C specification.
The calculated values when ACPI parameters are not used are (in fast mode):
HCNT: 87
LCNT: 159
which translates to:
tHIGH: 870 ns (spec min 600 ns)
tLOW: 1590 ns (spec min 1300 ns)
Bus period 3060 ns (assuming 300 ns tf and tr)
Bus speed 326.8 kHz
These values are also within the I2C specification.
Since both ACPI and calculated values meet the I2C specification timing requirements it is hard to say why the touchpad does not function properly with the ACPI values except that the bus speed is higher in this case (but still well below the max 400kHz).
Solve this by adding DMI quirk to the driver that disables using ACPI parameters on this particulare machine.
--- drivers/i2c/busses/i2c-designware-platdrv.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
drivers/i2c/busses/i2c-designware-platdrv.c +20 -0
@@ -28,6 +28,7 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/delay.h> +#include <linux/dmi.h> #include <linux/i2c.h> #include <linux/clk.h> #include <linux/errno.h>
@@ -53,6 +54,22 @@ static u32 i2c_dw_get_clk_rate_khz(struct dw_i2c_dev *dev) }#ifdef CONFIG_ACPI +/* +* The HCNT/LCNT information coming from ACPI should be the most accurate +* for given platform. However, some systems get it wrong. On such systems +* we get better results by calculating those based on the input clock. +*/ +static const struct dmi_system_id dw_i2c_no_acpi_params[] = { + { + .ident ="Dell Inspiron 7348" , + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), +DMI_MATCH (DMI_PRODUCT_NAME ,"Inspiron 7348" ), + }, + }, + { } +}; +static void dw_i2c_acpi_params (struct platform_device *pdev,char method[],u16 *hcnt,u16 *lcnt,u32 *sda_hold) {
@@ -60,6 +77,9 @@ static void dw_i2c_acpi_params(struct platform_device *pdev, char method[],acpi_handle handle =ACPI_HANDLE (&pdev->dev);union acpi_object *obj; +if (dmi_check_system (dw_i2c_no_acpi_params)) +return ; +if (ACPI_FAILURE (acpi_evaluate_object (handle, method,NULL , &buf)))return ;
Signature · 1 line
2.6.2
PATCH 99/123 workqueue: make sure delayed work run in local cpu
In reply to Jiri SlabyFrom: Shaohua Li <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 874bbfe600a660cba9c776b3957b1ce393151b76 upstream.
My system keeps crashing with below message. vmstat_update() schedules a delayed work in current cpu and expects the work runs in the cpu. schedule_delayed_work() is expected to make delayed work run in local cpu. The problem is timer can be migrated with NO_HZ. __queue_work() queues work in timer handler, which could run in a different cpu other than where the delayed work is scheduled. The end result is the delayed work runs in different cpu. The patch makes __queue_delayed_work records local cpu earlier. Where the timer runs doesn't change where the work runs with the change.
[ 28.010131] ------------[ cut here ]------------ [ 28.010609] kernel BUG at ../mm/vmstat.c:1392! [ 28.011099] invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC KASAN [ 28.011860] Modules linked in: [ 28.012245] CPU: 0 PID: 289 Comm: kworker/0:3 Tainted: G W4.3.0-rc3+ #634 [ 28.013065] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140709_153802- 04/01/2014 [ 28.014160] Workqueue: events vmstat_update [ 28.014571] task: ffff880117682580 ti: ffff8800ba428000 task.ti: ffff8800ba428000 [ 28.015445] RIP: 0010:[<ffffffff8115f921>] [<ffffffff8115f921>]vmstat_update+0x31/0x80 [ 28.016282] RSP: 0018:ffff8800ba42fd80 EFLAGS: 00010297 [ 28.016812] RAX: 0000000000000000 RBX: ffff88011a858dc0 RCX:0000000000000000 [ 28.017585] RDX: ffff880117682580 RSI: ffffffff81f14d8c RDI:ffffffff81f4df8d [ 28.018366] RBP: ffff8800ba42fd90 R08: 0000000000000001 R09:0000000000000000 [ 28.019169] R10: 0000000000000000 R11: 0000000000000121 R12:ffff8800baa9f640 [ 28.019947] R13: ffff88011a81e340 R14: ffff88011a823700 R15:0000000000000000 [ 28.020071] FS: 0000000000000000(0000) GS:ffff88011a800000(0000)knlGS:0000000000000000 [ 28.020071] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b [ 28.020071] CR2: 00007ff6144b01d0 CR3: 00000000b8e93000 CR4:00000000000006f0 [ 28.020071] Stack: [ 28.020071] ffff88011a858dc0 ffff8800baa9f640 ffff8800ba42fe00ffffffff8106bd88 [ 28.020071] ffffffff8106bd0b 0000000000000096 0000000000000000ffffffff82f9b1e8 [ 28.020071] ffffffff829f0b10 0000000000000000 ffffffff81f18460ffff88011a81e340 [ 28.020071] Call Trace: [ 28.020071] [<ffffffff8106bd88>] process_one_work+0x1c8/0x540 [ 28.020071] [<ffffffff8106bd0b>] ? process_one_work+0x14b/0x540 [ 28.020071] [<ffffffff8106c214>] worker_thread+0x114/0x460 [ 28.020071] [<ffffffff8106c100>] ? process_one_work+0x540/0x540 [ 28.020071] [<ffffffff81071bf8>] kthread+0xf8/0x110 [ 28.020071] [<ffffffff81071b00>] ?kthread_create_on_node+0x200/0x200 [ 28.020071] [<ffffffff81a6522f>] ret_from_fork+0x3f/0x70 [ 28.020071] [<ffffffff81071b00>] ?kthread_create_on_node+0x200/0x200
--- kernel/workqueue.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/workqueue.c +4 -4
@@ -1468,13 +1468,13 @@ static void __queue_delayed_work(int cpu, struct workqueue_struct *wq,timer_stats_timer_set_start_info (&dwork->timer); dwork->wq = wq; +/* timer isn't guaranteed to run in this cpu, record earlier */ +if (cpu ==WORK_CPU_UNBOUND ) + cpu =raw_smp_processor_id (); dwork->cpu = cpu; timer->expires = jiffies + delay; -if (unlikely (cpu !=WORK_CPU_UNBOUND )) -add_timer_on (timer, cpu); -else -add_timer (timer); +add_timer_on (timer, cpu); }/**
Signature · 1 line
2.6.2
PATCH 100/123 drm/nouveau/fbcon: take runpm reference when userspace has an open fd
In reply to Jiri SlabyFrom: Ben Skeggs <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit f231976c2e8964ceaa9250e57d27c35ff03825c2 upstream.
We need to do this in order to prevent accesses to the device while it's powered down. Userspace may have an mmap of the fb, and there's no good way (that I know of) to prevent it from touching the device otherwise.
This fixes some nasty races between runpm and plymouth on some systems, which result in the GPU getting very upset and hanging the boot.
--- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
drivers/gpu/drm/nouveau/nouveau_fbcon.c +24 -0
@@ -183,8 +183,30 @@ nouveau_fbcon_sync(struct fb_info *info)return 0 ; } +static int +nouveau_fbcon_open (struct fb_info *info,int user) +{ +struct nouveau_fbdev *fbcon = info->par; +struct nouveau_drm *drm =nouveau_drm (fbcon->dev); +int ret =pm_runtime_get_sync (drm->dev->dev); +if (ret <0 && ret != -EACCES ) +return ret; +return 0 ; +} + +static int +nouveau_fbcon_release (struct fb_info *info,int user) +{ +struct nouveau_fbdev *fbcon = info->par; +struct nouveau_drm *drm =nouveau_drm (fbcon->dev); +pm_runtime_put (drm->dev->dev); +return 0 ; +} +static struct fb_ops nouveau_fbcon_ops = { .owner =THIS_MODULE , + .fb_open = nouveau_fbcon_open, + .fb_release = nouveau_fbcon_release, .fb_check_var = drm_fb_helper_check_var, .fb_set_par = drm_fb_helper_set_par, .fb_fillrect = nouveau_fbcon_fillrect,
@@ -200,6 +222,8 @@ static struct fb_ops nouveau_fbcon_ops = {static struct fb_ops nouveau_fbcon_sw_ops = { .owner =THIS_MODULE , + .fb_open = nouveau_fbcon_open, + .fb_release = nouveau_fbcon_release, .fb_check_var = drm_fb_helper_check_var, .fb_set_par = drm_fb_helper_set_par, .fb_fillrect = cfb_fillrect,
Signature · 1 line
2.6.2
PATCH 101/123 dm thin: fix missing pool reference count decrement in pool_ctr error path
In reply to Jiri SlabyFrom: Mike Snitzer <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit ba30670f4d5292c4e7f7980bbd5071f7c4794cdd upstream.
--- drivers/md/dm-thin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/dm-thin.c +1 -1
@@ -2153,7 +2153,7 @@ static int pool_ctr(struct dm_target *ti, unsigned argc, char **argv) metadata_low_callback, pool);if (r) - goto out_free_pt; + goto out_flags_changed; pt->callbacks.congested_fn = pool_is_congested;dm_table_add_target_callbacks (ti->table, &pt->callbacks);
Signature · 1 line
2.6.2
PATCH 102/123 rbd: fix double free on rbd_dev->header_name
In reply to Jiri SlabyFrom: Ilya Dryomov <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 3ebe138ac642a195c7f2efdb918f464734421fd6 upstream.
If rbd_dev_image_probe() in rbd_dev_probe_parent() fails, header_name is freed twice: once in rbd_dev_probe_parent() and then in its caller rbd_dev_image_probe() (rbd_dev_image_probe() is called recursively to handle parent images).
rbd_dev_probe_parent() is responsible for probing the parent, so it shouldn't muck with clone's fields.
--- drivers/block/rbd.c | 1 - 1 file changed, 1 deletion(-)
drivers/block/rbd.c +0 -1
@@ -4868,7 +4868,6 @@ static int rbd_dev_probe_parent(struct rbd_device *rbd_dev) out_err:if (parent) {rbd_dev_unparent (rbd_dev); -kfree (rbd_dev->header_name);rbd_dev_destroy (parent); }else {rbd_put_client (rbdc);
Signature · 1 line
2.6.2
PATCH 103/123 usb: chipidea: debug: add runtime pm for register access
In reply to Jiri SlabyFrom: Li Jun <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit bc24937943d9f71a1e32b5dc4e2f0ef8fcc07b64 upstream.
Add runtime pm operations for registers access to avoid system hang.
--- drivers/usb/chipidea/debug.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/usb/chipidea/debug.c +6 -0
@@ -62,9 +62,11 @@ static int ci_port_test_show(struct seq_file *s, void *data)unsigned long flags;unsigned mode; +pm_runtime_get_sync (ci->dev);spin_lock_irqsave (&ci->lock, flags); mode =hw_port_test_get (ci);spin_unlock_irqrestore (&ci->lock, flags); +pm_runtime_put_sync (ci->dev);seq_printf (s,"mode = %u\n" , mode);
@@ -94,9 +96,11 @@ static ssize_t ci_port_test_write(struct file *file, const char __user *ubuf,if (sscanf (buf,"%u" , &mode) !=1 )return -EINVAL ; +pm_runtime_get_sync (ci->dev);spin_lock_irqsave (&ci->lock, flags); ret =hw_port_test_set (ci, mode);spin_unlock_irqrestore (&ci->lock, flags); +pm_runtime_put_sync (ci->dev);return ret ? ret : count; }
@@ -238,8 +242,10 @@ static ssize_t ci_role_write(struct file *file, const char __user *ubuf,if (role ==CI_ROLE_END || role == ci->role)return -EINVAL ; +pm_runtime_get_sync (ci->dev);ci_role_stop (ci); ret =ci_role_start (ci, role); +pm_runtime_put_sync (ci->dev);return ret ? ret : count; }
Signature · 1 line
2.6.2
PATCH 104/123 USB: symbolserial: Correct transferred data size
In reply to Jiri SlabyFrom: Philipp Hachtmann <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 8ae25a355b5969e12f3185e8cb8eb08b871c9084 upstream.
The scanner (here DS3508) always returns 64 bytes per urb buffer. The first byte indicates the data length used in the current buffer. There even was a comment describing this. But the comment also said that we'll send everything in the buffer to the tty layer. That means sending the actual barcode data and lots of trailing zeroes. This patch lets the driver only send the real data.
--- drivers/usb/serial/symbolserial.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-)
drivers/usb/serial/symbolserial.c +8 -10
@@ -61,17 +61,15 @@ static void symbol_int_callback(struct urb *urb)usb_serial_debug_data (&port->dev, __func__, urb->actual_length, data); +/* +* Data from the device comes with a 1 byte header: +* +* <size of data> <data>... +*/ if (urb->actual_length >1 ) { - data_length = urb->actual_length -1 ; - -/* -* Data from the device comes with a 1 byte header: -* -* <size of data>data... -* This is real data to be sent to the tty layer -* we pretty much just ignore the size and send everything -* else to the tty layer. -*/ + data_length = data[0 ]; +if (data_length > (urb->actual_length -1 )) + data_length = urb->actual_length -1 ;tty_insert_flip_string (&port->port, &data[1 ], data_length);tty_flip_buffer_push (&port->port); }else {
Signature · 1 line
2.6.2
PATCH 105/123 usb: musb: cppi41: improve rx channel abort routine
In reply to Jiri SlabyFrom: Bin Liu <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit cb83df77f3ec151d68a1b6be957207e6fc7b7f50 upstream.
1. set AUTOREQ to NONE at the beginning of teardown;
2. add delay for dma pipeline to drain;
3. Do not set USB_TDOWN bit for RX teardown.
The CPPI hw has an issue that when tearing down a RX channel, if another RX channel is receiving data, the CPPI will lockup.
To workaround the issue, do not set the CPPI TD bit. The steps before this point ensures the CPPI channel will be torn down properly.
--- drivers/usb/musb/musb_cppi41.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/usb/musb/musb_cppi41.c +9 -3
@@ -507,10 +507,15 @@ static int cppi41_dma_channel_abort(struct dma_channel *channel) csr &= ~MUSB_TXCSR_DMAENAB ;musb_writew (epio,MUSB_TXCSR , csr); }else { +cppi41_set_autoreq_mode (cppi41_channel,EP_MODE_AUTOREQ_NONE ); + csr =musb_readw (epio,MUSB_RXCSR ); csr &= ~(MUSB_RXCSR_H_REQPKT |MUSB_RXCSR_DMAENAB );musb_writew (epio,MUSB_RXCSR , csr); +/* wait to drain cppi dma pipe line */ +udelay (50 ); + csr =musb_readw (epio,MUSB_RXCSR );if (csr &MUSB_RXCSR_RXPKTRDY ) { csr |=MUSB_RXCSR_FLUSHFIFO ;
@@ -524,13 +529,14 @@ static int cppi41_dma_channel_abort(struct dma_channel *channel) tdbit <<=16 ;do { -musb_writel (musb->ctrl_base,USB_TDOWN , tdbit); +if (is_tx) +musb_writel (musb->ctrl_base,USB_TDOWN , tdbit); ret =dmaengine_terminate_all (cppi41_channel->dc); }while (ret == -EAGAIN ); -musb_writel (musb->ctrl_base,USB_TDOWN , tdbit); -if (is_tx) { +musb_writel (musb->ctrl_base,USB_TDOWN , tdbit); + csr =musb_readw (epio,MUSB_TXCSR );if (csr &MUSB_TXCSR_TXPKTRDY ) { csr |=MUSB_TXCSR_FLUSHFIFO ;
Signature · 1 line
2.6.2
RE: [PATCH 3.12 105/123] usb: musb: cppi41: improve rx channel abort routine
Hi Jiri,
Quoted 9 lines
-----Original Message-----
From: Jiri Slaby [mailto:[email protected]]
Sent: Wednesday, October 28, 2015 8:54 AM
To: [email protected]
Cc: [email protected]; Liu, Bin; Balbi, Felipe; Oliver Neukum; Jiri Slaby
Subject: [PATCH 3.12 105/123] usb: musb: cppi41: improve rx channel abort routine
Quoted 3 lines
From: Bin Liu <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
It seems this backport missing the dependency 0149b07 upstream (usb: musb:
cppi41: correct the macro name EP_MODE_AUTOREG_*), which causes the micro name mismatch.
Sorry for the late response, I just received the regression report.
Thanks,
-Bin.
Quoted 68 lines
===============
commit
cb83df77f3ec151d68a1b6be957207e6fc7b7f50upstream.1. set AUTOREQ to NONE at the beginning of teardown;
2. add delay for dma pipeline to drain;
3. Do not set
USB_TDOWNbit for RX teardown.The CPPI hw has an issue that when tearing down a RX channel, if another RX channel is receiving data, the CPPI will lockup.
To workaround the issue, do not set the CPPI TD bit. The steps before this point ensures the CPPI channel will be torn down properly.
Signed-off-by Bin Liu <[email protected]>Signed-off-by Felipe Balbi <[email protected]>Cc Oliver Neukum <[email protected]>Signed-off-by Jiri Slaby <[email protected]>--- drivers/usb/musb/musb_cppi41.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)(quoted diff) +0
-0
b/drivers/usb/musb/musb_cppi41.cindex77b475a43dad..1c9c626248fd100644drivers/usb/musb/musb_cppi41.c +5
-0@@ -507,10 +507,15 @@ static int cppi41_dma_channel_abort(struct dma_channel *channel) csr &= ~MUSB_TXCSR_DMAENAB;musb_writew (epio,MUSB_TXCSR , csr); }else { +cppi41_set_autoreq_mode (cppi41_channel,EP_MODE_AUTOREQ_NONE ); + csr =musb_readw (epio,MUSB_RXCSR ); csr &= ~(MUSB_RXCSR_H_REQPKT |MUSB_RXCSR_DMAENAB );musb_writew (epio,MUSB_RXCSR , csr); +/* wait to drain cppi dma pipe line */ +udelay (50 ); + csr =musb_readw (epio,MUSB_RXCSR );drivers/usb/musb/musb_cppi41.c +4
-3if (csr &MUSB_RXCSR_RXPKTRDY ) { csr |=MUSB_RXCSR_FLUSHFIFO ;@@ -524,13 +529,14 @@ static int cppi41_dma_channel_abort(struct dma_channel *channel) tdbit <<= 16;do { -musb_writel (musb->ctrl_base,USB_TDOWN , tdbit); +if (is_tx) +musb_writel (musb->ctrl_base,USB_TDOWN , tdbit); ret =dmaengine_terminate_all (cppi41_channel->dc); }while (ret == -EAGAIN ); -musb_writel (musb->ctrl_base,USB_TDOWN , tdbit); -if (is_tx) { +musb_writel (musb->ctrl_base,USB_TDOWN , tdbit); + csr =musb_readw (epio,MUSB_TXCSR );if (csr &MUSB_TXCSR_TXPKTRDY ) {csr |=
MUSB_TXCSR_FLUSHFIFO;
--
2.6.2
Re: [PATCH 3.12 105/123] usb: musb: cppi41: improve rx channel abort routine
Quoted 11 lines · Bin
Hi Jiri,
Quoted 9 lines
-----Original Message-----
From: Jiri Slaby [mailto:[email protected]]
Sent: Wednesday, October 28, 2015 8:54 AM
To: [email protected]
Cc: [email protected]; Liu, Bin; Balbi, Felipe; Oliver Neukum; Jiri Slaby
Subject: [PATCH 3.12 105/123] usb: musb: cppi41: improve rx channel abort routine
Quoted 7 lines
Quoted 3 lines
From: Bin Liu <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
It seems this backport missing the dependency 0149b07 upstream (usb: musb:
cppi41: correct the macro name EP_MODE_AUTOREG_*), which causes the micro name mismatch.
Ok, thanks, now added.
Signature · 2 lines
js suse labs
PATCH 106/123 usb: musb: fix cppi channel teardown for isoch transfer
In reply to Jiri SlabyFrom: Bin Liu <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit b431ba8803666e56c1d178a421b3cbc36e8d3d33 upstream.
After a few iterations of start/stop UVC camera streaming, the streaming stops.
This patch adds 250us delay in the cppi channel abort path to let cppi drain properly.
Using 50us delay seems to be too aggressive, some webcams are still broken. 250us is the original value used in TI 3.2 kernel.
--- drivers/usb/musb/musb_cppi41.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/musb/musb_cppi41.c +3 -0
@@ -509,6 +509,9 @@ static int cppi41_dma_channel_abort(struct dma_channel *channel) }else {cppi41_set_autoreq_mode (cppi41_channel,EP_MODE_AUTOREQ_NONE ); +/* delay to drain to cppi dma pipeline for isoch */ +udelay (250 ); + csr =musb_readw (epio,MUSB_RXCSR ); csr &= ~(MUSB_RXCSR_H_REQPKT |MUSB_RXCSR_DMAENAB );musb_writew (epio,MUSB_RXCSR , csr);
Signature · 1 line
2.6.2
PATCH 107/123 HID: apple: Add support for the 2015 Macbook Pro
In reply to Jiri SlabyFrom: Henrik Rydberg <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit a4a2c54560f2c57b88ba0283f141b44f594c2337 upstream.
This patch adds keyboard support for MacbookPro12,1 as WELLSPRING9 (0x0272, 0x0273, 0x0274). The touchpad is handled in a separate bcm5974 patch, as usual.
--- drivers/hid/hid-apple.c | 6 ++++++ drivers/hid/hid-core.c | 6 ++++++ drivers/hid/hid-ids.h | 3 +++ 3 files changed, 15 insertions(+)
drivers/hid/hid-apple.c +6 -0
@@ -546,6 +546,12 @@ static const struct hid_device_id apple_devices[] = { .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_JIS), .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI), + .driver_data = APPLE_HAS_FN }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ISO), + .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_JIS), + .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO),
drivers/hid/hid-core.c +6 -0
@@ -1695,6 +1695,9 @@ static const struct hid_device_id hid_have_special_driver[] = { { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_ISO) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_JIS) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ISO) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_JIS) }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) },
@@ -2370,6 +2373,9 @@ static const struct hid_device_id hid_mouse_ignore_list[] = { { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_ISO) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_JIS) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ISO) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_JIS) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, { }
drivers/hid/hid-ids.h +3 -0
@@ -139,6 +139,9 @@#define USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI 0x0290#define USB_DEVICE_ID_APPLE_WELLSPRING8_ISO 0x0291#define USB_DEVICE_ID_APPLE_WELLSPRING8_JIS 0x0292 +#define USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI 0x0272 +#define USB_DEVICE_ID_APPLE_WELLSPRING9_ISO 0x0273 +#define USB_DEVICE_ID_APPLE_WELLSPRING9_JIS 0x0274#define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY 0x030a#define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY 0x030b#define USB_DEVICE_ID_APPLE_IRCONTROL 0x8240
Signature · 1 line
2.6.2
PATCH 108/123 HID: quirks: add QUIRK_NOGET for an other TPV touchscreen
In reply to Jiri SlabyFrom: Benjamin Tissoires <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit c9b57724b38d4c1555ee49418be3d76801e3327c upstream.
Looks like 0x8882 needs the same quirk than 0x8883.
Given that both devices claim they are "TPV OpticalTouchScreen" rename the 0x8883 to add its PID in the #define.
--- drivers/hid/hid-ids.h | 3 ++- drivers/hid/usbhid/hid-quirks.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/hid/hid-ids.h +2 -1
@@ -881,7 +881,8 @@#define USB_DEVICE_ID_TOUCHPACK_RTS 0x1688#define USB_VENDOR_ID_TPV 0x25aa -#define USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN 0x8883 +#define USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN_8882 0x8882 +#define USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN_8883 0x8883#define USB_VENDOR_ID_TURBOX 0x062a#define USB_DEVICE_ID_TURBOX_KEYBOARD 0x0201
drivers/hid/usbhid/hid-quirks.c +2 -1
@@ -106,7 +106,8 @@ static const struct hid_blacklist { { USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET }, { USB_VENDOR_ID_SYMBOL, USB_DEVICE_ID_SYMBOL_SCANNER_1, HID_QUIRK_NOGET }, { USB_VENDOR_ID_SYMBOL, USB_DEVICE_ID_SYMBOL_SCANNER_2, HID_QUIRK_NOGET }, - { USB_VENDOR_ID_TPV, USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN, HID_QUIRK_NOGET }, + { USB_VENDOR_ID_TPV, USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN_8882, HID_QUIRK_NOGET }, + { USB_VENDOR_ID_TPV, USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN_8883, HID_QUIRK_NOGET }, { USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_KEYBOARD, HID_QUIRK_NOGET }, { USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_PF1209, HID_QUIRK_MULTI_INPUT }, { USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP4030U, HID_QUIRK_MULTI_INPUT },
Signature · 1 line
2.6.2
PATCH 109/123 Input: psmouse - add small delay for IBM trackpoint pass-through mode
In reply to Jiri SlabyFrom: Stefan Assmann <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 66bc2f51ef7deabc8b8f3baa98ae64b65e5e973a upstream.
There are trackpoint devices that fail to respond to the PS2 command PSMOUSE_CMD_GETID if immediately queried after the parent device is deactivated. Add a small delay for the hardware to get in a sane state before sending any PS2 commands.
One example of such a system is:
Lenovo ThinkPad X120e, model 30515QG
synaptics: Touchpad model: 1, fw: 8.0, id: 0x1e2b1, caps: 0xd001a3/0x940300/0x121c00, board id: 1811, fw id: 797391
--- drivers/input/mouse/psmouse-base.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/input/mouse/psmouse-base.c +4 -0
@@ -1441,6 +1441,10 @@ static int psmouse_connect(struct serio *serio, struct serio_driver *drv)if (error) goto err_clear_drvdata; +/* give PT device some time to settle down before probing */ +if (serio->id.type ==SERIO_PS_PSTHRU ) +usleep_range (10000 ,15000 ); +if (psmouse_probe (psmouse) <0 ) { error = -ENODEV ; goto err_close_serio;
Signature · 1 line
2.6.2
PATCH 110/123 Input: serio - fix blocking of parport
In reply to Jiri SlabyFrom: Sudip Mukherjee <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 1a5e251996e1b602f2ddc9261ee9de0ca1875bfa upstream.
If parkbd_allocate_serio() fails to allocate memory we are releasing the parport but we missed unregistering the device. As a result this device with exclusive access to that parport remains registered. And no other device will be able to use that parport even though this driver has failed to load.
--- drivers/input/serio/parkbd.c | 1 + 1 file changed, 1 insertion(+)
drivers/input/serio/parkbd.c +1 -0
@@ -194,6 +194,7 @@ static int __init parkbd_init(void) parkbd_port =parkbd_allocate_serio ();if (!parkbd_port) {parport_release (parkbd_dev); +parport_unregister_device (parkbd_dev);return -ENOMEM ; }
Signature · 1 line
2.6.2
PATCH 111/123 Input: omap4-keypad - fix memory leak
In reply to Jiri SlabyFrom: Sudip Mukherjee <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit d79bdc7f004404204a6ac07785f8d6717070ecdb upstream.
If omap4_keypad_parse_dt() fails we returned the error code but we missed releasing keypad_data.
--- drivers/input/keyboard/omap4-keypad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/keyboard/omap4-keypad.c +1 -1
@@ -284,7 +284,7 @@ static int omap4_keypad_probe(struct platform_device *pdev) }else { error =omap4_keypad_parse_dt (&pdev->dev, keypad_data);if (error) -return error; + goto err_free_keypad; } res =request_mem_region (res->start,resource_size (res), pdev->name);
Signature · 1 line
2.6.2
PATCH 112/123 Input: zhenhua - ensure we have BITREVERSE
In reply to Jiri SlabyFrom: Andrew Morton <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit d3b367bc26ea2e07a83fe73f0ccbddd729cb1f9a upstream.
It uses bitrev8(), so it must ensure that lib/bitrev.o gets included in vmlinux.
--- drivers/input/joystick/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/input/joystick/Kconfig +1 -0
@@ -196,6 +196,7 @@ config JOYSTICK_TWIDJOY config JOYSTICK_ZHENHUA tristate "5-byte Zhenhua RC transmitter" select SERIO + select BITREVERSE help Say Y here if you have a Zhen Hua PPM-4CH transmitter which is supplied with a ready to fly micro electric indoor helicopters
Signature · 1 line
2.6.2
PATCH 113/123 usbvision: fix locking error
In reply to Jiri SlabyFrom: Hans Verkuil <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit e2c84ccb0fbe5e524d15bb09c042a6ca634adaed upstream.
If remove_pending is non-zero, then the v4l2_lock is never unlocked.
--- drivers/media/usb/usbvision/usbvision-video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/usb/usbvision/usbvision-video.c +1 -1
@@ -435,6 +435,7 @@ static int usbvision_v4l2_close(struct file *file)usbvision_scratch_free (usbvision); usbvision->user--; +mutex_unlock (&usbvision->v4l2_lock);if (power_on_at_open) {/* power off in a little while
@@ -448,7 +449,6 @@ static int usbvision_v4l2_close(struct file *file)usbvision_release (usbvision);return 0 ; } -mutex_unlock (&usbvision->v4l2_lock);PDEBUG (DBG_IO ,"success" );return 0 ;
Signature · 1 line
2.6.2
PATCH 114/123 v4l: vsp1: Fix VI6_DPR_ROUTE_FXA_MASK macro
In reply to Jiri SlabyFrom: Nobuhiro Iwamatsu <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 45008ee9295b3ae96d7413ab91871907a671ca82 upstream.
FXA bit of VI6_DPR_mod_ROUTE register starts from 16bit. But VI6_DPR_ROUTE_FXA_MASK is set to become start from 8bit. This fixes shift size for VI6_DPR_ROUTE_FXA_MASK.
--- drivers/media/platform/vsp1/vsp1_regs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/vsp1/vsp1_regs.h +1 -1
@@ -304,7 +304,7 @@#define VI6_DPR_HST_ROUTE 0x2044#define VI6_DPR_HSI_ROUTE 0x2048#define VI6_DPR_BRU_ROUTE 0x204c -#define VI6_DPR_ROUTE_FXA_MASK (0xff << 8) +#define VI6_DPR_ROUTE_FXA_MASK (0xff << 16)#define VI6_DPR_ROUTE_FXA_SHIFT 16#define VI6_DPR_ROUTE_FP_MASK (0xff << 8)#define VI6_DPR_ROUTE_FP_SHIFT 8
Signature · 1 line
2.6.2
PATCH 115/123 v4l: vsp1: Fix VI6_DPR_ROUTE_FP_MASK macro
In reply to Jiri SlabyFrom: Nobuhiro Iwamatsu <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 1aa7890324b497f96f07c20673fae58f26fabfe7 upstream.
FP bit of VI6_DPR_mod_ROUTE register is 6bit. But VI6_DPR_ROUTE_FP_MASK is set to 0xFF, this will mask until the reserve bit.
This fixes size for VI6_DPR_ROUTE_FP_MASK.
--- drivers/media/platform/vsp1/vsp1_regs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/vsp1/vsp1_regs.h +1 -1
@@ -306,7 +306,7 @@#define VI6_DPR_BRU_ROUTE 0x204c#define VI6_DPR_ROUTE_FXA_MASK (0xff << 16)#define VI6_DPR_ROUTE_FXA_SHIFT 16 -#define VI6_DPR_ROUTE_FP_MASK (0xff << 8) +#define VI6_DPR_ROUTE_FP_MASK (0x3f << 8)#define VI6_DPR_ROUTE_FP_SHIFT 8#define VI6_DPR_ROUTE_RT_MASK (0x3f << 0)#define VI6_DPR_ROUTE_RT_SHIFT 0
Signature · 1 line
2.6.2
PATCH 116/123 v4l: vsp1: Fix VI6_WPF_SZCLIP_SIZE_MASK macro
In reply to Jiri SlabyFrom: Nobuhiro Iwamatsu <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 03b36e4dcf422a10da8b67bce2ed00b34ec58aac upstream.
Clipping size bit of VI6_WPFn _HSZCLIP and VI6_WPFn _VSZCLIP register are from 0 bit to 11 bit. But VI6_WPF_SZCLIP_SIZE_MASK is set to 0x1FFF, this will mask until the reserve bits. This fixes size for VI6_WPF_SZCLIP_SIZE_MASK.
--- drivers/media/platform/vsp1/vsp1_regs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/vsp1/vsp1_regs.h +1 -1
@@ -238,7 +238,7 @@#define VI6_WPF_SZCLIP_EN (1 << 28)#define VI6_WPF_SZCLIP_OFST_MASK (0xff << 16)#define VI6_WPF_SZCLIP_OFST_SHIFT 16 -#define VI6_WPF_SZCLIP_SIZE_MASK (0x1fff << 0) +#define VI6_WPF_SZCLIP_SIZE_MASK (0xfff << 0)#define VI6_WPF_SZCLIP_SIZE_SHIFT 0#define VI6_WPF_OUTFMT 0x100c
Signature · 1 line
2.6.2
PATCH 117/123 gscpa_m5602: use msecs_to_jiffies for conversions
In reply to Jiri SlabyFrom: Nicholas Mc Guire <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 63f2f417526fc54191f2b813f72dc1d5322bede8 upstream.
API compliance scanning with coccinelle flagged:
./drivers/media/usb/gspca/m5602/m5602_s5k83a.c:180:9-25:
WARNING: timeout (100) seems HZ dependent
Numeric constants passed to schedule_timeout() make the effective timeout HZ dependent which makes little sense in a polling loop for the cameras rotation state.
Fixed up by converting the constant to jiffies with msecs_to_jiffies()
--- drivers/media/usb/gspca/m5602/m5602_s5k83a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/usb/gspca/m5602/m5602_s5k83a.c +1 -1
@@ -177,7 +177,7 @@ static int rotation_thread_function(void *data)__s32 vflip, hflip;set_current_state (TASK_INTERRUPTIBLE ); -while (!schedule_timeout (100 )) { +while (!schedule_timeout (msecs_to_jiffies (100 ))) {if (mutex_lock_interruptible (&sd->gspca_dev.usb_lock))break ;
Signature · 1 line
2.6.2
Re: [PATCH 3.12 117/123] [media] gscpa_m5602: use msecs_to_jiffies for conversions
Quoted 31 lines · Jiri Slaby
From: Nicholas Mc Guire <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit
63f2f417526fc54191f2b813f72dc1d5322bede8upstream.API compliance scanning with coccinelle flagged:
./drivers/media/usb/gspca/m5602/m5602_s5k83a.c:180:9-25:
WARNING: timeout (100) seems HZ dependentNumeric constants passed to
schedule_timeout()make the effective timeout HZ dependent which makes little sense in a polling loop for the cameras rotation state.
Fixed up by converting the constant to jiffies withmsecs_to_jiffies()Signed-off-by Nicholas Mc Guire <[email protected]>Signed-off-by Hans de Goede <[email protected]>Signed-off-by Mauro Carvalho Chehab <[email protected]>Cc Oliver Neukum <[email protected]>Signed-off-by Jiri Slaby <[email protected]>--- drivers/media/usb/gspca/m5602/m5602_s5k83a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/media/usb/gspca/m5602/m5602_s5k83a.c +0
-0
drivers/media/usb/gspca/m5602/m5602_s5k83a.c static int rotation_thread_function(void *data) · line 183
Quoted 8 lines
drivers/media/usb/gspca/m5602/m5602_s5k83a.c +1
-1@@ -177,7 +177,7 @@ static int rotation_thread_function(void *data)__s32 vflip, hflip;set_current_state (TASK_INTERRUPTIBLE ); -while (!schedule_timeout (100 )) { +while (!schedule_timeout (msecs_to_jiffies (100 ))) {if (mutex_lock_interruptible (&sd->gspca_dev.usb_lock))break ;
Note that there were some concerns regarding using msecs_to_jiffies rather than explicit conversion where gcc can do constant folding (so in this case something like (100 * HZ / 1000) this was mitigated by the following pathes to kbuild see
https://lkml.org/lkml/2015/5/28/524
https://lkml.org/lkml/2015/5/28/525
in this case this does not really apply as the numeric 100 is actually a bug - but there might be some performance concerns if too many such conversions are added (there were all together about 30 such cases).
thx!
hofrat
PATCH 118/123 usb: core: implement AMD remote wakeup quirk
In reply to Jiri SlabyFrom: Huang Rui <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 7868943db1668fba898cf71bed1506c19d6958aa upstream.
The following patch is required to resolve remote wake issues with certain devices.
Issue description:
If the remote wake is issued from the device in a specific timing condition while the system is entering sleep state then it may cause system to auto wake on subsequent sleep cycle.
Root cause:
Host controller rebroadcasts the Resume signal > 100 µseconds after receiving the original resume event from the device. For proper function, some devices may require the rebroadcast of resume event within the USB spec of 100µS.
Workaroud:
1. Filter the AMD platforms with Yangtze chipset, then judge of all the usb devices are mouse or not. And get out the port id which attached a mouse with Pixart controller.
2. Then reset the port which attached issue device during system resume from S3.
[Q] Why the special devices are only mice? Would high speed devices such as 3G modem or USB Bluetooth adapter trigger this issue?
- Current this sensitivity is only confined to devices that use Pixart controllers. This controller is designed for use with LS mouse
devices only. We have not observed any other devices failing. There may be a small risk for other devices also but this patch (reset device in resume phase) will cover the cases if required.
[Q] Shouldn’t the resume signal be sent within 100 us for every device?
- The Host controller may not send the resume signal within 100us, this our host controller specification change. This is why we
require the patch to prevent side effects on certain known devices.
[Q] Why would clicking mouse INTENSELY to wake the system up trigger this issue?
- This behavior is specific to the devices that use Pixart controller. It is timing dependent on when the resume event is triggered during
the sleep state.
[Q] Is it a host controller issue or mouse?
- It is the host controller behavior during resume that triggers the device incorrect behavior on the next resume.
This patch sets USB_QUIRK_RESET_RESUME flag for these Pixart-based mice when they attached to platforms with AMD Yangtze chipset.
--- drivers/usb/core/hcd-pci.c | 3 +++ drivers/usb/core/quirks.c | 37 +++++++++++++++++++++++++++++++++++++ drivers/usb/host/pci-quirks.c | 12 ++++++++++++ include/linux/usb/hcd.h | 3 +++ 4 files changed, 55 insertions(+)
drivers/usb/core/hcd-pci.c +3 -0
@@ -215,6 +215,9 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) goto disable_pci; } + hcd->amd_resume_bug = (usb_hcd_amd_remote_wakeup_quirk (dev) && + driver->flags & (HCD_USB11 |HCD_USB3 )) ?1 :0 ; +if (driver->flags &HCD_MEMORY ) {/* EHCI, OHCI */ hcd->rsrc_start =pci_resource_start (dev,0 );
drivers/usb/core/quirks.c +37 -0
@@ -13,6 +13,7 @@#include <linux/usb.h> #include <linux/usb/quirks.h> +#include <linux/usb/hcd.h> #include "usb.h" /* Lists of quirky USB devices, split in device quirks and interface quirks.
@@ -212,6 +213,21 @@ static const struct usb_device_id usb_interface_quirk_list[] = { { }/* terminating entry must be last */ }; +static const struct usb_device_id usb_amd_resume_quirk_list[] = { +/* Lenovo Mouse with Pixart controller */ + {USB_DEVICE (0x17ef ,0x602e ), .driver_info =USB_QUIRK_RESET_RESUME }, + +/* Pixart Mouse */ + {USB_DEVICE (0x093a ,0x2500 ), .driver_info =USB_QUIRK_RESET_RESUME }, + {USB_DEVICE (0x093a ,0x2510 ), .driver_info =USB_QUIRK_RESET_RESUME }, + {USB_DEVICE (0x093a ,0x2521 ), .driver_info =USB_QUIRK_RESET_RESUME }, + +/* Logitech Optical Mouse M90/M100 */ + {USB_DEVICE (0x046d ,0xc05a ), .driver_info =USB_QUIRK_RESET_RESUME }, + + { }/* terminating entry must be last */ +}; +static bool usb_match_any_interface (struct usb_device *udev,const struct usb_device_id *id) {
@@ -238,6 +254,18 @@ static bool usb_match_any_interface(struct usb_device *udev,return false; } +int usb_amd_resume_quirk (struct usb_device *udev) +{ +struct usb_hcd *hcd; + + hcd =bus_to_hcd (udev->bus); +/* The device should be attached directly to root hub */ +if (udev->level ==1 && hcd->amd_resume_bug ==1 ) +return 1 ; + +return 0 ; +} +static u32 __usb_detect_quirks (struct usb_device *udev,const struct usb_device_id *id) {
@@ -263,6 +291,15 @@ static u32 __usb_detect_quirks(struct usb_device *udev,void usb_detect_quirks (struct usb_device *udev) { udev->quirks =__usb_detect_quirks (udev, usb_quirk_list); + +/* +* Pixart-based mice would trigger remote wakeup issue on AMD +* Yangtze chipset, so set them as RESET_RESUME flag. +*/ +if (usb_amd_resume_quirk (udev)) + udev->quirks |=__usb_detect_quirks (udev, + usb_amd_resume_quirk_list); +if (udev->quirks)dev_dbg (&udev->dev,"USB quirks for this device: %x\n" , udev->quirks);
drivers/usb/host/pci-quirks.c +12 -0
@@ -250,6 +250,18 @@ commit: }EXPORT_SYMBOL_GPL (usb_amd_find_chipset_info); +int usb_hcd_amd_remote_wakeup_quirk (struct pci_dev *pdev) +{ +/* Make sure amd chipset type has already been initialized */ +usb_amd_find_chipset_info (); +if (amd_chipset.sb_type.gen !=AMD_CHIPSET_YANGTZE ) +return 0 ; + +dev_dbg (&pdev->dev,"QUIRK: Enable AMD remote wakeup fix\n" ); +return 1 ; +} +EXPORT_SYMBOL_GPL (usb_hcd_amd_remote_wakeup_quirk); +bool usb_amd_hang_symptom_quirk (void ) {u8 rev;
include/linux/usb/hcd.h +3 -0
@@ -140,6 +140,7 @@ struct usb_hcd { unsigned wireless:1; /* Wireless USB HCD */ unsigned authorized_default:1; unsigned has_tt:1; /* Integrated TT in root hub */ + unsigned amd_resume_bug:1; /* AMD remote wakeup quirk */unsigned int irq;/* irq allocated */ void __iomem *regs;/* device memory/io */
@@ -428,6 +429,8 @@ extern int usb_hcd_pci_probe(struct pci_dev *dev,extern void usb_hcd_pci_remove (struct pci_dev *dev);extern void usb_hcd_pci_shutdown (struct pci_dev *dev); +extern int usb_hcd_amd_remote_wakeup_quirk (struct pci_dev *dev); +#ifdef CONFIG_PM extern const struct dev_pm_ops usb_hcd_pci_pm_ops;#endif
Signature · 1 line
2.6.2
PATCH 119/123 Revert "USB: quirks: add touchscreen that is dazzeled by remote wakeup"
In reply to Jiri SlabyFrom: Oliver Neukum <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit e0e6a356a0b41375b729c511caa99d3ec019640e upstream.
This reverts commit 614ced91fc6fbb5a1cdd12f0f1b6c9197d9f1350. The units on this was seen were prototypes and the issue is not seen on younger units.
--- drivers/usb/core/quirks.c | 3 --- 1 file changed, 3 deletions(-)
drivers/usb/core/quirks.c +0 -3
@@ -134,9 +134,6 @@ static const struct usb_device_id usb_quirk_list[] = {/* Alcor Micro Corp. Hub */ { USB_DEVICE(0x058f, 0x9254), .driver_info = USB_QUIRK_RESET_RESUME }, - /* MicroTouch Systems touchscreen */ - { USB_DEVICE(0x0596, 0x051e), .driver_info = USB_QUIRK_RESET_RESUME }, - /* appletouch */ { USB_DEVICE(0x05ac, 0x021a), .driver_info = USB_QUIRK_RESET_RESUME },
Signature · 1 line
2.6.2
PATCH 120/123 USB: Add OTG PET device to TPL
In reply to Jiri SlabyFrom: Macpaul Lin <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit e5dff0e80463cc3fa236e898ef1491b40be70b19 upstream.
OTG device shall support this device for allowing compliance automated testing. The modification is derived from Pavankumar and Vijayavardhans' previous work.
--- drivers/usb/core/otg_whitelist.h | 5 +++++ drivers/usb/core/quirks.c | 4 ++++ 2 files changed, 9 insertions(+)
drivers/usb/core/otg_whitelist.h +5 -0
@@ -59,6 +59,11 @@ static int is_targeted(struct usb_device *dev) le16_to_cpu(dev->descriptor.idProduct) == 0xbadd))return 0 ; +/* OTG PET device is always targeted (see OTG 2.0 ECN 6.4.2) */ +if ((le16_to_cpu (dev->descriptor.idVendor) ==0x1a0a && +le16_to_cpu (dev->descriptor.idProduct) ==0x0200 )) +return 1 ; +/* NOTE: can't use usb_match_id() since interface caches * aren't set up yet. this is cut/paste from that code. */
drivers/usb/core/quirks.c +4 -0
@@ -195,6 +195,10 @@ static const struct usb_device_id usb_quirk_list[] = { { USB_DEVICE(0x0b05, 0x17e0), .driver_info = USB_QUIRK_IGNORE_REMOTE_WAKEUP }, + /* Protocol and OTG Electrical Test Device */ + { USB_DEVICE(0x1a0a, 0x0200), .driver_info = + USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL }, + { } /* terminating entry must be last */ };
Signature · 1 line
2.6.2
PATCH 121/123 Revert "USB: Add device quirk for ASUS T100 Base Station keyboard"
In reply to Jiri Slaby3.12-stable review patch. If anyone has any objections, please let me know.
===============
This reverts commit e25ecd21ffdbf1f8287103ccf97205fc30088344 in 3.12, upstream commit ddbe1fca0bcb87ca8c199ea873a456ca8a948567 (USB: Add device quirk for ASUS T100 Base Station keyboard).
It was applied twice to 3.12 and one backport is bogus.
--- drivers/usb/core/quirks.c | 4 ---- include/linux/usb/quirks.h | 7 ++----- 2 files changed, 2 insertions(+), 9 deletions(-)
drivers/usb/core/quirks.c +0 -4
@@ -207,10 +207,6 @@ static const struct usb_device_id usb_interface_quirk_list[] = { { USB_VENDOR_AND_INTERFACE_INFO(0x046d, USB_CLASS_VIDEO, 1, 0), .driver_info = USB_QUIRK_RESET_RESUME }, - /* ASUS Base Station(T100) */ - { USB_DEVICE(0x0b05, 0x17e0), .driver_info = - USB_QUIRK_IGNORE_REMOTE_WAKEUP }, - { }/* terminating entry must be last */ };
include/linux/usb/quirks.h +2 -5
@@ -41,13 +41,10 @@*/ #define USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL 0x00000080 -/* device generates spurious wakeup, ignore remote wakeup capability */ -#define USB_QUIRK_IGNORE_REMOTE_WAKEUP 0x00000200 +/* device can't handle device_qualifier descriptor requests */ +#define USB_QUIRK_DEVICE_QUALIFIER 0x00000100/* device generates spurious wakeup, ignore remote wakeup capability */ #define USB_QUIRK_IGNORE_REMOTE_WAKEUP 0x00000200 -/* device can't handle device_qualifier descriptor requests */ -#define USB_QUIRK_DEVICE_QUALIFIER 0x00000100 -#endif /* __LINUX_USB_QUIRKS_H */
Signature · 1 line
2.6.2
PATCH 122/123 ath9k: declare required extra tx headroom
In reply to Jiri SlabyFrom: Felix Fietkau <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 029cd0370241641eb70235d205aa0b90c84dce44 upstream.
ath9k inserts padding between the 802.11 header and the data area (to align it). Since it didn't declare this extra required headroom, this led to some nasty issues like randomly dropped packets in some setups.
--- drivers/net/wireless/ath/ath9k/init.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/ath/ath9k/init.c +1 -0
@@ -893,6 +893,7 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) hw->max_rate_tries =10 ; hw->sta_data_size =sizeof (struct ath_node ); hw->vif_data_size =sizeof (struct ath_vif ); + hw->extra_tx_headroom =4 ; hw->wiphy->available_antennas_rx =BIT (ah->caps.max_rxchains) -1 ; hw->wiphy->available_antennas_tx =BIT (ah->caps.max_txchains) -1 ;
Signature · 1 line
2.6.2
PATCH 123/123 ARM: ux500: cpuidle: fix section mismatch
In reply to Jiri SlabyFrom: Daniel Lezcano <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 2c2b24d9c3e96d5cf974be4559a936e7f3b50225 upstream.
The dbx500_cpuidle_probe is tagged as an __init section but the variable dbx500_cpuidle_plat_driver is not.
The dbx500_cpuidle_probe could not be declared as __init because of macro module_platform_driver builds the exit function, tags as __exit and this one refers to the dbx500_cpuidle_plat_driver which is an __initdata.
That leads to a section mismatch.
Fix it by removing the __init tag for the probe function.
--- drivers/cpuidle/cpuidle-ux500.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpuidle/cpuidle-ux500.c +1 -1
@@ -111,7 +111,7 @@ static struct cpuidle_driver ux500_idle_driver = { .state_count = 2, }; -static int __init dbx500_cpuidle_probe (struct platform_device *pdev) +static int dbx500_cpuidle_probe (struct platform_device *pdev) {/* Configure wake up reasons */ prcmu_enable_wakeups(PRCMU_WAKEUP(ARM) | PRCMU_WAKEUP(RTC) |
Signature · 1 line
2.6.2
Quoted 8 lines · Jiri Slaby
This is the start of the stable review cycle for the 3.12.50 release. There are 123 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri Oct 30 09:39:16 CET 2015. Anything received after that time might be too late.
Build results:
total: 123 pass: 123 fail: 0 Qemu test results: total: 77 pass: 77 fail: 0
Details are available at http://server.roeck-us.net:8010/builders.
Guenter
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Quoted 6 lines · Guenter Roeck
Quoted 5 lines · Jiri Slaby
This is the start of the stable review cycle for the 3.12.50 release. There are 123 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 7 lines
Quoted 3 lines
Responses should be made by Fri Oct 30 09:39:16 CET 2015. Anything received after that time might be too late.
Build results: total: 123 pass: 123 fail: 0 Qemu test results:
total: 77 pass: 77 fail: 0Details are available at http://server.roeck-us.net:8010/builders.
Thanks for testing!
- --
js
suse labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBCAAGBQJWNyskAAoJEL0lsQQGtHBJb/gQAIo9lwawa1sPN8ooYxfaonXR uUJlJsub0rsZfCjGVJZ6Jqw4mFIdIyGFWXNXVPNe69mUtPnf9EMuC5s5OEr8S5TF nc4SrCnzMYkjE1OGFkowFApX7y3EyiO0HDex+ut2r98QG22JN/31lZVaMyly07Un jOdPA3Wsl2RdA0vXetS6HeAX/ixZdH5CKQUBOScogePjIbWhbSqjO1dJCBXQUrxM SaZc0VsVauXLMLVaM1K7IAhLfo6wLXHUyuCaRFDiXFBBPH3GVXfPkZdhkmEnhbMj cCO4Ru+yVicq68FwDtwaDxO6VumJGy7QKUnJVoV5qH3GYge1hFgUB7sTLcyTUPED FmJzPbjqiNZTSQlbwmWnCdUZuye/MX+4Paju8+mZVTYKPfdCxfW/VwaCNSwhq/cA jyVNkBOTC5TAui7pBwRwRSHdUO7Lpu12u8iNdEpFnlirV+dFbf5V+E2p7qFdNlb3 0zj9VccH9WWaxF9qTMCOcl7MbDOefDUlVBB0ZAut5IYGY6otbNhLTYiQ9vV0FWFT yOw8pZtlbAv2L1evgXLf7pfbc9EG9+6FLP5hYlRej+AGNvJhyPfStzupc0LTg7dI UzvamtBVL7/Xz05AzjeEJrH4PoKqSVR7Qbc7OxKkYJLFFGF0/UOb1PzM0mtAhB+s +f+LF8Gq9bUNQO9pphNm
=SAYR
-----END PGP SIGNATURE-----
Hello Jiri,
I think you should also add this patch:
I hit this on 3.12.47 originally -
http://www.spinics.net/lists/dm-devel/msg24531.html
Quoted 519 lines · Jiri Slaby
This is the start of the stable review cycle for the 3.12.50 release. There are 123 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri Oct 30 09:39:16 CET 2015. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
http://kernel.org/pub/linux/kernel/people/jirislaby/stable-review/patch-3.12.50-rc1.xzand the diffstat can be found below.
thanks,
js===============
Aaron Conole (2):
af_unix: Convert theunix_skmacro to an inline function for type
safety
af_unix: return data from multiple SKBs onrecv()withMSG_PEEKflagAlexander Couzens (1):
l2tp: protecttunnel->del_workbyref_countAndreas Schwab (1):
m68k: Defineasmlinkage_protectAndrew Morton (1):
Input: zhenhua - ensure we have BITREVERSEAndrey Vagin (1):
net/unix: fix logic aboutsk_peek_offsetAndy Lutomirski (2):
x86/nmi/64: Fix a paravirt stack-clobbering bug in the NMI code x86/paravirt: Replace the paravirt nop with a bona fide empty functionAndy Shevchenko (1):
dmaengine: dw: properly readDWC_PARAMSregisterArd Biesheuvel (1):
ARM: 8429/1: disable GCC SRA optimizationArnaldo Carvalho de Melo (2):
perf hists: Update the column width for the "srcline" sort key perf header: Fixup reading ofHEADER_NRCPUSfeatureBen Hutchings (1):
genirq: Fix race inregister_irq_proc()Ben Skeggs (1):
drm/nouveau/fbcon: take runpm reference when userspace has an open fdBenjamin Tissoires (1):
HID: quirks: addQUIRK_NOGETfor an other TPV touchscreenBin Liu (2):
usb: musb: cppi41: improve rx channel abort routine
usb: musb: fix cppi channel teardown for isoch transferCharles Keepax (1):
asix: Do full reset duringax88772_bindChris Mason (1):
btrfs: fix use after free iterating extrefsChristoph Hellwig (1):
3w-9xxx: don't unmap bounce buffered commandsDaniel Lezcano (1):
ARM: ux500: cpuidle: fix section mismatchDaniel Vetter (1):
drm: Reject DRI1 hw lock ioctl functions for kms driversDave Airlie (1):
drm/qxl: only report first monitor as connected if we have no stateDave Kleikamp (1):
crypto: sparc - initialize blkcipher.ivsizeDavid Woodhouse (1):
x86/platform: Fix Geode LX timekeeping in the generic x86 buildDirk Müller (1):
UseWARN_ON_ONCEfor missingX86_FEATURE_NRIPSEric Dumazet (1):
net: add pfmemalloc check insk_add_backlog()Fabiano Fidêncio (1):
drm/qxl: recreate the primary surface when the bo is not primaryFelix Fietkau (1):
ath9k: declare required extra tx headroomFilipe Manana (2):
Btrfs: fix read corruption of compressed and shared extents
Btrfs: update fix for read corruption of compressed and shared extentsGrazvydas Ignotas (1):
ARM: dts:omap5-uevm.dts: fix i2c5 pinctrl offsetsGuenter Roeck (2):
hwmon: (nct6775) SwapSTEP_UP_TIMEandSTEP_DOWN_TIMEregisters for
most chips
spi: Fix documentation ofspi_alloc_master()Guillaume Nault (1):
ppp: don't overridesk->sk_stateinpppoe_flush_dev()Hans Verkuil (1):
[media] usbvision: fix locking errorHenrik Rydberg (1):
HID: apple: Add support for the 2015 Macbook ProHuang Rui (1):
usb: core: implement AMD remote wakeup quirkIlya Dryomov (1):
rbd: fix double free onrbd_dev->header_nameJames Hogan (1):
MIPS: dma-default: Fix 32-bit fall back toGFP_DMAJan H. Schönherr (1):
sched: Fix cpu_active_mask/cpu_online_mask raceJan Kara (1):
jbd2: avoid infinite loop when destroying aborted journalJann Horn (1):
security: fix typo insecurity_task_prctlJason Wang (1):
kvm: fix zero length mmio searchingJeff Mahoney (1):
btrfs: skip waiting on ordered range for special filesJenny Derzhavetz (1):
iser-target: remove command with stateISTATE_REMOVEJiri Slaby (1):
Revert "USB: Add device quirk for ASUS T100 Base Station keyboard"Joe Perches (1):
ethtool: Use kcalloc instead of kmalloc forethtool_get_stringsJoe Stringer (1):
netfilter:nf_conntrack: Support expectations in different zonesJoe Thornber (2):
dm btree: add ref counting ops for the leaves of top level btrees dm cache: fix NULL pointer when switching from cleaner policyJoerg Roedel (1):
iommu/amd: Handle integer overflow indma_ops_area_allocJohan Hovold (1):
USB: whiteheat: fix potential null-deref at probeJohn Flatness (1):
ALSA: hda - Apply SPDIF pin ctl to MacBookPro 12,1Joonsoo Kim (1):
mm/slab: fix unexpected index mapping result of
kmalloc_size(INDEX_NODE+1)Julian Anastasov (2):
ipvs: do not use random local source address for tunnels
ipvs: fix crash with sync protocol v0 and FTPKan Liang (1):
perf stat: Get correct cpu id forprint_aggrLi Jun (1):
usb: chipidea: debug: add runtime pm for register accessLinus Torvalds (1):
Initialize msg/shm IPC objects before doingipc_addid()Liu.Zhao (1):
USB: option: add ZTE PIDsMacpaul Lin (1):
USB: Add OTG PET device to TPLMark Brown (2):
regmap: debugfs: Ensure we don't underflow when printing access masks
regmap: debugfs: Don't bother actually printing when calculating max
lengthMark Salyzyn (1):
arm64: readahead: fault retry breaks mmap file read random detectionMartin Schwidefsky (1):
s390/3270: redraw screen on unsolicited device endMathias Nyman (4):
xhci: Workaround for PME stuck issues in Intel xhci
xhci: rework cycle bit checking for new dequeue pointers
xhci: change xhci 1.0 only restrictions to support xhci 1.1
usb: Use theUSB_SS_MULT()macro to get the burst multiplier.Mel Gorman (1):
mm: hugetlbfs: skip shared VMAs when unmapping private pages to
satisfy a faultMichal Hocko (1):
scsi: fixscsi_error_handlervs.scsi_host_dev_releaseraceMichel Stam (1):
asix: Don't reset PHY onif_upfor ASIX 88772Mika Westerberg (1):
i2c: designware: Do not use parameters from ACPI on Dell Inspiron 7348Mike Snitzer (1):
dm thin: fix missing pool reference count decrement inpool_ctrerror
pathMikulas Patocka (1):
dm raid: fix round up of default region sizeNicholas Mc Guire (1):
[media]gscpa_m5602: usemsecs_to_jiffiesfor conversionsNobuhiro Iwamatsu (3):
[media] v4l: vsp1: FixVI6_DPR_ROUTE_FXA_MASKmacro [media] v4l: vsp1: FixVI6_DPR_ROUTE_FP_MASKmacro [media] v4l: vsp1: FixVI6_WPF_SZCLIP_SIZE_MASKmacroNoel Power (1):
client MUST ignore EncryptionKeyLength ifCAP_EXTENDED_SECURITYis setOliver Neukum (1):
Revert "USB: quirks: add touchscreen that is dazzeled by remote
wakeup"Pablo Neira Ayuso (1):
netfilter: ctnetlink: put back references to master ct and expect
objectsPaul Bolle (1):
windfarm: decrement client count when unregisteringPaul E. McKenney (1):
rcu: Reject memory-order-induced stall-warning false positivesPeter Seiderer (1):
cifs: use server timestamp for ntlmv2 authenticationPeter Zijlstra (4):
arch: Clean upasm/barrier.himplementations using
asm-generic/barrier.h
arch: Move smp_mb__{before,after}_atomic_{inc,dec}.h intoasm/atomic.harc,hexagon: Deleteasm/barrier.h
sched/core: FixTASK_DEADrace infinish_task_switch()Philipp Hachtmann (1):
USB: symbolserial: Correct transferred data sizePravin B Shelar (2):
skbuff: Fix skb checksum flag on skb pull
skbuff: Fix skb checksum partial check.Reyad Attiyat (1):
usb: xhci: Add support forURB_ZERO_PACKETto bulk/sg transfersRichard Weinberger (1):
UBI: Validatedata_sizeRobert Jarzmik (2):
ASoC: pxa: pxa2xx-ac97: fix dma requestor lines
ASoC: fix broken pxa SoC supportRobert Schlabbach (1):
usb: core: Fix USB 3.0 devices lost in NOTATTACHED state after a hub
port resetRoger Quadros (1):
usb: xhci: ClearXHCI_STATE_DYINGon startRussell King (2):
ARM: fix Thumb2 signal handling when ARMv6 is enabled
crypto: ahash - ensure statesize is non-zeroSabrina Dubroca (1):
net: add length argument toskb_copy_and_csum_datagram_iovecShaohua Li (2):
x86/apic: Serialize LVTT andTSC_DEADLINEwrites
workqueue: make sure delayed work run in local cpuStefan Assmann (1):
Input: psmouse - add small delay for IBM trackpoint pass-through modeStephen Smalley (1):
x86/mm: Set NX on gap between__ex_tableand rodataSteve French (1):
disabling oplocks/leases via module parmenable_oplocksbroken for
SMB3Sudip Mukherjee (2):
Input: serio - fix blocking of parport
Input: omap4-keypad - fix memory leakT.J. Purtell (1):
ARM: 7880/1: Clear the IT state independent of the Thumb-2 modeTakashi Iwai (2):
ALSA: hda - Control SPDIF out pin on MacBookPro 11,2
ALSA: synth: Fix conflicting OSS device registration on AWE32Tan, Jui Nee (1):
spi: spi-pxa2xx: Check status register to determine ifSSSR_TINTis
disabledTeunis van Beelen (1):
USB: usbtmc: add device quirk for Rigol DS6104Vincent Palatin (1):
usb: Add device quirk for Logitech PTZ camerasVitaly Kuznetsov (1):
x86/xen: Support kexec/kdump in HVM guests by doing a soft resetWill Deacon (1):
arm64: errata: useKBUILD_CFLAGS_MODULEfor erratum #843419Wolfram Sang (2):
i2c: rcar: enable RuntimePM before registering to the core
i2c: s3c2410: enable RuntimePM before registering to the coreYao-Wen Mao (1):
USB: Add reset-resume quirk for two Plantronics usb headphones.Yitian Bu (1):
ASoC: dwc: correct irq clear method[email protected] (1):
staging: speakup: fix speakup-r regressionshengyong (1):
UBI: return ENOSPC if no enough space availablearch/alpha/include/asm/barrier.h | 25 +---- arch/arc/include/asm/Kbuild | 1 + arch/arc/include/asm/atomic.h | 5 + arch/arc/include/asm/barrier.h | 42 ------- arch/arm/Makefile | 8 ++ arch/arm/boot/dts/omap5-uevm.dts | 4 +- arch/arm/kernel/signal.c | 19 +++- arch/arm64/Makefile | 2 +- arch/arm64/mm/fault.c | 1 + arch/avr32/include/asm/barrier.h | 17 +-- arch/blackfin/include/asm/barrier.h | 18 +-- arch/cris/include/asm/Kbuild | 1 + arch/cris/include/asm/barrier.h | 25 ----- arch/frv/include/asm/barrier.h | 8 +- arch/hexagon/include/asm/Kbuild | 1 + arch/hexagon/include/asm/atomic.h | 6 +- arch/hexagon/include/asm/barrier.h | 41 ------- arch/m32r/include/asm/barrier.h | 80 +------------- arch/m68k/include/asm/barrier.h | 14 +-- arch/m68k/include/asm/linkage.h | 30 +++++ arch/microblaze/include/asm/Kbuild | 1 + arch/microblaze/include/asm/barrier.h | 27 ----- arch/mips/mm/dma-default.c | 2 +- arch/mn10300/include/asm/Kbuild | 1 + arch/mn10300/include/asm/barrier.h | 37 ------- arch/parisc/include/asm/Kbuild | 1 + arch/parisc/include/asm/barrier.h | 35 ------ arch/score/include/asm/Kbuild | 1 + arch/score/include/asm/barrier.h | 16 --- arch/sh/include/asm/barrier.h | 21 +--- arch/sparc/crypto/aes_glue.c | 2 + arch/sparc/crypto/camellia_glue.c | 1 + arch/sparc/crypto/des_glue.c | 2 + arch/sparc/include/asm/barrier_32.h | 12 +- arch/tile/include/asm/barrier.h | 68 +----------- arch/unicore32/include/asm/barrier.h | 11 +- arch/x86/kernel/apic/apic.c | 7 ++ arch/x86/kernel/entry_64.S | 16 ++- arch/x86/kernel/paravirt.c | 16 ++- arch/x86/kernel/tsc.c | 17 +-- arch/x86/kvm/svm.c | 2 +- arch/x86/mm/init_64.c | 2 +- arch/x86/xen/enlighten.c | 23 ++++ arch/xtensa/include/asm/barrier.h | 9 +- crypto/ahash.c | 3 +- drivers/base/regmap/regmap-debugfs.c | 5 +- drivers/block/rbd.c | 1 - drivers/cpuidle/cpuidle-ux500.c | 2 +- drivers/dma/dw/core.c | 4 +- drivers/gpu/drm/drm_lock.c | 6 + drivers/gpu/drm/nouveau/nouveau_fbcon.c | 24 ++++ drivers/gpu/drm/qxl/qxl_display.c | 14 ++- drivers/hid/hid-apple.c | 6 + drivers/hid/hid-core.c | 6 + drivers/hid/hid-ids.h | 6 +- drivers/hid/usbhid/hid-quirks.c | 3 +- drivers/hwmon/nct6775.c | 16 ++- drivers/i2c/busses/i2c-designware-platdrv.c | 20 ++++ drivers/i2c/busses/i2c-rcar.c | 7 +- drivers/i2c/busses/i2c-s3c2410.c | 8 +- drivers/infiniband/ulp/isert/ib_isert.c | 9 +- drivers/input/joystick/Kconfig | 1 + drivers/input/keyboard/omap4-keypad.c | 2 +- drivers/input/mouse/psmouse-base.c | 4 + drivers/input/serio/parkbd.c | 1 + drivers/iommu/amd_iommu.c | 8 +- drivers/macintosh/windfarm_core.c | 2 +- drivers/md/dm-cache-policy-cleaner.c | 2 +- drivers/md/dm-raid.c | 3 +- drivers/md/dm-thin.c | 2 +- drivers/md/persistent-data/dm-btree-internal.h | 6 + drivers/md/persistent-data/dm-btree-remove.c | 12 +- drivers/md/persistent-data/dm-btree-spine.c | 37 +++++++ drivers/md/persistent-data/dm-btree.c | 7 +- drivers/media/platform/vsp1/vsp1_regs.h | 6 +- drivers/media/usb/gspca/m5602/m5602_s5k83a.c | 2 +- drivers/media/usb/usbvision/usbvision-video.c | 2 +- drivers/mtd/ubi/io.c | 5 + drivers/mtd/ubi/vtbl.c | 1 + drivers/mtd/ubi/wl.c | 1 + drivers/net/ppp/pppoe.c | 1 - drivers/net/usb/asix_devices.c | 16 +-- drivers/net/wireless/ath/ath9k/init.c | 1 + drivers/s390/char/con3270.c | 4 + drivers/s390/char/tty3270.c | 4 + drivers/scsi/3w-9xxx.c | 28 +++-- drivers/scsi/scsi_error.c | 11 +- drivers/spi/spi-pxa2xx.c | 4 + drivers/spi/spi.c | 3 +- drivers/staging/speakup/fakekey.c | 1 + drivers/usb/chipidea/debug.c | 6 + drivers/usb/class/usbtmc.c | 1 + drivers/usb/core/config.c | 5 +- drivers/usb/core/hcd-pci.c | 3 + drivers/usb/core/hub.c | 82 ++++++-------- drivers/usb/core/otg_whitelist.h | 5 + drivers/usb/core/quirks.c | 59 +++++++++- drivers/usb/host/pci-quirks.c | 12 ++ drivers/usb/host/xhci-mem.c | 6 +- drivers/usb/host/xhci-pci.c | 30 +++++ drivers/usb/host/xhci-ring.c | 145 ++++++++++++++++--------- drivers/usb/host/xhci.c | 11 +- drivers/usb/host/xhci.h | 1 + drivers/usb/musb/musb_cppi41.c | 15 ++- drivers/usb/serial/option.c | 24 ++++ drivers/usb/serial/symbolserial.c | 18 ++- drivers/usb/serial/whiteheat.c | 31 ++++++ fs/btrfs/backref.c | 8 +- fs/btrfs/extent_io.c | 80 +++++++++++--- fs/btrfs/inode.c | 3 +- fs/cifs/cifsencrypt.c | 52 ++++++++- fs/cifs/cifssmb.c | 5 +- fs/cifs/smb2ops.c | 8 +- fs/jbd2/checkpoint.c | 39 ++++++- fs/jbd2/commit.c | 2 +- fs/jbd2/journal.c | 11 +- include/asm-generic/barrier.h | 42 ++++--- include/linux/jbd2.h | 3 +- include/linux/security.h | 2 +- include/linux/skbuff.h | 6 +- include/linux/usb/hcd.h | 3 + include/linux/usb/quirks.h | 7 +- include/net/af_unix.h | 6 +- include/net/sock.h | 8 ++ include/xen/interface/sched.h | 8 ++ ipc/msg.c | 14 +-- ipc/shm.c | 12 +- ipc/util.c | 8 +- kernel/irq/proc.c | 19 +++- kernel/rcutree.c | 45 +++++++- kernel/sched/core.c | 18 ++- kernel/sched/sched.h | 5 +- kernel/workqueue.c | 8 +- mm/hugetlb.c | 8 ++ mm/slab.c | 13 ++- net/core/datagram.c | 6 +- net/core/ethtool.c | 2 +- net/core/skbuff.c | 9 +- net/ipv4/tcp_input.c | 2 +- net/ipv4/udp.c | 2 +- net/ipv6/raw.c | 2 +- net/ipv6/udp.c | 3 +- net/l2tp/l2tp_core.c | 11 +- net/netfilter/ipvs/ip_vs_sync.c | 2 +- net/netfilter/ipvs/ip_vs_xmit.c | 1 - net/netfilter/nf_conntrack_expect.c | 3 +- net/netfilter/nf_conntrack_netlink.c | 5 - net/rxrpc/ar-recvmsg.c | 3 +- net/unix/af_unix.c | 16 ++- sound/arm/Kconfig | 15 +-- sound/pci/hda/patch_cirrus.c | 57 +++++++++- sound/soc/dwc/designware_i2s.c | 4 +- sound/soc/pxa/Kconfig | 2 - sound/soc/pxa/pxa2xx-ac97.c | 4 +- sound/synth/emux/emux_oss.c | 3 +- tools/perf/builtin-stat.c | 5 +- tools/perf/util/header.c | 4 +- tools/perf/util/hist.c | 3 + virt/kvm/kvm_main.c | 19 +++- 159 files changed, 1221 insertions(+), 854 deletions(-) delete mode 100644 arch/arc/include/asm/barrier.h delete mode 100644 arch/cris/include/asm/barrier.h delete mode 100644 arch/hexagon/include/asm/barrier.h delete mode 100644 arch/microblaze/include/asm/barrier.h delete mode 100644 arch/mn10300/include/asm/barrier.h delete mode 100644 arch/parisc/include/asm/barrier.h delete mode 100644 arch/score/include/asm/barrier.h
Jiri Slaby
AppliedQuoted 3 lines · Nikolay Borisov
I think you should also add this patch:
Applied. Thanks.
Signature · 2 lines
js suse labs