3.6.11.4-stable review
Subsystems (74)
Steven Rostedt
maintainercover 3.6.11.4-stable review
This is the start of the stable review cycle for 3.6.11.4 release. There are 136 patches in this series, which will be posted as responses to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon May 20 2013. Anything received after that time might be too late.
Aaron Lu (1):
acpi: make ata_ap_acpi_handle not block
[d66af4df0837f21bf267305dc5ccab2d29e24d86]
Adrian Thomasset (2):
USB: ftdi_sio: enable two UART ports on ST Microconnect Lite
[71d9a2b95fc9c9474d46d764336efd7a5a805555]
USB: ftdi_sio: correct ST Micro Connect Lite PIDs
[9f06d15f8db6946e41f73196a122b84a37938878]
Alex A. Mihaylov (1):
rt2x00: Fix transmit power troubles on some Ralink RT30xx cards
[7e9dafd873034dd64ababcb858be424c4780ae13]Alex Deucher (16):
drm/radeon: fix handling of v6 power tables
[441e76ca83ac604eaf0f046def96d8e3a27eea28]
drm/radeon: add new richland pci ids
[62d1f92e06aef9665d71ca7e986b3047ecf0b3c7]
drm/radeon: fix possible segfault when parsing pm tables
[f8e6bfc2ce162855fa4f9822a45659f4b542c960]
drm/radeon: fix endian bugs in atom_allocate_fb_scratch()
[beb71fc61c2cad64e347f164991b8ef476529e64]
drm/radeon: fix typo in si_select_se_sh()
[79b52d6a7085a3e430c6de450a5847fdbe04159b]
drm/radeon: fix hdmi mode enable on RS600/RS690/RS740
[dcb852905772416e322536ced5cb3c796d176af5]
drm/radeon: cleanup properly if mmio mapping fails
[0cd9cb76ae26a19df21abc6f94f5fff141e689c7]
drm/radeon/evergreen+: don't enable HPD interrupts on eDP/LVDS
[2e97be73e5f74a317232740ae82eb8f95326a660]
drm/radeon: add some new SI PCI ids
[18932a28419596bc9403770f5d8a108c5433fe59]
drm/radeon: disable the crtcs in mc_stop (evergreen+) (v2)
[abf1457bbbe4c62066bd03c6d31837dea28644dc]
drm/radeon: update wait_for_vblank for r1xx-r4xx
[2b48b968c0d00aa5ab520b65a15a4f374cda7dda]
drm/radeon: update wait_for_vblank for evergreen+
[10257a6d8359c41407eb26b7ad7bf710a7e00155]
drm/radeon: update wait_for_vblank for r5xx-r7xx
[bea5497bfc1067620c8c8e9d37a42e0bb6d7d7fa]
drm/radeon/dce6: add missing display reg for tiling setup
[7c1c7c18fc752b2a1d07597286467ef186312463]
drm/radeon: use frac fb div on RS780/RS880
[411678288d61ba17afe1f8afed92200be6bbc65d]
drm/radeon: don't use get_engine_clock() on APUs
[bf05d9985111f85ed6922c134567b96eb789283b]
Anisse Astier (1):
drm/gma500: fix backlight hotkeys behaviour on netbooks
[e127dc28cc3057575da0216cde85687153ca180f]
Anton Blanchard (1):
powerpc: Emulate non privileged DSCR read and write
[73d2fb758e678c93bc76d40876c2359f0729b0ef]
Anurup m (1):
fs/fscache/stats.c: fix memory leak
[ec686c9239b4d472052a271c505d04dae84214cc]
Ben Jencks (1):
usb/misc/appledisplay: Add 24" LED Cinema display
[e7d3b6e22c871ba36d052ca99bc8ceca4d546a60]
Benjamin Herrenschmidt (1):
net/eth/ibmveth: Fixup retrieval of MAC address
[13f85203e1060da83d9ec1c1c5a63343eaab8de4]
Bjørn Mork (1):
USB: option: add a D-Link DWM-156 variant
[a2a2d6c7f93e160b52a4ad0164db1f43f743ae0f]
Bryan Schumaker (1):
nfsd: Decode and send 64bit time values
[bf8d909705e9d9bac31d9b8eac6734d2b51332a7]
Calvin Owens (1):
ALSA: usb: Add quirk for 192KHz recording on E-Mu devices
[1539d4f82ad534431cc67935e8e442ccf107d17d]
Catalin Marinas (1):
arm: set the page table freeing ceiling to TASK_SIZE
[104ad3b32d7a71941c8ab2dee78eea38e8a23309]
Chen Gang (1):
kernel/audit_tree.c: tree will leak memory when failure occurs in audit_trim_trees()
[12b2f117f3bf738c1a00a6f64393f1953a740bd4]
Chris Wilson (3):
drm/i915: Use MLC (l3$) for context objects
[4615d4c9e27eda42c3e965f208a4b4065841498c]
drm/i915: Workaround incoherence between fences and LLC across multiple CPUs
[25ff1195f8a0b3724541ae7bbe331b4296de9c06]
drm/i915: Fix detection of base of stolen memory
[e12a2d53ae45a69aea499b64f75e7222cca0f12f]
Christian Lamparter (1):
drm/i915: Add no-lvds quirk for Fujitsu Esprimo Q900
[9e9dd0e889c76c786e8f2e164c825c3c06dea30c]
Clemens Ladisch (1):
ALSA: usb-audio: disable autopm for MIDI devices
[cbc200bca4b51a8e2406d4b654d978f8503d430b]
Daniel Lezcano (1):
ARM: omap3: cpuidle: enable time keeping
[0d97558901c446a989de202a5d9ae94ec53644e5]
Daniel Mack (1):
ALSA: snd-usb: try harder to find USB_DT_CS_ENDPOINT
[ebfc594c02148b6a85c2f178cf167a44a3c3ce10]
Dave Airlie (4):
drm/ast: deal with bo reserve fail in dirty update path
[306373b645d80625335b8e684fa09b14ba460cec]
drm/prime: keep a reference from the handle to exported dma-buf (v6)
[219b47339ced80ca580bb6ce7d1636166984afa7]
drm/mgag200: deal with bo reserve fail in dirty update path
[641719599528d806e00de8ae8c8453361266a312]
drm/cirrus: deal with bo reserve fail in dirty update path
[f3b2bbdc8a87a080ccd23d27fca4b87d61340dd4]
David Engraf (1):
hrtimer: Fix ktime_add_ns() overflow on 32bit architectures
[51fd36f3fad8447c487137ae26b9d0b3ce77bb25]
David Jeffery (1):
autofs - remove autofs dentry mount check
[ce8a5dbdf9e709bdaf4618d7ef8cceb91e8adc69]
David Müller (ELSOFT AG) (1):
drm/i915: Fall back to bit banging mode for DVO transmitter detection
[e4bfff54ed3f5de88f5358504c78c2cb037813aa]
Derek Basehore (1):
drivers/rtc/rtc-cmos.c: don't disable hpet emulation on suspend
[e005715efaf674660ae59af83b13822567e3a758]
Dmitry Monakhov (3):
ext4: fix big-endian bug in metadata checksum calculations
[171a7f21a76a0958c225b97c00a97a10390d40ee]
ext4: fix journal callback list traversal
[5d3ee20855e28169d711b394857ee608a5023094]
jbd2: fix race between jbd2_journal_remove_checkpoint and ->j_commit_callback
[794446c6946513c684d448205fbd76fa35f38b72]Duncan Laurie (1):
TPM: Retry SaveState command in suspend path
[32d33b29ba077d6b45de35f2181e0a7411b162f4]
Dylan Reid (1):
ASoC: max98088: Fix logging of hardware revision.
[98682063549bedd6e2d2b6b7222f150c6fbce68c]
Emmanuel Grumbach (1):
iwlwifi: dvm: don't send zeroed LQ cmd
[63b77bf489881747c5118476918cc8c29378ee63]
Federico Vaga (1):
serial_core.c: add put_device() after device_find_child()
[5a65dcc04cda41f4122aacc37a5a348454645399]
Filippo Turato (1):
USB: serial: option: Added support Olivetti Olicard 145
[d19bf5cedfd7d53854a3bd699c98b467b139833b]
Florian Westphal (3):
netfilter: xt_rpfilter: skip locally generated broadcast/multicast, too
[f83a7ea2075ca896f2dbf07672bac9cf3682ff74]
netfilter: ctnetlink: don't permit ct creation with random tuple
[442fad9423b78319e0019a7f5047eddf3317afbc]
netfilter: nf_ct_helper: don't discard helper if it is actually the same
[6e2f0aa8cf8892868bf2c19349cb5d7c407f690d]
Gleb Natapov (1):
KVM: X86 emulator: fix source operand decoding for 8bit mov[zs]x instructions
[660696d1d16a71e15549ce1bf74953be1592bcd3]
Greg Thelen (1):
fs/dcache.c: add cond_resched() to shrink_dcache_parent()
[421348f1ca0bf17769dee0aed4d991845ae0536d]
Hans Schillstrom (1):
ipvs: ip_vs_sip_fill_param() BUG: bad check of return value
[f7a1dd6e3ad59f0cfd51da29dfdbfd54122c5916]
Hans de Goede (1):
usbfs: Always allow ctrl requests with USB_RECIP_ENDPOINT on the ctrl ep
[1361bf4b9f9ef45e628a5b89e0fd9bedfdcb7104]
Heiko Carstens (1):
s390/memory hotplug: prevent offline of active memory increments
[94c163663fc1dcfc067a5fb3cc1446b9469975ce]
Hugh Dickins (1):
mm: allow arch code to control the user page table ceiling
[6ee8630e02be6dd89926ca0fbc21af68b23dc087]
J. Bruce Fields (1):
nfsd4: don't close read-write opens too soon
[0c7c3e67ab91ec6caa44bdf1fc89a48012ceb0c5]
Jacob Keller (1):
ixgbe: fix EICR write in ixgbe_msix_other
[d87d830720a1446403ed38bfc2da268be0d356d1]
Jan-Simon Möller (1):
perf/x86/intel: Fix unintended variable name reuse
[1b0dac2ac6debdbf1541e15f2cede03613cf4465]
Jerome Marchand (1):
swap: redirty page if page write fails on swap file
[2d30d31ea3c5be426ce25607b9bd1835acb85e0a]
Jerry Hoemann (1):
x86/mm: account for PGDIR_SIZE alignment
Johan Hovold (1):
mmc: at91/avr32/atmel-mci: fix DMA-channel leak on module unload
[91cf54feecf815bec0b6a8d6d9dbd0e219f2f2cc]
Johannes Berg (1):
wireless: regulatory: fix channel disabling race condition
[990de49f74e772b6db5208457b7aa712a5f4db86]
Josef Bacik (1):
Btrfs: compare relevant parts of delayed tree refs
[41b0fc42800569f63e029549b75c4c9cb63f2dfd]
Jozsef Kadlecsik (2):
netfilter: ipset: "Directory not empty" error message
[dd82088dab3646ed28e4aa43d1a5b5d5ffc2afba]
netfilter: ipset: list:set: fix reference counter update
[02f815cb6d3f57914228be84df9613ee5a01c2e6]
Konrad Rzeszutek Wilk (3):
xen/smp/spinlock: Fix leakage of the spinlock interrupt line for every CPU online/offline
[66ff0fe9e7bda8aec99985b24daad03652f7304e]
xen/smp: Fix leakage of timer interrupt line for every CPU online/offline.
[888b65b4bc5e7fcbbb967023300cd5d44dba1950]
xen/time: Fix kasprintf splat when allocating timer%d IRQ line.
[7918c92ae9638eb8a6ec18e2b4a0de84557cccc8]
Konstantin Khlebnikov (1):
e1000e: fix runtime power management transitions
[66148babe728f3e00e13c56f6b0ecf325abd80da]
Lars-Peter Clausen (1):
mfd: adp5520: Restore mode bits on resume
[c6cc25fda58da8685ecef3f179adc7b99c8253b2]
Li Fei (1):
x86: Eliminate irq_mis_count counted in arch_irq_stat
[f7b0e1055574ce06ab53391263b4e205bf38daf3]
Li Zefan (1):
cgroup: fix an off-by-one bug which may trigger BUG_ON()
[3ac1707a13a3da9cfc8f242a15b2fae6df2c5f88]
Linus Torvalds (2):
s390: move dummy io_remap_pfn_range() to asm/pgtable.h
[4f2e29031e6c67802e7370292dd050fd62f337ee]
tty: fix up atime/mtime mess, take three
[b0b885657b6c8ef63a46bc9299b2a7715d19acde]
Linus Walleij (1):
ARM: u300: fix ages old copy/paste bug
[0259d9eb30d003af305626db2d8332805696e60d]
Maxime Ripard (1):
ARM: at91: Fix typo in restart code panic message
[e7619459d47a673af3433208a42f583af920e9db]
Mel Gorman (1):
mm: swap: mark swap pages writeback before queueing for direct IO
[0cdc444a67ccdbd58bfbcba865cb17a9f17a7691]
Michael Ellerman (1):
powerpc/spufs: Initialise inode->i_ino in spufs_new_inode()
[6747e83235caecd30b186d1282e4eba7679f81b7]Michael Grzeschik (2):
usb: chipidea: udc: fix memory leak in _ep_nuke
[7ca2cd291fd84ae499390f227a255ccba2780a81]
usb: chipidea: udc: fix memory access of shared memory on armv5 machines
[a9c174302b1590ef3ead485d804a303c5f89174b]
Michael Neuling (1):
powerpc: Add isync to copy_and_flush
[29ce3c5073057991217916abc25628e906911757]
Ming Lei (1):
sysfs: fix use after free in case of concurrent read/write and readdir
[f7db5e7660b122142410dcf36ba903c73d473250]
Namhyung Kim (3):
tracing: Reset ftrace_graph_filter_enabled if count is zero
[9f50afccfdc15d95d7331acddcb0f7703df089ae]
tracing: Check return value of tracing_init_dentry()
[ed6f1c996bfe4b6e520cf7a74b51cd6988d84420]
tracing: Fix off-by-one on allocating stat->pages
[39e30cd1537937d3c00ef87e865324e981434e5b]NeilBrown (1):
md: bad block list should default to disabled.
[486adf72ccc0c235754923d47a2270c5dcb0c98b]
Oleg Nesterov (1):
exec: do not abuse ->cred_guard_mutex in threadgroup_lock()
[e56fb2874015370e3b7f8d85051f6dce26051df9]Patrick McHardy (1):
netfilter: nf_ct_sip: don't drop packets with offsets pointing outside the packet
[3a7b21eaf4fb3c971bdb47a98f570550ddfe4471]
Paulo Zanoni (1):
drm/i915: set CPT FDI RX polarity bits based on VBT
[3f704fa2778d3fe45e6529825a5c7a8bcbc686f4]
Peter Zijlstra (2):
perf/x86/intel/lbr: Demand proper privileges for PERF_SAMPLE_BRANCH_KERNEL
[7cc23cd6c0c7d7f4bee057607e7ce01568925717]
perf/x86/intel/lbr: Fix LBR filter
[6e15eb3ba6c0249c9e8c783517d131b47db995ca]
Philip Rakity (1):
mmc: core: Fix bit width test failing on old eMMC cards
[836dc2fe89c968c10cada87e0dfae6626f8f9da3]
Prarit Bhargava (1):
hrtimer: Add expiry time overflow check in hrtimer_interrupt
[8f294b5a139ee4b75e890ad5b443c93d1e558a8b]
Rafael J. Wysocki (2):
PCI/PM: Clear state_saved during suspend
[82fee4d67ab86d6fe5eb0f9a9e988ca9d654d765]
PCI/PM: Fix fallback to PCI_D0 in pci_platform_power_transition()
[769ba7212f2059ca9fe0c73371e3d415c8c1c529]
Richard Cochran (1):
gianfar: do not advertise any alarm capability.
[cd4baaaa04b4aaa3b0ec4d13a6f3d203b92eadbd]
Robin Holt (1):
ipc: sysv shared memory limited to 8TiB
[d69f3bad4675ac519d41ca2b11e1c00ca115cecd]
Sarah Sharp (1):
xhci: Don't warn on empty ring for suspended devices.
[a83d6755814e4614ba77e15d82796af0f695c6b8]
Shaohua Li (1):
MD: ignore discard request for hard disks of hybid raid1/raid10 array
[32f9f570d04461a41bdcd5c1d93b41ebc5ce182a]
Shengzhou Liu (1):
usb: remove redundant tdi_reset
[61ac6ac8d662ac7ac67c864954d39d1b19948354]
Stanislaw Gruszka (1):
iwlwifi: fix freeing uninitialized pointer
[3309ccf7fcebceef540ebe90c65d2f94d745a45b]
Stefan Bader (1):
r8169: fix 8168evl frame padding.
[e5195c1f31f399289347e043d6abf3ffa80f0005]Stefani Seibold (1):
USB: add ftdi_sio USB ID for GDM Boost V1.x
[58f8b6c4fa5a13cb2ddb400e26e9e65766d71e38]
Stephan Schreiber (2):
Wrong asm register contraints in the kvm implementation
[de53e9caa4c6149ef4a78c2f83d7f5b655848767]
Wrong asm register contraints in the futex implementation
[136f39ddc53db3bcee2befbe323a56d4fbf06da8]
Steven A. Falco (1):
i2c: xiic: must always write 16-bit words to TX_FIFO
[c39e8e4354ce4daf23336de5daa28a3b01f00aa6]
Steven Rostedt (Red Hat) (4):
tracing: Fix ftrace_dump()
[7fe70b579c9e3daba71635e31b6189394e7b79d3]
tracing: Remove most or all of stack tracer stack size from stack_max_size
[4df297129f622bdc18935c856f42b9ddd18f9f28]
tracing: Fix stack tracer with fentry use
[d4ecbfc49b4b1d4b597fb5ba9e4fa25d62f105c5]
tracing: Use stack of calling function for stack tracer
[87889501d0adfae10e3b0f0e6f2d7536eed9ae84]
Takashi Iwai (2):
ALSA: usb-audio: Fix autopm error during probing
[60af3d037eb8c670dcce31401501d1271e7c5d95]
ALSA: usb-audio: Fix missing autopm for MIDI input
[f5f165418cabf2218eb466c0e94693b8b1aee88b]
Terry Barnaby (1):
mmc: atmel-mci: pio hang on block errors
[bdbc5d0c60f3e9de3eeccf1c1a18bdc11dca62cc]
Theodore Ts'o (4):
ext4: add check for inodes_count overflow in new resize ioctl
[3f8a6411fbada1fa482276591e037f3b1adcf55b]
ext4: fix Kconfig documentation for CONFIG_EXT4_DEBUG
[7f3e3c7cfcec148ccca9c0dd2dbfd7b00b7ac10f]
ext4: fix online resizing for ext3-compat file systems
[c5c72d814cf0f650010337c73638b25e6d14d2d4]
ext4/jbd2: don't wait (forever) for stale tid caused by wraparound
[d76a3a77113db020d9bb1e894822869410450bd9]
Thomas Gleixner (1):
clockevents: Set dummy handler on CPU_DEAD shutdown
[6f7a05d7018de222e40ca003721037a530979974]
Tony Luck (1):
Fix initialization of CMCI/CMCP interrupts
[d303e9e98fce56cdb3c6f2ac92f626fc2bd51c77]
Tormod Volden (1):
usb-storage: CY7C68300A chips do not support Cypress ATACB
[671b4b2ba9266cbcfe7210a704e9ea487dcaa988]
Trond Myklebust (2):
NFSv4: Handle NFS4ERR_DELAY and NFS4ERR_GRACE in nfs4_open_delegation_recall
[8b6cc4d6f841d31f72fe7478453759166d366274]
LOCKD: Ensure that nlmclnt_block resets block->b_status after a server reboot
[1dfd89af8697a299e7982ae740d4695ecd917eef]Vaidyanathan Srinivasan (1):
powerpc: fix numa distance for form0 device tree
[7122beeee7bc1757682049780179d7c216dd1c83]
Vince Weaver (1):
perf/x86/intel: Add support for IvyBridge model 58 Uncore
[9a6bc14350b130427725f33e371e86212fa56c85]
Yinghai Lu (1):
PCI / ACPI: Don't query OSC support with all possible controls
[545d6e189a41c94c11f55045a771118eccc9d9eb]
Yogesh Ashok Powar (2):
mwifiex: Call pci_release_region after calling pci_disable_device
[5b0d9b218b74042ff72bf4bfda6eeb2e4bf98397]
mwifiex: Use pci_release_region() instead of a pci_release_regions()
[c380aafb77b7435d010698fe3ca6d3e1cd745fde]
Zhao Hongjiang (1):
inotify: invalid mask should return a error number but not set it
[04df32fa10ab9a6f0643db2949d42efc966bc844]
fanchaoting (1):
nfsd: don't run get_file if nfs4_preprocess_stateid_op return error
[b022032e195ffca83d7002d6b84297d796ed443b]
----
arch/arm/configs/at91sam9g45_defconfig | 1 - arch/arm/include/asm/pgtable.h | 9 +++ arch/arm/mach-at91/setup.c | 2 +- arch/arm/mach-omap2/cpuidle34xx.c | 5 +- arch/arm/mach-u300/include/mach/u300-regs.h | 2 +- arch/avr32/configs/favr-32_defconfig | 1 - arch/avr32/configs/merisc_defconfig | 1 - arch/ia64/include/asm/futex.h | 5 +- arch/ia64/include/asm/mca.h | 1 + arch/ia64/kernel/irq.c | 8 +++ arch/ia64/kernel/mca.c | 37 +++++++---- arch/ia64/kvm/vtlb.c | 2 +- arch/powerpc/include/asm/ppc-opcode.h | 4 ++ arch/powerpc/kernel/head_64.S | 1 + arch/powerpc/kernel/traps.c | 10 ++- arch/powerpc/mm/numa.c | 2 +- arch/powerpc/platforms/cell/spufs/inode.c | 1 + arch/s390/include/asm/pgtable.h | 4 ++ arch/x86/kernel/cpu/perf_event_intel_lbr.c | 27 +++++++-- arch/x86/kernel/cpu/perf_event_intel_uncore.c | 17 +++--- arch/x86/kernel/irq.c | 4 -- arch/x86/kvm/emulate.c | 4 ++ arch/x86/mm/init.c | 5 ++ arch/x86/xen/enlighten.c | 5 +- arch/x86/xen/smp.c | 2 + arch/x86/xen/time.c | 6 +- drivers/acpi/pci_root.c | 4 +- drivers/ata/libata-acpi.c | 45 ++++++++------ drivers/char/tpm/tpm.c | 32 ++++++++-- drivers/char/tpm/tpm.h | 2 + drivers/gpu/drm/ast/ast_drv.h | 2 + drivers/gpu/drm/ast/ast_fb.c | 43 ++++++++++++- drivers/gpu/drm/ast/ast_ttm.c | 2 +- drivers/gpu/drm/cirrus/cirrus_drv.h | 2 + drivers/gpu/drm/cirrus/cirrus_fbdev.c | 38 +++++++++++- drivers/gpu/drm/cirrus/cirrus_ttm.c | 2 +- drivers/gpu/drm/drm_gem.c | 4 +- drivers/gpu/drm/drm_prime.c | 76 ++++++++++++----------- drivers/gpu/drm/gma500/psb_irq.c | 2 +- drivers/gpu/drm/i915/i915_drv.h | 2 + drivers/gpu/drm/i915/i915_gem.c | 28 +++++++-- drivers/gpu/drm/i915/i915_gem_context.c | 7 +++ drivers/gpu/drm/i915/i915_gem_stolen.c | 81 +++++++++++++------------ drivers/gpu/drm/i915/i915_reg.h | 1 + drivers/gpu/drm/i915/intel_bios.c | 6 +- drivers/gpu/drm/i915/intel_bios.h | 4 +- drivers/gpu/drm/i915/intel_dvo.c | 13 +++- drivers/gpu/drm/i915/intel_lvds.c | 8 +++ drivers/gpu/drm/i915/intel_pm.c | 9 ++- drivers/gpu/drm/mgag200/mgag200_drv.h | 2 + drivers/gpu/drm/mgag200/mgag200_fb.c | 43 ++++++++++++- drivers/gpu/drm/mgag200/mgag200_ttm.c | 4 +- drivers/gpu/drm/radeon/atom.c | 6 +- drivers/gpu/drm/radeon/atombios_crtc.c | 3 + drivers/gpu/drm/radeon/evergreen.c | 66 +++++++++++++++++--- drivers/gpu/drm/radeon/ni.c | 8 ++- drivers/gpu/drm/radeon/nid.h | 4 ++ drivers/gpu/drm/radeon/r100.c | 77 +++++++++++++++-------- drivers/gpu/drm/radeon/r600_hdmi.c | 4 +- drivers/gpu/drm/radeon/radeon_atombios.c | 21 ++++--- drivers/gpu/drm/radeon/radeon_kms.c | 4 ++ drivers/gpu/drm/radeon/radeon_pm.c | 6 +- drivers/gpu/drm/radeon/rs600.c | 54 ++++++++++++++--- drivers/gpu/drm/radeon/si.c | 3 +- drivers/gpu/drm/radeon/sid.h | 2 + drivers/i2c/busses/i2c-xiic.c | 6 +- drivers/md/md.c | 9 +-- drivers/md/raid1.c | 7 ++- drivers/md/raid10.c | 6 ++ drivers/mfd/adp5520.c | 8 ++- drivers/mmc/core/mmc.c | 2 +- drivers/mmc/host/Kconfig | 10 --- drivers/mmc/host/atmel-mci.c | 16 +++-- drivers/net/ethernet/freescale/gianfar_ptp.c | 3 +- drivers/net/ethernet/ibm/ibmveth.c | 23 +++---- drivers/net/ethernet/intel/e1000e/netdev.c | 78 ++++++------------------ drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 10 +++ drivers/net/ethernet/realtek/r8169.c | 9 +++ drivers/net/wireless/iwlwifi/dvm/debugfs.c | 16 ++--- drivers/net/wireless/iwlwifi/dvm/sta.c | 5 +- drivers/net/wireless/mwifiex/pcie.c | 4 +- drivers/net/wireless/rt2x00/rt2800lib.c | 10 ++- drivers/pci/pci-driver.c | 4 ++ drivers/pci/pci.c | 12 ++-- drivers/rtc/rtc-cmos.c | 4 +- drivers/s390/char/sclp_cmd.c | 4 +- drivers/tty/pty.c | 3 + drivers/tty/serial/serial_core.c | 4 ++ drivers/tty/tty_io.c | 4 +- drivers/usb/chipidea/udc.c | 8 +++ drivers/usb/chipidea/udc.h | 4 +- drivers/usb/core/devio.c | 2 + drivers/usb/host/ehci-hcd.c | 3 - drivers/usb/host/xhci-ring.c | 23 ++++--- drivers/usb/misc/appledisplay.c | 1 + drivers/usb/serial/ftdi_sio.c | 23 ++++--- drivers/usb/serial/ftdi_sio_ids.h | 4 +- drivers/usb/serial/option.c | 8 +++ drivers/usb/storage/cypress_atacb.c | 16 ++++- fs/autofs4/expire.c | 9 --- fs/btrfs/delayed-ref.c | 24 +++++--- fs/dcache.c | 4 +- fs/exec.c | 7 ++- fs/ext4/Kconfig | 3 +- fs/ext4/ext4_jbd2.h | 6 +- fs/ext4/fsync.c | 3 +- fs/ext4/inode.c | 11 ++-- fs/ext4/mballoc.c | 8 +-- fs/ext4/mmp.c | 2 +- fs/ext4/resize.c | 6 ++ fs/ext4/super.c | 7 ++- fs/fscache/stats.c | 2 +- fs/jbd2/commit.c | 50 ++++++++------- fs/jbd2/journal.c | 31 ++++++++++ fs/lockd/clntlock.c | 3 + fs/nfs/nfs4proc.c | 6 ++ fs/nfsd/nfs4proc.c | 8 +-- fs/nfsd/nfs4state.c | 8 +-- fs/nfsd/nfs4xdr.c | 19 ++---- fs/notify/inotify/inotify_user.c | 6 +- fs/sysfs/dir.c | 15 +++-- include/asm-generic/pgtable.h | 10 +++ include/drm/drmP.h | 5 +- include/drm/drm_pciids.h | 5 ++ include/linux/ipc_namespace.h | 2 +- include/linux/jbd2.h | 2 + include/linux/sched.h | 18 ++---- ipc/shm.c | 2 +- kernel/audit_tree.c | 2 +- kernel/cgroup.c | 2 +- kernel/hrtimer.c | 6 ++ kernel/time/tick-broadcast.c | 4 ++ kernel/time/tick-common.c | 1 + kernel/trace/ftrace.c | 5 +- kernel/trace/trace.c | 64 +++++++++---------- kernel/trace/trace_selftest.c | 9 +-- kernel/trace/trace_stack.c | 76 ++++++++++++++++++++--- kernel/trace/trace_stat.c | 2 + mm/mmap.c | 4 +- mm/page_io.c | 17 ++++++ net/ipv4/netfilter/ipt_rpfilter.c | 8 ++- net/ipv6/netfilter/ip6t_rpfilter.c | 8 ++- net/netfilter/ipset/ip_set_core.c | 3 +- net/netfilter/ipset/ip_set_list_set.c | 10 ++- net/netfilter/ipvs/ip_vs_pe_sip.c | 6 +- net/netfilter/nf_conntrack_helper.c | 4 +- net/netfilter/nf_conntrack_netlink.c | 3 + net/netfilter/nf_conntrack_sip.c | 2 +- net/wireless/reg.c | 2 +- sound/soc/codecs/max98088.c | 2 +- sound/usb/card.c | 4 +- sound/usb/card.h | 1 + sound/usb/midi.c | 69 +++++++++++---------- sound/usb/pcm.c | 2 +- sound/usb/quirks.c | 1 + sound/usb/stream.c | 9 +++ 156 files changed, 1246 insertions(+), 597 deletions(-)
Steven Rostedt
maintainerPATCH 1/136 USB: serial: option: Added support Olivetti Olicard 145
3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Filippo Turato <[email protected]>
[ Upstream commit d19bf5cedfd7d53854a3bd699c98b467b139833b ]
This adds PID for Olivetti Olicard 145 in option.c
--- drivers/usb/serial/option.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/serial/option.c +2 -0
@@ -344,6 +344,7 @@ static void option_instat_callback(struct urb *urb);/* Olivetti products */ #define OLIVETTI_VENDOR_ID 0x0b3c#define OLIVETTI_PRODUCT_OLICARD100 0xc000 +#define OLIVETTI_PRODUCT_OLICARD145 0xc003/* Celot products */ #define CELOT_VENDOR_ID 0x211f
@@ -1227,6 +1228,7 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) }, { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) }, + { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD145) }, { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */ { USB_DEVICE(ONDA_VENDOR_ID, ONDA_MT825UP) }, /* ONDA MT825UP modem */ { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_GT_B3730, USB_CLASS_CDC_DATA, 0x00, 0x00) }, /* Samsung GT-B3730 LTE USB modem.*/
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 2/136 USB: option: add a D-Link DWM-156 variant
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <[email protected]>
[ Upstream commit a2a2d6c7f93e160b52a4ad0164db1f43f743ae0f ]
Adding support for a Mediatek based device labelled as D-Link Model: DWM-156, H/W Ver: A7
Also adding two other device IDs found in the Debian(!) packages included on the embedded device driver CD.
This is a composite MBIM + serial ports + card reader device:
T: Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 14 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2001 ProdID=7d01 Rev= 3.00 S: Manufacturer=D-Link,Inc S: Product=D-Link DWM-156 C:* #Ifs= 7 Cfg#= 1 Atr=a0 MxPwr=500mA A: FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00 I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim E: Ad=88(I) Atr=03(Int.) MxPS= 64 Ivl=125us I: If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=02 Prot=01 Driver=option E: Ad=87(I) Atr=03(Int.) MxPS= 64 Ivl=500us E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 6 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
--- drivers/usb/serial/option.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/usb/serial/option.c +6 -0
@@ -1298,6 +1298,12 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FPDC_1COM, 0x0a, 0x00, 0x00) }, { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FPDC_2COM, 0x0a, 0x00, 0x00) }, { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) }, + { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d01, 0xff, 0x02, 0x01) }, /* D-Link DWM-156 (variant) */ + { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d01, 0xff, 0x00, 0x00) }, /* D-Link DWM-156 (variant) */ + { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d02, 0xff, 0x02, 0x01) }, + { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d02, 0xff, 0x00, 0x00) }, + { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x02, 0x01) }, + { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x00, 0x00) }, { } /* Terminating entry */ };MODULE_DEVICE_TABLE (usb, option_ids);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 3/136 ARM: omap3: cpuidle: enable time keeping
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Daniel Lezcano <[email protected]>
[ Upstream commit 0d97558901c446a989de202a5d9ae94ec53644e5 ]
The TIME_VALID flag is specified for the different states but the time residency computation is not done, no tk flag, no time computation in the idle function.
Set the en_core_tk_irqen flag to activate it.
--- arch/arm/mach-omap2/cpuidle34xx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/cpuidle34xx.c +3 -2
@@ -265,8 +265,9 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev, DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev);struct cpuidle_driver omap3_idle_driver = { - .name ="omap3_idle" , - .owner =THIS_MODULE , + .name ="omap3_idle" , + .owner =THIS_MODULE , + .en_core_tk_irqen =1 , .states = { { .enter = omap3_enter_idle_bm,
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 4/136 ARM: u300: fix ages old copy/paste bug
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Linus Walleij <[email protected]>
[ Upstream commit 0259d9eb30d003af305626db2d8332805696e60d ]
The UART1 is on the fast AHB bridge, not on the slow bus.
--- arch/arm/mach-u300/include/mach/u300-regs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-u300/include/mach/u300-regs.h +1 -1
@@ -101,7 +101,7 @@#ifdef CONFIG_MACH_U300_BS335 /* Fast UART1 on U335 only */ -#define U300_UART1_BASE (U300_SLOW_PER_PHYS_BASE+0x7000) +#define U300_UART1_BASE (U300_FAST_PER_PHYS_BASE+0x7000)#endif /*
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 5/136 ARM: at91: Fix typo in restart code panic message
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Maxime Ripard <[email protected]>
[ Upstream commit e7619459d47a673af3433208a42f583af920e9db ]
--- arch/arm/mach-at91/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-at91/setup.c +1 -1
@@ -330,7 +330,7 @@ static void at91_dt_rstc(void) of_id =of_match_node (rstc_ids, np);if (!of_id) -panic ("AT91: rtsc no restart function availlable\n" ); +panic ("AT91: rtsc no restart function available\n" ); arm_pm_restart = of_id->data;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 6/136 powerpc: Add isync to copy_and_flush
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Michael Neuling <[email protected]>
[ Upstream commit 29ce3c5073057991217916abc25628e906911757 ]
In __after_prom_start we copy the kernel down to zero in two calls to copy_and_flush. After the first call (copy from 0 to copy_to_here:) we jump to the newly copied code soon after.
Unfortunately there's no isync between the copy of this code and the jump to it. Hence it's possible that stale instructions could still be in the icache or pipeline before we branch to it.
We've seen this on real machines and it's results in no console output after:
calling quiesce...
returning from prom_init
The below adds an isync to ensure that the copy and flushing has completed before any branching to the new instructions occurs.
--- arch/powerpc/kernel/head_64.S | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/kernel/head_64.S +1 -0
@@ -489,6 +489,7 @@ _GLOBAL(copy_and_flush) sync addi r5,r5,8 addi r6,r6,8 + isync blr .align 8
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 7/136 powerpc/spufs: Initialise inode->i_ino in spufs_new_inode()
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Michael Ellerman <[email protected]>
[ Upstream commit 6747e83235caecd30b186d1282e4eba7679f81b7 ]
In commit 85fe402 (fs: do not assign default i_ino in new_inode), the initialisation of i_ino was removed from new_inode() and pushed down into the callers. However spufs_new_inode() was not updated.
This exhibits as no files appearing in /spu, because all our dirents have a zero inode, which readdir() seems to dislike.
--- arch/powerpc/platforms/cell/spufs/inode.c | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/platforms/cell/spufs/inode.c +1 -0
@@ -99,6 +99,7 @@ spufs_new_inode(struct super_block *sb, umode_t mode)if (!inode) goto out; + inode->i_ino =get_next_ino (); inode->i_mode = mode; inode->i_uid =current_fsuid (); inode->i_gid =current_fsgid ();
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 8/136 iwlwifi: fix freeing uninitialized pointer
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Stanislaw Gruszka <[email protected]>
[ Upstream commit 3309ccf7fcebceef540ebe90c65d2f94d745a45b ]
If on iwl_dump_nic_event_log() error occurs before that function initialize buf, we process uninitiated pointer in iwl_dbgfs_log_event_read() and can hit "BUG at mm/slub.c:3409"
Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=951241
--- drivers/net/wireless/iwlwifi/dvm/debugfs.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/net/wireless/iwlwifi/dvm/debugfs.c +8 -8
@@ -2237,15 +2237,15 @@ static ssize_t iwl_dbgfs_log_event_read(struct file *file, size_t count, loff_t *ppos) { struct iwl_priv *priv = file->private_data; -char *buf; -int pos =0 ; -ssize_t ret = -ENOMEM ; +char *buf =NULL ; +ssize_t ret; - ret = pos =iwl_dump_nic_event_log (priv, true, &buf, true); -if (buf) { - ret =simple_read_from_buffer (user_buf, count, ppos, buf, pos); -kfree (buf); - } + ret =iwl_dump_nic_event_log (priv, true, &buf, true); +if (ret <0 ) + goto err; + ret =simple_read_from_buffer (user_buf, count, ppos, buf, ret); +err: +kfree (buf);return ret; }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 9/136 iwlwifi: dvm: dont send zeroed LQ cmd
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Emmanuel Grumbach <[email protected]>
[ Upstream commit 63b77bf489881747c5118476918cc8c29378ee63 ]
When the stations are being restored because of unassoc RXON, the LQ cmd may not have been initialized because it is initialized only after association.
Sending zeroed LQ_CMD makes the fw unhappy: it raises SYSASSERT_2078.
--- drivers/net/wireless/iwlwifi/dvm/sta.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/wireless/iwlwifi/dvm/sta.c +4 -1
@@ -706,6 +706,7 @@ void iwl_clear_ucode_stations(struct iwl_priv *priv,void iwl_restore_stations (struct iwl_priv *priv,struct iwl_rxon_context *ctx) {struct iwl_addsta_cmd sta_cmd; +static const struct iwl_link_quality_cmd zero_lq = {};struct iwl_link_quality_cmd lq;int i;bool found = false;
@@ -744,7 +745,9 @@ void iwl_restore_stations(struct iwl_priv *priv, struct iwl_rxon_context *ctx)else memcpy (&lq, priv->stations[i].lq,sizeof (struct iwl_link_quality_cmd )); - send_lq = true; + +if (!memcmp (&lq, &zero_lq,sizeof (lq))) + send_lq = true; }spin_unlock_bh (&priv->sta_lock); ret =iwl_send_add_sta (priv, &sta_cmd,CMD_SYNC );
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 10/136 mwifiex: Use pci_release_region() instead of a pci_release_regions()
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Yogesh Ashok Powar <[email protected]>
[ Upstream commit c380aafb77b7435d010698fe3ca6d3e1cd745fde ]
PCI regions are associated with the device using pci_request_region() call. Hence use pci_release_region() instead of pci_release_regions().
--- drivers/net/wireless/mwifiex/pcie.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/mwifiex/pcie.c +2 -2
@@ -1831,8 +1831,8 @@ static void mwifiex_pcie_cleanup(struct mwifiex_adapter *adapter)if (pdev) {pci_iounmap (pdev, card->pci_mmap);pci_iounmap (pdev, card->pci_mmap1); - -pci_release_regions (pdev); +pci_release_region (pdev,2 ); +pci_release_region (pdev,0 );pci_disable_device (pdev);pci_set_drvdata (pdev,NULL ); }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 11/136 mwifiex: Call pci_release_region after calling pci_disable_device
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Yogesh Ashok Powar <[email protected]>
[ Upstream commit 5b0d9b218b74042ff72bf4bfda6eeb2e4bf98397 ]
"drivers should call pci_release_region() AFTER calling pci_disable_device()"
Please refer section 3.2 Request MMIO/IOP resources in Documentation/PCI/pci.txt
--- drivers/net/wireless/mwifiex/pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mwifiex/pcie.c +1 -1
@@ -1831,9 +1831,9 @@ static void mwifiex_pcie_cleanup(struct mwifiex_adapter *adapter)if (pdev) {pci_iounmap (pdev, card->pci_mmap);pci_iounmap (pdev, card->pci_mmap1); +pci_disable_device (pdev);pci_release_region (pdev,2 );pci_release_region (pdev,0 ); -pci_disable_device (pdev);pci_set_drvdata (pdev,NULL ); } }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 12/136 usb/misc/appledisplay: Add 24" LED Cinema display
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Ben Jencks <[email protected]>
[ Upstream commit e7d3b6e22c871ba36d052ca99bc8ceca4d546a60 ]
Add the Apple 24" LED Cinema display to the supported devices.
--- drivers/usb/misc/appledisplay.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/misc/appledisplay.c +1 -0
@@ -63,6 +63,7 @@ static const struct usb_device_id appledisplay_table[] = { { APPLEDISPLAY_DEVICE(0x9219) }, { APPLEDISPLAY_DEVICE(0x921c) }, { APPLEDISPLAY_DEVICE(0x921d) }, + { APPLEDISPLAY_DEVICE(0x9236) }, /* Terminating entry */ { }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 13/136 USB: add ftdi_sio USB ID for GDM Boost V1.x
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Stefani Seibold <[email protected]>
[ Upstream commit 58f8b6c4fa5a13cb2ddb400e26e9e65766d71e38 ]
This patch add a missing usb device id for the GDMBoost V1.x device
The patch is against 3.9-rc5
--- drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio_ids.h | 1 + 2 files changed, 2 insertions(+)
drivers/usb/serial/ftdi_sio.c +1 -0
@@ -195,6 +195,7 @@ static struct usb_device_id id_table_combined [] = { { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_THROTTLE_PID) }, { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GATEWAY_PID) }, { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GBM_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GBM_BOOST_PID) }, { USB_DEVICE(NEWPORT_VID, NEWPORT_AGILIS_PID) }, { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) },
drivers/usb/serial/ftdi_sio_ids.h +1 -0
@@ -74,6 +74,7 @@#define FTDI_OPENDCC_THROTTLE_PID 0xBFDA#define FTDI_OPENDCC_GATEWAY_PID 0xBFDB#define FTDI_OPENDCC_GBM_PID 0xBFDC +#define FTDI_OPENDCC_GBM_BOOST_PID 0xBFDD/* NZR SEM 16+ USB (http://www.nzr.de) */ #define FTDI_NZR_SEM_USB_PID 0xC1E0/* NZR SEM-LOG16+ */
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 14/136 USB: ftdi_sio: correct ST Micro Connect Lite PIDs
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Adrian Thomasset <[email protected]>
[ Upstream commit 9f06d15f8db6946e41f73196a122b84a37938878 ]
The current ST Micro Connect Lite uses the FT4232H hi-speed quad USB UART FTDI chip. It is also possible to drive STM reference targets populated with an on-board JTAG debugger based on the FT2232H chip with the same STMicroelectronics tools.
For this reason, the ST Micro Connect Lite PIDs should beST_STMCLT_2232_PID: 0x3746ST_STMCLT_4232_PID: 0x3747
--- drivers/usb/serial/ftdi_sio.c | 4 +++- drivers/usb/serial/ftdi_sio_ids.h | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/usb/serial/ftdi_sio.c +3 -1
@@ -875,7 +875,9 @@ static struct usb_device_id id_table_combined [] = { { USB_DEVICE(FTDI_VID, FTDI_DOTEC_PID) }, { USB_DEVICE(QIHARDWARE_VID, MILKYMISTONE_JTAGSERIAL_PID), .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, - { USB_DEVICE(ST_VID, ST_STMCLT1030_PID), + { USB_DEVICE(ST_VID, ST_STMCLT_2232_PID), + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, + { USB_DEVICE(ST_VID, ST_STMCLT_4232_PID), .driver_info = (kernel_ulong_t)&ftdi_stmclite_quirk }, { USB_DEVICE(FTDI_VID, FTDI_RF_R106) }, { USB_DEVICE(FTDI_VID, FTDI_DISTORTEC_JTAG_LOCK_PICK_PID),
drivers/usb/serial/ftdi_sio_ids.h +2 -1
@@ -1144,7 +1144,8 @@* STMicroelectonics */ #define ST_VID 0x0483 -#define ST_STMCLT1030_PID 0x3747/* ST Micro Connect Lite STMCLT1030 */ +#define ST_STMCLT_2232_PID 0x3746 +#define ST_STMCLT_4232_PID 0x3747/* * Papouch products (http://www.papouch.com/)
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 15/136 USB: ftdi_sio: enable two UART ports on ST Microconnect Lite
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Adrian Thomasset <[email protected]>
[ Upstream commit 71d9a2b95fc9c9474d46d764336efd7a5a805555 ]
The FT4232H used in the ST Micro Connect Lite has four hi-speed UART ports. The first two ports are reserved for the JTAG interface.
We enable by default ports 2 and 3 as UARTs (where port 2 is a conventional RS-232 UART)
--- drivers/usb/serial/ftdi_sio.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
drivers/usb/serial/ftdi_sio.c +11 -7
@@ -1795,20 +1795,24 @@ static int ftdi_8u2232c_probe(struct usb_serial *serial) }/* -* First and second port on STMCLiteadaptors is reserved for JTAG interface -* and the forth port for pio +* First two ports on JTAG adaptors using an FT4232 such as STMicroelectronics's +* ST Micro Connect Lite are reserved for JTAG or other non-UART interfaces and +* can be accessed from userspace. +* The next two ports are enabled as UARTs by default, where port 2 is +* a conventional RS-232 UART. */ static int ftdi_stmclite_probe (struct usb_serial *serial) {struct usb_device *udev = serial->dev;struct usb_interface *interface = serial->interface; -if (interface == udev->actconfig->interface[2 ]) -return 0 ; - -dev_info (&udev->dev,"Ignoring serial port reserved for JTAG\n" ); +if (interface == udev->actconfig->interface[0 ] || + interface == udev->actconfig->interface[1 ]) { +dev_info (&udev->dev,"Ignoring serial port reserved for JTAG\n" ); +return -ENODEV ; + } -return -ENODEV ; +return 0 ; }/*
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 16/136 usbfs: Always allow ctrl requests with USB_RECIP_ENDPOINT on the ctrl ep
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
[ Upstream commit 1361bf4b9f9ef45e628a5b89e0fd9bedfdcb7104 ]
When usbfs receives a ctrl-request from userspace it calls check_ctrlrecip, which for a request with USB_RECIP_ENDPOINT tries to map this to an interface to see if this interface is claimed, except for ctrl-requests with a type of USB_TYPE_VENDOR.
When trying to use this device: http://www.akaipro.com/eiepro
redirected to a Windows vm running on qemu on top of Linux.
The windows driver makes a ctrl-req with USB_TYPE_CLASS and USB_RECIP_ENDPOINT with index 0, and the mapping of the endpoint (0) to the interface fails since ep 0 is the ctrl endpoint and thus never is part of an interface.
This patch fixes this ctrl-req failing by skipping the checkintf call for USB_RECIP_ENDPOINT ctrl-reqs on the ctrl endpoint.
--- drivers/usb/core/devio.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/core/devio.c +2 -0
@@ -738,6 +738,8 @@ static int check_ctrlrecip(struct dev_state *ps, unsigned int requesttype, index &=0xff ;switch (requesttype &USB_RECIP_MASK ) {case USB_RECIP_ENDPOINT : +if ((index & ~USB_DIR_IN ) ==0 ) +return 0 ; ret =findintfep (ps->dev, index);if (ret >=0 ) ret =checkintf (ps, ret);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 17/136 usb: chipidea: udc: fix memory access of shared memory on armv5 machines
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Michael Grzeschik <[email protected]>
[ Upstream commit a9c174302b1590ef3ead485d804a303c5f89174b ]
The udc uses an shared dma memory space between hard and software. This memory layout is described in ci13xxx_qh and ci13xxx_td which are marked with the attribute ((packed)).
The compiler currently does not know about the alignment of the memory layout, and will create strb and ldrb operations.
The Datasheet of the synopsys core describes, that some operations on the mapped memory need to be atomic double word operations. I.e. the next pointer addressing in the qhead, as otherwise the hardware will read wrong data and totally stuck.
This is also possible while working with the current active td queue, and preparing the td->ptr.next in software while the hardware is still working with the current active td which is supposed to be changed:
writeb(0xde, &td->ptr.next + 0x0); /* strb */writeb(0xad, &td->ptr.next + 0x1); /* strb */
<----- hardware reads value of td->ptr.next and get stuck!
writeb(0xbe, &td->ptr.next + 0x2); /* strb */writeb(0xef, &td->ptr.next + 0x3); /* strb */
This appeares on armv5 machines where the hardware does not support unaligned 32bit operations.
This patch adds the attribute ((aligned(4))) to the structures to tell the compiler to use 32bit operations. It also adds an wmb() for the prepared TD data before it gets enqueued into the qhead.
--- drivers/usb/chipidea/udc.c | 2 ++ drivers/usb/chipidea/udc.h | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/usb/chipidea/udc.c +2 -0
@@ -439,6 +439,8 @@ static int _hardware_enqueue(struct ci13xxx_ep *mEp, struct ci13xxx_req *mReq) mReq->ptr->page[i] = (mReq->req.dma + i *CI13XXX_PAGE_SIZE ) & ~TD_RESERVED_MASK ; +wmb (); +if (!list_empty (&mEp->qh.queue)) {struct ci13xxx_req *mReqPrev;int n =hw_ep_bit (mEp->num, mEp->dir);
drivers/usb/chipidea/udc.h +2 -2
@@ -40,7 +40,7 @@ struct ci13xxx_td {#define TD_CURR_OFFSET (0x0FFFUL << 0)#define TD_FRAME_NUM (0x07FFUL << 0)#define TD_RESERVED_MASK (0x0FFFUL << 0) -} __attribute__ ((packed)); +} __attribute__ ((packed, aligned(4)));/* DMA layout of queue heads */ struct ci13xxx_qh {
@@ -57,7 +57,7 @@ struct ci13xxx_qh {/* 9 */ u32 RESERVED ;struct usb_ctrlrequest setup; -} __attribute__ ((packed)); +} __attribute__ ((packed, aligned(4)));/** * struct ci13xxx_req - usb request representation
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 18/136 usb: chipidea: udc: fix memory leak in _ep_nuke
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Michael Grzeschik <[email protected]>
[ Upstream commit 7ca2cd291fd84ae499390f227a255ccba2780a81 ]
In hardware_enqueue code adds one extra td with dma_pool_alloc if mReq->req.zero is true. When _ep_nuke will be called for that endpoint, dma_pool_free will not be called to free that memory again. That patch fixes this.
--- drivers/usb/chipidea/udc.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/usb/chipidea/udc.c +6 -0
@@ -541,6 +541,12 @@ __acquires(mEp->lock)struct ci13xxx_req *mReq = \list_entry (mEp->qh.queue.next, struct ci13xxx_req, queue); + +if (mReq->zptr) { +dma_pool_free (mEp->td_pool, mReq->zptr, mReq->zdma); + mReq->zptr =NULL ; + } +list_del_init (&mReq->queue); mReq->req.status = -ESHUTDOWN ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 19/136 usb: remove redundant tdi_reset
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Shengzhou Liu <[email protected]>
[ Upstream commit 61ac6ac8d662ac7ac67c864954d39d1b19948354 ]
We remove the redundant tdi_reset in ehci_setup since there is already it in ehci_reset.
It was observed that the duplicated tdi_reset was causing the PHY_CLK_VALID bit unstable.
--- drivers/usb/host/ehci-hcd.c | 3 --- 1 file changed, 3 deletions(-)
drivers/usb/host/ehci-hcd.c +0 -3
@@ -684,9 +684,6 @@ static int ehci_setup(struct usb_hcd *hcd)if (retval)return retval; -if (ehci_is_TDI (ehci)) -tdi_reset (ehci); -ehci_reset (ehci);return 0 ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 20/136 usb-storage: CY7C68300A chips do not support Cypress ATACB
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Tormod Volden <[email protected]>
[ Upstream commit 671b4b2ba9266cbcfe7210a704e9ea487dcaa988 ]
Many cards based on CY7C68300A/B/C use the USB ID 04b4:6830 but only the B and C variants (EZ-USB AT2LP) support the ATA Command Block functionality, according to the data sheets. The A variant (EZ-USB AT2) locks up if ATACB is attempted, until a typical 30 seconds timeout runs out and a USB reset is performed.
https://bugs.launchpad.net/bugs/428469
It seems that one way to spot a CY7C68300A (at least where the card manufacturer left Cypress' EEPROM default vaules, against Cypress' recommendations) is to look at the USB string descriptor indices.
A http://media.digikey.com/pdf/Data%20Sheets/Cypress%20PDFs/CY7C68300A.pdf
B http://www.farnell.com/datasheets/43456.pdf
C http://www.cypress.com/?rID=14189
Note that a CY7C68300B/C chip appears as CY7C68300A if it is running in Backward Compatibility Mode, and if ATACB would be supported in this case there is anyway no way to tell which chip it really is.
For 5 years my external USB drive has been locking up for half a minute when plugged in and ata_id is run by udev, or anytime hdparm or similar is run on it.
Finally looking at the /correct/ datasheet I think I found the reason. I am aware the quirk in this patch is a bit hacky, but the hardware manufacturers haven't made it easy for us.
--- drivers/usb/storage/cypress_atacb.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/usb/storage/cypress_atacb.c +14 -2
@@ -248,14 +248,26 @@ static int cypress_probe(struct usb_interface *intf, {struct us_data *us;int result; +struct usb_device *device; result =usb_stor_probe1 (&us, intf, id, (id - cypress_usb_ids) + cypress_unusual_dev_list);if (result)return result; - us->protocol_name ="Transparent SCSI with Cypress ATACB" ; - us->proto_handler = cypress_atacb_passthrough; +/* Among CY7C68300 chips, the A revision does not support Cypress ATACB +* Filter out this revision from EEPROM default descriptor values +*/ + device =interface_to_usbdev (intf); +if (device->descriptor.iManufacturer !=0x38 || + device->descriptor.iProduct !=0x4e || + device->descriptor.iSerialNumber !=0x64 ) { + us->protocol_name ="Transparent SCSI with Cypress ATACB" ; + us->proto_handler = cypress_atacb_passthrough; + }else { + us->protocol_name ="Transparent SCSI" ; + us->proto_handler = usb_stor_transparent_scsi_command; + } result =usb_stor_probe2 (us);return result;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 21/136 s390/memory hotplug: prevent offline of active memory increments
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Heiko Carstens <[email protected]>
[ Upstream commit 94c163663fc1dcfc067a5fb3cc1446b9469975ce ]
In case a machine supports memory hotplug all active memory increments present at IPL time have been initialized with a "usecount" of 1. This is wrong if the memory increment size is larger than the memory section size of the memory hotplug code. If that is the case the usecount must be initialized with the number of memory sections that fit into one memory increment.
Otherwise it is possible to put a memory increment into standby state even if there are still active sections.
Afterwards addressing exceptions might happen which cause the kernel to panic.
However even worse, if a memory increment was put into standby state and afterwards into active state again, it's contents would have been zeroed, leading to memory corruption.
This was only an issue for machines that support standby memory and have at least 256GB memory.
This is broken since commit fdb1bb15 "[S390] sclp/memory hotplug: fix initial usecount of increments".
--- drivers/s390/char/sclp_cmd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/s390/char/sclp_cmd.c +3 -1
@@ -567,6 +567,8 @@ static void __init sclp_add_standby_memory(void)add_memory_merged (0 ); } +#define MEM_SCT_SIZE (1UL << SECTION_SIZE_BITS) +static void __init insert_increment (u16 rn,int standby,int assigned) {struct memory_increment *incr, *new_incr;
@@ -579,7 +581,7 @@ static void __init insert_increment(u16 rn, int standby, int assigned) new_incr->rn = rn; new_incr->standby = standby;if (!standby) - new_incr->usecount =1 ; + new_incr->usecount = rzm >MEM_SCT_SIZE ? rzm/MEM_SCT_SIZE :1 ; last_rn =0 ; prev = &sclp_mem_list;list_for_each_entry (incr, &sclp_mem_list, list) {
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 22/136 xen/time: Fix kasprintf splat when allocating timer%d IRQ line.
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Konrad Rzeszutek Wilk <[email protected]>
[ Upstream commit 7918c92ae9638eb8a6ec18e2b4a0de84557cccc8 ]
When we online the CPU, we get this splat:
smpboot: Booting Node 0 Processor 1 APIC 0x2
installing Xen timer for CPU 1
BUG: sleeping function called from invalid context at /home/konrad/ssd/konrad/linux/mm/slab.c:3179 in_atomic(): 1, irqs_disabled(): 0, pid: 0, name: swapper/1 Pid: 0, comm: swapper/1 Not tainted 3.9.0-rc6upstream-00001-g3884fad #1 Call Trace: [<ffffffff810c1fea>] __might_sleep+0xda/0x100 [<ffffffff81194617>] __kmalloc_track_caller+0x1e7/0x2c0 [<ffffffff81303758>] ? kasprintf+0x38/0x40 [<ffffffff813036eb>] kvasprintf+0x5b/0x90 [<ffffffff81303758>] kasprintf+0x38/0x40 [<ffffffff81044510>] xen_setup_timer+0x30/0xb0 [<ffffffff810445af>] xen_hvm_setup_cpu_clockevents+0x1f/0x30 [<ffffffff81666d0a>] start_secondary+0x19c/0x1a8
The solution to that is use kasprintf in the CPU hotplug path that 'online's the CPU. That is, do it in in xen_hvm_cpu_notify, and remove the call to in xen_hvm_setup_cpu_clockevents.
Unfortunatly the later is not a good idea as the bootup path does not use xen_hvm_cpu_notify so we would end up never allocating timer%d interrupt lines when booting. As such add the check for atomic() to continue.
--- arch/x86/xen/enlighten.c | 5 ++++- arch/x86/xen/time.c | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-)
arch/x86/xen/enlighten.c +4 -1
@@ -1553,8 +1553,11 @@ static int __cpuinit xen_hvm_cpu_notify(struct notifier_block *self,switch (action) {case CPU_UP_PREPARE :xen_vcpu_setup (cpu); -if (xen_have_vector_callback) +if (xen_have_vector_callback) {xen_init_lock_cpu (cpu); +if (xen_feature (XENFEAT_hvm_safe_pvclock)) +xen_setup_timer (cpu); + }break ;default :break ;
arch/x86/xen/time.c +5 -1
@@ -497,7 +497,11 @@ static void xen_hvm_setup_cpu_clockevents(void) {int cpu =smp_processor_id ();xen_setup_runstate_info (cpu); -xen_setup_timer (cpu); +/* +* xen_setup_timer(cpu) - snprintf is bad in atomic context. Hence +* doing it xen_hvm_cpu_notify (which gets called by smp_init during +* early bootup and also during CPU hotplug events). +*/ xen_setup_cpu_clockevents (); }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 23/136 xen/smp: Fix leakage of timer interrupt line for every CPU online/offline.
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Konrad Rzeszutek Wilk <[email protected]>
[ Upstream commit 888b65b4bc5e7fcbbb967023300cd5d44dba1950 ]
In the PVHVM path when we do CPU online/offline path we would leak the timer%d IRQ line everytime we do a offline event. The online path (xen_hvm_setup_cpu_clockevents via x86_cpuinit.setup_percpu_clockev) would allocate a new interrupt line for the timer%d.
But we would still use the old interrupt line leading to:
kernel BUG at /home/konrad/ssd/konrad/linux/kernel/hrtimer.c:1261! invalid opcode: 0000 [#1] SMP
RIP: 0010:[<ffffffff810b9e21>] [<ffffffff810b9e21>] hrtimer_interrupt+0x261/0x270 .. snip.. <IRQ> [<ffffffff810445ef>] xen_timer_interrupt+0x2f/0x1b0 [<ffffffff81104825>] ? stop_machine_cpu_stop+0xb5/0xf0 [<ffffffff8111434c>] handle_irq_event_percpu+0x7c/0x240 [<ffffffff811175b9>] handle_percpu_irq+0x49/0x70 [<ffffffff813a74a3>] __xen_evtchn_do_upcall+0x1c3/0x2f0 [<ffffffff813a760a>] xen_evtchn_do_upcall+0x2a/0x40 [<ffffffff8167c26d>] xen_hvm_callback_vector+0x6d/0x80 <EOI> [<ffffffff81666d01>] ? start_secondary+0x193/0x1a8 [<ffffffff81666cfd>] ? start_secondary+0x18f/0x1a8
There is also the oddity (timer1) in the /proc/interrupts after offlining CPU1:
64: 1121 0 xen-percpu-virq timer0 78: 0 0 xen-percpu-virq timer1 84: 0 2483 xen-percpu-virq timer2
This patch fixes it.
--- arch/x86/xen/smp.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/xen/smp.c +1 -0
@@ -667,6 +667,7 @@ static void xen_hvm_cpu_die(unsigned int cpu)unbind_from_irqhandler (per_cpu (xen_debug_irq, cpu),NULL );unbind_from_irqhandler (per_cpu (xen_callfuncsingle_irq, cpu),NULL );unbind_from_irqhandler (per_cpu (xen_irq_work, cpu),NULL ); +xen_teardown_timer (cpu);native_cpu_die (cpu); }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 24/136 xen/smp/spinlock: Fix leakage of the spinlock interrupt line for every CPU online/offline
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Konrad Rzeszutek Wilk <[email protected]>
[ Upstream commit 66ff0fe9e7bda8aec99985b24daad03652f7304e ]
While we don't use the spinlock interrupt line (see for details commit f10cd522c5fbfec9ae3cc01967868c9c2401ed23 -
xen: disable PV spinlocks on HVM) - we should still do the proper init / deinit sequence. We did not do that correctly and for the CPU init for PVHVM guest we would allocate an interrupt line - but failed to deallocate the old interrupt line.
This resulted in leakage of an irq_desc but more importantly this splat as we online an offlined CPU:
genirq: Flags mismatch irq 71. 0002cc20 (spinlock1) vs. 0002cc20 (spinlock1)
Pid: 2542, comm: init.late Not tainted 3.9.0-rc6upstream #1
Call Trace: [<ffffffff811156de>] __setup_irq+0x23e/0x4a0 [<ffffffff81194191>] ? kmem_cache_alloc_trace+0x221/0x250 [<ffffffff811161bb>] request_threaded_irq+0xfb/0x160 [<ffffffff8104c6f0>] ? xen_spin_trylock+0x20/0x20 [<ffffffff813a8423>] bind_ipi_to_irqhandler+0xa3/0x160 [<ffffffff81303758>] ? kasprintf+0x38/0x40 [<ffffffff8104c6f0>] ? xen_spin_trylock+0x20/0x20 [<ffffffff810cad35>] ? update_max_interval+0x15/0x40 [<ffffffff816605db>] xen_init_lock_cpu+0x3c/0x78 [<ffffffff81660029>] xen_hvm_cpu_notify+0x29/0x33 [<ffffffff81676bdd>] notifier_call_chain+0x4d/0x70 [<ffffffff810bb2a9>] __raw_notifier_call_chain+0x9/0x10 [<ffffffff8109402b>] __cpu_notify+0x1b/0x30 [<ffffffff8166834a>] _cpu_up+0xa0/0x14b [<ffffffff816684ce>] cpu_up+0xd9/0xec [<ffffffff8165f754>] store_online+0x94/0xd0 [<ffffffff8141d15b>] dev_attr_store+0x1b/0x20 [<ffffffff81218f44>] sysfs_write_file+0xf4/0x170 [<ffffffff811a2864>] vfs_write+0xb4/0x130 [<ffffffff811a302a>] sys_write+0x5a/0xa0 [<ffffffff8167ada9>] system_call_fastpath+0x16/0x1b
cpu 1 spinlock event irq -16
smpboot: Booting Node 0 Processor 1 APIC 0x2
And if one looks at the /proc/interrupts right after offlining (CPU1):
70: 0 0 xen-percpu-ipi spinlock0 71: 0 0 xen-percpu-ipi spinlock1 77: 0 0 xen-percpu-ipi spinlock2
There is the oddity of the 'spinlock1' still being present.
--- arch/x86/xen/smp.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/xen/smp.c +1 -0
@@ -667,6 +667,7 @@ static void xen_hvm_cpu_die(unsigned int cpu)unbind_from_irqhandler (per_cpu (xen_debug_irq, cpu),NULL );unbind_from_irqhandler (per_cpu (xen_callfuncsingle_irq, cpu),NULL );unbind_from_irqhandler (per_cpu (xen_irq_work, cpu),NULL ); +xen_uninit_lock_cpu (cpu);xen_teardown_timer (cpu);native_cpu_die (cpu); }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 25/136 serial_core.c: add put_device() after device_find_child()
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Federico Vaga <[email protected]>
[ Upstream commit 5a65dcc04cda41f4122aacc37a5a348454645399 ]
The serial core uses device_find_child() but does not drop the reference to the retrieved child after using it. This patch add the missing put_device().
What I have done to test this issue.
I used a machine with an AMBA PL011 serial driver. I tested the patch on next-20120408 because the last branch [next-20120415] does not boot on this board.
For test purpose, I added some pr_info() messages to print the refcount after device_find_child() (lines: 1937,2009), and after put_device() (lines: 1947, 2021).
Boot the machine *without* put_device(). Then:
echo reboot > /sys/power/disk
echo disk > /sys/power/state
[ 87.058575] uart_suspend_port:1937 refcount 4 [ 87.058582] uart_suspend_port:1947 refcount 4 [ 87.098083] uart_resume_port:2009refcount 5 [ 87.098088] uart_resume_port:2021 refcount 5
echo disk > /sys/power/state
[ 103.055574] uart_suspend_port:1937 refcount 6 [ 103.055580] uart_suspend_port:1947 refcount 6 [ 103.095322] uart_resume_port:2009 refcount 7 [ 103.095327] uart_resume_port:2021 refcount 7
echo disk > /sys/power/state
[ 252.459580] uart_suspend_port:1937 refcount 8 [ 252.459586] uart_suspend_port:1947 refcount 8 [ 252.499611] uart_resume_port:2009 refcount 9 [ 252.499616] uart_resume_port:2021 refcount 9
The refcount continuously increased.
Boot the machine *with* this patch. Then:
echo reboot > /sys/power/disk
echo disk > /sys/power/state
[ 159.333559] uart_suspend_port:1937 refcount 4 [ 159.333566] uart_suspend_port:1947 refcount 3 [ 159.372751] uart_resume_port:2009 refcount 4 [ 159.372755] uart_resume_port:2021 refcount 3
echo disk > /sys/power/state
[ 185.713614] uart_suspend_port:1937 refcount 4 [ 185.713621] uart_suspend_port:1947 refcount 3 [ 185.752935] uart_resume_port:2009 refcount 4 [ 185.752940] uart_resume_port:2021 refcount 3
echo disk > /sys/power/state
[ 207.458584] uart_suspend_port:1937 refcount 4 [ 207.458591] uart_suspend_port:1947 refcount 3 [ 207.498598] uart_resume_port:2009 refcount 4 [ 207.498605] uart_resume_port:2021 refcount 3
The refcount correctly handled.
--- drivers/tty/serial/serial_core.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/tty/serial/serial_core.c +4 -0
@@ -1877,6 +1877,8 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport)mutex_unlock (&port->mutex);return 0 ; } +put_device (tty_dev); +if (console_suspend_enabled || !uart_console (uport)) uport->suspended =1 ;
@@ -1942,9 +1944,11 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport)disable_irq_wake (uport->irq); uport->irq_wake =0 ; } +put_device (tty_dev);mutex_unlock (&port->mutex);return 0 ; } +put_device (tty_dev); uport->suspended =0 ;/*
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 26/136 arm: set the page table freeing ceiling to TASK_SIZE
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Catalin Marinas <[email protected]>
[ Upstream commit 104ad3b32d7a71941c8ab2dee78eea38e8a23309 ]
ARM processors with LPAE enabled use 3 levels of page tables, with an entry in the top level (pgd) covering 1GB of virtual space. Because of the branch relocation limitations on ARM, the loadable modules are mapped 16MB below PAGE_OFFSET, making the corresponding 1GB pgd shared between kernel modules and user space.
If free_pgtables() is called with the default ceiling 0, free_pgd_range() (and subsequently called functions) also frees the page table shared between user space and kernel modules (which is normally handled by the ARM-specific pgd_free() function). This patch changes defines the ARM USER_PGTABLES_CEILING to TASK_SIZE when CONFIG_ARM_LPAE is enabled.
Note that the pgd_free() function already checks the presence of the shared pmd page allocated by pgd_alloc() and frees it, though with ceiling 0 this wasn't necessary.
--- arch/arm/include/asm/pgtable.h | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/arm/include/asm/pgtable.h +9 -0
@@ -61,6 +61,15 @@ extern void __pgd_error(const char *file, int line, pgd_t);#define FIRST_USER_ADDRESS PAGE_SIZE/* +* Use TASK_SIZE as the ceiling argument for free_pgtables() and +* free_pgd_range() to avoid freeing the modules pmd when LPAE is enabled (pmd +* page shared between user and kernel). +*/ +#ifdef CONFIG_ARM_LPAE +#define USER_PGTABLES_CEILING TASK_SIZE +#endif + +/* * The pgprot_* and protection_map entries will be fixed up in runtime * to include the cachable and bufferable bits based on memory policy, * as well as any architecture dependent bits like global/ASID and SMP
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 27/136 gianfar: do not advertise any alarm capability.
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Richard Cochran <[email protected]>
[ Upstream commit cd4baaaa04b4aaa3b0ec4d13a6f3d203b92eadbd ]
An early draft of the PHC patch series included an alarm in the gianfar driver. During the review process, the alarm code was dropped, but the capability removal was overlooked. This patch fixes the issue by advertising zero alarms.
This patch should be applied to every 3.x stable kernel.
--- drivers/net/ethernet/freescale/gianfar_ptp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/freescale/gianfar_ptp.c +1 -2
@@ -127,7 +127,6 @@ struct gianfar_ptp_registers {#define DRIVER "gianfar_ptp"#define DEFAULT_CKSEL 1 -#define N_ALARM 1/* first alarm is used internally to reset fipers */ #define N_EXT_TS 2#define REG_SIZE sizeof(struct gianfar_ptp_registers)
@@ -410,7 +409,7 @@ static struct ptp_clock_info ptp_gianfar_caps = { .owner = THIS_MODULE, .name = "gianfar clock", .max_adj = 512000, - .n_alarm = N_ALARM, + .n_alarm = 0, .n_ext_ts = N_EXT_TS, .n_per_out = 0, .pps = 1,
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 28/136 tty: fix up atime/mtime mess, take three
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
[ Upstream commit b0b885657b6c8ef63a46bc9299b2a7715d19acde ]
We first tried to avoid updating atime/mtime entirely (commitb0de59b5733d: "TTY: do not update atime/mtime on read/write"), and then limited it to only update it occasionally (commit 37b7f3c76595: "TTY:
fix atime/mtime regression"), but it turns out that this was both insufficient and overkill.
It was insufficient because we let people attach to the shared ptmx node to see activity without even reading atime/mtime, and it was overkill because the "only once a minute" means that you can't really tell an idle person from an active one with 'w'.
So this tries to fix the problem properly. It marks the shared ptmx node as un-notifiable, and it lowers the "only once a minute" to a few seconds instead - still long enough that you can't time individual keystrokes, but short enough that you can tell whether somebody is active or not.
--- drivers/tty/pty.c | 3 +++ drivers/tty/tty_io.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/tty/pty.c +3 -0
@@ -617,6 +617,9 @@ static int ptmx_open(struct inode *inode, struct file *filp)nonseekable_open (inode, filp); +/* We refuse fsnotify events on ptmx, since it's a shared resource */ + filp->f_mode |=FMODE_NONOTIFY ; + retval =tty_alloc_file (filp);if (retval)return retval;
drivers/tty/tty_io.c +2 -2
@@ -939,10 +939,10 @@ void start_tty(struct tty_struct *tty)EXPORT_SYMBOL (start_tty); +/* We limit tty time update visibility to every 8 seconds or so. */ static void tty_update_time (struct timespec *time) { -unsigned long sec =get_seconds (); - sec -= sec %60 ; +unsigned long sec =get_seconds () & ~7 ;if ((long )(sec - time->tv_sec) >0 ) time->tv_sec = sec; }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 29/136 tracing: Use stack of calling function for stack tracer
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: "Steven Rostedt (Red Hat)" <[email protected]>
[ Upstream commit 87889501d0adfae10e3b0f0e6f2d7536eed9ae84 ]
Use the stack of stack_trace_call() instead of check_stack() as the test pointer for max stack size. It makes it a bit cleaner and a little more accurate.
Adding stable, as a later fix depends on this patch.
--- kernel/trace/trace_stack.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
kernel/trace/trace_stack.c +7 -5
@@ -40,20 +40,21 @@ static DEFINE_MUTEX(stack_sysctl_mutex);int stack_tracer_enabled;static int last_stack_tracer_enabled; -static inline void check_stack (void ) +static inline void +check_stack (unsigned long *stack) {unsigned long this_size, flags;unsigned long *p, *top, *start;int i; - this_size = ((unsigned long )&this_size) & (THREAD_SIZE -1 ); + this_size = ((unsigned long )stack) & (THREAD_SIZE -1 ); this_size =THREAD_SIZE - this_size;if (this_size <= max_stack_size)return ;/* we do not handle interrupt stacks yet */ -if (!object_is_on_stack (&this_size)) +if (!object_is_on_stack (stack))return ;local_irq_save (flags);
@@ -74,7 +75,7 @@ static inline void check_stack(void)* Now find where in the stack these are. */ i =0 ; - start = &this_size; + start = stack; top = (unsigned long *) (((unsigned long )start & ~(THREAD_SIZE -1 )) +THREAD_SIZE );
@@ -113,6 +114,7 @@ static inline void check_stack(void)static void stack_trace_call (unsigned long ip,unsigned long parent_ip) { +unsigned long stack;int cpu;if (unlikely (!ftrace_enabled || stack_trace_disabled))
@@ -125,7 +127,7 @@ stack_trace_call(unsigned long ip, unsigned long parent_ip)if (per_cpu (trace_active, cpu)++ !=0 ) goto out; -check_stack (); +check_stack (&stack); out:per_cpu (trace_active, cpu)--;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 30/136 tracing: Fix stack tracer with fentry use
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: "Steven Rostedt (Red Hat)" <[email protected]>
[ Upstream commit d4ecbfc49b4b1d4b597fb5ba9e4fa25d62f105c5 ]
When gcc 4.6 on x86 is used, the function tracer will use the new option -mfentry which does a call to "fentry" at every function instead of "mcount". The significance of this is that fentry is called as the first operation of the function instead of the mcount usage of being called after the stack.
This causes the stack tracer to show some bogus results for the size of the last function traced, as well as showing "ftrace_call" instead of the function. This is due to the stack frame not being set up by the function that is about to be traced.
# cat stack_trace
Depth Size Location (48 entries)
----- ---- --------
0) 4824 216 ftrace_call+0x5/0x2f
1) 4608 112 ____cache_alloc+0xb7/0x22d
2) 4496 80 kmem_cache_alloc+0x63/0x12fThe 216 size for ftrace_call includes both the ftrace_call stack (which includes the saving of registers it does), as well as the stack size of the parent.
To fix this, if CC_USING_FENTRY is defined, then the stack_tracer will reserve the first item in stack_dump_trace[] array when calling save_stack_trace(), and it will fill it in with the parent ip. Then the code will look for the parent pointer on the stack and give the real size of the parent's stack pointer:
# cat stack_trace
Depth Size Location (14 entries)
----- ---- --------
0) 2640 48 update_group_power+0x26/0x187
1) 2592 224 update_sd_lb_stats+0x2a5/0x4ac
2) 2368 160 find_busiest_group+0x31/0x1f1
3) 2208 256 load_balance+0xd9/0x662I'm Cc'ing stable, although it's not urgent, as it only shows bogus size for item #0, the rest of the trace is legit. It should still be corrected in previous stable releases.
--- kernel/trace/trace_stack.c | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-)
kernel/trace/trace_stack.c +29 -4
@@ -20,13 +20,27 @@#define STACK_TRACE_ENTRIES 500 +/* +* If fentry is used, then the function being traced will +* jump to fentry directly before it sets up its stack frame. +* We need to ignore that one and record the parent. Since +* the stack frame for the traced function wasn't set up yet, +* the stack_trace wont see the parent. That needs to be added +* manually to stack_dump_trace[] as the first element. +*/ +#ifdef CC_USING_FENTRY +# define add_func 1 +#else +# define add_func 0 +#endif +static unsigned long stack_dump_trace[STACK_TRACE_ENTRIES +1 ] = { [0 ... (STACK_TRACE_ENTRIES )] =ULONG_MAX };static unsigned stack_dump_index[STACK_TRACE_ENTRIES ];static struct stack_trace max_stack_trace = { - .max_entries =STACK_TRACE_ENTRIES , - .entries = stack_dump_trace, + .max_entries =STACK_TRACE_ENTRIES - add_func, + .entries = &stack_dump_trace[add_func], };static unsigned long max_stack_size;
@@ -41,7 +55,7 @@ int stack_tracer_enabled;static int last_stack_tracer_enabled;static inline void -check_stack (unsigned long *stack) +check_stack (unsigned long ip,unsigned long *stack) {unsigned long this_size, flags;unsigned long *p, *top, *start;
@@ -72,6 +86,17 @@ check_stack(unsigned long *stack)save_stack_trace (&max_stack_trace);/* +* When fentry is used, the traced function does not get +* its stack frame set up, and we lose the parent. +* Add that one in manally. We set up save_stack_trace() +* to not touch the first element in this case. +*/ +if (add_func) { + stack_dump_trace[0 ] = ip; + max_stack_trace.nr_entries++; + } + +/* * Now find where in the stack these are. */ i =0 ;
@@ -127,7 +152,7 @@ stack_trace_call(unsigned long ip, unsigned long parent_ip)if (per_cpu (trace_active, cpu)++ !=0 ) goto out; -check_stack (&stack); +check_stack (parent_ip, &stack); out:per_cpu (trace_active, cpu)--;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 31/136 tracing: Remove most or all of stack tracer stack size from stack_max_size
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: "Steven Rostedt (Red Hat)" <[email protected]>
[ Upstream commit 4df297129f622bdc18935c856f42b9ddd18f9f28 ]
Currently, the depth reported in the stack tracer stack_trace file does not match the stack_max_size file. This is because the stack_max_size includes the overhead of stack tracer itself while the depth does not.
The first time a max is triggered, a calculation is not performed that figures out the overhead of the stack tracer and subtracts it from the stack_max_size variable. The overhead is stored and is subtracted from the reported stack size for comparing for a new max.
Now the stack_max_size corresponds to the reported depth:
# cat stack_max_size 4640
# cat stack_trace
Depth Size Location (48 entries)
----- ---- --------
0) 4640 32 _raw_spin_lock+0x18/0x24
1) 4608 112 ____cache_alloc+0xb7/0x22d
2) 4496 80 kmem_cache_alloc+0x63/0x12f
3) 4416 16 mempool_alloc_slab+0x15/0x17
[...]While testing against and older gcc on x86 that uses mcount instead of fentry, I found that pasing in ip + MCOUNT_INSN_SIZE let the stack trace show one more function deep which was missing before.
--- kernel/trace/trace_stack.c | 75 +++++++++++++++++++++++++++++++------------- 1 file changed, 54 insertions(+), 21 deletions(-)
kernel/trace/trace_stack.c +54 -21
@@ -20,27 +20,24 @@#define STACK_TRACE_ENTRIES 500 -/* -* If fentry is used, then the function being traced will -* jump to fentry directly before it sets up its stack frame. -* We need to ignore that one and record the parent. Since -* the stack frame for the traced function wasn't set up yet, -* the stack_trace wont see the parent. That needs to be added -* manually to stack_dump_trace[] as the first element. -*/ #ifdef CC_USING_FENTRY -# define add_func 1 +# define fentry 1#else -# define add_func 0 +# define fentry 0#endif static unsigned long stack_dump_trace[STACK_TRACE_ENTRIES +1 ] = { [0 ... (STACK_TRACE_ENTRIES )] =ULONG_MAX };static unsigned stack_dump_index[STACK_TRACE_ENTRIES ]; +/* +* Reserve one entry for the passed in ip. This will allow +* us to remove most or all of the stack size overhead +* added by the stack tracer itself. +*/ static struct stack_trace max_stack_trace = { - .max_entries =STACK_TRACE_ENTRIES - add_func, - .entries = &stack_dump_trace[add_func], + .max_entries =STACK_TRACE_ENTRIES -1 , + .entries = &stack_dump_trace[1 ], };static unsigned long max_stack_size;
@@ -59,10 +56,14 @@ check_stack(unsigned long ip, unsigned long *stack) {unsigned long this_size, flags;unsigned long *p, *top, *start; +static int tracer_frame; +int frame_size =ACCESS_ONCE (tracer_frame);int i; this_size = ((unsigned long )stack) & (THREAD_SIZE -1 ); this_size =THREAD_SIZE - this_size; +/* Remove the frame of the tracer */ + this_size -= frame_size;if (this_size <= max_stack_size)return ;
@@ -74,6 +75,10 @@ check_stack(unsigned long ip, unsigned long *stack)local_irq_save (flags);arch_spin_lock (&max_stack_lock); +/* In case another CPU set the tracer_frame on us */ +if (unlikely (!frame_size)) + this_size -= tracer_frame; +/* a race could have already updated it */ if (this_size <= max_stack_size) goto out;
@@ -86,15 +91,12 @@ check_stack(unsigned long ip, unsigned long *stack)save_stack_trace (&max_stack_trace);/* -* When fentry is used, the traced function does not get -* its stack frame set up, and we lose the parent. -* Add that one in manally. We set up save_stack_trace() -* to not touch the first element in this case. +* Add the passed in ip from the function tracer. +* Searching for this on the stack will skip over +* most of the overhead from the stack tracer itself. */ -if (add_func) { - stack_dump_trace[0 ] = ip; - max_stack_trace.nr_entries++; - } + stack_dump_trace[0 ] = ip; + max_stack_trace.nr_entries++;/* * Now find where in the stack these are.
@@ -124,6 +126,18 @@ check_stack(unsigned long ip, unsigned long *stack) found =1 ;/* Start the search from here */ start = p +1 ; +/* +* We do not want to show the overhead +* of the stack tracer stack in the +* max stack. If we haven't figured +* out what that is, then figure it out +* now. +*/ +if (unlikely (!tracer_frame) && i ==1 ) { + tracer_frame = (p - stack) * +sizeof (unsigned long ); + max_stack_size -= tracer_frame; + } } }
@@ -152,7 +166,26 @@ stack_trace_call(unsigned long ip, unsigned long parent_ip)if (per_cpu (trace_active, cpu)++ !=0 ) goto out; -check_stack (parent_ip, &stack); +/* +* When fentry is used, the traced function does not get +* its stack frame set up, and we lose the parent. +* The ip is pretty useless because the function tracer +* was called before that function set up its stack frame. +* In this case, we use the parent ip. +* +* By adding the return address of either the parent ip +* or the current ip we can disregard most of the stack usage +* caused by the stack tracer itself. +* +* The function tracer always reports the address of where the +* mcount call was, but the stack will hold the return address. +*/ +if (fentry) + ip = parent_ip; +else + ip +=MCOUNT_INSN_SIZE ; + +check_stack (ip, &stack); out:per_cpu (trace_active, cpu)--;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 32/136 tracing: Fix off-by-one on allocating stat->pages
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Namhyung Kim <[email protected]>
[ Upstream commit 39e30cd1537937d3c00ef87e865324e981434e5b ]
The first page was allocated separately, so no need to start from 0.
--- kernel/trace/ftrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/ftrace.c +1 -1
@@ -624,7 +624,7 @@ int ftrace_profile_pages_init(struct ftrace_profile_stat *stat) pages =DIV_ROUND_UP (functions,PROFILES_PER_PAGE ); -for (i =0 ; i < pages; i++) { +for (i =1 ; i < pages; i++) { pg->next = (void *)get_zeroed_page (GFP_KERNEL );if (!pg->next) goto out_free;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 33/136 tracing: Check return value of tracing_init_dentry()
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Namhyung Kim <[email protected]>
[ Upstream commit ed6f1c996bfe4b6e520cf7a74b51cd6988d84420 ]
Check return value and bail out if it's NULL.
--- kernel/trace/trace.c | 2 ++ kernel/trace/trace_stack.c | 2 ++ kernel/trace/trace_stat.c | 2 ++ 3 files changed, 6 insertions(+)
kernel/trace/trace.c +2 -0
@@ -4848,6 +4848,8 @@ static __init int tracer_init_debugfs(void)trace_access_lock_init (); d_tracer =tracing_init_dentry (); +if (!d_tracer) +return 0 ;trace_create_file ("tracing_enabled" ,0644 , d_tracer, &global_trace, &tracing_ctrl_fops);
kernel/trace/trace_stack.c +2 -0
@@ -433,6 +433,8 @@ static __init int stack_trace_init(void)struct dentry *d_tracer; d_tracer =tracing_init_dentry (); +if (!d_tracer) +return 0 ;trace_create_file ("stack_max_size" ,0644 , d_tracer, &max_stack_size, &stack_max_size_fops);
kernel/trace/trace_stat.c +2 -0
@@ -307,6 +307,8 @@ static int tracing_stat_init(void)struct dentry *d_tracing; d_tracing =tracing_init_dentry (); +if (!d_tracing) +return 0 ; stat_dir =debugfs_create_dir ("trace_stat" , d_tracing);if (!stat_dir)
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 34/136 tracing: Reset ftrace_graph_filter_enabled if count is zero
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Namhyung Kim <[email protected]>
[ Upstream commit 9f50afccfdc15d95d7331acddcb0f7703df089ae ]
The ftrace_graph_count can be decreased with a "!" pattern, so that the enabled flag should be updated too.
--- kernel/trace/ftrace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/trace/ftrace.c +2 -1
@@ -3579,7 +3579,8 @@ out:if (fail)return -EINVAL ; - ftrace_graph_filter_enabled =1 ; + ftrace_graph_filter_enabled = !!(*idx); +return 0 ; }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 35/136 i2c: xiic: must always write 16-bit words to TX_FIFO
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: "Steven A. Falco" <[email protected]>
[ Upstream commit c39e8e4354ce4daf23336de5daa28a3b01f00aa6 ]
The TX_FIFO register is 10 bits wide. The lower 8 bits are the data to be written, while the upper two bits are flags to indicate stop/start.
The driver apparently attempted to optimize write access, by only writing a byte in those cases where the stop/start bits are zero. However, we have seen cases where the lower byte is duplicated onto the upper byte by the hardware, which causes inadvertent stop/starts.
This patch changes the write access to the transmit FIFO to always be 16 bits wide.
Signed off by: Steven A. Falco <[email protected]>
--- drivers/i2c/busses/i2c-xiic.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/i2c/busses/i2c-xiic.c +2 -4
@@ -312,10 +312,8 @@ static void xiic_fill_tx_fifo(struct xiic_i2c *i2c)/* last message in transfer -> STOP */ data |=XIIC_TX_DYN_STOP_MASK ;dev_dbg (i2c->adap.dev.parent,"%s TX STOP\n" , __func__); - -xiic_setreg16 (i2c,XIIC_DTR_REG_OFFSET , data); - }else -xiic_setreg8 (i2c,XIIC_DTR_REG_OFFSET , data); + } +xiic_setreg16 (i2c,XIIC_DTR_REG_OFFSET , data); } }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 36/136 sysfs: fix use after free in case of concurrent read/write and readdir
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Ming Lei <[email protected]>
[ Upstream commit f7db5e7660b122142410dcf36ba903c73d473250 ]
The inode->i_mutex isn't hold when updating filp->f_pos in read()/write(), so the filp->f_pos might be read as 0 or 1 in readdir() when there is concurrent read()/write() on this same file, then may cause use after free in readdir().
The bug can be reproduced with Li Zefan's test code on the link:
https://patchwork.kernel.org/patch/2160771/
This patch fixes the use after free under this situation.
--- fs/sysfs/dir.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
fs/sysfs/dir.c +11 -4
@@ -1012,6 +1012,7 @@ static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir)enum kobj_ns_type type;const void *ns;ino_t ino; +loff_t off; type =sysfs_ns_type (parent_sd); ns =sysfs_info (dentry->d_sb)->ns[type];
@@ -1034,6 +1035,7 @@ static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir)return 0 ; }mutex_lock (&sysfs_mutex); + off = filp->f_pos;for (pos =sysfs_dir_pos (ns, parent_sd, filp->f_pos, pos); pos; pos =sysfs_dir_next_pos (ns, parent_sd, filp->f_pos, pos)) {
@@ -1045,19 +1047,24 @@ static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir) len =strlen (name); ino = pos->s_ino; type =dt_type (pos); - filp->f_pos = pos->s_hash; + off = filp->f_pos = pos->s_hash; filp->private_data =sysfs_get (pos);mutex_unlock (&sysfs_mutex); - ret =filldir (dirent, name, len, filp->f_pos, ino, type); + ret =filldir (dirent, name, len, off, ino, type);mutex_lock (&sysfs_mutex);if (ret <0 )break ; }mutex_unlock (&sysfs_mutex); -if ((filp->f_pos >1 ) && !pos) {/* EOF */ - filp->f_pos =INT_MAX ; + +/* don't reference last entry if its refcount is dropped */ +if (!pos) { filp->private_data =NULL ; + +/* EOF and not changed as 0 or 1 in read/write path */ +if (off == filp->f_pos && off >1 ) + filp->f_pos =INT_MAX ; }return 0 ; }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 37/136 Fix initialization of CMCI/CMCP interrupts
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Tony Luck <[email protected]>
[ Upstream commit d303e9e98fce56cdb3c6f2ac92f626fc2bd51c77 ]
Back 2010 during a revamp of the irq code some initializations were moved from ia64_mca_init() to ia64_mca_late_init() in
commit c75f2aa13f5b268aba369b5dc566088b5194377c Cannot use register_percpu_irq() from ia64_mca_init()
But this was hideously wrong. First of all these initializations are now down far too late. Specifically after all the other cpus have been brought up and initialized their own CMC vectors from smp_callin(). Also ia64_mca_late_init() may be called from any cpu so the line:
ia64_mca_cmc_vector_setup(); /* Setup vector on BSP */
is generally not executed on the BSP, and so the CMC vector isn't setup at all on that processor.
Make use of the arch_early_irq_init() hook to get this code executed at just the right moment: not too early, not too late.
--- arch/ia64/include/asm/mca.h | 1 + arch/ia64/kernel/irq.c | 8 ++++++++ arch/ia64/kernel/mca.c | 37 ++++++++++++++++++++++++------------- 3 files changed, 33 insertions(+), 13 deletions(-)
arch/ia64/include/asm/mca.h +1 -0
@@ -143,6 +143,7 @@ extern unsigned long __per_cpu_mca[NR_CPUS];extern int cpe_vector;extern int ia64_cpe_irq;extern void ia64_mca_init (void ); +extern void ia64_mca_irq_init (void );extern void ia64_mca_cpu_init (void *);extern void ia64_os_mca_dispatch (void );extern void ia64_os_mca_dispatch_end (void );
arch/ia64/kernel/irq.c +8 -0
@@ -23,6 +23,8 @@#include <linux/interrupt.h> #include <linux/kernel_stat.h> +#include <asm/mca.h> +/* * 'what should we do if we get a hw irq event on an illegal vector'. * each architecture has to answer this themselves.
@@ -83,6 +85,12 @@ bool is_affinity_mask_valid(const struct cpumask *cpumask)#endif /* CONFIG_SMP */ +int __init arch_early_irq_init (void ) +{ +ia64_mca_irq_init (); +return 0 ; +} +#ifdef CONFIG_HOTPLUG_CPU unsigned int vectors_in_migration[NR_IRQS ];
arch/ia64/kernel/mca.c +24 -13
@@ -2074,22 +2074,16 @@ ia64_mca_init(void)printk (KERN_INFO "MCA related initialization done\n" ); } +/* -* ia64_mca_late_init -* -* Opportunity to setup things that require initialization later -* than ia64_mca_init. Setup a timer to poll for CPEs if the -* platform doesn't support an interrupt driven mechanism. -* -* Inputs : None -* Outputs : Status +* These pieces cannot be done in ia64_mca_init() because it is called before +* early_irq_init() which would wipe out our percpu irq registrations. But we +* cannot leave them until ia64_mca_late_init() because by then all the other +* processors have been brought online and have set their own CMC vectors to +* point at a non-existant action. Called from arch_early_irq_init(). */ -static int __init -ia64_mca_late_init (void ) +void __init ia64_mca_irq_init (void ) { -if (!mca_init) -return 0 ; -/* * Configure the CMCI/P vector and handler. Interrupts for CMC are * per-processor, so AP CMC interrupts are setup in smp_callin() (smpboot.c).
@@ -2108,6 +2102,23 @@ ia64_mca_late_init(void)/* Setup the CPEI/P handler */ register_percpu_irq (IA64_CPEP_VECTOR , &mca_cpep_irqaction);#endif +} + +/* +* ia64_mca_late_init +* +* Opportunity to setup things that require initialization later +* than ia64_mca_init. Setup a timer to poll for CPEs if the +* platform doesn't support an interrupt driven mechanism. +* +* Inputs : None +* Outputs : Status +*/ +static int __init +ia64_mca_late_init (void ) +{ +if (!mca_init) +return 0 ;register_hotcpu_notifier (&mca_cpu_notifier);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 38/136 PCI / ACPI: Dont query OSC support with all possible controls
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Yinghai Lu <[email protected]>
[ Upstream commit 545d6e189a41c94c11f55045a771118eccc9d9eb ]
Found problem on system that firmware that could handle pci aer. Firmware get error reporting after pci injecting error, before os boots. But after os boots, firmware can not get report anymore, even pci=noaer is passed.
Root cause: BIOS _OSC has problem with query bit checking. It turns out that BIOS vendor is copying example code from ACPI Spec. In ACPI Spec 5.0, page 290:
If (Not(And(CDW1,1))) // Query flag clear?
{ // Disable GPEs for features granted native control.
If (And(CTRL,0x01)) // Hot plug control granted?
{
Store(0,HPCE) // clear the hot plug SCI enable bit
Store(1,HPCS) // clear the hot plug SCI status bit
}
...
}When Query flag is set, And(CDW1,1) will be 1, Not(1) will return 0xfffffffe. So it will get into code path that should be for control set only. BIOS acpi code should be changed to "If (LEqual(And(CDW1,1), 0)))"
Current kernel code is using _OSC query to notify firmware about support from OS and then use _OSC to set control bits.
During query support, current code is using all possible controls. So will execute code that should be only for control set stage.
That will have problem when pci=noaer or aer firmware_first is used. As firmware have that control set for os aer already in query support stage, but later will not os aer handling.
We should avoid passing all possible controls, just use osc_control_set instead.
That should workaround BIOS bugs with affected systems on the field as more bios vendors are copying sample code from ACPI spec.
--- drivers/acpi/pci_root.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/pci_root.c +2 -2
@@ -247,8 +247,8 @@ static acpi_status acpi_pci_query_osc(struct acpi_pci_root *root, *control &=OSC_PCI_CONTROL_MASKS ; capbuf[OSC_CONTROL_TYPE ] = *control | root->osc_control_set; }else { -/* Run _OSC query for all possible controls. */ - capbuf[OSC_CONTROL_TYPE ] =OSC_PCI_CONTROL_MASKS ; +/* Run _OSC query only with existing controls. */ + capbuf[OSC_CONTROL_TYPE ] = root->osc_control_set; } status =acpi_pci_run_osc (root->device->handle, capbuf, &result);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 39/136 PCI/PM: Fix fallback to PCI_D0 in pci_platform_power_transition()
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: "Rafael J. Wysocki" <[email protected]>
[ Upstream commit 769ba7212f2059ca9fe0c73371e3d415c8c1c529 ]
Commit b51306c (PCI: Set device power state to PCI_D0 for device without native PM support) modified pci_platform_power_transition() by adding code causing dev->current_state for devices that don't support native PCI PM but are power-manageable by the platform to be changed to PCI_D0 regardless of the value returned by the preceding platform_pci_set_power_state(). In particular, that also is done if the platform_pci_set_power_state() has been successful, which causes the correct power state of the device set by pci_update_current_state() in that case to be overwritten by PCI_D0.
Fix that mistake by making the fallback to PCI_D0 only happen if the platform_pci_set_power_state() has returned an error.
[bhelgaas: folded in Yinghai's simplification, added URL & stable info]
Reference: http://lkml.kernel.org/r/27806FC4E5928A408B78E88BBC67A2306F466BBA@ORSMSX101.amr.corp.intel.com
--- drivers/pci/pci.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/pci/pci.c +4 -8
@@ -663,15 +663,11 @@ static int pci_platform_power_transition(struct pci_dev *dev, pci_power_t state) error =platform_pci_set_power_state (dev, state);if (!error)pci_update_current_state (dev, state); -/* Fall back to PCI_D0 if native PM is not supported */ -if (!dev->pm_cap) - dev->current_state =PCI_D0 ; - }else { + }else error = -ENODEV ; -/* Fall back to PCI_D0 if native PM is not supported */ -if (!dev->pm_cap) - dev->current_state =PCI_D0 ; - } + +if (error && !dev->pm_cap)/* Fall back to PCI_D0 */ + dev->current_state =PCI_D0 ;return error; }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 40/136 rt2x00: Fix transmit power troubles on some Ralink RT30xx cards
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: "Alex A. Mihaylov" <[email protected]>
[ Upstream commit 7e9dafd873034dd64ababcb858be424c4780ae13 ]
Some cards on Ralink RT30xx chipset not have correctly TX_MIXER_GAIN value in them EEPROM/EFUSE. In this case, we must use default value, but always used EEPROM/EFUSE value. As result we have tranmitt power range from -10dBm to +6dBm instead 0dBm to +16dBm.
Correctly value in EEPROM/EFUSE is one or more for RT3070 and two or more for other RT30xx chips.
Tested on Canyon CNP-WF518N1 usb Wi-Fi dongle and Jorjin WN8020 usb embedded Wi-Fi module.
--- drivers/net/wireless/rt2x00/rt2800lib.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/wireless/rt2x00/rt2800lib.c +7 -3
@@ -4148,7 +4148,9 @@ static int rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev)rt2800_register_write (rt2x00dev,OPT_14_CSR , reg);if (!rt2x00_rt (rt2x00dev,RT5390 ) && - !rt2x00_rt (rt2x00dev,RT5392 )) { + !rt2x00_rt (rt2x00dev,RT5392 )) { +u8 min_gain =rt2x00_rt (rt2x00dev,RT3070 ) ?1 :2 ; +rt2800_rfcsr_read (rt2x00dev,17 , &rfcsr);rt2x00_set_field8 (&rfcsr,RFCSR17_TX_LO1_EN ,0 ); if (rt2x00_rt(rt2x00dev, RT3070) ||
@@ -4159,8 +4161,10 @@ static int rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev) &rt2x00dev->cap_flags))rt2x00_set_field8 (&rfcsr,RFCSR17_R ,1 ); } -rt2x00_set_field8 (&rfcsr,RFCSR17_TXMIXER_GAIN , - drv_data->txmixer_gain_24g); +if (drv_data->txmixer_gain_24g >= min_gain) { +rt2x00_set_field8 (&rfcsr,RFCSR17_TXMIXER_GAIN , + drv_data->txmixer_gain_24g); + }rt2800_rfcsr_write (rt2x00dev,17 , rfcsr); }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 41/136 Wrong asm register contraints in the futex implementation
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Stephan Schreiber <[email protected]>
[ Upstream commit 136f39ddc53db3bcee2befbe323a56d4fbf06da8 ]
The Linux Kernel contains some inline assembly source code which has wrong asm register constraints in arch/ia64/include/asm/futex.h.
I observed this on Kernel 3.2.23 but it is also true on the most recent Kernel 3.9-rc1.
File arch/ia64/include/asm/futex.h:
static inline int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
u32 oldval, u32 newval)
{
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
return -EFAULT;
{
register unsigned long r8 __asm ("r8");
unsigned long prev;
__asm__ __volatile__(
" mf;; \n"
" mov %0=r0 \n"
" mov ar.ccv=%4;; \n"
"[1:] cmpxchg4.acq %1=[%2],%3,ar.ccv \n"
" .xdata4 \"__ex_table\", 1b-., 2f-. \n"
"[2:]"
: "=r" (r8), "=r" (prev)
: "r" (uaddr), "r" (newval),
"rO" ((long) (unsigned) oldval)
: "memory");
*uval = prev;
return r8;
}
}The list of output registers is
: "=r" (r8), "=r" (prev)
The constraint "=r" means that the GCC has to maintain that these vars are in registers and contain valid info when the program flow leaves the assembly block (output registers).
But "=r" also means that GCC can put them in registers that are used as input registers. Input registers are uaddr, newval, oldval on the example.
The second assembly instruction
" mov %0=r0 \n"
is the first one which writes to a register; it sets %0 to 0. %0 means the first register operand; it is r8 here. (The r0 is read-only and always 0 on the Itanium; it can be used if an immediate zero value is needed.)
This instruction might overwrite one of the other registers which are still needed.
Whether it really happens depends on how GCC decides what registers it uses and how it optimizes the code.
The objdump utility can give us disassembly.
The futex_atomic_cmpxchg_inatomic() function is inline, so we have to look for a module that uses the funtion. This is the cmpxchg_futex_value_locked() function inkernel/futex.c:
static int cmpxchg_futex_value_locked(u32 *curval, u32 __user *uaddr,
u32 uval, u32 newval)
{
int ret;
pagefault_disable();
ret = futex_atomic_cmpxchg_inatomic(curval, uaddr, uval, newval);
pagefault_enable();
return ret;
}Now the disassembly. At first from the Kernel package 3.2.23 which has been compiled with GCC 4.4, remeber this Kernel seemed to work:
objdump -d linux-3.2.23/debian/build/build_ia64_none_mckinley/kernel/futex.o
0000000000000230 <cmpxchg_futex_value_locked>:
230: 0b 18 80 1b 18 21 [MMI] adds r3=3168,r13;;
236: 80 40 0d 00 42 00 adds r8=40,r3
23c: 00 00 04 00 nop.i 0x0;;
240: 0b 50 00 10 10 10 [MMI] ld4 r10=[r8];;
246: 90 08 28 00 42 00 adds r9=1,r10
24c: 00 00 04 00 nop.i 0x0;;
250: 09 00 00 00 01 00 [MMI] nop.m 0x0
256: 00 48 20 20 23 00 st4 [r8]=r9
25c: 00 00 04 00 nop.i 0x0;;
260: 08 10 80 06 00 21 [MMI] adds r2=32,r3
266: 00 00 00 02 00 00 nop.m 0x0
26c: 02 08 f1 52 extr.u r16=r33,0,61
270: 05 40 88 00 08 e0 [MLX] addp4 r8=r34,r0
276: ff ff 0f 00 00 e0 movl r15=0xfffffffbfff;;
27c: f1 f7 ff 65
280: 09 70 00 04 18 10 [MMI] ld8 r14=[r2]
286: 00 00 00 02 00 c0 nop.m 0x0
28c: f0 80 1c d0 cmp.ltu p6,p7=r15,r16;;
290: 08 40 fc 1d 09 3b [MMI] cmp.eq p8,p9=-1,r14
296: 00 00 00 02 00 40 nop.m 0x0
29c: e1 08 2d d0 cmp.ltu p10,p11=r14,r33
2a0: 56 01 10 00 40 10 [BBB] (p10) br.cond.spnt.few 2e0
<cmpxchg_futex_value_locked+0xb0>
2a6: 02 08 00 80 21 03 (p08) br.cond.dpnt.few 2b0
<cmpxchg_futex_value_locked+0x80>
2ac: 40 00 00 41 (p06) br.cond.spnt.few 2e0
<cmpxchg_futex_value_locked+0xb0>
2b0: 0a 00 00 00 22 00 [MMI] mf;;
2b6: 80 00 00 00 42 00 mov r8=r0
2bc: 00 00 04 00 nop.i 0x0
2c0: 0b 00 20 40 2a 04 [MMI] mov.m ar.ccv=r8;;
2c6: 10 1a 85 22 20 00 cmpxchg4.acq r33=[r33],r35,ar.ccv
2cc: 00 00 04 00 nop.i 0x0;;
2d0: 10 00 84 40 90 11 [MIB] st4 [r32]=r33
2d6: 00 00 00 02 00 00 nop.i 0x0
2dc: 20 00 00 40 br.few 2f0
<cmpxchg_futex_value_locked+0xc0>
2e0: 09 40 c8 f9 ff 27 [MMI] mov r8=-14
2e6: 00 00 00 02 00 00 nop.m 0x0
2ec: 00 00 04 00 nop.i 0x0;;
2f0: 0b 58 20 1a 19 21 [MMI] adds r11=3208,r13;;
2f6: 20 01 2c 20 20 00 ld4 r18=[r11]
2fc: 00 00 04 00 nop.i 0x0;;
300: 0b 88 fc 25 3f 23 [MMI] adds r17=-1,r18;;
306: 00 88 2c 20 23 00 st4 [r11]=r17
30c: 00 00 04 00 nop.i 0x0;;
310: 11 00 00 00 01 00 [MIB] nop.m 0x0
316: 00 00 00 02 00 80 nop.i 0x0
31c: 08 00 84 00 br.ret.sptk.many b0;;The lines
2b0: 0a 00 00 00 22 00 [MMI] mf;;
2b6: 80 00 00 00 42 00 mov r8=r0
2bc: 00 00 04 00 nop.i 0x0
2c0: 0b 00 20 40 2a 04 [MMI] mov.m ar.ccv=r8;;
2c6: 10 1a 85 22 20 00 cmpxchg4.acq r33=[r33],r35,ar.ccv
2cc: 00 00 04 00 nop.i 0x0;;
are the instructions of the assembly block.
The line
2b6: 80 00 00 00 42 00 mov r8=r0
sets the r8 register to 0 and after that
2c0: 0b 00 20 40 2a 04 [MMI] mov.m ar.ccv=r8;;prepares the 'oldvalue' for the cmpxchg but it takes it from r8. This is wrong.
What happened here is what I explained above: An input register is overwritten which is still needed.
The register operand constraints in futex.h are wrong.
(The problem doesn't occur when the Kernel is compiled with GCC 4.6.)
The attached patch fixes the register operand constraints in futex.h. The code after patching of it:
static inline int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
u32 oldval, u32 newval)
{
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
return -EFAULT;
{
register unsigned long r8 __asm ("r8") = 0;
unsigned long prev;
__asm__ __volatile__(
" mf;; \n"
" mov ar.ccv=%4;; \n"
"[1:] cmpxchg4.acq %1=[%2],%3,ar.ccv \n"
" .xdata4 \"__ex_table\", 1b-., 2f-. \n"
"[2:]"
: "+r" (r8), "=&r" (prev)
: "r" (uaddr), "r" (newval),
"rO" ((long) (unsigned) oldval)
: "memory");
*uval = prev;
return r8;
}
}I also initialized the 'r8' var with the C programming language. The _asm qualifier on the definition of the 'r8' var forces GCC to use the r8 processor register for it.
I don't believe that we should use inline assembly for zeroing out a local variable.
The constraint is
"+r" (r8)
what means that it is both an input register and an output register. Note that the page fault handler will modify the r8 register which will be the return value of the function.
The real fix is
"=&r" (prev)
The & means that GCC must not use any of the input registers to place this output register in.
Patched the Kernel 3.2.23 and compiled it with GCC4.4:
0000000000000230 <cmpxchg_futex_value_locked>:
230: 0b 18 80 1b 18 21 [MMI] adds r3=3168,r13;;
236: 80 40 0d 00 42 00 adds r8=40,r3
23c: 00 00 04 00 nop.i 0x0;;
240: 0b 50 00 10 10 10 [MMI] ld4 r10=[r8];;
246: 90 08 28 00 42 00 adds r9=1,r10
24c: 00 00 04 00 nop.i 0x0;;
250: 09 00 00 00 01 00 [MMI] nop.m 0x0
256: 00 48 20 20 23 00 st4 [r8]=r9
25c: 00 00 04 00 nop.i 0x0;;
260: 08 10 80 06 00 21 [MMI] adds r2=32,r3
266: 20 12 01 10 40 00 addp4 r34=r34,r0
26c: 02 08 f1 52 extr.u r16=r33,0,61
270: 05 40 00 00 00 e1 [MLX] mov r8=r0
276: ff ff 0f 00 00 e0 movl r15=0xfffffffbfff;;
27c: f1 f7 ff 65
280: 09 70 00 04 18 10 [MMI] ld8 r14=[r2]
286: 00 00 00 02 00 c0 nop.m 0x0
28c: f0 80 1c d0 cmp.ltu p6,p7=r15,r16;;
290: 08 40 fc 1d 09 3b [MMI] cmp.eq p8,p9=-1,r14
296: 00 00 00 02 00 40 nop.m 0x0
29c: e1 08 2d d0 cmp.ltu p10,p11=r14,r33
2a0: 56 01 10 00 40 10 [BBB] (p10) br.cond.spnt.few 2e0
<cmpxchg_futex_value_locked+0xb0>
2a6: 02 08 00 80 21 03 (p08) br.cond.dpnt.few 2b0
<cmpxchg_futex_value_locked+0x80>
2ac: 40 00 00 41 (p06) br.cond.spnt.few 2e0
<cmpxchg_futex_value_locked+0xb0>
2b0: 0b 00 00 00 22 00 [MMI] mf;;
2b6: 00 10 81 54 08 00 mov.m ar.ccv=r34
2bc: 00 00 04 00 nop.i 0x0;;
2c0: 09 58 8c 42 11 10 [MMI] cmpxchg4.acq r11=[r33],r35,ar.ccv
2c6: 00 00 00 02 00 00 nop.m 0x0
2cc: 00 00 04 00 nop.i 0x0;;
2d0: 10 00 2c 40 90 11 [MIB] st4 [r32]=r11
2d6: 00 00 00 02 00 00 nop.i 0x0
2dc: 20 00 00 40 br.few 2f0
<cmpxchg_futex_value_locked+0xc0>
2e0: 09 40 c8 f9 ff 27 [MMI] mov r8=-14
2e6: 00 00 00 02 00 00 nop.m 0x0
2ec: 00 00 04 00 nop.i 0x0;;
2f0: 0b 88 20 1a 19 21 [MMI] adds r17=3208,r13;;
2f6: 30 01 44 20 20 00 ld4 r19=[r17]
2fc: 00 00 04 00 nop.i 0x0;;
300: 0b 90 fc 27 3f 23 [MMI] adds r18=-1,r19;;
306: 00 90 44 20 23 00 st4 [r17]=r18
30c: 00 00 04 00 nop.i 0x0;;
310: 11 00 00 00 01 00 [MIB] nop.m 0x0
316: 00 00 00 02 00 80 nop.i 0x0
31c: 08 00 84 00 br.ret.sptk.many b0;;Much better.
There is a
270: 05 40 00 00 00 e1 [MLX] mov r8=r0
which was generated by C code r8 = 0. Below
2b6: 00 10 81 54 08 00 mov.m ar.ccv=r34what means that oldval is no longer overwritten.
This is Debian bug#702641
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=702641).
The patch is applicable on Kernel 3.9-rc1, 3.2.23 and many other versions.
--- arch/ia64/include/asm/futex.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
arch/ia64/include/asm/futex.h +2 -3
@@ -106,16 +106,15 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,return -EFAULT ; { - registerunsigned long r8 __asm ("r8" ); + register unsigned long r8 __asm ("r8") = 0;unsigned long prev; __asm__ __volatile__(" mf;; \n" -" mov %0=r0 \n" " mov ar.ccv=%4;; \n" "[1:] cmpxchg4.acq %1=[%2],%3,ar.ccv \n" " .xdata4 \"__ex_table\", 1b-., 2f-. \n" "[2:]" - :"=r" (r8),"=r" (prev) + :"+r" (r8),"=&r" (prev) :"r" (uaddr),"r" (newval),"rO" ((long ) (unsigned ) oldval) :"memory" );
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 42/136 Wrong asm register contraints in the kvm implementation
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Stephan Schreiber <[email protected]>
[ Upstream commit de53e9caa4c6149ef4a78c2f83d7f5b655848767 ]
The Linux Kernel contains some inline assembly source code which has wrong asm register constraints in arch/ia64/kvm/vtlb.c.
I observed this on Kernel 3.2.35 but it is also true on the most recent Kernel 3.9-rc1.
File arch/ia64/kvm/vtlb.c:
u64 guest_vhpt_lookup(u64 iha, u64 *pte)
{
u64 ret;
struct thash_data *data;
data = __vtr_lookup(current_vcpu, iha, D_TLB);
if (data != NULL)
thash_vhpt_insert(current_vcpu, data->page_flags,
data->itir, iha, D_TLB);
asm volatile (
"rsm psr.ic|psr.i;;"
"srlz.d;;"
"ld8.s r9=[%1];;"
"tnat.nz p6,p7=r9;;"
"(p6) mov %0=1;"
"(p6) mov r9=r0;"
"(p7) extr.u r9=r9,0,53;;"
"(p7) mov %0=r0;"
"(p7) st8 [%2]=r9;;"
"ssm psr.ic;;"
"srlz.d;;"
"ssm psr.i;;"
"srlz.d;;"
: "=r"(ret) : "r"(iha), "r"(pte):"memory");
return ret;
}The list of output registers is
: "=r"(ret) : "r"(iha), "r"(pte):"memory");
The constraint "=r" means that the GCC has to maintain that these vars are in registers and contain valid info when the program flow leaves the assembly block (output registers).
But "=r" also means that GCC can put them in registers that are used as input registers. Input registers are iha, pte on the example. If the predicate p7 is true, the 8th assembly instruction
"(p7) mov %0=r0;"
is the first one which writes to a register which is maintained by the register constraints; it sets %0. %0 means the first register operand; it is ret here.
This instruction might overwrite the %2 register (pte) which is needed by the next instruction:
"(p7) st8 [%2]=r9;;"
Whether it really happens depends on how GCC decides what registers it uses and how it optimizes the code.
The attached patch fixes the register operand constraints in arch/ia64/kvm/vtlb.c.
The register constraints should be
: "=&r"(ret) : "r"(iha), "r"(pte):"memory");
The & means that GCC must not use any of the input registers to place this output register in.
This is Debian bug#702639
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=702639).
The patch is applicable on Kernel 3.9-rc1, 3.2.35 and many other versions.
--- arch/ia64/kvm/vtlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/ia64/kvm/vtlb.c +1 -1
@@ -256,7 +256,7 @@ u64 guest_vhpt_lookup(u64 iha, u64 *pte)"srlz.d;;" "ssm psr.i;;" "srlz.d;;" - : "=r"(ret) : "r"(iha), "r"(pte):"memory"); + : "=&r"(ret) : "r"(iha), "r"(pte) : "memory"); return ret; }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 43/136 fs/fscache/stats.c: fix memory leak
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Anurup m <[email protected]>
[ Upstream commit ec686c9239b4d472052a271c505d04dae84214cc ]
There is a kernel memory leak observed when the proc file /proc/fs/fscache/stats is read.
The reason is that in fscache_stats_open, single_open is called and the respective release function is not called during release. Hence fix with correct release function - single_release().
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=57101
--- fs/fscache/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/fscache/stats.c +1 -1
@@ -276,5 +276,5 @@ const struct file_operations fscache_stats_fops = { .open = fscache_stats_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, };
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 44/136 mm: allow arch code to control the user page table ceiling
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Hugh Dickins <[email protected]>
[ Upstream commit 6ee8630e02be6dd89926ca0fbc21af68b23dc087 ]
On architectures where a pgd entry may be shared between user and kernel (e.g. ARM+LPAE), freeing page tables needs a ceiling other than 0. This patch introduces a generic USER_PGTABLES_CEILING that arch code can override. It is the responsibility of the arch code setting the ceiling to ensure the complete freeing of the page tables (usually in pgd_free()).
--- fs/exec.c | 4 ++-- include/asm-generic/pgtable.h | 10 ++++++++++ mm/mmap.c | 4 ++-- 3 files changed, 14 insertions(+), 4 deletions(-)
fs/exec.c +2 -2
@@ -623,7 +623,7 @@ static int shift_arg_pages(struct vm_area_struct *vma, unsigned long shift)* when the old and new regions overlap clear from new_end. */ free_pgd_range (&tlb, new_end, old_end, new_end, - vma->vm_next ? vma->vm_next->vm_start :0 ); + vma->vm_next ? vma->vm_next->vm_start :USER_PGTABLES_CEILING ); }else {/* * otherwise, clean from old_start; this is done to not touch
@@ -632,7 +632,7 @@ static int shift_arg_pages(struct vm_area_struct *vma, unsigned long shift)* for the others its just a little faster. */ free_pgd_range (&tlb, old_start, old_end, new_end, - vma->vm_next ? vma->vm_next->vm_start :0 ); + vma->vm_next ? vma->vm_next->vm_start :USER_PGTABLES_CEILING ); }tlb_finish_mmu (&tlb, new_end, old_end);
include/asm-generic/pgtable.h +10 -0
@@ -7,6 +7,16 @@#include <linux/mm_types.h> #include <linux/bug.h> +/* +* On almost all architectures and configurations, 0 can be used as the +* upper ceiling to free_pgtables(): on many architectures it has the same +* effect as using TASK_SIZE. However, there is one configuration which +* must impose a more careful limit, to avoid freeing kernel pgtables. +*/ +#ifndef USER_PGTABLES_CEILING +#define USER_PGTABLES_CEILING 0UL +#endif +#ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS extern int ptep_set_access_flags(struct vm_area_struct *vma, unsigned long address, pte_t *ptep,
mm/mmap.c +2 -2
@@ -1912,7 +1912,7 @@ static void unmap_region(struct mm_struct *mm,update_hiwater_rss (mm);unmap_vmas (&tlb, vma, start, end);free_pgtables (&tlb, vma, prev ? prev->vm_end :FIRST_USER_ADDRESS , - next ? next->vm_start :0 ); + next ? next->vm_start :USER_PGTABLES_CEILING );tlb_finish_mmu (&tlb, start, end); }
@@ -2294,7 +2294,7 @@ void exit_mmap(struct mm_struct *mm)/* Use -1 here to ensure all VMAs in the mm are unmapped */ unmap_vmas (&tlb, vma,0 ,-1 ); -free_pgtables (&tlb, vma,FIRST_USER_ADDRESS ,0 ); +free_pgtables (&tlb, vma,FIRST_USER_ADDRESS ,USER_PGTABLES_CEILING );tlb_finish_mmu (&tlb,0 ,-1 );/*
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 45/136 TPM: Retry SaveState command in suspend path
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Duncan Laurie <[email protected]>
[ Upstream commit 32d33b29ba077d6b45de35f2181e0a7411b162f4 ]
If the TPM has already been sent a SaveState command before the driver is loaded it may have problems sending that same command again later.
This issue is seen with the Chromebook Pixel due to a firmware bug in the legacy mode boot path which is sending the SaveState command before booting the kernel. More information is available at
http://crbug.com/203524
This change introduces a retry of the SaveState command in the suspend path in order to work around this issue. A future firmware update should fix this but this is also a trivial workaround in the driver that has no effect on systems that do not show this problem.
When this does happen the TPM responds with a non-fatal TPM_RETRY code that is defined in the specification:
The TPM is too busy to respond to the command immediately, but the command could be resubmitted at a later time. The TPM MAY return TPM_RETRY for any command at any time.
It can take several seconds before the TPM will respond again. I measured a typical time between 3 and 4 seconds and the timeout is set at a safe 5 seconds.
It is also possible to reproduce this with commands via /dev/tpm0. The bug linked above has a python script attached which can be used to test for this problem. I tested a variety of TPMs from Infineon, Nuvoton, Atmel, and STMicro but was only able to reproduce this with LPC and I2C TPMs from Infineon.
The TPM specification only loosely defines this behavior:
TPM Main Level 2 Part 3 v1.2 r116, section 3.3. TPM_SaveState:
The TPM MAY declare all preserved values invalid in response to any command other than TPM_Init.
TCG PC Client BIOS Spec 1.21 section 8.3.1.
After issuing a TPM_SaveState command, the OS SHOULD NOT issue TPM commands before transitioning to S3 without issuing another TPM_SaveState command.
TCG PC Client TIS 1.21, section 4. Power Management:
The TPM_SaveState command allows a Static OS to indicate to the TPM that the platform may enter a low power state where the TPM will be required to enter into the D3 power state. The use of the term "may" is significant in that there is no requirement for the platform to actually enter the low power state after sending the TPM_SaveState command. The software may, in fact, send subsequent commands after sending the TPM_SaveState command.
--- drivers/char/tpm/tpm.c | 32 ++++++++++++++++++++++++++++---- drivers/char/tpm/tpm.h | 2 ++ 2 files changed, 30 insertions(+), 4 deletions(-)
drivers/char/tpm/tpm.c +28 -4
@@ -35,6 +35,7 @@ enum tpm_const {TPM_MINOR =224 ,/* officially assigned */ TPM_BUFSIZE =4096 ,TPM_NUM_DEVICES =256 , + TPM_RETRY = 50, /* 5 seconds */ }; enum tpm_duration {
@@ -1293,7 +1294,7 @@ int tpm_pm_suspend(struct device *dev) {struct tpm_chip *chip =dev_get_drvdata (dev);struct tpm_cmd_t cmd; -int rc; +int rc, try;u8 dummy_hash[TPM_DIGEST_SIZE ] = {0 };
@@ -1311,9 +1312,32 @@ int tpm_pm_suspend(struct device *dev) }/* now do the actual savestate */ - cmd.header.in = savestate_header; - rc =transmit_cmd (chip, &cmd,SAVESTATE_RESULT_SIZE , -"sending savestate before suspend" ); +for (try =0 ; try <TPM_RETRY ; try++) { + cmd.header.in = savestate_header; + rc =transmit_cmd (chip, &cmd,SAVESTATE_RESULT_SIZE ,NULL ); + +/* +* If the TPM indicates that it is too busy to respond to +* this command then retry before giving up. It can take +* several seconds for this TPM to be ready. +* +* This can happen if the TPM has already been sent the +* SaveState command before the driver has loaded. TCG 1.2 +* specification states that any communication after SaveState +* may cause the TPM to invalidate previously saved state. +*/ +if (rc !=TPM_WARN_RETRY ) +break ; +msleep (TPM_TIMEOUT_RETRY ); + } + +if (rc) +dev_err (chip->dev, +"Error (%d) sending savestate before suspend\n" , rc); +else if (try >0 ) +dev_warn (chip->dev,"TPM savestate took %dms\n" , + try *TPM_TIMEOUT_RETRY ); +return rc; }EXPORT_SYMBOL_GPL (tpm_pm_suspend);
drivers/char/tpm/tpm.h +2 -0
@@ -30,6 +30,7 @@enum tpm_timeout {TPM_TIMEOUT =5 ,/* msecs */ +TPM_TIMEOUT_RETRY =100 /* msecs */ };/* TPM addresses */
@@ -38,6 +39,7 @@ enum tpm_addr { TPM_ADDR = 0x4E, }; +#define TPM_WARN_RETRY 0x800#define TPM_WARN_DOING_SELFTEST 0x802#define TPM_ERR_DEACTIVATED 0x6#define TPM_ERR_DISABLED 0x7
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 46/136 ALSA: snd-usb: try harder to find USB_DT_CS_ENDPOINT
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Daniel Mack <[email protected]>
[ Upstream commit ebfc594c02148b6a85c2f178cf167a44a3c3ce10 ]
The USB_DT_CS_ENDPOINT class-specific endpoint descriptor is usually stuffed directly after the standard USB endpoint descriptor, and this is where the driver currently expects it to be.
There are, however, devices in the wild that have it the other way around in their descriptor sets, so the USB_DT_CS_ENDPOINT comes *before* the standard enpoint. Devices known to implement it that way are "Sennheiser BTD-500" and Plantronics USB headsets.
When the driver can't find the USB_DT_CS_ENDPOINT, it won't be able to change sample rates, as the bitmask for the validity of this command is storen in bmAttributes of that descriptor.
Fix this by searching the entire interface instead of just the extra bytes of the first endpoint, in case the latter fails.
--- sound/usb/stream.c | 8 ++++++++ 1 file changed, 8 insertions(+)
sound/usb/stream.c +8 -0
@@ -193,6 +193,14 @@ static int parse_uac_endpoint_attributes(struct snd_usb_audio *chip,if (!csep && altsd->bNumEndpoints >=2 ) csep =snd_usb_find_desc (alts->endpoint[1 ].extra, alts->endpoint[1 ].extralen,NULL ,USB_DT_CS_ENDPOINT ); +/* +* If we can't locate the USB_DT_CS_ENDPOINT descriptor in the extra +* bytes after the first endpoint, go search the entire interface. +* Some devices have it directly *before* the standard endpoint. +*/ +if (!csep) + csep =snd_usb_find_desc (alts->extra, alts->extralen,NULL ,USB_DT_CS_ENDPOINT ); +if (!csep || csep->bLength <7 || csep->bDescriptorSubtype !=UAC_EP_GENERAL ) { snd_printk(KERN_WARNING "%d:%u:%d : no or invalid"
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 47/136 ALSA: usb: Add quirk for 192KHz recording on E-Mu devices
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Calvin Owens <[email protected]>
[ Upstream commit 1539d4f82ad534431cc67935e8e442ccf107d17d ]
When recording at 176.2KHz or 192Khz, the device adds a 32-bit length header to the capture packets, which obviously needs to be ignored for recording to work properly.
Userspace expected: L0 L1 L2 R0 R1 R2
...but actually got: R2 L0 L1 L2 R0 R1
Also, the last byte of the length header being interpreted as L0 of the first sample caused spikes every 0.5ms, resulting in a loud 16KHz tone (about the highest 'B' on a piano) being present throughout captures.
Tested at all sample rates on an E-Mu 0404USB, and tested for regressions on a generic USB headset.
--- sound/usb/card.h | 1 + sound/usb/pcm.c | 2 +- sound/usb/quirks.c | 1 + sound/usb/stream.c | 1 + 4 files changed, 4 insertions(+), 1 deletion(-)
sound/usb/card.h +1 -0
@@ -112,6 +112,7 @@ struct snd_usb_substream {unsigned int altset_idx;/* USB data format: index of alternate setting */ unsigned int txfr_quirk:1; /* allow sub-frame alignment */unsigned int fmt_type;/* USB audio format type (1-3) */ +unsigned int pkt_offset_adj;/* Bytes to drop from beginning of packets (for non-compliant devices) */ unsigned int running: 1; /* running status */
sound/usb/pcm.c +1 -1
@@ -1017,7 +1017,7 @@ static void retire_capture_urb(struct snd_usb_substream *subs, stride = runtime->frame_bits >>3 ;for (i =0 ; i < urb->number_of_packets; i++) { - cp = (unsigned char *)urb->transfer_buffer + urb->iso_frame_desc[i].offset; + cp = (unsigned char *)urb->transfer_buffer + urb->iso_frame_desc[i].offset + subs->pkt_offset_adj;if (urb->iso_frame_desc[i].status &&printk_ratelimit ()) {snd_printdd (KERN_ERR "frame %d active: %d\n" , i, urb->iso_frame_desc[i].status);// continue;
sound/usb/quirks.c +1 -0
@@ -746,6 +746,7 @@ static void set_format_emu_quirk(struct snd_usb_substream *subs,break ; }snd_emuusb_set_samplerate (subs->stream->chip, emu_samplerate_id); + subs->pkt_offset_adj = (emu_samplerate_id >=EMU_QUIRK_SR_176400HZ ) ?4 :0 ; } void snd_usb_set_format_quirk(struct snd_usb_substream *subs,
sound/usb/stream.c +1 -0
@@ -91,6 +91,7 @@ static void snd_usb_init_substream(struct snd_usb_stream *as, subs->dev = as->chip->dev; subs->txfr_quirk = as->chip->txfr_quirk; subs->speed =snd_usb_get_speed (subs->dev); + subs->pkt_offset_adj =0 ;snd_usb_set_pcm_ops (as->pcm, stream);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 48/136 ALSA: usb-audio: Fix missing autopm for MIDI input
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
[ Upstream commit f5f165418cabf2218eb466c0e94693b8b1aee88b ]
The commit [88a8516a: ALSA: usbaudio: implement USB autosuspend] added the support of autopm for USB MIDI output, but it didn't take the MIDI input into account.
This patch adds the following for fixing the autopm:
- Manage the URB start at the first MIDI input stream open, instead of the time of instance creation
- Move autopm code to the common substream_open()
- Make snd_usbmidi_input_start/_stop() more robust and add the running state check
--- sound/usb/midi.c | 78 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 33 deletions(-)
sound/usb/midi.c +45 -33
@@ -125,8 +125,10 @@ struct snd_usb_midi {struct snd_usb_midi_in_endpoint *in; } endpoints[MIDI_MAX_ENDPOINTS ];unsigned long input_triggered; -unsigned int opened; +bool autopm_reference; +unsigned int opened[2 ];unsigned char disconnected; +unsigned char input_running;struct snd_kcontrol *roland_load_ctl; };
@@ -148,7 +150,6 @@ struct snd_usb_midi_out_endpoint {struct snd_usb_midi_out_endpoint * ep;struct snd_rawmidi_substream *substream;int active; -bool autopm_reference;uint8_t cable;/* cable number << 4 */ uint8_t state;#define STATE_UNKNOWN 0
@@ -1033,29 +1034,51 @@ static void update_roland_altsetting(struct snd_usb_midi* umidi)snd_usbmidi_input_start (&umidi->list); } -static void substream_open (struct snd_rawmidi_substream *substream,int open) +static int substream_open (struct snd_rawmidi_substream *substream,int dir, +int open) {struct snd_usb_midi * umidi = substream->rmidi->private_data;struct snd_kcontrol *ctl; +int err;mutex_lock (&umidi->mutex);if (open) { -if (umidi->opened++ ==0 && umidi->roland_load_ctl) { - ctl = umidi->roland_load_ctl; - ctl->vd[0 ].access |=SNDRV_CTL_ELEM_ACCESS_INACTIVE ; -snd_ctl_notify (umidi->card, +if (!umidi->opened[0 ] && !umidi->opened[1 ]) { + err =usb_autopm_get_interface (umidi->iface); + umidi->autopm_reference = err >=0 ; +if (err <0 && err != -EACCES ) { +mutex_unlock (&umidi->mutex); +up_read (&umidi->disc_rwsem); +return -EIO ; + } +if (umidi->roland_load_ctl) { + ctl = umidi->roland_load_ctl; + ctl->vd[0 ].access |=SNDRV_CTL_ELEM_ACCESS_INACTIVE ; +snd_ctl_notify (umidi->card,SNDRV_CTL_EVENT_MASK_INFO , &ctl->id); -update_roland_altsetting (umidi); +update_roland_altsetting (umidi); + } } + umidi->opened[dir]++; +if (umidi->opened[1 ]) +snd_usbmidi_input_start (&umidi->list); }else { -if (--umidi->opened ==0 && umidi->roland_load_ctl) { - ctl = umidi->roland_load_ctl; - ctl->vd[0 ].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE ; -snd_ctl_notify (umidi->card, + umidi->opened[dir]--; +if (!umidi->opened[1 ]) +snd_usbmidi_input_stop (&umidi->list); +if (!umidi->opened[0 ] && !umidi->opened[1 ]) { +if (umidi->roland_load_ctl) { + ctl = umidi->roland_load_ctl; + ctl->vd[0 ].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE ; +snd_ctl_notify (umidi->card,SNDRV_CTL_EVENT_MASK_INFO , &ctl->id); + } +if (umidi->autopm_reference) +usb_autopm_put_interface (umidi->iface); } }mutex_unlock (&umidi->mutex); +return 0 ; }static int snd_usbmidi_output_open (struct snd_rawmidi_substream *substream)
@@ -1063,7 +1086,6 @@ static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream)struct snd_usb_midi * umidi = substream->rmidi->private_data;struct usbmidi_out_port * port =NULL ;int i, j; -int err;for (i =0 ; i <MIDI_MAX_ENDPOINTS ; ++i)if (umidi->endpoints[i].out)
@@ -1076,25 +1098,14 @@ static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream)snd_BUG ();return -ENXIO ; } - err =usb_autopm_get_interface (umidi->iface); - port->autopm_reference = err >=0 ; -if (err <0 && err != -EACCES ) -return -EIO ; substream->runtime->private_data = port; port->state =STATE_UNKNOWN ; -substream_open (substream,1 ); -return 0 ; +return substream_open (substream,0 ,1 ); }static int snd_usbmidi_output_close (struct snd_rawmidi_substream *substream) { -struct snd_usb_midi * umidi = substream->rmidi->private_data; -struct usbmidi_out_port *port = substream->runtime->private_data; - -substream_open (substream,0 ); -if (port->autopm_reference) -usb_autopm_put_interface (umidi->iface); -return 0 ; +return substream_open (substream,0 ,0 ); }static void snd_usbmidi_output_trigger (struct snd_rawmidi_substream *substream,int up)
@@ -1147,14 +1158,12 @@ static void snd_usbmidi_output_drain(struct snd_rawmidi_substream *substream)static int snd_usbmidi_input_open (struct snd_rawmidi_substream *substream) { -substream_open (substream,1 ); -return 0 ; +return substream_open (substream,1 ,1 ); }static int snd_usbmidi_input_close (struct snd_rawmidi_substream *substream) { -substream_open (substream,0 ); -return 0 ; +return substream_open (substream,1 ,0 ); }static void snd_usbmidi_input_trigger (struct snd_rawmidi_substream *substream,int up)
@@ -2060,12 +2069,15 @@ void snd_usbmidi_input_stop(struct list_head* p)unsigned int i, j; umidi = list_entry(p, struct snd_usb_midi, list); +if (!umidi->input_running) +return ;for (i =0 ; i <MIDI_MAX_ENDPOINTS ; ++i) {struct snd_usb_midi_endpoint * ep = &umidi->endpoints[i];if (ep->in)for (j =0 ; j <INPUT_URBS ; ++j)usb_kill_urb (ep->in->urbs[j]); } + umidi->input_running =0 ; }static void snd_usbmidi_input_start_ep (struct snd_usb_midi_in_endpoint * ep)
@@ -2090,8 +2102,11 @@ void snd_usbmidi_input_start(struct list_head* p)int i; umidi = list_entry(p, struct snd_usb_midi, list); +if (umidi->input_running || !umidi->opened[1 ]) +return ;for (i =0 ; i <MIDI_MAX_ENDPOINTS ; ++i)snd_usbmidi_input_start_ep (umidi->endpoints[i].in); + umidi->input_running =1 ; }/*
@@ -2229,9 +2244,6 @@ int snd_usbmidi_create(struct snd_card *card, }list_add_tail (&umidi->list, midi_list); - -for (i =0 ; i <MIDI_MAX_ENDPOINTS ; ++i) -snd_usbmidi_input_start_ep (umidi->endpoints[i].in);return 0 ; }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 49/136 ALSA: usb-audio: disable autopm for MIDI devices
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Clemens Ladisch <[email protected]>
[ Upstream commit cbc200bca4b51a8e2406d4b654d978f8503d430b ]
Commit 88a8516a2128 (ALSA: usbaudio: implement USB autosuspend) introduced autopm for all USB audio/MIDI devices. However, many MIDI devices, such as synthesizers, do not merely transmit MIDI messages but use their MIDI inputs to control other functions. With autopm, these devices would get powered down as soon as the last MIDI port device is closed on the host.
Even some plain MIDI interfaces could get broken: they automatically send Active Sensing messages while powered up, but as soon as these messages cease, the receiving device would interpret this as an accidental disconnection.
Commit f5f165418cab (ALSA: usb-audio: Fix missing autopm for MIDI input) introduced another regression: some devices (e.g. the Roland GAIA SH-01) are self-powered but do a reset whenever the USB interface's power state changes.
To work around all this, just disable autopm for all USB MIDI devices.
--- sound/usb/midi.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)
sound/usb/midi.c +2 -11
@@ -125,7 +125,6 @@ struct snd_usb_midi {struct snd_usb_midi_in_endpoint *in; } endpoints[MIDI_MAX_ENDPOINTS ];unsigned long input_triggered; -bool autopm_reference;unsigned int opened[2 ];unsigned char disconnected;unsigned char input_running;
@@ -1039,18 +1038,10 @@ static int substream_open(struct snd_rawmidi_substream *substream, int dir, {struct snd_usb_midi * umidi = substream->rmidi->private_data;struct snd_kcontrol *ctl; -int err;mutex_lock (&umidi->mutex);if (open) {if (!umidi->opened[0 ] && !umidi->opened[1 ]) { - err =usb_autopm_get_interface (umidi->iface); - umidi->autopm_reference = err >=0 ; -if (err <0 && err != -EACCES ) { -mutex_unlock (&umidi->mutex); -up_read (&umidi->disc_rwsem); -return -EIO ; - }if (umidi->roland_load_ctl) { ctl = umidi->roland_load_ctl; ctl->vd[0 ].access |=SNDRV_CTL_ELEM_ACCESS_INACTIVE ;
@@ -1073,8 +1064,6 @@ static int substream_open(struct snd_rawmidi_substream *substream, int dir,snd_ctl_notify (umidi->card,SNDRV_CTL_EVENT_MASK_INFO , &ctl->id); } -if (umidi->autopm_reference) -usb_autopm_put_interface (umidi->iface); } }mutex_unlock (&umidi->mutex);
@@ -2243,6 +2232,8 @@ int snd_usbmidi_create(struct snd_card *card,return err; } +usb_autopm_get_interface_no_resume (umidi->iface); +list_add_tail (&umidi->list, midi_list);return 0 ; }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 50/136 ALSA: usb-audio: Fix autopm error during probing
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
[ Upstream commit 60af3d037eb8c670dcce31401501d1271e7c5d95 ]
We've got strange errors in get_ctl_value() in mixer.c during probing, e.g. on Hercules RMX2 DJ Controller:
ALSA mixer.c:352 cannot get ctl value: req = 0x83, wValue = 0x201, wIndex = 0xa00, type = 4 ALSA mixer.c:352 cannot get ctl value: req = 0x83, wValue = 0x200, wIndex = 0xa00, type = 4
....
It turned out that the culprit is autopm: snd_usb_autoresume() returns -ENODEV when called during card->probing = 1.
Since the call itself during card->probing = 1 is valid, let's fix the return value of snd_usb_autoresume() as success.
--- sound/usb/card.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/usb/card.c +3 -1
@@ -619,7 +619,9 @@ int snd_usb_autoresume(struct snd_usb_audio *chip)int err = -ENODEV ;down_read (&chip->shutdown_rwsem); -if (!chip->shutdown && !chip->probing) +if (chip->probing) + err =0 ; +else if (!chip->shutdown) err =usb_autopm_get_interface (chip->pm_intf);up_read (&chip->shutdown_rwsem);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 51/136 ASoC: max98088: Fix logging of hardware revision.
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Dylan Reid <[email protected]>
[ Upstream commit 98682063549bedd6e2d2b6b7222f150c6fbce68c ]
The hardware revision of the codec is based at 0x40. Subtract that before convering to ASCII. The same as it is done for 98095.
--- sound/soc/codecs/max98088.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/max98088.c +1 -1
@@ -2006,7 +2006,7 @@ static int max98088_probe(struct snd_soc_codec *codec) ret); goto err_access; } -dev_info (codec->dev,"revision %c\n" , ret +'A' ); +dev_info (codec->dev,"revision %c\n" , ret -0x40 +'A' );snd_soc_write (codec,M98088_REG_51_PWR_SYS ,M98088_PWRSV );
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 52/136 hrtimer: Fix ktime_add_ns() overflow on 32bit architectures
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: David Engraf <[email protected]>
[ Upstream commit 51fd36f3fad8447c487137ae26b9d0b3ce77bb25 ]
One can trigger an overflow when using ktime_add_ns() on a 32bit architecture not supporting CONFIG_KTIME_SCALAR.
When passing a very high value for u64 nsec, e.g. 7881299347898368000 the do_div() function converts this value to seconds (7881299347) which is still to high to pass to the ktime_set() function as long. The result in is a negative value.
The problem on my system occurs in the tick-sched.c, tick_nohz_stop_sched_tick() when time_delta is set to timekeeping_max_deferment(). The check for time_delta < KTIME_MAX is valid, thus ktime_add_ns() is called with a too large value resulting in a negative expire value. This leads to an endless loop in the ticker code:
time_delta: 7881299347898368000
expires = ktime_add_ns(last_update, time_delta)
expires: negative value
This fix caps the value to KTIME_MAX.
This error doesn't occurs on 64bit or architectures supporting CONFIG_KTIME_SCALAR (e.g. ARM, x86-32).
--- kernel/hrtimer.c | 4 ++++ 1 file changed, 4 insertions(+)
kernel/hrtimer.c +4 -0
@@ -298,6 +298,10 @@ ktime_t ktime_sub_ns(const ktime_t kt, u64 nsec) }else {unsigned long rem =do_div (nsec,NSEC_PER_SEC ); +/* Make sure nsec fits into long */ +if (unlikely (nsec >KTIME_SEC_MAX )) +return (ktime_t ){ .tv64 =KTIME_MAX }; + tmp =ktime_set ((long )nsec, rem); }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 53/136 hrtimer: Add expiry time overflow check in hrtimer_interrupt
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Prarit Bhargava <[email protected]>
[ Upstream commit 8f294b5a139ee4b75e890ad5b443c93d1e558a8b ]
The settimeofday01 test in the LTP testsuite effectively does
gettimeofday(current time);
settimeofday(Jan 1, 1970 + 100 seconds);
settimeofday(current time);This test causes a stack trace to be displayed on the console during the setting of timeofday to Jan 1, 1970 + 100 seconds:
[ 131.066751] ------------[ cut here ]------------ [ 131.096448] WARNING: at kernel/time/clockevents.c:209 clockevents_program_event+0x135/0x140() [ 131.104935] Hardware name: Dinar [ 131.108150] Modules linked in: sg nfsv3 nfs_acl nfsv4 auth_rpcgss nfs dns_resolver fscache lockd sunrpc nf_conntrack_netbios_ns nf_conntrack_broadcast ipt_MASQUERADE ip6table_mangle ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 iptable_nat nf_nat_ipv4 nf_nat iptable_mangle ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter ip_tables kvm_amd kvm sp5100_tco bnx2 i2c_piix4 crc32c_intel k10temp fam15h_power ghash_clmulni_intel amd64_edac_mod pcspkr serio_raw edac_mce_amd edac_core microcode xfs libcrc32c sr_mod sd_mod cdrom ata_generic crc_t10dif pata_acpi radeon i2c_algo_bit drm_kms_helper ttm drm ahci pata_atiixp libahci libata usb_storage i2c_core dm_mirror dm_region_hash dm_log dm_mod [ 131.176784] Pid: 0, comm: swapper/28 Not tainted 3.8.0+ #6 [ 131.182248] Call Trace: [ 131.184684] <IRQ> [<ffffffff810612af>] warn_slowpath_common+0x7f/0xc0 [ 131.191312] [<ffffffff8106130a>] warn_slowpath_null+0x1a/0x20 [ 131.197131] [<ffffffff810b9fd5>] clockevents_program_event+0x135/0x140 [ 131.203721] [<ffffffff810bb584>] tick_program_event+0x24/0x30 [ 131.209534] [<ffffffff81089ab1>] hrtimer_interrupt+0x131/0x230 [ 131.215437] [<ffffffff814b9600>] ? cpufreq_p4_target+0x130/0x130 [ 131.221509] [<ffffffff81619119>] smp_apic_timer_interrupt+0x69/0x99 [ 131.227839] [<ffffffff8161805d>] apic_timer_interrupt+0x6d/0x80 [ 131.233816] <EOI> [<ffffffff81099745>] ? sched_clock_cpu+0xc5/0x120 [ 131.240267] [<ffffffff814b9ff0>] ? cpuidle_wrap_enter+0x50/0xa0 [ 131.246252] [<ffffffff814b9fe9>] ? cpuidle_wrap_enter+0x49/0xa0 [ 131.252238] [<ffffffff814ba050>] cpuidle_enter_tk+0x10/0x20 [ 131.257877] [<ffffffff814b9c89>] cpuidle_idle_call+0xa9/0x260 [ 131.263692] [<ffffffff8101c42f>] cpu_idle+0xaf/0x120 [ 131.268727] [<ffffffff815f8971>] start_secondary+0x255/0x257 [ 131.274449] ---[ end trace 1151a50552231615 ]---
When we change the system time to a low value like this, the value of timekeeper->offs_real will be a negative value.
It seems that the WARN occurs because an hrtimer has been started in the time between the releasing of the timekeeper lock and the IPI call (via a call to on_each_cpu) in clock_was_set() in the do_settimeofday() code. The end result is that a REALTIME_CLOCK timer has been added with softexpires = expires = KTIME_MAX. The hrtimer_interrupt() fires/is called and the loop at kernel/hrtimer.c:1289 is executed. In this loop the code subtracts the clock base's offset (which was set to timekeeper->offs_real in do_settimeofday()) from the current hrtimer_cpu_base->expiry value (which was KTIME_MAX):
KTIME_MAX - (a negative value) = overflow
A simple check for an overflow can resolve this problem. Using KTIME_MAX instead of the overflow value will result in the hrtimer function being run, and the reprogramming of the timer after that.
--- kernel/hrtimer.c | 2 ++ 1 file changed, 2 insertions(+)
kernel/hrtimer.c +2 -0
@@ -1312,6 +1312,8 @@ retry: expires =ktime_sub (hrtimer_get_expires (timer), base->offset); +if (expires.tv64 <0 ) + expires.tv64 =KTIME_MAX ;if (expires.tv64 < expires_next.tv64) expires_next = expires;break ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 54/136 swap: redirty page if page write fails on swap file
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Jerome Marchand <[email protected]>
[ Upstream commit 2d30d31ea3c5be426ce25607b9bd1835acb85e0a ]
Since commit 62c230bc1790 ("mm: add support for a filesystem to activate swap files and use direct_IO for writing swap pages"), swap_writepage() calls direct_IO on swap files. However, in that case the page isn't redirtied if I/O fails, and is therefore handled afterwards as if it has been successfully written to the swap file, leading to memory corruption when the page is eventually swapped back in.
This patch sets the page dirty when direct_IO() fails. It fixes a memory corruption that happened while using swap-over-NFS.
--- mm/page_io.c | 2 ++ 1 file changed, 2 insertions(+)
mm/page_io.c +2 -0
@@ -222,6 +222,8 @@ int swap_writepage(struct page *page, struct writeback_control *wbc)if (ret ==PAGE_SIZE ) {count_vm_event (PSWPOUT ); ret =0 ; + }else { +set_page_dirty (page); }return ret; }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 55/136 mm: swap: mark swap pages writeback before queueing for direct IO
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Mel Gorman <[email protected]>
[ Upstream commit 0cdc444a67ccdbd58bfbcba865cb17a9f17a7691 ]
As pointed out by Andrew Morton, the swap-over-NFS writeback is not setting PageWriteback before it is queued for direct IO. While swap pages do not participate in BDI or process dirty accounting and the IO is synchronous, the writeback bit is still required and not setting it in this case was an oversight. swapoff depends on the page writeback to synchronoise all pending writes on a swap page before it is reused. Swapcache freeing and reuse depend on checking the PageWriteback under lock to ensure the page is safe to reuse.
Direct IO handlers and the direct IO handler for NFS do not deal with PageWriteback as they are synchronous writes. In the case of NFS, it schedules pages (or a page in the case of swap) for IO and then waits synchronously for IO to complete in nfs_direct_write(). It is recognised that this is a slowdown from normal swap handling which is asynchronous and uses a completion handler. Shoving PageWriteback handling down into direct IO handlers looks like a bad fit to handle the swap case although it may have to be dealt with some day if swap is converted to use direct IO in general and bmap is finally done away with. At that point it will be necessary to refit asynchronous direct IO with completion handlers onto the swap subsystem.
As swapcache currently depends on PageWriteback to protect against races, this patch sets PageWriteback under the page lock before queueing it for direct IO. It is cleared when the direct IO handler returns. IO errors are treated similarly to the direct-to-bio case except PageError is not set as in the case of swap-over-NFS, it is likely to be a transient error.
It was asked what prevents such a page being reclaimed in parallel. With this patch applied, such a page will now be skipped (most of the time) or blocked until the writeback completes. Reclaim checks PageWriteback under the page lock before calling try_to_free_swap and the page lock should prevent the page being requeued for IO before it is freed.
This and Jerome's related patch should considered for -stable as far back as 3.6 when swap-over-NFS was introduced.
--- mm/page_io.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
mm/page_io.c +15 -0
@@ -214,6 +214,7 @@ int swap_writepage(struct page *page, struct writeback_control *wbc) kiocb.ki_left =PAGE_SIZE ; kiocb.ki_nbytes =PAGE_SIZE ; +set_page_writeback (page);unlock_page (page); ret = mapping->a_ops->direct_IO(KERNEL_WRITE, &kiocb, &iov,
@@ -223,8 +224,22 @@ int swap_writepage(struct page *page, struct writeback_control *wbc)count_vm_event (PSWPOUT ); ret =0 ; }else { +/* +* In the case of swap-over-nfs, this can be a +* temporary failure if the system has limited +* memory for allocating transmit buffers. +* Mark the page dirty and avoid +* rotate_reclaimable_page but rate-limit the +* messages but do not flag PageError like +* the normal direct-to-bio case as it could +* be temporary. +*/ set_page_dirty (page); +ClearPageReclaim (page); +pr_err_ratelimited ("Write error on dio swapfile (%Lu)\n" , +page_file_offset (page)); } +end_page_writeback (page);return ret; }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 56/136 drivers/rtc/rtc-cmos.c: dont disable hpet emulation on suspend
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Derek Basehore <[email protected]>
[ Upstream commit e005715efaf674660ae59af83b13822567e3a758 ]
There's a bug where rtc alarms are ignored after the rtc cmos suspends but before the system finishes suspend. Since hpet emulation is disabled and it still handles the interrupts, a wake event is never registered which is done from the rtc layer.
This patch reverts commit d1b2efa83fbf ("rtc: disable hpet emulation on suspend") which disabled hpet emulation. To fix the problem mentioned in that commit, hpet_rtc_timer_init() is called directly on resume.
--- drivers/rtc/rtc-cmos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/rtc/rtc-cmos.c +2 -2
@@ -805,9 +805,8 @@ static int cmos_suspend(struct device *dev) mask =RTC_IRQMASK ; tmp &= ~mask;CMOS_WRITE (tmp,RTC_CONTROL ); +hpet_mask_rtc_irq_bit (mask); -/* shut down hpet emulation - we don't need it for alarm */ -hpet_mask_rtc_irq_bit (RTC_PIE |RTC_AIE |RTC_UIE );cmos_checkintr (cmos, tmp); }spin_unlock_irq (&rtc_lock);
@@ -872,6 +871,7 @@ static int cmos_resume(struct device *dev)rtc_update_irq (cmos->rtc,1 , mask); tmp &= ~RTC_AIE ;hpet_mask_rtc_irq_bit (RTC_AIE ); +hpet_rtc_timer_init (); }while (mask &RTC_AIE );spin_unlock_irq (&rtc_lock); }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 57/136 acpi: make ata_ap_acpi_handle not block
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Aaron Lu <[email protected]>
[ Upstream commit d66af4df0837f21bf267305dc5ccab2d29e24d86 ]
Since commit 30dcf76acc, ata_ap_acpi_handle will always do a namespace walk, which requires acquiring an acpi namespace mutex. This made it impossible to be used when calling path has held a spinlock.
For example, it can occur in the following code path for pata_acpi:ata_scsi_queuecmd (ap->lock is acquired)
__ata_scsi_queuecmd
ata_scsi_translate
ata_qc_issue
pacpi_qc_issue
ata_acpi_stm
ata_ap_acpi_handle
acpi_get_child
acpi_walk_namespace
acpi_ut_acquire_mutex (acquire mutex while holding lock)
This caused scheduling while atomic bug, as reported in bug #56781.
Actually, ata_ap_acpi_handle doesn't have to walk the namespace every time it is called, it can simply return the bound acpi handle on the corresponding SCSI host. The reason previously it is not done this way is, ata_ap_acpi_handle is used in the binding function ata_acpi_bind_host by ata_acpi_gtm when the handle is not bound to the SCSI host yet. Since we already have the ATA port's handle in its binding function, we can simply use it instead of calling ata_ap_acpi_handle there. So introduce a new function __ata_acpi_gtm, where it will receive an acpi handle param in addition to the ATA port which is solely used for debug statement. With this change, we can make ata_ap_acpi_handle simply return the bound handle for SCSI host instead of walking the acpi namespace now.
--- drivers/ata/libata-acpi.c | 45 +++++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 18 deletions(-)
drivers/ata/libata-acpi.c +27 -18
@@ -60,7 +60,8 @@ acpi_handle ata_ap_acpi_handle(struct ata_port *ap)if (ap->flags &ATA_FLAG_ACPI_SATA )return NULL ; -return acpi_get_child (DEVICE_ACPI_HANDLE (ap->host->dev), ap->port_no); +return ap->scsi_host ? +DEVICE_ACPI_HANDLE (&ap->scsi_host->shost_gendev) :NULL ; }EXPORT_SYMBOL (ata_ap_acpi_handle);
@@ -236,28 +237,15 @@ void ata_acpi_dissociate(struct ata_host *host) } } -/** -* ata_acpi_gtm - execute _GTM -* @ap: target ATA port -* @gtm: out parameter for _GTM result -* -* Evaluate _GTM and store the result in @gtm. -* -* LOCKING: -* EH context. -* -* RETURNS: -* 0 on success, -ENOENT if _GTM doesn't exist, -errno on failure. -*/ -int ata_acpi_gtm (struct ata_port *ap,struct ata_acpi_gtm *gtm) +static int __ata_acpi_gtm (struct ata_port *ap,acpi_handle handle, +struct ata_acpi_gtm *gtm) {struct acpi_buffer output = { .length =ACPI_ALLOCATE_BUFFER };union acpi_object *out_obj;acpi_status status;int rc =0 ; - status =acpi_evaluate_object (ata_ap_acpi_handle (ap),"_GTM" ,NULL , - &output); + status =acpi_evaluate_object (handle,"_GTM" ,NULL , &output); rc = -ENOENT ;if (status ==AE_NOT_FOUND )
@@ -291,6 +279,27 @@ int ata_acpi_gtm(struct ata_port *ap, struct ata_acpi_gtm *gtm)return rc; } +/** +* ata_acpi_gtm - execute _GTM +* @ap: target ATA port +* @gtm: out parameter for _GTM result +* +* Evaluate _GTM and store the result in @gtm. +* +* LOCKING: +* EH context. +* +* RETURNS: +* 0 on success, -ENOENT if _GTM doesn't exist, -errno on failure. +*/ +int ata_acpi_gtm (struct ata_port *ap,struct ata_acpi_gtm *gtm) +{ +if (ata_ap_acpi_handle (ap)) +return __ata_acpi_gtm (ap,ata_ap_acpi_handle (ap), gtm); +else +return -EINVAL ; +} +EXPORT_SYMBOL_GPL (ata_acpi_gtm);/**
@@ -1091,7 +1100,7 @@ static int ata_acpi_bind_host(struct ata_port *ap, acpi_handle *handle)if (!*handle)return -ENODEV ; -if (ata_acpi_gtm (ap, &ap->__acpi_init_gtm) ==0 ) +if (__ata_acpi_gtm (ap, *handle, &ap->__acpi_init_gtm) ==0 ) ap->pflags |=ATA_PFLAG_INIT_GTM_VALID ;return 0 ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 58/136 cgroup: fix an off-by-one bug which may trigger BUG_ON()
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Li Zefan <[email protected]>
[ Upstream commit 3ac1707a13a3da9cfc8f242a15b2fae6df2c5f88 ]
The 3rd parameter of flex_array_prealloc() is the number of elements, not the index of the last element.
The effect of the bug is, when opening cgroup.procs, a flex array will be allocated and all elements of the array is allocated with GFP_KERNEL flag, but the last one is GFP_ATOMIC, and if we fail to allocate memory for it, it'll trigger a BUG_ON().
--- kernel/cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/cgroup.c +1 -1
@@ -2067,7 +2067,7 @@ static int cgroup_attach_proc(struct cgroup *cgrp, struct task_struct *leader)if (!group)return -ENOMEM ;/* pre-allocate to guarantee space while iterating in rcu read-side. */ - retval =flex_array_prealloc (group,0 , group_size -1 ,GFP_KERNEL ); + retval =flex_array_prealloc (group,0 , group_size,GFP_KERNEL );if (retval) goto out_free_group_list;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 59/136 clockevents: Set dummy handler on CPU_DEAD shutdown
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
[ Upstream commit 6f7a05d7018de222e40ca003721037a530979974 ]
Vitaliy reported that a per cpu HPET timer interrupt crashes the system during hibernation. What happens is that the per cpu HPET timer gets shut down when the nonboot cpus are stopped. When the nonboot cpus are onlined again the HPET code sets up the MSI interrupt which fires before the clock event device is registered. The event handler is still set to hrtimer_interrupt, which then crashes the machine due to highres mode not being active.
See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=700333
There is no real good way to avoid that in the HPET code. The HPET code alrady has a mechanism to detect spurious interrupts when event handler == NULL for a similar reason.
We can handle that in the clockevent/tick layer and replace the previous functional handler with a dummy handler like we do in tick_setup_new_device().
The original clockevents code did this in clockevents_exchange_device(), but that got removed by commit 7c1e76897 (clockevents: prevent clockevent event_handler ending up handler_noop) which forgot to fix it up in tick_shutdown(). Same issue with the broadcast device.
--- kernel/time/tick-broadcast.c | 4 ++++ kernel/time/tick-common.c | 1 + 2 files changed, 5 insertions(+)
kernel/time/tick-broadcast.c +4 -0
@@ -66,6 +66,8 @@ static void tick_broadcast_start_periodic(struct clock_event_device *bc)*/ int tick_check_broadcast_device (struct clock_event_device *dev) { +struct clock_event_device *cur = tick_broadcast_device.evtdev; + if ((dev->features & CLOCK_EVT_FEAT_DUMMY) || (tick_broadcast_device.evtdev && tick_broadcast_device.evtdev->rating >= dev->rating) ||
@@ -73,6 +75,8 @@ int tick_check_broadcast_device(struct clock_event_device *dev)return 0 ;clockevents_exchange_device (tick_broadcast_device.evtdev, dev); +if (cur) + cur->event_handler = clockevents_handle_noop; tick_broadcast_device.evtdev = dev;if (!cpumask_empty (tick_get_broadcast_mask ()))tick_broadcast_start_periodic (dev);
kernel/time/tick-common.c +1 -0
@@ -323,6 +323,7 @@ static void tick_shutdown(unsigned int *cpup)*/ dev->mode =CLOCK_EVT_MODE_UNUSED ;clockevents_exchange_device (dev,NULL ); + dev->event_handler = clockevents_handle_noop; td->evtdev =NULL ; }raw_spin_unlock_irqrestore (&tick_device_lock, flags);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 60/136 inotify: invalid mask should return a error number but not set it
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Zhao Hongjiang <[email protected]>
[ Upstream commit 04df32fa10ab9a6f0643db2949d42efc966bc844 ]
When we run the crackerjack testsuite, the inotify_add_watch test is stalled.
This is caused by the invalid mask 0 - the task is waiting for the event but it never comes. inotify_add_watch() should return -EINVAL as it did before commit 676a0675cf92 ("inotify: remove broken mask checks causing unmount to be EINVAL"). That commit removes the invalid mask check, but that check is needed.
Check the mask's ALL_INOTIFY_BITS before the inotify_arg_to_mask() call. If none are set, just return -EINVAL.
Because IN_UNMOUNT is in ALL_INOTIFY_BITS, this change will not trigger the problem that above commit fixed.
--- fs/notify/inotify/inotify_user.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/notify/inotify/inotify_user.c +4 -2
@@ -577,7 +577,6 @@ static int inotify_update_existing_watch(struct fsnotify_group *group,int add = (arg &IN_MASK_ADD );int ret; -/* don't allow invalid bits: we don't want flags set */ mask =inotify_arg_to_mask (arg);if (unlikely (!(mask &IN_ALL_EVENTS )))return -EINVAL ;
@@ -630,7 +629,6 @@ static int inotify_new_watch(struct fsnotify_group *group,struct idr *idr = &group->inotify_data.idr;spinlock_t *idr_lock = &group->inotify_data.idr_lock; -/* don't allow invalid bits: we don't want flags set */ mask =inotify_arg_to_mask (arg);if (unlikely (!(mask &IN_ALL_EVENTS )))return -EINVAL ;
@@ -761,6 +759,10 @@ SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname,int ret, fput_needed;unsigned flags =0 ; +/* don't allow invalid bits: we don't want flags set */ +if (unlikely (!(mask &ALL_INOTIFY_BITS ))) +return -EINVAL ; + filp =fget_light (fd, &fput_needed);if (unlikely (!filp))return -EBADF ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 61/136 fs/dcache.c: add cond_resched() to shrink_dcache_parent()
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Greg Thelen <[email protected]>
[ Upstream commit 421348f1ca0bf17769dee0aed4d991845ae0536d ]
Call cond_resched() in shrink_dcache_parent() to maintain interactivity.
Before this patch:
void shrink_dcache_parent(struct dentry * parent)
{
while ((found = select_parent(parent, &dispose)) != 0)
shrink_dentry_list(&dispose);
}select_parent() populates the dispose list with dentries which shrink_dentry_list() then deletes. select_parent() carefully uses need_resched() to avoid doing too much work at once. But neither shrink_dcache_parent() nor its called functions call cond_resched(). So once need_resched() is set select_parent() will return single dentry dispose list which is then deleted by shrink_dentry_list(). This is inefficient when there are a lot of dentry to process. This can cause softlockup and hurts interactivity on non preemptable kernels.
This change adds cond_resched() in shrink_dcache_parent(). The benefit of this is that need_resched() is quickly cleared so that future calls to select_parent() are able to efficiently return a big batch of dentry.
These additional cond_resched() do not seem to impact performance, at least for the workload below.
Here is a program which can cause soft lockup if other system activity sets need_resched().
int main()
{
struct rlimit rlim;
int i;
int f[100000];
char buf[20];
struct timeval t1, t2;
double diff;
/* cleanup past run */
system("rm -rf x");
/* boost nfile rlimit */
rlim.rlim_cur = 200000;
rlim.rlim_max = 200000;
if (setrlimit(RLIMIT_NOFILE, &rlim))
err(1, "setrlimit");
/* make directory for files */
if (mkdir("x", 0700))
err(1, "mkdir");
if (gettimeofday(&t1, NULL))
err(1, "gettimeofday");
/* populate directory with open files */
for (i = 0; i < 100000; i++) {
snprintf(buf, sizeof(buf), "x/%d", i);
f[i] = open(buf, O_CREAT);
if (f[i] == -1)
err(1, "open");
}
/* close some of the files */
for (i = 0; i < 85000; i++)
close(f[i]);
/* unlink all files, even open ones */
system("rm -rf x");
if (gettimeofday(&t2, NULL))
err(1, "gettimeofday");
diff = (((double)t2.tv_sec * 1000000 + t2.tv_usec) -
((double)t1.tv_sec * 1000000 + t1.tv_usec));
printf("done: %g elapsed\n", diff/1e6);
return 0;
}--- fs/dcache.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/dcache.c +3 -1
@@ -1256,8 +1256,10 @@ void shrink_dcache_parent(struct dentry * parent)LIST_HEAD (dispose);int found; -while ((found =select_parent (parent, &dispose)) !=0 ) +while ((found =select_parent (parent, &dispose)) !=0 ) {shrink_dentry_list (&dispose); +cond_resched (); + } }EXPORT_SYMBOL (shrink_dcache_parent);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 62/136 exec: do not abuse ->cred_guard_mutex in threadgroup_lock()
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Oleg Nesterov <[email protected]>
[ Upstream commit e56fb2874015370e3b7f8d85051f6dce26051df9 ]
threadgroup_lock() takes signal->cred_guard_mutex to ensure that thread_group_leader() is stable. This doesn't look nice, the scope of this lock in do_execve() is huge.
And as Dave pointed out this can lead to deadlock, we have the following dependencies:
do_execve: cred_guard_mutex -> i_mutex cgroup_mount: i_mutex -> cgroup_mutex attach_task_by_pid: cgroup_mutex -> cred_guard_mutex
Change de_thread() to take threadgroup_change_begin() around the switch-the-leader code and change threadgroup_lock() to avoid ->cred_guard_mutex.
Note that de_thread() can't sleep with ->group_rwsem held, this can obviously deadlock with the exiting leader if the writer is active, so it does threadgroup_change_end() before schedule().
--- fs/exec.c | 3 +++ include/linux/sched.h | 18 ++++-------------- 2 files changed, 7 insertions(+), 14 deletions(-)
fs/exec.c +3 -0
@@ -905,11 +905,13 @@ static int de_thread(struct task_struct *tsk) sig->notify_count =-1 ;/* for exit_notify() */ for (;;) { +threadgroup_change_begin (tsk);write_lock_irq (&tasklist_lock);if (likely (leader->exit_state))break ;__set_current_state (TASK_UNINTERRUPTIBLE );write_unlock_irq (&tasklist_lock); +threadgroup_change_end (tsk);schedule (); }
@@ -965,6 +967,7 @@ static int de_thread(struct task_struct *tsk)if (unlikely (leader->ptrace))__wake_up_parent (leader, leader->parent);write_unlock_irq (&tasklist_lock); +threadgroup_change_end (tsk);release_task (leader); }
include/linux/sched.h +4 -14
@@ -2455,27 +2455,18 @@ static inline void threadgroup_change_end(struct task_struct *tsk)* * Lock the threadgroup @tsk belongs to. No new task is allowed to enter * and member tasks aren't allowed to exit (as indicated by PF_EXITING) or -* perform exec. This is useful for cases where the threadgroup needs to -* stay stable across blockable operations. +* change ->group_leader/pid. This is useful for cases where the threadgroup +* needs to stay stable across blockable operations. * * fork and exit paths explicitly call threadgroup_change_{begin|end}() for * synchronization. While held, no new task will be added to threadgroup * and no existing live task will have its PF_EXITING set. * -* During exec, a task goes and puts its thread group through unusual -* changes. After de-threading, exclusive access is assumed to resources -* which are usually shared by tasks in the same group - e.g. sighand may -* be replaced with a new one. Also, the exec'ing task takes over group -* leader role including its pid. Exclude these changes while locked by -* grabbing cred_guard_mutex which is used to synchronize exec path. +* de_thread() does threadgroup_change_{begin|end}() when a non-leader +* sub-thread becomes a new leader. */ static inline void threadgroup_lock (struct task_struct *tsk) { -/* -* exec uses exit for de-threading nesting group_rwsem inside -* cred_guard_mutex. Grab cred_guard_mutex first. -*/ -mutex_lock (&tsk->signal->cred_guard_mutex);down_write (&tsk->signal->group_rwsem); }
@@ -2488,7 +2479,6 @@ static inline void threadgroup_lock(struct task_struct *tsk)static inline void threadgroup_unlock (struct task_struct *tsk) {up_write (&tsk->signal->group_rwsem); -mutex_unlock (&tsk->signal->cred_guard_mutex); }#else static inline void threadgroup_change_begin (struct task_struct *tsk) {}
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 63/136 LOCKD: Ensure that nlmclnt_block resets block->b_status after a server reboot
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
[ Upstream commit 1dfd89af8697a299e7982ae740d4695ecd917eef ]
After a server reboot, the reclaimer thread will recover all the existing locks. For locks that are blocked, however, it will change the value of block->b_status to nlm_lck_denied_grace_period in order to signal that they need to wake up and resend the original blocking lock request.
Due to a bug, however, the block->b_status never gets reset after the blocked locks have been woken up, and so the process goes into an infinite loop of resends until the blocked lock is satisfied.
--- fs/lockd/clntlock.c | 3 +++ 1 file changed, 3 insertions(+)
fs/lockd/clntlock.c +3 -0
@@ -144,6 +144,9 @@ int nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout) timeout);if (ret <0 )return -ERESTARTSYS ; +/* Reset the lock status after a server reboot so we resend */ +if (block->b_status == nlm_lck_denied_grace_period) + block->b_status = nlm_lck_blocked; req->a_res.status = block->b_status;return 0 ; }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 64/136 md: bad block list should default to disabled.
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: NeilBrown <[email protected]>
[ Upstream commit 486adf72ccc0c235754923d47a2270c5dcb0c98b ]
Maintenance of a bad-block-list currently defaults to 'enabled' and is then disabled when it cannot be supported.
This is backwards and causes problem for dm-raid which didn't know to disable it.
So fix the defaults, and only enabled for v1.x metadata which explicitly has bad blocks enabled.
The problem with dm-raid has been present since badblock support was added in v3.1, so this patch is suitable for any -stable from 3.1 onwards.
--- drivers/md/md.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/md/md.c +3 -6
@@ -1576,8 +1576,8 @@ static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_ sector, count, 1) == 0)return -EINVAL ; } - }else if (sb->bblog_offset ==0 ) - rdev->badblocks.shift =-1 ; + }else if (sb->bblog_offset !=0 ) + rdev->badblocks.shift =0 ;if (!refdev) { ret =1 ;
@@ -3224,7 +3224,7 @@ int md_rdev_init(struct md_rdev *rdev)* be used - I wonder if that matters */ rdev->badblocks.count =0 ; - rdev->badblocks.shift =0 ; + rdev->badblocks.shift =-1 ;/* disabled until explicitly enabled */ rdev->badblocks.page =kmalloc (PAGE_SIZE ,GFP_KERNEL );seqlock_init (&rdev->badblocks.lock);if (rdev->badblocks.page ==NULL )
@@ -3296,9 +3296,6 @@ static struct md_rdev *md_import_device(dev_t newdev, int super_format, int supe goto abort_free; } } -if (super_format ==-1 ) -/* hot-add for 0.90, or non-persistent: so no badblocks */ - rdev->badblocks.shift =-1 ;return rdev;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 65/136 MD: ignore discard request for hard disks of hybid raid1/raid10 array
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Shaohua Li <[email protected]>
[ Upstream commit 32f9f570d04461a41bdcd5c1d93b41ebc5ce182a ]
In SSD/hard disk hybid storage, discard request should be ignored for hard disk. We used to be doing this way, but the unplug path forgets it.
This is suitable for stable tree since v3.6.
--- drivers/md/raid1.c | 7 ++++++- drivers/md/raid10.c | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-)
drivers/md/raid1.c +6 -1
@@ -976,7 +976,12 @@ static void raid1_unplug(struct blk_plug_cb *cb, bool from_schedule)while (bio) {/* submit pending writes */ struct bio *next = bio->bi_next; bio->bi_next =NULL ; -generic_make_request (bio); +if (unlikely ((bio->bi_rw &REQ_DISCARD ) && + !blk_queue_discard (bdev_get_queue (bio->bi_bdev)))) +/* Just ignore it */ +bio_endio (bio,0 ); +else +generic_make_request (bio); bio = next; }kfree (plug);
drivers/md/raid10.c +6 -0
@@ -912,6 +912,12 @@ static void flush_pending_writes(struct r10conf *conf)struct bio *next = bio->bi_next; bio->bi_next =NULL ;generic_make_request (bio); +if (unlikely ((bio->bi_rw &REQ_DISCARD ) && + !blk_queue_discard (bdev_get_queue (bio->bi_bdev)))) +/* Just ignore it */ +bio_endio (bio,0 ); +else +generic_make_request (bio); bio = next; } }else
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 66/136 NFSv4: Handle NFS4ERR_DELAY and NFS4ERR_GRACE in nfs4_open_delegation_recall
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
[ Upstream commit 8b6cc4d6f841d31f72fe7478453759166d366274 ]
A server shouldn't normally return NFS4ERR_GRACE if the client holds a delegation, since no conflicting lock reclaims can be granted, however the spec does not require the server to grant the open in this instance
--- fs/nfs/nfs4proc.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/nfs/nfs4proc.c +6 -0
@@ -1383,6 +1383,12 @@ int nfs4_open_delegation_recall(struct nfs_open_context *ctx, struct nfs4_statecase -ENOMEM : err =0 ; goto out; +case -NFS4ERR_DELAY : +case -NFS4ERR_GRACE : +set_bit (NFS_DELEGATED_STATE , &state->flags); +ssleep (1 ); + err = -EAGAIN ; + goto out; } err =nfs4_handle_exception (server, err, &exception); }while (exception.retry);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 67/136 nfsd4: dont close read-write opens too soon
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: "J. Bruce Fields" <[email protected]>
[ Upstream commit 0c7c3e67ab91ec6caa44bdf1fc89a48012ceb0c5 ]
Don't actually close any opens until we don't need them at all.
This means being left with write access when it's not really necessary, but that's better than putting a file that might still have posix locks held on it, as we have been.
--- fs/nfsd/nfs4state.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
fs/nfsd/nfs4state.c +1 -7
@@ -217,13 +217,7 @@ static void __nfs4_file_put_access(struct nfs4_file *fp, int oflag) {if (atomic_dec_and_test (&fp->fi_access[oflag])) {nfs4_file_put_fd (fp, oflag); -/* -* It's also safe to get rid of the RDWR open *if* -* we no longer have need of the other kind of access -* or if we already have the other kind of open: -*/ -if (fp->fi_fds[1 -oflag] - ||atomic_read (&fp->fi_access[1 - oflag]) ==0 ) +if (atomic_read (&fp->fi_access[1 - oflag]) ==0 )nfs4_file_put_fd (fp,O_RDWR ); } }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 68/136 nfsd: dont run get_file if nfs4_preprocess_stateid_op return error
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: fanchaoting <[email protected]>
[ Upstream commit b022032e195ffca83d7002d6b84297d796ed443b ]
we should return error status directly when nfs4_preprocess_stateid_op return error.
--- fs/nfsd/nfs4proc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
fs/nfsd/nfs4proc.c +4 -4
@@ -893,14 +893,14 @@ nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,nfs4_lock_state (); status =nfs4_preprocess_stateid_op (SVC_NET (rqstp), cstate, stateid,WR_STATE , &filp); -if (filp) -get_file (filp); -nfs4_unlock_state (); -if (status) { +nfs4_unlock_state ();dprintk ("NFSD: nfsd4_write: couldn't process stateid!\n" );return status; } +if (filp) +get_file (filp); +nfs4_unlock_state (); cnt = write->wr_buflen; write->wr_how_written = write->wr_stable_how;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 69/136 nfsd: Decode and send 64bit time values
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Bryan Schumaker <[email protected]>
[ Upstream commit bf8d909705e9d9bac31d9b8eac6734d2b51332a7 ]
The seconds field of an nfstime4 structure is 64bit, but we are assuming that the first 32bits are zero-filled. So if the client tries to set atime to a value before the epoch (touch -t 196001010101), then the server will save the wrong value on disk.
--- fs/nfsd/nfs4xdr.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-)
fs/nfsd/nfs4xdr.c +5 -14
@@ -343,10 +343,7 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,all 32 bits of 'nseconds'. */ READ_BUF (12 ); len +=12 ; -READ32 (dummy32); -if (dummy32) -return nfserr_inval; -READ32 (iattr->ia_atime.tv_sec); +READ64 (iattr->ia_atime.tv_sec);READ32 (iattr->ia_atime.tv_nsec);if (iattr->ia_atime.tv_nsec >= (u32 )1000000000 )return nfserr_inval;
@@ -369,10 +366,7 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,all 32 bits of 'nseconds'. */ READ_BUF (12 ); len +=12 ; -READ32 (dummy32); -if (dummy32) -return nfserr_inval; -READ32 (iattr->ia_mtime.tv_sec); +READ64 (iattr->ia_mtime.tv_sec);READ32 (iattr->ia_mtime.tv_nsec);if (iattr->ia_mtime.tv_nsec >= (u32 )1000000000 )return nfserr_inval;
@@ -2397,8 +2391,7 @@ out_acl:if (bmval1 &FATTR4_WORD1_TIME_ACCESS ) {if ((buflen -=12 ) <0 ) goto out_resource; -WRITE32 (0 ); -WRITE32 (stat.atime.tv_sec); +WRITE64 ((s64 )stat.atime.tv_sec);WRITE32 (stat.atime.tv_nsec); }if (bmval1 &FATTR4_WORD1_TIME_DELTA ) {
@@ -2411,15 +2404,13 @@ out_acl:if (bmval1 &FATTR4_WORD1_TIME_METADATA ) {if ((buflen -=12 ) <0 ) goto out_resource; -WRITE32 (0 ); -WRITE32 (stat.ctime.tv_sec); +WRITE64 ((s64 )stat.ctime.tv_sec);WRITE32 (stat.ctime.tv_nsec); }if (bmval1 &FATTR4_WORD1_TIME_MODIFY ) {if ((buflen -=12 ) <0 ) goto out_resource; -WRITE32 (0 ); -WRITE32 (stat.mtime.tv_sec); +WRITE64 ((s64 )stat.mtime.tv_sec);WRITE32 (stat.mtime.tv_nsec); }if (bmval1 &FATTR4_WORD1_MOUNTED_ON_FILEID ) {
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 70/136 wireless: regulatory: fix channel disabling race condition
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
[ Upstream commit 990de49f74e772b6db5208457b7aa712a5f4db86 ]
When a full scan 2.4 and 5 GHz scan is scheduled, but then the 2.4 GHz part of the scan disables a 5.2 GHz channel due to, e.g. receiving country or frequency information, that 5.2 GHz channel might already be in the list of channels to scan next. Then, when the driver checks if it should do a passive scan, that will return false and attempt an active scan. This is not only wrong but can also lead to the iwlwifi device firmware crashing since it checks regulatory as well.
Fix this by not setting the channel flags to just disabled but rather OR'ing in the disabled flag. That way, even if the race happens, the channel will be scanned passively which is still (mostly) correct.
--- net/wireless/reg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/wireless/reg.c +1 -1
@@ -874,7 +874,7 @@ static void handle_channel(struct wiphy *wiphy,return ;REG_DBG_PRINT ("Disabling freq %d MHz\n" , chan->center_freq); - chan->flags =IEEE80211_CHAN_DISABLED ; + chan->flags |=IEEE80211_CHAN_DISABLED ;return ; }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 71/136 ipc: sysv shared memory limited to 8TiB
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Robin Holt <[email protected]>
[ Upstream commit d69f3bad4675ac519d41ca2b11e1c00ca115cecd ]
Trying to run an application which was trying to put data into half of memory using shmget(), we found that having a shmall value below 8EiB-8TiB would prevent us from using anything more than 8TiB. By setting kernel.shmall greater than 8EiB-8TiB would make the job work.
In the newseg() function, ns->shm_tot which, at 8TiB is INT_MAX.
ipc/shm.c:
458 static int newseg(struct ipc_namespace *ns, struct ipc_params *params) 459 {
...
465 int numpages = (size + PAGE_SIZE -1) >> PAGE_SHIFT;
...
474 if (ns->shm_tot + numpages > ns->shm_ctlall)
475 return -ENOSPC;
--- include/linux/ipc_namespace.h | 2 +- ipc/shm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
include/linux/ipc_namespace.h +1 -1
@@ -42,8 +42,8 @@ struct ipc_namespace {size_t shm_ctlmax;size_t shm_ctlall; +unsigned long shm_tot;int shm_ctlmni; -int shm_tot;/* * Defines whether IPC_RMID is forced for _all_ shm segments regardless * of shmctl()
ipc/shm.c +1 -1
@@ -462,7 +462,7 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)size_t size = params->u.size;int error;struct shmid_kernel *shp; -int numpages = (size +PAGE_SIZE -1 ) >>PAGE_SHIFT ; +size_t numpages = (size +PAGE_SIZE -1 ) >>PAGE_SHIFT ;struct file * file;char name[13 ];int id;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 72/136 ixgbe: fix EICR write in ixgbe_msix_other
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Jacob Keller <[email protected]>
[ Upstream commit d87d830720a1446403ed38bfc2da268be0d356d1 ]
Previously, the ixgbe_msix_other was writing the full 32bits of the set interrupts, instead of only the ones which the ixgbe_msix_other is handling. This resulted in a loss of performance when the X540's PPS feature is enabled due to sometimes clearing queue interrupts which resulted in the driver not getting the interrupt for cleaning the q_vector rings often enough. The fix is to simply mask the lower 16bits off so that this handler does not write them in the EICR, which causes them to remain high and be properly handled by the clean_rings interrupt routine as normal.
--- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +10 -0
@@ -2283,6 +2283,16 @@ static irqreturn_t ixgbe_msix_other(int irq, void *data)* with the write to EICR. */ eicr =IXGBE_READ_REG (hw,IXGBE_EICS ); + +/* The lower 16bits of the EICR register are for the queue interrupts +* which should be masked here in order to not accidently clear them if +* the bits are high when ixgbe_msix_other is called. There is a race +* condition otherwise which results in possible performance loss +* especially if the ixgbe_msix_other interrupt is triggering +* consistently (as it would when PPS is turned on for the X540 device) +*/ + eicr &=0xFFFF0000 ; +IXGBE_WRITE_REG (hw,IXGBE_EICR , eicr);if (eicr &IXGBE_EICR_LSC )
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 73/136 ext4/jbd2: dont wait (forever) for stale tid caused by wraparound
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Theodore Ts'o <[email protected]>
[ Upstream commit d76a3a77113db020d9bb1e894822869410450bd9 ]
In the case where an inode has a very stale transaction id (tid) in i_datasync_tid or i_sync_tid, it's possible that after a very large (2**31) number of transactions, that the tid number space might wrap, causing tid_geq()'s calculations to fail.
Commit deeeaf13 "jbd2: fix fsync() tid wraparound bug", later modified by commit e7b04ac0 "jbd2: don't wake kjournald unnecessarily", attempted to fix this problem, but it only avoided kjournald spinning forever by fixing the logic in jbd2_log_start_commit().
Unfortunately, in the codepaths in fs/ext4/fsync.c and fs/ext4/inode.c that might call jbd2_log_start_commit() with a stale tid, those functions will subsequently call jbd2_log_wait_commit() with the same stale tid, and then wait for a very long time. To fix this, we replace the calls to jbd2_log_start_commit() and jbd2_log_wait_commit() with a call to a new function, jbd2_complete_transaction(), which will correctly handle stale tid's.
As a bonus, jbd2_complete_transaction() will avoid locking j_state_lock for writing unless a commit needs to be started. This should have a small (but probably not measurable) improvement for ext4's scalability.
--- fs/ext4/fsync.c | 3 +-- fs/ext4/inode.c | 3 +-- fs/jbd2/journal.c | 31 +++++++++++++++++++++++++++++++ include/linux/jbd2.h | 1 + 4 files changed, 34 insertions(+), 4 deletions(-)
fs/ext4/fsync.c +1 -2
@@ -253,8 +253,7 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync)if (journal->j_flags &JBD2_BARRIER && !jbd2_trans_will_send_data_barrier (journal, commit_tid)) needs_barrier = true; -jbd2_log_start_commit (journal, commit_tid); - ret =jbd2_log_wait_commit (journal, commit_tid); + ret =jbd2_complete_transaction (journal, commit_tid);if (needs_barrier)blkdev_issue_flush (inode->i_sb->s_bdev,GFP_KERNEL ,NULL ); out:
fs/ext4/inode.c +1 -2
@@ -216,8 +216,7 @@ void ext4_evict_inode(struct inode *inode)journal_t *journal =EXT4_SB (inode->i_sb)->s_journal;tid_t commit_tid =EXT4_I (inode)->i_datasync_tid; -jbd2_log_start_commit (journal, commit_tid); -jbd2_log_wait_commit (journal, commit_tid); +jbd2_complete_transaction (journal, commit_tid);filemap_write_and_wait (&inode->i_data); }truncate_inode_pages (&inode->i_data,0 );
fs/jbd2/journal.c +31 -0
@@ -699,6 +699,37 @@ int jbd2_log_wait_commit(journal_t *journal, tid_t tid) }/* +* When this function returns the transaction corresponding to tid +* will be completed. If the transaction has currently running, start +* committing that transaction before waiting for it to complete. If +* the transaction id is stale, it is by definition already completed, +* so just return SUCCESS. +*/ +int jbd2_complete_transaction (journal_t *journal,tid_t tid) +{ +int need_to_wait =1 ; + +read_lock (&journal->j_state_lock); +if (journal->j_running_transaction && + journal->j_running_transaction->t_tid == tid) { +if (journal->j_commit_request != tid) { +/* transaction not yet started, so request it */ +read_unlock (&journal->j_state_lock); +jbd2_log_start_commit (journal, tid); + goto wait_commit; + } + }else if (!(journal->j_committing_transaction && + journal->j_committing_transaction->t_tid == tid)) + need_to_wait =0 ; +read_unlock (&journal->j_state_lock); +if (!need_to_wait) +return 0 ; +wait_commit: +return jbd2_log_wait_commit (journal, tid); +} +EXPORT_SYMBOL (jbd2_complete_transaction); + +/* * Log buffer allocation routines: */
include/linux/jbd2.h +1 -0
@@ -1211,6 +1211,7 @@ int __jbd2_log_start_commit(journal_t *journal, tid_t tid);int jbd2_journal_start_commit (journal_t *journal,tid_t *tid);int jbd2_journal_force_commit_nested (journal_t *journal);int jbd2_log_wait_commit (journal_t *journal,tid_t tid); +int jbd2_complete_transaction (journal_t *journal,tid_t tid);int jbd2_log_do_checkpoint (journal_t *journal);int jbd2_trans_will_send_data_barrier (journal_t *journal,tid_t tid);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 74/136 jbd2: fix race between jbd2_journal_remove_checkpoint and ->j_commit_callback
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Dmitry Monakhov <[email protected]>
[ Upstream commit 794446c6946513c684d448205fbd76fa35f38b72 ]
The following race is possible:
[kjournald2] other_taskjbd2_journal_commit_transaction()
j_state = T_FINISHED;
spin_unlock(&journal->j_list_lock);
->jbd2_journal_remove_checkpoint()
->jbd2_journal_free_transaction();
->kmem_cache_free(transaction)
->j_commit_callback(journal, transaction);
-> USE_AFTER_FREEWARNING: at lib/list_debug.c:62 __list_del_entry+0x1c0/0x250() Hardware name: list_del corruption. prev->next should be ffff88019a4ec198, but was 6b6b6b6b6b6b6b6b Modules linked in: cpufreq_ondemand acpi_cpufreq freq_table mperf coretemp kvm_intel kvm crc32c_intel ghash_clmulni_intel microcode sg xhci_hcd button sd_mod crc_t10dif aesni_intel ablk_helper cryptd lrw aes_x86_64 xts gf128mul ahci libahci pata_acpi ata_generic dm_mirror dm_region_hash dm_log dm_mod Pid: 16400, comm: jbd2/dm-1-8 Tainted: G W 3.8.0-rc3+ #107 Call Trace: [<ffffffff8106fb0d>] warn_slowpath_common+0xad/0xf0 [<ffffffff8106fc06>] warn_slowpath_fmt+0x46/0x50 [<ffffffff813637e9>] ? ext4_journal_commit_callback+0x99/0xc0 [<ffffffff8148cae0>] __list_del_entry+0x1c0/0x250 [<ffffffff813637bf>] ext4_journal_commit_callback+0x6f/0xc0 [<ffffffff813ca336>] jbd2_journal_commit_transaction+0x23a6/0x2570 [<ffffffff8108aa42>] ? try_to_del_timer_sync+0x82/0xa0 [<ffffffff8108b491>] ? del_timer_sync+0x91/0x1e0 [<ffffffff813d3ecf>] kjournald2+0x19f/0x6a0 [<ffffffff810ad630>] ? wake_up_bit+0x40/0x40 [<ffffffff813d3d30>] ? bit_spin_lock+0x80/0x80 [<ffffffff810ac6be>] kthread+0x10e/0x120 [<ffffffff810ac5b0>] ? __init_kthread_worker+0x70/0x70 [<ffffffff818ff6ac>] ret_from_fork+0x7c/0xb0 [<ffffffff810ac5b0>] ? __init_kthread_worker+0x70/0x70
In order to demonstrace this issue one should mount ext4 with mount -o discard option on SSD disk. This makes callback longer and race window becomes wider.
In order to fix this we should mark transaction as finished only after callbacks have completed
--- fs/jbd2/commit.c | 50 ++++++++++++++++++++++++++++---------------------- include/linux/jbd2.h | 1 + 2 files changed, 29 insertions(+), 22 deletions(-)
fs/jbd2/commit.c +28 -22
@@ -382,7 +382,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)int space_left =0 ;int first_tag =0 ;int tag_flag; -int i, to_free =0 ; +int i;int tag_bytes =journal_tag_bytes (journal);struct buffer_head *cbh =NULL ;/* For transactional checksums */ __u32 crc32_sum = ~0 ;
@@ -1108,7 +1108,7 @@ restart_loop: journal->j_stats.run.rs_blocks_logged += stats.run.rs_blocks_logged;spin_unlock (&journal->j_history_lock); - commit_transaction->t_state =T_FINISHED ; + commit_transaction->t_state =T_COMMIT_CALLBACK ;J_ASSERT (commit_transaction == journal->j_committing_transaction); journal->j_commit_sequence = commit_transaction->t_tid; journal->j_committing_transaction =NULL ;
@@ -1123,38 +1123,44 @@ restart_loop: journal->j_average_commit_time*3) / 4; else journal->j_average_commit_time = commit_time; +write_unlock (&journal->j_state_lock); -if (commit_transaction->t_checkpoint_list ==NULL && - commit_transaction->t_checkpoint_io_list ==NULL ) { -__jbd2_journal_drop_transaction (journal, commit_transaction); - to_free =1 ; +if (journal->j_checkpoint_transactions ==NULL ) { + journal->j_checkpoint_transactions = commit_transaction; + commit_transaction->t_cpnext = commit_transaction; + commit_transaction->t_cpprev = commit_transaction; }else { -if (journal->j_checkpoint_transactions ==NULL ) { - journal->j_checkpoint_transactions = commit_transaction; - commit_transaction->t_cpnext = commit_transaction; - commit_transaction->t_cpprev = commit_transaction; - }else { - commit_transaction->t_cpnext = - journal->j_checkpoint_transactions; - commit_transaction->t_cpprev = - commit_transaction->t_cpnext->t_cpprev; - commit_transaction->t_cpnext->t_cpprev = - commit_transaction; - commit_transaction->t_cpprev->t_cpnext = + commit_transaction->t_cpnext = + journal->j_checkpoint_transactions; + commit_transaction->t_cpprev = + commit_transaction->t_cpnext->t_cpprev; + commit_transaction->t_cpnext->t_cpprev = + commit_transaction; + commit_transaction->t_cpprev->t_cpnext = commit_transaction; - } }spin_unlock (&journal->j_list_lock); - +/* Drop all spin_locks because commit_callback may be block. +* __journal_remove_checkpoint() can not destroy transaction +* under us because it is not marked as T_FINISHED yet */ if (journal->j_commit_callback) journal->j_commit_callback (journal, commit_transaction);trace_jbd2_end_commit (journal, commit_transaction);jbd_debug (1 ,"JBD2: commit %d complete, head %d\n" , journal->j_commit_sequence, journal->j_tail_sequence); -if (to_free) -jbd2_journal_free_transaction (commit_transaction); +write_lock (&journal->j_state_lock); +spin_lock (&journal->j_list_lock); + commit_transaction->t_state =T_FINISHED ; +/* Recheck checkpoint lists after j_list_lock was dropped */ +if (commit_transaction->t_checkpoint_list ==NULL && + commit_transaction->t_checkpoint_io_list ==NULL ) { +__jbd2_journal_drop_transaction (journal, commit_transaction); +jbd2_journal_free_transaction (commit_transaction); + } +spin_unlock (&journal->j_list_lock); +write_unlock (&journal->j_state_lock);wake_up (&journal->j_wait_done_commit); }
include/linux/jbd2.h +1 -0
@@ -498,6 +498,7 @@ struct transaction_sT_COMMIT ,T_COMMIT_DFLUSH ,T_COMMIT_JFLUSH , +T_COMMIT_CALLBACK , T_FINISHED } t_state;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 75/136 ext4: fix journal callback list traversal
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Dmitry Monakhov <[email protected]>
[ Upstream commit 5d3ee20855e28169d711b394857ee608a5023094 ]
It is incorrect to use list_for_each_entry_safe() for journal callback traversial because ->next may be removed by other task:
->ext4_mb_free_metadata()
->ext4_mb_free_metadata()
->ext4_journal_callback_del()
This results in the following issue:
WARNING: at lib/list_debug.c:62 __list_del_entry+0x1c0/0x250() Hardware name: list_del corruption. prev->next should be ffff88019a4ec198, but was 6b6b6b6b6b6b6b6b Modules linked in: cpufreq_ondemand acpi_cpufreq freq_table mperf coretemp kvm_intel kvm crc32c_intel ghash_clmulni_intel microcode sg xhci_hcd button sd_mod crc_t10dif aesni_intel ablk_helper cryptd lrw aes_x86_64 xts gf128mul ahci libahci pata_acpi ata_generic dm_mirror dm_region_hash dm_log dm_mod Pid: 16400, comm: jbd2/dm-1-8 Tainted: G W 3.8.0-rc3+ #107 Call Trace: [<ffffffff8106fb0d>] warn_slowpath_common+0xad/0xf0 [<ffffffff8106fc06>] warn_slowpath_fmt+0x46/0x50 [<ffffffff813637e9>] ? ext4_journal_commit_callback+0x99/0xc0 [<ffffffff8148cae0>] __list_del_entry+0x1c0/0x250 [<ffffffff813637bf>] ext4_journal_commit_callback+0x6f/0xc0 [<ffffffff813ca336>] jbd2_journal_commit_transaction+0x23a6/0x2570 [<ffffffff8108aa42>] ? try_to_del_timer_sync+0x82/0xa0 [<ffffffff8108b491>] ? del_timer_sync+0x91/0x1e0 [<ffffffff813d3ecf>] kjournald2+0x19f/0x6a0 [<ffffffff810ad630>] ? wake_up_bit+0x40/0x40 [<ffffffff813d3d30>] ? bit_spin_lock+0x80/0x80 [<ffffffff810ac6be>] kthread+0x10e/0x120 [<ffffffff810ac5b0>] ? __init_kthread_worker+0x70/0x70 [<ffffffff818ff6ac>] ret_from_fork+0x7c/0xb0 [<ffffffff810ac5b0>] ? __init_kthread_worker+0x70/0x70
This patch fix the issue as follows:
- ext4_journal_commit_callback() make list truly traversial safe simply by always starting from list_head
- fix race between two ext4_journal_callback_del() and ext4_journal_callback_try_del()
--- fs/ext4/ext4_jbd2.h | 6 +++++- fs/ext4/mballoc.c | 8 ++++---- fs/ext4/super.c | 7 +++++-- 3 files changed, 14 insertions(+), 7 deletions(-)
fs/ext4/ext4_jbd2.h +5 -1
@@ -170,16 +170,20 @@ static inline void ext4_journal_callback_add(handle_t *handle,* ext4_journal_callback_del: delete a registered callback * @handle: active journal transaction handle on which callback was registered * @jce: registered journal callback entry to unregister +* Return true if object was sucessfully removed */ -static inline void ext4_journal_callback_del (handle_t *handle, +static inline bool ext4_journal_callback_try_del (handle_t *handle,struct ext4_journal_cb_entry *jce) { +bool deleted;struct ext4_sb_info *sbi =EXT4_SB (handle->h_transaction->t_journal->j_private);spin_lock (&sbi->s_md_lock); + deleted = !list_empty (&jce->jce_list);list_del_init (&jce->jce_list);spin_unlock (&sbi->s_md_lock); +return deleted; }int
fs/ext4/mballoc.c +4 -4
@@ -4438,11 +4438,11 @@ ext4_mb_free_metadata(handle_t *handle, struct ext4_buddy *e4b, node =rb_prev (new_node);if (node) { entry = rb_entry(node, struct ext4_free_data, efd_node); -if (can_merge (entry, new_entry)) { +if (can_merge (entry, new_entry) && +ext4_journal_callback_try_del (handle, &entry->efd_jce)) { new_entry->efd_start_cluster = entry->efd_start_cluster; new_entry->efd_count += entry->efd_count;rb_erase (node, &(db->bb_free_root)); -ext4_journal_callback_del (handle, &entry->efd_jce);kmem_cache_free (ext4_free_data_cachep, entry); } }
@@ -4450,10 +4450,10 @@ ext4_mb_free_metadata(handle_t *handle, struct ext4_buddy *e4b, node =rb_next (new_node);if (node) { entry = rb_entry(node, struct ext4_free_data, efd_node); -if (can_merge (new_entry, entry)) { +if (can_merge (new_entry, entry) && +ext4_journal_callback_try_del (handle, &entry->efd_jce)) { new_entry->efd_count += entry->efd_count;rb_erase (node, &(db->bb_free_root)); -ext4_journal_callback_del (handle, &entry->efd_jce);kmem_cache_free (ext4_free_data_cachep, entry); } }
fs/ext4/super.c +5 -2
@@ -452,10 +452,13 @@ static void ext4_journal_commit_callback(journal_t *journal, transaction_t *txn)struct super_block *sb = journal->j_private;struct ext4_sb_info *sbi =EXT4_SB (sb);int error =is_journal_aborted (journal); -struct ext4_journal_cb_entry *jce, *tmp; +struct ext4_journal_cb_entry *jce; +BUG_ON (txn->t_state ==T_FINISHED );spin_lock (&sbi->s_md_lock); -list_for_each_entry_safe (jce, tmp, &txn->t_private_list, jce_list) { +while (!list_empty (&txn->t_private_list)) { + jce =list_entry (txn->t_private_list.next, + struct ext4_journal_cb_entry, jce_list);list_del_init (&jce->jce_list);spin_unlock (&sbi->s_md_lock); jce->jce_func (sb, jce, error);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 76/136 ext4: fix big-endian bug in metadata checksum calculations
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Dmitry Monakhov <[email protected]>
[ Upstream commit 171a7f21a76a0958c225b97c00a97a10390d40ee ]
--- fs/ext4/inode.c | 8 ++++---- fs/ext4/mmp.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
fs/ext4/inode.c +4 -4
@@ -55,21 +55,21 @@ static __u32 ext4_inode_csum(struct inode *inode, struct ext4_inode *raw,__u16 csum_hi =0 ;__u32 csum; - csum_lo = raw->i_checksum_lo; + csum_lo =le16_to_cpu (raw->i_checksum_lo); raw->i_checksum_lo =0 ;if (EXT4_INODE_SIZE (inode->i_sb) >EXT4_GOOD_OLD_INODE_SIZE &&EXT4_FITS_IN_INODE (raw, ei, i_checksum_hi)) { - csum_hi = raw->i_checksum_hi; + csum_hi =le16_to_cpu (raw->i_checksum_hi); raw->i_checksum_hi =0 ; } csum =ext4_chksum (sbi, ei->i_csum_seed, (__u8 *)raw,EXT4_INODE_SIZE (inode->i_sb)); - raw->i_checksum_lo = csum_lo; + raw->i_checksum_lo =cpu_to_le16 (csum_lo);if (EXT4_INODE_SIZE (inode->i_sb) >EXT4_GOOD_OLD_INODE_SIZE &&EXT4_FITS_IN_INODE (raw, ei, i_checksum_hi)) - raw->i_checksum_hi = csum_hi; + raw->i_checksum_hi =cpu_to_le16 (csum_hi);return csum; }
fs/ext4/mmp.c +1 -1
@@ -7,7 +7,7 @@#include "ext4.h" /* Checksumming functions */ -static __u32 ext4_mmp_csum (struct super_block *sb,struct mmp_struct *mmp) +static __le32 ext4_mmp_csum (struct super_block *sb,struct mmp_struct *mmp) {struct ext4_sb_info *sbi =EXT4_SB (sb);int offset = offsetof(struct mmp_struct , mmp_checksum);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 77/136 ext4: fix online resizing for ext3-compat file systems
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Theodore Ts'o <[email protected]>
[ Upstream commit c5c72d814cf0f650010337c73638b25e6d14d2d4 ]
Commit fb0a387dcdc restricts block allocations for indirect-mapped files to block groups less than s_blockfile_groups. However, the online resizing code wasn't setting s_blockfile_groups, so the newly added block groups were not available for non-extent mapped files.
--- fs/ext4/resize.c | 2 ++ 1 file changed, 2 insertions(+)
fs/ext4/resize.c +2 -0
@@ -1255,6 +1255,8 @@ static void ext4_update_super(struct super_block *sb,/* Update the global fs size fields */ sbi->s_groups_count += flex_gd->count; + sbi->s_blockfile_groups =min_t (ext4_group_t, sbi->s_groups_count, + (EXT4_MAX_BLOCK_FILE_PHYS /EXT4_BLOCKS_PER_GROUP (sb)));/* Update the reserved block counts only once the new group is * active. */
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 78/136 ext4: fix Kconfig documentation for CONFIG_EXT4_DEBUG
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Theodore Ts'o <[email protected]>
[ Upstream commit 7f3e3c7cfcec148ccca9c0dd2dbfd7b00b7ac10f ]
Fox the Kconfig documentation for CONFIG_EXT4_DEBUG to match the change made by commit a0b30c1229: ext4: use module parameters instead of debugfs for mballoc_debug
--- fs/ext4/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/ext4/Kconfig +2 -1
@@ -84,4 +84,5 @@ config EXT4_DEBUG Enables run-time debugging support for the ext4 filesystem. If you select Y here, then you will be able to turn on debugging - with a command such as "echo 1 > /sys/kernel/debug/ext4/mballoc-debug" + with a command such as: + echo 1 > /sys/module/ext4/parameters/mballoc_debug
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 79/136 mmc: at91/avr32/atmel-mci: fix DMA-channel leak on module unload
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
[ Upstream commit 91cf54feecf815bec0b6a8d6d9dbd0e219f2f2cc ]
Fix regression introduced by commit 796211b7953 ("mmc: atmel-mci: add pdc support and runtime capabilities detection") which removed the need for CONFIG_MMC_ATMELMCI_DMA but kept the Kconfig-entry as well as the compile guards around dma_release_channel() in remove(). Consequently, DMA is always enabled (if supported), but the DMA-channel is not released on module unload unless the DMA-config option is selected.
Remove the no longer used CONFIG_MMC_ATMELMCI_DMA option completely.
--- arch/arm/configs/at91sam9g45_defconfig | 1 - arch/avr32/configs/favr-32_defconfig | 1 - arch/avr32/configs/merisc_defconfig | 1 - drivers/mmc/host/Kconfig | 10 ---------- drivers/mmc/host/atmel-mci.c | 2 -- 5 files changed, 15 deletions(-)
arch/arm/configs/at91sam9g45_defconfig +0 -1
@@ -173,7 +173,6 @@ CONFIG_MMC=y # CONFIG_MMC_BLOCK_BOUNCE is not set CONFIG_SDIO_UART=m CONFIG_MMC_ATMELMCI=y -CONFIG_MMC_ATMELMCI_DMA=y CONFIG_LEDS_ATMEL_PWM=y CONFIG_LEDS_GPIO=y CONFIG_LEDS_TRIGGER_TIMER=y
arch/avr32/configs/favr-32_defconfig +0 -1
@@ -122,7 +122,6 @@ CONFIG_USB_G_SERIAL=m CONFIG_USB_CDC_COMPOSITE=m CONFIG_MMC=y CONFIG_MMC_ATMELMCI=y -CONFIG_MMC_ATMELMCI_DMA=y CONFIG_NEW_LEDS=y CONFIG_LEDS_CLASS=y CONFIG_LEDS_ATMEL_PWM=m
arch/avr32/configs/merisc_defconfig +0 -1
@@ -102,7 +102,6 @@ CONFIG_FRAMEBUFFER_CONSOLE=y CONFIG_LOGO=y CONFIG_MMC=y CONFIG_MMC_ATMELMCI=y -CONFIG_MMC_ATMELMCI_DMA=y CONFIG_NEW_LEDS=y CONFIG_LEDS_CLASS=y CONFIG_LEDS_ATMEL_PWM=y
drivers/mmc/host/Kconfig +0 -10
@@ -300,16 +300,6 @@ config MMC_ATMELMCI endchoice -config MMC_ATMELMCI_DMA - bool "Atmel MCI DMA support" - depends on MMC_ATMELMCI && (AVR32 || ARCH_AT91SAM9G45) && DMA_ENGINE - help - Say Y here to have the Atmel MCI driver use a DMA engine to - do data transfers and thus increase the throughput and - reduce the CPU utilization. - - If unsure, say N. - config MMC_MSM tristate "Qualcomm SDCC Controller Support" depends on MMC && ARCH_MSM
drivers/mmc/host/atmel-mci.c +0 -2
@@ -2407,10 +2407,8 @@ static int __exit atmci_remove(struct platform_device *pdev)atmci_readl (host,ATMCI_SR );clk_disable (host->mck); -#ifdef CONFIG_MMC_ATMELMCI_DMA if (host->dma.chan)dma_release_channel (host->dma.chan); -#endif free_irq (platform_get_irq (pdev,0 ), host);iounmap (host->regs);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 80/136 KVM: X86 emulator: fix source operand decoding for 8bit mov[zs]x instructions
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Gleb Natapov <[email protected]>
[ Upstream commit 660696d1d16a71e15549ce1bf74953be1592bcd3 ]
Source operand for one byte mov[zs]x is decoded incorrectly if it is in high byte register. Fix that.
--- arch/x86/kvm/emulate.c | 4 ++++ 1 file changed, 4 insertions(+)
arch/x86/kvm/emulate.c +4 -0
@@ -3970,6 +3970,10 @@ static int decode_operand(struct x86_emulate_ctxt *ctxt, struct operand *op,break ;case OpMem8: ctxt->memop.bytes =1 ; +if (ctxt->memop.type ==OP_REG ) { + ctxt->memop.addr.reg =decode_register (ctxt, ctxt->modrm_rm,1 ); +fetch_register_operand (&ctxt->memop); + } goto mem_common;case OpMem16: ctxt->memop.bytes =2 ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 81/136 x86: Eliminate irq_mis_count counted in arch_irq_stat
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Li Fei <[email protected]>
[ Upstream commit f7b0e1055574ce06ab53391263b4e205bf38daf3 ]
With the current implementation, kstat_cpu(cpu).irqs_sum is also increased in case of irq_mis_count increment.
So there is no need to count irq_mis_count in arch_irq_stat, otherwise irq_mis_count will be counted twice in the sum of /proc/stat.
--- arch/x86/kernel/irq.c | 4 ---- 1 file changed, 4 deletions(-)
arch/x86/kernel/irq.c +0 -4
@@ -165,10 +165,6 @@ u64 arch_irq_stat_cpu(unsigned int cpu)u64 arch_irq_stat (void ) {u64 sum =atomic_read (&irq_err_count); - -#ifdef CONFIG_X86_IO_APIC - sum +=atomic_read (&irq_mis_count); -#endif return sum; }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 82/136 mmc: core: Fix bit width test failing on old eMMC cards
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Philip Rakity <[email protected]>
[ Upstream commit 836dc2fe89c968c10cada87e0dfae6626f8f9da3 ]
PARTITION_SUPPORT needs to be set before doing the compare on version number so the bit width test does not get invalid data. Before this patch, a Sandisk iNAND eMMC card would detect 1-bit width although the hardware supports 4-bit.
Only affects old emmc devices - pre 4.4 devices.
--- drivers/mmc/core/mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/core/mmc.c +1 -1
@@ -368,13 +368,13 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd) ext_csd[EXT_CSD_SEC_FEATURE_SUPPORT ]; card->ext_csd.raw_trim_mult = ext_csd[EXT_CSD_TRIM_MULT ]; + card->ext_csd.raw_partition_support = ext_csd[EXT_CSD_PARTITION_SUPPORT ];if (card->ext_csd.rev >=4 ) {/* * Enhanced area feature support -- check whether the eMMC * card has the Enhanced area enabled. If so, export enhanced * area offset and size to user by adding sysfs interface. */ - card->ext_csd.raw_partition_support = ext_csd[EXT_CSD_PARTITION_SUPPORT ];if ((ext_csd[EXT_CSD_PARTITION_SUPPORT ] &0x2 ) && (ext_csd[EXT_CSD_PARTITION_ATTRIBUTE ] &0x1 )) { hc_erase_grp_sz =
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 83/136 mmc: atmel-mci: pio hang on block errors
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Terry Barnaby <[email protected]>
[ Upstream commit bdbc5d0c60f3e9de3eeccf1c1a18bdc11dca62cc ]
The driver is doing, by default, multi-block reads. When a block error occurs, card/block.c instigates a single block read: "mmcblk0: retrying using single block read". It leaves the sg chain intact and just changes the length attribute for the first sg entry and the overall sg_len parameter. When atmci_read_data_pio is called to read the single block of data it ignores the sg_len and expects to read more than 512 bytes as it sees there are multiple items in the sg list. No more data comes as the controller has only been commanded to get one block.
--- drivers/mmc/host/atmel-mci.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/mmc/host/atmel-mci.c +10 -4
@@ -175,6 +175,7 @@ struct atmel_mci {void __iomem *regs;struct scatterlist *sg; +unsigned int sg_len;unsigned int pio_offset;unsigned int *buffer;unsigned int buf_size;
@@ -825,6 +826,7 @@ static u32 atmci_prepare_data(struct atmel_mci *host, struct mmc_data *data) data->error = -EINPROGRESS ; host->sg = data->sg; + host->sg_len = data->sg_len; host->data = data; host->data_chan =NULL ;
@@ -1757,7 +1759,8 @@ static void atmci_read_data_pio(struct atmel_mci *host)if (offset == sg->length) {flush_dcache_page (sg_page (sg)); host->sg = sg =sg_next (sg); -if (!sg) + host->sg_len--; +if (!sg || !host->sg_len) goto done; offset =0 ;
@@ -1770,7 +1773,8 @@ static void atmci_read_data_pio(struct atmel_mci *host)flush_dcache_page (sg_page (sg)); host->sg = sg =sg_next (sg); -if (!sg) + host->sg_len--; +if (!sg || !host->sg_len) goto done; offset =4 - remaining;
@@ -1821,7 +1825,8 @@ static void atmci_write_data_pio(struct atmel_mci *host) nbytes +=4 ;if (offset == sg->length) { host->sg = sg =sg_next (sg); -if (!sg) + host->sg_len--; +if (!sg || !host->sg_len) goto done; offset =0 ;
@@ -1835,7 +1840,8 @@ static void atmci_write_data_pio(struct atmel_mci *host) nbytes += remaining; host->sg = sg =sg_next (sg); -if (!sg) { + host->sg_len--; +if (!sg || !host->sg_len) {atmci_writel (host,ATMCI_TDR , value); goto done; }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 84/136 mfd: adp5520: Restore mode bits on resume
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Lars-Peter Clausen <[email protected]>
[ Upstream commit c6cc25fda58da8685ecef3f179adc7b99c8253b2 ]
The adp5520 unfortunately also clears the BL_EN bit when the nSTNDBY bit is cleared. So we need to make sure to restore it during resume if it was set before suspend.
--- drivers/mfd/adp5520.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/mfd/adp5520.c +6 -2
@@ -36,6 +36,7 @@ struct adp5520_chip {struct blocking_notifier_head notifier_list;int irq;unsigned long id; +uint8_t mode; }; static int __adp5520_read(struct i2c_client *client,
@@ -326,7 +327,10 @@ static int adp5520_suspend(struct device *dev)struct i2c_client *client =to_i2c_client (dev);struct adp5520_chip *chip =dev_get_drvdata (&client->dev); -adp5520_clr_bits (chip->dev,ADP5520_MODE_STATUS , ADP5520_nSTNBY); +adp5520_read (chip->dev,ADP5520_MODE_STATUS , &chip->mode); +/* All other bits are W1C */ + chip->mode &=ADP5520_BL_EN |ADP5520_DIM_EN | ADP5520_nSTNBY; +adp5520_write (chip->dev,ADP5520_MODE_STATUS ,0 );return 0 ; }
@@ -335,7 +339,7 @@ static int adp5520_resume(struct device *dev)struct i2c_client *client =to_i2c_client (dev);struct adp5520_chip *chip =dev_get_drvdata (&client->dev); -adp5520_set_bits (chip->dev,ADP5520_MODE_STATUS , ADP5520_nSTNBY); +adp5520_write (chip->dev,ADP5520_MODE_STATUS , chip->mode); return 0; }#endif
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 85/136 powerpc: Emulate non privileged DSCR read and write
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Anton Blanchard <[email protected]>
[ Upstream commit 73d2fb758e678c93bc76d40876c2359f0729b0ef ]
POWER8 allows read and write of the DSCR in userspace. We added kernel emulation so applications could always use the instructions regardless of the CPU type.
Unfortunately there are two SPRs for the DSCR and we only added emulation for the privileged one. Add code to match the non privileged one.
A simple test was created to verify the fix:
http://ozlabs.org/~anton/junkcode/user_dscr_test.c
Without the patch we get a SIGILL and it passes with the patch.
--- arch/powerpc/include/asm/ppc-opcode.h | 4 ++++ arch/powerpc/kernel/traps.c | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-)
arch/powerpc/include/asm/ppc-opcode.h +4 -0
@@ -111,6 +111,10 @@#define PPC_INST_MFSPR_DSCR_MASK 0xfc1fffff#define PPC_INST_MTSPR_DSCR 0x7c1103a6#define PPC_INST_MTSPR_DSCR_MASK 0xfc1fffff +#define PPC_INST_MFSPR_DSCR_USER 0x7c0302a6 +#define PPC_INST_MFSPR_DSCR_USER_MASK 0xfc1fffff +#define PPC_INST_MTSPR_DSCR_USER 0x7c0303a6 +#define PPC_INST_MTSPR_DSCR_USER_MASK 0xfc1fffff#define PPC_INST_SLBFEE 0x7c0007a7#define PPC_INST_STRING 0x7c00042a
arch/powerpc/kernel/traps.c +8 -2
@@ -960,7 +960,10 @@ static int emulate_instruction(struct pt_regs *regs)#ifdef CONFIG_PPC64 /* Emulate the mfspr rD, DSCR. */ -if (((instword &PPC_INST_MFSPR_DSCR_MASK ) ==PPC_INST_MFSPR_DSCR ) && +if ((((instword &PPC_INST_MFSPR_DSCR_USER_MASK ) == +PPC_INST_MFSPR_DSCR_USER ) || + ((instword &PPC_INST_MFSPR_DSCR_MASK ) == +PPC_INST_MFSPR_DSCR )) &&cpu_has_feature (CPU_FTR_DSCR )) {PPC_WARN_EMULATED (mfdscr, regs); rd = (instword >>21 ) &0x1f ;
@@ -968,7 +971,10 @@ static int emulate_instruction(struct pt_regs *regs)return 0 ; }/* Emulate the mtspr DSCR, rD. */ -if (((instword &PPC_INST_MTSPR_DSCR_MASK ) ==PPC_INST_MTSPR_DSCR ) && +if ((((instword &PPC_INST_MTSPR_DSCR_USER_MASK ) == +PPC_INST_MTSPR_DSCR_USER ) || + ((instword &PPC_INST_MTSPR_DSCR_MASK ) == +PPC_INST_MTSPR_DSCR )) &&cpu_has_feature (CPU_FTR_DSCR )) {PPC_WARN_EMULATED (mtdscr, regs); rd = (instword >>21 ) &0x1f ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 86/136 powerpc: fix numa distance for form0 device tree
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Vaidyanathan Srinivasan <[email protected]>
[ Upstream commit 7122beeee7bc1757682049780179d7c216dd1c83 ]
The following commit breaks numa distance setup for old powerpc systems that use form0 encoding in device tree.
commit 41eab6f88f24124df89e38067b3766b7bef06ddb powerpc/numa: Use form 1 affinity to setup node distance
Device tree node /rtas/ibm,associativity-reference-points would index into /cpus/PowerPCxxxx/ibm,associativity based on form0 or form1 encoding detected by ibm,architecture-vec-5 property.
All modern systems use form1 and current kernel code is correct. However, on older systems with form0 encoding, the numa distance will get hard coded as LOCAL_DISTANCE for all nodes. This causes task scheduling anomaly since scheduler will skip building numa level domain (topmost domain with all cpus) if all numa distances are same. (value of 'level' in sched_init_numa() will remain 0)
Prior to the above commit:
((from) == (to) ? LOCAL_DISTANCE : REMOTE_DISTANCE)
Restoring compatible behavior with this patch for old powerpc systems with device tree where numa distance are encoded as form0.
--- arch/powerpc/mm/numa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/mm/numa.c +1 -1
@@ -201,7 +201,7 @@ int __node_distance(int a, int b)int distance =LOCAL_DISTANCE ;if (!form1_affinity) -return distance; +return ((a == b) ?LOCAL_DISTANCE :REMOTE_DISTANCE );for (i =0 ; i < distance_ref_points_depth; i++) {if (distance_lookup_table[a][i] == distance_lookup_table[b][i])
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 87/136 autofs - remove autofs dentry mount check
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: David Jeffery <[email protected]>
[ Upstream commit ce8a5dbdf9e709bdaf4618d7ef8cceb91e8adc69 ]
When checking if an autofs mount point is busy it isn't sufficient to only check if it's a mount point.
For example, if the mount of an offset mountpoint in a tree is denied for this host by its export and the dentry becomes a process working directory the check incorrectly returns the mount as not in use at expire.
This can happen since the default when mounting within a tree is nostrict, which means ingnore mount fails on mounts within the tree and continue. The nostrict option is meant to allow mounting in this case.
--- fs/autofs4/expire.c | 9 --------- 1 file changed, 9 deletions(-)
fs/autofs4/expire.c +0 -9
@@ -61,15 +61,6 @@ static int autofs4_mount_busy(struct vfsmount *mnt, struct dentry *dentry)/* This is an autofs submount, we can't expire it */ if (autofs_type_indirect (sbi->type)) goto done; - -/* -* Otherwise it's an offset mount and we need to check -* if we can umount its mount, if there is one. -*/ -if (!d_mountpoint (path.dentry)) { - status =0 ; - goto done; - } }/* Update the expiry counter if fs is busy */
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 88/136 net/eth/ibmveth: Fixup retrieval of MAC address
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Benjamin Herrenschmidt <[email protected]>
[ Upstream commit 13f85203e1060da83d9ec1c1c5a63343eaab8de4 ]
Some ancient pHyp versions used to create a 8 bytes local-mac-address property in the device-tree instead of a 6 bytes one for veth.
The Linux driver code to deal with that is an insane hack which also happens to break with some choices of MAC addresses in qemu by testing for a bit in the address rather than just looking at the size of the property.
Sanitize this by doing the latter instead.
--- drivers/net/ethernet/ibm/ibmveth.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-)
drivers/net/ethernet/ibm/ibmveth.c +10 -13
@@ -1327,7 +1327,7 @@ static const struct net_device_ops ibmveth_netdev_ops = {static int __devinit ibmveth_probe (struct vio_dev *dev,const struct vio_device_id *id) { -int rc, i; +int rc, i, mac_len;struct net_device *netdev;struct ibmveth_adapter *adapter;unsigned char *mac_addr_p;
@@ -1337,11 +1337,19 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, dev->unit_address); mac_addr_p = (unsigned char *)vio_get_attribute (dev,VETH_MAC_ADDR , -NULL ); + &mac_len);if (!mac_addr_p) {dev_err (&dev->dev,"Can't find VETH_MAC_ADDR attribute\n" );return -EINVAL ; } +/* Workaround for old/broken pHyp */ +if (mac_len ==8 ) + mac_addr_p +=2 ; +else if (mac_len !=6 ) { +dev_err (&dev->dev,"VETH_MAC_ADDR attribute wrong len %d\n" , + mac_len); +return -EINVAL ; + } mcastFilterSize_p = (unsigned int *)vio_get_attribute (dev,VETH_MCAST_FILTER_SIZE ,NULL );
@@ -1366,17 +1374,6 @@ static int __devinit ibmveth_probe(struct vio_dev *dev,netif_napi_add (netdev, &adapter->napi, ibmveth_poll,16 ); -/* -* Some older boxes running PHYP non-natively have an OF that returns -* a 8-byte local-mac-address field (and the first 2 bytes have to be -* ignored) while newer boxes' OF return a 6-byte field. Note that -* IEEE 1275 specifies that local-mac-address must be a 6-byte field. -* The RPA doc specifies that the first byte must be 10b, so we'll -* just look for it to solve this 8 vs. 6 byte field issue -*/ -if ((*mac_addr_p &0x3 ) !=0x02 ) - mac_addr_p +=2 ; - adapter->mac_addr =0 ;memcpy (&adapter->mac_addr, mac_addr_p,6 );
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 89/136 perf/x86/intel: Add support for IvyBridge model 58 Uncore
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Vince Weaver <[email protected]>
[ Upstream commit 9a6bc14350b130427725f33e371e86212fa56c85 ]
According to Intel Vol3b 18.9, the IvyBridge model 58 uncore is the same as that of SandyBridge.
I've done some simple tests and with this patch things seem to work on my mac-mini.
--- arch/x86/kernel/cpu/perf_event_intel_uncore.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/kernel/cpu/perf_event_intel_uncore.c +1 -0
@@ -2820,6 +2820,7 @@ static int __init uncore_cpu_init(void) msr_uncores = nhm_msr_uncores;break ;case 42 :/* Sandy Bridge */ +case 58 :/* Ivy Bridge */ if (snb_uncore_cbox.num_boxes > max_cores) snb_uncore_cbox.num_boxes = max_cores; msr_uncores = snb_msr_uncores;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 90/136 perf/x86/intel: Fix unintended variable name reuse
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Jan-Simon=20M=C3=B6ller?= <[email protected]>
[ Upstream commit 1b0dac2ac6debdbf1541e15f2cede03613cf4465 ]
The variable name events_group is already in used and led to a compilation error when using clang to build the Linux Kernel . The fix is just to rename the var. No functional change. Please apply.
Fix suggested in discussion by PaX Team <[email protected]>
--- arch/x86/kernel/cpu/perf_event_intel_uncore.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
arch/x86/kernel/cpu/perf_event_intel_uncore.c +8 -8
@@ -2398,7 +2398,7 @@ static void __init uncore_types_exit(struct intel_uncore_type **types)static int __init uncore_type_init (struct intel_uncore_type *type) {struct intel_uncore_pmu *pmus; -struct attribute_group *events_group; +struct attribute_group *attr_group;struct attribute **attrs;int i, j;
@@ -2425,19 +2425,19 @@ static int __init uncore_type_init(struct intel_uncore_type *type)while (type->event_descs[i].attr.attr.name) i++; - events_group =kzalloc (sizeof (struct attribute *) * (i +1 ) + -sizeof (*events_group),GFP_KERNEL ); -if (!events_group) + attr_group =kzalloc (sizeof (struct attribute *) * (i +1 ) + +sizeof (*attr_group),GFP_KERNEL ); +if (!attr_group) goto fail; - attrs = (struct attribute **)(events_group +1 ); - events_group->name ="events" ; - events_group->attrs = attrs; + attrs = (struct attribute **)(attr_group +1 ); + attr_group->name ="events" ; + attr_group->attrs = attrs;for (j =0 ; j < i; j++) attrs[j] = &type->event_descs[j].attr.attr; - type->attr_groups[1 ] = events_group; + type->attr_groups[1 ] = attr_group; } type->pmus = pmus;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 91/136 perf/x86/intel/lbr: Fix LBR filter
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <[email protected]>
[ Upstream commit 6e15eb3ba6c0249c9e8c783517d131b47db995ca ]
The LBR 'from' adddress is under full userspace control; ensure we validate it before reading from it.
Note: is_module_text_address() can potentially be quite expensive; for those running into that with high overhead in modules optimize it using an RCU backed rb-tree.
--- arch/x86/kernel/cpu/perf_event_intel_lbr.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
arch/x86/kernel/cpu/perf_event_intel_lbr.c +12 -2
@@ -442,8 +442,18 @@ static int branch_type(unsigned long from, unsigned long to)return X86_BR_NONE ; addr = buf; - }else - addr = (void *)from; + }else { +/* +* The LBR logs any address in the IP, even if the IP just +* faulted. This means userspace can control the from address. +* Ensure we don't blindy read any address by validating it is +* a known text address. +*/ +if (kernel_text_address (from)) + addr = (void *)from; +else +return X86_BR_NONE ; + }/* * decoder needs to know the ABI especially
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 92/136 perf/x86/intel/lbr: Demand proper privileges for PERF_SAMPLE_BRANCH_KERNEL
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <[email protected]>
[ Upstream commit 7cc23cd6c0c7d7f4bee057607e7ce01568925717 ]
We should always have proper privileges when requesting kernel data.
--- arch/x86/kernel/cpu/perf_event_intel_lbr.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
arch/x86/kernel/cpu/perf_event_intel_lbr.c +10 -3
@@ -310,7 +310,7 @@ void intel_pmu_lbr_read(void)* - in case there is no HW filter * - in case the HW filter has errata or limitations */ -static void intel_pmu_setup_sw_lbr_filter (struct perf_event *event) +static int intel_pmu_setup_sw_lbr_filter (struct perf_event *event) {u64 br_type = event->attr.branch_sample_type;int mask =0 ;
@@ -318,8 +318,11 @@ static void intel_pmu_setup_sw_lbr_filter(struct perf_event *event)if (br_type &PERF_SAMPLE_BRANCH_USER ) mask |=X86_BR_USER ; -if (br_type &PERF_SAMPLE_BRANCH_KERNEL ) +if (br_type &PERF_SAMPLE_BRANCH_KERNEL ) { +if (perf_paranoid_kernel () && !capable (CAP_SYS_ADMIN )) +return -EACCES ; mask |=X86_BR_KERNEL ; + }/* we ignore BRANCH_HV here */
@@ -339,6 +342,8 @@ static void intel_pmu_setup_sw_lbr_filter(struct perf_event *event)* be used by fixup code for some CPU */ event->hw.branch_reg.reg = mask; + +return 0 ; }/*
@@ -386,7 +391,9 @@ int intel_pmu_setup_lbr_filter(struct perf_event *event)/* * setup SW LBR filter */ -intel_pmu_setup_sw_lbr_filter (event); + ret =intel_pmu_setup_sw_lbr_filter (event); +if (ret) +return ret;/* * setup HW LBR filter, if any
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 93/136 PCI/PM: Clear state_saved during suspend
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: "Rafael J. Wysocki" <[email protected]>
[ Upstream commit 82fee4d67ab86d6fe5eb0f9a9e988ca9d654d765 ]
This patch clears pci_dev->state_saved at the beginning of suspending. PCI config state may be saved long before that. Some drivers call pci_save_state() from the ->probe() callback to get snapshot of sane configuration space to use in the ->slot_reset() callback.
--- drivers/pci/pci-driver.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/pci/pci-driver.c +4 -0
@@ -685,6 +685,7 @@ static int pci_pm_suspend(struct device *dev) goto Fixup; } + pci_dev->state_saved = false;if (pm->suspend) {pci_power_t prev = pci_dev->current_state;int error;
@@ -831,6 +832,7 @@ static int pci_pm_freeze(struct device *dev)return 0 ; } + pci_dev->state_saved = false;if (pm->freeze) {int error;
@@ -919,6 +921,7 @@ static int pci_pm_poweroff(struct device *dev) goto Fixup; } + pci_dev->state_saved = false;if (pm->poweroff) {int error;
@@ -1037,6 +1040,7 @@ static int pci_pm_runtime_suspend(struct device *dev)if (!pm || !pm->runtime_suspend)return -ENOSYS ; + pci_dev->state_saved = false; pci_dev->no_d3cold = false; error = pm->runtime_suspend (dev);suspend_report_result (pm->runtime_suspend, error);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 94/136 e1000e: fix runtime power management transitions
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Konstantin Khlebnikov <[email protected]>
[ Upstream commit 66148babe728f3e00e13c56f6b0ecf325abd80da ]
This patch removes redundant actions from driver and fixes its interaction with actions in pci-bus runtime power management code.
It removes pci_save_state() from __e1000_shutdown() for normal adapters, PCI bus callbacks pci_pm_*() will do all this for us. Now __e1000_shutdown() switches to D3-state only quad-port adapters, because they needs quirk for clearing false-positive error from downsteam pci-e port.
pci_save_state() now called after clearing bus-master bit, thus __e1000_resume() and e1000_io_slot_reset() must set it back after restoring configuration space.
This patch set get_link_status before calling pm_runtime_put() in e1000_open() to allow e1000_idle() get real link status and schedule first runtime suspend.
This patch also enables wakeup for device if management mode is enabled (like for WoL) as result pci_prepare_to_sleep() would setup wakeup without special actions like custom 'enable_wakeup' sign.
--- drivers/net/ethernet/intel/e1000e/netdev.c | 78 +++++++--------------------- 1 file changed, 18 insertions(+), 60 deletions(-)
drivers/net/ethernet/intel/e1000e/netdev.c +18 -60
@@ -3951,6 +3951,7 @@ static int e1000_open(struct net_device *netdev)netif_start_queue (netdev); adapter->idle_check = true; + hw->mac.get_link_status = true;pm_runtime_put (&pdev->dev);/* fire a link status change interrupt to start the watchdog */
@@ -5454,8 +5455,7 @@ release:return retval; } -static int __e1000_shutdown (struct pci_dev *pdev,bool *enable_wake, -bool runtime) +static int __e1000_shutdown (struct pci_dev *pdev,bool runtime) {struct net_device *netdev =pci_get_drvdata (pdev);struct e1000_adapter *adapter =netdev_priv (netdev);
@@ -5479,10 +5479,6 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake, }e1000e_reset_interrupt_capability (adapter); - retval =pci_save_state (pdev); -if (retval) -return retval; - status =er32 (STATUS );if (status &E1000_STATUS_LU ) wufc &= ~E1000_WUFC_LNKC ;
@@ -5538,13 +5534,6 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake,ew32 (WUFC ,0 ); } - *enable_wake = !!wufc; - -/* make sure adapter isn't asleep if manageability is enabled */ -if ((adapter->flags &FLAG_MNG_PT_ENABLED ) || - (hw->mac.ops.check_mng_mode (hw))) - *enable_wake = true; -if (adapter->hw.phy.type == e1000_phy_igp_3)e1000e_igp3_phy_powerdown_workaround_ich8lan (&adapter->hw);
@@ -5556,26 +5545,6 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake,pci_disable_device (pdev); -return 0 ; -} - -static void e1000_power_off (struct pci_dev *pdev,bool sleep,bool wake) -{ -if (sleep && wake) { -pci_prepare_to_sleep (pdev); -return ; - } - -pci_wake_from_d3 (pdev, wake); -pci_set_power_state (pdev, PCI_D3hot); -} - -static void e1000_complete_shutdown (struct pci_dev *pdev,bool sleep, -bool wake) -{ -struct net_device *netdev =pci_get_drvdata (pdev); -struct e1000_adapter *adapter =netdev_priv (netdev); -/* * The pci-e switch on some quad port adapters will report a * correctable error when the MAC transitions from D0 to D3. To
@@ -5591,12 +5560,13 @@ static void e1000_complete_shutdown(struct pci_dev *pdev, bool sleep,pci_write_config_word (us_dev, pos +PCI_EXP_DEVCTL , (devctl & ~PCI_EXP_DEVCTL_CERE )); -e1000_power_off (pdev, sleep, wake); +pci_save_state (pdev); +pci_prepare_to_sleep (pdev);pci_write_config_word (us_dev, pos +PCI_EXP_DEVCTL , devctl); - }else { -e1000_power_off (pdev, sleep, wake); } + +return 0 ; }#ifdef CONFIG_PCIEASPM
@@ -5658,9 +5628,7 @@ static int __e1000_resume(struct pci_dev *pdev)if (aspm_disable_flag)e1000e_disable_aspm (pdev, aspm_disable_flag); -pci_set_power_state (pdev,PCI_D0 ); -pci_restore_state (pdev); -pci_save_state (pdev); +pci_set_master (pdev);e1000e_set_interrupt_capability (adapter);if (netif_running (netdev)) {
@@ -5727,14 +5695,8 @@ static int __e1000_resume(struct pci_dev *pdev)static int e1000_suspend (struct device *dev) {struct pci_dev *pdev =to_pci_dev (dev); -int retval; -bool wake; - - retval =__e1000_shutdown (pdev, &wake, false); -if (!retval) -e1000_complete_shutdown (pdev, true, wake); -return retval; +return __e1000_shutdown (pdev, false); }static int e1000_resume (struct device *dev)
@@ -5757,13 +5719,10 @@ static int e1000_runtime_suspend(struct device *dev)struct net_device *netdev =pci_get_drvdata (pdev);struct e1000_adapter *adapter =netdev_priv (netdev); -if (e1000e_pm_ready (adapter)) { -bool wake; - -__e1000_shutdown (pdev, &wake, true); - } +if (!e1000e_pm_ready (adapter)) +return 0 ; -return 0 ; +return __e1000_shutdown (pdev, true); }static int e1000_idle (struct device *dev)
@@ -5801,12 +5760,7 @@ static int e1000_runtime_resume(struct device *dev)static void e1000_shutdown (struct pci_dev *pdev) { -bool wake = false; - -__e1000_shutdown (pdev, &wake, false); - -if (system_state ==SYSTEM_POWER_OFF ) -e1000_complete_shutdown (pdev, false, wake); +__e1000_shutdown (pdev, false); }#ifdef CONFIG_NET_POLL_CONTROLLER
@@ -5924,9 +5878,9 @@ static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev) "Cannot re-enable PCI device after reset.\n"); result =PCI_ERS_RESULT_DISCONNECT ; }else { -pci_set_master (pdev); pdev->state_saved = true;pci_restore_state (pdev); +pci_set_master (pdev);pci_enable_wake (pdev, PCI_D3hot,0 );pci_enable_wake (pdev, PCI_D3cold,0 );
@@ -6363,7 +6317,11 @@ static int __devinit e1000_probe(struct pci_dev *pdev,/* initialize the wol settings based on the eeprom settings */ adapter->wol = adapter->eeprom_wol; -device_set_wakeup_enable (&adapter->pdev->dev, adapter->wol); + +/* make sure adapter isn't asleep if manageability is enabled */ +if (adapter->wol || (adapter->flags &FLAG_MNG_PT_ENABLED ) || + (hw->mac.ops.check_mng_mode (hw))) +device_wakeup_enable (&pdev->dev);/* save off EEPROM version number */ e1000_read_nvm (&adapter->hw,5 ,1 , &adapter->eeprom_vers);
Signature · 1 line
1.7.10.4
Re: [ 094/136 ] e1000e: fix runtime power management transitions
Quoted 2 lines · Steven Rostedt
3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
I don't think that 3.6.y needs this. That was fix for problem which appeared in 3.8 after some changes in PCI power management code. Probably it depends on these changes. If no one complains about problems we should leave it as is.
Quoted 32 lines
------------------
From: Konstantin Khlebnikov<[email protected]>
[ Upstream commit
66148babe728f3e00e13c56f6b0ecf325abd80da]This patch removes redundant actions from driver and fixes its interaction with actions in pci-bus runtime power management code.
It removes
pci_save_state()from__e1000_shutdown()for normal adapters, PCI bus callbacks pci_pm_*() will do all this for us. Now__e1000_shutdown()switches to D3-state only quad-port adapters, because they needs quirk for clearing false-positive error from downsteam pci-e port.
pci_save_state()now called after clearing bus-master bit, thus__e1000_resume()ande1000_io_slot_reset()must set it back after restoring configuration space.This patch set
get_link_statusbefore callingpm_runtime_put()ine1000_open()to allowe1000_idle()get real link status and schedule first runtime suspend.This patch also enables wakeup for device if management mode is enabled (like for WoL) as result
pci_prepare_to_sleep()would setup wakeup without special actions like custom 'enable_wakeup' sign.Cc Bruce Allan<[email protected]>Signed-off-by Konstantin Khlebnikov<[email protected]>Acked-by Rafael J. Wysocki<[email protected]>Tested-by Borislav Petkov<[email protected]>Tested-by Aaron Brown<[email protected]>Signed-off-by Jeff Kirsher<[email protected]>Signed-off-by Steven Rostedt<[email protected]>
Re: [ 094/136 ] e1000e: fix runtime power management transitions
Quoted 7 lines · Konstantin Khlebnikov
Quoted 2 lines · Steven Rostedt
3.6.11.4 stable review patch.
If anyone has any objections, please let me know.I don't think that 3.6.y needs this. That was fix for problem which appeared in 3.8 after some changes in PCI power management code. Probably it depends on these changes. If no one complains about problems we should leave it as is.
My thoughts are the same as Konstantin, but I would like Bruce Allan to weigh in on this since he is the e1000e maintainer. Since it is late Friday night, Bruce probably won't see this until Monday to respond.
Quoted 33 lines
Quoted 32 lines
------------------
From: Konstantin Khlebnikov<[email protected]>
[ Upstream commit
66148babe728f3e00e13c56f6b0ecf325abd80da]This patch removes redundant actions from driver and fixes its interaction with actions in pci-bus runtime power management code.
It removes
pci_save_state()from__e1000_shutdown()for normal adapters, PCI bus callbacks pci_pm_*() will do all this for us. Now__e1000_shutdown()switches to D3-state only quad-port adapters, because they needs quirk for clearing false-positive error from downsteam pci-e port.
pci_save_state()now called after clearing bus-master bit, thus__e1000_resume()ande1000_io_slot_reset()must set it back after restoring configuration space.This patch set
get_link_statusbefore callingpm_runtime_put()ine1000_open()to allowe1000_idle()get real link status and schedule first runtime suspend.This patch also enables wakeup for device if management mode is enabled (like for WoL) as result
pci_prepare_to_sleep()would setup wakeup without special actions like custom 'enable_wakeup' sign.Cc Bruce Allan<[email protected]>Signed-off-by Konstantin Khlebnikov<[email protected]>Acked-by Rafael J. Wysocki<[email protected]>Tested-by Borislav Petkov<[email protected]>Tested-by Aaron Brown<[email protected]>Signed-off-by Jeff Kirsher<[email protected]>Signed-off-by Steven Rostedt<[email protected]>
Steven Rostedt
maintainerRe: [ 094/136 ] e1000e: fix runtime power management transitions
Quoted 5 lines · Jeff Kirsher
Quoted 4 lines · Konstantin Khlebnikov
Quoted 2 lines · Steven Rostedt
3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
Quoted 7 lines
Quoted 3 lines
I don't think that 3.6.y needs this. That was fix for problem which appeared in 3.8 after some changes in PCI power management code. Probably it depends on these changes. If no one complains about problems we should leave it as is.
My thoughts are the same as Konstantin, but I would like Bruce Allan to weigh in on this since he is the e1000e maintainer. Since it is late Friday night, Bruce probably won't see this until Monday to respond.
Any word on this? I'll wait till tomorrow to do the release. If I don't hear anything, then I may just remove it.
Thanks,
-- Steve
Quoted 36 lines
Quoted 34 lines
Quoted 33 lines
------------------
From: Konstantin Khlebnikov<[email protected]>
[ Upstream commit
66148babe728f3e00e13c56f6b0ecf325abd80da]This patch removes redundant actions from driver and fixes its interaction with actions in pci-bus runtime power management code.
It removes
pci_save_state()from__e1000_shutdown()for normal adapters, PCI bus callbacks pci_pm_*() will do all this for us. Now__e1000_shutdown()switches to D3-state only quad-port adapters, because they needs quirk for clearing false-positive error from downsteam pci-e port.
pci_save_state()now called after clearing bus-master bit, thus__e1000_resume()ande1000_io_slot_reset()must set it back after restoring configuration space.This patch set
get_link_statusbefore callingpm_runtime_put()ine1000_open()to allowe1000_idle()get real link status and schedule first runtime suspend.This patch also enables wakeup for device if management mode is enabled (like for WoL) as result
pci_prepare_to_sleep()would setup wakeup without special actions like custom 'enable_wakeup' sign.Cc Bruce Allan<[email protected]>Signed-off-by Konstantin Khlebnikov<[email protected]>Acked-by Rafael J. Wysocki<[email protected]>Tested-by Borislav Petkov<[email protected]>Tested-by Aaron Brown<[email protected]>Signed-off-by Jeff Kirsher<[email protected]>Signed-off-by Steven Rostedt<[email protected]>
Re: [ 094/136 ] e1000e: fix runtime power management transitions
Quoted 14 lines · Steven Rostedt
Quoted 5 lines · Jeff Kirsher
Quoted 4 lines · Konstantin Khlebnikov
Quoted 2 lines · Steven Rostedt
3.6.11.4 stable review patch.
If anyone has any objections, please let me know.Quoted 7 lines
Quoted 3 lines
I don't think that 3.6.y needs this. That was fix for problem which appeared in 3.8 after some changes in PCI power management code. Probably it depends on these changes. If no one complains about problems we should leave it as is.
My thoughts are the same as Konstantin, but I would like Bruce Allan to weigh in on this since he is the e1000e maintainer. Since it is late Friday night, Bruce probably won't see this until Monday to respond.
Quoted 7 lines
Any word on this? I'll wait till tomorrow to do the release. If I don't hear anything, then I may just remove it.
Thanks,
-- Steve
Drop it from the release please.
Cheers,
Jeff
Quoted 38 lines
Quoted 36 lines
Quoted 34 lines
Quoted 33 lines
------------------
From: Konstantin Khlebnikov<[email protected]>
[ Upstream commit
66148babe728f3e00e13c56f6b0ecf325abd80da]This patch removes redundant actions from driver and fixes its interaction with actions in pci-bus runtime power management code.
It removes
pci_save_state()from__e1000_shutdown()for normal adapters, PCI bus callbacks pci_pm_*() will do all this for us. Now__e1000_shutdown()switches to D3-state only quad-port adapters, because they needs quirk for clearing false-positive error from downsteam pci-e port.
pci_save_state()now called after clearing bus-master bit, thus__e1000_resume()ande1000_io_slot_reset()must set it back after restoring configuration space.This patch set
get_link_statusbefore callingpm_runtime_put()ine1000_open()to allowe1000_idle()get real link status and schedule first runtime suspend.This patch also enables wakeup for device if management mode is enabled (like for WoL) as result
pci_prepare_to_sleep()would setup wakeup without special actions like custom 'enable_wakeup' sign.Cc Bruce Allan<[email protected]>Signed-off-by Konstantin Khlebnikov<[email protected]>Acked-by Rafael J. Wysocki<[email protected]>Tested-by Borislav Petkov<[email protected]>Tested-by Aaron Brown<[email protected]>Signed-off-by Jeff Kirsher<[email protected]>Signed-off-by Steven Rostedt<[email protected]>
Steven Rostedt
maintainerRe: [ 094/136 ] e1000e: fix runtime power management transitions
Quoted 2 lines · Jeff Kirsher
Drop it from the release please.
Will do, thanks.
-- Steve
Steven Rostedt
maintainerPATCH 95/136 xhci: Dont warn on empty ring for suspended devices.
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Sarah Sharp <[email protected]>
[ Upstream commit a83d6755814e4614ba77e15d82796af0f695c6b8 ]
When a device attached to the roothub is suspended, the endpoint rings are stopped. The host may generate a completion event with the completion code set to 'Stopped' or 'Stopped Invalid' when the ring is halted. The current xHCI code prints a warning in that case, which can be really annoying if the USB device is coming into and out of suspend.
Remove the unnecessary warning.
--- drivers/usb/host/xhci-ring.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
drivers/usb/host/xhci-ring.c +15 -8
@@ -2450,14 +2450,21 @@ static int handle_tx_event(struct xhci_hcd *xhci,* TD list. */ if (list_empty (&ep_ring->td_list)) { -xhci_warn (xhci,"WARN Event TRB for slot %d ep %d " -"with no TDs queued?\n" , -TRB_TO_SLOT_ID (le32_to_cpu (event->flags)), - ep_index); -xhci_dbg (xhci,"Event TRB with TRB type ID %u\n" , - (le32_to_cpu (event->flags) & -TRB_TYPE_BITMASK )>>10 ); -xhci_print_trb_offsets (xhci, (union xhci_trb *) event); +/* +* A stopped endpoint may generate an extra completion +* event if the device was suspended. Don't print +* warnings. +*/ +if (!(trb_comp_code ==COMP_STOP || + trb_comp_code ==COMP_STOP_INVAL )) { +xhci_warn (xhci,"WARN Event TRB for slot %d ep %d with no TDs queued?\n" , +TRB_TO_SLOT_ID (le32_to_cpu (event->flags)), + ep_index); +xhci_dbg (xhci,"Event TRB with TRB type ID %u\n" , + (le32_to_cpu (event->flags) & +TRB_TYPE_BITMASK )>>10 ); +xhci_print_trb_offsets (xhci, (union xhci_trb *) event); + }if (ep->skip) { ep->skip = false; xhci_dbg(xhci, "td_list is empty while skip "
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 96/136 ipvs: ip_vs_sip_fill_param() BUG: bad check of return value
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Hans Schillstrom <[email protected]>
[ Upstream commit f7a1dd6e3ad59f0cfd51da29dfdbfd54122c5916 ]
The reason for this patch is crash in kmemdup caused by returning from get_callid with uniialized matchoff and matchlen.
Removing Zero check of matchlen since it's done by ct_sip_get_header()
BUG: unable to handle kernel paging request at ffff880457b5763f IP: [<ffffffff810df7fc>] kmemdup+0x2e/0x35 PGD 27f6067 PUD 0 Oops: 0000 [#1] PREEMPT SMP Modules linked in: xt_state xt_helper nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_mangle xt_connmark xt_conntrack ip6_tables nf_conntrack_ftp ip_vs_ftp nf_nat xt_tcpudp iptable_mangle xt_mark ip_tables x_tables ip_vs_rr ip_vs_lblcr ip_vs_pe_sip ip_vs nf_conntrack_sip nf_conntrack bonding igb i2c_algo_bit i2c_core CPU 5 Pid: 0, comm: swapper/5 Not tainted 3.9.0-rc5+ #5 /S1200KP RIP: 0010:[<ffffffff810df7fc>] [<ffffffff810df7fc>] kmemdup+0x2e/0x35 RSP: 0018:ffff8803fea03648 EFLAGS: 00010282 RAX: ffff8803d61063e0 RBX: 0000000000000003 RCX: 0000000000000003 RDX: 0000000000000003 RSI: ffff880457b5763f RDI: ffff8803d61063e0 RBP: ffff8803fea03658 R08: 0000000000000008 R09: 0000000000000011 R10: 0000000000000011 R11: 00ffffffff81a8a3 R12: ffff880457b5763f R13: ffff8803d67f786a R14: ffff8803fea03730 R15: ffffffffa0098e90 FS: 0000000000000000(0000) GS:ffff8803fea00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff880457b5763f CR3: 0000000001a0c000 CR4: 00000000001407e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process swapper/5 (pid: 0, threadinfo ffff8803ee18c000, task ffff8803ee18a480) Stack: ffff8803d822a080 000000000000001c ffff8803fea036c8 ffffffffa000937a ffffffff81f0d8a0 000000038135fdd5 ffff880300000014 ffff880300110000 ffffffff150118ac ffff8803d7e8a000 ffff88031e0118ac 0000000000000000 Call Trace: <IRQ> [<ffffffffa000937a>] ip_vs_sip_fill_param+0x13a/0x187 [ip_vs_pe_sip] [<ffffffffa007b209>] ip_vs_sched_persist+0x2c6/0x9c3 [ip_vs] [<ffffffff8107dc53>] ? __lock_acquire+0x677/0x1697 [<ffffffff8100972e>] ? native_sched_clock+0x3c/0x7d [<ffffffff8100972e>] ? native_sched_clock+0x3c/0x7d [<ffffffff810649bc>] ? sched_clock_cpu+0x43/0xcf [<ffffffffa007bb1e>] ip_vs_schedule+0x181/0x4ba [ip_vs]
...
--- net/netfilter/ipvs/ip_vs_pe_sip.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
net/netfilter/ipvs/ip_vs_pe_sip.c +1 -5
@@ -37,14 +37,10 @@ static int get_callid(const char *dptr, unsigned int dataoff,if (ret >0 )break ;if (!ret) -return 0 ; +return -EINVAL ; dataoff += *matchoff; } -/* Empty callid is useless */ -if (!*matchlen) -return -EINVAL ; -/* Too large is useless */ if (*matchlen >IP_VS_PEDATA_MAXLEN )return -EINVAL ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 97/136 netfilter: ipset: list:set: fix reference counter update
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Jozsef Kadlecsik <[email protected]>
[ Upstream commit 02f815cb6d3f57914228be84df9613ee5a01c2e6 ]
The last element can be replaced or pushed off and in both cases the reference counter must be updated.
--- net/netfilter/ipset/ip_set_list_set.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
net/netfilter/ipset/ip_set_list_set.c +7 -3
@@ -171,9 +171,13 @@ list_set_add(struct list_set *map, u32 i, ip_set_id_t id, {const struct set_elem *e =list_set_elem (map, i); -if (i == map->size -1 && e->id !=IPSET_INVALID_ID ) -/* Last element replaced: e.g. add new,before,last */ -ip_set_put_byindex (e->id); +if (e->id !=IPSET_INVALID_ID ) { +const struct set_elem *x =list_set_elem (map, map->size -1 ); + +/* Last element replaced or pushed off */ +if (x->id !=IPSET_INVALID_ID ) +ip_set_put_byindex (x->id); + }if (with_timeout (map->timeout))list_elem_tadd (map, i, id,ip_set_timeout_set (timeout));else
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 98/136 netfilter: nf_ct_sip: dont drop packets with offsets pointing outside the packet
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Patrick McHardy <[email protected]>
[ Upstream commit 3a7b21eaf4fb3c971bdb47a98f570550ddfe4471 ]
Some Cisco phones create huge messages that are spread over multiple packets. After calculating the offset of the SIP body, it is validated to be within the packet and the packet is dropped otherwise. This breaks operation of these phones. Since connection tracking is supposed to be passive, just let those packets pass unmodified and untracked.
--- net/netfilter/nf_conntrack_sip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nf_conntrack_sip.c +1 -1
@@ -1521,7 +1521,7 @@ static int sip_help_tcp(struct sk_buff *skb, unsigned int protoff, msglen = origlen = end - dptr;if (msglen > datalen) -return NF_DROP ; +return NF_ACCEPT ; ret =process_sip_msg (skb, ct, dataoff, &dptr, &msglen);if (ret !=NF_ACCEPT )
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 99/136 netfilter: ipset: "Directory not empty" error message
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Jozsef Kadlecsik <[email protected]>
[ Upstream commit dd82088dab3646ed28e4aa43d1a5b5d5ffc2afba ]
When an entry flagged with "nomatch" was tested by ipset, it returned the error message "Kernel error received:
Directory not empty" instead of "<element> is NOT in set <setname>" (reported by John Brendler).
The internal error code was not properly transformed before returning to userspace, fixed.
--- net/netfilter/ipset/ip_set_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/netfilter/ipset/ip_set_core.c +2 -1
@@ -1387,7 +1387,8 @@ ip_set_utest(struct sock *ctnl, struct sk_buff *skb,if (ret == -EAGAIN ) ret =1 ; -return ret <0 ? ret : ret >0 ?0 : -IPSET_ERR_EXIST ; +return (ret <0 && ret != -ENOTEMPTY ) ? ret : + ret >0 ?0 : -IPSET_ERR_EXIST ; }/* Get headed data of a set */
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 100/136 netfilter: nf_ct_helper: dont discard helper if it is actually the same
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Florian Westphal <[email protected]>
[ Upstream commit 6e2f0aa8cf8892868bf2c19349cb5d7c407f690d ]
commit (32f5376 netfilter: nf_ct_helper: disable automatic helper re-assignment of different type) broke transparent proxy scenarios.
For example, initial helper lookup might yield "ftp" (dport 21), while re-lookup after REDIRECT yields "ftp-2121".
This causes the autoassign code to toss the ftp helper, even though these are just different instances of the same helper.
Change the test to check for the helper function address instead of the helper address, as suggested by Pablo.
--- net/netfilter/nf_conntrack_helper.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/netfilter/nf_conntrack_helper.c +3 -1
@@ -232,7 +232,9 @@ int __nf_ct_try_assign_helper(struct nf_conn *ct, struct nf_conn *tmpl,/* We only allow helper re-assignment of the same sort since * we cannot reallocate the helper extension area. */ -if (help->helper != helper) { +struct nf_conntrack_helper *tmp =rcu_dereference (help->helper); + +if (tmp && tmp->help != helper->help) {RCU_INIT_POINTER (help->helper,NULL ); goto out; }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 101/136 netfilter: ctnetlink: dont permit ct creation with random tuple
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Florian Westphal <[email protected]>
[ Upstream commit 442fad9423b78319e0019a7f5047eddf3317afbc ]
Userspace can cause kernel panic by not specifying orig/reply
tuple: kernel will create a tuple with random stack values.
Problem is that tuple.dst.dir will be random, too, which causes nf_ct_tuplehash_to_ctrack() to return garbage.
--- net/netfilter/nf_conntrack_netlink.c | 3 +++ 1 file changed, 3 insertions(+)
net/netfilter/nf_conntrack_netlink.c +3 -0
@@ -1579,6 +1579,9 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb,if (nlh->nlmsg_flags &NLM_F_CREATE ) {enum ip_conntrack_events events; +if (!cda[CTA_TUPLE_ORIG ] || !cda[CTA_TUPLE_REPLY ]) +return -EINVAL ; + ct =ctnetlink_create_conntrack (net, zone, cda, &otuple, &rtuple, u3);if (IS_ERR (ct))
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 102/136 netfilter: xt_rpfilter: skip locally generated broadcast/multicast, too
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Florian Westphal <[email protected]>
[ Upstream commit f83a7ea2075ca896f2dbf07672bac9cf3682ff74 ]
Alex Efros reported rpfilter module doesn't match following packets:
IN=br.qemu SRC=192.168.2.1 DST=192.168.2.255 [ .. ] (netfilter bugzilla #814).
Problem is that network stack arranges for the locally generated broadcasts to appear on the interface they were sent out, so the IFF_LOOPBACK check doesn't trigger.
As -m rpfilter is restricted to PREROUTING, we can check for existing rtable instead, it catches locally-generated broad/multicast case, too.
--- net/ipv4/netfilter/ipt_rpfilter.c | 8 +++++++- net/ipv6/netfilter/ip6t_rpfilter.c | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-)
net/ipv4/netfilter/ipt_rpfilter.c +7 -1
@@ -66,6 +66,12 @@ static bool rpfilter_lookup_reverse(struct flowi4 *fl4,return dev_match; } +static bool rpfilter_is_local (const struct sk_buff *skb) +{ +const struct rtable *rt =skb_rtable (skb); +return rt && (rt->rt_flags &RTCF_LOCAL ); +} +static bool rpfilter_mt (const struct sk_buff *skb,struct xt_action_param *par) {const struct xt_rpfilter_info *info;
@@ -76,7 +82,7 @@ static bool rpfilter_mt(const struct sk_buff *skb, struct xt_action_param *par) info = par->matchinfo; invert = info->flags &XT_RPFILTER_INVERT ; -if (par->in->flags &IFF_LOOPBACK ) +if (rpfilter_is_local (skb))return true ^ invert; iph =ip_hdr (skb);
net/ipv6/netfilter/ip6t_rpfilter.c +7 -1
@@ -71,6 +71,12 @@ static bool rpfilter_lookup_reverse6(const struct sk_buff *skb,return ret; } +static bool rpfilter_is_local (const struct sk_buff *skb) +{ +const struct rt6_info *rt = (const void *)skb_dst (skb); +return rt && (rt->rt6i_flags &RTF_LOCAL ); +} +static bool rpfilter_mt (const struct sk_buff *skb,struct xt_action_param *par) {const struct xt_rpfilter_info *info = par->matchinfo;
@@ -78,7 +84,7 @@ static bool rpfilter_mt(const struct sk_buff *skb, struct xt_action_param *par)struct ipv6hdr *iph;bool invert = info->flags &XT_RPFILTER_INVERT ; -if (par->in->flags &IFF_LOOPBACK ) +if (rpfilter_is_local (skb))return true ^ invert; iph =ipv6_hdr (skb);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 103/136 ext4: add check for inodes_count overflow in new resize ioctl
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Theodore Ts'o <[email protected]>
[ Upstream commit 3f8a6411fbada1fa482276591e037f3b1adcf55b ]
Addresses-Red-Hat-Bugzilla: #913245
--- fs/ext4/resize.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/ext4/resize.c +4 -0
@@ -1680,6 +1680,10 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count)return 0 ;ext4_get_group_no_and_offset (sb, n_blocks_count -1 , &n_group, &offset); +if (n_group > (0xFFFFFFFFUL /EXT4_INODES_PER_GROUP (sb))) { +ext4_warning (sb,"resize would cause inodes_count overflow" ); +return -EINVAL ; + }ext4_get_group_no_and_offset (sb, o_blocks_count -1 , &o_group, &offset); n_desc_blocks = (n_group + EXT4_DESC_PER_BLOCK(sb)) /
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 104/136 r8169: fix 8168evl frame padding.
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Stefan Bader <[email protected]>
[ Upstream commit e5195c1f31f399289347e043d6abf3ffa80f0005 ]
--- drivers/net/ethernet/realtek/r8169.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/net/ethernet/realtek/r8169.c +9 -0
@@ -5806,6 +5806,14 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb, goto err_stop_0; } +/* 8168evl does not automatically pad to minimum length. */ +if (unlikely (tp->mac_version ==RTL_GIGA_MAC_VER_34 && + skb->len <ETH_ZLEN )) { +if (skb_padto (skb,ETH_ZLEN )) + goto err_update_stats; +skb_put (skb,ETH_ZLEN - skb->len); + } +if (unlikely (le32_to_cpu (txd->opts1) & DescOwn)) goto err_stop_0;
@@ -5877,6 +5885,7 @@ err_dma_1:rtl8169_unmap_tx_skb (d, tp->tx_skb + entry, txd); err_dma_0:dev_kfree_skb (skb); +err_update_stats: dev->stats.tx_dropped++;return NETDEV_TX_OK ;
Signature · 1 line
1.7.10.4
Re: [ 104/136 ] r8169: fix 8168evl frame padding.
Steven Rostedt <[email protected]> :
Quoted 2 lines
3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
You should postpone it until the fix for a regression it induces when user enable Tx checksumming is merged.
Signature · 1 line
Ueimor
Steven Rostedt
maintainerRe: [ 104/136 ] r8169: fix 8168evl frame padding.
Quoted 7 lines · Francois Romieu
Steven Rostedt <[email protected]> :
Quoted 2 lines
3.6.11.4 stable review patch.
If anyone has any objections, please let me know.You should postpone it until the fix for a regression it induces when user enable Tx checksumming is merged.
What do you mean? This has already been incorporated into 3.2, 3.4, 3.8, and 3.9 stable trees. Or has it just been recently found that this introduces a regression?
I can pull this out for this release.
(this was upstream commit: e5195c1f31f399289347e043d6abf3ffa80f0005)
Thanks,
-- Steve
David Miller
maintainerRe: [ 104/136 ] r8169: fix 8168evl frame padding.
From: Steven Rostedt <[email protected]>
Date: Mon, 20 May 2013 15:40:44 -0400
Quoted 9 lines · Francois Romieu
Quoted 7 lines
Steven Rostedt <[email protected]> :
Quoted 2 lines
3.6.11.4 stable review patch.
If anyone has any objections, please let me know.You should postpone it until the fix for a regression it induces when user enable Tx checksumming is merged.
Quoted 7 lines
What do you mean? This has already been incorporated into 3.2, 3.4, 3.8, and 3.9 stable trees. Or has it just been recently found that this introduces a regression?
I can pull this out for this release.
(this was upstream commit:
e5195c1f31f399289347e043d6abf3ffa80f0005)
This patch causes a new regression, which is only fixed in my 'net' tree at this time.
Steven Rostedt
maintainerRe: [ 104/136 ] r8169: fix 8168evl frame padding.
Quoted 16 lines · David Miller
From: Steven Rostedt <[email protected]>
Date: Mon, 20 May 2013 15:40:44 -0400Quoted 13 lines · Francois Romieu
Quoted 7 lines
Steven Rostedt <[email protected]> :
Quoted 2 lines
3.6.11.4 stable review patch.
If anyone has any objections, please let me know.You should postpone it until the fix for a regression it induces when user enable Tx checksumming is merged.
What do you mean? This has already been incorporated into 3.2, 3.4, 3.8, and 3.9 stable trees. Or has it just been recently found that this introduces a regression?
Quoted 6 lines
Quoted 3 lines
I can pull this out for this release.
(this was upstream commit:
e5195c1f31f399289347e043d6abf3ffa80f0005)This patch causes a new regression, which is only fixed in my 'net' tree at this time.
Thanks for the quick response. I'll drop it from 3.6.11.4.
-- Steve
Steven Rostedt
maintainerRe: [ 104/136 ] r8169: fix 8168evl frame padding.
In reply to Francois RomieuQuoted 7 lines · Francois Romieu
Steven Rostedt <[email protected]> :
Quoted 2 lines
3.6.11.4 stable review patch.
If anyone has any objections, please let me know.You should postpone it until the fix for a regression it induces when user enable Tx checksumming is merged.
I'm working on 3.6.11.5. Has the fix for the regression been pulled into mainline yet, and if so, what's the commit SHA1?
Thanks,
-- Steve
Re: [ 104/136 ] r8169: fix 8168evl frame padding.
Steven Rostedt <[email protected]> :
[...]
Quoted 2 lines
I'm working on 3.6.11.5. Has the fix for the regression been pulled into mainline yet, and if so, what's the commit SHA1?
It's in mainline as b423e9ae49d78ea3f53b131c8d5a6087aed16fd6 but davem has not sent it into -stable yet.
Signature · 1 line
Ueimor
Steven Rostedt
maintainerRe: [ 104/136 ] r8169: fix 8168evl frame padding.
Quoted 8 lines · Francois Romieu
Steven Rostedt <[email protected]> :
[...]Quoted 2 lines
I'm working on 3.6.11.5. Has the fix for the regression been pulled into mainline yet, and if so, what's the commit SHA1?
It's in mainline as
b423e9ae49d78ea3f53b131c8d5a6087aed16fd6but davem has not sent it into -stable yet.
Thanks! I'll keep a look out for when it arrives in stable.
-- Steve
Steven Rostedt
maintainerPATCH 105/136 drm/cirrus: deal with bo reserve fail in dirty update path
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Dave Airlie <[email protected]>
[ Upstream commit f3b2bbdc8a87a080ccd23d27fca4b87d61340dd4 ]
Port over the mgag200 fix to cirrus as it suffers the same issue.
On F19 testing, it was noticed we get a lot of errors in dmesg about being unable to reserve the buffer when plymouth starts, this is due to the buffer being in the process of migrating, so it makes sense we can't reserve it.
In order to deal with it, this adds delayed updates for the dirty updates, when the bo is unreservable, in the normal console case this shouldn't ever happen, its just when plymouth or X is pushing the console bo to system memory.
--- drivers/gpu/drm/cirrus/cirrus_drv.h | 2 ++ drivers/gpu/drm/cirrus/cirrus_fbdev.c | 38 ++++++++++++++++++++++++++++++++- drivers/gpu/drm/cirrus/cirrus_ttm.c | 2 +- 3 files changed, 40 insertions(+), 2 deletions(-)
drivers/gpu/drm/cirrus/cirrus_drv.h +2 -0
@@ -155,6 +155,8 @@ struct cirrus_fbdev {struct list_head fbdev_list;void *sysram;int size; +int x1, y1, x2, y2;/* dirty rect */ +spinlock_t dirty_lock; };struct cirrus_bo {
drivers/gpu/drm/cirrus/cirrus_fbdev.c +37 -1
@@ -27,16 +27,51 @@ static void cirrus_dirty_update(struct cirrus_fbdev *afbdev,int bpp = (afbdev->gfb.base.bits_per_pixel +7 )/8 ;int ret;bool unmap = false; +bool store_for_later = false; +int x2, y2; +unsigned long flags; obj = afbdev->gfb.obj; bo =gem_to_cirrus_bo (obj); +/* +* try and reserve the BO, if we fail with busy +* then the BO is being moved and we should +* store up the damage until later. +*/ ret =cirrus_bo_reserve (bo, true);if (ret) { -DRM_ERROR ("failed to reserve fb bo\n" ); +if (ret != -EBUSY ) +return ; + store_for_later = true; + } + + x2 = x + width -1 ; + y2 = y + height -1 ; +spin_lock_irqsave (&afbdev->dirty_lock, flags); + +if (afbdev->y1 < y) + y = afbdev->y1; +if (afbdev->y2 > y2) + y2 = afbdev->y2; +if (afbdev->x1 < x) + x = afbdev->x1; +if (afbdev->x2 > x2) + x2 = afbdev->x2; + +if (store_for_later) { + afbdev->x1 = x; + afbdev->x2 = x2; + afbdev->y1 = y; + afbdev->y2 = y2; +spin_unlock_irqrestore (&afbdev->dirty_lock, flags);return ; } + afbdev->x1 = afbdev->y1 =INT_MAX ; + afbdev->x2 = afbdev->y2 =0 ; +spin_unlock_irqrestore (&afbdev->dirty_lock, flags); +if (!bo->kmap.virtual) { ret =ttm_bo_kmap (&bo->bo,0 , bo->bo.num_pages, &bo->kmap);if (ret) {
@@ -283,6 +318,7 @@ int cirrus_fbdev_init(struct cirrus_device *cdev) cdev->mode_info.gfbdev = gfbdev; gfbdev->helper.funcs = &cirrus_fb_helper_funcs; +spin_lock_init (&gfbdev->dirty_lock); ret =drm_fb_helper_init (cdev->dev, &gfbdev->helper, cdev->num_crtc,CIRRUSFB_CONN_LIMIT );
drivers/gpu/drm/cirrus/cirrus_ttm.c +1 -1
@@ -321,7 +321,7 @@ int cirrus_bo_reserve(struct cirrus_bo *bo, bool no_wait) ret =ttm_bo_reserve (&bo->bo, true, no_wait, false,0 );if (ret) { -if (ret != -ERESTARTSYS ) +if (ret != -ERESTARTSYS && ret != -EBUSY )DRM_ERROR ("reserve failed %p\n" , bo);return ret; }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 106/136 drm/mgag200: deal with bo reserve fail in dirty update path
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Dave Airlie <[email protected]>
[ Upstream commit 641719599528d806e00de8ae8c8453361266a312 ]
On F19 testing, it was noticed we get a lot of errors in dmesg about being unable to reserve the buffer when plymouth starts, this is due to the buffer being in the process of migrating, so it makes sense we can't reserve it.
In order to deal with it, this adds delayed updates for the dirty updates, when the bo is unreservable, in the normal console case this shouldn't ever happen, its just when plymouth or X is pushing the console bo to system memory.
--- drivers/gpu/drm/mgag200/mgag200_drv.h | 2 ++ drivers/gpu/drm/mgag200/mgag200_fb.c | 43 ++++++++++++++++++++++++++++++--- drivers/gpu/drm/mgag200/mgag200_ttm.c | 4 +-- 3 files changed, 44 insertions(+), 5 deletions(-)
drivers/gpu/drm/mgag200/mgag200_drv.h +2 -0
@@ -116,6 +116,8 @@ struct mga_fbdev {void *sysram;int size;struct ttm_bo_kmap_obj mapping; +int x1, y1, x2, y2;/* dirty rect */ +spinlock_t dirty_lock; };struct mga_crtc {
drivers/gpu/drm/mgag200/mgag200_fb.c +40 -3
72 lines not on this page · raw message
drivers/gpu/drm/mgag200/mgag200_ttm.c +2 -2
@@ -315,8 +315,8 @@ int mgag200_bo_reserve(struct mgag200_bo *bo, bool no_wait) ret =ttm_bo_reserve (&bo->bo, true, no_wait, false,0 );if (ret) { -if (ret != -ERESTARTSYS ) -DRM_ERROR ("reserve failed %p\n" , bo); +if (ret != -ERESTARTSYS && ret != -EBUSY ) +DRM_ERROR ("reserve failed %p %d\n" , bo, ret);return ret; }return 0 ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 107/136 drm/gma500: fix backlight hotkeys behaviour on netbooks
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Anisse Astier <[email protected]>
[ Upstream commit e127dc28cc3057575da0216cde85687153ca180f ]
Backlight hotkeys weren't working before on certain cedartrail laptops.
The source of this problem is that the hotkeys' ASLE opregion interrupts were simply ignored. Driver seemed to expect the interrupt to be associated with a pipe, but it wasn't.
Accepting the ASLE interrupt without an associated pipe event flag fixes the issue, the backlight code is called when needed, making the brightness keys work properly.
[patrik: This patch affects irq handling on any netbook with opregion support]
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=833597
Reference: http://lists.freedesktop.org/archives/dri-devel/2012-July/025279.html
--- drivers/gpu/drm/gma500/psb_irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/gma500/psb_irq.c +1 -1
@@ -211,7 +211,7 @@ irqreturn_t psb_irq_handler(DRM_IRQ_ARGS) vdc_stat =PSB_RVDC32 (PSB_INT_IDENTITY_R ); -if (vdc_stat & _PSB_PIPE_EVENT_FLAG) +if (vdc_stat & (_PSB_PIPE_EVENT_FLAG|_PSB_IRQ_ASLE)) dsp_int =1 ;/* FIXME: Handle Medfield
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 108/136 drm/prime: keep a reference from the handle to exported dma-buf (v6)
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Dave Airlie <[email protected]>
[ Upstream commit 219b47339ced80ca580bb6ce7d1636166984afa7 ]
Currently we have a problem with this:
1. i915: create gem object
2. i915: export gem object to prime
3. radeon: import gem object
4. close prime fd
5. radeon: unref object
6. i915: unref object
i915 has an imported object reference in its file priv, that isn't cleaned up properly until fd close. The reference gets added at step 2, but at step 6 we don't have enough info to clean it up.
The solution is to take a reference on the dma-buf when we export it, and drop the reference when the gem handle goes away.
So when we export a dma_buf from a gem object, we keep track of it with the handle, we take a reference to the dma_buf. When we close the handle (i.e. userspace is finished with the buffer), we drop the reference to the dma_buf, and it gets collected.
This patch isn't meant to fix any other problem or bikesheds, and it doesn't fix any races with other scenarios.
v1.1: move export symbol line back up.
v2: okay I had to do a bit more, as the first patch showed a leak on one of my tests, that I found using the dma-buf debugfs support, the problem case is exporting a buffer twice with the same handle, we'd add another export handle for it unnecessarily, however
we now fail if we try to export the same object with a different gem handle, however I'm not sure if that is a case I want to support, and I've gotten the code to WARN_ON if we hit something like that.
v2.1: rebase this patch, write better commit msg.
v3: cleanup error handling, track import vs export in linked list, these two patches were separate previously, but seem to work better like this.
v4: danvet is correct, this code is no longer useful, since the buffer better exist, so remove it.
v5: always take a reference to the dma buf object, import or export. (Imre Deak contributed this originally)
v6: square the circle, remove import vs export tracking now that there is no difference
--- drivers/gpu/drm/drm_gem.c | 4 +-- drivers/gpu/drm/drm_prime.c | 76 +++++++++++++++++++++++-------------------- include/drm/drmP.h | 5 ++- 3 files changed, 44 insertions(+), 41 deletions(-)
drivers/gpu/drm/drm_gem.c +2 -2
@@ -205,11 +205,11 @@ static void drm_gem_remove_prime_handles(struct drm_gem_object *obj, struct drm_file *filp) {if (obj->import_attach) { -drm_prime_remove_imported_buf_handle (&filp->prime, +drm_prime_remove_buf_handle (&filp->prime, obj->import_attach->dmabuf); }if (obj->export_dma_buf) { -drm_prime_remove_imported_buf_handle (&filp->prime, +drm_prime_remove_buf_handle (&filp->prime, obj->export_dma_buf); } }
drivers/gpu/drm/drm_prime.c +40 -36
150 lines not on this page · raw message
include/drm/drmP.h +2 -3
@@ -1554,9 +1554,8 @@ extern void drm_prime_gem_destroy(struct drm_gem_object *obj, struct sg_table *svoid drm_prime_init_file_private (struct drm_prime_file_private *prime_fpriv);void drm_prime_destroy_file_private (struct drm_prime_file_private *prime_fpriv); -int drm_prime_add_imported_buf_handle (struct drm_prime_file_private *prime_fpriv,struct dma_buf *dma_buf,uint32_t handle); -int drm_prime_lookup_imported_buf_handle (struct drm_prime_file_private *prime_fpriv,struct dma_buf *dma_buf,uint32_t *handle); -void drm_prime_remove_imported_buf_handle (struct drm_prime_file_private *prime_fpriv,struct dma_buf *dma_buf); +int drm_prime_lookup_buf_handle (struct drm_prime_file_private *prime_fpriv,struct dma_buf *dma_buf,uint32_t *handle); +void drm_prime_remove_buf_handle (struct drm_prime_file_private *prime_fpriv,struct dma_buf *dma_buf);int drm_prime_add_dma_buf (struct drm_device *dev,struct drm_gem_object *obj); int drm_prime_lookup_obj(struct drm_device *dev, struct dma_buf *buf,
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 109/136 drm/ast: deal with bo reserve fail in dirty update path
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Dave Airlie <[email protected]>
[ Upstream commit 306373b645d80625335b8e684fa09b14ba460cec ]
Port over the mgag200 fix to ast as it suffers the same issue.
On F19 testing, it was noticed we get a lot of errors in dmesg about being unable to reserve the buffer when plymouth starts, this is due to the buffer being in the process of migrating, so it makes sense we can't reserve it.
In order to deal with it, this adds delayed updates for the dirty updates, when the bo is unreservable, in the normal console case this shouldn't ever happen, its just when plymouth or X is pushing the console bo to system memory.
--- drivers/gpu/drm/ast/ast_drv.h | 2 ++ drivers/gpu/drm/ast/ast_fb.c | 43 ++++++++++++++++++++++++++++++++++++++--- drivers/gpu/drm/ast/ast_ttm.c | 2 +- 3 files changed, 43 insertions(+), 4 deletions(-)
drivers/gpu/drm/ast/ast_drv.h +2 -0
@@ -240,6 +240,8 @@ struct ast_fbdev {void *sysram;int size;struct ttm_bo_kmap_obj mapping; +int x1, y1, x2, y2;/* dirty rect */ +spinlock_t dirty_lock; };#define to_ast_crtc (x) container_of(x, struct ast_crtc, base)
drivers/gpu/drm/ast/ast_fb.c +40 -3
72 lines not on this page · raw message
drivers/gpu/drm/ast/ast_ttm.c +1 -1
@@ -316,7 +316,7 @@ int ast_bo_reserve(struct ast_bo *bo, bool no_wait) ret =ttm_bo_reserve (&bo->bo, true, no_wait, false,0 );if (ret) { -if (ret != -ERESTARTSYS ) +if (ret != -ERESTARTSYS && ret != -EBUSY )DRM_ERROR ("reserve failed %p\n" , bo);return ret; }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 110/136 drm/i915: Fix detection of base of stolen memory
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Chris Wilson <[email protected]>
[ Upstream commit e12a2d53ae45a69aea499b64f75e7222cca0f12f ]
The routine to query the base of stolen memory was using the wrong registers and the wrong encodings on virtually every platform.
It was not until the G33 refresh, that a PCI config register was introduced that explicitly said where the stolen memory was. Prior to 865G there was not even a register that said where the end of usable low memory was and where the stolen memory began (or ended depending upon chipset). Before then, one has to look at the BIOS memory maps to find the Top of Memory. Alas that is not exported by arch/x86 and so we have to resort to disabling stolen memory on gen2 for the time being.
Then SandyBridge enlarged the PCI register to a full 32-bits and change the encoding of the address, so even though we happened to be querying the right register, we read the wrong bits and ended up using address 0 for our stolen data, i.e. notably FBC.
--- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_gem_stolen.c | 81 ++++++++++++++++---------------- 2 files changed, 42 insertions(+), 40 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +1 -0
@@ -672,6 +672,7 @@ typedef struct drm_i915_private {unsigned long gtt_start;unsigned long gtt_mappable_end;unsigned long gtt_end; +unsigned long stolen_base;/* limited to low memory (32-bit) */ struct io_mapping *gtt_mapping;phys_addr_t gtt_base_addr;
drivers/gpu/drm/i915/i915_gem_stolen.c +41 -40
124 lines not on this page · raw message
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 111/136 drm/i915: Add no-lvds quirk for Fujitsu Esprimo Q900
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Christian Lamparter <[email protected]>
[ Upstream commit 9e9dd0e889c76c786e8f2e164c825c3c06dea30c ]
The "Mobile Sandy Bridge CPUs" in the Fujitsu Esprimo Q900 mini desktop PCs are probably misleading the LVDS detection code in intel_lvds_supported. Nothing is connected to the LVDS ports in these systems.
--- drivers/gpu/drm/i915/intel_lvds.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/i915/intel_lvds.c +8 -0
@@ -796,6 +796,14 @@ static const struct dmi_system_id intel_no_lvds[] = { DMI_MATCH(DMI_PRODUCT_NAME, "X7SPA-H"), }, }, + { + .callback = intel_no_lvds_dmi_callback, + .ident = "Fujitsu Esprimo Q900", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), + DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO Q900"), + }, + }, { }/* terminating entry */ };
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 112/136 drm/i915: Workaround incoherence between fences and LLC across multiple CPUs
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Chris Wilson <[email protected]>
[ Upstream commit 25ff1195f8a0b3724541ae7bbe331b4296de9c06 ]
In order to fully serialize access to the fenced region and the update to the fence register we need to take extreme measures on SNB+, and manually flush writes to memory prior to writing the fence register in conjunction with the memory barriers placed around the register write.
Fixes i-g-t/gem_fence_thrash
v2: Bring a bigger gun
v3: Switch the bigger gun for heavier bullets (Arjan van de Ven)
v4: Remove changes for working generations.
v5: Reduce to a per-cpu wbinvd() call prior to updating the fences.
v6: Rewrite comments to ellide forgotten history.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62191
--- drivers/gpu/drm/i915/i915_gem.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +23 -5
@@ -2525,17 +2525,35 @@ static inline int fence_number(struct drm_i915_private *dev_priv,return fence - dev_priv->fence_regs; } +static void i915_gem_write_fence__ipi (void *data) +{ +wbinvd (); +} +static void i915_gem_object_update_fence (struct drm_i915_gem_object *obj,struct drm_i915_fence_reg *fence,bool enable) { -struct drm_i915_private *dev_priv = obj->base.dev->dev_private; -int reg =fence_number (dev_priv, fence); - -i915_gem_write_fence (obj->base.dev, reg, enable ? obj :NULL ); +struct drm_device *dev = obj->base.dev; +struct drm_i915_private *dev_priv = dev->dev_private; +int fence_reg =fence_number (dev_priv, fence); + +/* In order to fully serialize access to the fenced region and +* the update to the fence register we need to take extreme +* measures on SNB+. In theory, the write to the fence register +* flushes all memory transactions before, and coupled with the +* mb() placed around the register write we serialise all memory +* operations with respect to the changes in the tiler. Yet, on +* SNB+ we need to take a step further and emit an explicit wbinvd() +* on each processor in order to manually flush all memory +* transactions before updating the fence register. +*/ +if (HAS_LLC (obj->base.dev)) +on_each_cpu (i915_gem_write_fence__ipi,NULL ,1 ); +i915_gem_write_fence (dev, fence_reg, enable ? obj :NULL );if (enable) { - obj->fence_reg = reg; + obj->fence_reg = fence_reg; fence->obj = obj;list_move_tail (&fence->lru_list, &dev_priv->mm.fence_list); }else {
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 113/136 drm/i915: Use MLC (l3$) for context objects
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Chris Wilson <[email protected]>
[ Upstream commit 4615d4c9e27eda42c3e965f208a4b4065841498c ]
Enabling context support increases SwapBuffers latency by about 20% (measured on an i7-3720qm). We can offset that loss slightly by enabling faster caching for the contexts. As they are not backed by any particular cache (such as the sampler or render caches) our only option is to select the generic mid-level cache. This reduces the latency of the swap by about 5%.
Oddly this effect can be observed running smokin-guns on IVB at 1280x1024:
Using BLT copies for swaps: 151.67 fps
Using Render copies for swaps (unpatched): 141.70 fps With contexts disabled: 150.23 fps
With contexts in L3$: 150.77 fps
--- drivers/gpu/drm/i915/i915_gem_context.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/i915/i915_gem_context.c +7 -0
@@ -155,6 +155,13 @@ create_hw_context(struct drm_device *dev,return ERR_PTR (-ENOMEM ); } +if (INTEL_INFO (dev)->gen >=7 ) { + ret =i915_gem_object_set_cache_level (ctx->obj, +I915_CACHE_LLC_MLC ); +if (ret) + goto err_out; + } +/* The ring associated with the context object is handled by the normal * object tracking code. We give an initial ring value simple to pass an * assertion in the context switch code.
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 114/136 drm/i915: set CPT FDI RX polarity bits based on VBT
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Paulo Zanoni <[email protected]>
[ Upstream commit 3f704fa2778d3fe45e6529825a5c7a8bcbc686f4 ]
Check the VBT to see if the machine has inverted FDI RX polarity on CPT. Based on this bit, set the appropriate bit on the TRANS_CHICKEN2 registers.
This should fix some machines that were showing black screens on all outputs.
Cc: [email protected]
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60029
--- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_reg.h | 1 + drivers/gpu/drm/i915/intel_bios.c | 6 ++++-- drivers/gpu/drm/i915/intel_bios.h | 4 +++- drivers/gpu/drm/i915/intel_pm.c | 9 +++++++-- 5 files changed, 16 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +1 -0
@@ -464,6 +464,7 @@ typedef struct drm_i915_private { unsigned int int_crt_support:1; unsigned int lvds_use_ssc:1; unsigned int display_clock_mode:1; + unsigned int fdi_rx_polarity_inverted:1;int lvds_ssc_freq;unsigned int bios_lvds_val;/* initial [PCH_]LVDS reg val in VBIOS */ unsigned int lvds_val;/* used for checking LVDS channel mode */
drivers/gpu/drm/i915/i915_reg.h +1 -0
@@ -3758,6 +3758,7 @@#define _TRANSB_CHICKEN2 0xf1064#define TRANS_CHICKEN2 (pipe) _PIPE(pipe, _TRANSA_CHICKEN2, _TRANSB_CHICKEN2)#define TRANS_AUTOTRAIN_GEN_STALL_DIS (1<<31) +#define TRANS_CHICKEN2_FDI_POLARITY_REVERSED (1<<29)#define SOUTH_CHICKEN1 0xc2000#define FDIA_PHASE_SYNC_SHIFT_OVR 19
drivers/gpu/drm/i915/intel_bios.c +4 -2
@@ -352,12 +352,14 @@ parse_general_features(struct drm_i915_private *dev_priv, dev_priv->lvds_ssc_freq =intel_bios_ssc_frequency (dev, general->ssc_freq); dev_priv->display_clock_mode = general->display_clock_mode; -DRM_DEBUG_KMS ("BDB_GENERAL_FEATURES int_tv_support %d int_crt_support %d lvds_use_ssc %d lvds_ssc_freq %d display_clock_mode %d\n" , + dev_priv->fdi_rx_polarity_inverted = general->fdi_rx_polarity_inverted; +DRM_DEBUG_KMS ("BDB_GENERAL_FEATURES int_tv_support %d int_crt_support %d lvds_use_ssc %d lvds_ssc_freq %d display_clock_mode %d fdi_rx_polarity_inverted %d\n" , dev_priv->int_tv_support, dev_priv->int_crt_support, dev_priv->lvds_use_ssc, dev_priv->lvds_ssc_freq, - dev_priv->display_clock_mode); + dev_priv->display_clock_mode, + dev_priv->fdi_rx_polarity_inverted); } }
drivers/gpu/drm/i915/intel_bios.h +3 -1
@@ -127,7 +127,9 @@ struct bdb_general_features {/* bits 3 */ u8 disable_smooth_vision:1; u8 single_dvi:1; - u8 rsvd9:6; /* finish byte */ + u8 rsvd9:1; + u8 fdi_rx_polarity_inverted:1; + u8 rsvd10:4; /* finish byte *//* bits 4 */ u8 legacy_monitor_detect;
drivers/gpu/drm/i915/intel_pm.c +7 -2
@@ -3712,6 +3712,7 @@ static void cpt_init_clock_gating(struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;int pipe; +uint32_t val;/* * On Ibex Peak and Cougar Point, we need to disable clock
@@ -3722,8 +3723,12 @@ static void cpt_init_clock_gating(struct drm_device *dev)I915_WRITE (SOUTH_CHICKEN2 ,I915_READ (SOUTH_CHICKEN2 ) |DPLS_EDP_PPS_FIX_DIS );/* Without this, mode sets may fail silently on FDI */ -for_each_pipe (pipe) -I915_WRITE (TRANS_CHICKEN2 (pipe),TRANS_AUTOTRAIN_GEN_STALL_DIS ); +for_each_pipe (pipe) { + val =TRANS_AUTOTRAIN_GEN_STALL_DIS ; +if (dev_priv->fdi_rx_polarity_inverted) + val |=TRANS_CHICKEN2_FDI_POLARITY_REVERSED ; +I915_WRITE (TRANS_CHICKEN2 (pipe), val); + } }void intel_init_clock_gating (struct drm_device *dev)
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 115/136 drm/i915: Fall back to bit banging mode for DVO transmitter detection
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?"David=20M=C3=BCller=20(ELSOFT=20AG)"?= <[email protected]>
[ Upstream commit e4bfff54ed3f5de88f5358504c78c2cb037813aa ]
As discussed in this thread
http://lists.freedesktop.org/archives/dri-devel/2013-April/037411.html
GMBUS based DVO transmitter detection seems to be unreliable which could result in an unusable DVO port.
The attached patch fixes this by falling back to bit banging mode for the time DVO transmitter detection is in progress.
--- drivers/gpu/drm/i915/intel_dvo.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_dvo.c +12 -1
@@ -370,6 +370,7 @@ void intel_dvo_init(struct drm_device *dev)const struct intel_dvo_device *dvo = &intel_dvo_devices[i];struct i2c_adapter *i2c;int gpio; +bool dvoinit;/* Allow the I2C driver info to specify the GPIO to be used in * special cases, but otherwise default to what's defined
@@ -389,7 +390,17 @@ void intel_dvo_init(struct drm_device *dev) i2c =intel_gmbus_get_adapter (dev_priv, gpio); intel_dvo->dev = *dvo; -if (!dvo->dev_ops->init (&intel_dvo->dev, i2c)) + +/* GMBUS NAK handling seems to be unstable, hence let the +* transmitter detection run in bit banging mode for now. +*/ +intel_gmbus_force_bit (i2c, true); + + dvoinit = dvo->dev_ops->init (&intel_dvo->dev, i2c); + +intel_gmbus_force_bit (i2c, false); + +if (!dvoinit)continue ; intel_encoder->type =INTEL_OUTPUT_DVO ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 116/136 drm/radeon: dont use get_engine_clock() on APUs
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
[ Upstream commit bf05d9985111f85ed6922c134567b96eb789283b ]
It doesn't work reliably. Just report back the currently selected engine clock.
Partially fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=62493
--- drivers/gpu/drm/radeon/radeon_pm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_pm.c +5 -1
@@ -856,7 +856,11 @@ static int radeon_debugfs_pm_info(struct seq_file *m, void *data)struct radeon_device *rdev = dev->dev_private;seq_printf (m,"default engine clock: %u0 kHz\n" , rdev->pm.default_sclk); -seq_printf (m,"current engine clock: %u0 kHz\n" ,radeon_get_engine_clock (rdev)); +/* radeon_get_engine_clock is not reliable on APUs so just print the current clock */ +if ((rdev->family >=CHIP_PALM ) && (rdev->flags &RADEON_IS_IGP )) +seq_printf (m,"current engine clock: %u0 kHz\n" , rdev->pm.current_sclk); +else +seq_printf (m,"current engine clock: %u0 kHz\n" ,radeon_get_engine_clock (rdev));seq_printf (m,"default memory clock: %u0 kHz\n" , rdev->pm.default_mclk);if (rdev->asic->pm.get_memory_clock)seq_printf (m,"current memory clock: %u0 kHz\n" ,radeon_get_memory_clock (rdev));
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 117/136 drm/radeon: use frac fb div on RS780/RS880
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
[ Upstream commit 411678288d61ba17afe1f8afed92200be6bbc65d ]
Monitors seem to prefer it. Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=37696
--- drivers/gpu/drm/radeon/atombios_crtc.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/radeon/atombios_crtc.c +3 -0
@@ -569,6 +569,9 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,/* use frac fb div on APUs */ if (ASIC_IS_DCE41 (rdev) ||ASIC_IS_DCE61 (rdev)) pll->flags |=RADEON_PLL_USE_FRAC_FB_DIV ; +/* use frac fb div on RS780/RS880 */ +if ((rdev->family ==CHIP_RS780 ) || (rdev->family ==CHIP_RS880 )) + pll->flags |=RADEON_PLL_USE_FRAC_FB_DIV ; }else { pll->flags |=RADEON_PLL_LEGACY ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 118/136 drm/radeon/dce6: add missing display reg for tiling setup
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
[ Upstream commit 7c1c7c18fc752b2a1d07597286467ef186312463 ]
A new tiling config register for the display blocks was added on DCE6.
May fix:
https://bugs.freedesktop.org/show_bug.cgi?id=62889
https://bugs.freedesktop.org/show_bug.cgi?id=57919
--- drivers/gpu/drm/radeon/ni.c | 2 ++ drivers/gpu/drm/radeon/nid.h | 4 ++++ drivers/gpu/drm/radeon/si.c | 1 + drivers/gpu/drm/radeon/sid.h | 2 ++ 4 files changed, 9 insertions(+)
drivers/gpu/drm/radeon/ni.c +2 -0
@@ -619,6 +619,8 @@ static void cayman_gpu_init(struct radeon_device *rdev)WREG32 (GB_ADDR_CONFIG , gb_addr_config);WREG32 (DMIF_ADDR_CONFIG , gb_addr_config); +if (ASIC_IS_DCE6 (rdev)) +WREG32 (DMIF_ADDR_CALC , gb_addr_config);WREG32 (HDP_ADDR_CONFIG , gb_addr_config); tmp = gb_addr_config &NUM_PIPES_MASK ;
drivers/gpu/drm/radeon/nid.h +4 -0
@@ -45,6 +45,10 @@#define ARUBA_GB_ADDR_CONFIG_GOLDEN 0x12010001#define DMIF_ADDR_CONFIG 0xBD4 + +/* DCE6 only */ +#define DMIF_ADDR_CALC 0xC00 +#define SRBM_GFX_CNTL 0x0E44#define RINGID (x) (((x) & 0x3) << 0)#define VMID (x) (((x) & 0x7) << 0)
drivers/gpu/drm/radeon/si.c +1 -0
@@ -1659,6 +1659,7 @@ static void si_gpu_init(struct radeon_device *rdev)WREG32 (GB_ADDR_CONFIG , gb_addr_config);WREG32 (DMIF_ADDR_CONFIG , gb_addr_config); +WREG32 (DMIF_ADDR_CALC , gb_addr_config);WREG32 (HDP_ADDR_CONFIG , gb_addr_config);si_tiling_mode_table_init (rdev);
drivers/gpu/drm/radeon/sid.h +2 -0
@@ -60,6 +60,8 @@#define DMIF_ADDR_CONFIG 0xBD4 +#define DMIF_ADDR_CALC 0xC00 +#define SRBM_STATUS 0xE50#define CC_SYS_RB_BACKEND_DISABLE 0xe80
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 119/136 drm/radeon: update wait_for_vblank for r5xx-r7xx
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
[ Upstream commit bea5497bfc1067620c8c8e9d37a42e0bb6d7d7fa ]
Properly wait for the next vblank region. The previous code didn't always wait long enough depending on the timing.
--- drivers/gpu/drm/radeon/rs600.c | 54 ++++++++++++++++++++++++++++++++++------ 1 file changed, 47 insertions(+), 7 deletions(-)
drivers/gpu/drm/radeon/rs600.c +47 -7
@@ -46,21 +46,61 @@void rs600_gpu_init (struct radeon_device *rdev);int rs600_mc_wait_for_idle (struct radeon_device *rdev); +static bool avivo_is_in_vblank (struct radeon_device *rdev,int crtc) +{ +struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc]; + +if (RREG32 (AVIVO_D1CRTC_STATUS + radeon_crtc->crtc_offset) &AVIVO_D1CRTC_V_BLANK ) +return true; +else +return false; +} + +static bool avivo_is_counter_moving (struct radeon_device *rdev,int crtc) +{ +struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc]; +u32 pos1, pos2; + + pos1 =RREG32 (AVIVO_D1CRTC_STATUS_POSITION + radeon_crtc->crtc_offset); + pos2 =RREG32 (AVIVO_D1CRTC_STATUS_POSITION + radeon_crtc->crtc_offset); + +if (pos1 != pos2) +return true; +else +return false; +} + +/** +* avivo_wait_for_vblank - vblank wait asic callback. +* +* @rdev: radeon_device pointer +* @crtc: crtc to wait for vblank on +* +* Wait for vblank on the requested crtc (r5xx-r7xx). +*/ void avivo_wait_for_vblank (struct radeon_device *rdev,int crtc) {struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc]; -int i; +unsigned i =0 ; + +if (!(RREG32 (AVIVO_D1CRTC_CONTROL + radeon_crtc->crtc_offset) &AVIVO_CRTC_EN )) +return ; -if (RREG32 (AVIVO_D1CRTC_CONTROL + radeon_crtc->crtc_offset) &AVIVO_CRTC_EN ) { -for (i =0 ; i < rdev->usec_timeout; i++) { -if (!(RREG32 (AVIVO_D1CRTC_STATUS + radeon_crtc->crtc_offset) &AVIVO_D1CRTC_V_BLANK )) +/* depending on when we hit vblank, we may be close to active; if so, +* wait for another frame. +*/ +while (avivo_is_in_vblank (rdev, crtc)) { +if (i++ %100 ==0 ) { +if (!avivo_is_counter_moving (rdev, crtc))break ;udelay (1 ); } -for (i =0 ; i < rdev->usec_timeout; i++) { -if (RREG32 (AVIVO_D1CRTC_STATUS + radeon_crtc->crtc_offset) &AVIVO_D1CRTC_V_BLANK ) + } + +while (!avivo_is_in_vblank (rdev, crtc)) { +if (i++ %100 ==0 ) { +if (!avivo_is_counter_moving (rdev, crtc))break ; -udelay (1 ); } } }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 120/136 drm/radeon: update wait_for_vblank for evergreen+
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
[ Upstream commit 10257a6d8359c41407eb26b7ad7bf710a7e00155 ]
Properly wait for the next vblank region. The previous code didn't always wait long enough depending on the timing.
--- drivers/gpu/drm/radeon/evergreen.c | 44 +++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 8 deletions(-)
drivers/gpu/drm/radeon/evergreen.c +36 -8
@@ -109,6 +109,27 @@ void evergreen_fix_pci_max_read_req_size(struct radeon_device *rdev) } } +static bool dce4_is_in_vblank (struct radeon_device *rdev,int crtc) +{ +if (RREG32 (EVERGREEN_CRTC_STATUS + crtc_offsets[crtc]) &EVERGREEN_CRTC_V_BLANK ) +return true; +else +return false; +} + +static bool dce4_is_counter_moving (struct radeon_device *rdev,int crtc) +{ +u32 pos1, pos2; + + pos1 =RREG32 (EVERGREEN_CRTC_STATUS_POSITION + crtc_offsets[crtc]); + pos2 =RREG32 (EVERGREEN_CRTC_STATUS_POSITION + crtc_offsets[crtc]); + +if (pos1 != pos2) +return true; +else +return false; +} +/** * dce4_wait_for_vblank - vblank wait asic callback. *
@@ -119,21 +140,28 @@ void evergreen_fix_pci_max_read_req_size(struct radeon_device *rdev)*/ void dce4_wait_for_vblank (struct radeon_device *rdev,int crtc) { -int i; +unsigned i =0 ;if (crtc >= rdev->num_crtc)return ; -if (RREG32 (EVERGREEN_CRTC_CONTROL + crtc_offsets[crtc]) &EVERGREEN_CRTC_MASTER_EN ) { -for (i =0 ; i < rdev->usec_timeout; i++) { -if (!(RREG32 (EVERGREEN_CRTC_STATUS + crtc_offsets[crtc]) &EVERGREEN_CRTC_V_BLANK )) +if (!(RREG32 (EVERGREEN_CRTC_CONTROL + crtc_offsets[crtc]) &EVERGREEN_CRTC_MASTER_EN )) +return ; + +/* depending on when we hit vblank, we may be close to active; if so, +* wait for another frame. +*/ +while (dce4_is_in_vblank (rdev, crtc)) { +if (i++ %100 ==0 ) { +if (!dce4_is_counter_moving (rdev, crtc))break ; -udelay (1 ); } -for (i =0 ; i < rdev->usec_timeout; i++) { -if (RREG32 (EVERGREEN_CRTC_STATUS + crtc_offsets[crtc]) &EVERGREEN_CRTC_V_BLANK ) + } + +while (!dce4_is_in_vblank (rdev, crtc)) { +if (i++ %100 ==0 ) { +if (!dce4_is_counter_moving (rdev, crtc))break ; -udelay (1 ); } } }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 121/136 drm/radeon: update wait_for_vblank for r1xx-r4xx
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
[ Upstream commit 2b48b968c0d00aa5ab520b65a15a4f374cda7dda ]
Properly wait for the next vblank region. The previous code didn't always wait long enough depending on the timing.
--- drivers/gpu/drm/radeon/r100.c | 77 ++++++++++++++++++++++++++++------------- 1 file changed, 53 insertions(+), 24 deletions(-)
drivers/gpu/drm/radeon/r100.c +53 -24
@@ -70,6 +70,38 @@ MODULE_FIRMWARE(FIRMWARE_R520);* and others in some cases. */ +static bool r100_is_in_vblank (struct radeon_device *rdev,int crtc) +{ +if (crtc ==0 ) { +if (RREG32 (RADEON_CRTC_STATUS ) &RADEON_CRTC_VBLANK_CUR ) +return true; +else +return false; + }else { +if (RREG32 (RADEON_CRTC2_STATUS ) &RADEON_CRTC2_VBLANK_CUR ) +return true; +else +return false; + } +} + +static bool r100_is_counter_moving (struct radeon_device *rdev,int crtc) +{ +u32 vline1, vline2; + +if (crtc ==0 ) { + vline1 = (RREG32 (RADEON_CRTC_VLINE_CRNT_VLINE ) >>16 ) &RADEON_CRTC_V_TOTAL ; + vline2 = (RREG32 (RADEON_CRTC_VLINE_CRNT_VLINE ) >>16 ) &RADEON_CRTC_V_TOTAL ; + }else { + vline1 = (RREG32 (RADEON_CRTC2_VLINE_CRNT_VLINE ) >>16 ) &RADEON_CRTC_V_TOTAL ; + vline2 = (RREG32 (RADEON_CRTC2_VLINE_CRNT_VLINE ) >>16 ) &RADEON_CRTC_V_TOTAL ; + } +if (vline1 != vline2) +return true; +else +return false; +} +/** * r100_wait_for_vblank - vblank wait asic callback. *
@@ -81,33 +113,30 @@ MODULE_FIRMWARE(FIRMWARE_R520);void r100_wait_for_vblank (struct radeon_device *rdev,int crtc) {struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc]; -int i; +unsigned i =0 ;if (radeon_crtc->crtc_id ==0 ) { -if (RREG32 (RADEON_CRTC_GEN_CNTL ) &RADEON_CRTC_EN ) { -for (i =0 ; i < rdev->usec_timeout; i++) { -if (!(RREG32 (RADEON_CRTC_STATUS ) &RADEON_CRTC_VBLANK_CUR )) -break ; -udelay (1 ); - } -for (i =0 ; i < rdev->usec_timeout; i++) { -if (RREG32 (RADEON_CRTC_STATUS ) &RADEON_CRTC_VBLANK_CUR ) -break ; -udelay (1 ); - } - } +if (!(RREG32 (RADEON_CRTC_GEN_CNTL ) &RADEON_CRTC_EN )) +return ; }else { -if (RREG32 (RADEON_CRTC2_GEN_CNTL ) &RADEON_CRTC2_EN ) { -for (i =0 ; i < rdev->usec_timeout; i++) { -if (!(RREG32 (RADEON_CRTC2_STATUS ) &RADEON_CRTC2_VBLANK_CUR )) -break ; -udelay (1 ); - } -for (i =0 ; i < rdev->usec_timeout; i++) { -if (RREG32 (RADEON_CRTC2_STATUS ) &RADEON_CRTC2_VBLANK_CUR ) -break ; -udelay (1 ); - } +if (!(RREG32 (RADEON_CRTC2_GEN_CNTL ) &RADEON_CRTC2_EN )) +return ; + } + +/* depending on when we hit vblank, we may be close to active; if so, +* wait for another frame. +*/ +while (r100_is_in_vblank (rdev, crtc)) { +if (i++ %100 ==0 ) { +if (!r100_is_counter_moving (rdev, crtc)) +break ; + } + } + +while (!r100_is_in_vblank (rdev, crtc)) { +if (i++ %100 ==0 ) { +if (!r100_is_counter_moving (rdev, crtc)) +break ; } } }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 122/136 drm/radeon: disable the crtcs in mc_stop (evergreen+) (v2)
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
[ Upstream commit abf1457bbbe4c62066bd03c6d31837dea28644dc ]
Just disabling the mem requests should be enough, but that doesn't seem to work correctly on efi systems.
May fix:
https://bugs.freedesktop.org/show_bug.cgi?id=57567
https://bugs.freedesktop.org/show_bug.cgi?id=43655
https://bugzilla.kernel.org/show_bug.cgi?id=56441
v2: blank displays first, then disable.
--- drivers/gpu/drm/radeon/evergreen.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/gpu/drm/radeon/evergreen.c +12 -0
@@ -1286,6 +1286,7 @@ void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *sav tmp =RREG32 (EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i]);if (!(tmp &EVERGREEN_CRTC_BLANK_DATA_EN )) {radeon_wait_for_vblank (rdev, i); +WREG32 (EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i],1 ); tmp |=EVERGREEN_CRTC_BLANK_DATA_EN ;WREG32 (EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i], tmp); }
@@ -1293,8 +1294,10 @@ void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *sav tmp =RREG32 (EVERGREEN_CRTC_CONTROL + crtc_offsets[i]);if (!(tmp &EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE )) {radeon_wait_for_vblank (rdev, i); +WREG32 (EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i],1 ); tmp |=EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE ;WREG32 (EVERGREEN_CRTC_CONTROL + crtc_offsets[i], tmp); +WREG32 (EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i],0 ); } }/* wait for the next frame */
@@ -1304,6 +1307,15 @@ void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *savbreak ;udelay (1 ); } + +/* XXX this is a hack to avoid strange behavior with EFI on certain systems */ +WREG32 (EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i],1 ); + tmp =RREG32 (EVERGREEN_CRTC_CONTROL + crtc_offsets[i]); + tmp &= ~EVERGREEN_CRTC_MASTER_EN ; +WREG32 (EVERGREEN_CRTC_CONTROL + crtc_offsets[i], tmp); +WREG32 (EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i],0 ); + save->crtc_enabled[i] = false; +/* ***** */ }else { save->crtc_enabled[i] = false; }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 123/136 drm/radeon: add some new SI PCI ids
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
[ Upstream commit 18932a28419596bc9403770f5d8a108c5433fe59 ]
--- include/drm/drm_pciids.h | 3 +++ 1 file changed, 3 insertions(+)
include/drm/drm_pciids.h +3 -0
@@ -227,6 +227,7 @@ {0x1002, 0x6819, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6820, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6821, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x6822, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6823, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6824, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
@@ -234,11 +235,13 @@ {0x1002, 0x6827, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6828, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6829, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x682A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ {0x1002, 0x682B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ {0x1002, 0x682D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ {0x1002, 0x682F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6830, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6831, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x6835, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6837, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6838, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6839, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|RADEON_NEW_MEMMAP}, \
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 124/136 drm/radeon/evergreen+: dont enable HPD interrupts on eDP/LVDS
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
[ Upstream commit 2e97be73e5f74a317232740ae82eb8f95326a660 ]
Avoids potential interrupt storms when the display is disabled.
May fix:
https://bugzilla.kernel.org/show_bug.cgi?id=56041
--- drivers/gpu/drm/radeon/evergreen.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/gpu/drm/radeon/evergreen.c +10 -0
@@ -569,6 +569,16 @@ void evergreen_hpd_init(struct radeon_device *rdev)list_for_each_entry (connector, &dev->mode_config.connector_list, head) {struct radeon_connector *radeon_connector =to_radeon_connector (connector); + +if (connector->connector_type == DRM_MODE_CONNECTOR_eDP || + connector->connector_type ==DRM_MODE_CONNECTOR_LVDS ) { +/* don't try to enable hpd on eDP or LVDS avoid breaking the +* aux dp channel on imac and help (but not completely fix) +* https://bugzilla.redhat.com/show_bug.cgi?id=726143 +* also avoid interrupt storms during dpms. +*/ +continue ; + }switch (radeon_connector->hpd.hpd) {case RADEON_HPD_1 :WREG32 (DC_HPD1_CONTROL , tmp);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 125/136 drm/radeon: cleanup properly if mmio mapping fails
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
[ Upstream commit 0cd9cb76ae26a19df21abc6f94f5fff141e689c7 ]
If we fail to map the mmio BAR, skip driver tear down that requires mmio.
Should fix:
https://bugzilla.kernel.org/show_bug.cgi?id=56541
--- drivers/gpu/drm/radeon/radeon_kms.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/radeon/radeon_kms.c +4 -0
@@ -51,8 +51,12 @@ int radeon_driver_unload_kms(struct drm_device *dev)if (rdev ==NULL )return 0 ; +if (rdev->rmmio ==NULL ) + goto done_free;radeon_modeset_fini (rdev);radeon_device_fini (rdev); + +done_free:kfree (rdev); dev->dev_private =NULL ;return 0 ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 126/136 drm/radeon: fix hdmi mode enable on RS600/RS690/RS740
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
[ Upstream commit dcb852905772416e322536ced5cb3c796d176af5 ]
These chips were previously skipped since they are pre-R600.
--- drivers/gpu/drm/radeon/r600_hdmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/r600_hdmi.c +2 -2
@@ -489,7 +489,7 @@ void r600_hdmi_enable(struct drm_encoder *encoder) offset = dig->afmt->offset;/* Older chipsets require setting HDMI and routing manually */ -if (rdev->family >=CHIP_R600 && !ASIC_IS_DCE3 (rdev)) { +if (ASIC_IS_DCE2 (rdev) && !ASIC_IS_DCE3 (rdev)) { hdmi =HDMI0_ERROR_ACK |HDMI0_ENABLE ;switch (radeon_encoder->encoder_id) {case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_TMDS1 :
@@ -558,7 +558,7 @@ void r600_hdmi_disable(struct drm_encoder *encoder)radeon_irq_kms_disable_afmt (rdev, dig->afmt->id);/* Older chipsets not handled by AtomBIOS */ -if (rdev->family >=CHIP_R600 && !ASIC_IS_DCE3 (rdev)) { +if (ASIC_IS_DCE2 (rdev) && !ASIC_IS_DCE3 (rdev)) {switch (radeon_encoder->encoder_id) {case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_TMDS1 : WREG32_P(AVIVO_TMDSA_CNTL, 0,
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 127/136 drm/radeon: fix typo in si_select_se_sh()
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
[ Upstream commit 79b52d6a7085a3e430c6de450a5847fdbe04159b ]
--- drivers/gpu/drm/radeon/si.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/si.c +1 -1
@@ -1374,7 +1374,7 @@ static void si_select_se_sh(struct radeon_device *rdev,u32 data =INSTANCE_BROADCAST_WRITES ;if ((se_num ==0xffffffff ) && (sh_num ==0xffffffff )) - data =SH_BROADCAST_WRITES |SE_BROADCAST_WRITES ; + data |=SH_BROADCAST_WRITES |SE_BROADCAST_WRITES ;else if (se_num ==0xffffffff ) data |=SE_BROADCAST_WRITES |SH_INDEX (sh_num);else if (sh_num ==0xffffffff )
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 128/136 drm/radeon: fix endian bugs in atom_allocate_fb_scratch()
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
[ Upstream commit beb71fc61c2cad64e347f164991b8ef476529e64 ]
--- drivers/gpu/drm/radeon/atom.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/radeon/atom.c +3 -3
@@ -1389,10 +1389,10 @@ int atom_allocate_fb_scratch(struct atom_context *ctx) firmware_usage = (struct _ATOM_VRAM_USAGE_BY_FIRMWARE *)(ctx->bios + data_offset);DRM_DEBUG ("atom firmware requested %08x %dkb\n" , - firmware_usage->asFirmwareVramReserveInfo[0 ].ulStartAddrUsedByFirmware, - firmware_usage->asFirmwareVramReserveInfo[0 ].usFirmwareUseInKb); +le32_to_cpu (firmware_usage->asFirmwareVramReserveInfo[0 ].ulStartAddrUsedByFirmware), +le16_to_cpu (firmware_usage->asFirmwareVramReserveInfo[0 ].usFirmwareUseInKb)); - usage_bytes = firmware_usage->asFirmwareVramReserveInfo[0 ].usFirmwareUseInKb *1024 ; + usage_bytes =le16_to_cpu (firmware_usage->asFirmwareVramReserveInfo[0 ].usFirmwareUseInKb) *1024 ; } ctx->scratch_size_bytes =0 ;if (usage_bytes ==0 )
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 129/136 drm/radeon: fix possible segfault when parsing pm tables
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
[ Upstream commit f8e6bfc2ce162855fa4f9822a45659f4b542c960 ]
If we have a empty power table, bail early and allocate the default power state.
Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=63865
--- drivers/gpu/drm/radeon/radeon_atombios.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_atombios.c +9 -1
@@ -2023,6 +2023,8 @@ static int radeon_atombios_parse_power_table_1_3(struct radeon_device *rdev) num_modes = power_info->info.ucNumOfPowerModeEntries;if (num_modes >ATOM_MAX_NUMBEROF_POWER_BLOCK ) num_modes =ATOM_MAX_NUMBEROF_POWER_BLOCK ; +if (num_modes ==0 ) +return state_index; rdev->pm.power_state =kzalloc (sizeof (struct radeon_power_state ) * num_modes,GFP_KERNEL );if (!rdev->pm.power_state)return state_index;
@@ -2421,6 +2423,8 @@ static int radeon_atombios_parse_power_table_4_5(struct radeon_device *rdev) power_info = (union power_info *)(mode_info->atom_context->bios + data_offset);radeon_atombios_add_pplib_thermal_controller (rdev, &power_info->pplib.sThermalController); +if (power_info->pplib.ucNumStates ==0 ) +return state_index; rdev->pm.power_state =kzalloc (sizeof (struct radeon_power_state ) * power_info->pplib.ucNumStates,GFP_KERNEL );if (!rdev->pm.power_state)
@@ -2519,6 +2523,8 @@ static int radeon_atombios_parse_power_table_6(struct radeon_device *rdev) non_clock_info_array = (struct _NonClockInfoArray *) (mode_info->atom_context->bios + data_offset +le16_to_cpu (power_info->pplib.usNonClockInfoArrayOffset)); +if (state_array->ucNumEntries ==0 ) +return state_index; rdev->pm.power_state =kzalloc (sizeof (struct radeon_power_state ) * state_array->ucNumEntries,GFP_KERNEL );if (!rdev->pm.power_state)
@@ -2609,7 +2615,9 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)default :break ; } - }else { + } + +if (state_index ==0 ) { rdev->pm.power_state =kzalloc (sizeof (struct radeon_power_state ),GFP_KERNEL );if (rdev->pm.power_state) { rdev->pm.power_state[0].clock_info =
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 130/136 drm/radeon: add new richland pci ids
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
[ Upstream commit 62d1f92e06aef9665d71ca7e986b3047ecf0b3c7 ]
--- drivers/gpu/drm/radeon/ni.c | 6 ++++-- include/drm/drm_pciids.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/ni.c +4 -2
@@ -471,7 +471,8 @@ static void cayman_gpu_init(struct radeon_device *rdev) (rdev->pdev->device ==0x990F ) || (rdev->pdev->device ==0x9910 ) || (rdev->pdev->device ==0x9917 ) || - (rdev->pdev->device == 0x9999)) { + (rdev->pdev->device ==0x9999 ) || + (rdev->pdev->device == 0x999C)) { rdev->config.cayman.max_simds_per_se = 6; rdev->config.cayman.max_backends_per_se =2 ; } else if ((rdev->pdev->device == 0x9903) ||
@@ -480,7 +481,8 @@ static void cayman_gpu_init(struct radeon_device *rdev) (rdev->pdev->device ==0x990D ) || (rdev->pdev->device ==0x990E ) || (rdev->pdev->device ==0x9913 ) || - (rdev->pdev->device == 0x9918)) { + (rdev->pdev->device ==0x9918 ) || + (rdev->pdev->device == 0x999D)) { rdev->config.cayman.max_simds_per_se = 4; rdev->config.cayman.max_backends_per_se =2 ; } else if ((rdev->pdev->device == 0x9919) ||
include/drm/drm_pciids.h +2 -0
@@ -593,6 +593,8 @@ {0x1002, 0x9999, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ {0x1002, 0x999A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ {0x1002, 0x999B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ + {0x1002, 0x999C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ + {0x1002, 0x999D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ {0x1002, 0x99A0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ {0x1002, 0x99A2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ {0x1002, 0x99A4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 131/136 drm/radeon: fix handling of v6 power tables
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
[ Upstream commit 441e76ca83ac604eaf0f046def96d8e3a27eea28 ]
The code was mis-handling variable sized arrays.
--- drivers/gpu/drm/radeon/radeon_atombios.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/gpu/drm/radeon/radeon_atombios.c +5 -6
@@ -2507,6 +2507,7 @@ static int radeon_atombios_parse_power_table_6(struct radeon_device *rdev)int index =GetIndexIntoMasterTable (DATA , PowerPlayInfo);u16 data_offset;u8 frev, crev; +u8 *power_state_offset;if (!atom_parse_data_header (mode_info->atom_context, index,NULL , &frev, &crev, &data_offset))
@@ -2529,11 +2530,11 @@ static int radeon_atombios_parse_power_table_6(struct radeon_device *rdev) state_array->ucNumEntries, GFP_KERNEL);if (!rdev->pm.power_state)return state_index; + power_state_offset = (u8 *)state_array->states;for (i =0 ; i < state_array->ucNumEntries; i++) { mode_index =0 ; - power_state = (union pplib_power_state *)&state_array->states[i]; -/* XXX this might be an inagua bug... */ - non_clock_array_index = i;/* power_state->v2.nonClockInfoIndex */ + power_state = (union pplib_power_state *)power_state_offset; + non_clock_array_index = power_state->v2.nonClockInfoIndex; non_clock_info = (struct _ATOM_PPLIB_NONCLOCK_INFO *) &non_clock_info_array->nonClockInfo[non_clock_array_index]; rdev->pm.power_state[i].clock_info = kzalloc(sizeof(struct radeon_pm_clock_info) *
@@ -2545,9 +2546,6 @@ static int radeon_atombios_parse_power_table_6(struct radeon_device *rdev)if (power_state->v2.ucNumDPMLevels) {for (j =0 ; j < power_state->v2.ucNumDPMLevels; j++) { clock_array_index = power_state->v2.clockInfoIndex[j]; -/* XXX this might be an inagua bug... */ -if (clock_array_index >= clock_info_array->ucNumEntries) -continue ; clock_info = (union pplib_clock_info *) &clock_info_array->clockInfo[clock_array_index * clock_info_array->ucEntrySize]; valid = radeon_atombios_parse_pplib_clock_info(rdev,
@@ -2569,6 +2567,7 @@ static int radeon_atombios_parse_power_table_6(struct radeon_device *rdev) non_clock_info); state_index++; } + power_state_offset +=2 + power_state->v2.ucNumDPMLevels; }/* if multiple clock modes, mark the lowest as no display */ for (i =0 ; i < state_index; i++) {
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 132/136 tracing: Fix ftrace_dump()
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: "Steven Rostedt (Red Hat)" <[email protected]>
[ Upstream commit 7fe70b579c9e3daba71635e31b6189394e7b79d3 ]
ftrace_dump() had a lot of issues. What ftrace_dump() does, is when ftrace_dump_on_oops is set (via a kernel parameter or sysctl), it will dump out the ftrace buffers to the console when either a oops, panic, or a sysrq-z occurs.
This was written a long time ago when ftrace was fragile to recursion. But it wasn't written well even for that.
There's a possible deadlock that can occur if a ftrace_dump() is happening and an NMI triggers another dump. This is because it grabs a lock before checking if the dump ran.
It also totally disables ftrace, and tracing for no good reasons.
As the ring_buffer now checks if it is read via a oops or NMI, where there's a chance that the buffer gets corrupted, it will disable itself. No need to have ftrace_dump() do the same.
ftrace_dump() is now cleaned up where it uses an atomic counter to make sure only one dump happens at a time. A simple atomic_inc_return() is enough that is needed for both other CPUs and NMIs. No need for a spinlock, as if one CPU is running the dump, no other CPU needs to do it too.
The tracing_on variable is turned off and not turned on. The original code did this, but it wasn't pretty. By just disabling this variable we get the result of not seeing traces that happen between crashes.
For sysrq-z, it doesn't get turned on, but the user can always write a '1' to the tracing_on file. If they are using sysrq-z, then they should know about tracing_on.
The new code is much easier to read and less error prone. No more deadlock possibility when an NMI triggers here.
--- kernel/trace/trace.c | 62 +++++++++++++++++------------------------ kernel/trace/trace_selftest.c | 9 +++--- 2 files changed, 31 insertions(+), 40 deletions(-)
kernel/trace/trace.c +26 -36
@@ -4986,36 +4986,32 @@ void trace_init_global_iter(struct trace_iterator *iter) iter->cpu_file =TRACE_PIPE_ALL_CPU ; } -static void -__ftrace_dump (bool disable_tracing,enum ftrace_dump_mode oops_dump_mode) +void ftrace_dump (enum ftrace_dump_mode oops_dump_mode) { -static arch_spinlock_t ftrace_dump_lock = - (arch_spinlock_t )__ARCH_SPIN_LOCK_UNLOCKED;/* use static because iter can be a bit big for the stack */ static struct trace_iterator iter; +static atomic_t dump_running;unsigned int old_userobj; -static int dump_ran;unsigned long flags;int cnt =0 , cpu; -/* only one dump */ -local_irq_save (flags); -arch_spin_lock (&ftrace_dump_lock); -if (dump_ran) - goto out; - - dump_ran =1 ; +/* Only allow one dump user at a time. */ +if (atomic_inc_return (&dump_running) !=1 ) { +atomic_dec (&dump_running); +return ; + } +/* +* Always turn off tracing when we dump. +* We don't need to show trace output of what happens +* between multiple crashes. +* +* If the user does a sysrq-z, then they can re-enable +* tracing with echo 1 > tracing_on. +*/ tracing_off (); -/* Did function tracer already get disabled? */ -if (ftrace_is_dead ()) { -printk ("# WARNING: FUNCTION TRACING IS CORRUPTED\n" ); -printk ("# MAY BE MISSING FUNCTION EVENTS\n" ); - } - -if (disable_tracing) -ftrace_kill (); +local_irq_save (flags);trace_init_global_iter (&iter);
@@ -5048,6 +5044,12 @@ __ftrace_dump(bool disable_tracing, enum ftrace_dump_mode oops_dump_mode)printk (KERN_TRACE "Dumping ftrace buffer:\n" ); +/* Did function tracer already get disabled? */ +if (ftrace_is_dead ()) { +printk ("# WARNING: FUNCTION TRACING IS CORRUPTED\n" ); +printk ("# MAY BE MISSING FUNCTION EVENTS\n" ); + } +/* * We need to stop all tracing on all CPUS to read the * the next buffer. This is a bit expensive, but is
@@ -5087,26 +5089,14 @@ __ftrace_dump(bool disable_tracing, enum ftrace_dump_mode oops_dump_mode)printk (KERN_TRACE "---------------------------------\n" ); out_enable: -/* Re-enable tracing if requested */ -if (!disable_tracing) { - trace_flags |= old_userobj; + trace_flags |= old_userobj; -for_each_tracing_cpu (cpu) { -atomic_dec (&iter.tr->data[cpu]->disabled); - } -tracing_on (); +for_each_tracing_cpu (cpu) { +atomic_dec (&iter.tr->data[cpu]->disabled); } - - out: -arch_spin_unlock (&ftrace_dump_lock); +atomic_dec (&dump_running);local_irq_restore (flags); } - -/* By default: disable tracing after the dump */ -void ftrace_dump (enum ftrace_dump_mode oops_dump_mode) -{ -__ftrace_dump (true, oops_dump_mode); -}EXPORT_SYMBOL_GPL (ftrace_dump);__init static int tracer_alloc_buffers (void )
kernel/trace/trace_selftest.c +5 -4
@@ -461,8 +461,6 @@ trace_selftest_startup_function(struct tracer *trace, struct trace_array *tr)/* Maximum number of functions to trace before diagnosing a hang */ #define GRAPH_MAX_FUNC_TEST 100000000 -static void -__ftrace_dump (bool disable_tracing,enum ftrace_dump_mode oops_dump_mode);static unsigned int graph_hang_thresh;/* Wrap the real function entry probe to avoid possible hanging */
@@ -472,8 +470,11 @@ static int trace_graph_entry_watchdog(struct ftrace_graph_ent *trace)if (unlikely (++graph_hang_thresh >GRAPH_MAX_FUNC_TEST )) {ftrace_graph_stop ();printk (KERN_WARNING "BUG: Function graph tracer hang!\n" ); -if (ftrace_dump_on_oops) -__ftrace_dump (false,DUMP_ALL ); +if (ftrace_dump_on_oops) { +ftrace_dump (DUMP_ALL ); +/* ftrace_dump() disables tracing */ +tracing_on (); + }return 0 ; }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 133/136 Btrfs: compare relevant parts of delayed tree refs
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Josef Bacik <[email protected]>
[ Upstream commit 41b0fc42800569f63e029549b75c4c9cb63f2dfd ]
A user reported a panic while running a balance. What was happening was he was relocating a block, which added the reference to the relocation tree. Then relocation would walk through the relocation tree and drop that reference and free that block, and then it would walk down a snapshot which referenced the same block and add another ref to the block. The problem is this was all happening in the same transaction, so the parent block was free'ed up when we drop our reference which was immediately available for allocation, and then it was used _again_ to add a reference for the same block from a different snapshot. This resulted in something like this in the delayed ref tree
add ref to 90234880, parent=2067398656, ref_root 1766, level 1 del ref to 90234880, parent=2067398656, ref_root 18446744073709551608, level 1 add ref to 90234880, parent=2067398656, ref_root 1767, level 1
as you can see the ref_root's don't match, because when we inc the ref we use the header owner, which is the original tree the block belonged to, instead of the data reloc tree. Then when we remove the extent we use the reloc tree objectid. But none of this matters, since it is a shared reference which means only the parent matters. When the delayed ref stuff runs it adds all the increments first, and then does all the drops, to make sure that we don't delete the ref if we net a positive ref count. But tree blocks aren't allowed to have multiple refs from the same block, so this panics when it tries to add the second ref. We need the add and the drop to cancel each other out in memory so we only do the final add.
So to fix this we need to adjust how the delayed refs are added to the tree. Only the ref_root matters when it is a normal backref, and only the parent matters when it is a shared backref. So make our decision based on what ref type we have. This allows us to keep the ref_root in memory in case anybody wants to use it for something else, and it allows the delayed refs to be merged properly so we don't end up with this panic.
With this patch the users image no longer panics on mount, and it has a clean fsck after a normal mount/umount cycle. Thanks,
--- fs/btrfs/delayed-ref.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-)
fs/btrfs/delayed-ref.c +14 -10
@@ -36,16 +36,19 @@* compare two delayed tree backrefs with same bytenr and type */ static int comp_tree_refs (struct btrfs_delayed_tree_ref *ref2, -struct btrfs_delayed_tree_ref *ref1) +struct btrfs_delayed_tree_ref *ref1,int type) { -if (ref1->root < ref2->root) -return -1 ; -if (ref1->root > ref2->root) -return 1 ; -if (ref1->parent < ref2->parent) -return -1 ; -if (ref1->parent > ref2->parent) -return 1 ; +if (type ==BTRFS_TREE_BLOCK_REF_KEY ) { +if (ref1->root < ref2->root) +return -1 ; +if (ref1->root > ref2->root) +return 1 ; + }else { +if (ref1->parent < ref2->parent) +return -1 ; +if (ref1->parent > ref2->parent) +return 1 ; + }return 0 ; }
@@ -109,7 +112,8 @@ static int comp_entry(struct btrfs_delayed_ref_node *ref2,if (ref1->type ==BTRFS_TREE_BLOCK_REF_KEY || ref1->type ==BTRFS_SHARED_BLOCK_REF_KEY ) {return comp_tree_refs (btrfs_delayed_node_to_tree_ref (ref2), -btrfs_delayed_node_to_tree_ref (ref1)); +btrfs_delayed_node_to_tree_ref (ref1), + ref1->type); }else if (ref1->type ==BTRFS_EXTENT_DATA_REF_KEY || ref1->type ==BTRFS_SHARED_DATA_REF_KEY ) { return comp_data_refs(btrfs_delayed_node_to_data_ref(ref2),
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 134/136 kernel/audit_tree.c: tree will leak memory when failure occurs in audit_trim_trees()
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Chen Gang <[email protected]>
[ Upstream commit 12b2f117f3bf738c1a00a6f64393f1953a740bd4 ]
audit_trim_trees() calls get_tree(). If a failure occurs we must call put_tree().
--- kernel/audit_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/audit_tree.c +1 -1
@@ -609,9 +609,9 @@ void audit_trim_trees(void) }spin_unlock (&hash_lock);trim_marked (tree); -put_tree (tree);drop_collected_mounts (root_mnt); skip_it: +put_tree (tree);mutex_lock (&audit_filter_mutex); }list_del (&cursor);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 135/136 x86/mm: account for PGDIR_SIZE alignment
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Jerry Hoemann <[email protected]>
Patch for -stable. Function find_early_table_space removed upstream.
Fixes panic in alloc_low_page due to pgt_buf overflow during init_memory_mapping.
find_early_table_space sizes pgt_buf based upon the size of the memory being mapped, but it does not take into account the alignment of the memory. When the region being mapped spans a 512GB (PGDIR_SIZE) alignment, a panic from alloc_low_pages occurs.
kernel_physical_mapping_init takes into account PGDIR_SIZE alignment. This causes an extra call to alloc_low_page to be made. This extra call isn't accounted for by find_early_table_space and causes a kernel panic.
Change is to take into account PGDIR_SIZE alignment in find_early_table_space.
--- arch/x86/mm/init.c | 5 +++++ 1 file changed, 5 insertions(+)
arch/x86/mm/init.c +5 -0
@@ -45,11 +45,15 @@ static void __init find_early_table_space(struct map_range *mr, int nr_range)int i;unsigned long puds =0 , pmds =0 , ptes =0 , tables;unsigned long start =0 , good_end; +unsigned long pgd_extra =0 ;phys_addr_t base;for (i =0 ; i < nr_range; i++) {unsigned long range, extra; +if ((mr[i].end >>PGDIR_SHIFT ) - (mr[i].start >>PGDIR_SHIFT )) + pgd_extra++; + range = mr[i].end - mr[i].start; puds += (range +PUD_SIZE -1 ) >>PUD_SHIFT ;
@@ -74,6 +78,7 @@ static void __init find_early_table_space(struct map_range *mr, int nr_range) tables =roundup (puds *sizeof (pud_t),PAGE_SIZE ); tables +=roundup (pmds *sizeof (pmd_t),PAGE_SIZE ); tables +=roundup (ptes *sizeof (pte_t),PAGE_SIZE ); + tables += (pgd_extra *PAGE_SIZE );#ifdef CONFIG_X86_32 /* for fixmap */
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 136/136 s390: move dummy io_remap_pfn_range() to asm/pgtable.h
In reply to Steven Rostedt3.6.11.4 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
[ Upstream commit 4f2e29031e6c67802e7370292dd050fd62f337ee ]
Commit b4cbb197c7e7 ("vm: add vm_iomap_memory() helper function") added a helper function wrapper around io_remap_pfn_range(), and every other architecture defined it in <asm/pgtable.h>.
The s390 choice of <asm/io.h> may make sense, but is not very convenient for this case, and gratuitous differences like that cause unexpected errors like this:
mm/memory.c: In function 'vm_iomap_memory':
mm/memory.c:2439:2: error: implicit declaration of function 'io_remap_pfn_range' [-Werror=implicit-function-declaration]
Glory be the kbuild test robot who noticed this, bisected it, and reported it to the guilty parties (ie me).
--- arch/s390/include/asm/pgtable.h | 4 ++++ 1 file changed, 4 insertions(+)
arch/s390/include/asm/pgtable.h +4 -0
@@ -65,6 +65,10 @@ static inline int is_zero_pfn(unsigned long pfn)#define my_zero_pfn (addr) page_to_pfn(ZERO_PAGE(addr)) +/* TODO: s390 cannot support io_remap_pfn_range... */ +#define io_remap_pfn_range (vma, vaddr, pfn, size, prot) \ + remap_pfn_range(vma, vaddr, pfn, size, prot) +#endif /* !__ASSEMBLY__ */ /*
Signature · 1 line
1.7.10.4