3.12.7-stable review
Subsystems (3)
Greg Kroah-Hartman
maintainercover 3.12.7-stable review
This is the start of the stable review cycle for the 3.12.7 release. There are 144 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed Jan 8 22:37:25 UTC 2014. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.12.7-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 3.12.7-rc1
Rafael J. Wysocki <[email protected]>
ACPIPHP / radeon / nouveau: Fix VGA switcheroo problem related to hotplug
Zhang Rui <[email protected]>
nouveau_acpi: convert acpi_get_handle() to acpi_has_method()
Benjamin LaHaise <[email protected]>
aio/migratepages: make aio migrate pages sane
Linus Torvalds <[email protected]>
aio: clean up and fix aio_setup_ring page mapping
Dinh Nguyen <[email protected]>
clocksource: dw_apb_timer_of: Fix support for dts binding "snps,dw-apb-timer"
Dinh Nguyen <[email protected]>
clocksource: dw_apb_timer_of: Fix read_sched_clock
Paul Moore <[email protected]>
selinux: process labeled IPsec TCP SYN-ACK packets properly in selinux_ip_postroute()
Paul Moore <[email protected]>
selinux: look for IPsec labels on both inbound and outbound packets
Geert Uytterhoeven <[email protected]>
sh: always link in helper functions extracted from libgcc
Stephen Boyd <[email protected]>
gpio: msm: Fix irq mask/unmask by writing bits instead of numbers
Roger Quadros <[email protected]>
gpio: twl4030: Fix regression for twl gpio LED output
Laurent Pinchart <[email protected]>
sh-pfc: Fix PINMUX_GPIO macro
Theodore Ts'o <[email protected]>
jbd2: don't BUG but return ENOSPC if a handle runs out of space
Martin Schwidefsky <[email protected]>
s390/3270: fix allocation of tty3270_screen structure
Maxime Ripard <[email protected]>
ARM: sun7i: dt: Fix interrupt trigger types
Vladimir Davydov <[email protected]>
memcg: fix memcg_size() calculation
Steven Whitehouse <[email protected]>
GFS2: Fix incorrect invalidation for DIO/buffered I/O
Bob Peterson <[email protected]>
GFS2: Fix slab memory leak in gfs2_bufdata
Bob Peterson <[email protected]>
GFS2: Fix use-after-free race when calling gfs2_remove_from_ail
Steven Whitehouse <[email protected]>
GFS2: don't hold s_umount over blkdev_put
Dmitry Torokhov <[email protected]>
Input: allocate absinfo data when setting ABS capability
Naoya Horiguchi <[email protected]>
mm/memory-failure.c: transfer page count from head page to tail page after split thp
Rik van Riel <[email protected]>
mm: fix use-after-free in sys_remap_file_pages
Vlastimil Babka <[email protected]>
mm: munlock: fix deadlock in __munlock_pagevec()
Vlastimil Babka <[email protected]>
mm: munlock: fix a bug where THP tail page is encountered
Johannes Weiner <[email protected]>
mm: page_alloc: revert NUMA aspect of fair allocation policy
Jianguo Wu <[email protected]>
mm/hugetlb: check for pte NULL pointer in __page_check_address()
Jianguo Wu <[email protected]>
mm/memory-failure.c: recheck PageHuge() after hugetlb page migrate successfully
Joonsoo Kim <[email protected]>
mm/compaction: respect ignore_skip_hint in update_pageblock_skip
Joonsoo Kim <[email protected]>
mm/mempolicy: correct putback method for isolate pages if failed
Mel Gorman <[email protected]>
mm: numa: guarantee that tlb_flush_pending updates are visible before page table updates
Rik van Riel <[email protected]>
mm: fix TLB flush race between migration, and change_protection_range
Mel Gorman <[email protected]>
mm: numa: avoid unnecessary work on the failure path
Mel Gorman <[email protected]>
mm: numa: ensure anon_vma is locked to prevent parallel THP splits
Mel Gorman <[email protected]>
mm: clear pmd_numa before invalidating
Rob Herring <[email protected]>
Revert "of/address: Handle #address-cells > 2 specially"
Rafael J. Wysocki <[email protected]>
intel_pstate: Fail initialization if P-state information is missing
Toshi Kani <[email protected]>
ACPI / PCI / hotplug: Avoid warning when _ADR not present
Jan Kara <[email protected]>
ext2: Fix oops in ext2_get_block() called from ext2_quota_write()
Larry Finger <[email protected]>
rtlwifi: pci: Fix oops on driver unload
Johannes Berg <[email protected]>
radiotap: fix bitmap-end-finding buffer overrun
Shirish Pargaonkar <[email protected]>
cifs: set FILE_CREATED
Sachin Prabhu <[email protected]>
cifs: We do not drop reference to tlink in CIFSCheckMFSymlink()
Tejun Heo <[email protected]>
libata, freezer: avoid block device removal while system is frozen
Marc Carino <[email protected]>
libata: implement ATA_HORKAGE_NO_NCQ_TRIM and apply it to Micro M500 SSDs
Robin H. Johnson <[email protected]>
libata: disable a disk via libata.force params
Michele Baldessari <[email protected]>
libata: add ATA_HORKAGE_BROKEN_FPDMA_AA quirk for Seagate Momentus SpinPoint M8
Marek Vasut <[email protected]>
ahci: imx: Explicitly clear IMX6Q_GPR13_SATA_MPLL_CLK_EN
Ilia Mirkin <[email protected]>
drm/nouveau: only runtime suspend by default in optimus configuration
Shuah Khan <[email protected]>
power_supply: Fix Oops from NULL pointer dereference from wakeup_source_activate
Josh Boyer <[email protected]>
cpupower: Fix segfault due to incorrect getopt_long arugments
Anton Blanchard <[email protected]>
powerpc: Align p_end
Michael Neuling <[email protected]>
powerpc: Fix bad stack check in exception entry
Jan Kiszka <[email protected]>
KVM: x86: Fix APIC map calculation after re-enabling
Jan Kiszka <[email protected]>
KVM: nVMX: Unconditionally uninit the MMU on nested vmexit
Mathy Vanhoef <[email protected]>
ath9k_htc: properly set MAC address and BSSID mask
Sujith Manoharan <[email protected]>
ath9k: Fix interrupt handling for the AR9002 family
Peter Korsgaard <[email protected]>
dm9601: work around tx fifo sync issue on dm962x
Peter Korsgaard <[email protected]>
dm9601: fix reception of full size ethernet frames on dm9620/dm9621a
Ard Biesheuvel <[email protected]>
auxvec.h: account for AT_HWCAP2 in AT_VECTOR_SIZE_BASE
Tejun Heo <[email protected]>
cgroup: fix cgroup_create() error handling path
Nithin Sujir <[email protected]>
tg3: Expand 4g_overflow_test workaround to skb fragments of any size.
Li Wang <[email protected]>
ceph: Avoid data inconsistency due to d-cache aliasing in readpage()
Marek Olšák <[email protected]>
drm/radeon: set correct pipe config for Hawaii in DCE
Alex Deucher <[email protected]>
drm/radeon: 0x9649 is SUMO2 not SUMO
Marek Olšák <[email protected]>
drm/radeon: expose render backend mask to the userspace
Marek Olšák <[email protected]>
drm/radeon: fix render backend setup for SI and CIK
Christian König <[email protected]>
drm/radeon: fix UVD 256MB check
Chris Wilson <[email protected]>
drm/i915: Use the correct GMCH_CTRL register for Sandybridge+
Paulo Zanoni <[email protected]>
drm/i915: change CRTC assertion on LCPLL disable
Chris Wilson <[email protected]>
drm/i915: Fix erroneous dereference of batch_obj inside reset_status
Alex Deucher <[email protected]>
drm/radeon: fix asic gfx values for scrapper asics
Alex Deucher <[email protected]>
drm/radeon: check for 0 count in speaker allocation and SAD code
Alex Deucher <[email protected]>
drm/radeon/dpm: disable ss on Cayman
Daniel Vetter <[email protected]>
drm/i915: don't update the dri1 breadcrumb with modesetting
Daniel Vetter <[email protected]>
drm/i915: Fix use-after-free in do_switch
Chris Wilson <[email protected]>
drm/i915: Hold mutex across i915_gem_release
Ville Syrjälä <[email protected]>
drm/i915: Take modeset locks around intel_modeset_setup_hw_state()
Alex Deucher <[email protected]>
drm/radeon: add missing display tiling setup for oland
Christian König <[email protected]>
drm/radeon: fix typo in cik_copy_dma
Alex Deucher <[email protected]>
drm/radeon: Fix sideport problems on certain RS690 boards
Thomas Hellstrom <[email protected]>
drm/ttm: Fix accesses through vmas with only partial coverage
Rafał Miłecki <[email protected]>
drm/edid: add quirk for BPC in Samsung NP700G7A-S01PL notebook
Dan Williams <[email protected]>
net_dma: mark broken
Stefan Richter <[email protected]>
firewire: sbp2: bring back WRITE SAME support
Kirill Tkhai <[email protected]>
sched/rt: Fix rq's cpupri leak while enqueue/dequeue child RT entities
Mel Gorman <[email protected]>
sched: numa: skip inaccessible VMAs
Lukas Czerner <[email protected]>
ext4: fix FITRIM in no journal mode
Theodore Ts'o <[email protected]>
ext4: add explicit casts when masking cluster sizes
Jan Kara <[email protected]>
ext4: fix deadlock when writing in ENOSPC conditions
Jan Kara <[email protected]>
ext4: Do not reserve clusters when fs doesn't support extents
Al Viro <[email protected]>
ext4: fix del_timer() misuse for ->s_err_report
Eryu Guan <[email protected]>
ext4: check for overlapping extents in ext4_valid_extent_entries()
Junho Ryu <[email protected]>
ext4: fix use-after-free in ext4_mb_new_blocks
Theodore Ts'o <[email protected]>
ext4: call ext4_error_inode() if jbd2_journal_dirty_metadata() fails
Paul Drews <[email protected]>
ACPI: Add BayTrail SoC GPIO and LPSS ACPI IDs
Len Brown <[email protected]>
x86 idle: Repair large-server 50-watt idle-power regression
Tony Lindgren <[email protected]>
ARM: OMAP2+: Fix LCD panel backlight regression for LDP legacy booting
Suman Anna <[email protected]>
ARM: OMAP2+: hwmod_data: fix missing OMAP_INTC_START in irq data
Rajendra Nayak <[email protected]>
ARM: DRA7: hwmod: Fix boot crash with DEBUG_LL
Ben Dooks <[email protected]>
ARM: shmobile: r8a7790: fix shdi resource sizes
Will Deacon <[email protected]>
arm64: ptrace: avoid using HW_BREAKPOINT_EMPTY for disabled events
Ming Lei <[email protected]>
scripts/link-vmlinux.sh: only filter kernel symbols for arm
Miao Xie <[email protected]>
ftrace: Initialize the ftrace profiler for each possible cpu
Jie Liu <[email protected]>
xfs: fix infinite loop by detaching the group/project hints from user dquot
Nicholas Bellinger <[email protected]>
target/file: Update hw_max_sectors based on current block_size
Nicholas Bellinger <[email protected]>
iser-target: Move INIT_WORK setup into isert_create_device_ib_res
Nicholas Bellinger <[email protected]>
iscsi-target: Fix incorrect np->np_thread NULL assignment
Nicholas Bellinger <[email protected]>
iscsi-target: Fix-up all zero data-length CDBs with R/W_BIT set
Wei Yongjun <[email protected]>
iser-target: fix error return code in isert_create_device_ib_res()
Shivaram Upadhyayula <[email protected]>
qla2xxx: Fix schedule_delayed_work() for target timeout calculations
Benjamin LaHaise <[email protected]>
aio: fix kioctx leak introduced by "aio: Fix a trinity splat"
Oleg Nesterov <[email protected]>
selinux: selinux_setprocattr()->ptrace_parent() needs rcu_read_lock()
Chad Hanson <[email protected]>
selinux: fix broken peer recv check
Sebastian Andrzej Siewior <[email protected]>
usb: musb: only cancel work if it is initialized
Sebastian Andrzej Siewior <[email protected]>
usb: musb: core: Call dma_controller_destroy() in error path only once.
Peter Chen <[email protected]>
usb: chipidea: fix nobody cared IRQ when booting with host role
Fabio Estevam <[email protected]>
usb: chipidea: host: Only disable the vbus regulator if it is not NULL
Bjørn Mork <[email protected]>
usb: cdc-wdm: manage_power should always set needs_remote_wakeup
Marc Kleine-Budde <[email protected]>
can: peak_usb: fix mem leak in pcan_usb_pro_init()
Takashi Iwai <[email protected]>
xhci: Limit the spurious wakeup fix only to HP machines
Dmitry Kunilov <[email protected]>
usb: serial: zte_ev: move support for ZTE AC2726 from zte_ev back to option
Mika Westerberg <[email protected]>
serial: 8250_dw: add new ACPI IDs
Jonathan Cameron <[email protected]>
iio:adc:ad7887 Fix channel reported endianness from cpu to big endian
Jonathan Cameron <[email protected]>
iio:imu:adis16400 fix pressure channel scan type
Hui Wang <[email protected]>
ALSA: hda - Add Dell headset detection quirk for three laptop models
David Henningsson <[email protected]>
ALSA: hda - Add enable_msi=0 workaround for four HP machines
JongHo Kim <[email protected]>
ALSA: Add SNDRV_PCM_STATE_PAUSED case in wait_for_avail function
Charles Keepax <[email protected]>
ASoC: wm5110: Correct HPOUT3 DAPM route typo
Charles Keepax <[email protected]>
ASoC: wm_adsp: Add small delay while polling DSP RAM start
Bo Shen <[email protected]>
ASoC: wm8904: fix DSP mode B configuration
Stephen Warren <[email protected]>
ASoC: tegra: fix uninitialized variables in set_fmt
Vivek Goyal <[email protected]>
kexec: migrate to reboot cpu
H Hartley Sweeten <[email protected]>
staging: comedi: drivers: fix return value of comedi_load_firmware()
Ian Abbott <[email protected]>
staging: comedi: 8255_pci: fix for newer PCI-DIO48H
Geert Uytterhoeven <[email protected]>
TTY: pmac_zilog, check existence of ports in pmz_console_init()
Peter Hurley <[email protected]>
n_tty: Fix apparent order of echoed output
Peter Hurley <[email protected]>
tty: Fix hang at ldsem_down_read()
pingfan liu <[email protected]>
powerpc: kvm: fix rare but potential deadlock scene
Li Wang <[email protected]>
ceph: allocate non-zero page to fscache in readpage()
Yan, Zheng <[email protected]>
ceph: wake up 'safe' waiters when unregistering request
Yan, Zheng <[email protected]>
ceph: cleanup aborted requests when re-sending requests.
Milosz Tanski <[email protected]>
ceph: hung on ceph fscache invalidate in some cases
Johan Hovold <[email protected]>
USB: serial: fix race in generic write
-------------
Diffstat:
Documentation/kernel-parameters.txt | 2 + Makefile | 4 +- arch/arm/boot/dts/r8a7790.dtsi | 4 +- arch/arm/boot/dts/sun7i-a20.dtsi | 32 +++--- arch/arm/mach-omap2/board-ldp.c | 7 +- arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c | 4 +- arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 6 +- arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 2 +- arch/arm64/kernel/ptrace.c | 38 ++++--- arch/powerpc/include/asm/exception-64s.h | 2 +- arch/powerpc/kernel/head_64.S | 1 + arch/powerpc/kvm/book3s_64_mmu_hv.c | 6 +- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 4 + arch/sh/lib/Makefile | 2 +- arch/sparc/include/asm/pgtable_64.h | 4 +- arch/x86/include/asm/pgtable.h | 11 +- arch/x86/kernel/cpu/intel.c | 3 +- arch/x86/kvm/lapic.c | 8 +- arch/x86/kvm/vmx.c | 3 +- drivers/acpi/acpi_lpss.c | 1 + drivers/acpi/bus.c | 10 ++ drivers/ata/ahci_imx.c | 3 +- drivers/ata/libata-core.c | 19 +++- drivers/ata/libata-scsi.c | 21 ++++ drivers/clocksource/dw_apb_timer_of.c | 7 +- drivers/cpufreq/intel_pstate.c | 5 + drivers/dma/Kconfig | 1 + drivers/firewire/sbp2.c | 1 - drivers/gpio/gpio-msm-v2.c | 4 +- drivers/gpio/gpio-twl4030.c | 15 ++- drivers/gpu/drm/drm_edid.c | 8 ++ drivers/gpu/drm/i915/i915_dma.c | 10 ++ drivers/gpu/drm/i915/i915_gem.c | 34 +++++-- drivers/gpu/drm/i915/i915_gem_context.c | 16 ++- drivers/gpu/drm/i915/intel_display.c | 9 +- drivers/gpu/drm/nouveau/nouveau_acpi.c | 19 +++- drivers/gpu/drm/nouveau/nouveau_drm.c | 6 ++ drivers/gpu/drm/radeon/atombios_crtc.c | 23 ++--- drivers/gpu/drm/radeon/cik.c | 12 ++- drivers/gpu/drm/radeon/cik_sdma.c | 2 +- drivers/gpu/drm/radeon/dce6_afmt.c | 4 +- drivers/gpu/drm/radeon/evergreen_hdmi.c | 4 +- drivers/gpu/drm/radeon/ni.c | 20 +++- drivers/gpu/drm/radeon/radeon.h | 4 +- drivers/gpu/drm/radeon/radeon_atpx_handler.c | 16 ++- drivers/gpu/drm/radeon/radeon_kms.c | 9 ++ drivers/gpu/drm/radeon/radeon_uvd.c | 2 +- drivers/gpu/drm/radeon/rs690.c | 10 ++ drivers/gpu/drm/radeon/rv770_dpm.c | 6 ++ drivers/gpu/drm/radeon/si.c | 12 ++- drivers/gpu/drm/ttm/ttm_bo_vm.c | 6 +- drivers/idle/intel_idle.c | 3 + drivers/iio/adc/ad7887.c | 16 ++- drivers/iio/imu/adis16400_core.c | 7 +- drivers/infiniband/ulp/isert/ib_isert.c | 22 ++-- drivers/input/input.c | 4 + drivers/net/can/usb/peak_usb/pcan_usb_pro.c | 3 + drivers/net/ethernet/broadcom/tg3.c | 2 +- drivers/net/usb/dm9601.c | 34 +++++-- drivers/net/wireless/ath/ath9k/ar9002_mac.c | 52 ++++++++-- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 25 +++-- drivers/net/wireless/ath/ath9k/main.c | 5 +- drivers/net/wireless/rtlwifi/pci.c | 4 +- drivers/of/address.c | 8 -- drivers/pci/hotplug/acpiphp_glue.c | 30 +++++- drivers/pinctrl/pinctrl-baytrail.c | 1 + drivers/pinctrl/sh-pfc/sh_pfc.h | 2 +- drivers/power/power_supply_core.c | 12 +-- drivers/s390/char/tty3270.c | 2 +- drivers/scsi/qla2xxx/qla_target.c | 9 +- drivers/staging/comedi/drivers.c | 2 +- drivers/staging/comedi/drivers/8255_pci.c | 15 ++- drivers/target/iscsi/iscsi_target.c | 27 +++-- drivers/target/iscsi/iscsi_target_login.c | 6 -- drivers/target/target_core_device.c | 5 + drivers/target/target_core_file.c | 8 +- drivers/target/target_core_file.h | 5 +- drivers/tty/n_tty.c | 7 +- drivers/tty/serial/8250/8250_dw.c | 2 + drivers/tty/serial/pmac_zilog.c | 3 + drivers/tty/tty_ldsem.c | 16 ++- drivers/usb/chipidea/core.c | 4 + drivers/usb/chipidea/host.c | 3 +- drivers/usb/chipidea/udc.c | 3 - drivers/usb/class/cdc-wdm.c | 8 +- drivers/usb/host/xhci-pci.c | 7 +- drivers/usb/musb/musb_core.c | 14 +-- drivers/usb/serial/generic.c | 9 +- drivers/usb/serial/option.c | 2 + drivers/usb/serial/zte_ev.c | 3 +- fs/aio.c | 113 +++++++++++++-------- fs/ceph/addr.c | 10 +- fs/ceph/cache.c | 3 + fs/ceph/mds_client.c | 8 +- fs/cifs/cifsproto.h | 7 +- fs/cifs/dir.c | 11 +- fs/cifs/inode.c | 6 +- fs/cifs/link.c | 26 ++--- fs/ext2/super.c | 1 + fs/ext4/ext4.h | 10 ++ fs/ext4/ext4_jbd2.c | 9 ++ fs/ext4/extents.c | 45 +++++--- fs/ext4/inode.c | 12 --- fs/ext4/mballoc.c | 21 ++-- fs/ext4/super.c | 21 ++-- fs/gfs2/aops.c | 30 ++++++ fs/gfs2/log.c | 4 +- fs/gfs2/meta_io.c | 5 + fs/gfs2/ops_fstype.c | 12 ++- fs/jbd2/transaction.c | 6 +- fs/xfs/xfs_qm.c | 71 +++++++++---- include/acpi/acpi_bus.h | 4 +- include/asm-generic/pgtable.h | 2 +- include/drm/drm_pciids.h | 2 +- include/linux/auxvec.h | 2 +- include/linux/libata.h | 1 + include/linux/migrate.h | 3 +- include/linux/mm_types.h | 49 +++++++++ include/linux/reboot.h | 1 + include/target/target_core_base.h | 1 + include/uapi/drm/radeon_drm.h | 2 + kernel/cgroup.c | 31 ++++-- kernel/fork.c | 1 + kernel/freezer.c | 6 ++ kernel/kexec.c | 1 + kernel/reboot.c | 2 +- kernel/sched/fair.c | 7 ++ kernel/sched/rt.c | 14 +++ kernel/trace/ftrace.c | 2 +- mm/compaction.c | 4 + mm/fremap.c | 8 +- mm/huge_memory.c | 14 +++ mm/memcontrol.c | 2 +- mm/memory-failure.c | 24 ++++- mm/mempolicy.c | 2 +- mm/migrate.c | 17 ++-- mm/mlock.c | 44 +++++--- mm/mprotect.c | 2 + mm/page_alloc.c | 19 ++-- mm/pgtable-generic.c | 8 +- mm/rmap.c | 4 + net/wireless/radiotap.c | 4 + scripts/link-vmlinux.sh | 4 +- security/selinux/hooks.c | 53 ++++++++-- security/selinux/include/xfrm.h | 9 +- security/selinux/xfrm.c | 53 ++++++++-- sound/core/pcm_lib.c | 2 + sound/pci/hda/hda_intel.c | 4 + sound/pci/hda/patch_realtek.c | 3 + sound/soc/codecs/wm5110.c | 2 +- sound/soc/codecs/wm8904.c | 2 +- sound/soc/codecs/wm_adsp.c | 10 +- sound/soc/tegra/tegra20_i2s.c | 6 +- sound/soc/tegra/tegra20_spdif.c | 10 +- sound/soc/tegra/tegra30_i2s.c | 6 +- tools/power/cpupower/utils/cpupower-set.c | 6 +- 156 files changed, 1234 insertions(+), 502 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/144 USB: serial: fix race in generic write
3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 6f6485463aada1ec6a0f3db6a03eb8e393d6bb55 upstream.
Fix race in generic write implementation, which could lead to temporarily degraded throughput.
The current generic write implementation introduced by commit 27c7acf22047 ("USB: serial: reimplement generic fifo-based writes") has always had this bug, although it's fairly hard to trigger and the consequences are not likely to be noticed.
Specifically, a write() on one CPU while the completion handler is running on another could result in only one of the two write urbs being utilised to empty the remainder of the write fifo (unless there is a second write() that doesn't race during that time).
--- drivers/usb/serial/generic.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/usb/serial/generic.c +1 -8
@@ -176,14 +176,7 @@ retry:return result; } -/* Try sending off another urb, unless in irq context (in which case -* there will be no free urb). */ -if (!in_irq ()) - goto retry; - -clear_bit_unlock (USB_SERIAL_WRITE_BUSY , &port->flags); - -return 0 ; + goto retry;/* try sending off another urb */ }/**
Greg Kroah-Hartman
maintainerPATCH 2/144 ceph: hung on ceph fscache invalidate in some cases
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Milosz Tanski <[email protected]>
commit ffc79664d15841025d90afdd902c4112ffe168d6 upstream.
In some cases I'm on my ceph client cluster I'm seeing hunk kernel tasks in the invalidate page code path. This is due to the fact that we don't check if the page is marked as cache before calling fscache_wait_on_page_write().
This is the log from the hang
INFO: task XXXXXX:12034 blocked for more than 120 seconds. "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. ... Call Trace: [<ffffffff81568d09>] schedule+0x29/0x70 [<ffffffffa01d4cbd>] __fscache_wait_on_page_write+0x6d/0xb0 [fscache] [<ffffffff81083520>] ? add_wait_queue+0x60/0x60 [<ffffffffa029a3e9>] ceph_invalidate_fscache_page+0x29/0x50 [ceph] [<ffffffffa027df00>] ceph_invalidatepage+0x70/0x190 [ceph] [<ffffffff8112656f>] ? delete_from_page_cache+0x5f/0x70 [<ffffffff81133cab>] truncate_inode_page+0x8b/0x90 [<ffffffff81133ded>] truncate_inode_pages_range.part.12+0x13d/0x620 [<ffffffff8113431d>] truncate_inode_pages_range+0x4d/0x60 [<ffffffff811343b5>] truncate_inode_pages+0x15/0x20 [<ffffffff8119bbf6>] evict+0x1a6/0x1b0 [<ffffffff8119c3f3>] iput+0x103/0x190 ...
--- fs/ceph/cache.c | 3 +++ 1 file changed, 3 insertions(+)
fs/ceph/cache.c +3 -0
@@ -324,6 +324,9 @@ void ceph_invalidate_fscache_page(struct {struct ceph_inode_info *ci =ceph_inode (inode); +if (!PageFsCache (page)) +return ; +fscache_wait_on_page_write (ci->fscache, page);fscache_uncache_page (ci->fscache, page); }
Greg Kroah-Hartman
maintainerPATCH 3/144 ceph: cleanup aborted requests when re-sending requests.
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Yan, Zheng" <[email protected]>
commit eb1b8af33c2e42a9a57fc0a7588f4a7b255d2e79 upstream.
Aborted requests usually get cleared when the reply is received. If MDS crashes, no reply will be received. So we need to cleanup aborted requests when re-sending requests.
--- fs/ceph/mds_client.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
fs/ceph/mds_client.c +4 -1
@@ -1875,8 +1875,11 @@ static int __do_request(struct ceph_mds_int mds =-1 ;int err = -EAGAIN ; -if (req->r_err || req->r_got_result) +if (req->r_err || req->r_got_result) { +if (req->r_aborted) +__unregister_request (mdsc, req); goto out; + }if (req->r_timeout &&time_after_eq (jiffies, req->r_started + req->r_timeout)) {
Greg Kroah-Hartman
maintainerPATCH 4/144 ceph: wake up safe waiters when unregistering request
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Yan, Zheng" <[email protected]>
commit fc55d2c9448b34218ca58733a6f51fbede09575b upstream.
We also need to wake up 'safe' waiters if error occurs or request aborted. Otherwise sync(2)/fsync(2) may hang forever.
--- fs/ceph/mds_client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/ceph/mds_client.c +2 -1
@@ -642,6 +642,8 @@ static void __unregister_request(struct req->r_unsafe_dir =NULL ; } +complete_all (&req->r_safe_completion); +ceph_mdsc_put_request (req); }
@@ -2189,7 +2191,6 @@ static void handle_reply(struct ceph_mdsif (head->safe) { req->r_got_safe = true;__unregister_request (mdsc, req); -complete_all (&req->r_safe_completion);if (req->r_got_unsafe) {/*
Greg Kroah-Hartman
maintainerPATCH 5/144 ceph: allocate non-zero page to fscache in readpage()
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Wang <[email protected]>
commit ff638b7df5a9264024a6448bdfde2b2bf5d1994a upstream.
ceph_osdc_readpages() returns number of bytes read, currently, the code only allocate full-zero page into fscache, this patch fixes this.
--- fs/ceph/addr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ceph/addr.c +1 -1
@@ -216,7 +216,7 @@ static int readpage_nounlock(struct file }SetPageUptodate (page); -if (err ==0 ) +if (err >=0 )ceph_readpage_to_fscache (inode, page); out:
Greg Kroah-Hartman
maintainerPATCH 6/144 powerpc: kvm: fix rare but potential deadlock scene
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: pingfan liu <[email protected]>
commit 91648ec09c1ef69c4d840ab6dab391bfb452d554 upstream.
Since kvmppc_hv_find_lock_hpte() is called from both virtmode and realmode, so it can trigger the deadlock.
Suppose the following scene:
Two physical cpuM, cpuN, two VM instances A, B, each VM has a group of vcpus.
If on cpuM, vcpu_A_1 holds bitlock X (HPTE_V_HVLOCK), then is switched out, and on cpuN, vcpu_A_2 try to lock X in realmode, then cpuN will be caught in realmode for a long time.
What makes things even worse if the following happens,
On cpuM, bitlockX is hold, on cpuN, Y is hold. vcpu_B_2 try to lock Y on cpuM in realmode vcpu_A_2 try to lock X on cpuN in realmode
Oops! deadlock happens
--- arch/powerpc/kvm/book3s_64_mmu_hv.c | 6 +++++- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-)
arch/powerpc/kvm/book3s_64_mmu_hv.c +5 -1
@@ -473,11 +473,14 @@ static int kvmppc_mmu_book3s_64_hv_xlate slb_v = vcpu->kvm->arch.vrma_slb_v; } +preempt_disable ();/* Find the HPTE in the hash table */ index =kvmppc_hv_find_lock_hpte (kvm, eaddr, slb_v,HPTE_V_VALID |HPTE_V_ABSENT ); -if (index <0 ) +if (index <0 ) { +preempt_enable ();return -ENOENT ; + } hptep = (unsigned long *)(kvm->arch.hpt_virt + (index <<4 )); v = hptep[0 ] & ~HPTE_V_HVLOCK ; gr = kvm->arch.revmap[index].guest_rpte;
@@ -485,6 +488,7 @@ static int kvmppc_mmu_book3s_64_hv_xlate/* Unlock the HPTE */ asmvolatile ("lwsync" : : :"memory" ); hptep[0 ] = v; +preempt_enable (); gpte->eaddr = eaddr; gpte->vpage = ((v &HPTE_V_AVPN ) <<4 ) | ((eaddr >>12 ) &0xfff );
arch/powerpc/kvm/book3s_hv_rm_mmu.c +4 -0
@@ -749,6 +749,10 @@ static int slb_base_page_shift[4] = { 20, /* 1M, unsupported */ }; +/* When called from virtmode, this func should be protected by +* preempt_disable(), otherwise, the holding of HPTE_V_HVLOCK +* can trigger deadlock issue. +*/ long kvmppc_hv_find_lock_hpte (struct kvm *kvm,gva_t eaddr,unsigned long slb_v,unsigned long valid) {
Greg Kroah-Hartman
maintainerPATCH 7/144 tty: Fix hang at ldsem_down_read()
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Hurley <[email protected]>
commit cf872776fc84128bb779ce2b83a37c884c3203ae upstream.
When a controlling tty is being hung up and the hang up is waiting for a just-signalled tty reader or writer to exit, and a new tty reader/writer tries to acquire an ldisc reference concurrently with the ldisc reference release from the signalled reader/writer, the hangup can hang. The new reader/writer is sleeping in ldsem_down_read() and the hangup is sleeping in ldsem_down_write() [1].
The new reader/writer fails to wakeup the waiting hangup because the wrong lock count value is checked (the old lock count rather than the new lock count) to see if the lock is unowned.
Change helper function to return the new lock count if the cmpxchg was successful; document this behavior.
[1] edited dmesg log from reporter
SysRq : Show Blocked State
task PC stack pid father
systemd D ffff88040c4f0000 0 1 0 0x00000000
ffff88040c49fbe0 0000000000000046 ffff88040c4a0000 ffff88040c49ffd8 00000000001d3980 00000000001d3980 ffff88040c4a0000 ffff88040593d840 ffff88040c49fb40 ffffffff810a4cc0 0000000000000006 0000000000000023
Call Trace: [<ffffffff810a4cc0>] ? sched_clock_cpu+0x9f/0xe4 [<ffffffff810a4cc0>] ? sched_clock_cpu+0x9f/0xe4 [<ffffffff810a4cc0>] ? sched_clock_cpu+0x9f/0xe4 [<ffffffff810a4cc0>] ? sched_clock_cpu+0x9f/0xe4 [<ffffffff817a6649>] schedule+0x24/0x5e [<ffffffff817a588b>] schedule_timeout+0x15b/0x1ec [<ffffffff810a4cc0>] ? sched_clock_cpu+0x9f/0xe4 [<ffffffff817aa691>] ? _raw_spin_unlock_irq+0x24/0x26 [<ffffffff817aa10c>] down_read_failed+0xe3/0x1b9 [<ffffffff817aa26d>] ldsem_down_read+0x8b/0xa5 [<ffffffff8142b5ca>] ? tty_ldisc_ref_wait+0x1b/0x44 [<ffffffff8142b5ca>] tty_ldisc_ref_wait+0x1b/0x44 [<ffffffff81423f5b>] tty_write+0x7d/0x28a [<ffffffff814241f5>] redirected_tty_write+0x8d/0x98 [<ffffffff81424168>] ? tty_write+0x28a/0x28a [<ffffffff8115d03f>] do_loop_readv_writev+0x56/0x79 [<ffffffff8115e604>] do_readv_writev+0x1b0/0x1ff [<ffffffff8116ea0b>] ? do_vfs_ioctl+0x32a/0x489 [<ffffffff81167d9d>] ? final_putname+0x1d/0x3a [<ffffffff8115e6c7>] vfs_writev+0x2e/0x49 [<ffffffff8115e7d3>] SyS_writev+0x47/0xaa [<ffffffff817ab822>] system_call_fastpath+0x16/0x1b
bash D ffffffff81c104c0 0 5469 5302 0x00000082
ffff8800cf817ac0 0000000000000046 ffff8804086b22a0 ffff8800cf817fd8 00000000001d3980 00000000001d3980 ffff8804086b22a0 ffff8800cf817a48 000000000000b9a0 ffff8800cf817a78 ffffffff81004675 ffff8800cf817a44
Call Trace: [<ffffffff81004675>] ? dump_trace+0x165/0x29c [<ffffffff810a4cc0>] ? sched_clock_cpu+0x9f/0xe4 [<ffffffff8100edda>] ? save_stack_trace+0x26/0x41 [<ffffffff817a6649>] schedule+0x24/0x5e [<ffffffff817a588b>] schedule_timeout+0x15b/0x1ec [<ffffffff810a4cc0>] ? sched_clock_cpu+0x9f/0xe4 [<ffffffff817a9f03>] ? down_write_failed+0xa3/0x1c9 [<ffffffff817aa691>] ? _raw_spin_unlock_irq+0x24/0x26 [<ffffffff817a9f0b>] down_write_failed+0xab/0x1c9 [<ffffffff817aa300>] ldsem_down_write+0x79/0xb1 [<ffffffff817aada3>] ? tty_ldisc_lock_pair_timeout+0xa5/0xd9 [<ffffffff817aada3>] tty_ldisc_lock_pair_timeout+0xa5/0xd9 [<ffffffff8142bf33>] tty_ldisc_hangup+0xc4/0x218 [<ffffffff81423ab3>] __tty_hangup+0x2e2/0x3ed [<ffffffff81424a76>] disassociate_ctty+0x63/0x226 [<ffffffff81078aa7>] do_exit+0x79f/0xa11 [<ffffffff81086bdb>] ? get_signal_to_deliver+0x206/0x62f [<ffffffff810b4bfb>] ? lock_release_holdtime.part.8+0xf/0x16e [<ffffffff81079b05>] do_group_exit+0x47/0xb5 [<ffffffff81086c16>] get_signal_to_deliver+0x241/0x62f [<ffffffff810020a7>] do_signal+0x43/0x59d [<ffffffff810f2af7>] ? __audit_syscall_exit+0x21a/0x2a8 [<ffffffff810b4bfb>] ? lock_release_holdtime.part.8+0xf/0x16e [<ffffffff81002655>] do_notify_resume+0x54/0x6c [<ffffffff817abaf8>] int_signal+0x12/0x17
--- drivers/tty/tty_ldsem.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
drivers/tty/tty_ldsem.c +13 -3
@@ -86,11 +86,21 @@ static inline long ldsem_atomic_update(lreturn atomic_long_add_return (delta, (atomic_long_t *)&sem->count); } +/* +* ldsem_cmpxchg() updates @*old with the last-known sem->count value. +* Returns 1 if count was successfully changed; @*old will have @new value. +* Returns 0 if count was not changed; @*old will have most recent sem->count +*/ static inline int ldsem_cmpxchg (long *old,long new,struct ld_semaphore *sem) { -long tmp = *old; - *old =atomic_long_cmpxchg (&sem->count, *old, new); -return *old == tmp; +long tmp =atomic_long_cmpxchg (&sem->count, *old, new); +if (tmp == *old) { + *old = new; +return 1 ; + }else { + *old = tmp; +return 0 ; + } }/*
Greg Kroah-Hartman
maintainerPATCH 8/144 n_tty: Fix apparent order of echoed output
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Hurley <[email protected]>
commit 1075a6e2dc7e2a96efc417b98dd98f57fdae985d upstream.
With block processing of echoed output, observed output order is still required. Push completed echoes and echo commands prior to output.
Introduce echo_mark echo buffer index, which tracks completed echo commands; ie., those submitted via commit_echoes but which may not have been committed. Ensure that completed echoes are output prior to subsequent terminal writes in process_echoes().
Fixes newline/prompt output order in cooked mode shell.
--- drivers/tty/n_tty.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/tty/n_tty.c +6 -1
@@ -93,6 +93,7 @@ struct n_tty_data {size_t canon_head;size_t echo_head;size_t echo_commit; +size_t echo_mark;DECLARE_BITMAP (char_map,256 );/* private to n_tty_receive_overrun (single-threaded) */
@@ -336,6 +337,7 @@ static void reset_buffer_flags(struct n_ { ldata->read_head = ldata->canon_head = ldata->read_tail =0 ; ldata->echo_head = ldata->echo_tail = ldata->echo_commit =0 ; + ldata->echo_mark =0 ; ldata->line_start =0 ; ldata->erasing =0 ;
@@ -787,6 +789,7 @@ static void commit_echoes(struct tty_strsize_t head; head = ldata->echo_head; + ldata->echo_mark = head; old = ldata->echo_commit - ldata->echo_tail;/* Process committed echoes if the accumulated # of bytes
@@ -811,10 +814,11 @@ static void process_echoes(struct tty_stsize_t echoed;if ((!L_ECHO (tty) && !L_ECHONL (tty)) || - ldata->echo_commit == ldata->echo_tail) + ldata->echo_mark == ldata->echo_tail)return ;mutex_lock (&ldata->output_lock); + ldata->echo_commit = ldata->echo_mark; echoed =__process_echoes (tty);mutex_unlock (&ldata->output_lock);
@@ -822,6 +826,7 @@ static void process_echoes(struct tty_st tty->ops->flush_chars (tty); } +/* NB: echo_mark and echo_head should be equivalent here */ static void flush_echoes (struct tty_struct *tty) {struct n_tty_data *ldata = tty->disc_data;
Greg Kroah-Hartman
maintainerPATCH 9/144 TTY: pmac_zilog, check existence of ports in pmz_console_init()
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
commit dc1dc2f8a5dd863bf2e79f338fc3ae29e99c683a upstream.
When booting a multi-platform m68k kernel on a non-Mac with "console=ttyS0" on the kernel command line, it crashes with:
Unable to handle kernel NULL pointer dereference at virtual address (null) Oops: 00000000 PC: [<0013ad28>] __pmz_startup+0x32/0x2a0 ... Call Trace: [<002c5d3e>] pmz_console_setup+0x64/0xe4
The normal tty driver doesn't crash, because init_pmz() checks pmz_ports_count again after calling pmz_probe().
In the serial console initialization path, pmz_console_init() doesn't do this, causing the driver to crash later.
Add a check for pmz_ports_count to fix this.
--- drivers/tty/serial/pmac_zilog.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/tty/serial/pmac_zilog.c +3 -0
@@ -2050,6 +2050,9 @@ static int __init pmz_console_init(void)/* Probe ports */ pmz_probe (); +if (pmz_ports_count ==0 ) +return -ENODEV ; +/* TODO: Autoprobe console based on OF */ /* pmz_console.index = i; */ register_console (&pmz_console);
Greg Kroah-Hartman
maintainerPATCH 10/144 staging: comedi: 8255_pci: fix for newer PCI-DIO48H
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Abbott <[email protected]>
commit 0283f7a100882684ad32b768f9f1ad81658a0b92 upstream.
At some point, Measurement Computing / ComputerBoards redesigned the PCI-DIO48H to use a PLX PCI interface chip instead of an AMCC chip. This meant they had to put their hardware registers in the PCI BAR 2 region instead of PCI BAR 1. Unfortunately, they kept the same PCI device ID for the new design. This means the driver recognizes the newer cards, but doesn't work (and is likely to screw up the local configuration registers of the PLX chip) because it's using the wrong region.
Since the PCI subvendor and subdevice IDs were both zero on the old design, but are the same as the vendor and device on the new design, we can tell the old design and new design apart easily enough. Split the existing entry for the PCI-DIO48H in pci_8255_boards[] into two new entries, referenced by different entries in the PCI device ID table pci_8255_pci_table[]. Use the same board name for both entries.
--- drivers/staging/comedi/drivers/8255_pci.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
drivers/staging/comedi/drivers/8255_pci.c +12 -3
@@ -63,7 +63,8 @@ enum pci_8255_boardid {BOARD_ADLINK_PCI7296 ,BOARD_CB_PCIDIO24 ,BOARD_CB_PCIDIO24H , -BOARD_CB_PCIDIO48H , +BOARD_CB_PCIDIO48H_OLD , +BOARD_CB_PCIDIO48H_NEW ,BOARD_CB_PCIDIO96H ,BOARD_NI_PCIDIO96 , BOARD_NI_PCIDIO96B,
@@ -106,11 +107,16 @@ static const struct pci_8255_boardinfo p .dio_badr = 2, .n_8255 = 1, }, - [BOARD_CB_PCIDIO48H] = { + [BOARD_CB_PCIDIO48H_OLD] = { .name = "cb_pci-dio48h", .dio_badr = 1, .n_8255 = 2, }, + [BOARD_CB_PCIDIO48H_NEW] = { + .name = "cb_pci-dio48h", + .dio_badr = 2, + .n_8255 = 2, + }, [BOARD_CB_PCIDIO96H] = { .name = "cb_pci-dio96h", .dio_badr = 2,
@@ -263,7 +269,10 @@ static DEFINE_PCI_DEVICE_TABLE(pci_8255_ { PCI_VDEVICE(ADLINK, 0x7296), BOARD_ADLINK_PCI7296 }, { PCI_VDEVICE(CB, 0x0028), BOARD_CB_PCIDIO24 }, { PCI_VDEVICE(CB, 0x0014), BOARD_CB_PCIDIO24H }, - { PCI_VDEVICE(CB, 0x000b), BOARD_CB_PCIDIO48H }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_CB, 0x000b, 0x0000, 0x0000), + .driver_data = BOARD_CB_PCIDIO48H_OLD }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_CB, 0x000b, PCI_VENDOR_ID_CB, 0x000b), + .driver_data = BOARD_CB_PCIDIO48H_NEW }, { PCI_VDEVICE(CB, 0x0017), BOARD_CB_PCIDIO96H }, { PCI_VDEVICE(NI, 0x0160), BOARD_NI_PCIDIO96 }, { PCI_VDEVICE(NI, 0x1630), BOARD_NI_PCIDIO96B },
Greg Kroah-Hartman
maintainerPATCH 11/144 staging: comedi: drivers: fix return value of comedi_load_firmware()
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: H Hartley Sweeten <[email protected]>
commit c6236c0ce39c809c336ca929f68cf8ad02cf94e0 upstream.
Some of the callback functions that upload the firmware in the comedi drivers return a positive value indicating the number of bytes sent to the device. Detect this condition and just return '0' to indicate a successful upload.
--- drivers/staging/comedi/drivers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/comedi/drivers.c +1 -1
@@ -417,7 +417,7 @@ int comedi_load_firmware(struct comedi_drelease_firmware (fw); } -return ret; +return ret <0 ? ret :0 ; }EXPORT_SYMBOL_GPL (comedi_load_firmware);
Greg Kroah-Hartman
maintainerPATCH 12/144 kexec: migrate to reboot cpu
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vivek Goyal <[email protected]>
commit c97102ba96324da330078ad8619ba4dfe840dbe3 upstream.
Commit 1b3a5d02ee07 ("reboot: move arch/x86 reboot= handling to generic kernel") moved reboot= handling to generic code. In the process it also removed the code in native_machine_shutdown() which are moving reboot process to reboot_cpu/cpu0.
I guess that thought must have been that all reboot paths are calling migrate_to_reboot_cpu(), so we don't need this special handling. But kexec reboot path (kernel_kexec()) is not calling migrate_to_reboot_cpu() so above change broke kexec. Now reboot can happen on non-boot cpu and when INIT is sent in second kerneo to bring up BP, it brings down the machine.
So start calling migrate_to_reboot_cpu() in kexec reboot path to avoid this problem.
Bisected by WANG Chao.
--- include/linux/reboot.h | 1 + kernel/kexec.c | 1 + kernel/reboot.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-)
include/linux/reboot.h +1 -0
@@ -43,6 +43,7 @@ extern int unregister_reboot_notifier(st* Architecture-specific implementations of sys_reboot commands. */ +extern void migrate_to_reboot_cpu (void );extern void machine_restart (char *cmd);extern void machine_halt (void );extern void machine_power_off (void );
kernel/kexec.c +1 -0
@@ -1680,6 +1680,7 @@ int kernel_kexec(void) { kexec_in_progress = true;kernel_restart_prepare (NULL ); +migrate_to_reboot_cpu ();printk (KERN_EMERG "Starting new kernel\n" );machine_shutdown (); }
kernel/reboot.c +1 -1
@@ -104,7 +104,7 @@ int unregister_reboot_notifier(struct no }EXPORT_SYMBOL (unregister_reboot_notifier); -static void migrate_to_reboot_cpu (void ) +void migrate_to_reboot_cpu (void ) {/* The boot cpu is always logical cpu 0 */ int cpu = reboot_cpu;
Greg Kroah-Hartman
maintainerPATCH 13/144 ASoC: tegra: fix uninitialized variables in set_fmt
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Warren <[email protected]>
commit 241bf43321a10815225f477bba96a42285a2da73 upstream.
In tegra*_i2s_set_fmt(), in the (fmt == SND_SOC_DAIFMT_CBM_CFM) case, "val" is never assigned to, but left uninitialized. The other case does initialized it. Fix this by initializing val at the start of the function, and only ever ORing into it.
Update the handling of "mask" so it works the same way for consistency.
Update tegra20_spdif.c to use the same code-style for consistency, even though it doesn't happen to suffer from the same problem at present.
--- sound/soc/tegra/tegra20_i2s.c | 6 +++--- sound/soc/tegra/tegra20_spdif.c | 10 +++++----- sound/soc/tegra/tegra30_i2s.c | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-)
sound/soc/tegra/tegra20_i2s.c +3 -3
@@ -74,7 +74,7 @@ static int tegra20_i2s_set_fmt(struct sn unsigned int fmt) {struct tegra20_i2s *i2s =snd_soc_dai_get_drvdata (dai); -unsigned int mask, val; +unsigned int mask =0 , val =0 ;switch (fmt &SND_SOC_DAIFMT_INV_MASK ) {case SND_SOC_DAIFMT_NB_NF :
@@ -83,10 +83,10 @@ static int tegra20_i2s_set_fmt(struct snreturn -EINVAL ; } - mask =TEGRA20_I2S_CTRL_MASTER_ENABLE ; + mask |=TEGRA20_I2S_CTRL_MASTER_ENABLE ;switch (fmt &SND_SOC_DAIFMT_MASTER_MASK ) {case SND_SOC_DAIFMT_CBS_CFS : - val =TEGRA20_I2S_CTRL_MASTER_ENABLE ; + val |=TEGRA20_I2S_CTRL_MASTER_ENABLE ;break ;case SND_SOC_DAIFMT_CBM_CFM :break ;
sound/soc/tegra/tegra20_spdif.c +5 -5
@@ -67,15 +67,15 @@ static int tegra20_spdif_hw_params(struc {struct device *dev = dai->dev;struct tegra20_spdif *spdif =snd_soc_dai_get_drvdata (dai); -unsigned int mask, val; +unsigned int mask =0 , val =0 ;int ret, spdifclock; - mask =TEGRA20_SPDIF_CTRL_PACK | -TEGRA20_SPDIF_CTRL_BIT_MODE_MASK ; + mask |=TEGRA20_SPDIF_CTRL_PACK | +TEGRA20_SPDIF_CTRL_BIT_MODE_MASK ;switch (params_format (params)) {case SNDRV_PCM_FORMAT_S16_LE : - val =TEGRA20_SPDIF_CTRL_PACK | -TEGRA20_SPDIF_CTRL_BIT_MODE_16BIT ; + val |=TEGRA20_SPDIF_CTRL_PACK | +TEGRA20_SPDIF_CTRL_BIT_MODE_16BIT ;break ;default :return -EINVAL ;
sound/soc/tegra/tegra30_i2s.c +3 -3
@@ -117,7 +117,7 @@ static int tegra30_i2s_set_fmt(struct sn unsigned int fmt) {struct tegra30_i2s *i2s =snd_soc_dai_get_drvdata (dai); -unsigned int mask, val; +unsigned int mask =0 , val =0 ;switch (fmt &SND_SOC_DAIFMT_INV_MASK ) {case SND_SOC_DAIFMT_NB_NF :
@@ -126,10 +126,10 @@ static int tegra30_i2s_set_fmt(struct snreturn -EINVAL ; } - mask =TEGRA30_I2S_CTRL_MASTER_ENABLE ; + mask |=TEGRA30_I2S_CTRL_MASTER_ENABLE ;switch (fmt &SND_SOC_DAIFMT_MASTER_MASK ) {case SND_SOC_DAIFMT_CBS_CFS : - val =TEGRA30_I2S_CTRL_MASTER_ENABLE ; + val |=TEGRA30_I2S_CTRL_MASTER_ENABLE ;break ;case SND_SOC_DAIFMT_CBM_CFM :break ;
Greg Kroah-Hartman
maintainerPATCH 14/144 ASoC: wm8904: fix DSP mode B configuration
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bo Shen <[email protected]>
commit f0199bc5e3a3ec13f9bc938556517ec430b36437 upstream.
When wm8904 work in DSP mode B, we still need to configure it to work in DSP mode. Or else, it will work in Right Justified mode.
--- sound/soc/codecs/wm8904.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/wm8904.c +1 -1
@@ -1443,7 +1443,7 @@ static int wm8904_set_fmt(struct snd_socswitch (fmt &SND_SOC_DAIFMT_FORMAT_MASK ) {case SND_SOC_DAIFMT_DSP_B : - aif1 |=WM8904_AIF_LRCLK_INV ; + aif1 |=0x3 |WM8904_AIF_LRCLK_INV ;case SND_SOC_DAIFMT_DSP_A : aif1 |=0x3 ;break ;
Greg Kroah-Hartman
maintainerPATCH 15/144 ASoC: wm_adsp: Add small delay while polling DSP RAM start
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Keepax <[email protected]>
commit 939fd1e8d9deff206f12bd9d4e54aa7a4bd0ffd6 upstream.
Some devices are getting very close to the limit whilst polling the RAM start, this patch adds a small delay to this loop to give a longer startup timeout.
--- sound/soc/codecs/wm_adsp.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
sound/soc/codecs/wm_adsp.c +7 -3
@@ -1466,13 +1466,17 @@ static int wm_adsp2_ena(struct wm_adsp *return ret;/* Wait for the RAM to start, should be near instantaneous */ - count =0 ; -do { +for (count =0 ; count <10 ; ++count) { ret =regmap_read (dsp->regmap, dsp->base +ADSP2_STATUS1 , &val);if (ret !=0 )return ret; - }while (!(val &ADSP2_RAM_RDY ) && ++count <10 ); + +if (val &ADSP2_RAM_RDY ) +break ; + +msleep (1 ); + }if (!(val &ADSP2_RAM_RDY )) {adsp_err (dsp,"Failed to start DSP RAM\n" );
Greg Kroah-Hartman
maintainerPATCH 16/144 ASoC: wm5110: Correct HPOUT3 DAPM route typo
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Keepax <[email protected]>
commit 280484e708a3cc38fe6807718caa460e744c0b20 upstream.
--- sound/soc/codecs/wm5110.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/wm5110.c +1 -1
@@ -1031,7 +1031,7 @@ static const struct snd_soc_dapm_route w { "HPOUT2R", NULL, "OUT2R" }, { "HPOUT3L", NULL, "OUT3L" }, - { "HPOUT3R", NULL, "OUT3L" }, + { "HPOUT3R", NULL, "OUT3R" }, { "SPKOUTLN", NULL, "OUT4L" }, { "SPKOUTLP", NULL, "OUT4L" },
Greg Kroah-Hartman
maintainerPATCH 17/144 ALSA: Add SNDRV_PCM_STATE_PAUSED case in wait_for_avail function
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: JongHo Kim <[email protected]>
commit ed697e1aaf7237b1a62af39f64463b05c262808d upstream.
When the process is sleeping at the SNDRV_PCM_STATE_PAUSED state from the wait_for_avail function, the sleep process will be woken by timeout(10 seconds). Even if the sleep process wake up by timeout, by this patch, the process will continue with sleep and wait for the other state.
--- sound/core/pcm_lib.c | 2 ++ 1 file changed, 2 insertions(+)
sound/core/pcm_lib.c +2 -0
@@ -1937,6 +1937,8 @@ static int wait_for_avail(struct snd_pcmcase SNDRV_PCM_STATE_DISCONNECTED : err = -EBADFD ; goto _endloop; +case SNDRV_PCM_STATE_PAUSED : +continue ; }if (!tout) { snd_printd("%s write error (DMA or IRQ trouble?)\n",
Greg Kroah-Hartman
maintainerPATCH 18/144 ALSA: hda - Add enable_msi=0 workaround for four HP machines
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Henningsson <[email protected]>
commit 693e0cb052c607e2d41edf9e9f1fa99ff8c266c1 upstream.
While enabling these machines, we found we would sometimes lose an interrupt if we change hardware volume during playback, and that disabling msi fixed this issue. (Losing the interrupt caused underruns and crackling audio, as the one second timeout is usually bigger than the period size.)
The machines were all machines from HP, running AMD Hudson controller, and Realtek ALC282 codec.
--- sound/pci/hda/hda_intel.c | 4 ++++ 1 file changed, 4 insertions(+)
sound/pci/hda/hda_intel.c +4 -0
@@ -3430,6 +3430,10 @@ static void check_probe_mask(struct azx* white/black-list for enable_msi */ static struct snd_pci_quirk msi_black_list[] = { +SND_PCI_QUIRK (0x103c ,0x2191 ,"HP" ,0 ),/* AMD Hudson */ +SND_PCI_QUIRK (0x103c ,0x2192 ,"HP" ,0 ),/* AMD Hudson */ +SND_PCI_QUIRK (0x103c ,0x21f7 ,"HP" ,0 ),/* AMD Hudson */ +SND_PCI_QUIRK (0x103c ,0x21fa ,"HP" ,0 ),/* AMD Hudson */ SND_PCI_QUIRK (0x1043 ,0x81f2 ,"ASUS" ,0 ),/* Athlon64 X2 + nvidia */ SND_PCI_QUIRK (0x1043 ,0x81f6 ,"ASUS" ,0 ),/* nvidia */ SND_PCI_QUIRK (0x1043 ,0x822d ,"ASUS" ,0 ),/* Athlon64 X2 + nvidia MCP55 */
Greg Kroah-Hartman
maintainerPATCH 19/144 ALSA: hda - Add Dell headset detection quirk for three laptop models
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hui Wang <[email protected]>
commit c29cb5eb8157a0049c882672a7f941261f23ea34 upstream.
On the Dell machines with codec whose Subsystem Id is 0x10280610, 0x10280629 or 0x1028063e, no external microphone can be detected when plugging a 3-ring headset. If we add "model=dell-headset-multi" for the snd-hda-intel.ko, the problem will disappear.
The codecs on these machines belong to alc_269 family.
--- sound/pci/hda/patch_realtek.c | 3 +++ 1 file changed, 3 insertions(+)
sound/pci/hda/patch_realtek.c +3 -0
@@ -4004,10 +4004,13 @@ static const struct snd_pci_quirk alc269SND_PCI_QUIRK (0x1028 ,0x0606 ,"Dell" ,ALC269_FIXUP_DELL1_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1028 ,0x0608 ,"Dell" ,ALC269_FIXUP_DELL1_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1028 ,0x0609 ,"Dell" ,ALC269_FIXUP_DELL1_MIC_NO_PRESENCE ), +SND_PCI_QUIRK (0x1028 ,0x0610 ,"Dell" ,ALC269_FIXUP_DELL1_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1028 ,0x0613 ,"Dell" ,ALC269_FIXUP_DELL1_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1028 ,0x0614 ,"Dell Inspiron 3135" ,ALC269_FIXUP_DELL1_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1028 ,0x0616 ,"Dell Vostro 5470" ,ALC290_FIXUP_MONO_SPEAKERS ), +SND_PCI_QUIRK (0x1028 ,0x0629 ,"Dell" ,ALC269_FIXUP_DELL1_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1028 ,0x0638 ,"Dell Inspiron 5439" ,ALC290_FIXUP_MONO_SPEAKERS ), +SND_PCI_QUIRK (0x1028 ,0x063e ,"Dell" ,ALC269_FIXUP_DELL1_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1028 ,0x15cc ,"Dell X5 Precision" ,ALC269_FIXUP_DELL2_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1028 ,0x15cd ,"Dell X5 Precision" ,ALC269_FIXUP_DELL2_MIC_NO_PRESENCE ), SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
Greg Kroah-Hartman
maintainerPATCH 20/144 iio:imu:adis16400 fix pressure channel scan type
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jonathan Cameron <[email protected]>
commit 3425c0f7ac61f2fcfb7f2728e9b7ba7e27aec429 upstream.
A single channel in this driver was using the IIO_ST macro. This does not provide a parameter for setting the endianness of the channel. Thus this channel will have been reported as whatever is the native endianness of the cpu rather than big endian. This means it would be incorrect on little endian platforms.
--- drivers/iio/imu/adis16400_core.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/iio/imu/adis16400_core.c +6 -1
@@ -651,7 +651,12 @@ static const struct iio_chan_spec adis16 .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), .address = ADIS16448_BARO_OUT, .scan_index = ADIS16400_SCAN_BARO, - .scan_type =IIO_ST ('s' ,16 ,16 ,0 ), + .scan_type = { + .sign = 's', + .realbits = 16, + .storagebits = 16, + .endianness =IIO_BE , + }, },ADIS16400_TEMP_CHAN (ADIS16448_TEMP_OUT ,12 ),IIO_CHAN_SOFT_TIMESTAMP (11 )
Greg Kroah-Hartman
maintainerPATCH 21/144 iio:adc:ad7887 Fix channel reported endianness from cpu to big endian
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jonathan Cameron <[email protected]>
commit e39d99059ad7f75d7ae2d3c59055d3c476cdb0d9 upstream.
Note this also sets the endianness to big endian whereas it would previously have defaulted to the cpu endian. Hence technically this is a bug fix on LE platforms.
--- drivers/iio/adc/ad7887.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/iio/adc/ad7887.c +14 -2
@@ -211,7 +211,13 @@ static const struct ad7887_chip_info ad7 .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), .address = 1, .scan_index = 1, - .scan_type = IIO_ST('u', 12, 16, 0), + .scan_type = { + .sign = 'u', + .realbits = 12, + .storagebits = 16, + .shift = 0, + .endianness =IIO_BE , + }, }, .channel[1] = { .type = IIO_VOLTAGE,
@@ -221,7 +227,13 @@ static const struct ad7887_chip_info ad7 .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), .address = 0, .scan_index = 0, - .scan_type = IIO_ST('u', 12, 16, 0), + .scan_type = { + .sign = 'u', + .realbits = 12, + .storagebits = 16, + .shift = 0, + .endianness =IIO_BE , + }, }, .channel[2] = IIO_CHAN_SOFT_TIMESTAMP(2), .int_vref_mv = 2500,
Greg Kroah-Hartman
maintainerPATCH 22/144 serial: 8250_dw: add new ACPI IDs
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mika Westerberg <[email protected]>
commit d24c195f90cb1adb178d26d84c722d4b9e551e05 upstream.
Newer Intel PCHs with LPSS have the same Designware controllers than Haswell but ACPI IDs are different. Add these IDs to the driver list.
--- drivers/tty/serial/8250/8250_dw.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/tty/serial/8250/8250_dw.c +2 -0
@@ -417,6 +417,8 @@ MODULE_DEVICE_TABLE(of, dw8250_of_match)static const struct acpi_device_id dw8250_acpi_match[] = { {"INT33C4" ,0 }, {"INT33C5" ,0 }, + {"INT3434" ,0 }, + {"INT3435" ,0 }, {"80860F0A" ,0 }, { }, };
Greg Kroah-Hartman
maintainerPATCH 23/144 usb: serial: zte_ev: move support for ZTE AC2726 from zte_ev back to option
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Kunilov <[email protected]>
commit 52d0dc7597c89b2ab779f3dcb9b9bf0800dd9218 upstream.
ZTE AC2726 EVDO modem drops ppp connection every minute when driven by zte_ev but works fine when driven by option. Move the support for AC2726 back to option driver.
--- drivers/usb/serial/option.c | 2 ++ drivers/usb/serial/zte_ev.c | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/usb/serial/option.c +2 -0
@@ -251,6 +251,7 @@ static void option_instat_callback(struc#define ZTE_PRODUCT_MF628 0x0015#define ZTE_PRODUCT_MF626 0x0031#define ZTE_PRODUCT_MC2718 0xffe8 +#define ZTE_PRODUCT_AC2726 0xfff1#define BENQ_VENDOR_ID 0x04a5#define BENQ_PRODUCT_H10 0x4068
@@ -1453,6 +1454,7 @@ static const struct usb_device_id option { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x01) }, { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x05) }, { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x86, 0x10) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) }, { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) }, { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) },
drivers/usb/serial/zte_ev.c +1 -2
@@ -281,8 +281,7 @@ static const struct usb_device_id id_tab { USB_DEVICE(0x19d2, 0xfffd) }, { USB_DEVICE(0x19d2, 0xfffc) }, { USB_DEVICE(0x19d2, 0xfffb) }, -/* AC2726, AC8710_V3 */ - { USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0xfff1, 0xff, 0xff, 0xff) }, +/* AC8710_V3 */ { USB_DEVICE(0x19d2, 0xfff6) }, { USB_DEVICE(0x19d2, 0xfff7) }, { USB_DEVICE(0x19d2, 0xfff8) },
Greg Kroah-Hartman
maintainerPATCH 24/144 xhci: Limit the spurious wakeup fix only to HP machines
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 6962d914f317b119e0db7189199b21ec77a4b3e0 upstream.
We've got regression reports that my previous fix for spurious wakeups after S5 on HP Haswell machines leads to the automatic reboot at shutdown on some machines. It turned out that the fix for one side triggers another BIOS bug in other side. So, it's exclusive.
Since the original S5 wakeups have been confirmed only on HP machines, it'd be safer to apply it only to limited machines. As a wild guess, limiting to machines with HP PCI SSID should suffice.
This patch should be backported to kernels as old as 3.12, that contain the commit 638298dc66ea36623dbc2757a24fc2c4ab41b016 "xhci: Fix spurious wakeups after S5 on Haswell".
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=66171
--- drivers/usb/host/xhci-pci.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/usb/host/xhci-pci.c +6 -1
@@ -128,7 +128,12 @@ static void xhci_pci_quirks(struct devic* any other sleep) on Haswell machines with LPT and LPT-LP * with the new Intel BIOS */ - xhci->quirks |=XHCI_SPURIOUS_WAKEUP ; +/* Limit the quirk to only known vendors, as this triggers +* yet another BIOS bug on some other machines +* https://bugzilla.kernel.org/show_bug.cgi?id=66171 +*/ +if (pdev->subsystem_vendor ==PCI_VENDOR_ID_HP ) + xhci->quirks |=XHCI_SPURIOUS_WAKEUP ; }if (pdev->vendor ==PCI_VENDOR_ID_ETRON && pdev->device ==PCI_DEVICE_ID_ASROCK_P67 ) {
Greg Kroah-Hartman
maintainerPATCH 25/144 can: peak_usb: fix mem leak in pcan_usb_pro_init()
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Kleine-Budde <[email protected]>
commit 20fb4eb96fb0350d28fc4d7cbfd5506711079592 upstream.
This patch fixes a memory leak in pcan_usb_pro_init(). In patch
f14e224 net: can: peak_usb: Do not do dma on the stack
the struct pcan_usb_pro_fwinfo *fi and struct pcan_usb_pro_blinfo *bi were converted from stack to dynamic allocation va kmalloc(). However the corresponding kfree() was not introduced.
This patch adds the missing kfree().
--- drivers/net/can/usb/peak_usb/pcan_usb_pro.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/can/usb/peak_usb/pcan_usb_pro.c +3 -0
@@ -927,6 +927,9 @@ static int pcan_usb_pro_init(struct peak/* set LED in default state (end of init phase) */ pcan_usb_pro_set_led (dev,0 ,1 ); +kfree (bi); +kfree (fi); +return 0 ; err_out:
Greg Kroah-Hartman
maintainerPATCH 27/144 usb: chipidea: host: Only disable the vbus regulator if it is not NULL
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fabio Estevam <[email protected]>
commit cc5c9eb67f912cb2c349b04063ff9f444affbc59 upstream.
Commit 40ed51a4b (usb: chipidea: host: add vbus regulator control) introduced a smatch complaint because regulator_disable() is called without checking whether ci->platdata->reg_vbus is not NULL.
Fix this by adding the check.
This patch is needed for 3.12 stable
--- drivers/usb/chipidea/host.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/chipidea/host.c +2 -1
@@ -88,7 +88,8 @@ static int host_start(struct ci_hdrc *cireturn ret; disable_reg: -regulator_disable (ci->platdata->reg_vbus); +if (ci->platdata->reg_vbus) +regulator_disable (ci->platdata->reg_vbus); put_hcd:usb_put_hcd (hcd);
Greg Kroah-Hartman
maintainerPATCH 28/144 usb: chipidea: fix nobody cared IRQ when booting with host role
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Chen <[email protected]>
commit 5a1e1456fc633da5291285b1fff75d2a7507375b upstream.
If we connect Male-A-To-Male-A cable between otg-host and host pc, the ci->vbus_active is set wrongly, and cause the controller run at peripheral mode when we load gadget module (ci_udc_start will be run), but the software runs at host mode due to id = 0. The ehci_irq can't handle suspend (USBi_SLI) interrupt which is enabled for peripheral mode, it causes no one will handle irq error.
This patch is needed for 3.12 stable
--- drivers/usb/chipidea/core.c | 4 ++++ drivers/usb/chipidea/udc.c | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/usb/chipidea/core.c +4 -0
@@ -575,6 +575,10 @@ static int ci_hdrc_probe(struct platform : CI_ROLE_GADGET; } +/* only update vbus status for peripheral */ +if (ci->role ==CI_ROLE_GADGET ) +ci_handle_vbus_change (ci); + ret =ci_role_start (ci, ci->role);if (ret) {dev_err (dev,"can't start %s role\n" ,ci_role (ci)->name);
drivers/usb/chipidea/udc.c +0 -3
@@ -1818,9 +1818,6 @@ static int udc_start(struct ci_hdrc *ci)pm_runtime_no_callbacks (&ci->gadget.dev);pm_runtime_enable (&ci->gadget.dev); -/* Update ci->vbus_active */ -ci_handle_vbus_change (ci); -return retval; remove_trans:
Greg Kroah-Hartman
maintainerPATCH 29/144 usb: musb: core: Call dma_controller_destroy() in error path only once.
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <[email protected]>
commit 8d1aad7485e653c2c5fd985b326096f680f7d918 upstream.
In commit f3ce4d5 ("usb: musb: core: call dma_controller_destroy() in the err path") I erroneously assumed that the dma controller is not removed in the error patch. This was wrong because it happens later via musb_free(). That means the original commit can be reverted because it is wrong or we do this, so it is more obvious.
--- drivers/usb/musb/musb_core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/usb/musb/musb_core.c +3 -2
@@ -1810,8 +1810,6 @@ static void musb_free(struct musb *musb)free_irq (musb->nIrq, musb); }cancel_work_sync (&musb->irq_work); -if (musb->dma_controller) -dma_controller_destroy (musb->dma_controller);musb_host_free (musb); }
@@ -2036,6 +2034,9 @@ static int musb_remove(struct platform_dmusb_exit_debugfs (musb);musb_shutdown (pdev); +if (musb->dma_controller) +dma_controller_destroy (musb->dma_controller); +musb_free (musb);device_init_wakeup (dev,0 );return 0 ;
Greg Kroah-Hartman
maintainerPATCH 30/144 usb: musb: only cancel work if it is initialized
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <[email protected]>
commit 66fadea5b79c07154126bb0db375be915f611246 upstream.
Since commit c5340bd14 ("usb: musb: cancel work on removal") the workqueue is cancelled but then if we bail out before the workqueue is setup we get this:
|INFO: trying to register non-static key. |the code is fine but needs lockdep annotation. |turning off the locking correctness validator. |CPU: 0 PID: 708 Comm: modprobe Not tainted 3.12.0+ #435 |[<c00867bc>] (lock_acquire+0xf0/0x108) from [<c00529d0>] (flush_work+0x38/0x2ec) |[<c00529d0>] (flush_work+0x38/0x2ec) from [<c0052d24>] (__cancel_work_timer+0xa0/0x134) |[<c0052d24>] (__cancel_work_timer+0xa0/0x134) from [<bf0e4ae4>] (musb_free+0x40/0x60 [musb_hdrc]) |[<bf0e4ae4>] (musb_free+0x40/0x60 [musb_hdrc]) from [<bf0e5364>] (musb_probe+0x678/0xb78 [musb_hdrc]) |[<bf0e5364>] (musb_probe+0x678/0xb78 [musb_hdrc]) from [<c0294bf0>] (platform_drv_probe+0x1c/0x24) |[<c0294bf0>] (platform_drv_probe+0x1c/0x24) from [<c0293970>] (driver_probe_device+0x90/0x224) |[<c0293970>] (driver_probe_device+0x90/0x224) from [<c0291ef0>] (bus_for_each_drv+0x60/0x8c) |[<c0291ef0>] (bus_for_each_drv+0x60/0x8c) from [<c02938bc>] (device_attach+0x80/0xa4) |[<c02938bc>] (device_attach+0x80/0xa4) from [<c0292b24>] (bus_probe_device+0x88/0xac) |[<c0292b24>] (bus_probe_device+0x88/0xac) from [<c0291490>] (device_add+0x388/0x6c8) |[<c0291490>] (device_add+0x388/0x6c8) from [<c02952a0>] (platform_device_add+0x188/0x22c) |[<c02952a0>] (platform_device_add+0x188/0x22c) from [<bf11ea30>] (dsps_probe+0x294/0x394 [musb_dsps]) |[<bf11ea30>] (dsps_probe+0x294/0x394 [musb_dsps]) from [<c0294bf0>] (platform_drv_probe+0x1c/0x24) |platform musb-hdrc.1.auto: Driver musb-hdrc requests probe deferral |musb-hdrc musb-hdrc.1.auto: musb_init_controller failed with status -517
This patch moves the init part to earlier part so it can be cleaned as part of the fail3 label because now it is surrounded by the fail4 label. Step two is to remove it from musb_free() and add it to the two cleanup paths (error path and device removal) separately.
--- drivers/usb/musb/musb_core.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/usb/musb/musb_core.c +5 -4
@@ -1809,7 +1809,6 @@ static void musb_free(struct musb *musb)disable_irq_wake (musb->nIrq);free_irq (musb->nIrq, musb); } -cancel_work_sync (&musb->irq_work);musb_host_free (musb); }
@@ -1891,6 +1890,9 @@ musb_init_controller(struct device *dev,musb_platform_disable (musb);musb_generic_disable (musb); +/* Init IRQ workqueue before request_irq */ +INIT_WORK (&musb->irq_work, musb_irq_work); +/* setup musb parts of the core (especially endpoints) */ status = musb_core_init(plat->config->multipoint ? MUSB_CONTROLLER_MHDRC
@@ -1900,9 +1902,6 @@ musb_init_controller(struct device *dev,setup_timer (&musb->otg_timer, musb_otg_timer_func, (unsigned long ) musb); -/* Init IRQ workqueue before request_irq */ -INIT_WORK (&musb->irq_work, musb_irq_work); -/* attach to the IRQ */ if (request_irq (nIrq, musb->isr,0 ,dev_name (dev), musb)) {dev_err (dev,"request_irq %d failed!\n" , nIrq);
@@ -1976,6 +1975,7 @@ fail4:musb_host_cleanup (musb); fail3: +cancel_work_sync (&musb->irq_work);if (musb->dma_controller)dma_controller_destroy (musb->dma_controller);pm_runtime_put_sync (musb->controller);
@@ -2037,6 +2037,7 @@ static int musb_remove(struct platform_dif (musb->dma_controller)dma_controller_destroy (musb->dma_controller); +cancel_work_sync (&musb->irq_work);musb_free (musb);device_init_wakeup (dev,0 );return 0 ;
Greg Kroah-Hartman
maintainerPATCH 31/144 selinux: fix broken peer recv check
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chad Hanson <[email protected]>
commit 46d01d63221c3508421dd72ff9c879f61053cffc upstream.
Fix a broken networking check. Return an error if peer recv fails. If secmark is active and the packet recv succeeds the peer recv error is ignored.
--- security/selinux/hooks.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
security/selinux/hooks.c +3 -1
@@ -4297,8 +4297,10 @@ static int selinux_socket_sock_rcv_skb(s } err =avc_has_perm (sk_sid, peer_sid,SECCLASS_PEER ,PEER__RECV , &ad); -if (err) +if (err) {selinux_netlbl_err (skb, err,0 ); +return err; + } }if (secmark_active) {
Greg Kroah-Hartman
maintainerPATCH 32/144 selinux: selinux_setprocattr()->ptrace_parent() needs rcu_read_lock()
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleg Nesterov <[email protected]>
commit c0c1439541f5305b57a83d599af32b74182933fe upstream.
selinux_setprocattr() does ptrace_parent(p) under task_lock(p), but task_struct->alloc_lock doesn't pin ->parent or ->ptrace, this looks confusing and triggers the "suspicious RCU usage" warning because ptrace_parent() does rcu_dereference_check().
And in theory this is wrong, spin_lock()->preempt_disable() doesn't necessarily imply rcu_read_lock() we need to access the ->parent.
--- security/selinux/hooks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
security/selinux/hooks.c +2 -2
@@ -5523,11 +5523,11 @@ static int selinux_setprocattr(struct ta/* Check for ptracing, and update the task SID if ok. Otherwise, leave SID unchanged and fail. */ ptsid =0 ; -task_lock (p); +rcu_read_lock (); tracer =ptrace_parent (p);if (tracer) ptsid =task_sid (tracer); -task_unlock (p); +rcu_read_unlock ();if (tracer) { error = avc_has_perm(ptsid, sid, SECCLASS_PROCESS,
Greg Kroah-Hartman
maintainerPATCH 33/144 aio: fix kioctx leak introduced by "aio: Fix a trinity splat"
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin LaHaise <[email protected]>
commit 1881686f842065d2f92ec9c6424830ffc17d23b0 upstream.
e34ecee2ae791df674dfb466ce40692ca6218e43 reworked the percpu reference counting to correct a bug trinity found. Unfortunately, the change lead to kioctxes being leaked because there was no final reference count to put. Add that reference count back in to fix things.
--- fs/aio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/aio.c +2 -1
@@ -652,7 +652,8 @@ static struct kioctx *ioctx_alloc(unsign aio_nr += ctx->max_reqs;spin_unlock (&aio_nr_lock); -percpu_ref_get (&ctx->users);/* io_setup() will drop this ref */ +percpu_ref_get (&ctx->users);/* io_setup() will drop this ref */ +percpu_ref_get (&ctx->reqs);/* free_ioctx_users() will drop this */ err =ioctx_add_table (ctx, mm);if (err)
Greg Kroah-Hartman
maintainerPATCH 34/144 qla2xxx: Fix schedule_delayed_work() for target timeout calculations
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shivaram Upadhyayula <[email protected]>
commit 63832aabec12a28a41a221773ab3819d30ba0a67 upstream.
This patch fixes two cases in qla_target.c code where the schedule_delayed_work() value was being incorrectly calculated from sess->expires - jiffies.
--- drivers/scsi/qla2xxx/qla_target.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/scsi/qla2xxx/qla_target.c +5 -4
@@ -471,7 +471,7 @@ static void qlt_schedule_sess_for_deletischedule_delayed_work (&tgt->sess_del_work,0 ); else schedule_delayed_work(&tgt->sess_del_work, - jiffies - sess->expires); + sess->expires - jiffies); }/* ha->hardware_lock supposed to be held on entry */
@@ -550,13 +550,14 @@ static void qlt_del_sess_work_fn(structstruct scsi_qla_host *vha = tgt->vha;struct qla_hw_data *ha = vha->hw;struct qla_tgt_sess *sess; -unsigned long flags; +unsigned long flags, elapsed;spin_lock_irqsave (&ha->hardware_lock, flags);while (!list_empty (&tgt->del_sess_list)) { sess =list_entry (tgt->del_sess_list.next,typeof (*sess), del_list_entry); -if (time_after_eq (jiffies, sess->expires)) { + elapsed = jiffies; +if (time_after_eq (elapsed, sess->expires)) {qlt_undelete_sess (sess); ql_dbg(ql_dbg_tgt_mgt, vha, 0xf004,
@@ -566,7 +567,7 @@ static void qlt_del_sess_work_fn(struct ha->tgt.tgt_ops->put_sess (sess); }else {schedule_delayed_work (&tgt->sess_del_work, - jiffies - sess->expires); + sess->expires - elapsed);break ; } }
Greg Kroah-Hartman
maintainerPATCH 35/144 iser-target: fix error return code in isert_create_device_ib_res()
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Yongjun <[email protected]>
commit 94a7111043d99819cd0a72d9b3174c7054adb2a0 upstream.
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.
--- drivers/infiniband/ulp/isert/ib_isert.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/infiniband/ulp/isert/ib_isert.c +12 -4
@@ -263,21 +263,29 @@ isert_create_device_ib_res(struct isert_ isert_cq_event_callback, (void *)&cq_desc[i], ISER_MAX_RX_CQ_LEN, i); -if (IS_ERR (device->dev_rx_cq[i])) +if (IS_ERR (device->dev_rx_cq[i])) { + ret =PTR_ERR (device->dev_rx_cq[i]); + device->dev_rx_cq[i] =NULL ; goto out_cq; + } device->dev_tx_cq[i] =ib_create_cq (device->ib_device, isert_cq_tx_callback, isert_cq_event_callback, (void *)&cq_desc[i],ISER_MAX_TX_CQ_LEN , i); -if (IS_ERR (device->dev_tx_cq[i])) +if (IS_ERR (device->dev_tx_cq[i])) { + ret =PTR_ERR (device->dev_tx_cq[i]); + device->dev_tx_cq[i] =NULL ; goto out_cq; + } -if (ib_req_notify_cq (device->dev_rx_cq[i],IB_CQ_NEXT_COMP )) + ret =ib_req_notify_cq (device->dev_rx_cq[i],IB_CQ_NEXT_COMP ); +if (ret) goto out_cq; -if (ib_req_notify_cq (device->dev_tx_cq[i],IB_CQ_NEXT_COMP )) + ret =ib_req_notify_cq (device->dev_tx_cq[i],IB_CQ_NEXT_COMP ); +if (ret) goto out_cq; }
Greg Kroah-Hartman
maintainerPATCH 36/144 iscsi-target: Fix-up all zero data-length CDBs with R/W_BIT set
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Bellinger <[email protected]>
commit 4454b66cb67f14c33cd70ddcf0ff4985b26324b7 upstream.
This patch changes special case handling for ISCSI_OP_SCSI_CMD where an initiator sends a zero length Expected Data Transfer Length (EDTL), but still sets the WRITE and/or READ flag bits when no payload transfer is requested.
Many, many moons ago two special cases where added for an ancient version of ESX that has long since been fixed, so instead of adding a new special case for the reported bug with a Broadcom 57800 NIC, go ahead and always strip off the incorrect WRITE + READ flag bits.
Also, avoid sending a reject here, as RFC-3720 does mandate this case be handled without protocol error.
--- drivers/target/iscsi/iscsi_target.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-)
drivers/target/iscsi/iscsi_target.c +12 -14
@@ -830,24 +830,22 @@ int iscsit_setup_scsi_cmd(struct iscsi_cif (((hdr->flags &ISCSI_FLAG_CMD_READ ) || (hdr->flags &ISCSI_FLAG_CMD_WRITE )) && !hdr->data_length) {/* -* Vmware ESX v3.0 uses a modified Cisco Initiator (v3.4.2) -* that adds support for RESERVE/RELEASE. There is a bug -* add with this new functionality that sets R/W bits when -* neither CDB carries any READ or WRITE datapayloads. +* From RFC-3720 Section 10.3.1: +* +* "Either or both of R and W MAY be 1 when either the +* Expected Data Transfer Length and/or Bidirectional Read +* Expected Data Transfer Length are 0" +* +* For this case, go ahead and clear the unnecssary bits +* to avoid any confusion with ->data_direction. */ -if ((hdr->cdb[0 ] ==0x16 ) || (hdr->cdb[0 ] ==0x17 )) { - hdr->flags &= ~ISCSI_FLAG_CMD_READ ; - hdr->flags &= ~ISCSI_FLAG_CMD_WRITE ; - goto done; - } + hdr->flags &= ~ISCSI_FLAG_CMD_READ ; + hdr->flags &= ~ISCSI_FLAG_CMD_WRITE ; -pr_err ("ISCSI_FLAG_CMD_READ or ISCSI_FLAG_CMD_WRITE" +pr_warn ("ISCSI_FLAG_CMD_READ or ISCSI_FLAG_CMD_WRITE" " set when Expected Data Transfer Length is 0 for" -" CDB: 0x%02x. Bad iSCSI Initiator.\n" , hdr->cdb[0 ]); -return iscsit_add_reject_cmd (cmd, -ISCSI_REASON_BOOKMARK_INVALID , buf); +" CDB: 0x%02x, Fixing up flags\n" , hdr->cdb[0 ]); } -done:if (!(hdr->flags &ISCSI_FLAG_CMD_READ ) && !(hdr->flags &ISCSI_FLAG_CMD_WRITE ) && (hdr->data_length !=0 )) {
Greg Kroah-Hartman
maintainerPATCH 37/144 iscsi-target: Fix incorrect np->np_thread NULL assignment
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Bellinger <[email protected]>
commit db6077fd0b7dd41dc6ff18329cec979379071f87 upstream.
When shutting down a target there is a race condition between iscsit_del_np() and __iscsi_target_login_thread(). The latter sets the thread pointer to NULL, and the former tries to issue kthread_stop() on that pointer without any synchronization.
This patch moves the np->np_thread NULL assignment into iscsit_del_np(), after kthread_stop() has completed. It also removes the signal_pending() + np_state check, and only exits when kthread_should_stop() is true.
--- drivers/target/iscsi/iscsi_target.c | 1 + drivers/target/iscsi/iscsi_target_login.c | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-)
drivers/target/iscsi/iscsi_target.c +1 -0
@@ -465,6 +465,7 @@ int iscsit_del_np(struct iscsi_np *np)*/ send_sig (SIGINT , np->np_thread,1 );kthread_stop (np->np_thread); + np->np_thread =NULL ; } np->np_transport->iscsit_free_np (np);
drivers/target/iscsi/iscsi_target_login.c +0 -6
@@ -1404,11 +1404,6 @@ old_sess_out: out: stop =kthread_should_stop (); -if (!stop &&signal_pending (current)) { -spin_lock_bh (&np->np_thread_lock); - stop = (np->np_thread_state ==ISCSI_NP_THREAD_SHUTDOWN ); -spin_unlock_bh (&np->np_thread_lock); - }/* Wait for another socket.. */ if (!stop)return 1 ;
@@ -1416,7 +1411,6 @@ exit:iscsi_stop_login_thread_timer (np);spin_lock_bh (&np->np_thread_lock); np->np_thread_state =ISCSI_NP_THREAD_EXIT ; - np->np_thread =NULL ;spin_unlock_bh (&np->np_thread_lock);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 38/144 iser-target: Move INIT_WORK setup into isert_create_device_ib_res
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Bellinger <[email protected]>
commit 2853c2b6671509591be09213954d7249ca6ff224 upstream.
This patch moves INIT_WORK setup for cq_desc->cq_[rx,tx]_work into isert_create_device_ib_res(), instead of being done each callback invocation in isert_cq_[rx,tx]_callback().
This also fixes a 'INFO: trying to register non-static key' warning when cancel_work_sync() is called before INIT_WORK has setup the struct work_struct.
--- drivers/infiniband/ulp/isert/ib_isert.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/infiniband/ulp/isert/ib_isert.c +4 -2
@@ -206,7 +206,9 @@ isert_free_rx_descriptors(struct isert_c isert_conn->conn_rx_descs =NULL ; } +static void isert_cq_tx_work (struct work_struct *);static void isert_cq_tx_callback (struct ib_cq *,void *); +static void isert_cq_rx_work (struct work_struct *);static void isert_cq_rx_callback (struct ib_cq *,void *); static int
@@ -258,6 +260,7 @@ isert_create_device_ib_res(struct isert_ cq_desc[i].device = device; cq_desc[i].cq_index = i; +INIT_WORK (&cq_desc[i].cq_rx_work, isert_cq_rx_work); device->dev_rx_cq[i] = ib_create_cq(device->ib_device, isert_cq_rx_callback, isert_cq_event_callback,
@@ -269,6 +272,7 @@ isert_create_device_ib_res(struct isert_ goto out_cq; } +INIT_WORK (&cq_desc[i].cq_tx_work, isert_cq_tx_work); device->dev_tx_cq[i] = ib_create_cq(device->ib_device, isert_cq_tx_callback, isert_cq_event_callback,
@@ -1694,7 +1698,6 @@ isert_cq_tx_callback(struct ib_cq *cq, v {struct isert_cq_desc *cq_desc = (struct isert_cq_desc *)context; -INIT_WORK (&cq_desc->cq_tx_work, isert_cq_tx_work);queue_work (isert_comp_wq, &cq_desc->cq_tx_work); }
@@ -1738,7 +1741,6 @@ isert_cq_rx_callback(struct ib_cq *cq, v {struct isert_cq_desc *cq_desc = (struct isert_cq_desc *)context; -INIT_WORK (&cq_desc->cq_rx_work, isert_cq_rx_work);queue_work (isert_rx_wq, &cq_desc->cq_rx_work); }
Greg Kroah-Hartman
maintainerPATCH 39/144 target/file: Update hw_max_sectors based on current block_size
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Bellinger <[email protected]>
commit 95cadace8f3959282e76ebf8b382bd0930807d2c upstream.
This patch allows FILEIO to update hw_max_sectors based on the current max_bytes_per_io. This is required because vfs_[writev,readv]() can accept a maximum of 2048 iovecs per call, so the enforced hw_max_sectors really needs to be calculated based on block_size.
This addresses a >= v3.5 bug where block_size=512 was rejecting > 1M sized I/O requests, because FD_MAX_SECTORS was hardcoded to 2048 for the block_size=4096 case.
(v2: Use max_bytes_per_io instead of ->update_hw_max_sectors)
--- drivers/target/target_core_device.c | 5 +++++ drivers/target/target_core_file.c | 8 ++++---- drivers/target/target_core_file.h | 5 ++++- include/target/target_core_base.h | 1 + 4 files changed, 14 insertions(+), 5 deletions(-)
drivers/target/target_core_device.c +5 -0
@@ -1107,6 +1107,11 @@ int se_dev_set_block_size(struct se_devi dev->dev_attrib.block_size = block_size;pr_debug ("dev[%p]: SE Device block_size changed to %u\n" , dev, block_size); + +if (dev->dev_attrib.max_bytes_per_io) + dev->dev_attrib.hw_max_sectors = + dev->dev_attrib.max_bytes_per_io / block_size; +return 0 ; }
drivers/target/target_core_file.c +4 -4
@@ -66,9 +66,8 @@ static int fd_attach_hba(struct se_hba *pr_debug ("CORE_HBA[%d] - TCM FILEIO HBA Driver %s on Generic" " Target Core Stack %s\n" , hba->hba_id,FD_VERSION ,TARGET_CORE_MOD_VERSION ); -pr_debug ("CORE_HBA[%d] - Attached FILEIO HBA: %u to Generic" -" MaxSectors: %u\n" , - hba->hba_id, fd_host->fd_host_id,FD_MAX_SECTORS ); +pr_debug ("CORE_HBA[%d] - Attached FILEIO HBA: %u to Generic\n" , + hba->hba_id, fd_host->fd_host_id);return 0 ; }
@@ -220,7 +219,8 @@ static int fd_configure_device(struct se } dev->dev_attrib.hw_block_size = fd_dev->fd_block_size; - dev->dev_attrib.hw_max_sectors =FD_MAX_SECTORS ; + dev->dev_attrib.max_bytes_per_io =FD_MAX_BYTES ; + dev->dev_attrib.hw_max_sectors =FD_MAX_BYTES / fd_dev->fd_block_size; dev->dev_attrib.hw_queue_depth =FD_MAX_DEVICE_QUEUE_DEPTH ;if (fd_dev->fbd_flags &FDBD_HAS_BUFFERED_IO_WCE ) {
drivers/target/target_core_file.h +4 -1
@@ -7,7 +7,10 @@#define FD_DEVICE_QUEUE_DEPTH 32#define FD_MAX_DEVICE_QUEUE_DEPTH 128#define FD_BLOCKSIZE 512 -#define FD_MAX_SECTORS 2048 +/* +* Limited by the number of iovecs (2048) per vfs_[writev,readv] call +*/ +#define FD_MAX_BYTES 8388608#define RRF_EMULATE_CDB 0x01#define RRF_GOT_LBA 0x02
include/target/target_core_base.h +1 -0
@@ -624,6 +624,7 @@ struct se_dev_attrib {u32 unmap_granularity;u32 unmap_granularity_alignment;u32 max_write_same_len; +u32 max_bytes_per_io;struct se_device *da_dev;struct config_group da_group; };
Greg Kroah-Hartman
maintainerPATCH 40/144 xfs: fix infinite loop by detaching the group/project hints from user dquot
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jie Liu <[email protected]>
commit 718cc6f88cbfc4fbd39609f28c4c86883945f90d upstream.
xfs_quota(8) will hang up if trying to turn group/project quota off before the user quota is off, this could be 100% reproduced by:
# mount -ouquota,gquota /dev/sda7 /xfs # mkdir /xfs/test # xfs_quota -xc 'off -g' /xfs <-- hangs up # echo w > /proc/sysrq-trigger # dmesg
SysRq : Show Blocked State
task PC stack pid father
xfs_quota D 0000000000000000 0 27574 2551 0x00000000
[snip]
Call Trace: [<ffffffff81aaa21d>] schedule+0xad/0xc0 [<ffffffff81aa327e>] schedule_timeout+0x35e/0x3c0 [<ffffffff8114b506>] ? mark_held_locks+0x176/0x1c0 [<ffffffff810ad6c0>] ? call_timer_fn+0x2c0/0x2c0 [<ffffffffa0c25380>] ? xfs_qm_shrink_count+0x30/0x30 [xfs] [<ffffffff81aa3306>] schedule_timeout_uninterruptible+0x26/0x30 [<ffffffffa0c26155>] xfs_qm_dquot_walk+0x235/0x260 [xfs] [<ffffffffa0c059d8>] ? xfs_perag_get+0x1d8/0x2d0 [xfs] [<ffffffffa0c05805>] ? xfs_perag_get+0x5/0x2d0 [xfs] [<ffffffffa0b7707e>] ? xfs_inode_ag_iterator+0xae/0xf0 [xfs] [<ffffffffa0c22280>] ? xfs_trans_free_dqinfo+0x50/0x50 [xfs] [<ffffffffa0b7709f>] ? xfs_inode_ag_iterator+0xcf/0xf0 [xfs] [<ffffffffa0c261e6>] xfs_qm_dqpurge_all+0x66/0xb0 [xfs] [<ffffffffa0c2497a>] xfs_qm_scall_quotaoff+0x20a/0x5f0 [xfs] [<ffffffffa0c2b8f6>] xfs_fs_set_xstate+0x136/0x180 [xfs] [<ffffffff8136cf7a>] do_quotactl+0x53a/0x6b0 [<ffffffff812fba4b>] ? iput+0x5b/0x90 [<ffffffff8136d257>] SyS_quotactl+0x167/0x1d0 [<ffffffff814cf2ee>] ? trace_hardirqs_on_thunk+0x3a/0x3f [<ffffffff81abcd19>] system_call_fastpath+0x16/0x1b
It's fine if we turn user quota off at first, then turn off other kind of quotas if they are enabled since the group/project dquot refcount is decreased to zero once the user quota if off. Otherwise, those dquots refcount is non-zero due to the user dquot might refer to them as hint(s). Hence, above operation cause an infinite loop at xfs_qm_dquot_walk() while trying to purge dquot cache.
This problem has been around since Linux 3.4, it was introduced by:
[ b84a3a9675 xfs: remove the per-filesystem list of dquots ]
Originally we will release the group dquot pointers because the user dquots maybe carrying around as a hint via xfs_qm_detach_gdquots(). However, with above change, there is no such work to be done before purging group/project dquot cache.
In order to solve this problem, this patch introduces a special routine xfs_qm_dqpurge_hints(), and it would release the group/project dquot pointers the user dquots maybe carrying around as a hint, and then it will proceed to purge the user dquot cache if requested.
(cherry picked from commit df8052e7dae00bde6f21b40b6e3e1099770f3afc)
--- fs/xfs/xfs_qm.c | 71 +++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 50 insertions(+), 21 deletions(-)
fs/xfs/xfs_qm.c +50 -21
@@ -137,8 +137,6 @@ xfs_qm_dqpurge( {struct xfs_mount *mp = dqp->q_mount;struct xfs_quotainfo *qi = mp->m_quotainfo; -struct xfs_dquot *gdqp =NULL ; -struct xfs_dquot *pdqp =NULL ;xfs_dqlock (dqp);if ((dqp->dq_flags &XFS_DQ_FREEING ) || dqp->q_nrefs !=0 ) {
@@ -146,21 +144,6 @@ xfs_qm_dqpurge(return EAGAIN ; } -/* -* If this quota has a hint attached, prepare for releasing it now. -*/ - gdqp = dqp->q_gdquot; -if (gdqp) { -xfs_dqlock (gdqp); - dqp->q_gdquot =NULL ; - } - - pdqp = dqp->q_pdquot; -if (pdqp) { -xfs_dqlock (pdqp); - dqp->q_pdquot =NULL ; - } - dqp->dq_flags |=XFS_DQ_FREEING ;xfs_dqflock (dqp);
@@ -209,11 +192,47 @@ xfs_qm_dqpurge(XFS_STATS_DEC (xs_qm_dquot_unused);xfs_qm_dqdestroy (dqp); +return 0 ; +} + +/* +* Release the group or project dquot pointers the user dquots maybe carrying +* around as a hint, and proceed to purge the user dquot cache if requested. +*/ +STATIC int +xfs_qm_dqpurge_hints ( +struct xfs_dquot *dqp, +void *data) +{ +struct xfs_dquot *gdqp =NULL ; +struct xfs_dquot *pdqp =NULL ; +uint flags = *((uint *)data); + +xfs_dqlock (dqp); +if (dqp->dq_flags &XFS_DQ_FREEING ) { +xfs_dqunlock (dqp); +return EAGAIN ; + } + +/* If this quota has a hint attached, prepare for releasing it now */ + gdqp = dqp->q_gdquot; +if (gdqp) + dqp->q_gdquot =NULL ; + + pdqp = dqp->q_pdquot; +if (pdqp) + dqp->q_pdquot =NULL ; + +xfs_dqunlock (dqp);if (gdqp) -xfs_qm_dqput (gdqp); +xfs_qm_dqrele (gdqp);if (pdqp) -xfs_qm_dqput (pdqp); +xfs_qm_dqrele (pdqp); + +if (flags &XFS_QMOPT_UQUOTA ) +return xfs_qm_dqpurge (dqp,NULL ); +return 0 ; }
@@ -225,8 +244,18 @@ xfs_qm_dqpurge_all( struct xfs_mount *mp, uint flags) { -if (flags &XFS_QMOPT_UQUOTA ) -xfs_qm_dquot_walk (mp,XFS_DQ_USER , xfs_qm_dqpurge,NULL ); +/* +* We have to release group/project dquot hint(s) from the user dquot +* at first if they are there, otherwise we would run into an infinite +* loop while walking through radix tree to purge other type of dquots +* since their refcount is not zero if the user dquot refers to them +* as hint. +* +* Call the special xfs_qm_dqpurge_hints() will end up go through the +* general xfs_qm_dqpurge() against user dquot cache if requested. +*/ +xfs_qm_dquot_walk (mp,XFS_DQ_USER , xfs_qm_dqpurge_hints, &flags); +if (flags &XFS_QMOPT_GQUOTA )xfs_qm_dquot_walk (mp,XFS_DQ_GROUP , xfs_qm_dqpurge,NULL );if (flags &XFS_QMOPT_PQUOTA )
Greg Kroah-Hartman
maintainerPATCH 41/144 ftrace: Initialize the ftrace profiler for each possible cpu
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miao Xie <[email protected]>
commit c4602c1c818bd6626178d6d3fcc152d9f2f48ac0 upstream.
Ftrace currently initializes only the online CPUs. This implementation has two problems:
- If we online a CPU after we enable the function profile, and then run the test, we will lose the trace information on that CPU.
Steps to reproduce:
# echo 0 > /sys/devices/system/cpu/cpu1/online # cd <debugfs>/tracing/ # echo <some function name> >> set_ftrace_filter # echo 1 > function_profile_enabled # echo 1 > /sys/devices/system/cpu/cpu1/online # run test - If we offline a CPU before we enable the function profile, we will not clear the trace information when we enable the function profile. It will trouble the users. Steps to reproduce: # cd <debugfs>/tracing/ # echo <some function name> >> set_ftrace_filter # echo 1 > function_profile_enabled # run test # cat trace_stat/function* # echo 0 > /sys/devices/system/cpu/cpu1/online # echo 0 > function_profile_enabled # echo 1 > function_profile_enabled # cat trace_stat/function* # run test # cat trace_stat/function*
So it is better that we initialize the ftrace profiler for each possible cpu every time we enable the function profile instead of just the online ones.
--- kernel/trace/ftrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/ftrace.c +1 -1
@@ -775,7 +775,7 @@ static int ftrace_profile_init(void)int cpu;int ret =0 ; -for_each_online_cpu (cpu) { +for_each_possible_cpu (cpu) { ret =ftrace_profile_init_cpu (cpu);if (ret)break ;
Greg Kroah-Hartman
maintainerPATCH 42/144 scripts/link-vmlinux.sh: only filter kernel symbols for arm
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ming Lei <[email protected]>
commit 7122c3e9154b5d9a7422f68f02d8acf050fad2b0 upstream.
Actually CONFIG_PAGE_OFFSET isn't same with PAGE_OFFSET, so it isn't easy to figue out PAGE_OFFSET defined in header file from scripts.
Because CONFIG_PAGE_OFFSET may not be defined in some ARCHs( 64bit ARCH), or defined as bogus value in !MMU case, so this patch only applys the filter on ARM when CONFIG_PAGE_OFFSET is defined as the original problem is only on ARM.
--- scripts/link-vmlinux.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
scripts/link-vmlinux.sh +3 -1
@@ -82,7 +82,9 @@ kallsyms() kallsymopt="${kallsymopt} --all-symbols" fi - kallsymopt="${kallsymopt} --page-offset=$CONFIG_PAGE_OFFSET" + if [ -n "${CONFIG_ARM}" ] && [ -n "${CONFIG_PAGE_OFFSET}" ]; then + kallsymopt="${kallsymopt} --page-offset=$CONFIG_PAGE_OFFSET" + fi local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} \ ${NOSTDINC_FLAGS} ${LINUXINCLUDE} ${KBUILD_CPPFLAGS}"
Greg Kroah-Hartman
maintainerPATCH 43/144 arm64: ptrace: avoid using HW_BREAKPOINT_EMPTY for disabled events
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <[email protected]>
commit cdc27c27843248ae7eb0df5fc261dd004eaa5670 upstream.
Commit 8f34a1da35ae ("arm64: ptrace: use HW_BREAKPOINT_EMPTY type for disabled breakpoints") fixed an issue with GDB trying to zero breakpoint control registers. The problem there is that the arch hw_breakpoint code will attempt to create a (disabled), execute breakpoint of length 0.
This will fail validation and report unexpected failure to GDB. To avoid this, we treated disabled breakpoints as HW_BREAKPOINT_EMPTY, but that seems to have broken with recent kernels, causing watchpoints to be treated as TYPE_INST in the core code and returning ENOSPC for any further breakpoints.
This patch fixes the problem by prioritising the `enable' field of the
breakpoint: if it is cleared, we simply update the perf_event_attr to indicate that the thing is disabled and don't bother changing either the type or the length. This reinforces the behaviour that the breakpoint control register is essentially read-only apart from the enable bit when disabling a breakpoint.
--- arch/arm64/kernel/ptrace.c | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-)
arch/arm64/kernel/ptrace.c +17 -19
@@ -214,31 +214,29 @@ static int ptrace_hbp_fill_attr_ctrl(uns {int err, len, type, disabled = !ctrl.enabled; -if (disabled) { - len =0 ; - type =HW_BREAKPOINT_EMPTY ; - }else { - err =arch_bp_generic_fields (ctrl, &len, &type); -if (err) -return err; + attr->disabled = disabled; +if (disabled) +return 0 ; -switch (note_type) { -case NT_ARM_HW_BREAK : -if ((type &HW_BREAKPOINT_X ) != type) -return -EINVAL ; -break ; -case NT_ARM_HW_WATCH : -if ((type &HW_BREAKPOINT_RW ) != type) -return -EINVAL ; -break ; -default : + err =arch_bp_generic_fields (ctrl, &len, &type); +if (err) +return err; + +switch (note_type) { +case NT_ARM_HW_BREAK : +if ((type &HW_BREAKPOINT_X ) != type) +return -EINVAL ; +break ; +case NT_ARM_HW_WATCH : +if ((type &HW_BREAKPOINT_RW ) != type)return -EINVAL ; - } +break ; +default : +return -EINVAL ; } attr->bp_len = len; attr->bp_type = type; - attr->disabled = disabled;return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 44/144 ARM: shmobile: r8a7790: fix shdi resource sizes
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Dooks <[email protected]>
commit d721a15c300c5f638a11573a6dd492158e737d6a upstream.
The r8a7790.dtsi file has four sdhi nodes which the first two have the wrong resource size for their register block. This causes the sh_modbile_sdhi driver to fail to communicate with card at-all.
Change sdhi{0,1} node size from 0x100 to 0x200 to correct these nodes as per Kuninori Morimoto's response to the original patch where all four nodes where changed. sdhi{2,3} are the correct size.
This bug has been present since sdhi resources were added to the r8a7790 by 8c9b1aa41853272a ("ARM: shmobile: r8a7790: add MMCIF and SDHI DT templates") in v3.11-rc2.
--- arch/arm/boot/dts/r8a7790.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/r8a7790.dtsi +2 -2
@@ -152,7 +152,7 @@ sdhi0: sdhi@ee100000 { compatible = "renesas,sdhi-r8a7790"; - reg = <0 0xee100000 0 0x100>; + reg = <0 0xee100000 0 0x200>; interrupt-parent = <&gic>; interrupts = <0 165 4>; cap-sd-highspeed;
@@ -161,7 +161,7 @@ sdhi1: sdhi@ee120000 { compatible = "renesas,sdhi-r8a7790"; - reg = <0 0xee120000 0 0x100>; + reg = <0 0xee120000 0 0x200>; interrupt-parent = <&gic>; interrupts = <0 166 4>; cap-sd-highspeed;
Greg Kroah-Hartman
maintainerPATCH 45/144 ARM: DRA7: hwmod: Fix boot crash with DEBUG_LL
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rajendra Nayak <[email protected]>
commit 38958c15dc640a9249e4f0cd0dfb0ddc7a23464d upstream.
With commit '7dedd34: ARM: OMAP2+: hwmod: Fix a crash in _setup_reset() with
DEBUG_LL' we moved from parsing cmdline to identify uart used for earlycon
to using the requsite hwmod CONFIG_DEBUG_OMAPxUARTy FLAGS.
On DRA7 though, we seem to be missing this flag, and atleast on the DRA7 EVM where we use uart1 for console, boot fails with DEBUG_LL enabled.
--- arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-omap2/omap_hwmod_7xx_data.c +1 -1
@@ -1637,7 +1637,7 @@ static struct omap_hwmod dra7xx_uart1_hw .class = &dra7xx_uart_hwmod_class, .clkdm_name = "l4per_clkdm", .main_clk = "uart1_gfclk_mux", - .flags = HWMOD_SWSUP_SIDLE_ACT, + .flags = HWMOD_SWSUP_SIDLE_ACT | DEBUG_OMAP2UART1_FLAGS, .prcm = { .omap4 = { .clkctrl_offs = DRA7XX_CM_L4PER_UART1_CLKCTRL_OFFSET,
Greg Kroah-Hartman
maintainerPATCH 46/144 ARM: OMAP2+: hwmod_data: fix missing OMAP_INTC_START in irq data
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Suman Anna <[email protected]>
commit 6d4c88304794442055eaea1c07f3c7b988b8c924 upstream.
Commit 7d7e1eb (ARM: OMAP2+: Prepare for irqs.h removal) and commit ec2c082 (ARM: OMAP2+: Remove hardcoded IRQs and enable SPARSE_IRQ) updated the way interrupts for OMAP2/3 devices are defined in the HWMOD data structures to being an index plus a fixed offset (defined by OMAP_INTC_START).
Couple of irqs in the OMAP2/3 hwmod data were misconfigured completely as they were missing this OMAP_INTC_START relative offset. Add this offset back to fix the incorrect irq data for the following modules:
OMAP2 - GPMC, RNG
OMAP3 - GPMC, ISP MMU & IVA MMU
--- arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c | 4 ++-- arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c +2 -2
@@ -796,7 +796,7 @@ struct omap_hwmod omap2xxx_counter_32k_h/* gpmc */ static struct omap_hwmod_irq_info omap2xxx_gpmc_irqs[] = { - { .irq =20 }, + { .irq =20 +OMAP_INTC_START , }, { .irq =-1 } };
@@ -841,7 +841,7 @@ static struct omap_hwmod_class omap2_rng };static struct omap_hwmod_irq_info omap2_rng_mpu_irqs[] = { - { .irq =52 }, + { .irq =52 +OMAP_INTC_START , }, { .irq =-1 } };
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +3 -3
@@ -2165,7 +2165,7 @@ static struct omap_hwmod_class omap3xxx_ };static struct omap_hwmod_irq_info omap3xxx_gpmc_irqs[] = { - { .irq =20 }, + { .irq =20 +OMAP_INTC_START , }, { .irq =-1 } };
@@ -2999,7 +2999,7 @@ static struct omap_mmu_dev_attr mmu_isp_static struct omap_hwmod omap3xxx_mmu_isp_hwmod;static struct omap_hwmod_irq_info omap3xxx_mmu_isp_irqs[] = { - { .irq =24 }, + { .irq =24 +OMAP_INTC_START , }, { .irq =-1 } };
@@ -3041,7 +3041,7 @@ static struct omap_mmu_dev_attr mmu_iva_static struct omap_hwmod omap3xxx_mmu_iva_hwmod;static struct omap_hwmod_irq_info omap3xxx_mmu_iva_irqs[] = { - { .irq =28 }, + { .irq =28 +OMAP_INTC_START , }, { .irq =-1 } };
Greg Kroah-Hartman
maintainerPATCH 47/144 ARM: OMAP2+: Fix LCD panel backlight regression for LDP legacy booting
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Lindgren <[email protected]>
commit 7e367c18c059c638bf6fb540f1decec18d64cb55 upstream.
Looks like the LCD panel on LDP has been broken quite a while, and recently got fixed by commit 0b2aa8bed3e1 (gpio: twl4030: Fix regression for twl gpio output). However, there's still an issue left where the panel backlight does not come on if the LCD drivers are built into the kernel.
Fix the issue by registering the DPI LCD panel only after the twl4030 GPIO has probed.
--- arch/arm/mach-omap2/board-ldp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
arch/arm/mach-omap2/board-ldp.c +6 -1
@@ -243,12 +243,18 @@ static void __init ldp_display_init(voidstatic int ldp_twl_gpio_setup (struct device *dev,unsigned gpio,unsigned ngpio) { +int res; +/* LCD enable GPIO */ ldp_lcd_pdata.enable_gpio = gpio +7 ;/* Backlight enable GPIO */ ldp_lcd_pdata.backlight_gpio = gpio +15 ; + res =platform_device_register (&ldp_lcd_device); +if (res) +pr_err ("Unable to register LCD: %d\n" , res); +return 0 ; }
@@ -347,7 +353,6 @@ static struct omap2_hsmmc_info mmc[] __istatic struct platform_device *ldp_devices[]__initdata = { &ldp_gpio_keys_device, - &ldp_lcd_device, };#ifdef CONFIG_OMAP_MUX
Greg Kroah-Hartman
maintainerPATCH 48/144 x86 idle: Repair large-server 50-watt idle-power regression
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Len Brown <[email protected]>
commit 40e2d7f9b5dae048789c64672bf3027fbb663ffa upstream.
Linux 3.10 changed the timing of how thread_info->flags is touched:
x86: Use generic idle loop (7d1a941731fabf27e5fb6edbebb79fe856edb4e5)
This caused Intel NHM-EX and WSM-EX servers to experience a large number of immediate MONITOR/MWAIT break wakeups, which caused cpuidle to demote from deep C-states to shallow C-states, which caused these platforms to experience a significant increase in idle power.
Note that this issue was already present before the commit above, however, it wasn't seen often enough to be noticed in power measurements.
Here we extend an errata workaround from the Core2 EX "Dunnington" to extend to NHM-EX and WSM-EX, to prevent these immediate returns from MWAIT, reducing idle power on these platforms.
While only acpi_idle ran on Dunnington, intel_idle may also run on these two newer systems.
As of today, there are no other models that are known to need this tweak.
--- arch/x86/kernel/cpu/intel.c | 3 ++- drivers/idle/intel_idle.c | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-)
arch/x86/kernel/cpu/intel.c +2 -1
@@ -387,7 +387,8 @@ static void init_intel(struct cpuinfo_x8set_cpu_cap (c,X86_FEATURE_PEBS ); } -if (c->x86 ==6 && c->x86_model ==29 && cpu_has_clflush) +if (c->x86 ==6 && cpu_has_clflush && + (c->x86_model ==29 || c->x86_model ==46 || c->x86_model ==47 ))set_cpu_cap (c,X86_FEATURE_CLFLUSH_MONITOR );#ifdef CONFIG_X86_64
drivers/idle/intel_idle.c +3 -0
@@ -361,6 +361,9 @@ static int intel_idle(struct cpuidle_devif (!current_set_polling_and_test ()) { +if (this_cpu_has (X86_FEATURE_CLFLUSH_MONITOR )) +clflush ((void *)¤t_thread_info ()->flags); +__monitor ((void *)¤t_thread_info ()->flags,0 ,0 );smp_mb ();if (!need_resched ())
Greg Kroah-Hartman
maintainerPATCH 49/144 ACPI: Add BayTrail SoC GPIO and LPSS ACPI IDs
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Drews <[email protected]>
commit f6308b36c411dc5afd6a6f73e6454722bfde57b7 upstream.
This adds the new ACPI ID (INT33FC) for the BayTrail GPIO banks as seen on a BayTrail M System-On-Chip platform. This ACPI ID is used by the BayTrail GPIO (pinctrl) driver to manage the Low Power Subsystem (LPSS).
--- drivers/acpi/acpi_lpss.c | 1 + drivers/pinctrl/pinctrl-baytrail.c | 1 + 2 files changed, 2 insertions(+)
drivers/acpi/acpi_lpss.c +1 -0
@@ -156,6 +156,7 @@ static const struct acpi_device_id acpi_ { "80860F14", (unsigned long)&byt_sdio_dev_desc }, { "80860F41", (unsigned long)&byt_i2c_dev_desc }, { "INT33B2", }, + { "INT33FC", }, { } };
drivers/pinctrl/pinctrl-baytrail.c +1 -0
@@ -512,6 +512,7 @@ static const struct dev_pm_ops byt_gpio_static const struct acpi_device_id byt_gpio_acpi_match[] = { {"INT33B2" ,0 }, + {"INT33FC" ,0 }, { } };MODULE_DEVICE_TABLE (acpi, byt_gpio_acpi_match);
Greg Kroah-Hartman
maintainerPATCH 50/144 ext4: call ext4_error_inode() if jbd2_journal_dirty_metadata() fails
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Theodore Ts'o <[email protected]>
commit ae1495b12df1897d4f42842a7aa7276d920f6290 upstream.
While it's true that errors can only happen if there is a bug in jbd2_journal_dirty_metadata(), if a bug does happen, we need to halt the kernel or remount the file system read-only in order to avoid further data loss. The ext4_journal_abort_handle() function doesn't do any of this, and while it's likely that this call (since it doesn't adjust refcounts) will likely result in the file system eventually deadlocking since the current transaction will never be able to close, it's much cleaner to call let ext4's error handling system deal with this situation.
There's a separate bug here which is that if certain jbd2 errors errors occur and file system is mounted errors=continue, the file system will probably eventually end grind to a halt as described above. But things have been this way in a long time, and usually when we have these sorts of errors it's pretty much a disaster --- and that's why the jbd2 layer aggressively retries memory allocations, which is the most likely cause of these jbd2 errors.
--- fs/ext4/ext4_jbd2.c | 9 +++++++++ 1 file changed, 9 insertions(+)
fs/ext4/ext4_jbd2.c +9 -0
@@ -259,6 +259,15 @@ int __ext4_handle_dirty_metadata(const cif (WARN_ON_ONCE (err)) {ext4_journal_abort_handle (where, line, __func__, bh, handle, err); +ext4_error_inode (inode, where, line, + bh->b_blocknr, +"journal_dirty_metadata failed: " +"handle type %u started at line %u, " +"credits %u/%u, errcode %d" , + handle->h_type, + handle->h_line_no, + handle->h_requested_credits, + handle->h_buffer_credits, err); } }else {if (inode)
Greg Kroah-Hartman
maintainerPATCH 51/144 ext4: fix use-after-free in ext4_mb_new_blocks
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Junho Ryu <[email protected]>
commit 4e8d2139802ce4f41936a687f06c560b12115247 upstream.
ext4_mb_put_pa should hold pa->pa_lock before accessing pa->pa_count. While ext4_mb_use_preallocated checks pa->pa_deleted first and then increments pa->count later, ext4_mb_put_pa decrements pa->pa_count before holding pa->pa_lock and then sets pa->pa_deleted.
* Free sequenceext4_mb_put_pa (1): atomic_dec_and_test pa->pa_countext4_mb_put_pa (2): lock pa->pa_lockext4_mb_put_pa (3): check pa->pa_deletedext4_mb_put_pa (4): set pa->pa_deleted=1ext4_mb_put_pa (5): unlock pa->pa_lockext4_mb_put_pa (6): remove pa from a listext4_mb_pa_callback: free pa
* Use sequenceext4_mb_use_preallocated (1): iterate over preallocationext4_mb_use_preallocated (2): lock pa->pa_lockext4_mb_use_preallocated (3): check pa->pa_deletedext4_mb_use_preallocated (4): increase pa->pa_countext4_mb_use_preallocated (5): unlock pa->pa_lockext4_mb_release_context: access pa
* Use-after-free sequence
[initial status] <pa->pa_deleted = 0, pa_count = 1>ext4_mb_use_preallocated (1): iterate over preallocationext4_mb_use_preallocated (2): lock pa->pa_lockext4_mb_use_preallocated (3): check pa->pa_deletedext4_mb_put_pa (1): atomic_dec_and_test pa->pa_count
[pa_count decremented] <pa->pa_deleted = 0, pa_count = 0>ext4_mb_use_preallocated (4): increase pa->pa_count
[pa_count incremented] <pa->pa_deleted = 0, pa_count = 1>ext4_mb_use_preallocated (5): unlock pa->pa_lockext4_mb_put_pa (2): lock pa->pa_lockext4_mb_put_pa (3): check pa->pa_deletedext4_mb_put_pa (4): set pa->pa_deleted=1
[race condition!] <pa->pa_deleted = 1, pa_count = 1>ext4_mb_put_pa (5): unlock pa->pa_lockext4_mb_put_pa (6): remove pa from a listext4_mb_pa_callback: free paext4_mb_release_context: access pa
AddressSanitizer has detected use-after-free in ext4_mb_new_blocks Bug report: http://goo.gl/rG1On3
--- fs/ext4/mballoc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
fs/ext4/mballoc.c +8 -3
@@ -3442,6 +3442,9 @@ static void ext4_mb_pa_callback(struct r {struct ext4_prealloc_space *pa; pa = container_of(head, struct ext4_prealloc_space, u.pa_rcu); + +BUG_ON (atomic_read (&pa->pa_count)); +BUG_ON (pa->pa_deleted ==0 );kmem_cache_free (ext4_pspace_cachep, pa); }
@@ -3455,11 +3458,13 @@ static void ext4_mb_put_pa(struct ext4_aext4_group_t grp;ext4_fsblk_t grp_blk; -if (!atomic_dec_and_test (&pa->pa_count) || pa->pa_free !=0 ) -return ; -/* in this short window concurrent discard can set pa_deleted */ spin_lock (&pa->pa_lock); +if (!atomic_dec_and_test (&pa->pa_count) || pa->pa_free !=0 ) { +spin_unlock (&pa->pa_lock); +return ; + } +if (pa->pa_deleted ==1 ) {spin_unlock (&pa->pa_lock);return ;
Greg Kroah-Hartman
maintainerPATCH 53/144 ext4: fix del_timer() misuse for ->s_err_report
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Al Viro <[email protected]>
commit 9105bb149bbbc555d2e11ba5166dfe7a24eae09e upstream.
That thing should be del_timer_sync(); consider what happens if ext4_put_super() call of del_timer() happens to come just as it's getting run on another CPU. Since that timer reschedules itself to run next day, you are pretty much guaranteed that you'll end up with kfree'd scheduled timer, with usual fun consequences. AFAICS, that's -stable fodder all way back to 2010... [the second del_timer_sync() is almost certainly not needed, but it doesn't hurt either]
--- fs/ext4/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ext4/super.c +2 -2
@@ -773,7 +773,7 @@ static void ext4_put_super(struct super_ }ext4_es_unregister_shrinker (sbi); -del_timer (&sbi->s_err_report); +del_timer_sync (&sbi->s_err_report);ext4_release_system_zone (sb);ext4_mb_release (sb);ext4_ext_release (sb);
@@ -4151,7 +4151,7 @@ failed_mount_wq: } failed_mount3:ext4_es_unregister_shrinker (sbi); -del_timer (&sbi->s_err_report); +del_timer_sync (&sbi->s_err_report);if (sbi->s_flex_groups)ext4_kvfree (sbi->s_flex_groups);percpu_counter_destroy (&sbi->s_freeclusters_counter);
Greg Kroah-Hartman
maintainerPATCH 54/144 ext4: Do not reserve clusters when fs doesnt support extents
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <[email protected]>
commit 30fac0f75da24dd5bb43c9e911d2039a984ac815 upstream.
When the filesystem doesn't support extents (like in ext2/3 compatibility modes), there is no need to reserve any clusters. Space estimates for writing are exact, hole punching doesn't need new metadata, and there are no unwritten extents to convert.
This fixes a problem when filesystem still having some free space when accessed with a native ext2/3 driver suddently reports ENOSPC when accessed with ext4 driver.
--- fs/ext4/super.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
fs/ext4/super.c +13 -4
@@ -3288,11 +3288,19 @@ int ext4_calculate_overhead(struct super } -static ext4_fsblk_t ext4_calculate_resv_clusters (struct ext4_sb_info *sbi) +static ext4_fsblk_t ext4_calculate_resv_clusters (struct super_block *sb) {ext4_fsblk_t resv_clusters;/* +* There's no need to reserve anything when we aren't using extents. +* The space estimates are exact, there are no unwritten extents, +* hole punching doesn't need new metadata... This is needed especially +* to keep ext2/3 backward compatibility. +*/ +if (!EXT4_HAS_INCOMPAT_FEATURE (sb,EXT4_FEATURE_INCOMPAT_EXTENTS )) +return 0 ; +/* * By default we reserve 2% or 4096 clusters, whichever is smaller. * This should cover the situations where we can not afford to run * out of space like for example punch hole, or converting
@@ -3300,7 +3308,8 @@ static ext4_fsblk_t ext4_calculate_resv_* allocation would require 1, or 2 blocks, higher numbers are * very rare. */ - resv_clusters =ext4_blocks_count (sbi->s_es) >> sbi->s_cluster_bits; + resv_clusters =ext4_blocks_count (EXT4_SB (sb)->s_es) >> +EXT4_SB (sb)->s_cluster_bits;do_div (resv_clusters,50 ); resv_clusters =min_t (ext4_fsblk_t, resv_clusters,4096 );
@@ -4043,10 +4052,10 @@ no_journal: "available"); } - err =ext4_reserve_clusters (sbi,ext4_calculate_resv_clusters (sbi)); + err =ext4_reserve_clusters (sbi,ext4_calculate_resv_clusters (sb));if (err) {ext4_msg (sb,KERN_ERR ,"failed to reserve %llu clusters for " -"reserved pool" ,ext4_calculate_resv_clusters (sbi)); +"reserved pool" ,ext4_calculate_resv_clusters (sb)); goto failed_mount4a; }
Greg Kroah-Hartman
maintainerPATCH 55/144 ext4: fix deadlock when writing in ENOSPC conditions
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <[email protected]>
commit 34cf865d54813aab3497838132fb1bbd293f4054 upstream.
Akira-san has been reporting rare deadlocks of his machine when running xfstests test 269 on ext4 filesystem. The problem turned out to be in ext4_da_reserve_metadata() and ext4_da_reserve_space() which called ext4_should_retry_alloc() while holding i_data_sem. Since ext4_should_retry_alloc() can force a transaction commit, this is a lock ordering violation and leads to deadlocks.
Fix the problem by just removing the retry loops. These functions should just report ENOSPC to the caller (e.g. ext4_da_write_begin()) and that function must take care of retrying after dropping all necessary locks.
--- fs/ext4/inode.c | 12 ------------ 1 file changed, 12 deletions(-)
fs/ext4/inode.c +0 -12
@@ -1206,7 +1206,6 @@ static int ext4_journalled_write_end(str*/ static int ext4_da_reserve_metadata (struct inode *inode,ext4_lblk_t lblock) { -int retries =0 ;struct ext4_sb_info *sbi =EXT4_SB (inode->i_sb);struct ext4_inode_info *ei =EXT4_I (inode);unsigned int md_needed;
@@ -1218,7 +1217,6 @@ static int ext4_da_reserve_metadata(stru* in order to allocate nrblocks * worse case is one extent per block */ -repeat:spin_lock (&ei->i_block_reservation_lock);/* * ext4_calc_metadata_amount() has side effects, which we have
@@ -1238,10 +1236,6 @@ repeat: ei->i_da_metadata_calc_len = save_len; ei->i_da_metadata_calc_last_lblock = save_last_lblock;spin_unlock (&ei->i_block_reservation_lock); -if (ext4_should_retry_alloc (inode->i_sb, &retries)) { -cond_resched (); - goto repeat; - }return -ENOSPC ; } ei->i_reserved_meta_blocks += md_needed;
@@ -1255,7 +1249,6 @@ repeat:*/ static int ext4_da_reserve_space (struct inode *inode,ext4_lblk_t lblock) { -int retries =0 ;struct ext4_sb_info *sbi =EXT4_SB (inode->i_sb);struct ext4_inode_info *ei =EXT4_I (inode);unsigned int md_needed;
@@ -1277,7 +1270,6 @@ static int ext4_da_reserve_space(struct* in order to allocate nrblocks * worse case is one extent per block */ -repeat:spin_lock (&ei->i_block_reservation_lock);/* * ext4_calc_metadata_amount() has side effects, which we have
@@ -1297,10 +1289,6 @@ repeat: ei->i_da_metadata_calc_len = save_len; ei->i_da_metadata_calc_last_lblock = save_last_lblock;spin_unlock (&ei->i_block_reservation_lock); -if (ext4_should_retry_alloc (inode->i_sb, &retries)) { -cond_resched (); - goto repeat; - }dquot_release_reservation_block (inode,EXT4_C2B (sbi,1 ));return -ENOSPC ; }
Greg Kroah-Hartman
maintainerPATCH 56/144 ext4: add explicit casts when masking cluster sizes
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Theodore Ts'o <[email protected]>
commit f5a44db5d2d677dfbf12deee461f85e9ec633961 upstream.
The missing casts can cause the high 64-bits of the physical blocks to be lost. Set up new macros which allows us to make sure the right thing happen, even if at some point we end up supporting larger logical block numbers.
Thanks to the Emese Revfy and the PaX security team for reporting this issue.
--- fs/ext4/ext4.h | 10 ++++++++++ fs/ext4/extents.c | 26 ++++++++++++-------------- fs/ext4/mballoc.c | 6 +++--- 3 files changed, 25 insertions(+), 17 deletions(-)
fs/ext4/ext4.h +10 -0
@@ -267,6 +267,16 @@ struct ext4_io_submit {/* Translate # of blks to # of clusters */ #define EXT4_NUM_B2C (sbi, blks) (((blks) + (sbi)->s_cluster_ratio - 1) >> \ (sbi)->s_cluster_bits) +/* Mask out the low bits to get the starting block of the cluster */ +#define EXT4_PBLK_CMASK (s, pblk) ((pblk) & \ + ~((ext4_fsblk_t) (s)->s_cluster_ratio - 1)) +#define EXT4_LBLK_CMASK (s, lblk) ((lblk) & \ + ~((ext4_lblk_t) (s)->s_cluster_ratio - 1)) +/* Get the cluster offset */ +#define EXT4_PBLK_COFF (s, pblk) ((pblk) & \ + ((ext4_fsblk_t) (s)->s_cluster_ratio - 1)) +#define EXT4_LBLK_COFF (s, lblk) ((lblk) & \ + ((ext4_lblk_t) (s)->s_cluster_ratio - 1))/* * Structure of a blocks group descriptor
fs/ext4/extents.c +12 -14
@@ -1861,8 +1861,7 @@ static unsigned int ext4_ext_check_overl depth =ext_depth (inode);if (!path[depth].p_ext) goto out; - b2 =le32_to_cpu (path[depth].p_ext->ee_block); - b2 &= ~(sbi->s_cluster_ratio -1 ); + b2 =EXT4_LBLK_CMASK (sbi,le32_to_cpu (path[depth].p_ext->ee_block));/* * get the next allocated block if the extent in the path
@@ -1872,7 +1871,7 @@ static unsigned int ext4_ext_check_overl b2 =ext4_ext_next_allocated_block (path);if (b2 ==EXT_MAX_BLOCKS ) goto out; - b2 &= ~(sbi->s_cluster_ratio -1 ); + b2 =EXT4_LBLK_CMASK (sbi, b2); }/* check for wrap through zero on extent logical start block*/
@@ -2552,7 +2551,7 @@ static int ext4_remove_blocks(handle_t ** extent, we have to mark the cluster as used (store negative * cluster number in partial_cluster). */ - unaligned = pblk & (sbi->s_cluster_ratio -1 ); + unaligned =EXT4_PBLK_COFF (sbi, pblk);if (unaligned && (ee_len == num) && (*partial_cluster != -((long long )EXT4_B2C (sbi, pblk)))) *partial_cluster =EXT4_B2C (sbi, pblk);
@@ -2646,7 +2645,7 @@ ext4_ext_rm_leaf(handle_t *handle, struc* accidentally freeing it later on */ pblk =ext4_ext_pblock (ex); -if (pblk & (sbi->s_cluster_ratio -1 )) +if (EXT4_PBLK_COFF (sbi, pblk)) *partial_cluster = -((long long )EXT4_B2C (sbi, pblk)); ex--;
@@ -3801,7 +3800,7 @@ int ext4_find_delalloc_cluster(struct in {struct ext4_sb_info *sbi =EXT4_SB (inode->i_sb);ext4_lblk_t lblk_start, lblk_end; - lblk_start = lblk & (~(sbi->s_cluster_ratio -1 )); + lblk_start =EXT4_LBLK_CMASK (sbi, lblk); lblk_end = lblk_start + sbi->s_cluster_ratio -1 ;return ext4_find_delalloc_range (inode, lblk_start, lblk_end);
@@ -3860,9 +3859,9 @@ get_reserved_cluster_alloc(struct inodetrace_ext4_get_reserved_cluster_alloc (inode, lblk_start, num_blks);/* Check towards left side */ - c_offset = lblk_start & (sbi->s_cluster_ratio -1 ); + c_offset =EXT4_LBLK_COFF (sbi, lblk_start);if (c_offset) { - lblk_from = lblk_start & (~(sbi->s_cluster_ratio -1 )); + lblk_from =EXT4_LBLK_CMASK (sbi, lblk_start); lblk_to = lblk_from + c_offset -1 ;if (ext4_find_delalloc_range (inode, lblk_from, lblk_to))
@@ -3870,7 +3869,7 @@ get_reserved_cluster_alloc(struct inode }/* Now check towards right. */ - c_offset = (lblk_start + num_blks) & (sbi->s_cluster_ratio -1 ); + c_offset =EXT4_LBLK_COFF (sbi, lblk_start + num_blks);if (allocated_clusters && c_offset) { lblk_from = lblk_start + num_blks; lblk_to = lblk_from + (sbi->s_cluster_ratio - c_offset) -1 ;
@@ -4078,7 +4077,7 @@ static int get_implied_cluster_alloc(str struct ext4_ext_path *path) {struct ext4_sb_info *sbi =EXT4_SB (sb); -ext4_lblk_t c_offset = map->m_lblk & (sbi->s_cluster_ratio-1 ); +ext4_lblk_t c_offset =EXT4_LBLK_COFF (sbi, map->m_lblk);ext4_lblk_t ex_cluster_start, ex_cluster_end;ext4_lblk_t rr_cluster_start;ext4_lblk_t ee_block =le32_to_cpu (ex->ee_block);
@@ -4096,8 +4095,7 @@ static int get_implied_cluster_alloc(str (rr_cluster_start == ex_cluster_start)) {if (rr_cluster_start == ex_cluster_end) ee_start += ee_len -1 ; - map->m_pblk = (ee_start & ~(sbi->s_cluster_ratio -1 )) + - c_offset; + map->m_pblk =EXT4_PBLK_CMASK (sbi, ee_start) + c_offset; map->m_len =min (map->m_len, (unsigned ) sbi->s_cluster_ratio - c_offset);/*
@@ -4251,7 +4249,7 @@ int ext4_ext_map_blocks(handle_t *handle*/ map->m_flags &= ~EXT4_MAP_FROM_CLUSTER ; newex.ee_block =cpu_to_le32 (map->m_lblk); - cluster_offset = map->m_lblk & (sbi->s_cluster_ratio-1 ); + cluster_offset =EXT4_LBLK_CMASK (sbi, map->m_lblk);/* * If we are doing bigalloc, check to see if the extent returned
@@ -4319,7 +4317,7 @@ int ext4_ext_map_blocks(handle_t *handle* needed so that future calls to get_implied_cluster_alloc() * work correctly. */ - offset = map->m_lblk & (sbi->s_cluster_ratio -1 ); + offset =EXT4_LBLK_COFF (sbi, map->m_lblk); ar.len =EXT4_NUM_B2C (sbi, offset+allocated); ar.goal -= offset; ar.logical -= offset;
fs/ext4/mballoc.c +3 -3
@@ -4126,7 +4126,7 @@ ext4_mb_initialize_context(struct ext4_aext4_get_group_no_and_offset (sb, goal, &group, &block);/* set up allocation goals */ - ac->ac_b_ex.fe_logical = ar->logical & ~(sbi->s_cluster_ratio -1 ); + ac->ac_b_ex.fe_logical =EXT4_LBLK_CMASK (sbi, ar->logical); ac->ac_status =AC_STATUS_CONTINUE ; ac->ac_sb = sb; ac->ac_inode = ar->inode;
@@ -4668,7 +4668,7 @@ void ext4_free_blocks(handle_t *handle,* blocks at the beginning or the end unless we are explicitly * requested to avoid doing so. */ - overflow = block & (sbi->s_cluster_ratio -1 ); + overflow =EXT4_PBLK_COFF (sbi, block);if (overflow) {if (flags &EXT4_FREE_BLOCKS_NOFREE_FIRST_CLUSTER ) { overflow = sbi->s_cluster_ratio - overflow;
@@ -4682,7 +4682,7 @@ void ext4_free_blocks(handle_t *handle, count += overflow; } } - overflow = count & (sbi->s_cluster_ratio -1 ); + overflow =EXT4_LBLK_COFF (sbi, count);if (overflow) {if (flags &EXT4_FREE_BLOCKS_NOFREE_LAST_CLUSTER ) {if (count > overflow)
Greg Kroah-Hartman
maintainerPATCH 58/144 sched: numa: skip inaccessible VMAs
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mel Gorman <[email protected]>
commit 3c67f474558748b604e247d92b55dfe89654c81d upstream.
Inaccessible VMA should not be trapping NUMA hint faults. Skip them.
--- kernel/sched/fair.c | 7 +++++++ 1 file changed, 7 insertions(+)
kernel/sched/fair.c +7 -0
@@ -974,6 +974,13 @@ void task_numa_work(struct callback_headif (vma->vm_end - vma->vm_start <HPAGE_SIZE )continue ; +/* +* Skip inaccessible VMAs to avoid any confusion between +* PROT_NONE and NUMA hinting ptes +*/ +if (!(vma->vm_flags & (VM_READ |VM_EXEC |VM_WRITE ))) +continue ; + do { start = max(start, vma->vm_start); end = ALIGN(start + (pages << PAGE_SHIFT), HPAGE_SIZE);
Greg Kroah-Hartman
maintainerPATCH 59/144 sched/rt: Fix rqs cpupri leak while enqueue/dequeue child RT entities
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kirill Tkhai <[email protected]>
commit 757dfcaa41844595964f1220f1d33182dae49976 upstream.
This patch touches the RT group scheduling case.
Functions inc_rt_prio_smp() and dec_rt_prio_smp() change (global) rq's priority, while rt_rq passed to them may be not the top-level rt_rq. This is wrong, because changing of priority on a child level does not guarantee that the priority is the highest all over the rq. So, this leak makes RT balancing unusable.
The short example: the task having the highest priority among all rq's RT tasks (no one other task has the same priority) are waking on a throttle rt_rq. The rq's cpupri is set to the task's priority equivalent, but real rq->rt.highest_prio.curr is less.
The patch below fixes the problem.
--- kernel/sched/rt.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
kernel/sched/rt.c +14 -0
@@ -899,6 +899,13 @@ inc_rt_prio_smp(struct rt_rq *rt_rq, int {struct rq *rq =rq_of_rt_rq (rt_rq); +#ifdef CONFIG_RT_GROUP_SCHED +/* +* Change rq's cpupri only if rt_rq is the top queue. +*/ +if (&rq->rt != rt_rq) +return ; +#endif if (rq->online && prio < prev_prio)cpupri_set (&rq->rd->cpupri, rq->cpu, prio); }
@@ -908,6 +915,13 @@ dec_rt_prio_smp(struct rt_rq *rt_rq, int {struct rq *rq =rq_of_rt_rq (rt_rq); +#ifdef CONFIG_RT_GROUP_SCHED +/* +* Change rq's cpupri only if rt_rq is the top queue. +*/ +if (&rq->rt != rt_rq) +return ; +#endif if (rq->online && rt_rq->highest_prio.curr != prev_prio)cpupri_set (&rq->rd->cpupri, rq->cpu, rt_rq->highest_prio.curr); }
Greg Kroah-Hartman
maintainerPATCH 60/144 firewire: sbp2: bring back WRITE SAME support
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Richter <[email protected]>
commit ce027ed98fd176710fb14be9d6015697b62436f0 upstream.
Commit 54b2b50c20a6 "[SCSI] Disable WRITE SAME for RAID and virtual host adapter drivers" disabled WRITE SAME support for all SBP-2 attached targets. But as described in the changelog of commit b0ea5f19d3d8 "firewire: sbp2: allow WRITE SAME and REPORT SUPPORTED OPERATION CODES", it is not required to blacklist WRITE SAME.
Bring the feature back by reverting the sbp2.c hunk of commit 54b2b50c20a6.
--- drivers/firewire/sbp2.c | 1 - 1 file changed, 1 deletion(-)
drivers/firewire/sbp2.c +0 -1
@@ -1623,7 +1623,6 @@ static struct scsi_host_template scsi_dr .cmd_per_lun = 1, .can_queue = 1, .sdev_attrs = sbp2_scsi_sysfs_attrs, - .no_write_same = 1, };MODULE_AUTHOR ("Kristian Hoegsberg <[email protected]>" );
Greg Kroah-Hartman
maintainerPATCH 61/144 net_dma: mark broken
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Williams <[email protected]>
commit 77873803363c9e831fc1d1e6895c084279090c22 upstream.
net_dma can cause data to be copied to a stale mapping if a copy-on-write fault occurs during dma. The application sees missing data.
The following trace is triggered by modifying the kernel to WARN if it ever triggers copy-on-write on a page that is undergoing dma:
WARNING: CPU: 24 PID: 2529 at lib/dma-debug.c:485 debug_dma_assert_idle+0xd2/0x120() ioatdma 0000:00:04.0: DMA-API: cpu touching an active dma mapped page [pfn=0x16bcd9] Modules linked in: iTCO_wdt iTCO_vendor_support ioatdma lpc_ich pcspkr dca CPU: 24 PID: 2529 Comm: linbug Tainted: G W 3.13.0-rc1+ #353 00000000000001e5 ffff88016f45f688 ffffffff81751041 ffff88017ab0ef70 ffff88016f45f6d8 ffff88016f45f6c8 ffffffff8104ed9c ffffffff810f3646 ffff8801768f4840 0000000000000282 ffff88016f6cca10 00007fa2bb699349 Call Trace: [<ffffffff81751041>] dump_stack+0x46/0x58 [<ffffffff8104ed9c>] warn_slowpath_common+0x8c/0xc0 [<ffffffff810f3646>] ? ftrace_pid_func+0x26/0x30 [<ffffffff8104ee86>] warn_slowpath_fmt+0x46/0x50 [<ffffffff8139c062>] debug_dma_assert_idle+0xd2/0x120 [<ffffffff81154a40>] do_wp_page+0xd0/0x790 [<ffffffff811582ac>] handle_mm_fault+0x51c/0xde0 [<ffffffff813830b9>] ? copy_user_enhanced_fast_string+0x9/0x20 [<ffffffff8175fc2c>] __do_page_fault+0x19c/0x530 [<ffffffff8175c196>] ? _raw_spin_lock_bh+0x16/0x40 [<ffffffff810f3539>] ? trace_clock_local+0x9/0x10 [<ffffffff810fa1f4>] ? rb_reserve_next_event+0x64/0x310 [<ffffffffa0014c00>] ? ioat2_dma_prep_memcpy_lock+0x60/0x130 [ioatdma] [<ffffffff8175ffce>] do_page_fault+0xe/0x10 [<ffffffff8175c862>] page_fault+0x22/0x30 [<ffffffff81643991>] ? __kfree_skb+0x51/0xd0 [<ffffffff813830b9>] ? copy_user_enhanced_fast_string+0x9/0x20 [<ffffffff81388ea2>] ? memcpy_toiovec+0x52/0xa0 [<ffffffff8164770f>] skb_copy_datagram_iovec+0x5f/0x2a0 [<ffffffff8169d0f4>] tcp_rcv_established+0x674/0x7f0 [<ffffffff816a68c5>] tcp_v4_do_rcv+0x2e5/0x4a0 [..] ---[ end trace e30e3b01191b7617 ]--- Mapped at: [<ffffffff8139c169>] debug_dma_map_page+0xb9/0x160 [<ffffffff8142bf47>] dma_async_memcpy_pg_to_pg+0x127/0x210 [<ffffffff8142cce9>] dma_memcpy_pg_to_iovec+0x119/0x1f0 [<ffffffff81669d3c>] dma_skb_copy_datagram_iovec+0x11c/0x2b0 [<ffffffff8169d1ca>] tcp_rcv_established+0x74a/0x7f0:
...the problem is that the receive path falls back to cpu-copy in several locations and this trace is just one of the areas. A few options were considered to fix this:
1/ sync all dma whenever a cpu copy branch is taken
2/ modify the page fault handler to hold off while dma is in-flight
Option 1 adds yet more cpu overhead to an "offload" that struggles to compete with cpu-copy. Option 2 adds checks for behavior that is already documented as broken when using get_user_pages(). At a minimum a debug mode is warranted to catch and flag these violations of the dma-api vs get_user_pages().
Thanks to David for his reproducer.
--- drivers/dma/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/dma/Kconfig +1 -0
@@ -339,6 +339,7 @@ config NET_DMA bool "Network: TCP receive copy offload" depends on DMA_ENGINE && NET default (INTEL_IOATDMA || FSL_DMA) + depends on BROKEN help This enables the use of DMA engines in the network stack to offload receive copy-to-user operations, freeing CPU cycles.
Greg Kroah-Hartman
maintainerPATCH 63/144 drm/ttm: Fix accesses through vmas with only partial coverage
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Hellstrom <[email protected]>
commit d386735588c3e22129c2bc6eb64fc1d37a8f805c upstream.
VMAs covering a bo but that didn't start at the same address space offset as the bo they were mapping were incorrectly generating SEGFAULT errors in the fault handler.
--- drivers/gpu/drm/ttm/ttm_bo_vm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/ttm/ttm_bo_vm.c +3 -3
@@ -116,9 +116,9 @@ static int ttm_bo_vm_fault(struct vm_are } page_offset = ((address - vma->vm_start) >>PAGE_SHIFT ) + -drm_vma_node_start (&bo->vma_node) - vma->vm_pgoff; - page_last =vma_pages (vma) + -drm_vma_node_start (&bo->vma_node) - vma->vm_pgoff; + vma->vm_pgoff -drm_vma_node_start (&bo->vma_node); + page_last =vma_pages (vma) + vma->vm_pgoff - +drm_vma_node_start (&bo->vma_node);if (unlikely (page_offset >= bo->num_pages)) { retval =VM_FAULT_SIGBUS ;
Greg Kroah-Hartman
maintainerPATCH 64/144 drm/radeon: Fix sideport problems on certain RS690 boards
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 8333f0fe133be420ce3fcddfd568c3a559ab274e upstream.
Some RS690 boards with 64MB of sideport memory show up as having 128MB sideport + 256MB of UMA. In this case, just skip the sideport memory and use UMA. This fixes rendering corruption and should improve performance.
bug:
https://bugs.freedesktop.org/show_bug.cgi?id=35457
--- drivers/gpu/drm/radeon/rs690.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/gpu/drm/radeon/rs690.c +10 -0
@@ -162,6 +162,16 @@ static void rs690_mc_init(struct radeon_ base =RREG32_MC (R_000100_MCCFG_FB_LOCATION ); base =G_000100_MC_FB_START (base) <<16 ; rdev->mc.igp_sideport_enabled =radeon_atombios_sideport_present (rdev); +/* Some boards seem to be configured for 128MB of sideport memory, +* but really only have 64MB. Just skip the sideport and use +* UMA memory. +*/ +if (rdev->mc.igp_sideport_enabled && + (rdev->mc.real_vram_size == (384 *1024 *1024 ))) { + base +=128 *1024 *1024 ; + rdev->mc.real_vram_size -=128 *1024 *1024 ; + rdev->mc.mc_vram_size = rdev->mc.real_vram_size; + }/* Use K8 direct mapping for fast fb access. */ rdev->fastfb_working = false;
Greg Kroah-Hartman
maintainerPATCH 66/144 drm/radeon: add missing display tiling setup for oland
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 227ae10f17a5f2fd1307b7e582b603ef7bbb7e97 upstream.
Fixes improperly set up display params for 2D tiling on oland.
--- drivers/gpu/drm/radeon/atombios_crtc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/atombios_crtc.c +3 -1
@@ -1196,7 +1196,9 @@ static int dce4_crtc_do_set_base(struct }else if ((rdev->family ==CHIP_TAHITI ) || (rdev->family ==CHIP_PITCAIRN )) fb_format |=SI_GRPH_PIPE_CONFIG (SI_ADDR_SURF_P8_32x32_8x16); -else if (rdev->family ==CHIP_VERDE ) +else if ((rdev->family ==CHIP_VERDE ) || + (rdev->family ==CHIP_OLAND ) || + (rdev->family ==CHIP_HAINAN ))/* for completeness. HAINAN has no display hw */ fb_format |=SI_GRPH_PIPE_CONFIG (SI_ADDR_SURF_P4_8x16);switch (radeon_crtc->crtc_id) {
Greg Kroah-Hartman
maintainerPATCH 68/144 drm/i915: Hold mutex across i915_gem_release
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Wilson <[email protected]>
commit 0d1430a3f4b7cfd8779b78740a4182321f3ca7f3 upstream.
Inorder to serialise the closing of the file descriptor and its subsequent release of client requests with i915_gem_free_request(), we need to hold the struct_mutex in i915_gem_release(). Failing to do so has the potential to trigger an OOPS, later with a use-after-free.
Testcase: igt/gem_close_race
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70874
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71029
--- drivers/gpu/drm/i915/i915_dma.c | 2 ++ drivers/gpu/drm/i915/i915_gem_context.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_dma.c +2 -0
@@ -1848,8 +1848,10 @@ void i915_driver_lastclose(struct drm_devoid i915_driver_preclose (struct drm_device * dev,struct drm_file *file_priv) { +mutex_lock (&dev->struct_mutex);i915_gem_context_close (dev, file_priv);i915_gem_release (dev, file_priv); +mutex_unlock (&dev->struct_mutex); }void i915_driver_postclose (struct drm_device *dev,struct drm_file *file)
drivers/gpu/drm/i915/i915_gem_context.c +0 -2
@@ -328,10 +328,8 @@ void i915_gem_context_close(struct drm_d {struct drm_i915_file_private *file_priv = file->driver_priv; -mutex_lock (&dev->struct_mutex);idr_for_each (&file_priv->context_idr, context_idr_cleanup,NULL );idr_destroy (&file_priv->context_idr); -mutex_unlock (&dev->struct_mutex); } static struct i915_hw_context *
Greg Kroah-Hartman
maintainerPATCH 70/144 drm/i915: dont update the dri1 breadcrumb with modesetting
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Vetter <[email protected]>
commit 6c719faca2aceca72f1bf5b1645c1734ed3e9447 upstream.
The update is horribly racy since it doesn't protect at all against concurrent closing of the master fd. And it can't really since that requires us to grab a mutex.
Instead of jumping through hoops and offloading this to a worker thread just block this bit of code for the modesetting driver.
Note that the race is fairly easy to hit since we call the breadcrumb function for any interrupt. So the vblank interrupt (which usually keeps going for a bit) is enough. But even if we'd block this and only update the breadcrumb for user interrupts from the CS we could hit this race with kms/gem userspace: If a non-master is waiting somewhere (and hence has interrupts enabled) and the master closes its fd (probably due to crashing).
v2: Add a code comment to explain why fixing this for real isn't really worth it. Also improve the commit message a bit.
v3: Fix the spelling in the comment.
--- drivers/gpu/drm/i915/i915_dma.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/i915/i915_dma.c +8 -0
@@ -83,6 +83,14 @@ void i915_update_dri1_breadcrumb(structdrm_i915_private_t *dev_priv = dev->dev_private;struct drm_i915_master_private *master_priv; +/* +* The dri breadcrumb update races against the drm master disappearing. +* Instead of trying to fix this (this is by far not the only ums issue) +* just don't do the update in kms mode. +*/ +if (drm_core_check_feature (dev,DRIVER_MODESET )) +return ; +if (dev->primary->master) { master_priv = dev->primary->master->driver_priv;if (master_priv->sarea_priv)
Greg Kroah-Hartman
maintainerPATCH 71/144 drm/radeon/dpm: disable ss on Cayman
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit c745fe611ca42295c9d91d8e305d27983e9132ef upstream.
Spread spectrum seems to cause hangs when dynamic clock switching is enabled. Disable it for now. This does not affect performance or the amount of power saved. Tracked down by Martin Andersson.
bug:
https://bugs.freedesktop.org/show_bug.cgi?id=69723
--- drivers/gpu/drm/radeon/rv770_dpm.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/radeon/rv770_dpm.c +6 -0
@@ -2328,6 +2328,12 @@ void rv770_get_engine_memory_ss(struct r pi->mclk_ss =radeon_atombios_get_asic_ss_info (rdev, &ss,ASIC_INTERNAL_MEMORY_SS ,0 ); +/* disable ss, causes hangs on some cayman boards */ +if (rdev->family ==CHIP_CAYMAN ) { + pi->sclk_ss = false; + pi->mclk_ss = false; + } +if (pi->sclk_ss || pi->mclk_ss) pi->dynamic_ss = true;else
Greg Kroah-Hartman
maintainerPATCH 72/144 drm/radeon: check for 0 count in speaker allocation and SAD code
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit b67ce39a30976171e7b96b30a94a0216ab89df97 upstream.
If there is no speaker allocation block or SAD block, bail early.
bug:
https://bugs.freedesktop.org/show_bug.cgi?id=72283
--- drivers/gpu/drm/radeon/dce6_afmt.c | 4 ++-- drivers/gpu/drm/radeon/evergreen_hdmi.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/radeon/dce6_afmt.c +2 -2
@@ -132,7 +132,7 @@ void dce6_afmt_write_speaker_allocation( } sad_count =drm_edid_to_speaker_allocation (radeon_connector->edid, &sadb); -if (sad_count <0 ) { +if (sad_count <=0 ) {DRM_ERROR ("Couldn't read Speaker Allocation Data Block: %d\n" , sad_count);return ; }
@@ -193,7 +193,7 @@ void dce6_afmt_write_sad_regs(struct drm } sad_count =drm_edid_to_sad (radeon_connector->edid, &sads); -if (sad_count <0 ) { +if (sad_count <=0 ) {DRM_ERROR ("Couldn't read SADs: %d\n" , sad_count);return ; }
drivers/gpu/drm/radeon/evergreen_hdmi.c +2 -2
@@ -81,7 +81,7 @@ static void dce4_afmt_write_speaker_allo } sad_count =drm_edid_to_speaker_allocation (radeon_connector->edid, &sadb); -if (sad_count <0 ) { +if (sad_count <=0 ) {DRM_ERROR ("Couldn't read Speaker Allocation Data Block: %d\n" , sad_count);return ; }
@@ -134,7 +134,7 @@ static void evergreen_hdmi_write_sad_reg } sad_count =drm_edid_to_sad (radeon_connector->edid, &sads); -if (sad_count <0 ) { +if (sad_count <=0 ) {DRM_ERROR ("Couldn't read SADs: %d\n" , sad_count);return ; }
Greg Kroah-Hartman
maintainerPATCH 73/144 drm/radeon: fix asic gfx values for scrapper asics
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit e2f6c88fb903e123edfd1106b0b8310d5117f774 upstream.
Fixes gfx corruption on certain TN/RL parts.
bug:
https://bugs.freedesktop.org/show_bug.cgi?id=60389
--- drivers/gpu/drm/radeon/ni.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)
drivers/gpu/drm/radeon/ni.c +16 -4
@@ -900,6 +900,10 @@ static void cayman_gpu_init(struct radeo (rdev->pdev->device == 0x999C)) { rdev->config.cayman.max_simds_per_se =6 ; rdev->config.cayman.max_backends_per_se =2 ; + rdev->config.cayman.max_hw_contexts =8 ; + rdev->config.cayman.sx_max_export_size =256 ; + rdev->config.cayman.sx_max_export_pos_size =64 ; + rdev->config.cayman.sx_max_export_smx_size =192 ; } else if ((rdev->pdev->device == 0x9903) || (rdev->pdev->device == 0x9904) || (rdev->pdev->device == 0x990A) ||
@@ -910,6 +914,10 @@ static void cayman_gpu_init(struct radeo (rdev->pdev->device == 0x999D)) { rdev->config.cayman.max_simds_per_se =4 ; rdev->config.cayman.max_backends_per_se =2 ; + rdev->config.cayman.max_hw_contexts =8 ; + rdev->config.cayman.sx_max_export_size =256 ; + rdev->config.cayman.sx_max_export_pos_size =64 ; + rdev->config.cayman.sx_max_export_smx_size =192 ; } else if ((rdev->pdev->device == 0x9919) || (rdev->pdev->device == 0x9990) || (rdev->pdev->device == 0x9991) ||
@@ -920,9 +928,17 @@ static void cayman_gpu_init(struct radeo (rdev->pdev->device == 0x99A0)) { rdev->config.cayman.max_simds_per_se =3 ; rdev->config.cayman.max_backends_per_se =1 ; + rdev->config.cayman.max_hw_contexts =4 ; + rdev->config.cayman.sx_max_export_size =128 ; + rdev->config.cayman.sx_max_export_pos_size =32 ; + rdev->config.cayman.sx_max_export_smx_size =96 ; } else { rdev->config.cayman.max_simds_per_se =2 ; rdev->config.cayman.max_backends_per_se =1 ; + rdev->config.cayman.max_hw_contexts =4 ; + rdev->config.cayman.sx_max_export_size =128 ; + rdev->config.cayman.sx_max_export_pos_size =32 ; + rdev->config.cayman.sx_max_export_smx_size =96 ; } rdev->config.cayman.max_texture_channel_caches =2 ; rdev->config.cayman.max_gprs =256 ;
@@ -930,10 +946,6 @@ static void cayman_gpu_init(struct radeo rdev->config.cayman.max_gs_threads =32 ; rdev->config.cayman.max_stack_entries =512 ; rdev->config.cayman.sx_num_of_sets =8 ; - rdev->config.cayman.sx_max_export_size =256 ; - rdev->config.cayman.sx_max_export_pos_size =64 ; - rdev->config.cayman.sx_max_export_smx_size =192 ; - rdev->config.cayman.max_hw_contexts =8 ; rdev->config.cayman.sq_num_cf_insts =2 ; rdev->config.cayman.sc_prim_fifo_size =0x40 ;
Greg Kroah-Hartman
maintainerPATCH 74/144 drm/i915: Fix erroneous dereference of batch_obj inside reset_status
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Wilson <[email protected]>
commit 4db080f9e93411c3c41ec402244da28e2bbde835 upstream.
As the rings may be processed and their requests deallocated in a different order to the natural retirement during a reset,
/* Whilst this request exists, batch_obj will be on the
* active_list, and so will hold the active reference. Only when this
* request is retired will the the batch_obj be moved onto the
* inactive_list and lose its active reference. Hence we do not need
* to explicitly hold another reference here.
*/
is violated, and the batch_obj may be dereferenced after it had been freed on another ring. This can be simply avoided by processing the status update prior to deallocating any requests.
Fixes regression (a possible OOPS following a GPU hang) from commit aa60c664e6df502578454621c3a9b1f087ff8d25
Author: Mika Kuoppala <[email protected]> Date: Wed Jun 12 15:13:20 2013 +0300
drm/i915: find guilty batch buffer on ring resets
--- drivers/gpu/drm/i915/i915_gem.c | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +24 -10
@@ -2278,15 +2278,24 @@ static void i915_gem_free_request(structkfree (request); } -static void i915_gem_reset_ring_lists (struct drm_i915_private *dev_priv, -struct intel_ring_buffer *ring) +static void i915_gem_reset_ring_status (struct drm_i915_private *dev_priv, +struct intel_ring_buffer *ring) { -u32 completed_seqno; -u32 acthd; +u32 completed_seqno = ring->get_seqno (ring, false); +u32 acthd =intel_ring_get_active_head (ring); +struct drm_i915_gem_request *request; + +list_for_each_entry (request, &ring->request_list, list) { +if (i915_seqno_passed (completed_seqno, request->seqno)) +continue ; - acthd =intel_ring_get_active_head (ring); - completed_seqno = ring->get_seqno (ring, false); +i915_set_reset_status (ring, request, acthd); + } +} +static void i915_gem_reset_ring_cleanup (struct drm_i915_private *dev_priv, +struct intel_ring_buffer *ring) +{while (!list_empty (&ring->request_list)) {struct drm_i915_gem_request *request;
@@ -2294,9 +2303,6 @@ static void i915_gem_reset_ring_lists(st struct drm_i915_gem_request, list); -if (request->seqno > completed_seqno) -i915_set_reset_status (ring, request, acthd); -i915_gem_free_request (request); }
@@ -2338,8 +2344,16 @@ void i915_gem_reset(struct drm_device *dstruct intel_ring_buffer *ring;int i; +/* +* Before we free the objects from the requests, we need to inspect +* them for finding the guilty party. As the requests only borrow +* their reference to the objects, the inspection must be done first. +*/ +for_each_ring (ring, dev_priv, i) +i915_gem_reset_ring_status (dev_priv, ring); +for_each_ring (ring, dev_priv, i) -i915_gem_reset_ring_lists (dev_priv, ring); +i915_gem_reset_ring_cleanup (dev_priv, ring);i915_gem_restore_fences (dev); }
Greg Kroah-Hartman
maintainerPATCH 75/144 drm/i915: change CRTC assertion on LCPLL disable
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Zanoni <[email protected]>
commit 96b4026878d9dac71bd4c3d6e05c7fbb16a3e0aa upstream.
Currently, PC8 is enabled at modeset_global_resources, which is called after intel_modeset_update_state. Due to this, there's a small race condition on the case where we start enabling PC8, then do a modeset while PC8 is still being enabled. The racing condition triggers a WARN because intel_modeset_update_state will mark the CRTC as enabled, then the thread that's still enabling PC8 might look at the data structure and think that PC8 is being enabled while a pipe is enabled. Despite the WARN, this is not really a bug since we'll wait for the PC8-enabling thread to finish when we call modeset_global_resources.
The spec says the CRTC cannot be enabled when we disable LCPLL, so we had a check for crtc->base.enabled. If we change to crtc->active we will still prevent disabling LCPLL while the CRTC is enabled, and we will also prevent the WARN above.
This is a replacement for the previous patch named
"drm/i915: get/put PC8 when we get/put a CRTC"
Testcase: igt/pm_pc8/modeset-lpsp-stress-no-wait
from -next due to Dave's report.)
--- drivers/gpu/drm/i915/intel_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +1 -1
@@ -6009,7 +6009,7 @@ static void assert_can_disable_lcpll(struint32_t val;list_for_each_entry (crtc, &dev->mode_config.crtc_list, base.head) -WARN (crtc->base.enabled,"CRTC for pipe %c enabled\n" , +WARN (crtc->active,"CRTC for pipe %c enabled\n" ,pipe_name (crtc->pipe));WARN (I915_READ (HSW_PWR_WELL_DRIVER ),"Power well on\n" );
Greg Kroah-Hartman
maintainerPATCH 80/144 drm/radeon: 0x9649 is SUMO2 not SUMO
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit d00adcc8ae9e22eca9d8af5f66c59ad9a74c90ec upstream.
Fixes rendering corruption due to incorrect
gfx configuration.
bug:
https://bugs.freedesktop.org/show_bug.cgi?id=63599
--- include/drm/drm_pciids.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/drm/drm_pciids.h +1 -1
@@ -588,7 +588,7 @@ {0x1002, 0x9645, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO2|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ {0x1002, 0x9647, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\ {0x1002, 0x9648, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\ - {0x1002, 0x9649, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\ + {0x1002, 0x9649, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO2|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\ {0x1002, 0x964a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ {0x1002, 0x964b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ {0x1002, 0x964c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
Greg Kroah-Hartman
maintainerPATCH 82/144 ceph: Avoid data inconsistency due to d-cache aliasing in readpage()
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Wang <[email protected]>
commit 56f91aad69444d650237295f68c195b74d888d95 upstream.
If the length of data to be read in readpage() is exactly PAGE_CACHE_SIZE, the original code does not flush d-cache for data consistency after finishing reading. This patches fixes this.
--- fs/ceph/addr.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
fs/ceph/addr.c +6 -2
@@ -210,9 +210,13 @@ static int readpage_nounlock(struct fileif (err <0 ) {SetPageError (page); goto out; - }else if (err <PAGE_CACHE_SIZE ) { + }else { +if (err <PAGE_CACHE_SIZE ) {/* zero fill remainder of page */ -zero_user_segment (page, err,PAGE_CACHE_SIZE ); +zero_user_segment (page, err,PAGE_CACHE_SIZE ); + }else { +flush_dcache_page (page); + } }SetPageUptodate (page);
Greg Kroah-Hartman
maintainerPATCH 83/144 tg3: Expand 4g_overflow_test workaround to skb fragments of any size.
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nithin Sujir <[email protected]>
commit 375679104ab3ccfd18dcbd7ba503734fb9a2c63a upstream.
The current driver assumes that an skb fragment can only be upto jumbo size. Presumably this was a fast-path optimization. This assumption is no longer true as fragments can be upto 32k.
v2: Remove unnecessary parantheses per Eric Dumazet.
--- drivers/net/ethernet/broadcom/tg3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/broadcom/tg3.c +1 -1
@@ -7608,7 +7608,7 @@ static inline int tg3_4g_overflow_test(d {u32 base = (u32 ) mapping &0xffffffff ; -return (base >0xffffdcc0 ) && (base + len +8 < base); +return base + len +8 < base; }/* Test for TSO DMA buffers that cross into regions which are within MSS bytes
Greg Kroah-Hartman
maintainerPATCH 84/144 cgroup: fix cgroup_create() error handling path
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <[email protected]>
commit 266ccd505e8acb98717819cef9d91d66c7b237cc upstream.
ae7f164a09 ("cgroup: move cgroup->subsys[] assignment to online_css()") moved cgroup->subsys[] assignements later in cgroup_create() but didn't update error handling path accordingly leading to the following oops and leaking later css's after an online_css() failure. The oops is from cgroup destruction path being invoked on the partially constructed cgroup which is not ready to handle empty slots in cgrp->subsys[] array.
BUG: unable to handle kernel NULL pointer dereference at 0000000000000008 IP: [<ffffffff810eeaa8>] cgroup_destroy_locked+0x118/0x2f0 PGD a780a067 PUD aadbe067 PMD 0 Oops: 0000 [#1] SMP Modules linked in: CPU: 6 PID: 7360 Comm: mkdir Not tainted 3.13.0-rc2+ #69 Hardware name: task: ffff8800b9dbec00 ti: ffff8800a781a000 task.ti: ffff8800a781a000 RIP: 0010:[<ffffffff810eeaa8>] [<ffffffff810eeaa8>] cgroup_destroy_locked+0x118/0x2f0 RSP: 0018:ffff8800a781bd98 EFLAGS: 00010282 RAX: ffff880586903878 RBX: ffff880586903800 RCX: ffff880586903820 RDX: ffff880586903860 RSI: ffff8800a781bdb0 RDI: ffff880586903820 RBP: ffff8800a781bde8 R08: ffff88060e0b8048 R09: ffffffff811d7bc1 R10: 000000000000008c R11: 0000000000000001 R12: ffff8800a72286c0 R13: 0000000000000000 R14: ffffffff81cf7a40 R15: 0000000000000001 FS: 00007f60ecda57a0(0000) GS:ffff8806272c0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000008 CR3: 00000000a7a03000 CR4: 00000000000007e0 Stack: ffff880586903860 ffff880586903910 ffff8800a72286c0 ffff880586903820 ffffffff81cf7a40 ffff880586903800 ffff88060e0b8018 ffffffff81cf7a40 ffff8800b9dbec00 ffff8800b9dbf098 ffff8800a781bec8 ffffffff810ef5bf Call Trace: [<ffffffff810ef5bf>] cgroup_mkdir+0x55f/0x5f0 [<ffffffff811c90ae>] vfs_mkdir+0xee/0x140 [<ffffffff811cb07e>] SyS_mkdirat+0x6e/0xf0 [<ffffffff811c6a19>] SyS_mkdir+0x19/0x20 [<ffffffff8169e569>] system_call_fastpath+0x16/0x1b
This patch moves reference bumping inside online_css() loop, clears css_ar[] as css's are brought online successfully, and updates err_destroy path so that either a css is fully online and destroyed by cgroup_destroy_locked() or the error path frees it. This creates a duplicate css free logic in the error path but it will be cleaned up soon.
v2: Li pointed out that cgroup_destroy_locked() would do NULL-deref if
invoked with a cgroup which doesn't have all css's populated. Update cgroup_destroy_locked() so that it skips NULL css's.
--- kernel/cgroup.c | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-)
kernel/cgroup.c +21 -10
@@ -4490,14 +4490,6 @@ static long cgroup_create(struct cgrouplist_add_tail_rcu (&cgrp->sibling, &cgrp->parent->children); root->number_of_cgroups++; -/* each css holds a ref to the cgroup's dentry and the parent css */ -for_each_root_subsys (root, ss) { -struct cgroup_subsys_state *css = css_ar[ss->subsys_id]; - -dget (dentry); -css_get (css->parent); - } -/* hold a ref to the parent's dentry */ dget (parent->dentry);
@@ -4509,6 +4501,13 @@ static long cgroup_create(struct cgroupif (err) goto err_destroy; +/* each css holds a ref to the cgroup's dentry and parent css */ +dget (dentry); +css_get (css->parent); + +/* mark it consumed for error path */ + css_ar[ss->subsys_id] =NULL ; +if (ss->broken_hierarchy && !ss->warned_broken_hierarchy && parent->parent) { pr_warning("cgroup: %s (%d) created nested cgroup for controller \"%s\" which has incomplete hierarchy support. Nested cgroups may change behavior in the future.\n",
@@ -4555,6 +4554,14 @@ err_free_cgrp:return err; err_destroy: +for_each_root_subsys (root, ss) { +struct cgroup_subsys_state *css = css_ar[ss->subsys_id]; + +if (css) { +percpu_ref_cancel_init (&css->refcnt); + ss->css_free (css); + } + }cgroup_destroy_locked (cgrp);mutex_unlock (&cgroup_mutex);mutex_unlock (&dentry->d_inode->i_mutex);
@@ -4716,8 +4723,12 @@ static int cgroup_destroy_locked(struct* will be invoked to perform the rest of destruction once the * percpu refs of all css's are confirmed to be killed. */ -for_each_root_subsys (cgrp->root, ss) -kill_css (cgroup_css (cgrp, ss)); +for_each_root_subsys (cgrp->root, ss) { +struct cgroup_subsys_state *css =cgroup_css (cgrp, ss); + +if (css) +kill_css (css); + }/* * Mark @cgrp dead. This prevents further task migration and child
Greg Kroah-Hartman
maintainerPATCH 85/144 auxvec.h: account for AT_HWCAP2 in AT_VECTOR_SIZE_BASE
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ard Biesheuvel <[email protected]>
commit f60900f2609e893c7f8d0bccc7ada4947dac4cd5 upstream.
Commit 2171364d1a92 ("powerpc: Add HWCAP2 aux entry") introduced a new AT_ auxv entry type AT_HWCAP2 but failed to update AT_VECTOR_SIZE_BASE accordingly.
--- include/linux/auxvec.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/auxvec.h +1 -1
@@ -3,6 +3,6 @@#include <uapi/linux/auxvec.h> -#define AT_VECTOR_SIZE_BASE 19/* NEW_AUX_ENT entries in auxiliary table */ +#define AT_VECTOR_SIZE_BASE 20/* NEW_AUX_ENT entries in auxiliary table */ /* number of "#define AT_.*" above, minus {AT_NULL, AT_IGNORE, AT_NOTELF} */ #endif /* _LINUX_AUXVEC_H */
Greg Kroah-Hartman
maintainerPATCH 86/144 dm9601: fix reception of full size ethernet frames on dm9620/dm9621a
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Korsgaard <[email protected]>
commit 407900cfb54bdb2cfa228010b6697305f66b2948 upstream.
dm9620/dm9621a require room for 4 byte padding even in dm9601 (3 byte header) mode.
--- drivers/net/usb/dm9601.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/usb/dm9601.c +6 -1
@@ -364,7 +364,12 @@ static int dm9601_bind(struct usbnet *de dev->net->ethtool_ops = &dm9601_ethtool_ops; dev->net->hard_header_len +=DM_TX_OVERHEAD ; dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len; - dev->rx_urb_size = dev->net->mtu +ETH_HLEN +DM_RX_OVERHEAD ; + +/* dm9620/21a require room for 4 byte padding, even in dm9601 +* mode, so we need +1 to be able to receive full size +* ethernet frames. +*/ + dev->rx_urb_size = dev->net->mtu +ETH_HLEN +DM_RX_OVERHEAD +1 ; dev->mii.dev = dev->net; dev->mii.mdio_read = dm9601_mdio_read;
Greg Kroah-Hartman
maintainerPATCH 87/144 dm9601: work around tx fifo sync issue on dm962x
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Korsgaard <[email protected]>
commit 4263c86dca5198da6bd3ad826d0b2304fbe25776 upstream.
Certain dm962x revisions contain an bug, where if a USB bulk transfer retry (E.G. if bulk crc mismatch) happens right after a transfer with odd or maxpacket length, the internal tx hardware fifo gets out of sync causing the interface to stop working.
Work around it by adding up to 3 bytes of padding to ensure this situation cannot trigger.
This workaround also means we never pass multiple-of-maxpacket size skb's to usbnet, so the length adjustment to handle usbnet's padding of those can be removed.
--- drivers/net/usb/dm9601.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-)
drivers/net/usb/dm9601.c +19 -8
@@ -473,7 +473,7 @@ static int dm9601_rx_fixup(struct usbnetstatic struct sk_buff *dm9601_tx_fixup (struct usbnet *dev,struct sk_buff *skb,gfp_t flags) { -int len; +int len, pad;/* format: b1: packet length low
@@ -481,12 +481,23 @@ static struct sk_buff *dm9601_tx_fixup(sb3..n: packet data */ - len = skb->len; + len = skb->len +DM_TX_OVERHEAD ; -if (skb_headroom (skb) <DM_TX_OVERHEAD ) { +/* workaround for dm962x errata with tx fifo getting out of +* sync if a USB bulk transfer retry happens right after a +* packet with odd / maxpacket length by adding up to 3 bytes +* padding. +*/ +while ((len &1 ) || !(len % dev->maxpacket)) + len++; + + len -=DM_TX_OVERHEAD ;/* hw header doesn't count as part of length */ + pad = len - skb->len; + +if (skb_headroom (skb) <DM_TX_OVERHEAD ||skb_tailroom (skb) < pad) {struct sk_buff *skb2; - skb2 =skb_copy_expand (skb,DM_TX_OVERHEAD ,0 , flags); + skb2 =skb_copy_expand (skb,DM_TX_OVERHEAD , pad, flags);dev_kfree_skb_any (skb); skb = skb2;if (!skb)
@@ -495,10 +506,10 @@ static struct sk_buff *dm9601_tx_fixup(s__skb_push (skb,DM_TX_OVERHEAD ); -/* usbnet adds padding if length is a multiple of packet size -if so, adjust length value in header */ -if ((skb->len % dev->maxpacket) ==0 ) - len++; +if (pad) { +memset (skb->data + skb->len,0 , pad); +__skb_put (skb, pad); + } skb->data[0 ] = len; skb->data[1 ] = len >>8 ;
Greg Kroah-Hartman
maintainerPATCH 88/144 ath9k: Fix interrupt handling for the AR9002 family
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sujith Manoharan <[email protected]>
commit 73f0b56a1ff64e7fb6c3a62088804bab93bcedc2 upstream.
This patch adds a driver workaround for a HW issue.
A race condition in the HW results in missing interrupts, which can be avoided by a read/write with the ISR register. All chips in the AR9002 series are affected by this bug - AR9003 and above do not have this problem.
--- drivers/net/wireless/ath/ath9k/ar9002_mac.c | 52 +++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 9 deletions(-)
drivers/net/wireless/ath/ath9k/ar9002_mac.c +43 -9
@@ -76,9 +76,16 @@ static bool ar9002_hw_get_isr(struct ath mask2 |=ATH9K_INT_CST ;if (isr2 &AR_ISR_S2_TSFOOR ) mask2 |=ATH9K_INT_TSFOOR ; + +if (!(pCap->hw_caps &ATH9K_HW_CAP_RAC_SUPPORTED )) { +REG_WRITE (ah,AR_ISR_S2 , isr2); + isr &= ~AR_ISR_BCNMISC ; + } } - isr =REG_READ (ah,AR_ISR_RAC ); +if (pCap->hw_caps &ATH9K_HW_CAP_RAC_SUPPORTED ) + isr =REG_READ (ah,AR_ISR_RAC ); +if (isr ==0xffffffff ) { *masked =0 ;return false;
@@ -97,11 +104,23 @@ static bool ar9002_hw_get_isr(struct ath *masked |=ATH9K_INT_TX ; - s0_s =REG_READ (ah,AR_ISR_S0_S ); +if (pCap->hw_caps &ATH9K_HW_CAP_RAC_SUPPORTED ) { + s0_s =REG_READ (ah,AR_ISR_S0_S ); + s1_s =REG_READ (ah,AR_ISR_S1_S ); + }else { + s0_s =REG_READ (ah,AR_ISR_S0 ); +REG_WRITE (ah,AR_ISR_S0 , s0_s); + s1_s =REG_READ (ah,AR_ISR_S1 ); +REG_WRITE (ah,AR_ISR_S1 , s1_s); + + isr &= ~(AR_ISR_TXOK | +AR_ISR_TXDESC | +AR_ISR_TXERR | +AR_ISR_TXEOL ); + } + ah->intr_txqs |=MS (s0_s,AR_ISR_S0_QCU_TXOK ); ah->intr_txqs |=MS (s0_s,AR_ISR_S0_QCU_TXDESC ); - - s1_s =REG_READ (ah,AR_ISR_S1_S ); ah->intr_txqs |=MS (s1_s,AR_ISR_S1_QCU_TXERR ); ah->intr_txqs |=MS (s1_s,AR_ISR_S1_QCU_TXEOL ); }
@@ -114,13 +133,15 @@ static bool ar9002_hw_get_isr(struct ath *masked |= mask2; } -if (AR_SREV_9100 (ah)) -return true; - -if (isr &AR_ISR_GENTMR ) { +if (!AR_SREV_9100 (ah) && (isr &AR_ISR_GENTMR )) {u32 s5_s; - s5_s =REG_READ (ah,AR_ISR_S5_S ); +if (pCap->hw_caps &ATH9K_HW_CAP_RAC_SUPPORTED ) { + s5_s =REG_READ (ah,AR_ISR_S5_S ); + }else { + s5_s =REG_READ (ah,AR_ISR_S5 ); + } + ah->intr_gen_timer_trigger =MS (s5_s,AR_ISR_S5_GENTIMER_TRIG );
@@ -133,8 +154,21 @@ static bool ar9002_hw_get_isr(struct athif ((s5_s &AR_ISR_S5_TIM_TIMER ) && !(pCap->hw_caps &ATH9K_HW_CAP_AUTOSLEEP )) *masked |=ATH9K_INT_TIM_TIMER ; + +if (!(pCap->hw_caps &ATH9K_HW_CAP_RAC_SUPPORTED )) { +REG_WRITE (ah,AR_ISR_S5 , s5_s); + isr &= ~AR_ISR_GENTMR ; + } + } + +if (!(pCap->hw_caps &ATH9K_HW_CAP_RAC_SUPPORTED )) { +REG_WRITE (ah,AR_ISR , isr); +REG_READ (ah,AR_ISR ); } +if (AR_SREV_9100 (ah)) +return true; +if (sync_cause) {ath9k_debug_sync_cause (common, sync_cause); fatal_int =
Greg Kroah-Hartman
maintainerPATCH 89/144 ath9k_htc: properly set MAC address and BSSID mask
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathy Vanhoef <[email protected]>
commit 657eb17d87852c42b55c4b06d5425baa08b2ddb3 upstream.
Pick the MAC address of the first virtual interface as the new hardware MAC address. Set BSSID mask according to this MAC address. This fixes CVE-2013-4579.
--- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 25 +++++++++++++++++-------- drivers/net/wireless/ath/ath9k/main.c | 5 +++-- 2 files changed, 20 insertions(+), 10 deletions(-)
drivers/net/wireless/ath/ath9k/htc_drv_main.c +17 -8
@@ -147,21 +147,26 @@ static void ath9k_htc_bssid_iter(void *dstruct ath9k_vif_iter_data *iter_data = data;int i; -for (i =0 ; i <ETH_ALEN ; i++) - iter_data->mask[i] &= ~(iter_data->hw_macaddr[i] ^ mac[i]); +if (iter_data->hw_macaddr !=NULL ) { +for (i =0 ; i <ETH_ALEN ; i++) + iter_data->mask[i] &= ~(iter_data->hw_macaddr[i] ^ mac[i]); + }else { + iter_data->hw_macaddr = mac; + } } -static void ath9k_htc_set_bssid_mask (struct ath9k_htc_priv *priv, +static void ath9k_htc_set_mac_bssid_mask (struct ath9k_htc_priv *priv,struct ieee80211_vif *vif) {struct ath_common *common =ath9k_hw_common (priv->ah);struct ath9k_vif_iter_data iter_data;/* -* Use the hardware MAC address as reference, the hardware uses it -* together with the BSSID mask when matching addresses. +* Pick the MAC address of the first interface as the new hardware +* MAC address. The hardware will use it together with the BSSID mask +* when matching addresses. */ - iter_data.hw_macaddr = common->macaddr; + iter_data.hw_macaddr =NULL ;memset (&iter_data.mask,0xff ,ETH_ALEN );if (vif)
@@ -173,6 +178,10 @@ static void ath9k_htc_set_bssid_mask(str ath9k_htc_bssid_iter, &iter_data);memcpy (common->bssidmask, iter_data.mask,ETH_ALEN ); + +if (iter_data.hw_macaddr) +memcpy (common->macaddr, iter_data.hw_macaddr,ETH_ALEN ); +ath_hw_setbssidmask (common); }
@@ -1083,7 +1092,7 @@ static int ath9k_htc_add_interface(struc goto out; } -ath9k_htc_set_bssid_mask (priv, vif); +ath9k_htc_set_mac_bssid_mask (priv, vif); priv->vif_slot |= (1 << avp->index); priv->nvifs++;
@@ -1148,7 +1157,7 @@ static void ath9k_htc_remove_interface(sath9k_htc_set_opmode (priv); -ath9k_htc_set_bssid_mask (priv, vif); +ath9k_htc_set_mac_bssid_mask (priv, vif);/* * Stop ANI only if there are no associated station interfaces.
drivers/net/wireless/ath/ath9k/main.c +3 -2
@@ -885,8 +885,9 @@ void ath9k_calculate_iter_data(struct iestruct ath_common *common =ath9k_hw_common (ah);/* -* Use the hardware MAC address as reference, the hardware uses it -* together with the BSSID mask when matching addresses. +* Pick the MAC address of the first interface as the new hardware +* MAC address. The hardware will use it together with the BSSID mask +* when matching addresses. */ memset (iter_data,0 ,sizeof (*iter_data));memset (&iter_data->mask,0xff ,ETH_ALEN );
Greg Kroah-Hartman
maintainerPATCH 90/144 KVM: nVMX: Unconditionally uninit the MMU on nested vmexit
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kiszka <[email protected]>
commit 29bf08f12b2fd72b882da0d85b7385e4a438a297 upstream.
Three reasons for doing this: 1. arch.walk_mmu points to arch.mmu anyway in case nested EPT wasn't in use. 2. this aligns VMX with SVM. But 3. is most important: nested_cpu_has_ept(vmcs12) queries the VMCS page, and if one guest VCPU manipulates the page of another VCPU in L2, we may be fooled to skip over the nested_ept_uninit_mmu_context, leaving mmu in nested state. That can crash the host later on if nested_ept_get_cr3 is invoked while L1 already left vmxon and nested.current_vmcs12 became NULL therefore.
--- arch/x86/kvm/vmx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/x86/kvm/vmx.c +1 -2
@@ -8218,8 +8218,7 @@ static void load_vmcs12_host_state(struc vcpu->arch.cr4_guest_owned_bits = ~vmcs_readl (CR4_GUEST_HOST_MASK );kvm_set_cr4 (vcpu, vmcs12->host_cr4); -if (nested_cpu_has_ept (vmcs12)) -nested_ept_uninit_mmu_context (vcpu); +nested_ept_uninit_mmu_context (vcpu);kvm_set_cr3 (vcpu, vmcs12->host_cr3);kvm_mmu_reset_context (vcpu);
Greg Kroah-Hartman
maintainerPATCH 91/144 KVM: x86: Fix APIC map calculation after re-enabling
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kiszka <[email protected]>
commit e66d2ae7c67bd9ac982a3d1890564de7f7eabf4b upstream.
Update arch.apic_base before triggering recalculate_apic_map. Otherwise the recalculation will work against the previous state of the APIC and will fail to build the correct map when an APIC is hardware-enabled again.
This fixes a regression of 1e08ec4a13.
--- arch/x86/kvm/lapic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/x86/kvm/lapic.c +4 -4
@@ -1350,6 +1350,10 @@ void kvm_lapic_set_base(struct kvm_vcpureturn ; } +if (!kvm_vcpu_is_bsp (apic->vcpu)) + value &= ~MSR_IA32_APICBASE_BSP ; + vcpu->arch.apic_base = value; +/* update jump label if enable bit changes */ if ((vcpu->arch.apic_base ^ value) &MSR_IA32_APICBASE_ENABLE ) {if (value &MSR_IA32_APICBASE_ENABLE )
@@ -1359,10 +1363,6 @@ void kvm_lapic_set_base(struct kvm_vcpurecalculate_apic_map (vcpu->kvm); } -if (!kvm_vcpu_is_bsp (apic->vcpu)) - value &= ~MSR_IA32_APICBASE_BSP ; - - vcpu->arch.apic_base = value;if ((old_value ^ value) &X2APIC_ENABLE ) {if (value &X2APIC_ENABLE ) {u32 id =kvm_apic_id (apic);
Greg Kroah-Hartman
maintainerPATCH 92/144 powerpc: Fix bad stack check in exception entry
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Neuling <[email protected]>
commit 90ff5d688e61f49f23545ffab6228bd7e87e6dc7 upstream.
In EXCEPTION_PROLOG_COMMON() we check to see if the stack pointer (r1) is valid when coming from the kernel. If it's not valid, we die but with a nice oops message.
Currently we allocate a stack frame (subtract INT_FRAME_SIZE) before we check to see if the stack pointer is negative. Unfortunately, this won't detect a bad stack where r1 is less than INT_FRAME_SIZE.
This patch fixes the check to compare the modified r1 with -INT_FRAME_SIZE. With this, bad kernel stack pointers (including NULL pointers) are correctly detected again.
Kudos to Paulus for finding this.
--- arch/powerpc/include/asm/exception-64s.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/include/asm/exception-64s.h +1 -1
@@ -265,7 +265,7 @@ do_kvm_##n: \subi r1,r1,INT_FRAME_SIZE ;/* alloc frame on kernel stack */ \ beq-1f ; \ld r1,PACAKSAVE (r13 );/* kernel stack to use */ \ -1: cmpdi cr1,r1,0; /* check if r1 is in userspace */ \ +1: cmpdi cr1,r1,-INT_FRAME_SIZE; /* check if r1 is in userspace */ \ blt+ cr1,3f ;/* abort if it is */ \li r1,(n);/* will be reloaded later */ \sth r1,PACA_TRAP_SAVE (r13 ); \
Greg Kroah-Hartman
maintainerPATCH 93/144 powerpc: Align p_end
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anton Blanchard <[email protected]>
commit 286e4f90a72c0b0621dde0294af6ed4b0baddabb upstream.
p_end is an 8 byte value embedded in the text section. This means it is only 4 byte aligned when it should be 8 byte aligned. Fix this by adding an explicit alignment.
This fixes an issue where POWER7 little endian builds with CONFIG_RELOCATABLE=y fail to boot.
--- arch/powerpc/kernel/head_64.S | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/kernel/head_64.S +1 -0
@@ -467,6 +467,7 @@ _STATIC(__after_prom_start) mtctr r8 bctr +.balign 8 p_end: .llong _end - _stext 4: /* Now copy the rest of the kernel up to _end */
Greg Kroah-Hartman
maintainerPATCH 94/144 cpupower: Fix segfault due to incorrect getopt_long arugments
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josh Boyer <[email protected]>
commit f447ef4a56dee4b68a91460bcdfe06b5011085f2 upstream.
If a user calls 'cpupower set --perf-bias 15', the process will end with a SIGSEGV in libc because cpupower-set passes a NULL optarg to the atoi call. This is because the getopt_long structure currently has all of the options as having an optional_argument when they really have a required argument. We change the structure to use required_argument to match the short options and it resolves the issue.
This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1000439
--- tools/power/cpupower/utils/cpupower-set.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/power/cpupower/utils/cpupower-set.c +3 -3
@@ -18,9 +18,9 @@#include "helpers/bitmask.h" static struct option set_opts[] = { - { .name ="perf-bias" , .has_arg = optional_argument, .flag =NULL , .val ='b' }, - { .name ="sched-mc" , .has_arg = optional_argument, .flag =NULL , .val ='m' }, - { .name ="sched-smt" , .has_arg = optional_argument, .flag =NULL , .val ='s' }, + { .name ="perf-bias" , .has_arg = required_argument, .flag =NULL , .val ='b' }, + { .name ="sched-mc" , .has_arg = required_argument, .flag =NULL , .val ='m' }, + { .name ="sched-smt" , .has_arg = required_argument, .flag =NULL , .val ='s' }, { }, };
Greg Kroah-Hartman
maintainerPATCH 95/144 power_supply: Fix Oops from NULL pointer dereference from wakeup_source_activate
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shuah Khan <[email protected]>
commit 80c6463e2fa3377febfc98a6672d92d07f3c26c1 upstream.
power_supply_register() calls device_init_wakeup() to register a wakeup source before initializing dev_name. As a result, device_wakeup_enable() end up registering wakeup source with a null name when wakeup_source_register() gets called with dev_name(dev) which is null at the time.
When kernel is booted with wakeup_source_activate enabled, it will panic when the trace point code tries to dereference ws->name.
Fixed the problem by moving up the kobject_set_name() call prior to accesses to dev_name(). Replaced kobject_set_name() with dev_set_name() which is the right interface to be called from drivers. Fixed the call to device_del() prior to device_add() in for wakeup_init_failed error handling code.
Trace after the change:
bash-2143 [003] d... 132.280697: wakeup_source_activate: BAT1 state=0x20001
kworker/3:2-1169 [003] d... 132.281305: wakeup_source_deactivate: BAT1 state=0x30000Oops message:
[ 819.769934] device: 'BAT1': device_add [ 819.770078] PM: Adding info for No Bus:BAT1 [ 819.770235] BUG: unable to handle kernel NULL pointer dereference at (null) [ 819.770435] IP: [<ffffffff813381c0>] skip_spaces+0x30/0x30 [ 819.770572] PGD 3efd90067 PUD 3eff61067 PMD 0 [ 819.770716] Oops: 0000 [#1] SMP [ 819.770829] Modules linked in: arc4 iwldvm mac80211 x86_pkg_temp_thermal coretemp kvm_intel joydev i915 kvm uvcvideo ghash_clmulni_intel videobuf2_vmalloc aesni_intel videobuf2_memops videobuf2_core aes_x86_64 ablk_helper cryptd videodev iwlwifi lrw rfcomm gf128mul glue_helper bnep btusb media bluetooth parport_pc hid_generic ppdev snd_hda_codec_hdmi drm_kms_helper snd_hda_codec_realtek cfg80211 drm tpm_infineon samsung_laptop snd_hda_intel usbhid snd_hda_codec hid snd_hwdep snd_pcm microcode snd_page_alloc snd_timer psmouse i2c_algo_bit lpc_ich tpm_tis video wmi mac_hid serio_raw ext2 lp parport r8169 mii [ 819.771802] CPU: 0 PID: 2167 Comm: bash Not tainted 3.12.0+ #25 [ 819.771876] Hardware name: SAMSUNG ELECTRONICS CO., LTD. 900X3C/900X3D/900X4C/900X4D/SAMSUNG_NP1234567890, BIOS P03AAC 07/12/2012 [ 819.772022] task: ffff88002e6ddcc0 ti: ffff8804015ca000 task.ti: ffff8804015ca000 [ 819.772119] RIP: 0010:[<ffffffff813381c0>] [<ffffffff813381c0>] skip_spaces+0x30/0x30 [ 819.772242] RSP: 0018:ffff8804015cbc70 EFLAGS: 00010046 [ 819.772310] RAX: 0000000000000003 RBX: ffff88040cfd6d40 RCX: 0000000000000018 [ 819.772397] RDX: 0000000000020001 RSI: 0000000000000000 RDI: 0000000000000000 [ 819.772484] RBP: ffff8804015cbcc0 R08: 0000000000000000 R09: ffff8803f0768d40 [ 819.772570] R10: ffffea001033b800 R11: 0000000000000000 R12: ffffffff81c519c0 [ 819.772656] R13: 0000000000020001 R14: 0000000000000000 R15: 0000000000020001 [ 819.772744] FS: 00007ff98309b740(0000) GS:ffff88041f200000(0000) knlGS:0000000000000000 [ 819.772845] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 819.772917] CR2: 0000000000000000 CR3: 00000003f59dc000 CR4: 00000000001407f0 [ 819.773001] Stack: [ 819.773030] ffffffff81114003 ffff8804015cbcb0 0000000000000000 0000000000000046 [ 819.773146] ffff880409757a18 ffff8803f065a160 0000000000000000 0000000000020001 [ 819.773273] 0000000000000000 0000000000000000 ffff8804015cbce8 ffffffff8143e388 [ 819.773387] Call Trace: [ 819.773434] [<ffffffff81114003>] ? ftrace_raw_event_wakeup_source+0x43/0xe0 [ 819.773520] [<ffffffff8143e388>] wakeup_source_report_event+0xb8/0xd0 [ 819.773595] [<ffffffff8143e3cd>] __pm_stay_awake+0x2d/0x50 [ 819.773724] [<ffffffff8153395c>] power_supply_changed+0x3c/0x90 [ 819.773795] [<ffffffff8153407c>] power_supply_register+0x18c/0x250 [ 819.773869] [<ffffffff813d8d18>] sysfs_add_battery+0x61/0x7b [ 819.773935] [<ffffffff813d8d69>] battery_notify+0x37/0x3f [ 819.774001] [<ffffffff816ccb7c>] notifier_call_chain+0x4c/0x70 [ 819.774071] [<ffffffff81073ded>] __blocking_notifier_call_chain+0x4d/0x70 [ 819.774149] [<ffffffff81073e26>] blocking_notifier_call_chain+0x16/0x20 [ 819.774227] [<ffffffff8109397a>] pm_notifier_call_chain+0x1a/0x40 [ 819.774316] [<ffffffff81095b66>] hibernate+0x66/0x1c0 [ 819.774407] [<ffffffff81093931>] state_store+0x71/0xa0 [ 819.774507] [<ffffffff81331d8f>] kobj_attr_store+0xf/0x20 [ 819.774613] [<ffffffff811f8618>] sysfs_write_file+0x128/0x1c0 [ 819.774735] [<ffffffff8118579d>] vfs_write+0xbd/0x1e0 [ 819.774841] [<ffffffff811861d9>] SyS_write+0x49/0xa0 [ 819.774939] [<ffffffff816d1052>] system_call_fastpath+0x16/0x1b [ 819.775055] Code: 89 f8 48 89 e5 f6 82 c0 a6 84 81 20 74 15 0f 1f 44 00 00 48 83 c0 01 0f b6 10 f6 82 c0 a6 84 81 20 75 f0 5d c3 66 0f 1f 44 00 00 <80> 3f 00 55 48 89 e5 74 15 48 89 f8 0f 1f 40 00 48 83 c0 01 80 [ 819.775760] RIP [<ffffffff813381c0>] skip_spaces+0x30/0x30 [ 819.775881] RSP <ffff8804015cbc70> [ 819.775949] CR2: 0000000000000000 [ 819.794175] ---[ end trace c4ef25127039952e ]---
--- drivers/power/power_supply_core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/power/power_supply_core.c +6 -6
@@ -511,6 +511,10 @@ int power_supply_register(struct devicedev_set_drvdata (dev, psy); psy->dev = dev; + rc =dev_set_name (dev,"%s" , psy->name); +if (rc) + goto dev_set_name_failed; +INIT_WORK (&psy->changed_work, power_supply_changed_work); rc =power_supply_check_supplies (psy);
@@ -524,10 +528,6 @@ int power_supply_register(struct deviceif (rc) goto wakeup_init_failed; - rc =kobject_set_name (&dev->kobj,"%s" , psy->name); -if (rc) - goto kobject_set_name_failed; - rc =device_add (dev);if (rc) goto device_add_failed;
@@ -553,11 +553,11 @@ create_triggers_failed: register_cooler_failed:psy_unregister_thermal (psy); register_thermal_failed: -wakeup_init_failed:device_del (dev); -kobject_set_name_failed: device_add_failed: +wakeup_init_failed: check_supplies_failed: +dev_set_name_failed:put_device (dev); success:return rc;
Greg Kroah-Hartman
maintainerPATCH 96/144 drm/nouveau: only runtime suspend by default in optimus configuration
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilia Mirkin <[email protected]>
commit b25b4427e9dfba073cf9bc86603956ed395eb6e3 upstream.
The intent was to only enable it by default for optimus, e.g. see the runtime_idle callback. The suspend callback may be called directly, e.g. as a result of nouveau_crtc_set_config.
--- drivers/gpu/drm/nouveau/nouveau_drm.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/nouveau/nouveau_drm.c +6 -0
@@ -879,6 +879,12 @@ static int nouveau_pmops_runtime_suspendif (nouveau_runtime_pm ==0 )return -EINVAL ; +/* are we optimus enabled? */ +if (nouveau_runtime_pm ==-1 && !nouveau_is_optimus () && !nouveau_is_v1_dsm ()) { +DRM_DEBUG_DRIVER ("failing to power off - not optimus\n" ); +return -EINVAL ; + } +drm_kms_helper_poll_disable (drm_dev);vga_switcheroo_set_dynamic_switch (pdev,VGA_SWITCHEROO_OFF );nouveau_switcheroo_optimus_dsm ();
Greg Kroah-Hartman
maintainerPATCH 97/144 ahci: imx: Explicitly clear IMX6Q_GPR13_SATA_MPLL_CLK_EN
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Vasut <[email protected]>
commit 10becdb402af4fd4808a0491a726b96128c41076 upstream.
We must clear this IMX6Q_GPR13_SATA_MPLL_CLK_EN bit on i.MX6Q, otherwise Linux will fail to find the attached drive on some boards.
This entire fix was:
--- drivers/ata/ahci_imx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/ata/ahci_imx.c +2 -1
@@ -60,7 +60,7 @@ static int imx6q_sata_init(struct device/* * set PHY Paremeters, two steps to configure the GPR13, * one write for rest of parameters, mask of first write -* is 0x07fffffd, and the other one write for setting +* is 0x07ffffff, and the other one write for setting * the mpll_clk_en. */ regmap_update_bits(imxpriv->gpr, 0x34, IMX6Q_GPR13_SATA_RX_EQ_VAL_MASK
@@ -71,6 +71,7 @@ static int imx6q_sata_init(struct device | IMX6Q_GPR13_SATA_TX_ATTEN_MASK |IMX6Q_GPR13_SATA_TX_BOOST_MASK |IMX6Q_GPR13_SATA_TX_LVL_MASK + |IMX6Q_GPR13_SATA_MPLL_CLK_EN |IMX6Q_GPR13_SATA_TX_EDGE_RATE ,IMX6Q_GPR13_SATA_RX_EQ_VAL_3_0_DB |IMX6Q_GPR13_SATA_RX_LOS_LVL_SATA2M
Greg Kroah-Hartman
maintainerPATCH 98/144 libata: add ATA_HORKAGE_BROKEN_FPDMA_AA quirk for Seagate Momentus SpinPoint M8
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michele Baldessari <[email protected]>
commit 87809942d3fa60bafb7a58d0bdb1c79e90a6821d upstream.
We've received multiple reports in Fedora via (BZ 907193) that the Seagate Momentus SpinPoint M8 errors out when enabling AA:
[ 2.555905] ata2.00: failed to enable AA (error_mask=0x1) [ 2.568482] ata2.00: failed to enable AA (error_mask=0x1)
Add the ATA_HORKAGE_BROKEN_FPDMA_AA for this specific harddisk.
--- drivers/ata/libata-core.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/ata/libata-core.c +3 -0
@@ -4156,6 +4156,9 @@ static const struct ata_blacklist_entry {"ST3320[68]13AS" ,"SD1[5-9]" ,ATA_HORKAGE_NONCQ | ATA_HORKAGE_FIRMWARE_WARN }, +/* Seagate Momentus SpinPoint M8 seem to have FPMDA_AA issues */ + { "ST1000LM024 HN-M101MBB", "2AR10001", ATA_HORKAGE_BROKEN_FPDMA_AA }, +/* Blacklist entries taken from Silicon Image 3124/3132 Windows driver .inf file - also several Linux problem reports */ { "HTS541060G9SA00", "MB3OC60D", ATA_HORKAGE_NONCQ, },
Greg Kroah-Hartman
maintainerPATCH 99/144 libata: disable a disk via libata.force params
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Robin H. Johnson" <[email protected]>
commit b8bd6dc36186fe99afa7b73e9e2d9a98ad5c4865 upstream.
A user on StackExchange had a failing SSD that's soldered directly onto the motherboard of his system. The BIOS does not give any option to disable it at all, so he can't just hide it from the OS via the BIOS.
The old IDE layer had hdX=noprobe override for situations like this, but that was never ported to the libata layer.
This patch implements a disable flag for libata.force.
Example use:
libata.force=2.0:disable
[v2 of the patch, removed the nodisable flag per Tejun Heo]
--- Documentation/kernel-parameters.txt | 2 ++ drivers/ata/libata-core.c | 1 + 2 files changed, 3 insertions(+)
Documentation/kernel-parameters.txt +2 -0
@@ -1515,6 +1515,8 @@ bytes respectively. Such letter suffixes * atapi_dmadir: Enable ATAPI DMADIR bridge support + * disable: Disable this device. + If there are multiple matching configurations changing the same attribute, the last one is used.
drivers/ata/libata-core.c +1 -0
@@ -6523,6 +6523,7 @@ static int __init ata_parse_force_one(ch { "norst", .lflags = ATA_LFLAG_NO_HRST | ATA_LFLAG_NO_SRST }, { "rstonce", .lflags = ATA_LFLAG_RST_ONCE }, { "atapi_dmadir", .horkage_on = ATA_HORKAGE_ATAPI_DMADIR }, + { "disable", .horkage_on = ATA_HORKAGE_DISABLE }, };char *start = *cur, *p = *cur;char *id, *val, *endp;
Greg Kroah-Hartman
maintainerPATCH 100/144 libata: implement ATA_HORKAGE_NO_NCQ_TRIM and apply it to Micro M500 SSDs
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Carino <[email protected]>
commit f78dea064c5f7de07de4912a6e5136dbc443d614 upstream.
Certain drives cannot handle queued TRIM commands properly, even though support is indicated in the IDENTIFY DEVICE buffer. This patch allows for disabling the commands for the affected drives and apply it to the Micron/Crucial M500 SSDs which exhibit incorrect protocol behavior when issued queued TRIM commands, which could lead to silent data corruption.
tj: Merged two unnecessarily split patches and made minor edits
including shortening horkage name.
--- drivers/ata/libata-core.c | 15 +++++++++++++-- include/linux/libata.h | 1 + 2 files changed, 14 insertions(+), 2 deletions(-)
drivers/ata/libata-core.c +13 -2
@@ -2149,9 +2149,16 @@ static int ata_dev_config_ncq(struct ata"failed to get NCQ Send/Recv Log Emask 0x%x\n" , err_mask); }else { +u8 *cmds = dev->ncq_send_recv_cmds; + dev->flags |=ATA_DFLAG_NCQ_SEND_RECV ; -memcpy (dev->ncq_send_recv_cmds, ap->sector_buf, -ATA_LOG_NCQ_SEND_RECV_SIZE ); +memcpy (cmds, ap->sector_buf,ATA_LOG_NCQ_SEND_RECV_SIZE ); + +if (dev->horkage &ATA_HORKAGE_NO_NCQ_TRIM ) { +ata_dev_dbg (dev,"disabling queued TRIM support\n" ); + cmds[ATA_LOG_NCQ_SEND_RECV_DSM_OFFSET ] &= + ~ATA_LOG_NCQ_SEND_RECV_DSM_TRIM ; + } } }
@@ -4205,6 +4212,10 @@ static const struct ata_blacklist_entry { "PIONEER DVD-RW DVR-212D", NULL, ATA_HORKAGE_NOSETXFER }, { "PIONEER DVD-RW DVR-216D", NULL, ATA_HORKAGE_NOSETXFER }, +/* devices that don't properly handle queued TRIM commands */ + { "Micron_M500*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, + { "Crucial_CT???M500SSD1", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, + /* End Marker */ { } };
include/linux/libata.h +1 -0
@@ -418,6 +418,7 @@ enum {ATA_HORKAGE_DUMP_ID = (1 <<16 ),/* dump IDENTIFY data */ ATA_HORKAGE_MAX_SEC_LBA48 = (1 <<17 ),/* Set max sects to 65535 */ ATA_HORKAGE_ATAPI_DMADIR = (1 <<18 ),/* device requires dmadir */ + ATA_HORKAGE_NO_NCQ_TRIM = (1 << 19), /* don't use queued TRIM *//* DMA mask for user DMA control: User visible values; DO NOT renumber */
Greg Kroah-Hartman
maintainerPATCH 102/144 cifs: We do not drop reference to tlink in CIFSCheckMFSymlink()
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sachin Prabhu <[email protected]>
commit 750b8de6c4277d7034061e1da50663aa1b0479e4 upstream.
When we obtain tcon from cifs_sb, we use cifs_sb_tlink() to first obtain tlink which also grabs a reference to it. We do not drop this reference to tlink once we are done with the call.
The patch fixes this issue by instead passing tcon as a parameter and avoids having to obtain a reference to the tlink. A lookup for the tcon is already made in the calling functions and this way we avoid having to re-run the lookup. This is also consistent with the argument list for other similar calls for M-F symlinks.
We should also return an ENOSYS when we do not find a protocol specific function to lookup the MF Symlink data.
--- fs/cifs/cifsproto.h | 7 ++++--- fs/cifs/inode.c | 6 ++++-- fs/cifs/link.c | 26 +++++++++++--------------- 3 files changed, 19 insertions(+), 20 deletions(-)
fs/cifs/cifsproto.h +4 -3
@@ -475,9 +475,10 @@ extern int CIFSGetExtAttr(const unsigned const int netfid, __u64 *pExtAttrBits, __u64 *pMask);extern void cifs_autodisable_serverino (struct cifs_sb_info *cifs_sb);extern bool CIFSCouldBeMFSymlink (const struct cifs_fattr *fattr); -extern int CIFSCheckMFSymlink (struct cifs_fattr *fattr, -const unsigned char *path, -struct cifs_sb_info *cifs_sb,unsigned int xid); +extern int CIFSCheckMFSymlink (unsigned int xid,struct cifs_tcon *tcon, +struct cifs_sb_info *cifs_sb, +struct cifs_fattr *fattr, +const unsigned char *path);extern int mdfour (unsigned char *,unsigned char *,int );extern int E_md4hash (const unsigned char *passwd,unsigned char *p16,const struct nls_table *codepage);
fs/cifs/inode.c +4 -2
@@ -383,7 +383,8 @@ int cifs_get_inode_info_unix(struct inod/* check for Minshall+French symlinks */ if (cifs_sb->mnt_cifs_flags &CIFS_MOUNT_MF_SYMLINKS ) { -int tmprc =CIFSCheckMFSymlink (&fattr, full_path, cifs_sb, xid); +int tmprc =CIFSCheckMFSymlink (xid, tcon, cifs_sb, &fattr, + full_path);if (tmprc)cifs_dbg (FYI ,"CIFSCheckMFSymlink: %d\n" , tmprc); }
@@ -799,7 +800,8 @@ cifs_get_inode_info(struct inode **inode/* check for Minshall+French symlinks */ if (cifs_sb->mnt_cifs_flags &CIFS_MOUNT_MF_SYMLINKS ) { - tmprc =CIFSCheckMFSymlink (&fattr, full_path, cifs_sb, xid); + tmprc =CIFSCheckMFSymlink (xid, tcon, cifs_sb, &fattr, + full_path);if (tmprc)cifs_dbg (FYI ,"CIFSCheckMFSymlink: %d\n" , tmprc); }
fs/cifs/link.c +11 -15
@@ -354,34 +354,30 @@ open_query_close_cifs_symlink(const unsiint -CIFSCheckMFSymlink (struct cifs_fattr *fattr, -const unsigned char *path, -struct cifs_sb_info *cifs_sb,unsigned int xid) +CIFSCheckMFSymlink (unsigned int xid,struct cifs_tcon *tcon, +struct cifs_sb_info *cifs_sb,struct cifs_fattr *fattr, +const unsigned char *path) { -int rc =0 ; +int rc;u8 *buf =NULL ;unsigned int link_len =0 ;unsigned int bytes_read =0 ; -struct cifs_tcon *ptcon;if (!CIFSCouldBeMFSymlink (fattr))/* it's not a symlink */ return 0 ; buf =kmalloc (CIFS_MF_SYMLINK_FILE_SIZE ,GFP_KERNEL ); -if (!buf) { - rc = -ENOMEM ; - goto out; - } +if (!buf) +return -ENOMEM ; - ptcon =tlink_tcon (cifs_sb_tlink (cifs_sb)); -if ((ptcon->ses) && (ptcon->ses->server->ops->query_mf_symlink)) - rc = ptcon->ses->server->ops->query_mf_symlink (path, buf, - &bytes_read, cifs_sb, xid); +if (tcon->ses->server->ops->query_mf_symlink) + rc = tcon->ses->server->ops->query_mf_symlink (path, buf, + &bytes_read, cifs_sb, xid);else - goto out; + rc = -ENOSYS ; -if (rc !=0 ) +if (rc) goto out;if (bytes_read ==0 )/* not a symlink */
Greg Kroah-Hartman
maintainerPATCH 103/144 cifs: set FILE_CREATED
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shirish Pargaonkar <[email protected]>
commit f1e3268126a35b9d3cb8bf67487fcc6cd13991d8 upstream.
Set FILE_CREATED on O_CREAT|O_EXCL.
cifs code didn't change during commit 116cc0225381415b96551f725455d067f63a76a0
Kernel bugzilla 66251
--- fs/cifs/dir.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
fs/cifs/dir.c +6 -5
@@ -193,7 +193,7 @@ check_name(struct dentry *direntry)static int cifs_do_create (struct inode *inode,struct dentry *direntry,unsigned int xid,struct tcon_link *tlink,unsigned oflags,umode_t mode, -__u32 *oplock,struct cifs_fid *fid,int *created) +__u32 *oplock,struct cifs_fid *fid) {int rc = -ENOENT ;int create_options =CREATE_NOT_DIR ;
@@ -349,7 +349,6 @@ cifs_do_create(struct inode *inode, stru .device = 0, }; - *created |=FILE_CREATED ;if (cifs_sb->mnt_cifs_flags &CIFS_MOUNT_SET_UID ) { args.uid =current_fsuid ();if (inode->i_mode &S_ISGID )
@@ -480,13 +479,16 @@ cifs_atomic_open(struct inode *inode, stcifs_add_pending_open (&fid, tlink, &open); rc =cifs_do_create (inode, direntry, xid, tlink, oflags, mode, - &oplock, &fid, opened); + &oplock, &fid);if (rc) {cifs_del_pending_open (&open); goto out; } +if ((oflags & (O_CREAT |O_EXCL )) == (O_CREAT |O_EXCL )) + *opened |=FILE_CREATED ; + rc =finish_open (file, direntry, generic_file_open, opened);if (rc) {if (server->ops->close)
@@ -529,7 +531,6 @@ int cifs_create(struct inode *inode, strstruct TCP_Server_Info *server;struct cifs_fid fid;__u32 oplock; -int created =FILE_CREATED ;cifs_dbg (FYI ,"cifs_create parent inode = 0x%p name is: %s and dentry = 0x%p\n" , inode, direntry->d_name.name, direntry);
@@ -546,7 +547,7 @@ int cifs_create(struct inode *inode, str server->ops->new_lease_key (&fid); rc =cifs_do_create (inode, direntry, xid, tlink, oflags, mode, - &oplock, &fid, &created); + &oplock, &fid);if (!rc && server->ops->close) server->ops->close (xid, tcon, &fid);
Greg Kroah-Hartman
maintainerPATCH 104/144 radiotap: fix bitmap-end-finding buffer overrun
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
commit bd02cd2549cfcdfc57cb5ce57ffc3feb94f70575 upstream.
Evan Huus found (by fuzzing in wireshark) that the radiotap iterator code can access beyond the length of the buffer if the first bitmap claims an extension but then there's no data at all. Fix this.
--- net/wireless/radiotap.c | 4 ++++ 1 file changed, 4 insertions(+)
net/wireless/radiotap.c +4 -0
@@ -124,6 +124,10 @@ int ieee80211_radiotap_iterator_init(/* find payload start allowing for extended bitmap(s) */ if (iterator->_bitmap_shifter & (1 <<IEEE80211_RADIOTAP_EXT )) { +if ((unsigned long )iterator->_arg - + (unsigned long )iterator->_rtheader +sizeof (uint32_t ) > + (unsigned long )iterator->_max_length) +return -EINVAL ;while (get_unaligned_le32 (iterator->_arg) & (1 <<IEEE80211_RADIOTAP_EXT )) { iterator->_arg +=sizeof (uint32_t );
Greg Kroah-Hartman
maintainerPATCH 105/144 rtlwifi: pci: Fix oops on driver unload
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Larry Finger <[email protected]>
commit 9278db6279e28d4d433bc8a848e10b4ece8793ed upstream.
On Fedora systems, unloading rtl8192ce causes an oops. This patch fixes the problem reported at https://bugzilla.redhat.com/show_bug.cgi?id=852761.
--- drivers/net/wireless/rtlwifi/pci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/rtlwifi/pci.c +3 -1
@@ -741,6 +741,8 @@ static void _rtl_pci_rx_interrupt(struct };int index = rtlpci->rx_ring[rx_queue_idx].idx; +if (rtlpci->driver_is_goingto_unload) +return ;/*RX NORMAL PKT */ while (count--) {/*rx descriptor */
@@ -1637,6 +1639,7 @@ static void rtl_pci_stop(struct ieee8021*/ set_hal_stop (rtlhal); + rtlpci->driver_is_goingto_unload = true; rtlpriv->cfg->ops->disable_interrupt (hw);cancel_work_sync (&rtlpriv->works.lps_change_work);
@@ -1654,7 +1657,6 @@ static void rtl_pci_stop(struct ieee8021 ppsc->rfchange_inprogress = true;spin_unlock_irqrestore (&rtlpriv->locks.rf_ps_lock, flags); - rtlpci->driver_is_goingto_unload = true; rtlpriv->cfg->ops->hw_disable (hw);/* some things are not needed if firmware not available */ if (!rtlpriv->max_fw_size)
Greg Kroah-Hartman
maintainerPATCH 106/144 ext2: Fix oops in ext2_get_block() called from ext2_quota_write()
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <[email protected]>
commit df4e7ac0bb70abc97fbfd9ef09671fc084b3f9db upstream.
ext2_quota_write() doesn't properly setup bh it passes to ext2_get_block() and thus we hit assertion BUG_ON(maxblocks == 0) in ext2_get_blocks() (or we could actually ask for mapping arbitrary number of blocks depending on whatever value was on stack).
Fix ext2_quota_write() to properly fill in number of blocks to map.
--- fs/ext2/super.c | 1 + 1 file changed, 1 insertion(+)
fs/ext2/super.c +1 -0
@@ -1493,6 +1493,7 @@ static ssize_t ext2_quota_write(struct s sb->s_blocksize - offset : towrite; tmp_bh.b_state =0 ; + tmp_bh.b_size = sb->s_blocksize; err =ext2_get_block (inode, blk, &tmp_bh,1 );if (err <0 ) goto out;
Greg Kroah-Hartman
maintainerPATCH 107/144 ACPI / PCI / hotplug: Avoid warning when _ADR not present
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Toshi Kani <[email protected]>
commit f26ca1d699e8b54a50d9faf82327d3c2072aaedd upstream.
acpiphp_enumerate_slots() walks ACPI namenamespace under a PCI host bridge with callback register_slot(). register_slot() evaluates _ADR for all the device objects and emits a warning message for any error. Some platforms have _HID device objects (such as HPET and IPMI), which trigger unnecessary warning messages.
This patch avoids emitting a warning message when a target device object does not have _ADR.
--- drivers/pci/hotplug/acpiphp_glue.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/pci/hotplug/acpiphp_glue.c +3 -1
@@ -279,7 +279,9 @@ static acpi_status register_slot(acpi_ha status =acpi_evaluate_integer (handle,"_ADR" ,NULL , &adr);if (ACPI_FAILURE (status)) { -acpi_handle_warn (handle,"can't evaluate _ADR (%#x)\n" , status); +if (status !=AE_NOT_FOUND ) +acpi_handle_warn (handle, +"can't evaluate _ADR (%#x)\n" , status);return AE_OK ; }
Greg Kroah-Hartman
maintainerPATCH 108/144 intel_pstate: Fail initialization if P-state information is missing
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Rafael J. Wysocki" <[email protected]>
commit 98a947abdd54e5de909bebadfced1696ccad30cf upstream.
If pstate.current_pstate is 0 after the initial intel_pstate_get_cpu_pstates(), this means that we were unable to obtain any useful P-state information and there is no reason to continue, so free memory and return an error in that case.
This fixes the following divide error occuring in a nested KVM guest:
Intel P-state driver initializing.
Intel pstate controlling: cpu 0
cpufreq: __cpufreq_add_dev: ->get() failed
divide error: 0000 [#1] SMP
Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.13.0-0.rc4.git5.1.fc21.x86_64 #1 Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 task: ffff88001ea20000 ti: ffff88001e9bc000 task.ti: ffff88001e9bc000 RIP: 0010:[<ffffffff815c551d>] [<ffffffff815c551d>] intel_pstate_timer_func+0x11d/0x2b0 RSP: 0000:ffff88001ee03e18 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff88001a454348 RCX: 0000000000006100 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffff88001ee03e38 R08: 0000000000000000 R09: 0000000000000000 R10: ffff88001ea20000 R11: 0000000000000000 R12: 00000c0a1ea20000 R13: 1ea200001ea20000 R14: ffffffff815c5400 R15: ffff88001a454348 FS: 0000000000000000(0000) GS:ffff88001ee00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b CR2: 0000000000000000 CR3: 0000000001c0c000 CR4: 00000000000006f0 Stack: fffffffb1a454390 ffffffff821a4500 ffff88001a454390 0000000000000100 ffff88001ee03ea8 ffffffff81083e9a ffffffff81083e15 ffffffff82d5ed40 ffffffff8258cc60 0000000000000000 ffffffff81ac39de 0000000000000000 Call Trace: <IRQ> [<ffffffff81083e9a>] call_timer_fn+0x8a/0x310 [<ffffffff81083e15>] ? call_timer_fn+0x5/0x310 [<ffffffff815c5400>] ? pid_param_set+0x130/0x130 [<ffffffff81084354>] run_timer_softirq+0x234/0x380 [<ffffffff8107aee4>] __do_softirq+0x104/0x430 [<ffffffff8107b5fd>] irq_exit+0xcd/0xe0 [<ffffffff81770645>] smp_apic_timer_interrupt+0x45/0x60 [<ffffffff8176efb2>] apic_timer_interrupt+0x72/0x80 <EOI> [<ffffffff810e15cd>] ? vprintk_emit+0x1dd/0x5e0 [<ffffffff81757719>] printk+0x67/0x69 [<ffffffff815c1493>] __cpufreq_add_dev.isra.13+0x883/0x8d0 [<ffffffff815c14f0>] cpufreq_add_dev+0x10/0x20 [<ffffffff814a14d1>] subsys_interface_register+0xb1/0xf0 [<ffffffff815bf5cf>] cpufreq_register_driver+0x9f/0x210 [<ffffffff81fb19af>] intel_pstate_init+0x27d/0x3be [<ffffffff81761e3e>] ? mutex_unlock+0xe/0x10 [<ffffffff81fb1732>] ? cpufreq_gov_dbs_init+0x12/0x12 [<ffffffff8100214a>] do_one_initcall+0xfa/0x1b0 [<ffffffff8109dbf5>] ? parse_args+0x225/0x3f0 [<ffffffff81f64193>] kernel_init_freeable+0x1fc/0x287 [<ffffffff81f638d0>] ? do_early_param+0x88/0x88 [<ffffffff8174b530>] ? rest_init+0x150/0x150 [<ffffffff8174b53e>] kernel_init+0xe/0x130 [<ffffffff8176e27c>] ret_from_fork+0x7c/0xb0 [<ffffffff8174b530>] ? rest_init+0x150/0x150 Code: c1 e0 05 48 63 bc 03 10 01 00 00 48 63 83 d0 00 00 00 48 63 d6 48 c1 e2 08 c1 e1 08 4c 63 c2 48 c1 e0 08 48 98 48 c1 e0 08 48 99 <49> f7 f8 48 98 48 0f af f8 48 c1 ff 08 29 f9 89 ca c1 fa 1f 89 RIP [<ffffffff815c551d>] intel_pstate_timer_func+0x11d/0x2b0 RSP <ffff88001ee03e18> ---[ end trace f166110ed22cc37a ]--- Kernel panic - not syncing: Fatal exception in interrupt
--- drivers/cpufreq/intel_pstate.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/cpufreq/intel_pstate.c +5 -0
@@ -550,6 +550,11 @@ static int intel_pstate_init_cpu(unsigne cpu = all_cpu_data[cpunum];intel_pstate_get_cpu_pstates (cpu); +if (!cpu->pstate.current_pstate) { + all_cpu_data[cpunum] =NULL ; +kfree (cpu); +return -ENODATA ; + } cpu->cpu = cpunum; cpu->pstate_policy =
Greg Kroah-Hartman
maintainerPATCH 109/144 Revert "of/address: Handle #address-cells > 2 specially"
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rob Herring <[email protected]>
commit 13fcca8f25f4e9ce7f55da9cd353bb743236e212 upstream.
This reverts commit e38c0a1fbc5803cbacdaac0557c70ac8ca5152e7.
Nikita Yushchenko reports:
While trying to make freescale p2020ds and mpc8572ds boards working with mainline kernel, I faced that commit e38c0a1f (Handle
Both these boards have uli1575 chip. Corresponding part in device tree is something like
uli1575@0 {
reg = <0x0 0x0 0x0 0x0 0x0>;
#size-cells = <2>;
#address-cells = <3>;
ranges = <0x2000000 0x0 0x80000000
0x2000000 0x0 0x80000000
0x0 0x20000000
0x1000000 0x0 0x0
0x1000000 0x0 0x0
0x0 0x10000>;
isa@1e {...
I.e. it has #address-cells = <3>
With commit e38c0a1f reverted, devices under uli1575 are registered correctly, e.g. for rtc
OF: ** translation for device /pcie@ffe09000/pcie@0/uli1575@0/isa@1e/rtc@70 **
OF: bus is isa (na=2, ns=1) on /pcie@ffe09000/pcie@0/uli1575@0/isa@1e
OF: translating address: 00000001 00000070
OF: parent bus is default (na=3, ns=2) on /pcie@ffe09000/pcie@0/uli1575@0
OF: walking ranges...
OF: ISA map, cp=0, s=1000, da=70
OF: parent translation for: 01000000 00000000 00000000
OF: with offset: 70
OF: one level translation: 00000000 00000000 00000070
OF: parent bus is pci (na=3, ns=2) on /pcie@ffe09000/pcie@0
OF: walking ranges...
OF: default map, cp=a0000000, s=20000000, da=70
OF: default map, cp=0, s=10000, da=70
OF: parent translation for: 01000000 00000000 00000000
OF: with offset: 70
OF: one level translation: 01000000 00000000 00000070
OF: parent bus is pci (na=3, ns=2) on /pcie@ffe09000
OF: walking ranges...
OF: PCI map, cp=0, s=10000, da=70
OF: parent translation for: 01000000 00000000 00000000
OF: with offset: 70
OF: one level translation: 01000000 00000000 00000070
OF: parent bus is default (na=2, ns=2) on /
OF: walking ranges...
OF: PCI map, cp=0, s=10000, da=70
OF: parent translation for: 00000000 ffc10000
OF: with offset: 70
OF: one level translation: 00000000 ffc10070
OF: reached root node
With commit e38c0a1f in place, address translation fails:
OF: ** translation for device /pcie@ffe09000/pcie@0/uli1575@0/isa@1e/rtc@70 **
OF: bus is isa (na=2, ns=1) on /pcie@ffe09000/pcie@0/uli1575@0/isa@1e
OF: translating address: 00000001 00000070
OF: parent bus is default (na=3, ns=2) on /pcie@ffe09000/pcie@0/uli1575@0
OF: walking ranges...
OF: ISA map, cp=0, s=1000, da=70
OF: parent translation for: 01000000 00000000 00000000
OF: with offset: 70
OF: one level translation: 00000000 00000000 00000070
OF: parent bus is pci (na=3, ns=2) on /pcie@ffe09000/pcie@0
OF: walking ranges...
OF: default map, cp=a0000000, s=20000000, da=70
OF: default map, cp=0, s=10000, da=70
OF: not found !
Thierry Reding confirmed this commit was not needed after all:
"We ended up merging a different address representation for Tegra PCIe and I've confirmed that reverting this commit doesn't cause any obvious regressions. I think all other drivers in drivers/pci/host ended up copying what we did on Tegra, so I wouldn't expect any other breakage either."
There doesn't appear to be a simple way to support both behaviours, so reverting this as nothing should be depending on the new behaviour.
--- drivers/of/address.c | 8 -------- 1 file changed, 8 deletions(-)
drivers/of/address.c +0 -8
@@ -69,14 +69,6 @@ static u64 of_bus_default_map(__be32 *ad (unsigned long long )cp, (unsigned long long )s, (unsigned long long)da); -/* -* If the number of address cells is larger than 2 we assume the -* mapping doesn't specify a physical address. Rather, the address -* specifies an identifier that must match exactly. -*/ -if (na >2 &&memcmp (range, addr, na *4 ) !=0 ) -return OF_BAD_ADDR ; -if (da < cp || da >= (cp + s))return OF_BAD_ADDR ;return da - cp;
Greg Kroah-Hartman
maintainerPATCH 110/144 mm: clear pmd_numa before invalidating
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mel Gorman <[email protected]>
commit 67f87463d3a3362424efcbe8b40e4772fd34fc61 upstream.
On x86, PMD entries are similar to _PAGE_PROTNONE protection and are handled as NUMA hinting faults. The following two page table protection bits are what defines them
_PAGE_NUMA:set _PAGE_PRESENT:clear
A PMD is considered present if any of the _PAGE_PRESENT, _PAGE_PROTNONE, _PAGE_PSE or _PAGE_NUMA bits are set. If pmdp_invalidate encounters a pmd_numa, it clears the present bit leaving _PAGE_NUMA which will be considered not present by the CPU but present by pmd_present. The existing caller of pmdp_invalidate should handle it but it's an inconsistent state for a PMD. This patch keeps the state consistent when calling pmdp_invalidate.
--- mm/pgtable-generic.c | 3 +++ 1 file changed, 3 insertions(+)
mm/pgtable-generic.c +3 -0
@@ -191,6 +191,9 @@ pgtable_t pgtable_trans_huge_withdraw(stvoid pmdp_invalidate (struct vm_area_struct *vma,unsigned long address,pmd_t *pmdp) { +pmd_t entry = *pmdp; +if (pmd_numa (entry)) + entry =pmd_mknonnuma (entry);set_pmd_at (vma->vm_mm, address, pmdp,pmd_mknotpresent (*pmdp));flush_tlb_range (vma, address, address +HPAGE_PMD_SIZE ); }
Greg Kroah-Hartman
maintainerPATCH 111/144 mm: numa: ensure anon_vma is locked to prevent parallel THP splits
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mel Gorman <[email protected]>
commit c3a489cac38d43ea6dc4ac240473b44b46deecf7 upstream.
The anon_vma lock prevents parallel THP splits and any associated complexity that arises when handling splits during THP migration. This patch checks if the lock was successfully acquired and bails from THP migration if it failed for any reason.
--- mm/huge_memory.c | 7 +++++++ 1 file changed, 7 insertions(+)
mm/huge_memory.c +7 -0
@@ -1334,6 +1334,13 @@ int do_huge_pmd_numa_page(struct mm_stru goto out_unlock; } +/* Bail if we fail to protect against THP splits for any reason */ +if (unlikely (!anon_vma)) { +put_page (page); + page_nid =-1 ; + goto clear_pmdnuma; + } +/* * Migrate the THP to the requested node, returns with page unlocked * and pmd_numa cleared.
Greg Kroah-Hartman
maintainerPATCH 112/144 mm: numa: avoid unnecessary work on the failure path
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mel Gorman <[email protected]>
commit eb4489f69f224356193364dc2762aa009738ca7f upstream.
If a PMD changes during a THP migration then migration aborts but the failure path is doing more work than is necessary.
--- mm/migrate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
mm/migrate.c +3 -1
@@ -1720,7 +1720,8 @@ int migrate_misplaced_transhuge_page(strputback_lru_page (page);mod_zone_page_state (page_zone (page),NR_ISOLATED_ANON + page_lru, -HPAGE_PMD_NR ); - goto out_fail; + + goto out_unlock; }/*
@@ -1770,6 +1771,7 @@ out_dropref:set_pmd_at (mm, haddr, pmd, entry);update_mmu_cache_pmd (vma, address, &entry); +out_unlock:unlock_page (page);put_page (page);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 113/144 mm: fix TLB flush race between migration, and change_protection_range
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rik van Riel <[email protected]>
commit 20841405940e7be0617612d521e206e4b6b325db upstream.
There are a few subtle races, between change_protection_range (used by mprotect and change_prot_numa) on one side, and NUMA page migration and compaction on the other side.
The basic race is that there is a time window between when the PTE gets made non-present (PROT_NONE or NUMA), and the TLB is flushed.
During that time, a CPU may continue writing to the page.
This is fine most of the time, however compaction or the NUMA migration code may come in, and migrate the page away.
When that happens, the CPU may continue writing, through the cached translation, to what is no longer the current memory location of the process.
This only affects x86, which has a somewhat optimistic pte_accessible. All other architectures appear to be safe, and will either always flush, or flush whenever there is a valid mapping, even with no permissions (SPARC).
The basic race looks like this:
CPU A CPU B CPU C
load TLB entry
make entry PTE/PMD_NUMA
fault on entry
read/write old page
start migrating page
change PTE/PMD to new page
read/write old page [*]
flush TLB
reload TLB from new entry read/write new page lose data
[*] the old page may belong to a new user at this point!
The obvious fix is to flush remote TLB entries, by making sure that pte_accessible aware of the fact that PROT_NONE and PROT_NUMA memory may still be accessible if there is a TLB flush pending for the mm.
This should fix both NUMA migration and compaction.
--- arch/sparc/include/asm/pgtable_64.h | 4 +-- arch/x86/include/asm/pgtable.h | 11 +++++++-- include/asm-generic/pgtable.h | 2 - include/linux/mm_types.h | 44 ++++++++++++++++++++++++++++++++++++ kernel/fork.c | 1 mm/huge_memory.c | 7 +++++ mm/mprotect.c | 2 + mm/pgtable-generic.c | 5 ++-- 8 files changed, 69 insertions(+), 7 deletions(-)
arch/sparc/include/asm/pgtable_64.h +2 -2
@@ -616,7 +616,7 @@ static inline unsigned long pte_present( }#define pte_accessible pte_accessible -static inline unsigned long pte_accessible (pte_t a) +static inline unsigned long pte_accessible (struct mm_struct *mm,pte_t a) {return pte_val (a) & _PAGE_VALID; }
@@ -806,7 +806,7 @@ static inline void __set_pte_at(struct m* SUN4V NOTE: _PAGE_VALID is the same value in both the SUN4U * and SUN4V pte layout, so this inline test is fine. */ -if (likely (mm != &init_mm) &&pte_accessible (orig)) +if (likely (mm != &init_mm) &&pte_accessible (mm, orig))tlb_batch_add (mm, addr, ptep, orig, fullmm); }
arch/x86/include/asm/pgtable.h +9 -2
@@ -452,9 +452,16 @@ static inline int pte_present(pte_t a) }#define pte_accessible pte_accessible -static inline int pte_accessible (pte_t a) +static inline bool pte_accessible (struct mm_struct *mm,pte_t a) { -return pte_flags (a) & _PAGE_PRESENT; +if (pte_flags (a) & _PAGE_PRESENT) +return true; + +if ((pte_flags (a) & (_PAGE_PROTNONE | _PAGE_NUMA)) && +mm_tlb_flush_pending (mm)) +return true; + +return false; }static inline int pte_hidden (pte_t pte)
include/asm-generic/pgtable.h +1 -1
@@ -217,7 +217,7 @@ static inline int pmd_same(pmd_t pmd_a,#endif #ifndef pte_accessible -# define pte_accessible (pte) ((void)(pte),1) +# define pte_accessible (mm, pte) ((void)(pte), 1)#endif #ifndef flush_tlb_fix_spurious_fault
include/linux/mm_types.h +44 -0
54 lines not on this page · raw message
kernel/fork.c +1 -0
@@ -537,6 +537,7 @@ static struct mm_struct *mm_init(structspin_lock_init (&mm->page_table_lock);mm_init_aio (mm);mm_init_owner (mm, p); +clear_tlb_flush_pending (mm);if (likely (!mm_alloc_pgd (mm))) { mm->def_flags =0 ;
mm/huge_memory.c +7 -0
@@ -1342,6 +1342,13 @@ int do_huge_pmd_numa_page(struct mm_stru }/* +* The page_table_lock above provides a memory barrier +* with change_protection_range. +*/ +if (mm_tlb_flush_pending (mm)) +flush_tlb_range (vma, haddr, haddr +HPAGE_PMD_SIZE ); + +/* * Migrate the THP to the requested node, returns with page unlocked * and pmd_numa cleared. */
mm/mprotect.c +2 -0
@@ -209,6 +209,7 @@ static unsigned long change_protection_rBUG_ON (addr >= end); pgd =pgd_offset (mm, addr);flush_cache_range (vma, addr, end); +set_tlb_flush_pending (mm); do { next = pgd_addr_end(addr, end); if (pgd_none_or_clear_bad(pgd))
@@ -220,6 +221,7 @@ static unsigned long change_protection_r/* Only flush the TLB if we actually modified any entries: */ if (pages)flush_tlb_range (vma, start, end); +clear_tlb_flush_pending (mm);return pages; }
mm/pgtable-generic.c +3 -2
@@ -110,9 +110,10 @@ int pmdp_clear_flush_young(struct vm_arepte_t ptep_clear_flush (struct vm_area_struct *vma,unsigned long address,pte_t *ptep) { +struct mm_struct *mm = (vma)->vm_mm;pte_t pte; - pte =ptep_get_and_clear ((vma)->vm_mm, address, ptep); -if (pte_accessible (pte)) + pte =ptep_get_and_clear (mm, address, ptep); +if (pte_accessible (mm, pte))flush_tlb_page (vma, address);return pte; }
Greg Kroah-Hartman
maintainerPATCH 114/144 mm: numa: guarantee that tlb_flush_pending updates are visible before page table updates
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mel Gorman <[email protected]>
commit af2c1401e6f9177483be4fad876d0073669df9df upstream.
According to documentation on barriers, stores issued before a LOCK can complete after the lock implying that it's possible tlb_flush_pending can be visible after a page table update. As per revised documentation, this patch adds a smp_mb__before_spinlock to guarantee the correct ordering.
--- include/linux/mm_types.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
include/linux/mm_types.h +6 -1
@@ -478,7 +478,12 @@ static inline bool mm_tlb_flush_pending(static inline void set_tlb_flush_pending (struct mm_struct *mm) { mm->tlb_flush_pending = true; -barrier (); + +/* +* Guarantee that the tlb_flush_pending store does not leak into the +* critical section updating the page tables +*/ +smp_mb__before_spinlock (); }/* Clearing is done after a TLB flush, which also provides a barrier. */ static inline void clear_tlb_flush_pending (struct mm_struct *mm)
Greg Kroah-Hartman
maintainerPATCH 115/144 mm/mempolicy: correct putback method for isolate pages if failed
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joonsoo Kim <[email protected]>
commit b0e5fd7359f1ce8db4ccb862b3aa80d2f2cbf4d0 upstream.
queue_pages_range() isolates hugetlbfs pages and putback_lru_pages() can't handle these. We should change it to putback_movable_pages().
Naoya said that it is worth going into stable, because it can break in-use hugepage list.
--- mm/mempolicy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/mempolicy.c +1 -1
@@ -1317,7 +1317,7 @@ static long do_mbind(unsigned long startif (nr_failed && (flags &MPOL_MF_STRICT )) err = -EIO ; }else -putback_lru_pages (&pagelist); +putback_movable_pages (&pagelist);up_write (&mm->mmap_sem); mpol_out:
Greg Kroah-Hartman
maintainerPATCH 116/144 mm/compaction: respect ignore_skip_hint in update_pageblock_skip
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joonsoo Kim <[email protected]>
commit 6815bf3f233e0b10c99a758497d5d236063b010b upstream.
update_pageblock_skip() only fits to compaction which tries to isolate by pageblock unit. If isolate_migratepages_range() is called by CMA, it try to isolate regardless of pageblock unit and it don't reference get_pageblock_skip() by ignore_skip_hint. We should also respect it on update_pageblock_skip() to prevent from setting the wrong information.
--- mm/compaction.c | 4 ++++ 1 file changed, 4 insertions(+)
mm/compaction.c +4 -0
@@ -134,6 +134,10 @@ static void update_pageblock_skip(struct bool migrate_scanner) {struct zone *zone = cc->zone; + +if (cc->ignore_skip_hint) +return ; +if (!page)return ;
Greg Kroah-Hartman
maintainerPATCH 117/144 mm/memory-failure.c: recheck PageHuge() after hugetlb page migrate successfully
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jianguo Wu <[email protected]>
commit a49ecbcd7b0d5a1cda7d60e03df402dd0ef76ac8 upstream.
After a successful hugetlb page migration by soft offline, the source page will either be freed into hugepage_freelists or buddy(over-commit page). If page is in buddy, page_hstate(page) will be NULL. It will hit a NULL pointer dereference in dequeue_hwpoisoned_huge_page().
BUG: unable to handle kernel NULL pointer dereference at 0000000000000058 IP: [<ffffffff81163761>] dequeue_hwpoisoned_huge_page+0x131/0x1d0 PGD c23762067 PUD c24be2067 PMD 0 Oops: 0000 [#1] SMP
So check PageHuge(page) after call migrate_pages() successfully.
--- mm/memory-failure.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
mm/memory-failure.c +10 -4
@@ -1519,10 +1519,16 @@ static int soft_offline_huge_page(structif (ret >0 ) ret = -EIO ; }else { -set_page_hwpoison_huge_page (hpage); -dequeue_hwpoisoned_huge_page (hpage); -atomic_long_add (1 <<compound_order (hpage), - &num_poisoned_pages); +/* overcommit hugetlb page will be freed to buddy */ +if (PageHuge (page)) { +set_page_hwpoison_huge_page (hpage); +dequeue_hwpoisoned_huge_page (hpage); +atomic_long_add (1 <<compound_order (hpage), + &num_poisoned_pages); + }else { +SetPageHWPoison (page); +atomic_long_inc (&num_poisoned_pages); + } }return ret; }
Greg Kroah-Hartman
maintainerPATCH 118/144 mm/hugetlb: check for pte NULL pointer in __page_check_address()
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jianguo Wu <[email protected]>
commit 98398c32f6687ee1e1f3ae084effb4b75adb0747 upstream.
In __page_check_address(), if address's pud is not present, huge_pte_offset() will return NULL, we should check the return value.
--- mm/rmap.c | 4 ++++ 1 file changed, 4 insertions(+)
mm/rmap.c +4 -0
@@ -600,7 +600,11 @@ pte_t *__page_check_address(struct pagespinlock_t *ptl;if (unlikely (PageHuge (page))) { +/* when pud is not present, pte will be NULL */ pte =huge_pte_offset (mm, address); +if (!pte) +return NULL ; + ptl = &mm->page_table_lock; goto check; }
Greg Kroah-Hartman
maintainerPATCH 119/144 mm: page_alloc: revert NUMA aspect of fair allocation policy
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Weiner <[email protected]>
commit fff4068cba484e6b0abe334ed6b15d5a215a3b25 upstream.
Commit 81c0a2bb515f ("mm: page_alloc: fair zone allocator policy") meant to bring aging fairness among zones in system, but it was overzealous and badly regressed basic workloads on NUMA systems.
Due to the way kswapd and page allocator interacts, we still want to make sure that all zones in any given node are used equally for all allocations to maximize memory utilization and prevent thrashing on the highest zone in the node.
While the same principle applies to NUMA nodes - memory utilization is obviously improved by spreading allocations throughout all nodes - remote references can be costly and so many workloads prefer locality over memory utilization. The original change assumed that zone_reclaim_mode would be a good enough predictor for that, but it turned out to be as indicative as a coin flip.
Revert the NUMA aspect of the fairness until we can find a proper way to make it configurable and agree on a sane default.
--- mm/page_alloc.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-)
mm/page_alloc.c +9 -10
@@ -1822,7 +1822,7 @@ static void zlc_clear_zones_full(structstatic bool zone_local (struct zone *local_zone,struct zone *zone) { -return node_distance (local_zone->node, zone->node) ==LOCAL_DISTANCE ; +return local_zone->node == zone->node; }static bool zone_allows_reclaim (struct zone *local_zone,struct zone *zone)
@@ -1919,18 +1919,17 @@ zonelist_scan:* page was allocated in should have no effect on the * time the page has in memory before being reclaimed. * -* When zone_reclaim_mode is enabled, try to stay in -* local zones in the fastpath. If that fails, the -* slowpath is entered, which will do another pass -* starting with the local zones, but ultimately fall -* back to remote zones that do not partake in the -* fairness round-robin cycle of this zonelist. +* Try to stay in local zones in the fastpath. If +* that fails, the slowpath is entered, which will do +* another pass starting with the local zones, but +* ultimately fall back to remote zones that do not +* partake in the fairness round-robin cycle of this +* zonelist. */ if (alloc_flags &ALLOC_WMARK_LOW ) {if (zone_page_state (zone,NR_ALLOC_BATCH ) <=0 )continue ; -if (zone_reclaim_mode && - !zone_local (preferred_zone, zone)) +if (!zone_local (preferred_zone, zone))continue ; }/*
@@ -2396,7 +2395,7 @@ static void prepare_slowpath(gfp_t gfp_m* thrash fairness information for zones that are not * actually part of this zonelist's round-robin cycle. */ -if (zone_reclaim_mode && !zone_local (preferred_zone, zone)) +if (!zone_local (preferred_zone, zone))continue ; mod_zone_page_state(zone, NR_ALLOC_BATCH, high_wmark_pages(zone) -
Greg Kroah-Hartman
maintainerPATCH 120/144 mm: munlock: fix a bug where THP tail page is encountered
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vlastimil Babka <[email protected]>
commit c424be1cbbf852e46acc84d73162af3066cd2c86 upstream.
Since commit ff6a6da60b89 ("mm: accelerate munlock() treatment of THP pages") munlock skips tail pages of a munlocked THP page. However, when the head page already has PageMlocked unset, it will not skip the tail pages.
Commit 7225522bb429 ("mm: munlock: batch non-THP page isolation and munlock+putback using pagevec") has added a PageTransHuge() check which contains VM_BUG_ON(PageTail(page)). Sasha Levin found this triggered using trinity, on the first tail page of a THP page without PageMlocked flag.
This patch fixes the issue by skipping tail pages also in the case when PageMlocked flag is unset. There is still a possibility of race with THP page split between clearing PageMlocked and determining how many pages to skip. The race might result in former tail pages not being skipped, which is however no longer a bug, as during the skip the PageTail flags are cleared.
However this race also affects correctness of NR_MLOCK accounting, which is to be fixed in a separate patch.
--- mm/mlock.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-)
mm/mlock.c +22 -7
@@ -133,7 +133,10 @@ static void __munlock_isolation_failed(s/** * munlock_vma_page - munlock a vma page -* @page - page to be unlocked +* @page - page to be unlocked, either a normal page or THP page head +* +* returns the size of the page as a page mask (0 for normal page, +* HPAGE_PMD_NR - 1 for THP head page) * * called from munlock()/munmap() path with page supposedly on the LRU. * When we munlock a page, because the vma where we found the page is being
@@ -148,21 +151,30 @@ static void __munlock_isolation_failed(s*/ unsigned int munlock_vma_page (struct page *page) { -unsigned int page_mask =0 ; +unsigned int nr_pages;BUG_ON (!PageLocked (page));if (TestClearPageMlocked (page)) { -unsigned int nr_pages =hpage_nr_pages (page); + nr_pages =hpage_nr_pages (page);mod_zone_page_state (page_zone (page),NR_MLOCK , -nr_pages); - page_mask = nr_pages -1 ;if (!isolate_lru_page (page))__munlock_isolated_page (page);else __munlock_isolation_failed (page); + }else { + nr_pages =hpage_nr_pages (page); } -return page_mask; +/* +* Regardless of the original PageMlocked flag, we determine nr_pages +* after touching the flag. This leaves a possible race with a THP page +* split, such that a whole THP page was munlocked, but nr_pages == 1. +* Returning a smaller mask due to that is OK, the worst that can +* happen is subsequent useless scanning of the former tail pages. +* The NR_MLOCK accounting can however become broken. +*/ +return nr_pages -1 ; }/**
@@ -440,7 +452,8 @@ void munlock_vma_pages_range(struct vm_awhile (start < end) {struct page *page =NULL ; -unsigned int page_mask, page_increm; +unsigned int page_mask; +unsigned long page_increm;struct pagevec pvec;struct zone *zone;int zoneid;
@@ -490,7 +503,9 @@ void munlock_vma_pages_range(struct vm_a goto next; } } - page_increm =1 + (~(start >>PAGE_SHIFT ) & page_mask); +/* It's a bug to munlock in the middle of a THP page */ +VM_BUG_ON ((start >>PAGE_SHIFT ) & page_mask); + page_increm =1 + page_mask; start += page_increm *PAGE_SIZE ; next:cond_resched ();
Greg Kroah-Hartman
maintainerPATCH 121/144 mm: munlock: fix deadlock in __munlock_pagevec()
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vlastimil Babka <[email protected]>
commit 3b25df93c6e37e323b86a2a8c1e00c0a2821c6c9 upstream.
Commit 7225522bb429 ("mm: munlock: batch non-THP page isolation and munlock+putback using pagevec" introduced __munlock_pagevec() to speed up munlock by holding lru_lock over multiple isolated pages. Pages that fail to be isolated are put_page()d immediately, also within the lock.
This can lead to deadlock when __munlock_pagevec() becomes the holder of the last page pin and put_page() leads to __page_cache_release() which also locks lru_lock. The deadlock has been observed by Sasha Levin using trinity.
This patch avoids the deadlock by deferring put_page() operations until lru_lock is released. Another pagevec (which is also used by later phases of the function is reused to gather the pages for put_page() operation.
--- mm/mlock.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
mm/mlock.c +10 -5
@@ -298,10 +298,12 @@ static void __munlock_pagevec(struct pag {int i;int nr =pagevec_count (pvec); -int delta_munlocked = -nr; +int delta_munlocked;struct pagevec pvec_putback;int pgrescued =0 ; +pagevec_init (&pvec_putback,0 ); +/* Phase 1: page isolation */ spin_lock_irq (&zone->lru_lock);for (i =0 ; i < nr; i++) {
@@ -330,18 +332,21 @@ skip_munlock:/* * We won't be munlocking this page in the next phase * but we still need to release the follow_page_mask() -* pin. +* pin. We cannot do it under lru_lock however. If it's +* the last pin, __page_cache_release would deadlock. */ +pagevec_add (&pvec_putback, pvec->pages[i]); pvec->pages[i] =NULL ; -put_page (page); - delta_munlocked++; } } + delta_munlocked = -nr +pagevec_count (&pvec_putback);__mod_zone_page_state (zone,NR_MLOCK , delta_munlocked);spin_unlock_irq (&zone->lru_lock); +/* Now we can release pins of pages that we are not munlocking */ +pagevec_release (&pvec_putback); +/* Phase 2: page munlock */ -pagevec_init (&pvec_putback,0 );for (i =0 ; i < nr; i++) {struct page *page = pvec->pages[i];
Greg Kroah-Hartman
maintainerPATCH 122/144 mm: fix use-after-free in sys_remap_file_pages
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rik van Riel <[email protected]>
commit 4eb919825e6c3c7fb3630d5621f6d11e98a18b3a upstream.
remap_file_pages calls mmap_region, which may merge the VMA with other existing VMAs, and free "vma". This can lead to a use-after-free bug. Avoid the bug by remembering vm_flags before calling mmap_region, and not trying to dereference vma later.
--- mm/fremap.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
mm/fremap.c +5 -3
@@ -208,9 +208,10 @@ get_write_lock:if (mapping_cap_account_dirty (mapping)) {unsigned long addr;struct file *file =get_file (vma->vm_file); +/* mmap_region may free vma; grab the info now */ + vm_flags = vma->vm_flags; - addr =mmap_region (file, start, size, - vma->vm_flags, pgoff); + addr =mmap_region (file, start, size, vm_flags, pgoff);fput (file);if (IS_ERR_VALUE (addr)) { err = addr;
@@ -218,7 +219,7 @@ get_write_lock:BUG_ON (addr != start); err =0 ; } - goto out; + goto out_freed; }mutex_lock (&mapping->i_mmap_mutex);flush_dcache_mmap_lock (mapping);
@@ -253,6 +254,7 @@ get_write_lock: out:if (vma) vm_flags = vma->vm_flags; +out_freed:if (likely (!has_write_lock))up_read (&mm->mmap_sem);else
Greg Kroah-Hartman
maintainerPATCH 123/144 mm/memory-failure.c: transfer page count from head page to tail page after split thp
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Naoya Horiguchi <[email protected]>
commit a3e0f9e47d5ef7858a26cc12d90ad5146e802d47 upstream.
Memory failures on thp tail pages cause kernel panic like below:
mce: [Hardware Error]: Machine check events logged MCE exception done on CPU 7
BUG: unable to handle kernel NULL pointer dereference at 0000000000000058
IP: [<ffffffff811b7cd1>] dequeue_hwpoisoned_huge_page+0x131/0x1e0
PGD bae42067 PUD ba47d067 PMD 0
Oops: 0000 [#1] SMP
...
CPU: 7 PID: 128 Comm: kworker/7:2 Tainted: G M O 3.13.0-rc4-131217-1558-00003-g83b7df08e462 #25
...
Call Trace:
me_huge_page+0x3e/0x50
memory_failure+0x4bb/0xc20
mce_process_work+0x3e/0x70
process_one_work+0x171/0x420
worker_thread+0x11b/0x3a0
? manage_workers.isra.25+0x2b0/0x2b0
kthread+0xe4/0x100
? kthread_create_on_node+0x190/0x190
ret_from_fork+0x7c/0xb0
? kthread_create_on_node+0x190/0x190
...
RIP dequeue_hwpoisoned_huge_page+0x131/0x1e0
CR2: 0000000000000058The reasoning of this problem is shown below:
- when we have a memory error on a thp tail page, the memory error handler grabs a refcount of the head page to keep the thp under us.
- Before unmapping the error page from processes, we split the thp, where page refcounts of both of head/tail pages don't change.
- Then we call try_to_unmap() over the error page (which was a tail page before). We didn't pin the error page to handle the memory error, this error page is freed and removed from LRU list.
- We never have the error page on LRU list, so the first page state check returns "unknown page," then we move to the second check with the saved page flag.
- The saved page flag have PG_tail set, so the second page state check returns "hugepage."
- We call me_huge_page() for freed error page, then we hit the above panic.
The root cause is that we didn't move refcount from the head page to the tail page after split thp. So this patch suggests to do this.
This panic was introduced by commit 524fca1e73 ("HWPOISON: fix misjudgement of page_action() for errors on mlocked pages"). Note that we did have the same refcount problem before this commit, but it was just ignored because we had only first page state check which returned "unknown page." The commit changed the refcount problem from "doesn't work" to "kernel panic."
--- mm/memory-failure.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
mm/memory-failure.c +10 -0
@@ -938,6 +938,16 @@ static int hwpoison_user_mappings(structBUG_ON (!PageHWPoison (p));return SWAP_FAIL ; } +/* +* We pinned the head page for hwpoison handling, +* now we split the thp and we are interested in +* the hwpoisoned raw page, so move the refcount +* to it. +*/ +if (hpage != p) { +put_page (hpage); +get_page (p); + }/* THP is split, so ppage should be the real poisoned page. */ ppage = p; }
Greg Kroah-Hartman
maintainerPATCH 124/144 Input: allocate absinfo data when setting ABS capability
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Torokhov <[email protected]>
commit 28a2a2e1aedbe2d8b2301e6e0e4e63f6e4177aca upstream.
We need to make sure we allocate absinfo data when we are setting one of EV_ABS/ABS_XXX capabilities, otherwise we may bomb when we try to emit this event.
--- drivers/input/input.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/input/input.c +4 -0
@@ -1871,6 +1871,10 @@ void input_set_capability(struct input_dbreak ;case EV_ABS : +input_alloc_absinfo (dev); +if (!dev->absinfo) +return ; +__set_bit (code, dev->absbit);break ;
Greg Kroah-Hartman
maintainerPATCH 125/144 GFS2: dont hold s_umount over blkdev_put
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steven Whitehouse <[email protected]>
commit dfe5b9ad83a63180f358b27d1018649a27b394a9 upstream.
This is a GFS2 version of Tejun's patch:4f331f01b9c43bf001d3ffee578a97a1e0633eac
vfs: don't hold s_umount over close_bdev_exclusive() call
In this case its blkdev_put itself that is the issue and this patch uses the same solution of dropping and retaking s_umount.
--- fs/gfs2/ops_fstype.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
fs/gfs2/ops_fstype.c +11 -1
@@ -1366,8 +1366,18 @@ static struct dentry *gfs2_mount(structif (IS_ERR (s)) goto error_bdev; -if (s->s_root) +if (s->s_root) { +/* +* s_umount nests inside bd_mutex during +* __invalidate_device(). blkdev_put() acquires +* bd_mutex and can't be called under s_umount. Drop +* s_umount temporarily. This is safe as we're +* holding an active reference. +*/ +up_write (&s->s_umount);blkdev_put (bdev, mode); +down_write (&s->s_umount); + }memset (&args,0 ,sizeof (args)); args.ar_quota =GFS2_QUOTA_DEFAULT ;
Greg Kroah-Hartman
maintainerPATCH 126/144 GFS2: Fix use-after-free race when calling gfs2_remove_from_ail
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bob Peterson <[email protected]>
commit 9290a9a7c0bcf5400e8dbfbf9707fa68ea3fb338 upstream.
Function gfs2_remove_from_ail drops the reference on the bh via brelse. This patch fixes a race condition whereby bh is deferenced after the brelse when setting bd->bd_blkno = bh->b_blocknr;
Under certain rare circumstances, bh might be gone or reused,
and bd->bd_blkno is set to whatever that memory happens to be, which is often 0. Later, in gfs2_trans_add_unrevoke, that bd fails the test "bd->bd_blkno >= blkno" which causes it to never be freed. The end result is that the bd is never freed from the bufdata cache, which results in this error:
slab error in kmem_cache_destroy(): cache `gfs2_bufdata': Can't free all objects
--- fs/gfs2/log.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/gfs2/log.c +2 -2
@@ -551,10 +551,10 @@ void gfs2_add_revoke(struct gfs2_sbd *sdstruct buffer_head *bh = bd->bd_bh;struct gfs2_glock *gl = bd->bd_gl; -gfs2_remove_from_ail (bd); - bd->bd_bh =NULL ; bh->b_private =NULL ; bd->bd_blkno = bh->b_blocknr; +gfs2_remove_from_ail (bd);/* drops ref on bh */ + bd->bd_bh =NULL ; bd->bd_ops = &gfs2_revoke_lops; sdp->sd_log_num_revoke++;atomic_inc (&gl->gl_revokes);
Greg Kroah-Hartman
maintainerPATCH 127/144 GFS2: Fix slab memory leak in gfs2_bufdata
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bob Peterson <[email protected]>
commit 502be2a32f09f388e4ff34ef2e3ebcabbbb261da upstream.
This patch fixes a slab memory leak that sometimes can occur for files with a very short lifespan. The problem occurs when a dinode is deleted before it has gotten to the journal properly. In the leak scenario, the bd object is pinned for journal committment (queued to the metadata buffers queue: sd_log_le_buf) but is subsequently unpinned and dequeued before it finds its way to the ail or the revoke queue. In this rare circumstance, the bd object needs to be freed from slab memory, or it is forgotten. We have to be very careful how we do it, though, because multiple processes can call gfs2_remove_from_journal. In order to avoid double-frees, only the process that does the unpinning is allowed to free the bd.
--- fs/gfs2/meta_io.c | 5 +++++ 1 file changed, 5 insertions(+)
fs/gfs2/meta_io.c +5 -0
@@ -258,6 +258,7 @@ void gfs2_remove_from_journal(struct bufstruct address_space *mapping = bh->b_page->mapping;struct gfs2_sbd *sdp =gfs2_mapping2sbd (mapping);struct gfs2_bufdata *bd = bh->b_private; +int was_pinned =0 ;if (test_clear_buffer_pinned (bh)) {trace_gfs2_pin (bd,0 );
@@ -273,12 +274,16 @@ void gfs2_remove_from_journal(struct buf tr->tr_num_databuf_rm++; } tr->tr_touched =1 ; + was_pinned =1 ;brelse (bh); }if (bd) {spin_lock (&sdp->sd_ail_lock);if (bd->bd_tr) {gfs2_trans_add_revoke (sdp, bd); + }else if (was_pinned) { + bh->b_private =NULL ; +kmem_cache_free (gfs2_bufdata_cachep, bd); }spin_unlock (&sdp->sd_ail_lock); }
Greg Kroah-Hartman
maintainerPATCH 128/144 GFS2: Fix incorrect invalidation for DIO/buffered I/O
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steven Whitehouse <[email protected]>
commit dfd11184d894cd0a92397b25cac18831a1a6a5bc upstream.
In patch 209806aba9d540dde3db0a5ce72307f85f33468f we allowed local deferred locks to be granted against a cached exclusive lock. That opened up a corner case which this patch now fixes.
The solution to the problem is to check whether we have cached pages each time we do direct I/O and if so to unmap, flush and invalidate those pages. Since the glock state machine normally does that for us, mostly the code will be a no-op.
--- fs/gfs2/aops.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
fs/gfs2/aops.c +30 -0
@@ -984,6 +984,7 @@ static ssize_t gfs2_direct_IO(int rw, st {struct file *file = iocb->ki_filp;struct inode *inode = file->f_mapping->host; +struct address_space *mapping = inode->i_mapping;struct gfs2_inode *ip =GFS2_I (inode);struct gfs2_holder gh;int rv;
@@ -1004,6 +1005,35 @@ static ssize_t gfs2_direct_IO(int rw, stif (rv !=1 ) goto out;/* dio not valid, fall back to buffered i/o */ +/* +* Now since we are holding a deferred (CW) lock at this point, you +* might be wondering why this is ever needed. There is a case however +* where we've granted a deferred local lock against a cached exclusive +* glock. That is ok provided all granted local locks are deferred, but +* it also means that it is possible to encounter pages which are +* cached and possibly also mapped. So here we check for that and sort +* them out ahead of the dio. The glock state machine will take care of +* everything else. +* +* If in fact the cached glock state (gl->gl_state) is deferred (CW) in +* the first place, mapping->nr_pages will always be zero. +*/ +if (mapping->nrpages) { +loff_t lstart = offset & (PAGE_CACHE_SIZE -1 ); +loff_t len =iov_length (iov, nr_segs); +loff_t end =PAGE_ALIGN (offset + len) -1 ; + + rv =0 ; +if (len ==0 ) + goto out; +if (test_and_clear_bit (GIF_SW_PAGED , &ip->i_flags)) +unmap_shared_mapping_range (ip->i_inode.i_mapping, offset, len); + rv =filemap_write_and_wait_range (mapping, lstart, end); +if (rv) +return rv; +truncate_inode_pages_range (mapping, lstart, end); + } + rv =__blockdev_direct_IO (rw, iocb, inode, inode->i_sb->s_bdev, iov, offset, nr_segs, gfs2_get_block_direct,NULL ,NULL ,0 );
Greg Kroah-Hartman
maintainerPATCH 129/144 memcg: fix memcg_size() calculation
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vladimir Davydov <[email protected]>
commit 695c60830764945cf61a2cc623eb1392d137223e upstream.
The mem_cgroup structure contains nr_node_ids pointers to mem_cgroup_per_node objects, not the objects themselves.
--- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memcontrol.c +1 -1
@@ -337,7 +337,7 @@ struct mem_cgroup {static size_t memcg_size (void ) {return sizeof (struct mem_cgroup ) + - nr_node_ids *sizeof (struct mem_cgroup_per_node ); + nr_node_ids *sizeof (struct mem_cgroup_per_node *); }/* internal only representation about the status of kmem accounting. */
Greg Kroah-Hartman
maintainerPATCH 130/144 ARM: sun7i: dt: Fix interrupt trigger types
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maxime Ripard <[email protected]>
commit 378d0aee3b53bd8549b29dcc75f2bf47ee446e8f upstream.
The Allwinner A20 uses the ARM GIC as its internal interrupts controller. The GIC can work on several interrupt triggers, and the A20 was actually setting it up to use a rising edge as a trigger, while it was actually a level high trigger, leading to some interrupts that would be completely ignored if the edge was missed.
--- arch/arm/boot/dts/sun7i-a20.dtsi | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-)
arch/arm/boot/dts/sun7i-a20.dtsi +16 -16
@@ -170,7 +170,7 @@ emac: ethernet@01c0b000 { compatible = "allwinner,sun4i-emac"; reg = <0x01c0b000 0x1000>; - interrupts = <0 55 1>; + interrupts = <0 55 4>; clocks = <&ahb_gates 17>; status = "disabled"; };
@@ -186,7 +186,7 @@ pio: pinctrl@01c20800 { compatible = "allwinner,sun7i-a20-pinctrl"; reg = <0x01c20800 0x400>; - interrupts = <0 28 1>; + interrupts = <0 28 4>; clocks = <&apb0_gates 5>; gpio-controller; interrupt-controller;
@@ -230,12 +230,12 @@ timer@01c20c00 { compatible = "allwinner,sun4i-timer"; reg = <0x01c20c00 0x90>; - interrupts = <0 22 1>, - <0 23 1>, - <0 24 1>, - <0 25 1>, - <0 67 1>, - <0 68 1>; + interrupts = <0 22 4>, + <0 23 4>, + <0 24 4>, + <0 25 4>, + <0 67 4>, + <0 68 4>; clocks = <&osc24M>; };
@@ -247,7 +247,7 @@ uart0: serial@01c28000 { compatible = "snps,dw-apb-uart"; reg = <0x01c28000 0x400>; - interrupts = <0 1 1>; + interrupts = <0 1 4>; reg-shift = <2>; reg-io-width = <4>; clocks = <&apb1_gates 16>;
@@ -257,7 +257,7 @@ uart1: serial@01c28400 { compatible = "snps,dw-apb-uart"; reg = <0x01c28400 0x400>; - interrupts = <0 2 1>; + interrupts = <0 2 4>; reg-shift = <2>; reg-io-width = <4>; clocks = <&apb1_gates 17>;
@@ -267,7 +267,7 @@ uart2: serial@01c28800 { compatible = "snps,dw-apb-uart"; reg = <0x01c28800 0x400>; - interrupts = <0 3 1>; + interrupts = <0 3 4>; reg-shift = <2>; reg-io-width = <4>; clocks = <&apb1_gates 18>;
@@ -277,7 +277,7 @@ uart3: serial@01c28c00 { compatible = "snps,dw-apb-uart"; reg = <0x01c28c00 0x400>; - interrupts = <0 4 1>; + interrupts = <0 4 4>; reg-shift = <2>; reg-io-width = <4>; clocks = <&apb1_gates 19>;
@@ -287,7 +287,7 @@ uart4: serial@01c29000 { compatible = "snps,dw-apb-uart"; reg = <0x01c29000 0x400>; - interrupts = <0 17 1>; + interrupts = <0 17 4>; reg-shift = <2>; reg-io-width = <4>; clocks = <&apb1_gates 20>;
@@ -297,7 +297,7 @@ uart5: serial@01c29400 { compatible = "snps,dw-apb-uart"; reg = <0x01c29400 0x400>; - interrupts = <0 18 1>; + interrupts = <0 18 4>; reg-shift = <2>; reg-io-width = <4>; clocks = <&apb1_gates 21>;
@@ -307,7 +307,7 @@ uart6: serial@01c29800 { compatible = "snps,dw-apb-uart"; reg = <0x01c29800 0x400>; - interrupts = <0 19 1>; + interrupts = <0 19 4>; reg-shift = <2>; reg-io-width = <4>; clocks = <&apb1_gates 22>;
@@ -317,7 +317,7 @@ uart7: serial@01c29c00 { compatible = "snps,dw-apb-uart"; reg = <0x01c29c00 0x400>; - interrupts = <0 20 1>; + interrupts = <0 20 4>; reg-shift = <2>; reg-io-width = <4>; clocks = <&apb1_gates 23>;
Greg Kroah-Hartman
maintainerPATCH 131/144 s390/3270: fix allocation of tty3270_screen structure
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Martin Schwidefsky <[email protected]>
commit 36d9f4d3b68c7035ead3850dc85f310a579ed0eb upstream.
The tty3270_alloc_screen function is called from tty3270_install with swapped arguments, the number of columns instead of rows and vice versa. The number of rows is typically smaller than the number of columns which makes the screen array too big but the individual cell arrays for the lines too small. Creating lines longer than the number of rows will clobber the memory after the end of the cell array.
The fix is simple, call tty3270_alloc_screen with the correct argument order.
--- drivers/s390/char/tty3270.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/char/tty3270.c +1 -1
@@ -942,7 +942,7 @@ static int tty3270_install(struct tty_drreturn rc; } - tp->screen =tty3270_alloc_screen (tp->view.cols, tp->view.rows); + tp->screen =tty3270_alloc_screen (tp->view.rows, tp->view.cols);if (IS_ERR (tp->screen)) { rc =PTR_ERR (tp->screen);raw3270_put_view (&tp->view);
Greg Kroah-Hartman
maintainerPATCH 132/144 jbd2: dont BUG but return ENOSPC if a handle runs out of space
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Theodore Ts'o <[email protected]>
commit f6c07cad081ba222d63623d913aafba5586c1d2c upstream.
If a handle runs out of space, we currently stop the kernel with a BUG in jbd2_journal_dirty_metadata(). This makes it hard to figure out what might be going on. So return an error of ENOSPC, so we can let the file system layer figure out what is going on, to make it more likely we can get useful debugging information). This should make it easier to debug problems such as the one which was reported by:
https://bugzilla.kernel.org/show_bug.cgi?id=44731
The only two callers of this function are ext4_handle_dirty_metadata() and ocfs2_journal_dirty(). The ocfs2 function will trigger a BUG_ON(), which means there will be no change in behavior. The ext4 function will call ext4_error_inode() which will print the useful debugging information and then handle the situation using ext4's error handling mechanisms (i.e., which might mean halting the kernel or remounting the file system read-only).
Also, since both file systems already call WARN_ON(), drop the WARN_ON from jbd2_journal_dirty_metadata() to avoid two stack traces from being displayed.
--- fs/jbd2/transaction.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/jbd2/transaction.c +4 -2
@@ -1290,7 +1290,10 @@ int jbd2_journal_dirty_metadata(handle_t* once a transaction -bzzz */ jh->b_modified =1 ; -J_ASSERT_JH (jh, handle->h_buffer_credits >0 ); +if (handle->h_buffer_credits <=0 ) { + ret = -ENOSPC ; + goto out_unlock_bh; + } handle->h_buffer_credits--; }
@@ -1373,7 +1376,6 @@ out_unlock_bh:jbd2_journal_put_journal_head (jh); out:JBUFFER_TRACE (jh,"exit" ); -WARN_ON (ret);/* All errors are bugs, so dump the stack */ return ret; }
Greg Kroah-Hartman
maintainerPATCH 133/144 sh-pfc: Fix PINMUX_GPIO macro
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Laurent Pinchart <[email protected]>
commit 8620f394c4f9abd13e4fdf927d9c2bbeda74cde7 upstream.
Commit 7cbb0e55e27e ("sh-pfc: Don't duplicate argument to PINMUX_GPIO macro") erronesouly modified the PINMUX_GPIO macro in a way that resulted in all pins being named "name". Fix the macro to name the pins correctly.
--- drivers/pinctrl/sh-pfc/sh_pfc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/sh-pfc/sh_pfc.h +1 -1
@@ -254,7 +254,7 @@ struct sh_pfc_soc_info {#define PINMUX_GPIO (_pin) \ [GPIO_##_pin] = { \ .pin = (u16)-1, \ - .name = __stringify(name), \ + .name = __stringify(GPIO_##_pin), \ .enum_id = _pin##_DATA, \ }
Greg Kroah-Hartman
maintainerPATCH 134/144 gpio: twl4030: Fix regression for twl gpio LED output
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Roger Quadros <[email protected]>
commit f5837ec11f8cfa6d53ebc5806582771b2c9988c6 upstream.
Commit 0b2aa8be introduced a regression that causes failure in setting LED GPO direction to OUT.
This causes USB host probe failures for Beagleboard C4.
platform usb_phy_gen_xceiv.2: Driver usb_phy_gen_xceiv requests probe deferralhsusb2_vcc: Failed to request enable GPIO510: -22 reg-fixed-voltage reg-fixed-voltage.0.auto: Failed to register regulator: -22
reg-fixed-voltage: probe of reg-fixed-voltage.0.auto failed with error -22
direction_out/direction_in must return 0 if the operation succeeded.
Also, don't update direction flag and output data if twl4030_set_gpio_direction() failed inside twl_direction_out();
--- drivers/gpio/gpio-twl4030.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
drivers/gpio/gpio-twl4030.c +12 -3
@@ -300,7 +300,7 @@ static int twl_direction_in(struct gpio_if (offset <TWL4030_GPIO_MAX ) ret =twl4030_set_gpio_direction (offset,1 );else - ret = -EINVAL ; + ret = -EINVAL ;/* LED outputs can't be set as input */ if (!ret) priv->direction &= ~BIT (offset);
@@ -354,11 +354,20 @@ static void twl_set(struct gpio_chip *chstatic int twl_direction_out (struct gpio_chip *chip,unsigned offset,int value) {struct gpio_twl4030_priv *priv =to_gpio_twl4030 (chip); -int ret = -EINVAL ; +int ret =0 ;mutex_lock (&priv->mutex); -if (offset <TWL4030_GPIO_MAX ) +if (offset <TWL4030_GPIO_MAX ) { ret =twl4030_set_gpio_direction (offset,0 ); +if (ret) { +mutex_unlock (&priv->mutex); +return ret; + } + } + +/* +* LED gpios i.e. offset >= TWL4030_GPIO_MAX are always output +*/ priv->direction |=BIT (offset);mutex_unlock (&priv->mutex);
Greg Kroah-Hartman
maintainerPATCH 135/144 gpio: msm: Fix irq mask/unmask by writing bits instead of numbers
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Boyd <[email protected]>
commit 4cc629b7a20945ce35628179180329b6bc9e552b upstream.
We should be writing bits here but instead we're writing the numbers that correspond to the bits we want to write. Fix it by wrapping the numbers in the BIT() macro. This fixes gpios acting as interrupts.
--- drivers/gpio/gpio-msm-v2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpio/gpio-msm-v2.c +2 -2
@@ -252,7 +252,7 @@ static void msm_gpio_irq_mask(struct irqspin_lock_irqsave (&tlmm_lock, irq_flags);writel (TARGET_PROC_NONE ,GPIO_INTR_CFG_SU (gpio)); -clear_gpio_bits (INTR_RAW_STATUS_EN |INTR_ENABLE ,GPIO_INTR_CFG (gpio)); +clear_gpio_bits (BIT (INTR_RAW_STATUS_EN ) |BIT (INTR_ENABLE ),GPIO_INTR_CFG (gpio));__clear_bit (gpio, msm_gpio.enabled_irqs);spin_unlock_irqrestore (&tlmm_lock, irq_flags); }
@@ -264,7 +264,7 @@ static void msm_gpio_irq_unmask(struct ispin_lock_irqsave (&tlmm_lock, irq_flags);__set_bit (gpio, msm_gpio.enabled_irqs); -set_gpio_bits (INTR_RAW_STATUS_EN |INTR_ENABLE ,GPIO_INTR_CFG (gpio)); +set_gpio_bits (BIT (INTR_RAW_STATUS_EN ) |BIT (INTR_ENABLE ),GPIO_INTR_CFG (gpio));writel (TARGET_PROC_SCORPION ,GPIO_INTR_CFG_SU (gpio));spin_unlock_irqrestore (&tlmm_lock, irq_flags); }
Greg Kroah-Hartman
maintainerPATCH 136/144 sh: always link in helper functions extracted from libgcc
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
commit 84ed8a99058e61567f495cc43118344261641c5f upstream.
E.g. landisk_defconfig, which has CONFIG_NTFS_FS=m:
ERROR: "__ashrdi3" [fs/ntfs/ntfs.ko] undefined!
For "lib-y", if no symbols in a compilation unit are referenced by other units, the compilation unit will not be included in vmlinux. This breaks modules that do reference those symbols.
Use "obj-y" instead to fix this.
http://kisskb.ellerman.id.au/kisskb/buildresult/8838077/
This doesn't fix all cases. There are others, e.g. udivsi3. This is also not limited to sh, many architectures handle this in the same way.
A simple solution is to unconditionally include all helper functions. A more complex solution is to make the choice of "lib-y" or "obj-y" depend on CONFIG_MODULES:
obj-$(CONFIG_MODULES) += ... lib-y($CONFIG_MODULES) += ...
--- arch/sh/lib/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sh/lib/Makefile +1 -1
@@ -6,7 +6,7 @@ lib-y = delay.o memmove.o memchr.o \ checksum.o strlen.o div64.o div64-generic.o # Extracted from libgcc -lib-y += movmem.o ashldi3.o ashrdi3.o lshrdi3.o \ +obj-y += movmem.o ashldi3.o ashrdi3.o lshrdi3.o \ ashlsi3.o ashrsi3.o ashiftrt.o lshrsi3.o \ udiv_qrnnd.o
Greg Kroah-Hartman
maintainerPATCH 137/144 selinux: look for IPsec labels on both inbound and outbound packets
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Moore <[email protected]>
commit 817eff718dca4e54d5721211ddde0914428fbb7c upstream.
Previously selinux_skb_peerlbl_sid() would only check for labeled IPsec security labels on inbound packets, this patch enables it to check both inbound and outbound traffic for labeled IPsec security labels.
--- security/selinux/hooks.c | 2 - security/selinux/include/xfrm.h | 9 +++--- security/selinux/xfrm.c | 53 +++++++++++++++++++++++++++++++--------- 3 files changed, 48 insertions(+), 16 deletions(-)
security/selinux/hooks.c +1 -1
@@ -3792,7 +3792,7 @@ static int selinux_skb_peerlbl_sid(strucu32 nlbl_sid;u32 nlbl_type; -selinux_skb_xfrm_sid (skb, &xfrm_sid); +selinux_xfrm_skb_sid (skb, &xfrm_sid);selinux_netlbl_skbuff_getsid (skb, family, &nlbl_type, &nlbl_sid); err =security_net_peersid_resolve (nlbl_sid, nlbl_type, xfrm_sid, sid);
security/selinux/include/xfrm.h +5 -4
@@ -47,6 +47,7 @@ int selinux_xfrm_sock_rcv_skb(u32 sid, sint selinux_xfrm_postroute_last (u32 isec_sid,struct sk_buff *skb,struct common_audit_data *ad,u8 proto);int selinux_xfrm_decode_session (struct sk_buff *skb,u32 *sid,int ckall); +int selinux_xfrm_skb_sid (struct sk_buff *skb,u32 *sid);static inline void selinux_xfrm_notify_policyload (void ) {
@@ -85,12 +86,12 @@ static inline int selinux_xfrm_decode_sestatic inline void selinux_xfrm_notify_policyload (void ) { } -#endif -static inline void selinux_skb_xfrm_sid (struct sk_buff *skb,u32 *sid) +static inline int selinux_xfrm_skb_sid (struct sk_buff *skb,u32 *sid) { -int err =selinux_xfrm_decode_session (skb, sid,0 ); -BUG_ON (err); + *sid =SECSID_NULL ; +return 0 ; } +#endif #endif /* _SELINUX_XFRM_H_ */
security/selinux/xfrm.c +42 -11
69 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 138/144 selinux: process labeled IPsec TCP SYN-ACK packets properly in selinux_ip_postroute()
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Moore <[email protected]>
commit c0828e50485932b7e019df377a6b0a8d1ebd3080 upstream.
Due to difficulty in arriving at the proper security label for TCP SYN-ACK packets in selinux_ip_postroute(), we need to check packets while/before they are undergoing XFRM transforms instead of waiting until afterwards so that we can determine the correct security label.
--- security/selinux/hooks.c | 43 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-)
security/selinux/hooks.c +36 -7
@@ -4811,22 +4811,32 @@ static unsigned int selinux_ip_postroute* as fast and as clean as possible. */ if (!selinux_policycap_netpeer)return selinux_ip_postroute_compat (skb, ifindex, family); + + secmark_active =selinux_secmark_enabled (); + peerlbl_active =netlbl_enabled () ||selinux_xfrm_enabled (); +if (!secmark_active && !peerlbl_active) +return NF_ACCEPT ; + + sk = skb->sk; +#ifdef CONFIG_XFRM /* If skb->dst->xfrm is non-NULL then the packet is undergoing an IPsec * packet transformation so allow the packet to pass without any checks * since we'll have another chance to perform access control checks * when the packet is on it's final way out. * NOTE: there appear to be some IPv6 multicast cases where skb->dst -* is NULL, in this case go ahead and apply access control. */ -if (skb_dst (skb) !=NULL &&skb_dst (skb)->xfrm !=NULL ) +* is NULL, in this case go ahead and apply access control. +* is NULL, in this case go ahead and apply access control. +* NOTE: if this is a local socket (skb->sk != NULL) that is in the +* TCP listening state we cannot wait until the XFRM processing +* is done as we will miss out on the SA label if we do; +* unfortunately, this means more work, but it is only once per +* connection. */ +if (skb_dst (skb) !=NULL &&skb_dst (skb)->xfrm !=NULL && + !(sk !=NULL && sk->sk_state ==TCP_LISTEN ))return NF_ACCEPT ;#endif - secmark_active =selinux_secmark_enabled (); - peerlbl_active =netlbl_enabled () ||selinux_xfrm_enabled (); -if (!secmark_active && !peerlbl_active) -return NF_ACCEPT ; - sk = skb->sk;if (sk ==NULL ) {/* Without an associated socket the packet is either coming * from the kernel or it is being forwarded; check the packet
@@ -4854,6 +4864,25 @@ static unsigned int selinux_ip_postroutestruct sk_security_struct *sksec = sk->sk_security;if (selinux_skb_peerlbl_sid (skb, family, &skb_sid))return NF_DROP ; +/* At this point, if the returned skb peerlbl is SECSID_NULL +* and the packet has been through at least one XFRM +* transformation then we must be dealing with the "final" +* form of labeled IPsec packet; since we've already applied +* all of our access controls on this packet we can safely +* pass the packet. */ +if (skb_sid ==SECSID_NULL ) { +switch (family) { +case PF_INET : +if (IPCB (skb)->flags &IPSKB_XFRM_TRANSFORMED ) +return NF_ACCEPT ; +break ; +case PF_INET6 : +if (IP6CB (skb)->flags &IP6SKB_XFRM_TRANSFORMED ) +return NF_ACCEPT ; +default : +return NF_DROP_ERR (-ECONNREFUSED ); + } + }if (selinux_conn_sid (sksec->sid, skb_sid, &peer_sid))return NF_DROP ; secmark_perm =PACKET__SEND ;
Greg Kroah-Hartman
maintainerPATCH 139/144 clocksource: dw_apb_timer_of: Fix read_sched_clock
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dinh Nguyen <[email protected]>
commit 85dc6ee1237c8a4a7742e6abab96a20389b7d682 upstream.
The read_sched_clock should return the ~value because the clock is a countdown implementation. read_sched_clock() should be the same as
__apbt_read_clocksource().
--- drivers/clocksource/dw_apb_timer_of.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/dw_apb_timer_of.c +1 -1
@@ -108,7 +108,7 @@ static void add_clocksource(struct devicstatic u32 read_sched_clock (void ) { -return __raw_readl (sched_io_base); +return ~__raw_readl (sched_io_base); }static const struct of_device_id sptimer_ids[]__initconst = {
Greg Kroah-Hartman
maintainerPATCH 140/144 clocksource: dw_apb_timer_of: Fix support for dts binding "snps,dw-apb-timer"
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dinh Nguyen <[email protected]>
commit 9ab4727c1d41e50b67aecde4bf11879560a3ca78 upstream.
In commit 620f5e1cbf (dts: Rename DW APB timer compatible strings), both "snps,dw-apb-timer-sp" and "snps,dw-apb-timer-osc" were deprecated in place of "snps,dw-apb-timer". But the driver also needs to be udpated in order to support this new binding "snps,dw-apb-timer".
--- drivers/clocksource/dw_apb_timer_of.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/clocksource/dw_apb_timer_of.c +3 -2
@@ -113,7 +113,6 @@ static u32 read_sched_clock(void)static const struct of_device_id sptimer_ids[]__initconst = { { .compatible ="picochip,pc3x2-rtc" }, - { .compatible ="snps,dw-apb-timer-sp" }, {/* Sentinel */ }, };
@@ -153,4 +152,6 @@ static void __init dw_apb_timer_init(str num_called++; }CLOCKSOURCE_OF_DECLARE (pc3x2_timer,"picochip,pc3x2-timer" , dw_apb_timer_init); -CLOCKSOURCE_OF_DECLARE (apb_timer,"snps,dw-apb-timer-osc" , dw_apb_timer_init); +CLOCKSOURCE_OF_DECLARE (apb_timer_osc,"snps,dw-apb-timer-osc" , dw_apb_timer_init); +CLOCKSOURCE_OF_DECLARE (apb_timer_sp,"snps,dw-apb-timer-sp" , dw_apb_timer_init); +CLOCKSOURCE_OF_DECLARE (apb_timer,"snps,dw-apb-timer" , dw_apb_timer_init);
Greg Kroah-Hartman
maintainerPATCH 141/144 aio: clean up and fix aio_setup_ring page mapping
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
commit 3dc9acb67600393249a795934ccdfc291a200e6b upstream.
Since commit 36bc08cc01709 ("fs/aio: Add support to aio ring pages migration") the aio ring setup code has used a special per-ring backing inode for the page allocations, rather than just using random anonymous pages.
However, rather than remembering the pages as it allocated them, it would allocate the pages, insert them into the file mapping (dirty, so that they couldn't be free'd), and then forget about them. And then to look them up again, it would mmap the mapping, and then use "get_user_pages()" to get back an array of the pages we just created.
Now, not only is that incredibly inefficient, it also leaked all the pages if the mmap failed (which could happen due to excessive number of mappings, for example).
So clean it all up, making it much more straightforward. Also remove some left-overs of the previous (broken) mm_populate() usage that was removed in commit d6c355c7dabc ("aio: fix race in ring buffer page lookup introduced by page migration support") but left the pointless and now misleading MAP_POPULATE flag around.
--- fs/aio.c | 58 +++++++++++++++++++++++----------------------------------- 1 file changed, 23 insertions(+), 35 deletions(-)
fs/aio.c +23 -35
@@ -326,7 +326,7 @@ static int aio_setup_ring(struct kioctxstruct aio_ring *ring;unsigned nr_events = ctx->max_reqs;struct mm_struct *mm = current->mm; -unsigned long size, populate; +unsigned long size, unused;int nr_pages;int i;struct file *file;
@@ -347,6 +347,20 @@ static int aio_setup_ring(struct kioctxreturn -EAGAIN ; } + ctx->aio_ring_file = file; + nr_events = (PAGE_SIZE * nr_pages -sizeof (struct aio_ring )) + /sizeof (struct io_event ); + + ctx->ring_pages = ctx->internal_pages; +if (nr_pages >AIO_RING_PAGES ) { + ctx->ring_pages =kcalloc (nr_pages,sizeof (struct page *), +GFP_KERNEL ); +if (!ctx->ring_pages) { +put_aio_ring_file (ctx); +return -ENOMEM ; + } + } +for (i =0 ; i < nr_pages; i++) {struct page *page; page = find_or_create_page(file->f_inode->i_mapping,
@@ -358,19 +372,14 @@ static int aio_setup_ring(struct kioctxSetPageUptodate (page);SetPageDirty (page);unlock_page (page); + + ctx->ring_pages[i] = page; } - ctx->aio_ring_file = file; - nr_events = (PAGE_SIZE * nr_pages -sizeof (struct aio_ring )) - /sizeof (struct io_event ); + ctx->nr_pages = i; - ctx->ring_pages = ctx->internal_pages; -if (nr_pages >AIO_RING_PAGES ) { - ctx->ring_pages =kcalloc (nr_pages,sizeof (struct page *), -GFP_KERNEL ); -if (!ctx->ring_pages) { -put_aio_ring_file (ctx); -return -ENOMEM ; - } +if (unlikely (i != nr_pages)) { +aio_free_ring (ctx); +return -EAGAIN ; } ctx->mmap_size = nr_pages *PAGE_SIZE ;
@@ -379,9 +388,9 @@ static int aio_setup_ring(struct kioctxdown_write (&mm->mmap_sem); ctx->mmap_base =do_mmap_pgoff (ctx->aio_ring_file,0 , ctx->mmap_size,PROT_READ |PROT_WRITE , -MAP_SHARED |MAP_POPULATE ,0 , &populate); +MAP_SHARED ,0 , &unused); +up_write (&mm->mmap_sem);if (IS_ERR ((void *)ctx->mmap_base)) { -up_write (&mm->mmap_sem); ctx->mmap_size =0 ;aio_free_ring (ctx);return -EAGAIN ;
@@ -389,27 +398,6 @@ static int aio_setup_ring(struct kioctxpr_debug ("mmap address: 0x%08lx\n" , ctx->mmap_base); -/* We must do this while still holding mmap_sem for write, as we -* need to be protected against userspace attempting to mremap() -* or munmap() the ring buffer. -*/ - ctx->nr_pages =get_user_pages (current, mm, ctx->mmap_base, nr_pages, -1 ,0 , ctx->ring_pages,NULL ); - -/* Dropping the reference here is safe as the page cache will hold -* onto the pages for us. It is also required so that page migration -* can unmap the pages and get the right reference count. -*/ -for (i =0 ; i < ctx->nr_pages; i++) -put_page (ctx->ring_pages[i]); - -up_write (&mm->mmap_sem); - -if (unlikely (ctx->nr_pages != nr_pages)) { -aio_free_ring (ctx); -return -EAGAIN ; - } - ctx->user_id = ctx->mmap_base; ctx->nr_events = nr_events;/* trusted copy */
Greg Kroah-Hartman
maintainerPATCH 142/144 aio/migratepages: make aio migrate pages sane
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin LaHaise <[email protected]>
commit 8e321fefb0e60bae4e2a28d20fc4fa30758d27c6 upstream.
The arbitrary restriction on page counts offered by the core migrate_page_move_mapping() code results in rather suspicious looking fiddling with page reference counts in the aio_migratepage() operation. To fix this, make migrate_page_move_mapping() take an extra_count parameter that allows aio to tell the code about its own reference count on the page being migrated.
While cleaning up aio_migratepage(), make it validate that the old page being passed in is actually what aio_migratepage() expects to prevent misbehaviour in the case of races.
--- fs/aio.c | 52 ++++++++++++++++++++++++++++++++++++++++-------- include/linux/migrate.h | 3 +- mm/migrate.c | 13 ++++++------ 3 files changed, 53 insertions(+), 15 deletions(-)
fs/aio.c +44 -8
@@ -244,9 +244,14 @@ static void aio_free_ring(struct kioctxint i;for (i =0 ; i < ctx->nr_pages; i++) { +struct page *page;pr_debug ("pid(%d) [%d] page->count=%d\n" , current->pid, i,page_count (ctx->ring_pages[i])); -put_page (ctx->ring_pages[i]); + page = ctx->ring_pages[i]; +if (!page) +continue ; + ctx->ring_pages[i] =NULL ; +put_page (page); }put_aio_ring_file (ctx);
@@ -280,18 +285,38 @@ static int aio_migratepage(struct addresunsigned long flags;int rc; + rc =0 ; + +/* Make sure the old page hasn't already been changed */ +spin_lock (&mapping->private_lock); + ctx = mapping->private_data; +if (ctx) { +pgoff_t idx; +spin_lock_irqsave (&ctx->completion_lock, flags); + idx = old->index; +if (idx < (pgoff_t )ctx->nr_pages) { +if (ctx->ring_pages[idx] != old) + rc = -EAGAIN ; + }else + rc = -EINVAL ; +spin_unlock_irqrestore (&ctx->completion_lock, flags); + }else + rc = -EINVAL ; +spin_unlock (&mapping->private_lock); + +if (rc !=0 ) +return rc; +/* Writeback must be complete */ BUG_ON (PageWriteback (old)); -put_page (old); +get_page (new); - rc =migrate_page_move_mapping (mapping, new, old,NULL , mode); + rc =migrate_page_move_mapping (mapping, new, old,NULL , mode,1 );if (rc !=MIGRATEPAGE_SUCCESS ) { -get_page (old); +put_page (new);return rc; } -get_page (new); -/* We can potentially race against kioctx teardown here. Use the * address_space's private data lock to protect the mapping's * private_data.
@@ -303,13 +328,24 @@ static int aio_migratepage(struct addresspin_lock_irqsave (&ctx->completion_lock, flags);migrate_page_copy (new, old); idx = old->index; -if (idx < (pgoff_t )ctx->nr_pages) - ctx->ring_pages[idx] = new; +if (idx < (pgoff_t )ctx->nr_pages) { +/* And only do the move if things haven't changed */ +if (ctx->ring_pages[idx] == old) + ctx->ring_pages[idx] = new; +else + rc = -EAGAIN ; + }else + rc = -EINVAL ; spin_unlock_irqrestore(&ctx->completion_lock, flags); }else rc = -EBUSY ;spin_unlock (&mapping->private_lock); +if (rc ==MIGRATEPAGE_SUCCESS ) +put_page (old); +else +put_page (new); +return rc; }#endif
include/linux/migrate.h +2 -1
@@ -55,7 +55,8 @@ extern int migrate_huge_page_move_mappin struct page *newpage, struct page *page);extern int migrate_page_move_mapping (struct address_space *mapping,struct page *newpage,struct page *page, -struct buffer_head *head,enum migrate_mode mode); +struct buffer_head *head,enum migrate_mode mode, +int extra_count);#else static inline void putback_lru_pages (struct list_head *l) {}
mm/migrate.c +7 -6
@@ -315,14 +315,15 @@ static inline bool buffer_migrate_lock_b*/ int migrate_page_move_mapping (struct address_space *mapping,struct page *newpage,struct page *page, -struct buffer_head *head,enum migrate_mode mode) +struct buffer_head *head,enum migrate_mode mode, +int extra_count) { -int expected_count =0 ; +int expected_count =1 + extra_count;void **pslot;if (!mapping) {/* Anonymous page without mapping */ -if (page_count (page) !=1 ) +if (page_count (page) != expected_count)return -EAGAIN ;return MIGRATEPAGE_SUCCESS ; }
@@ -332,7 +333,7 @@ int migrate_page_move_mapping(struct add pslot =radix_tree_lookup_slot (&mapping->page_tree,page_index (page)); - expected_count =2 +page_has_private (page); + expected_count +=1 +page_has_private (page);if (page_count (page) != expected_count ||radix_tree_deref_slot_protected (pslot, &mapping->tree_lock) != page) {spin_unlock_irq (&mapping->tree_lock);
@@ -525,7 +526,7 @@ int migrate_page(struct address_space *mBUG_ON (PageWriteback (page));/* Writeback must be complete */ - rc =migrate_page_move_mapping (mapping, newpage, page,NULL , mode); + rc =migrate_page_move_mapping (mapping, newpage, page,NULL , mode,0 );if (rc !=MIGRATEPAGE_SUCCESS )return rc;
@@ -552,7 +553,7 @@ int buffer_migrate_page(struct address_s head =page_buffers (page); - rc =migrate_page_move_mapping (mapping, newpage, page, head, mode); + rc =migrate_page_move_mapping (mapping, newpage, page, head, mode,0 );if (rc !=MIGRATEPAGE_SUCCESS )return rc;
Greg Kroah-Hartman
maintainerPATCH 143/144 nouveau_acpi: convert acpi_get_handle() to acpi_has_method()
In reply to Greg Kroah-Hartman3.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhang Rui <[email protected]>
commit 187b5b5d520c2318a1f88fb8d8913a9d7fbf7d92 upstream.
acpi_has_method() is a new ACPI API introduced to check the existence of an ACPI control method.
It can be used to replace acpi_get_handle() in the case that
1. the calling function doesn't need the ACPI handle of the control method. and
2. the calling function doesn't care the reason why the method is unavailable.
Convert acpi_get_handle() to acpi_has_method() in drivers/gpu/drm/nouveau/nouveau_acpi.c in this patch.
--- drivers/gpu/drm/nouveau/nouveau_acpi.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/gpu/drm/nouveau/nouveau_acpi.c +2 -5
@@ -253,18 +253,15 @@ static struct vga_switcheroo_handler noustatic int nouveau_dsm_pci_probe (struct pci_dev *pdev) { -acpi_handle dhandle, nvidia_handle; -acpi_status status; +acpi_handle dhandle;int retval =0 ; dhandle =DEVICE_ACPI_HANDLE (&pdev->dev);if (!dhandle)return false; - status =acpi_get_handle (dhandle,"_DSM" , &nvidia_handle); -if (ACPI_FAILURE (status)) { +if (!acpi_has_method (dhandle,"_DSM" ))return false; - }if (nouveau_test_dsm (dhandle, nouveau_dsm,NOUVEAU_DSM_POWER )) retval |=NOUVEAU_DSM_HAS_MUX ;
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.12.7 release. There are 144 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed Jan 8 22:37:25 UTC 2014. Anything received after that time might be too late.
Build results:
total: 111 pass: 107 skipped: 4 fail: 0
qemu tests all passed.
Results are as expected.
Details are available as usual at http://server.roeck-us.net:8010/builders.
Guenter
Greg Kroah-Hartman
maintainerQuoted 10 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.12.7 release. There are 144 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed Jan 8 22:37:25 UTC 2014. Anything received after that time might be too late.
Quoted 7 lines
Build results:
total: 111 pass: 107 skipped: 4 fail: 0qemu tests all passed.
Results are as expected.
Details are available as usual at http://server.roeck-us.net:8010/builders.
Thanks for testing.
greg k-h
Greg Kroah-Hartman
maintainerAs there were lots of changes to the -rc1 release, I've now done a -rc2.
Changes were with the mm NUMA patches (lots more added and reordered to fix potential build issues), some ARM clock fixes added, and a SH patch.
Full announcement follows:
-----------------------------------------------
This is the start of the stable review cycle for the 3.12.7 release. There are 153 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu Jan 9 18:59:01 UTC 2014. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.12.7-rc2.gz
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 3.12.7-rc2
Nobuhiro Iwamatsu <[email protected]>
sh: add EXPORT_SYMBOL(min_low_pfn) and EXPORT_SYMBOL(max_low_pfn) to sh_ksyms_32.c
Eric Whitney <[email protected]>
ext4: fix bigalloc regression
Rafael J. Wysocki <[email protected]>
ACPIPHP / radeon / nouveau: Fix VGA switcheroo problem related to hotplug
Zhang Rui <[email protected]>
nouveau_acpi: convert acpi_get_handle() to acpi_has_method()
Benjamin LaHaise <[email protected]>
aio/migratepages: make aio migrate pages sane
Linus Torvalds <[email protected]>
aio: clean up and fix aio_setup_ring page mapping
Dinh Nguyen <[email protected]>
clocksource: dw_apb_timer_of: Fix support for dts binding "snps,dw-apb-timer"
Dinh Nguyen <[email protected]>
clocksource: dw_apb_timer_of: Fix read_sched_clock
Paul Moore <[email protected]>
selinux: process labeled IPsec TCP SYN-ACK packets properly in selinux_ip_postroute()
Paul Moore <[email protected]>
selinux: look for IPsec labels on both inbound and outbound packets
Geert Uytterhoeven <[email protected]>
sh: always link in helper functions extracted from libgcc
Stephen Boyd <[email protected]>
gpio: msm: Fix irq mask/unmask by writing bits instead of numbers
Roger Quadros <[email protected]>
gpio: twl4030: Fix regression for twl gpio LED output
Laurent Pinchart <[email protected]>
sh-pfc: Fix PINMUX_GPIO macro
Theodore Ts'o <[email protected]>
jbd2: don't BUG but return ENOSPC if a handle runs out of space
Martin Schwidefsky <[email protected]>
s390/3270: fix allocation of tty3270_screen structure
Maxime Ripard <[email protected]>
ARM: sun7i: dt: Fix interrupt trigger types
Vladimir Davydov <[email protected]>
memcg: fix memcg_size() calculation
Steven Whitehouse <[email protected]>
GFS2: Fix incorrect invalidation for DIO/buffered I/O
Bob Peterson <[email protected]>
GFS2: Fix slab memory leak in gfs2_bufdata
Bob Peterson <[email protected]>
GFS2: Fix use-after-free race when calling gfs2_remove_from_ail
Steven Whitehouse <[email protected]>
GFS2: don't hold s_umount over blkdev_put
Dmitry Torokhov <[email protected]>
Input: allocate absinfo data when setting ABS capability
Naoya Horiguchi <[email protected]>
mm/memory-failure.c: transfer page count from head page to tail page after split thp
Rik van Riel <[email protected]>
mm: fix use-after-free in sys_remap_file_pages
Vlastimil Babka <[email protected]>
mm: munlock: fix deadlock in __munlock_pagevec()
Vlastimil Babka <[email protected]>
mm: munlock: fix a bug where THP tail page is encountered
Johannes Weiner <[email protected]>
mm: page_alloc: revert NUMA aspect of fair allocation policy
Jianguo Wu <[email protected]>
mm/hugetlb: check for pte NULL pointer in __page_check_address()
Jianguo Wu <[email protected]>
mm/memory-failure.c: recheck PageHuge() after hugetlb page migrate successfully
Joonsoo Kim <[email protected]>
mm/compaction: respect ignore_skip_hint in update_pageblock_skip
Joonsoo Kim <[email protected]>
mm/mempolicy: correct putback method for isolate pages if failed
Mel Gorman <[email protected]>
mm: numa: defer TLB flush for THP migration as long as possible
Mel Gorman <[email protected]>
mm: numa: guarantee that tlb_flush_pending updates are visible before page table updates
Rik van Riel <[email protected]>
mm: fix TLB flush race between migration, and change_protection_range
Mel Gorman <[email protected]>
mm: numa: avoid unnecessary disruption of NUMA hinting during migration
Mel Gorman <[email protected]>
mm: numa: clear numa hinting information on mprotect
Mel Gorman <[email protected]>
sched: numa: skip inaccessible VMAs
Mel Gorman <[email protected]>
mm: numa: avoid unnecessary work on the failure path
Mel Gorman <[email protected]>
mm: numa: ensure anon_vma is locked to prevent parallel THP splits
Mel Gorman <[email protected]>
mm: numa: do not clear PTE for pte_numa update
Mel Gorman <[email protected]>
mm: numa: do not clear PMD during PTE update scan
Mel Gorman <[email protected]>
mm: clear pmd_numa before invalidating
Mel Gorman <[email protected]>
mm: numa: call MMU notifiers on THP migration
Mel Gorman <[email protected]>
mm: numa: serialise parallel get_user_page against THP migration
Rob Herring <[email protected]>
Revert "of/address: Handle #address-cells > 2 specially"
Rafael J. Wysocki <[email protected]>
intel_pstate: Fail initialization if P-state information is missing
Toshi Kani <[email protected]>
ACPI / PCI / hotplug: Avoid warning when _ADR not present
Jan Kara <[email protected]>
ext2: Fix oops in ext2_get_block() called from ext2_quota_write()
Larry Finger <[email protected]>
rtlwifi: pci: Fix oops on driver unload
Johannes Berg <[email protected]>
radiotap: fix bitmap-end-finding buffer overrun
Shirish Pargaonkar <[email protected]>
cifs: set FILE_CREATED
Sachin Prabhu <[email protected]>
cifs: We do not drop reference to tlink in CIFSCheckMFSymlink()
Tejun Heo <[email protected]>
libata, freezer: avoid block device removal while system is frozen
Marc Carino <[email protected]>
libata: implement ATA_HORKAGE_NO_NCQ_TRIM and apply it to Micro M500 SSDs
Robin H. Johnson <[email protected]>
libata: disable a disk via libata.force params
Michele Baldessari <[email protected]>
libata: add ATA_HORKAGE_BROKEN_FPDMA_AA quirk for Seagate Momentus SpinPoint M8
Marek Vasut <[email protected]>
ahci: imx: Explicitly clear IMX6Q_GPR13_SATA_MPLL_CLK_EN
Ilia Mirkin <[email protected]>
drm/nouveau: only runtime suspend by default in optimus configuration
Shuah Khan <[email protected]>
power_supply: Fix Oops from NULL pointer dereference from wakeup_source_activate
Josh Boyer <[email protected]>
cpupower: Fix segfault due to incorrect getopt_long arugments
Anton Blanchard <[email protected]>
powerpc: Align p_end
Michael Neuling <[email protected]>
powerpc: Fix bad stack check in exception entry
Jan Kiszka <[email protected]>
KVM: x86: Fix APIC map calculation after re-enabling
Jan Kiszka <[email protected]>
KVM: nVMX: Unconditionally uninit the MMU on nested vmexit
Mathy Vanhoef <[email protected]>
ath9k_htc: properly set MAC address and BSSID mask
Sujith Manoharan <[email protected]>
ath9k: Fix interrupt handling for the AR9002 family
Peter Korsgaard <[email protected]>
dm9601: work around tx fifo sync issue on dm962x
Peter Korsgaard <[email protected]>
dm9601: fix reception of full size ethernet frames on dm9620/dm9621a
Ard Biesheuvel <[email protected]>
auxvec.h: account for AT_HWCAP2 in AT_VECTOR_SIZE_BASE
Tejun Heo <[email protected]>
cgroup: fix cgroup_create() error handling path
Nithin Sujir <[email protected]>
tg3: Expand 4g_overflow_test workaround to skb fragments of any size.
Li Wang <[email protected]>
ceph: Avoid data inconsistency due to d-cache aliasing in readpage()
Marek Olšák <[email protected]>
drm/radeon: set correct pipe config for Hawaii in DCE
Alex Deucher <[email protected]>
drm/radeon: 0x9649 is SUMO2 not SUMO
Marek Olšák <[email protected]>
drm/radeon: expose render backend mask to the userspace
Marek Olšák <[email protected]>
drm/radeon: fix render backend setup for SI and CIK
Christian König <[email protected]>
drm/radeon: fix UVD 256MB check
Chris Wilson <[email protected]>
drm/i915: Use the correct GMCH_CTRL register for Sandybridge+
Paulo Zanoni <[email protected]>
drm/i915: change CRTC assertion on LCPLL disable
Chris Wilson <[email protected]>
drm/i915: Fix erroneous dereference of batch_obj inside reset_status
Alex Deucher <[email protected]>
drm/radeon: fix asic gfx values for scrapper asics
Alex Deucher <[email protected]>
drm/radeon: check for 0 count in speaker allocation and SAD code
Alex Deucher <[email protected]>
drm/radeon/dpm: disable ss on Cayman
Daniel Vetter <[email protected]>
drm/i915: don't update the dri1 breadcrumb with modesetting
Daniel Vetter <[email protected]>
drm/i915: Fix use-after-free in do_switch
Chris Wilson <[email protected]>
drm/i915: Hold mutex across i915_gem_release
Ville Syrjälä <[email protected]>
drm/i915: Take modeset locks around intel_modeset_setup_hw_state()
Alex Deucher <[email protected]>
drm/radeon: add missing display tiling setup for oland
Christian König <[email protected]>
drm/radeon: fix typo in cik_copy_dma
Alex Deucher <[email protected]>
drm/radeon: Fix sideport problems on certain RS690 boards
Thomas Hellstrom <[email protected]>
drm/ttm: Fix accesses through vmas with only partial coverage
Rafał Miłecki <[email protected]>
drm/edid: add quirk for BPC in Samsung NP700G7A-S01PL notebook
Dan Williams <[email protected]>
net_dma: mark broken
Stefan Richter <[email protected]>
firewire: sbp2: bring back WRITE SAME support
Kirill Tkhai <[email protected]>
sched/rt: Fix rq's cpupri leak while enqueue/dequeue child RT entities
Lukas Czerner <[email protected]>
ext4: fix FITRIM in no journal mode
Theodore Ts'o <[email protected]>
ext4: add explicit casts when masking cluster sizes
Jan Kara <[email protected]>
ext4: fix deadlock when writing in ENOSPC conditions
Jan Kara <[email protected]>
ext4: Do not reserve clusters when fs doesn't support extents
Al Viro <[email protected]>
ext4: fix del_timer() misuse for ->s_err_report
Eryu Guan <[email protected]>
ext4: check for overlapping extents in ext4_valid_extent_entries()
Junho Ryu <[email protected]>
ext4: fix use-after-free in ext4_mb_new_blocks
Theodore Ts'o <[email protected]>
ext4: call ext4_error_inode() if jbd2_journal_dirty_metadata() fails
Paul Drews <[email protected]>
ACPI: Add BayTrail SoC GPIO and LPSS ACPI IDs
Len Brown <[email protected]>
x86 idle: Repair large-server 50-watt idle-power regression
Tony Lindgren <[email protected]>
ARM: OMAP2+: Fix LCD panel backlight regression for LDP legacy booting
Suman Anna <[email protected]>
ARM: OMAP2+: hwmod_data: fix missing OMAP_INTC_START in irq data
Rajendra Nayak <[email protected]>
ARM: DRA7: hwmod: Fix boot crash with DEBUG_LL
Ben Dooks <[email protected]>
ARM: shmobile: r8a7790: fix shdi resource sizes
Will Deacon <[email protected]>
arm64: ptrace: avoid using HW_BREAKPOINT_EMPTY for disabled events
Ming Lei <[email protected]>
scripts/link-vmlinux.sh: only filter kernel symbols for arm
Miao Xie <[email protected]>
ftrace: Initialize the ftrace profiler for each possible cpu
Jie Liu <[email protected]>
xfs: fix infinite loop by detaching the group/project hints from user dquot
Nicholas Bellinger <[email protected]>
target/file: Update hw_max_sectors based on current block_size
Nicholas Bellinger <[email protected]>
iser-target: Move INIT_WORK setup into isert_create_device_ib_res
Nicholas Bellinger <[email protected]>
iscsi-target: Fix incorrect np->np_thread NULL assignment
Nicholas Bellinger <[email protected]>
iscsi-target: Fix-up all zero data-length CDBs with R/W_BIT set
Wei Yongjun <[email protected]>
iser-target: fix error return code in isert_create_device_ib_res()
Shivaram Upadhyayula <[email protected]>
qla2xxx: Fix schedule_delayed_work() for target timeout calculations
Benjamin LaHaise <[email protected]>
aio: fix kioctx leak introduced by "aio: Fix a trinity splat"
Oleg Nesterov <[email protected]>
selinux: selinux_setprocattr()->ptrace_parent() needs rcu_read_lock()
Chad Hanson <[email protected]>
selinux: fix broken peer recv check
Sebastian Andrzej Siewior <[email protected]>
usb: musb: only cancel work if it is initialized
Sebastian Andrzej Siewior <[email protected]>
usb: musb: core: Call dma_controller_destroy() in error path only once.
Peter Chen <[email protected]>
usb: chipidea: fix nobody cared IRQ when booting with host role
Fabio Estevam <[email protected]>
usb: chipidea: host: Only disable the vbus regulator if it is not NULL
Bjørn Mork <[email protected]>
usb: cdc-wdm: manage_power should always set needs_remote_wakeup
Marc Kleine-Budde <[email protected]>
can: peak_usb: fix mem leak in pcan_usb_pro_init()
Takashi Iwai <[email protected]>
xhci: Limit the spurious wakeup fix only to HP machines
Dmitry Kunilov <[email protected]>
usb: serial: zte_ev: move support for ZTE AC2726 from zte_ev back to option
Mika Westerberg <[email protected]>
serial: 8250_dw: add new ACPI IDs
Jonathan Cameron <[email protected]>
iio:adc:ad7887 Fix channel reported endianness from cpu to big endian
Jonathan Cameron <[email protected]>
iio:imu:adis16400 fix pressure channel scan type
Hui Wang <[email protected]>
ALSA: hda - Add Dell headset detection quirk for three laptop models
David Henningsson <[email protected]>
ALSA: hda - Add enable_msi=0 workaround for four HP machines
JongHo Kim <[email protected]>
ALSA: Add SNDRV_PCM_STATE_PAUSED case in wait_for_avail function
Charles Keepax <[email protected]>
ASoC: wm5110: Correct HPOUT3 DAPM route typo
Charles Keepax <[email protected]>
ASoC: wm_adsp: Add small delay while polling DSP RAM start
Bo Shen <[email protected]>
ASoC: wm8904: fix DSP mode B configuration
Stephen Warren <[email protected]>
ASoC: tegra: fix uninitialized variables in set_fmt
Vivek Goyal <[email protected]>
kexec: migrate to reboot cpu
H Hartley Sweeten <[email protected]>
staging: comedi: drivers: fix return value of comedi_load_firmware()
Ian Abbott <[email protected]>
staging: comedi: 8255_pci: fix for newer PCI-DIO48H
Geert Uytterhoeven <[email protected]>
TTY: pmac_zilog, check existence of ports in pmz_console_init()
Peter Hurley <[email protected]>
n_tty: Fix apparent order of echoed output
Peter Hurley <[email protected]>
tty: Fix hang at ldsem_down_read()
pingfan liu <[email protected]>
powerpc: kvm: fix rare but potential deadlock scene
Li Wang <[email protected]>
ceph: allocate non-zero page to fscache in readpage()
Yan, Zheng <[email protected]>
ceph: wake up 'safe' waiters when unregistering request
Yan, Zheng <[email protected]>
ceph: cleanup aborted requests when re-sending requests.
Milosz Tanski <[email protected]>
ceph: hung on ceph fscache invalidate in some cases
Johan Hovold <[email protected]>
USB: serial: fix race in generic write
-------------
Diffstat:
Documentation/kernel-parameters.txt | 2 + Makefile | 4 +- arch/arm/boot/dts/r8a7790.dtsi | 4 +- arch/arm/boot/dts/sun7i-a20.dtsi | 32 +++--- arch/arm/mach-omap2/board-ldp.c | 7 +- arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c | 4 +- arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 6 +- arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 2 +- arch/arm64/kernel/ptrace.c | 38 ++++--- arch/powerpc/include/asm/exception-64s.h | 2 +- arch/powerpc/kernel/head_64.S | 1 + arch/powerpc/kvm/book3s_64_mmu_hv.c | 6 +- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 4 + arch/sh/kernel/sh_ksyms_32.c | 5 + arch/sh/lib/Makefile | 2 +- arch/sparc/include/asm/pgtable_64.h | 4 +- arch/x86/include/asm/pgtable.h | 11 +- arch/x86/kernel/cpu/intel.c | 3 +- arch/x86/kvm/lapic.c | 8 +- arch/x86/kvm/vmx.c | 3 +- arch/x86/mm/gup.c | 13 +++ drivers/acpi/acpi_lpss.c | 1 + drivers/acpi/bus.c | 10 ++ drivers/ata/ahci_imx.c | 3 +- drivers/ata/libata-core.c | 19 +++- drivers/ata/libata-scsi.c | 21 ++++ drivers/clocksource/dw_apb_timer_of.c | 7 +- drivers/cpufreq/intel_pstate.c | 5 + drivers/dma/Kconfig | 1 + drivers/firewire/sbp2.c | 1 - drivers/gpio/gpio-msm-v2.c | 4 +- drivers/gpio/gpio-twl4030.c | 15 ++- drivers/gpu/drm/drm_edid.c | 8 ++ drivers/gpu/drm/i915/i915_dma.c | 10 ++ drivers/gpu/drm/i915/i915_gem.c | 34 +++++-- drivers/gpu/drm/i915/i915_gem_context.c | 16 ++- drivers/gpu/drm/i915/intel_display.c | 9 +- drivers/gpu/drm/nouveau/nouveau_acpi.c | 19 +++- drivers/gpu/drm/nouveau/nouveau_drm.c | 6 ++ drivers/gpu/drm/radeon/atombios_crtc.c | 23 ++--- drivers/gpu/drm/radeon/cik.c | 12 ++- drivers/gpu/drm/radeon/cik_sdma.c | 2 +- drivers/gpu/drm/radeon/dce6_afmt.c | 4 +- drivers/gpu/drm/radeon/evergreen_hdmi.c | 4 +- drivers/gpu/drm/radeon/ni.c | 20 +++- drivers/gpu/drm/radeon/radeon.h | 4 +- drivers/gpu/drm/radeon/radeon_atpx_handler.c | 16 ++- drivers/gpu/drm/radeon/radeon_kms.c | 9 ++ drivers/gpu/drm/radeon/radeon_uvd.c | 2 +- drivers/gpu/drm/radeon/rs690.c | 10 ++ drivers/gpu/drm/radeon/rv770_dpm.c | 6 ++ drivers/gpu/drm/radeon/si.c | 12 ++- drivers/gpu/drm/ttm/ttm_bo_vm.c | 6 +- drivers/idle/intel_idle.c | 3 + drivers/iio/adc/ad7887.c | 16 ++- drivers/iio/imu/adis16400_core.c | 7 +- drivers/infiniband/ulp/isert/ib_isert.c | 22 ++-- drivers/input/input.c | 4 + drivers/net/can/usb/peak_usb/pcan_usb_pro.c | 3 + drivers/net/ethernet/broadcom/tg3.c | 2 +- drivers/net/usb/dm9601.c | 34 +++++-- drivers/net/wireless/ath/ath9k/ar9002_mac.c | 52 ++++++++-- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 25 +++-- drivers/net/wireless/ath/ath9k/main.c | 5 +- drivers/net/wireless/rtlwifi/pci.c | 4 +- drivers/of/address.c | 8 -- drivers/pci/hotplug/acpiphp_glue.c | 30 +++++- drivers/pinctrl/pinctrl-baytrail.c | 1 + drivers/pinctrl/sh-pfc/sh_pfc.h | 2 +- drivers/power/power_supply_core.c | 12 +-- drivers/s390/char/tty3270.c | 2 +- drivers/scsi/qla2xxx/qla_target.c | 9 +- drivers/staging/comedi/drivers.c | 2 +- drivers/staging/comedi/drivers/8255_pci.c | 15 ++- drivers/target/iscsi/iscsi_target.c | 27 +++-- drivers/target/iscsi/iscsi_target_login.c | 6 -- drivers/target/target_core_device.c | 5 + drivers/target/target_core_file.c | 8 +- drivers/target/target_core_file.h | 5 +- drivers/tty/n_tty.c | 7 +- drivers/tty/serial/8250/8250_dw.c | 2 + drivers/tty/serial/pmac_zilog.c | 3 + drivers/tty/tty_ldsem.c | 16 ++- drivers/usb/chipidea/core.c | 4 + drivers/usb/chipidea/host.c | 3 +- drivers/usb/chipidea/udc.c | 3 - drivers/usb/class/cdc-wdm.c | 8 +- drivers/usb/host/xhci-pci.c | 7 +- drivers/usb/musb/musb_core.c | 14 +-- drivers/usb/serial/generic.c | 9 +- drivers/usb/serial/option.c | 2 + drivers/usb/serial/zte_ev.c | 3 +- fs/aio.c | 113 +++++++++++++-------- fs/ceph/addr.c | 10 +- fs/ceph/cache.c | 3 + fs/ceph/mds_client.c | 8 +- fs/cifs/cifsproto.h | 7 +- fs/cifs/dir.c | 11 +- fs/cifs/inode.c | 6 +- fs/cifs/link.c | 26 ++--- fs/ext2/super.c | 1 + fs/ext4/ext4.h | 10 ++ fs/ext4/ext4_jbd2.c | 9 ++ fs/ext4/extents.c | 45 +++++--- fs/ext4/inode.c | 12 --- fs/ext4/mballoc.c | 21 ++-- fs/ext4/super.c | 21 ++-- fs/gfs2/aops.c | 30 ++++++ fs/gfs2/log.c | 4 +- fs/gfs2/meta_io.c | 5 + fs/gfs2/ops_fstype.c | 12 ++- fs/jbd2/transaction.c | 6 +- fs/xfs/xfs_qm.c | 71 +++++++++---- include/acpi/acpi_bus.h | 4 +- include/asm-generic/pgtable.h | 2 +- include/drm/drm_pciids.h | 2 +- include/linux/auxvec.h | 2 +- include/linux/libata.h | 1 + include/linux/migrate.h | 13 ++- include/linux/mm_types.h | 49 +++++++++ include/linux/reboot.h | 1 + include/target/target_core_base.h | 1 + include/uapi/drm/radeon_drm.h | 2 + kernel/cgroup.c | 31 ++++-- kernel/fork.c | 1 + kernel/freezer.c | 6 ++ kernel/kexec.c | 1 + kernel/reboot.c | 2 +- kernel/sched/fair.c | 7 ++ kernel/sched/rt.c | 14 +++ kernel/trace/ftrace.c | 2 +- mm/compaction.c | 4 + mm/fremap.c | 8 +- mm/huge_memory.c | 49 +++++++-- mm/memcontrol.c | 2 +- mm/memory-failure.c | 24 ++++- mm/mempolicy.c | 2 +- mm/migrate.c | 82 +++++++++++---- mm/mlock.c | 44 +++++--- mm/mprotect.c | 13 ++- mm/page_alloc.c | 19 ++-- mm/pgtable-generic.c | 8 +- mm/rmap.c | 4 + net/wireless/radiotap.c | 4 + scripts/link-vmlinux.sh | 4 +- security/selinux/hooks.c | 53 ++++++++-- security/selinux/include/xfrm.h | 9 +- security/selinux/xfrm.c | 53 ++++++++-- sound/core/pcm_lib.c | 2 + sound/pci/hda/hda_intel.c | 4 + sound/pci/hda/patch_realtek.c | 3 + sound/soc/codecs/wm5110.c | 2 +- sound/soc/codecs/wm8904.c | 2 +- sound/soc/codecs/wm_adsp.c | 10 +- sound/soc/tegra/tegra20_i2s.c | 6 +- sound/soc/tegra/tegra20_spdif.c | 10 +- sound/soc/tegra/tegra30_i2s.c | 6 +- tools/power/cpupower/utils/cpupower-set.c | 6 +- 158 files changed, 1350 insertions(+), 525 deletions(-)
Greg Kroah-Hartman
maintainerQuoted 4 lines · Greg Kroah-Hartman
As there were lots of changes to the -rc1 release, I've now done a -rc2.
Changes were with the mm NUMA patches (lots more added and reordered to fix potential build issues), some ARM clock fixes added, and a SH patch.
Oops, no, the ARM clock fixes were for the 3.10.26-rc1 release, not 3.12.7-rc1, sorry abou that.
Too many trees...
greg k-h
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.12.7 release. There are 144 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed Jan 8 22:37:25 UTC 2014. Anything received after that time might be too late.
Quoted 7 lines
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.12.7-rc1.gzand the diffstat can be found below.
thanks,
greg k-h
Patches testing - passed
Compile testing - passed
Boot testing - passed
dmesg regression testing - passed
Test systems
Samsung Series 9 900X4C Intel Corei5 (3.4 and later) HP ProBook 6475b AMD A10-4600M APU with Radeon(tm) HD Graphics Dell OptiPlex 790 Intel(R) Core(TM) i5-2400
Detailed test status
Patches applied cleanly
dmesgs look good. No regressions compared to the previous dmesgs for this release. dmesg emerg, crit, alert, err are clean. No regressions in warn.
-- Shuah
Signature · 4 lines
Shuah Khan Senior Linux Kernel Developer - Open Source Group Samsung Research America(Silicon Valley) [email protected] | (970) 672-0658
Greg Kroah-Hartman
maintainerQuoted 28 lines · Shuah Khan
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.12.7 release. There are 144 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed Jan 8 22:37:25 UTC 2014. Anything received after that time might be too late.
Quoted 7 lines
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.12.7-rc1.gzand the diffstat can be found below.
thanks,
greg k-h
Patches testing - passed
Compile testing - passed
Boot testing - passed
dmesg regression testing - passedTest systems
Samsung Series 9 900X4C Intel Corei5 (3.4 and later) HP ProBook 6475b AMD A10-4600M APU with Radeon(tm) HD Graphics Dell OptiPlex 790 Intel(R) Core(TM) i5-2400
Quoted 5 lines
Detailed test status
Patches applied cleanly
dmesgs look good. No regressions compared to the previous dmesgs for this release. dmesg emerg, crit, alert, err are clean. No regressions in warn.
Just in time for me to do a -rc2 release for this, and the 3.10 -rc1 announcement, sorry :)
thanks for testing all 3 of these and letting me know.
greg k-h
Quoted 29 lines · Greg Kroah-Hartman
Quoted 28 lines · Shuah Khan
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.12.7 release. There are 144 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed Jan 8 22:37:25 UTC 2014. Anything received after that time might be too late.
Quoted 7 lines
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.12.7-rc1.gzand the diffstat can be found below.
thanks,
greg k-h
Patches testing - passed
Compile testing - passed
Boot testing - passed
dmesg regression testing - passedTest systems
Samsung Series 9 900X4C Intel Corei5 (3.4 and later) HP ProBook 6475b AMD A10-4600M APU with Radeon(tm) HD Graphics Dell OptiPlex 790 Intel(R) Core(TM) i5-2400
Quoted 9 lines
Quoted 5 lines
Detailed test status
Patches applied cleanly
dmesgs look good. No regressions compared to the previous dmesgs for this release. dmesg emerg, crit, alert, err are clean. No regressions in warn.Just in time for me to do a -rc2 release for this, and the 3.10 -rc1 announcement, sorry :)
3.10.26-rc2 and 3.12.7-rc2 are looking good on all my 3 test systems. No dmesg regressions.
-- Shuah
Signature · 4 lines
Shuah Khan Senior Linux Kernel Developer - Open Source Group Samsung Research America(Silicon Valley) [email protected] | (970) 672-0658
Quoted 36 lines · Shuah Khan
Quoted 35 lines · Greg Kroah-Hartman
Quoted 33 lines · Shuah Khan
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.12.7 release. There are 144 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed Jan 8 22:37:25 UTC 2014. Anything received after that time might be too late.
Quoted 7 lines
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.12.7-rc1.gzand the diffstat can be found below.
thanks,
greg k-h
Patches testing - passed
Compile testing - passed
Boot testing - passed
dmesg regression testing - passedTest systems
Samsung Series 9 900X4C Intel Corei5 (3.4 and later) HP ProBook 6475b AMD A10-4600M APU with Radeon(tm) HD Graphics Dell OptiPlex 790 Intel(R) Core(TM) i5-2400
Detailed test status
Patches applied cleanly
dmesgs look good. No regressions compared to the previous dmesgs for this release. dmesg emerg, crit, alert, err are clean. No regressions in warn.
Quoted 6 lines
Quoted 3 lines
Just in time for me to do a -rc2 release for this, and the 3.10 -rc1 announcement, sorry :)
3.10.26-rc2 and 3.12.7-rc2 are looking good on all my 3 test systems. No dmesg regressions.
Same here.
Guenter
Greg Kroah-Hartman
maintainerQuoted 37 lines · Guenter Roeck
Quoted 36 lines · Shuah Khan
Quoted 35 lines · Greg Kroah-Hartman
Quoted 33 lines · Shuah Khan
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.12.7 release. There are 144 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed Jan 8 22:37:25 UTC 2014. Anything received after that time might be too late.
Quoted 7 lines
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.12.7-rc1.gzand the diffstat can be found below.
thanks,
greg k-h
Patches testing - passed
Compile testing - passed
Boot testing - passed
dmesg regression testing - passedTest systems
Samsung Series 9 900X4C Intel Corei5 (3.4 and later) HP ProBook 6475b AMD A10-4600M APU with Radeon(tm) HD Graphics Dell OptiPlex 790 Intel(R) Core(TM) i5-2400
Detailed test status
Patches applied cleanly
dmesgs look good. No regressions compared to the previous dmesgs for this release. dmesg emerg, crit, alert, err are clean. No regressions in warn.
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
Just in time for me to do a -rc2 release for this, and the 3.10 -rc1 announcement, sorry :)
3.10.26-rc2 and 3.12.7-rc2 are looking good on all my 3 test systems. No dmesg regressions.
Same here.
Great, thanks to both of you for testing and letting me know.
greg k-h