3.14.6-stable review
Subsystems (11)
Greg Kroah-Hartman
maintainercover 3.14.6-stable review
This is the start of the stable review cycle for the 3.14.6 release. There are 228 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri Jun 6 23:23:11 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.14.6-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 3.14.6-rc1
Guennadi Liakhovetski <[email protected]>
media: V4L2: fix VIDIOC_CREATE_BUFS in 64- / 32-bit compatibility mode
Guennadi Liakhovetski <[email protected]>
media: V4L2: ov7670: fix a wrong index, potentially Oopsing the kernel from user-space
Eyal Shapira <[email protected]>
iwlwifi: mvm: rs: clear per rate stats when aggregation changes
Eliad Peller <[email protected]>
iwlwifi: add rs_rate_scale_clear_tbl_windows helper function
Emmanuel Grumbach <[email protected]>
iwlwifi: mvm: disable beacon filtering
Antti Palosaari <[email protected]>
media: fc2580: fix tuning failure on 32-bit arch
Alex Williamson <[email protected]>
iommu/amd: Fix interrupt remapping for aliased devices
Chunwei Chen <[email protected]>
libceph: fix corruption when using page_count 0 page in rbd
Geert Uytterhoeven <[email protected]>
spi: core: Ignore unsupported Dual/Quad Transfer Mode bits
Srivatsa S. Bhat <[email protected]>
powerpc, kexec: Fix "Processor X is stuck" issue during kexec from ST mode
Guenter Roeck <[email protected]>
powerpc: Fix 64 bit builds with binutils 2.24
Anton Blanchard <[email protected]>
powerpc: irq work racing with timer interrupt can result in timer interrupt hang
Gavin Shan <[email protected]>
powerpc/powernv: Reset root port in firmware
Stephen Boyd <[email protected]>
clk: Fix slab corruption in clk_unregister()
Stephen Boyd <[email protected]>
clk: Fix double free due to devm_clk_register()
Harald Freudenberger <[email protected]>
crypto: s390 - fix aes,des ctr mode concurrency finding.
Horia Geanta <[email protected]>
crypto: caam - add allocation failure handling in SPRINTFCAT macro
Dirk Brandewie <[email protected]>
intel_pstate: remove setting P state to MAX on init
Dirk Brandewie <[email protected]>
intel_pstate: Set turbo VID for BayTrail
Olof Johansson <[email protected]>
i2c: s3c2410: resume race fix
Du, Wenkai <[email protected]>
i2c: designware: Mask all interrupts during i2c controller enable
Wolfram Sang <[email protected]>
i2c: rcar: bail out on zero length transfers
Hans de Goede <[email protected]>
ACPI / video: Revert native brightness quirk for ThinkPad T530
Aaron Lu <[email protected]>
ACPI / video: correct DMI tag for Dell Inspiron 7520
Rafael J. Wysocki <[email protected]>
ACPI / TPM: Fix resume regression on Chromebooks
Edward Lin <[email protected]>
ACPI: blacklist win8 OSI for Dell Inspiron 7737
Guenter Roeck <[email protected]>
ACPI: Revert "ACPI / AC: convert ACPI ac driver to platform bus"
Igor Mammedov <[email protected]>
ACPI / processor: do not mark present at boot but not onlined CPU as onlined
Hans de Goede <[email protected]>
ACPI / blacklist: Add dmi_enable_osi_linux quirk for Asus EEE PC 1015PX
Hans de Goede <[email protected]>
ACPI / video: Add use_native_backlight quirks for more systems
Lan Tianyu <[email protected]>
ACPI: Revert "ACPI / Battery: Remove battery's proc directory"
Lan Tianyu <[email protected]>
ACPI: Revert "ACPI: Remove CONFIG_ACPI_PROCFS_POWER and cm_sbsc.c"
Lv Zheng <[email protected]>
ACPICA: Tables: Restore old behavor to favor 32-bit FADT addresses.
Lv Zheng <[email protected]>
ACPICA: Tables: Fix invalid pointer accesses in acpi_tb_parse_root_table().
Levente Kurusa <[email protected]>
libata: clean up ZPODD when a port is detached
Nicholas Bellinger <[email protected]>
tcm_fc: Fix free-after-use regression in ft_free_cmd
Andy Shevchenko <[email protected]>
dmaengine: dw: went back to plain {request,free}_irq() calls
Ezequiel Garcia <[email protected]>
dma: mv_xor: Flush descriptors before activating a channel
Xuelin Shi <[email protected]>
dmaengine: fix dmaengine_unmap failure
Joe Thornber <[email protected]>
dm thin: add timeout to stop out-of-data-space mode holding IO forever
Joe Thornber <[email protected]>
dm thin: allow metadata commit if pool is in PM_OUT_OF_DATA_SPACE mode
Mikulas Patocka <[email protected]>
dm crypt: fix cpu hotplug crash by removing per-cpu structure
Gavin Shan <[email protected]>
PCI: Wrong register used to check pending traffic
Emmanuel Grumbach <[email protected]>
iwlwifi: mvm: BT Coex - fix Look Up Table
Jani Nikula <[email protected]>
drm/i915: quirk invert brightness for Acer Aspire 5336
Chris Wilson <[email protected]>
drm/i915: Fix unsafe loop iteration over vma whilst unbinding them
Imre Deak <[email protected]>
drm/i915: move power domain init earlier during system resume
Daniel Vetter <[email protected]>
drm/i915: Disable self-refresh for untiled fbs on i915gm
Mikulas Patocka <[email protected]>
target: fix memory leak on XCOPY
Andy Grover <[email protected]>
target: Don't allow setting WC emulation if device doesn't support
Nicholas Bellinger <[email protected]>
iscsi-target: Change BUG_ON to REJECT in iscsit_process_nop_out
Sagi Grimberg <[email protected]>
Target/iser: Fix iscsit_accept_np and rdma_cm racy flow
Sagi Grimberg <[email protected]>
Target/iser: Fix wrong connection requests list addition
Andy Grover <[email protected]>
target: Allow non-supporting backends to set pi_prot_type to 0
Marcel Apfelbaum <[email protected]>
PCI: shpchp: Check bridge's secondary (not primary) bus speed
Tejun Heo <[email protected]>
sysfs: make sure read buffer is zeroed
Arnd Bergmann <[email protected]>
genirq: Provide irq_force_affinity fallback for non-SMP
Linus Torvalds <[email protected]>
x86-64, modify_ldt: Make support for 16-bit segments a runtime option
James Hogan <[email protected]>
metag: Reduce maximum stack size to 256MB
Mikulas Patocka <[email protected]>
metag: fix memory barriers
John David Anglin <[email protected]>
parisc: Improve LWS-CAS performance
Helge Deller <[email protected]>
parisc: ratelimit userspace segfault printing
Charles Keepax <[email protected]>
ASoC: wm8962: Update register CLASS_D_CONTROL_1 to be non-volatile
Lars-Peter Clausen <[email protected]>
ASoC: dapm: Skip CODEC<->CODEC links in connect_dai_link_widgets()
Emmanuel Grumbach <[email protected]>
iwlwifi: mvm: fix setting channel in monitor mode
Emmanuel Grumbach <[email protected]>
iwlwifi: pcie: disable interrupts upon PCIe alloc
Jianyu Zhan <[email protected]>
percpu: make pcpu_alloc_chunk() use pcpu_mem_free() instead of kfree()
Thomas Petazzoni <[email protected]>
ARM: mvebu: mvebu-soc-id: keep clock enabled if PCIe unit is enabled
Thomas Petazzoni <[email protected]>
ARM: mvebu: mvebu-soc-id: add missing clk_put() call
Thomas Petazzoni <[email protected]>
PCI: mvebu: split PCIe BARs into multiple MBus windows when needed
Thomas Petazzoni <[email protected]>
bus: mvebu-mbus: allow several windows with the same target/attribute
Willy Tarreau <[email protected]>
PCI: mvebu: fix off-by-one in the computed size of the mbus windows
Thomas Petazzoni <[email protected]>
memory: mvebu-devbus: fix the conversion of the bus width
Lai Jiangshan <[email protected]>
workqueue: make rescuer_thread() empty wq->maydays list before exiting
Lai Jiangshan <[email protected]>
workqueue: fix a possible race condition between rescuer and pwq-release
Daeseok Youn <[email protected]>
workqueue: fix bugs in wq_update_unbound_numa() failure path
J. Bruce Fields <[email protected]>
nfsd4: remove lockowner when removing lock stateid
J. Bruce Fields <[email protected]>
nfsd4: warn on finding lockowner without stateid's
Kinglong Mee <[email protected]>
NFSD: Call ->set_acl with a NULL ACL structure if no entries
Trond Myklebust <[email protected]>
NFSd: call rpc_destroy_wait_queue() from free_client()
Trond Myklebust <[email protected]>
NFSd: Move default initialisers from create_client() to alloc_client()
Takashi Iwai <[email protected]>
ALSA: hda - Fix onboard audio on Intel H97/Z97 chipsets
Anssi Hannula <[email protected]>
ALSA: hda - hdmi: Set converter channel count even without sink
Hans de Goede <[email protected]>
Input: synaptics - change min/max quirk table to pnp-id matching
Hans de Goede <[email protected]>
Input: synaptics - add a matches_pnp_id helper function
Hans de Goede <[email protected]>
Input: synaptics - T540p - unify with other LEN0034 models
Hans de Goede <[email protected]>
Input: synaptics - add min/max quirk for the ThinkPad W540
Hans de Goede <[email protected]>
Input: elantech - fix touchpad initialization on Gigabyte U2442
Sheng-Liang Song <[email protected]>
Input: atkbd - fix keyboard not working on some LG laptops
Romain Izard <[email protected]>
trace: module: Maintain a valid user count
Al Viro <[email protected]>
fix races between __d_instantiate() and checks of dentry flags
Ian Kent <[email protected]>
autofs: fix lockref lookup
Yan, Zheng <[email protected]>
ceph: clear directory's completeness when creating file
David Ertman <[email protected]>
e1000e: Fix no connectivity when driver loaded with cable out
Hans de Goede <[email protected]>
Input: synaptics - report INPUT_PROP_TOPBUTTONPAD property
Hans de Goede <[email protected]>
Input: Add INPUT_PROP_TOPBUTTONPAD device property
Hans de Goede <[email protected]>
Input: i8042 - add firmware_id support
Hans de Goede <[email protected]>
Input: serio - add firmware_id sysfs attribute
Chew, Kean ho <[email protected]>
i2c: i801: enable Intel BayTrail SMBUS
Salva Peiró <[email protected]>
media: media-device: fix infoleak in ioctl media_enum_entities()
Dan Carpenter <[email protected]>
clk: vexpress: NULL dereference on error path
Tim Chen <[email protected]>
crypto: crypto_wq - Fix late crypto work queue initialization
Aristeu Rozanski <[email protected]>
device_cgroup: check if exception removal is allowed
Aristeu Rozanski <[email protected]>
device_cgroup: rework device access check and exception checking
Geert Uytterhoeven <[email protected]>
Documentation: Update stable address in Chinese and Japanese translations
Emil Goode <[email protected]>
brcmsmac: fix deadlock on missing firmware
Russell King <[email protected]>
leds: leds-pwm: properly clean up after probe failure
Martin Peres <[email protected]>
drm/nouveau/pm/fan: drop the fan lock in fan_update() before rescheduling
Christoph Paasch <[email protected]>
igb: Unset IGB_FLAG_HAS_MSIX-flag when falling back to msi-only
Christoph Paasch <[email protected]>
igb: Fix Null-pointer dereference in igb_reset_q_vector
Dan Carpenter <[email protected]>
i40e: potential array underflow in i40e_vc_process_vf_msg()
Aaron Lu <[email protected]>
drm/i915: restore backlight precision when converting from ACPI
Jani Nikula <[email protected]>
drm/i915/vlv: reset VLV media force wake request register
Maarten Lankhorst <[email protected]>
drm/nouveau: fix another lock unbalance in nouveau_crtc_page_flip
Ilia Mirkin <[email protected]>
drm/nouveau/acpi: allow non-optimus setups to load vbios from acpi
Ben Hutchings <[email protected]>
rtl8192cu: Fix unbalanced irq enable in error path of rtl92cu_hw_init()
Liu Hua <[email protected]>
ARM: 8012/1: kdump: Avoid overflow when converting pfn to physaddr
Leif Lindholm <[email protected]>
arm: dts: Fix missing device_type="memory" for ste-ccu8540
Thomas Petazzoni <[email protected]>
ARM: mvebu: fix NOR bus-width in Armada XP OpenBlocks AX3 Device Tree
Thomas Petazzoni <[email protected]>
ARM: mvebu: fix NOR bus-width in Armada XP DB Device Tree
Thomas Petazzoni <[email protected]>
ARM: mvebu: fix NOR bus-width in Armada XP GP Device Tree
Thomas Gleixner <[email protected]>
ARM: common: edma: Fix xbar mapping
Sascha Hauer <[email protected]>
ARM: dts: i.MX53: Fix ipu register space size
Sebastian Hesselbarth <[email protected]>
ARM: dts: kirkwood: fix mislocated pcie-controller nodes
Thomas Petazzoni <[email protected]>
ARM: orion5x: fix target ID for crypto SRAM window
Johannes Weiner <[email protected]>
revert "mm: vmscan: do not swap anon pages just because free+file is low"
Vlastimil Babka <[email protected]>
mm/compaction: make isolate_freepages start at pageblock boundary
Rik van Riel <[email protected]>
mm/page-writeback.c: fix divide by zero in pos_ratio_polynom
Fabian Frederick <[email protected]>
fs/affs/super.c: bugfix / double free
Christoph Hellwig <[email protected]>
posix_acl: handle NULL ACL in posix_acl_equiv_mode
Marcel Holtmann <[email protected]>
Revert "Bluetooth: Enable autosuspend for Intel Bluetooth device"
Mohammed Habibulla <[email protected]>
Bluetooth: Add support for Lite-on [04ca:3007]
Johan Hedberg <[email protected]>
Bluetooth: Fix redundant encryption request for reauthentication
Johan Hedberg <[email protected]>
Bluetooth: Fix triggering BR/EDR L2CAP Connect too early
Clemens Ladisch <[email protected]>
ALSA: usb-audio: work around corrupted TEAC UD-H01 feedback data
Stanislaw Gruszka <[email protected]>
rt2x00: fix beaconing on USB
Daniele Forsi <[email protected]>
USB: Nokia 5300 should be treated as unusual dev
Victor A. Santos <[email protected]>
USB: Nokia 305 should be treated as unusual dev
Daniele Forsi <[email protected]>
usb: storage: shuttle_usbat: fix discs being detected twice
Bjørn Mork <[email protected]>
usb: qcserial: add a number of Dell devices
Alan Stern <[email protected]>
USB: OHCI: fix problem with global suspend on ATI controllers
Jean-Jacques Hiblot <[email protected]>
usb: gadget: at91-udc: fix irq and iomem resource retrieval
Nikita Yushchenko <[email protected]>
fsl-usb: do not test for PHY_CLK_VALID bit on controller version 1.6
Atilla Filiz <[email protected]>
iio:imu:mpu6050: Fixed segfault in Invensens MPU driver due to null dereference
Tuomas Tynkkynen <[email protected]>
clk: tegra: Fix wrong value written to PLLE_AUX
Thierry Reding <[email protected]>
drm/tegra: Remove gratuitous pad field
Leo Liu <[email protected]>
drm/radeon: check buffer relocation offset
Christian König <[email protected]>
drm/radeon: use pflip irq on R600+ v2
Christian König <[email protected]>
drm/radeon/uvd: use lower clocks on old UVD to boot v2
Alex Deucher <[email protected]>
drm/radeon: fix count in cik_sdma_ring_test()
Alex Deucher <[email protected]>
drm/radeon: disable dpm on rv770 by default
Alex Deucher <[email protected]>
drm/radeon: don't allow runpm=1 on systems with out ATPX
Alex Deucher <[email protected]>
drm/radeon/pm: don't walk the crtc list before it has been initialized (v2)
Alex Deucher <[email protected]>
drm/radeon: fix ATPX detection on non-VGA GPUs
Alex Deucher <[email protected]>
drm/radeon: properly unregister hwmon interface (v2)
Alex Deucher <[email protected]>
drm/radeon/ci: make sure mc ucode is loaded before checking the size
Alex Deucher <[email protected]>
drm/radeon/si: make sure mc ucode is loaded before checking the size
Alex Deucher <[email protected]>
drm/radeon: re-enable mclk dpm on R7 260X asics
Alex Deucher <[email protected]>
drm/radeon: add support for newer mc ucode on CI (v2)
Alex Deucher <[email protected]>
drm/radeon: add support for newer mc ucode on SI (v2)
Alex Deucher <[email protected]>
drm/radeon: disable mclk dpm on R7 260X
Alex Deucher <[email protected]>
drm/radeon: fix runpm handling on APUs (v4)
Alex Deucher <[email protected]>
drm/radeon: fix audio pin counts for DCE6+ (v2)
Egbert Eich <[email protected]>
drm/i915: Break encoder->crtc link separately in intel_sanitize_crtc()
Daniel Vetter <[email protected]>
drm/i915: Don't WARN nor handle unexpected hpd interrupts on gmch platforms
Daniel Vetter <[email protected]>
drm/i915: Don't check gmch state on inherited configs
Ville Syrjälä <[email protected]>
drm/i915: Allow user modes to exceed DVI 165MHz limit
Neil Greatorex <[email protected]>
irqchip: armada-370-xp: Fix releasing of MSIs
Thomas Petazzoni <[email protected]>
irqchip: armada-370-xp: implement the ->check_device() msi_chip operation
Thomas Petazzoni <[email protected]>
irqchip: armada-370-xp: fix invalid cast of signed value into unsigned variable
Kieran Clancy <[email protected]>
ACPI / EC: Process rather than discard events in acpi_ec_clear
Rafael J. Wysocki <[email protected]>
PNP / ACPI: Do not return errors if _DIS or _SRS are not present
NeilBrown <[email protected]>
md: avoid possible spinning md thread at shutdown.
NeilBrown <[email protected]>
md/raid10: call wait_barrier() for each request submitted.
Mike Snitzer <[email protected]>
dm cache: fix writethrough mode quiescing in cache_map
Milan Broz <[email protected]>
dm verity: fix biovecs hash calculation regression
Viresh Kumar <[email protected]>
hrtimer: Set expiry time before switch_hrtimer_base()
Leon Ma <[email protected]>
hrtimer: Prevent remote enqueue of leftmost timers
Stuart Hayes <[email protected]>
hrtimer: Prevent all reprogramming if hang detected
Grant Likely <[email protected]>
drivercore: deferral race condition fix
Josef Gajdusek <[email protected]>
hwmon: (emc1403) Support full range of known chip revision numbers
Jean Delvare <[email protected]>
hwmon: (emc1403) Fix resource leak on module unload
Josef Gajdusek <[email protected]>
hwmon: (emc1403) fix inverted store_hyst()
Guenter Roeck <[email protected]>
Revert "hwmon: (coretemp) Refine TjMax detection"
Rusty Russell <[email protected]>
module: remove warning about waiting module removal.
Leon Yu <[email protected]>
aio: fix potential leak in aio_run_iocb().
Johannes Berg <[email protected]>
iwlwifi: mvm: delay enabling smart FIFO until after beacon RX
Chen Yucong <[email protected]>
hwpoison, hugetlb: lock_page/unlock_page does not match for handling a free hugepage
Mark Salter <[email protected]>
arm64: fix pud_huge() for 2-level pagetables
Anthony Iliopoulos <[email protected]>
x86, mm, hugetlb: Add missing TLB page invalidation for hugetlb_cow()
Heiko Stuebner <[email protected]>
drivers/rtc/rtc-hym8563.c: set uie_unsupported
Kirill A. Shutemov <[email protected]>
mm, thp: close race between mremap() and split_huge_page()
Johannes Berg <[email protected]>
mac80211: fix on-channel remain-on-channel
Emmanuel Grumbach <[email protected]>
mac80211: fix suspend vs. association race
Eliad Peller <[email protected]>
mac80211: fix nested rtnl locking on ieee80211_reconfig
Eliad Peller <[email protected]>
cfg80211: add cfg80211_sched_scan_stopped_rtnl
Eliad Peller <[email protected]>
cfg80211: free sme on connection failures
Ilan Peer <[email protected]>
cfg80211: fix few minor issues in reg_process_hint()
Corey Minyard <[email protected]>
ipmi: Reset the KCS timeout when starting error recovery
Bodo Stroesser <[email protected]>
ipmi: Fix a race restarting the timer
Jiri Bohac <[email protected]>
timer: Prevent overflow in apply_slack
Stephen Warren <[email protected]>
gpu: host1x: handle the correct # of syncpt regs
Emmanuel Grumbach <[email protected]>
iwlwifi: 7000: bump API to 9
Eyal Shapira <[email protected]>
iwlwifi: mvm: rs: reinit rs if no tx for a long time
Eyal Shapira <[email protected]>
iwlwifi: mvm: rs: fix and cleanup rs_get_rate_action
Eyal Shapira <[email protected]>
iwlwifi: mvm: avoid searching unnecessary columns
Eyal Shapira <[email protected]>
iwlwifi: mvm: rs: fallback to legacy Tx columns
Oren Givon <[email protected]>
iwlwifi: add new 7265 HW IDs
Eyal Shapira <[email protected]>
iwlwifi: mvm: rs: fix mimo delimiter in LQ cmd
Emmanuel Grumbach <[email protected]>
iwlwifi: add MODULE_FIRMWARE for 7265
Loic Poulain <[email protected]>
8250_core: Fix unwanted TX chars write
Loic Poulain <[email protected]>
serial: 8250: Fix thread unsafe __dma_tx_complete function
Linus Torvalds <[email protected]>
mm: make fixup_user_fault() check the vma access rights too
Vincent Stehlé <[email protected]>
topology: Fix compilation warning when not in SMP
Eric Dumazet <[email protected]>
coredump: fix va_list corruption
Bartlomiej Zolnierkiewicz <[email protected]>
pata_at91: fix ata_host_activate() failure handling
Tejun Heo <[email protected]>
kernfs: add back missing error check in kernfs_fop_mmap()
Krzysztof Kozlowski <[email protected]>
clocksource: Exynos_mct: Register clock event after request_irq()
Thomas Gleixner <[email protected]>
clocksource: Exynos_mct: Use irq_force_affinity() in cpu bringup
Thomas Gleixner <[email protected]>
genirq: Allow forcing cpu affinity of interrupts
Thomas Gleixner <[email protected]>
irqchip: Gic: Support forced affinity setting
Rob Herring <[email protected]>
of/irq: do irq resolution in platform_get_irq
Steven Rostedt (Red Hat) <[email protected]>
ftrace/module: Hardcode ftrace_module_init() call into load_module()
Thomas Gleixner <[email protected]>
rtmutex: Fix deadlock detector for real
Leif Lindholm <[email protected]>
mips: dts: Fix missing device_type="memory" property in memory nodes
Aaro Koskinen <[email protected]>
MIPS/loongson2_cpufreq: Fix CPU clock rate setting
Thomas Gleixner <[email protected]>
futex: Prevent attaching to kernel threads
Thomas Gleixner <[email protected]>
futex: Add another early deadlock detection check
-------------
Diffstat:
Documentation/devicetree/bindings/dma/ti-edma.txt | 4 +- Documentation/i2c/busses/i2c-i801 | 1 + Documentation/input/elantech.txt | 5 +- Documentation/ja_JP/HOWTO | 2 +- Documentation/ja_JP/stable_kernel_rules.txt | 6 +- Documentation/zh_CN/HOWTO | 2 +- Documentation/zh_CN/stable_kernel_rules.txt | 2 +- Makefile | 4 +- arch/arm/boot/dts/am33xx.dtsi | 2 +- arch/arm/boot/dts/armada-xp-db.dts | 2 +- arch/arm/boot/dts/armada-xp-gp.dts | 2 +- arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts | 2 +- arch/arm/boot/dts/imx53.dtsi | 2 +- arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts | 18 +- arch/arm/boot/dts/kirkwood-nsa310-common.dtsi | 18 +- arch/arm/boot/dts/ste-ccu8540.dts | 1 + arch/arm/common/edma.c | 48 +-- arch/arm/kernel/crash_dump.c | 2 +- arch/arm/mach-mvebu/mvebu-soc-id.c | 13 +- arch/arm/mach-orion5x/common.h | 2 +- arch/arm64/mm/hugetlbpage.c | 4 + arch/metag/include/asm/barrier.h | 3 + arch/metag/include/asm/processor.h | 2 + arch/mips/cavium-octeon/octeon-irq.c | 2 +- arch/mips/lantiq/dts/easy50712.dts | 1 + arch/mips/loongson/lemote-2f/clock.c | 5 +- arch/mips/ralink/dts/mt7620a_eval.dts | 1 + arch/mips/ralink/dts/rt2880_eval.dts | 1 + arch/mips/ralink/dts/rt3052_eval.dts | 1 + arch/mips/ralink/dts/rt3883_eval.dts | 1 + arch/parisc/Kconfig | 1 + arch/parisc/include/asm/processor.h | 2 + arch/parisc/kernel/syscall.S | 12 +- arch/parisc/kernel/traps.c | 54 ++-- arch/parisc/mm/fault.c | 44 ++- arch/powerpc/Makefile | 4 +- arch/powerpc/include/asm/ppc_asm.h | 7 +- arch/powerpc/kernel/machine_kexec_64.c | 2 +- arch/powerpc/kernel/time.c | 3 - arch/powerpc/platforms/powernv/eeh-ioda.c | 3 +- arch/s390/crypto/aes_s390.c | 3 + arch/s390/crypto/des_s390.c | 3 + arch/x86/include/asm/hugetlb.h | 1 + arch/x86/kernel/ldt.c | 4 +- arch/x86/vdso/vdso32-setup.c | 8 + crypto/crypto_wq.c | 2 +- drivers/acpi/Kconfig | 17 ++ drivers/acpi/Makefile | 1 + drivers/acpi/ac.c | 117 ++++---- drivers/acpi/acpi_platform.c | 1 - drivers/acpi/acpi_processor.c | 1 - drivers/acpi/acpica/acglobal.h | 4 +- drivers/acpi/acpica/tbutils.c | 7 +- drivers/acpi/battery.c | 329 ++++++++++++++++++++- drivers/acpi/blacklist.c | 21 ++ drivers/acpi/cm_sbs.c | 105 +++++++ drivers/acpi/ec.c | 21 +- drivers/acpi/video.c | 16 +- drivers/ata/libata-core.c | 9 + drivers/ata/pata_at91.c | 11 +- drivers/base/dd.c | 17 ++ drivers/base/platform.c | 7 +- drivers/base/topology.c | 3 +- drivers/bluetooth/ath3k.c | 2 + drivers/bluetooth/btusb.c | 5 +- drivers/bus/mvebu-mbus.c | 6 - drivers/char/ipmi/ipmi_kcs_sm.c | 5 +- drivers/char/ipmi/ipmi_si_intf.c | 46 +-- drivers/char/tpm/tpm_ppi.c | 8 +- drivers/clk/clk.c | 74 ++--- drivers/clk/tegra/clk-pll.c | 2 +- drivers/clk/versatile/clk-vexpress-osc.c | 2 +- drivers/clocksource/exynos_mct.c | 12 +- drivers/cpufreq/intel_pstate.c | 34 +-- drivers/cpufreq/loongson2_cpufreq.c | 4 +- drivers/crypto/caam/error.c | 10 +- drivers/dma/dmaengine.c | 2 + drivers/dma/dw/core.c | 11 +- drivers/dma/mv_xor.c | 8 +- drivers/gpu/drm/i915/i915_drv.c | 90 +++++- drivers/gpu/drm/i915/i915_gem.c | 4 +- drivers/gpu/drm/i915/i915_irq.c | 18 +- drivers/gpu/drm/i915/intel_display.c | 52 ++-- drivers/gpu/drm/i915/intel_drv.h | 3 +- drivers/gpu/drm/i915/intel_hdmi.c | 9 +- drivers/gpu/drm/i915/intel_panel.c | 8 +- drivers/gpu/drm/i915/intel_pm.c | 10 + drivers/gpu/drm/i915/intel_uncore.c | 2 + drivers/gpu/drm/nouveau/core/subdev/therm/fan.c | 19 +- drivers/gpu/drm/nouveau/nouveau_acpi.c | 3 - drivers/gpu/drm/nouveau/nouveau_display.c | 2 +- drivers/gpu/drm/radeon/ci_dpm.c | 8 + drivers/gpu/drm/radeon/cik.c | 104 ++++++- drivers/gpu/drm/radeon/cik_sdma.c | 2 +- drivers/gpu/drm/radeon/cikd.h | 9 + drivers/gpu/drm/radeon/dce6_afmt.c | 14 +- drivers/gpu/drm/radeon/evergreen.c | 28 +- drivers/gpu/drm/radeon/r600.c | 13 +- drivers/gpu/drm/radeon/r600_dpm.c | 35 ++- drivers/gpu/drm/radeon/radeon.h | 12 +- drivers/gpu/drm/radeon/radeon_atpx_handler.c | 9 +- drivers/gpu/drm/radeon/radeon_device.c | 19 +- drivers/gpu/drm/radeon/radeon_display.c | 4 + drivers/gpu/drm/radeon/radeon_drv.c | 24 +- drivers/gpu/drm/radeon/radeon_family.h | 1 + drivers/gpu/drm/radeon/radeon_kms.c | 12 +- drivers/gpu/drm/radeon/radeon_pm.c | 51 ++-- drivers/gpu/drm/radeon/radeon_ucode.h | 7 +- drivers/gpu/drm/radeon/radeon_uvd.c | 4 + drivers/gpu/drm/radeon/si.c | 65 ++-- drivers/gpu/drm/radeon/uvd_v1_0.c | 10 +- drivers/gpu/host1x/hw/intr_hw.c | 4 +- drivers/hwmon/coretemp.c | 4 +- drivers/hwmon/emc1403.c | 10 +- drivers/i2c/busses/Kconfig | 1 + drivers/i2c/busses/i2c-designware-core.c | 3 + drivers/i2c/busses/i2c-i801.c | 3 + drivers/i2c/busses/i2c-rcar.c | 9 +- drivers/i2c/busses/i2c-s3c2410.c | 2 +- drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 7 +- drivers/infiniband/ulp/isert/ib_isert.c | 27 +- drivers/infiniband/ulp/isert/ib_isert.h | 2 +- drivers/input/keyboard/atkbd.c | 29 +- drivers/input/mouse/elantech.c | 26 +- drivers/input/mouse/elantech.h | 1 + drivers/input/mouse/synaptics.c | 195 ++++++------ drivers/input/serio/i8042-x86ia64io.h | 15 + drivers/input/serio/i8042.c | 6 + drivers/input/serio/serio.c | 14 + drivers/iommu/amd_iommu.c | 2 +- drivers/irqchip/irq-armada-370-xp.c | 17 +- drivers/irqchip/irq-gic.c | 8 +- drivers/leds/leds-pwm.c | 23 +- drivers/md/dm-cache-target.c | 1 + drivers/md/dm-crypt.c | 61 +--- drivers/md/dm-thin.c | 23 +- drivers/md/dm-verity.c | 15 +- drivers/md/md.c | 3 +- drivers/md/raid10.c | 13 +- drivers/media/i2c/ov7670.c | 2 +- drivers/media/media-device.c | 1 + drivers/media/tuners/fc2580.c | 6 +- drivers/media/tuners/fc2580_priv.h | 1 + drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 12 +- drivers/memory/mvebu-devbus.c | 15 +- drivers/net/ethernet/intel/e1000e/netdev.c | 20 +- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 +- drivers/net/ethernet/intel/igb/igb_main.c | 7 + .../net/wireless/brcm80211/brcmsmac/mac80211_if.c | 14 +- drivers/net/wireless/iwlwifi/iwl-7000.c | 5 +- drivers/net/wireless/iwlwifi/mvm/bt-coex.c | 12 +- drivers/net/wireless/iwlwifi/mvm/mac80211.c | 7 +- drivers/net/wireless/iwlwifi/mvm/rs.c | 219 ++++++++------ drivers/net/wireless/iwlwifi/mvm/rs.h | 2 + drivers/net/wireless/iwlwifi/mvm/sf.c | 3 +- drivers/net/wireless/iwlwifi/pcie/drv.c | 2 + drivers/net/wireless/iwlwifi/pcie/trans.c | 10 +- drivers/net/wireless/rt2x00/rt2x00mac.c | 22 +- drivers/net/wireless/rtlwifi/rtl8192cu/hw.c | 2 +- drivers/of/irq.c | 26 ++ drivers/of/platform.c | 4 +- drivers/pci/host/pci-mvebu.c | 92 +++++- drivers/pci/hotplug/shpchp_ctrl.c | 4 +- drivers/pci/pci.c | 5 +- drivers/pnp/pnpacpi/core.c | 44 +-- drivers/rtc/rtc-hym8563.c | 3 + drivers/spi/spi.c | 11 +- drivers/target/iscsi/iscsi_target.c | 4 +- drivers/target/target_core_device.c | 12 +- drivers/target/target_core_transport.c | 2 +- drivers/target/tcm_fc/tfc_cmd.c | 8 +- drivers/tty/serial/8250/8250_core.c | 2 +- drivers/tty/serial/8250/8250_dma.c | 9 +- drivers/usb/gadget/at91_udc.c | 10 - drivers/usb/host/ehci-fsl.c | 3 +- drivers/usb/host/ohci-hub.c | 18 ++ drivers/usb/host/ohci-pci.c | 1 + drivers/usb/host/ohci.h | 2 + drivers/usb/serial/qcserial.c | 15 + drivers/usb/storage/shuttle_usbat.c | 2 +- drivers/usb/storage/unusual_devs.h | 14 + fs/affs/super.c | 2 - fs/aio.c | 6 +- fs/autofs4/root.c | 4 +- fs/ceph/dir.c | 9 +- fs/ceph/inode.c | 71 +---- fs/ceph/super.h | 1 - fs/coredump.c | 7 +- fs/dcache.c | 3 +- fs/exec.c | 6 +- fs/kernfs/file.c | 2 + fs/namei.c | 6 +- fs/nfsd/nfs4acl.c | 17 +- fs/nfsd/nfs4state.c | 40 ++- fs/posix_acl.c | 6 + fs/sysfs/file.c | 3 +- include/linux/dmaengine.h | 1 + include/linux/ftrace.h | 2 + include/linux/interrupt.h | 40 ++- include/linux/irq.h | 3 +- include/linux/of_irq.h | 5 + include/linux/serio.h | 1 + include/net/cfg80211.h | 12 + include/trace/events/module.h | 2 +- include/uapi/drm/tegra_drm.h | 1 - include/uapi/linux/input.h | 1 + kernel/futex.c | 52 +++- kernel/hrtimer.c | 30 +- kernel/irq/manage.c | 17 +- kernel/kexec.c | 8 + kernel/locking/rtmutex.c | 32 +- kernel/module.c | 6 +- kernel/timer.c | 2 +- kernel/trace/ftrace.c | 27 +- kernel/workqueue.c | 36 ++- mm/compaction.c | 22 +- mm/memory-failure.c | 15 +- mm/memory.c | 5 + mm/mremap.c | 9 +- mm/page-writeback.c | 6 +- mm/percpu.c | 2 +- mm/vmscan.c | 18 ++ net/bluetooth/hci_conn.c | 9 +- net/bluetooth/hci_event.c | 6 + net/ceph/messenger.c | 20 +- net/mac80211/ieee80211_i.h | 1 + net/mac80211/mlme.c | 20 +- net/mac80211/offchannel.c | 27 +- net/mac80211/util.c | 2 +- net/wireless/reg.c | 19 +- net/wireless/scan.c | 12 +- net/wireless/sme.c | 2 +- security/device_cgroup.c | 203 ++++++++++--- sound/pci/hda/hda_intel.c | 3 + sound/pci/hda/patch_hdmi.c | 4 +- sound/soc/codecs/wm8962.c | 15 +- sound/soc/codecs/wm8962.h | 4 + sound/soc/soc-dapm.c | 7 +- sound/usb/card.h | 1 + sound/usb/endpoint.c | 15 +- 240 files changed, 2763 insertions(+), 1205 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/228 futex: Add another early deadlock detection check
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
commit 866293ee54227584ffcb4a42f69c1f365974ba7f upstream.
Dave Jones trinity syscall fuzzer exposed an issue in the deadlock detection code of rtmutex:
http://lkml.kernel.org/r/[email protected]
That underlying issue has been fixed with a patch to the rtmutex code, but the futex code must not call into rtmutex in that case because
- it can detect that issue early
- it avoids a different and more complex fixup for backing out
If the user space variable got manipulated to 0x80000000 which means no lock holder, but the waiters bit set and an active pi_state in the kernel is found we can figure out the recursive locking issue by looking at the pi_state owner. If that is the current task, then we can safely return -EDEADLK.
The check should have been added in commit 59fa62451 (futex: Handle futex_pi OWNER_DIED take over correctly) already, but I did not see the above issue caused by user space manipulation back then.
--- kernel/futex.c | 47 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 13 deletions(-)
kernel/futex.c +34 -13
@@ -731,7 +731,8 @@ void exit_pi_state_list(struct task_strustatic int lookup_pi_state (u32 uval,struct futex_hash_bucket *hb, -union futex_key *key,struct futex_pi_state **ps) +union futex_key *key,struct futex_pi_state **ps, +struct task_struct *task) {struct futex_pi_state *pi_state =NULL ;struct futex_q *this, *next;
@@ -772,6 +773,16 @@ lookup_pi_state(u32 uval, struct futex_hreturn -EINVAL ; } +/* +* Protect against a corrupted uval. If uval +* is 0x80000000 then pid is 0 and the waiter +* bit is set. So the deadlock check in the +* calling code has failed and we did not fall +* into the check above due to !pid. +*/ +if (task && pi_state->owner == task) +return -EDEADLK ; +atomic_inc (&pi_state->refcount); *ps = pi_state;
@@ -921,7 +932,7 @@ retry:* We dont have the lock. Look up the PI state (or create it if * we are the first waiter): */ - ret =lookup_pi_state (uval, hb, key, ps); + ret =lookup_pi_state (uval, hb, key, ps, task);if (unlikely (ret)) {switch (ret) {
@@ -1333,7 +1344,7 @@ void requeue_pi_wake_futex(struct futex_* * Return: * 0 - failed to acquire the lock atomically; -* 1 - acquired the lock; +* >0 - acquired the lock, return value is vpid of the top_waiter * <0 - error */ static int futex_proxy_trylock_atomic(u32 __user *pifutex,
@@ -1344,7 +1355,7 @@ static int futex_proxy_trylock_atomic(u3 {struct futex_q *top_waiter =NULL ;u32 curval; -int ret; +int ret, vpid;if (get_futex_value_locked (&curval, pifutex))return -EFAULT ;
@@ -1372,11 +1383,13 @@ static int futex_proxy_trylock_atomic(u3* the contended case or if set_waiters is 1. The pi_state is returned * in ps in contended cases. */ + vpid =task_pid_vnr (top_waiter->task); ret =futex_lock_pi_atomic (pifutex, hb2, key2, ps, top_waiter->task, set_waiters); -if (ret ==1 ) +if (ret ==1 ) {requeue_pi_wake_futex (top_waiter, key2, hb2); - +return vpid; + }return ret; }
@@ -1407,7 +1420,6 @@ static int futex_requeue(u32 __user *uadstruct futex_pi_state *pi_state =NULL ;struct futex_hash_bucket *hb1, *hb2;struct futex_q *this, *next; -u32 curval2;if (requeue_pi) {/*
@@ -1495,16 +1507,25 @@ retry_private:* At this point the top_waiter has either taken uaddr2 or is * waiting on it. If the former, then the pi_state will not * exist yet, look it up one more time to ensure we have a -* reference to it. +* reference to it. If the lock was taken, ret contains the +* vpid of the top waiter task. */ -if (ret ==1 ) { +if (ret >0 ) {WARN_ON (pi_state); drop_count++; task_count++; - ret =get_futex_value_locked (&curval2, uaddr2); -if (!ret) - ret =lookup_pi_state (curval2, hb2, &key2, - &pi_state); +/* +* If we acquired the lock, then the user +* space value of uaddr2 should be vpid. It +* cannot be changed by the top waiter as it +* is blocked on hb2 lock if it tries to do +* so. If something fiddled with it behind our +* back the pi state lookup might unearth +* it. So we rather use the known value than +* rereading and handing potential crap to +* lookup_pi_state. +*/ + ret =lookup_pi_state (ret, hb2, &key2, &pi_state,NULL ); }switch (ret) {
Greg Kroah-Hartman
maintainerPATCH 2/228 futex: Prevent attaching to kernel threads
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
commit f0d71b3dcb8332f7971b5f2363632573e6d9486a upstream.
We happily allow userspace to declare a random kernel thread to be the owner of a user space PI futex.
Found while analysing the fallout of Dave Jones syscall fuzzer.
We also should validate the thread group for private futexes and find some fast way to validate whether the "alleged" owner has RW access on the file which backs the SHM, but that's a separate issue.
--- kernel/futex.c | 5 +++++ 1 file changed, 5 insertions(+)
kernel/futex.c +5 -0
@@ -800,6 +800,11 @@ lookup_pi_state(u32 uval, struct futex_hif (!p)return -ESRCH ; +if (!p->mm) { +put_task_struct (p); +return -EPERM ; + } +/* * We need to look at the task state flags to figure out, * whether the task is exiting. To protect against the do_exit
Greg Kroah-Hartman
maintainerPATCH 3/228 MIPS/loongson2_cpufreq: Fix CPU clock rate setting
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aaro Koskinen <[email protected]>
commit 8e8acb32960f42c81b1d50deac56a2c07bb6a18a upstream.
Loongson2 has been using (incorrectly) kHz for cpu_clk rate. This has been unnoticed, as loongson2_cpufreq was the only place where the rate was set/get. After commit 652ed95d5fa6074b3c4ea245deb0691f1acb6656 (cpufreq: introduce cpufreq_generic_get() routine) things however broke, and now loops_per_jiffy adjustments are incorrect (1000 times too long). The patch fixes this by changing cpu_clk rate to Hz.
Patchwork: https://patchwork.linux-mips.org/patch/6678/
--- arch/mips/loongson/lemote-2f/clock.c | 5 +++-- drivers/cpufreq/loongson2_cpufreq.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-)
arch/mips/loongson/lemote-2f/clock.c +3 -2
@@ -91,6 +91,7 @@ EXPORT_SYMBOL(clk_put);int clk_set_rate (struct clk *clk,unsigned long rate) { +unsigned int rate_khz = rate /1000 ;int ret =0 ;int regval;int i;
@@ -111,10 +112,10 @@ int clk_set_rate(struct clk *clk, unsignif (loongson2_clockmod_table[i].frequency ==CPUFREQ_ENTRY_INVALID )continue ; -if (rate == loongson2_clockmod_table[i].frequency) +if (rate_khz == loongson2_clockmod_table[i].frequency)break ; } -if (rate != loongson2_clockmod_table[i].frequency) +if (rate_khz != loongson2_clockmod_table[i].frequency)return -ENOTSUPP ; clk->rate = rate;
drivers/cpufreq/loongson2_cpufreq.c +2 -2
@@ -62,7 +62,7 @@ static int loongson2_cpufreq_target(struset_cpus_allowed_ptr (current, &cpus_allowed);/* setting the cpu frequency */ -clk_set_rate (policy->clk, freq); +clk_set_rate (policy->clk, freq *1000 );return 0 ; }
@@ -92,7 +92,7 @@ static int loongson2_cpufreq_cpu_init(st i++) loongson2_clockmod_table[i].frequency = (rate * i) /8 ; - ret =clk_set_rate (cpuclk, rate); + ret =clk_set_rate (cpuclk, rate *1000 );if (ret) {clk_put (cpuclk);return ret;
Greg Kroah-Hartman
maintainerPATCH 4/228 mips: dts: Fix missing device_type="memory" property in memory nodes
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leif Lindholm <[email protected]>
commit dfc44f8030653b345fc6fb337558c3a07536823f upstream.
A few platforms lack a 'device_type = "memory"' for their memory nodes, relying on an old ppc quirk in order to discover its memory. Add the missing data so that all parsing code can find memory nodes correctly.
--- arch/mips/lantiq/dts/easy50712.dts | 1 + arch/mips/ralink/dts/mt7620a_eval.dts | 1 + arch/mips/ralink/dts/rt2880_eval.dts | 1 + arch/mips/ralink/dts/rt3052_eval.dts | 1 + arch/mips/ralink/dts/rt3883_eval.dts | 1 + 5 files changed, 5 insertions(+)
arch/mips/lantiq/dts/easy50712.dts +1 -0
@@ -8,6 +8,7 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x2000000>; };
arch/mips/ralink/dts/mt7620a_eval.dts +1 -0
@@ -7,6 +7,7 @@ model = "Ralink MT7620A evaluation board"; memory@0 { + device_type = "memory"; reg = <0x0 0x2000000>; };
arch/mips/ralink/dts/rt2880_eval.dts +1 -0
@@ -7,6 +7,7 @@ model = "Ralink RT2880 evaluation board"; memory@0 { + device_type = "memory"; reg = <0x8000000 0x2000000>; };
arch/mips/ralink/dts/rt3052_eval.dts +1 -0
@@ -7,6 +7,7 @@ model = "Ralink RT3052 evaluation board"; memory@0 { + device_type = "memory"; reg = <0x0 0x2000000>; };
arch/mips/ralink/dts/rt3883_eval.dts +1 -0
@@ -7,6 +7,7 @@ model = "Ralink RT3883 evaluation board"; memory@0 { + device_type = "memory"; reg = <0x0 0x2000000>; };
Greg Kroah-Hartman
maintainerPATCH 5/228 rtmutex: Fix deadlock detector for real
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
commit 397335f004f41e5fcf7a795e94eb3ab83411a17c upstream.
The current deadlock detection logic does not work reliably due to the following early exit path:
/* * Drop out, when the task has no waiters. Note, * top_waiter can be NULL, when we are in the deboosting * mode! */ if (top_waiter && (!task_has_pi_waiters(task) || top_waiter != task_top_pi_waiter(task))) goto out_unlock_pi;
So this not only exits when the task has no waiters, it also exits unconditionally when the current waiter is not the top priority waiter of the task.
So in a nested locking scenario, it might abort the lock chain walk and therefor miss a potential deadlock.
Simple fix: Continue the chain walk, when deadlock detection is enabled.
We also avoid the whole enqueue, if we detect the deadlock right away (A-A). It's an optimization, but also prevents that another waiter who comes in after the detection and before the task has undone the damage observes the situation and detects the deadlock and returns -EDEADLOCK, which is wrong as the other task is not in a deadlock situation.
--- kernel/locking/rtmutex.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-)
kernel/locking/rtmutex.c +28 -4
@@ -331,9 +331,16 @@ static int rt_mutex_adjust_prio_chain(st* top_waiter can be NULL, when we are in the deboosting * mode! */ -if (top_waiter && (!task_has_pi_waiters (task) || - top_waiter !=task_top_pi_waiter (task))) - goto out_unlock_pi; +if (top_waiter) { +if (!task_has_pi_waiters (task)) + goto out_unlock_pi; +/* +* If deadlock detection is off, we stop here if we +* are not the top pi waiter of the task. +*/ +if (!detect_deadlock && top_waiter !=task_top_pi_waiter (task)) + goto out_unlock_pi; + }/* * When deadlock detection is off then we check, if further
@@ -349,7 +356,12 @@ static int rt_mutex_adjust_prio_chain(st goto retry; } -/* Deadlock detection */ +/* +* Deadlock detection. If the lock is the same as the original +* lock which caused us to walk the lock chain or if the +* current lock is owned by the task which initiated the chain +* walk, we detected a deadlock. +*/ if (lock == orig_lock ||rt_mutex_owner (lock) == top_task) {debug_rt_mutex_deadlock (deadlock_detect, orig_waiter, lock);raw_spin_unlock (&lock->wait_lock);
@@ -515,6 +527,18 @@ static int task_blocks_on_rt_mutex(strucunsigned long flags;int chain_walk =0 , res; +/* +* Early deadlock detection. We really don't want the task to +* enqueue on itself just to untangle the mess later. It's not +* only an optimization. We drop the locks, so another waiter +* can come in before the chain walk detects the deadlock. So +* the other will detect the deadlock and return -EDEADLOCK, +* which is wrong, as the other waiter is not in a deadlock +* situation. +*/ +if (detect_deadlock && owner == task) +return -EDEADLK ; +raw_spin_lock_irqsave (&task->pi_lock, flags);__rt_mutex_adjust_prio (task); waiter->task = task;
Greg Kroah-Hartman
maintainerPATCH 6/228 ftrace/module: Hardcode ftrace_module_init() call into load_module()
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Steven Rostedt (Red Hat)" <[email protected]>
commit a949ae560a511fe4e3adf48fa44fefded93e5c2b upstream.
A race exists between module loading and enabling of function tracer.
CPU 1 CPU 2 ----- -----
load_module()
module->state = MODULE_STATE_COMING
register_ftrace_function() mutex_lock(&ftrace_lock); ftrace_startup() update_ftrace_function(); ftrace_arch_code_modify_prepare() set_all_module_text_rw(); <enables-ftrace> ftrace_arch_code_modify_post_process() set_all_module_text_ro(); [ here all module text is set to RO, including the module that is loading!! ]
blocking_notifier_call_chain(MODULE_STATE_COMING);
ftrace_init_module() [ tries to modify code, but it's RO, and fails!
ftrace_bug() is called]
When this race happens, ftrace_bug() will produces a nasty warning and all of the function tracing features will be disabled until reboot.
The simple solution is to treate module load the same way the core kernel is treated at boot. To hardcode the ftrace function modification of converting calls to mcount into nops. This is done in init/main.c there's no reason it could not be done in load_module(). This gives a better control of the changes and doesn't tie the state of the module to its notifiers as much. Ftrace is special, it needs to be treated as such.
The reason this would work, is that the ftrace_module_init() would be called while the module is in MODULE_STATE_UNFORMED, which is ignored by the set_all_module_text_ro() call.
--- include/linux/ftrace.h | 2 ++ kernel/module.c | 3 +++ kernel/trace/ftrace.c | 27 ++++----------------------- 3 files changed, 9 insertions(+), 23 deletions(-)
include/linux/ftrace.h +2 -0
@@ -524,6 +524,7 @@ static inline int ftrace_modify_call(strextern int ftrace_arch_read_dyn_info (char *buf,int size);extern int skip_trace (unsigned long ip); +extern void ftrace_module_init (struct module *mod);extern void ftrace_disable_daemon (void );extern void ftrace_enable_daemon (void );
@@ -533,6 +534,7 @@ static inline int ftrace_force_update(vostatic inline void ftrace_disable_daemon (void ) { }static inline void ftrace_enable_daemon (void ) { }static inline void ftrace_release_mod (struct module *mod) {} +static inline void ftrace_module_init (struct module *mod) {}static inline __init int register_ftrace_command (struct ftrace_func_command *cmd) {return -EINVAL ;
kernel/module.c +3 -0
@@ -3265,6 +3265,9 @@ static int load_module(struct load_infodynamic_debug_setup (info->debug, info->num_debug); +/* Ftrace init must be called in the MODULE_STATE_UNFORMED state */ +ftrace_module_init (mod); +/* Finally it's fully formed, ready to start executing. */ err =complete_formation (mod, info);if (err)
kernel/trace/ftrace.c +4 -23
@@ -4315,16 +4315,11 @@ static void ftrace_init_module(struct moftrace_process_locs (mod, start, end); } -static int ftrace_module_notify_enter (struct notifier_block *self, -unsigned long val,void *data) +void ftrace_module_init (struct module *mod) { -struct module *mod = data; - -if (val ==MODULE_STATE_COMING ) -ftrace_init_module (mod, mod->ftrace_callsites, - mod->ftrace_callsites + - mod->num_ftrace_callsites); -return 0 ; +ftrace_init_module (mod, mod->ftrace_callsites, + mod->ftrace_callsites + + mod->num_ftrace_callsites); } static int ftrace_module_notify_exit(struct notifier_block *self,
@@ -4338,11 +4333,6 @@ static int ftrace_module_notify_exit(str return 0; }#else -static int ftrace_module_notify_enter (struct notifier_block *self, -unsigned long val,void *data) -{ -return 0 ; -}static int ftrace_module_notify_exit (struct notifier_block *self,unsigned long val,void *data) {
@@ -4350,11 +4340,6 @@ static int ftrace_module_notify_exit(str }#endif /* CONFIG_MODULES */ -struct notifier_block ftrace_module_enter_nb = { - .notifier_call = ftrace_module_notify_enter, - .priority =INT_MAX ,/* Run before anything that can use kprobes */ -}; -struct notifier_block ftrace_module_exit_nb = { .notifier_call = ftrace_module_notify_exit, .priority =INT_MIN ,/* Run after anything that can remove kprobes */
@@ -4391,10 +4376,6 @@ void __init ftrace_init(void) __start_mcount_loc, __stop_mcount_loc); - ret =register_module_notifier (&ftrace_module_enter_nb); -if (ret) -pr_warning ("Failed to register trace ftrace module enter notifier\n" ); - ret =register_module_notifier (&ftrace_module_exit_nb);if (ret)pr_warning ("Failed to register trace ftrace module exit notifier\n" );
Greg Kroah-Hartman
maintainerPATCH 7/228 of/irq: do irq resolution in platform_get_irq
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rob Herring <[email protected]>
commit 9ec36cafe43bf835f8f29273597a5b0cbc8267ef upstream.
Currently we get the following kind of errors if we try to use interrupt phandles to irqchips that have not yet initialized:
irq: no irq domain found for /ocp/pinmux@48002030 !
------------[ cut here ]------------ WARNING: CPU: 0 PID: 1 at drivers/of/platform.c:171 of_device_alloc+0x144/0x184() Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.12.0-00038-g42a9708 #1012 (show_stack+0x14/0x1c) (dump_stack+0x6c/0xa0) (warn_slowpath_common+0x64/0x84) (warn_slowpath_null+0x1c/0x24) (of_device_alloc+0x144/0x184) (of_platform_device_create_pdata+0x44/0x9c) (of_platform_bus_create+0xd0/0x170) (of_platform_bus_create+0x12c/0x170) (of_platform_populate+0x60/0x98)
This is because we're wrongly trying to populate resources that are not yet available. It's perfectly valid to create irqchips dynamically, so let's fix up the issue by resolving the interrupt resources when platform_get_irq is called.
And then we also need to accept the fact that some irqdomains do not exist that early on, and only get initialized later on. So we can make the current WARN_ON into just into a pr_debug().
We still attempt to populate irq resources when we create the devices. This allows current drivers which don't use platform_get_irq to continue to function. Once all drivers are fixed, this code can be removed.
--- drivers/base/platform.c | 7 ++++++- drivers/of/irq.c | 26 ++++++++++++++++++++++++++ drivers/of/platform.c | 4 +++- include/linux/of_irq.h | 5 +++++ 4 files changed, 40 insertions(+), 2 deletions(-)
drivers/base/platform.c +6 -1
@@ -13,6 +13,7 @@#include <linux/string.h> #include <linux/platform_device.h> #include <linux/of_device.h> +#include <linux/of_irq.h> #include <linux/module.h> #include <linux/init.h> #include <linux/dma-mapping.h>
@@ -87,7 +88,11 @@ int platform_get_irq(struct platform_devreturn -ENXIO ;return dev->archdata.irqs[num];#else -struct resource *r =platform_get_resource (dev,IORESOURCE_IRQ , num); +struct resource *r; +if (IS_ENABLED (CONFIG_OF_IRQ ) && dev->dev.of_node) +return of_irq_get (dev->dev.of_node, num); + + r =platform_get_resource (dev,IORESOURCE_IRQ , num);return r ? r->start : -ENXIO ;#endif
drivers/of/irq.c +26 -0
@@ -380,6 +380,32 @@ int of_irq_to_resource(struct device_nodEXPORT_SYMBOL_GPL (of_irq_to_resource);/** +* of_irq_get - Decode a node's IRQ and return it as a Linux irq number +* @dev: pointer to device tree node +* @index: zero-based index of the irq +* +* Returns Linux irq number on success, or -EPROBE_DEFER if the irq domain +* is not yet created. +* +*/ +int of_irq_get (struct device_node *dev,int index) +{ +int rc; +struct of_phandle_args oirq; +struct irq_domain *domain; + + rc =of_irq_parse_one (dev, index, &oirq); +if (rc) +return rc; + + domain =irq_find_host (oirq.np); +if (!domain) +return -EPROBE_DEFER ; + +return irq_create_of_mapping (&oirq); +} + +/** * of_irq_count - Count the number of IRQs a node uses * @dev: pointer to device tree node */
drivers/of/platform.c +3 -1
@@ -168,7 +168,9 @@ struct platform_device *of_device_alloc( rc =of_address_to_resource (np, i, res);WARN_ON (rc); } -WARN_ON (of_irq_to_resource_table (np, res, num_irq) != num_irq); +if (of_irq_to_resource_table (np, res, num_irq) != num_irq) +pr_debug ("not all legacy IRQ resources mapped for %s\n" , + np->name); } dev->dev.of_node =of_node_get (np);
include/linux/of_irq.h +5 -0
@@ -44,11 +44,16 @@ extern void of_irq_init(const struct of_#ifdef CONFIG_OF_IRQ extern int of_irq_count (struct device_node *dev); +extern int of_irq_get (struct device_node *dev,int index);#else static inline int of_irq_count (struct device_node *dev) {return 0 ; } +static inline int of_irq_get (struct device_node *dev,int index) +{ +return 0 ; +}#endif #if defined(CONFIG_OF )
Greg Kroah-Hartman
maintainerPATCH 8/228 irqchip: Gic: Support forced affinity setting
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
commit ffde1de64012c406dfdda8690918248b472f24e4 upstream.
To support the affinity setting of per cpu timers in the early startup of a not yet online cpu, implement the force logic, which disables the cpu online check.
Tagged for stable to allow a simple fix of the affected SoC clock event drivers.
--- drivers/irqchip/irq-gic.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/irqchip/irq-gic.c +6 -2
@@ -246,10 +246,14 @@ static int gic_set_affinity(struct irq_d bool force) {void __iomem *reg =gic_dist_base (d) +GIC_DIST_TARGET + (gic_irq (d) & ~3 ); -unsigned int shift = (gic_irq (d) %4 ) *8 ; -unsigned int cpu =cpumask_any_and (mask_val, cpu_online_mask); +unsigned int cpu, shift = (gic_irq (d) %4 ) *8 ;u32 val, mask, bit; +if (!force) + cpu =cpumask_any_and (mask_val, cpu_online_mask); +else + cpu =cpumask_first (mask_val); +if (cpu >=NR_GIC_CPU_IF || cpu >= nr_cpu_ids)return -EINVAL ;
Re: [PATCH 3.14 008/228] irqchip: Gic: Support forced affinity setting
Hi Greg,
Quoted 6 lines · Greg Kroah-Hartman
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
Quoted 8 lines
commit
ffde1de64012c406dfdda8690918248b472f24e4upstream.To support the affinity setting of per cpu timers in the early startup of a not yet online cpu, implement the force logic, which disables the cpu online check.
Tagged for stable to allow a simple fix of the affected SoC clock event drivers.
The problems I mentioned on the 3.10 patch [1] apply here too.
Mark.
[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2014-June/262158.html
Quoted 45 lines
Signed-off-by Thomas Gleixner <[email protected]>Tested-by Krzysztof Kozlowski <[email protected]>Cc Kyungmin Park <[email protected]>Cc Marek Szyprowski <[email protected]>Cc Bartlomiej Zolnierkiewicz <[email protected]>Cc Tomasz Figa <[email protected]>,Cc Daniel Lezcano <[email protected]>,Cc Kukjin Kim <[email protected]>Cc linux-arm-kernel at lists.infradead.org,Link http://lkml.kernel.org/r/20140416143315.916984416 at linutronix.deSigned-off-by Thomas Gleixner <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/irqchip/irq-gic.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/irqchip/irq-gic.c +6
-2@@ -246,10 +246,14 @@ static int gic_set_affinity(struct irq_d bool force) {void __iomem *reg =gic_dist_base (d) +GIC_DIST_TARGET + (gic_irq (d) & ~3 ); -unsigned int shift = (gic_irq (d) %4 ) *8 ; -unsigned int cpu =cpumask_any_and (mask_val, cpu_online_mask); +unsigned int cpu, shift = (gic_irq (d) %4 ) *8 ;u32 val, mask, bit; +if (!force) + cpu =cpumask_any_and (mask_val, cpu_online_mask); +else + cpu =cpumask_first (mask_val); +if (cpu >=NR_GIC_CPU_IF || cpu >= nr_cpu_ids)return -EINVAL ;_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Greg Kroah-Hartman
maintainerPATCH 9/228 genirq: Allow forcing cpu affinity of interrupts
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
commit 01f8fa4f01d8362358eb90e412bd7ae18a3ec1ad upstream.
The current implementation of irq_set_affinity() refuses rightfully to route an interrupt to an offline cpu.
But there is a special case, where this is actually desired. Some of the ARM SoCs have per cpu timers which require setting the affinity during cpu startup where the cpu is not yet in the online mask.
If we can't do that, then the local timer interrupt for the about to become online cpu is routed to some random online cpu.
The developers of the affected machines tried to work around that issue, but that results in a massive mess in that timer code.
We have a yet unused argument in the set_affinity callbacks of the irq chips, which I added back then for a similar reason. It was never required so it got not used. But I'm happy that I never removed it.
That allows us to implement a sane handling of the above scenario. So the affected SoC drivers can add the required force handling to their interrupt chip, switch the timer code to irq_force_affinity() and things just work.
This does not affect any existing user of irq_set_affinity().
Tagged for stable to allow a simple fix of the affected SoC clock event drivers.
--- arch/mips/cavium-octeon/octeon-irq.c | 2 +- include/linux/interrupt.h | 35 ++++++++++++++++++++++++++++++++++- include/linux/irq.h | 3 ++- kernel/irq/manage.c | 17 ++++++----------- 4 files changed, 43 insertions(+), 14 deletions(-)
arch/mips/cavium-octeon/octeon-irq.c +1 -1
@@ -635,7 +635,7 @@ static void octeon_irq_cpu_offline_ciu(scpumask_clear (&new_affinity);cpumask_set_cpu (cpumask_first (cpu_online_mask), &new_affinity); } -__irq_set_affinity_locked (data, &new_affinity); +irq_set_affinity_locked (data, &new_affinity, false); } static int octeon_irq_ciu_set_affinity(struct irq_data *data,
include/linux/interrupt.h +34 -1
@@ -202,7 +202,40 @@ static inline int check_wakeup_irqs(voidextern cpumask_var_t irq_default_affinity; -extern int irq_set_affinity (unsigned int irq,const struct cpumask *cpumask); +/* Internal implementation. Use the helpers below */ +extern int __irq_set_affinity (unsigned int irq,const struct cpumask *cpumask, +bool force); + +/** +* irq_set_affinity - Set the irq affinity of a given irq +* @irq: Interrupt to set affinity +* @mask: cpumask +* +* Fails if cpumask does not contain an online CPU +*/ +static inline int +irq_set_affinity (unsigned int irq,const struct cpumask *cpumask) +{ +return __irq_set_affinity (irq, cpumask, false); +} + +/** +* irq_force_affinity - Force the irq affinity of a given irq +* @irq: Interrupt to set affinity +* @mask: cpumask +* +* Same as irq_set_affinity, but without checking the mask against +* online cpus. +* +* Solely for low level cpu hotplug code, where we need to make per +* cpu interrupts affine before the cpu becomes online. +*/ +static inline int +irq_force_affinity (unsigned int irq,const struct cpumask *cpumask) +{ +return __irq_set_affinity (irq, cpumask, true); +} +extern int irq_can_set_affinity (unsigned int irq);extern int irq_select_affinity (unsigned int irq);
include/linux/irq.h +2 -1
@@ -385,7 +385,8 @@ extern void remove_percpu_irq(unsigned iextern void irq_cpu_online (void );extern void irq_cpu_offline (void ); -extern int __irq_set_affinity_locked (struct irq_data *data,const struct cpumask *cpumask); +extern int irq_set_affinity_locked (struct irq_data *data, +const struct cpumask *cpumask,bool force);#if defined(CONFIG_SMP ) && defined(CONFIG_GENERIC_PENDING_IRQ )void irq_move_irq (struct irq_data *data);
kernel/irq/manage.c +6 -11
@@ -150,7 +150,7 @@ int irq_do_set_affinity(struct irq_datastruct irq_chip *chip =irq_data_get_irq_chip (data);int ret; - ret = chip->irq_set_affinity (data, mask, false); + ret = chip->irq_set_affinity (data, mask, force);switch (ret) {case IRQ_SET_MASK_OK :cpumask_copy (data->affinity, mask);
@@ -162,7 +162,8 @@ int irq_do_set_affinity(struct irq_datareturn ret; } -int __irq_set_affinity_locked (struct irq_data *data,const struct cpumask *mask) +int irq_set_affinity_locked (struct irq_data *data,const struct cpumask *mask, +bool force) {struct irq_chip *chip =irq_data_get_irq_chip (data);struct irq_desc *desc =irq_data_to_desc (data);
@@ -172,7 +173,7 @@ int __irq_set_affinity_locked(struct irqreturn -EINVAL ;if (irq_can_move_pcntxt (data)) { - ret =irq_do_set_affinity (data, mask, false); + ret =irq_do_set_affinity (data, mask, force); }else {irqd_set_move_pending (data);irq_copy_pending (desc, mask);
@@ -187,13 +188,7 @@ int __irq_set_affinity_locked(struct irqreturn ret; } -/** -* irq_set_affinity - Set the irq affinity of a given irq -* @irq: Interrupt to set affinity -* @mask: cpumask -* -*/ -int irq_set_affinity (unsigned int irq,const struct cpumask *mask) +int __irq_set_affinity (unsigned int irq,const struct cpumask *mask,bool force) {struct irq_desc *desc =irq_to_desc (irq);unsigned long flags;
@@ -203,7 +198,7 @@ int irq_set_affinity(unsigned int irq, creturn -EINVAL ;raw_spin_lock_irqsave (&desc->lock, flags); - ret =__irq_set_affinity_locked (irq_desc_get_irq_data (desc), mask); + ret =irq_set_affinity_locked (irq_desc_get_irq_data (desc), mask, force);raw_spin_unlock_irqrestore (&desc->lock, flags);return ret; }
Greg Kroah-Hartman
maintainerPATCH 10/228 clocksource: Exynos_mct: Use irq_force_affinity() in cpu bringup
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
commit 30ccf03b4a6a2102a2219058bdc6d779dc637dd7 upstream.
The starting cpu is not yet in the online mask so irq_set_affinity() fails which results in per cpu timers for this cpu ending up on some other online cpu, ususally cpu 0.
Use irq_force_affinity() which disables the online mask check and makes things work.
--- drivers/clocksource/exynos_mct.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/clocksource/exynos_mct.c +1 -7
@@ -432,6 +432,7 @@ static int exynos4_local_timer_setup(str evt->irq);return -EIO ; } +irq_force_affinity (mct_irqs[MCT_L0_IRQ + cpu],cpumask_of (cpu)); }else {enable_percpu_irq (mct_irqs[MCT_L0_IRQ ],0 ); }
@@ -452,7 +453,6 @@ static int exynos4_mct_cpu_notify(struct unsigned long action, void *hcpu) { struct mct_clock_event_device *mevt; -unsigned int cpu;/* * Grab cpu pointer in each case to avoid spurious
@@ -463,12 +463,6 @@ static int exynos4_mct_cpu_notify(struct mevt =this_cpu_ptr (&percpu_mct_tick);exynos4_local_timer_setup (&mevt->evt);break ; -case CPU_ONLINE : - cpu = (unsigned long )hcpu; -if (mct_int_type ==MCT_INT_SPI ) -irq_set_affinity (mct_irqs[MCT_L0_IRQ + cpu], -cpumask_of (cpu)); -break ;case CPU_DYING : mevt =this_cpu_ptr (&percpu_mct_tick);exynos4_local_timer_stop (&mevt->evt);
Greg Kroah-Hartman
maintainerPATCH 11/228 clocksource: Exynos_mct: Register clock event after request_irq()
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
commit 8db6e5104b77de5d0b7002b95069da0992a34be9 upstream.
After hotplugging CPU1 the first call of interrupt handler for CPU1 oneshot timer was called on CPU0 because it fired before setting IRQ affinity. Affected are SoCs where Multi Core Timer interrupts are shared (SPI), e.g. Exynos 4210.
During setup of the MCT timers the clock event device should be registered after setting the affinity for interrupt. This will prevent starting the timer too early.
--- drivers/clocksource/exynos_mct.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clocksource/exynos_mct.c +2 -2
@@ -418,8 +418,6 @@ static int exynos4_local_timer_setup(str evt->set_mode = exynos4_tick_set_mode; evt->features =CLOCK_EVT_FEAT_PERIODIC |CLOCK_EVT_FEAT_ONESHOT ; evt->rating =450 ; -clockevents_config_and_register (evt, clk_rate / (TICK_BASE_CNT +1 ), -0xf ,0x7fffffff );exynos4_mct_write (TICK_BASE_CNT , mevt->base +MCT_L_TCNTB_OFFSET );
@@ -436,6 +434,8 @@ static int exynos4_local_timer_setup(str }else {enable_percpu_irq (mct_irqs[MCT_L0_IRQ ],0 ); } +clockevents_config_and_register (evt, clk_rate / (TICK_BASE_CNT +1 ), +0xf ,0x7fffffff );return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 12/228 kernfs: add back missing error check in kernfs_fop_mmap()
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <[email protected]>
commit b44b2140265ddfde03acbe809336111d31adb0d1 upstream.
While updating how mmap enabled kernfs files are handled by lockdep, 9b2db6e18945 ("sysfs: bail early from kernfs_file_mmap() to avoid spurious lockdep warning") inadvertently dropped error return check from kernfs_file_mmap(). The intention was just dropping "if (ops->mmap)" check as the control won't reach the point if the mmap callback isn't implemented, but I mistakenly removed the error return check together with it.
This led to Xorg crash on i810 which was reported and bisected to the commit and then to the specific change by Tobias.
References: http://lkml.kernel.org/g/[email protected]
--- fs/kernfs/file.c | 2 ++ 1 file changed, 2 insertions(+)
fs/kernfs/file.c +2 -0
@@ -476,6 +476,8 @@ static int kernfs_fop_mmap(struct file * ops =kernfs_ops (of->kn); rc = ops->mmap (of, vma); +if (rc) + goto out_put;/* * PowerPC's pci_mmap of legacy_mem uses shmem_zero_setup()
Greg Kroah-Hartman
maintainerPATCH 13/228 pata_at91: fix ata_host_activate() failure handling
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartlomiej Zolnierkiewicz <[email protected]>
commit 27aa64b9d1bd0d23fd692c91763a48309b694311 upstream.
Add missing clk_put() call to ata_host_activate() failure path.
Sergei says,
"Hm, I have once fixed that (see that *if* (!ret)) but looks like a
later commit 477c87e90853d136b188c50c0e4a93d01cad872e (ARM:
at91/pata: use gpio_is_valid to check the gpio) broke it again. :-( Would be good if the changelog did mention that..."
--- drivers/ata/pata_at91.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/ata/pata_at91.c +6 -5
@@ -408,12 +408,13 @@ static int pata_at91_probe(struct platfo host->private_data = info; -return ata_host_activate (host,gpio_is_valid (irq) ?gpio_to_irq (irq) :0 , -gpio_is_valid (irq) ? ata_sff_interrupt :NULL , - irq_flags, &pata_at91_sht); + ret =ata_host_activate (host,gpio_is_valid (irq) ?gpio_to_irq (irq) :0 , +gpio_is_valid (irq) ? ata_sff_interrupt :NULL , + irq_flags, &pata_at91_sht); +if (ret) + goto err_put; -if (!ret) -return 0 ; +return 0 ; err_put:clk_put (info->mck);
Greg Kroah-Hartman
maintainerPATCH 14/228 coredump: fix va_list corruption
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
commit 404ca80eb5c2727d78cd517d12108b040c522e12 upstream.
A va_list needs to be copied in case it needs to be used twice.
Thanks to Hugh for debugging this issue, leading to various panics.
Tested:
lpq84:~# echo "|/foobar12345 %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h" >/proc/sys/kernel/core_pattern
'produce_core' is simply : main() { *(int *)0 = 1;}
lpq84:~# ./produce_core Segmentation fault (core dumped) lpq84:~# dmesg | tail -1 [ 614.352947] Core dump to |/foobar12345 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 (null) pipe failed
Notice the last argument was replaced by a NULL (we were lucky enough to not crash, but do not try this on your production machine !)
After fix :
lpq83:~# echo "|/foobar12345 %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h" >/proc/sys/kernel/core_pattern lpq83:~# ./produce_core Segmentation fault lpq83:~# dmesg | tail -1 [ 740.800441] Core dump to |/foobar12345 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 pipe failed
--- fs/coredump.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
fs/coredump.c +6 -1
@@ -73,10 +73,15 @@ static int expand_corename(struct core_nstatic int cn_vprintf (struct core_name *cn,const char *fmt,va_list arg) {int free, need; +va_list arg_copy; again: free = cn->size - cn->used; - need =vsnprintf (cn->corename + cn->used, free, fmt, arg); + +va_copy (arg_copy, arg); + need =vsnprintf (cn->corename + cn->used, free, fmt, arg_copy); +va_end (arg_copy); +if (need < free) { cn->used += need;return 0 ;
Greg Kroah-Hartman
maintainerPATCH 16/228 mm: make fixup_user_fault() check the vma access rights too
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
commit 1b17844b29ae042576bea588164f2f1e9590a8bc upstream.
fixup_user_fault() is used by the futex code when the direct user access fails, and the futex code wants it to either map in the page in a usable form or return an error. It relied on handle_mm_fault() to map the page, and correctly checked the error return from that, but while that does map the page, it doesn't actually guarantee that the page will be mapped with sufficient permissions to be then accessed.
So do the appropriate tests of the vma access rights by hand.
[ Side note: arguably handle_mm_fault() could just do that itself, but
we have traditionally done it in the caller, because some callers - notably get_user_pages() - have been able to access pages even when they are mapped with PROT_NONE. Maybe we should re-visit that design decision, but in the meantime this is the minimal patch. ]
Found by Dave Jones running his trinity tool.
--- mm/memory.c | 5 +++++ 1 file changed, 5 insertions(+)
mm/memory.c +5 -0
@@ -1929,12 +1929,17 @@ int fixup_user_fault(struct task_struct unsigned long address, unsigned int fault_flags) { struct vm_area_struct *vma; +vm_flags_t vm_flags;int ret; vma =find_extend_vma (mm, address);if (!vma || address < vma->vm_start)return -EFAULT ; + vm_flags = (fault_flags &FAULT_FLAG_WRITE ) ?VM_WRITE :VM_READ ; +if (!(vm_flags & vma->vm_flags)) +return -EFAULT ; + ret =handle_mm_fault (mm, vma, address, fault_flags);if (ret &VM_FAULT_ERROR ) {if (ret &VM_FAULT_OOM )
Greg Kroah-Hartman
maintainerPATCH 17/228 serial: 8250: Fix thread unsafe __dma_tx_complete function
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Loic Poulain <[email protected]>
commit f8fd1b0350d3a4581125f5eda6528f5a2c5f9183 upstream.
__dma_tx_complete is not protected against concurrent call of serial8250_tx_dma. it can lead to circular tail index corruption or parallel call of serial_tx_dma on the same data portion.
This patch fixes this issue by holding the port lock.
--- drivers/tty/serial/8250/8250_dma.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/tty/serial/8250/8250_dma.c +7 -2
@@ -20,12 +20,15 @@ static void __dma_tx_complete(void *parastruct uart_8250_port *p = param;struct uart_8250_dma *dma = p->dma;struct circ_buf *xmit = &p->port.state->xmit; - - dma->tx_running =0 ; +unsigned long flags;dma_sync_single_for_cpu (dma->txchan->device->dev, dma->tx_addr,UART_XMIT_SIZE ,DMA_TO_DEVICE ); +spin_lock_irqsave (&p->port.lock, flags); + + dma->tx_running =0 ; + xmit->tail += dma->tx_size; xmit->tail &=UART_XMIT_SIZE -1 ; p->port.icount.tx += dma->tx_size;
@@ -35,6 +38,8 @@ static void __dma_tx_complete(void *paraif (!uart_circ_empty (xmit) && !uart_tx_stopped (&p->port))serial8250_tx_dma (p); + +spin_unlock_irqrestore (&p->port.lock, flags); }static void __dma_rx_complete (void *param)
Greg Kroah-Hartman
maintainerPATCH 18/228 8250_core: Fix unwanted TX chars write
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Loic Poulain <[email protected]>
commit b08c9c317e3f7764a91d522cd031639ba42b98cc upstream.
On transmit-hold-register empty, serial8250_tx_chars should be called only if we don't use DMA. DMA has its own tx cycle.
--- drivers/tty/serial/8250/8250_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/8250/8250_core.c +1 -1
@@ -1520,7 +1520,7 @@ int serial8250_handle_irq(struct uart_po status =serial8250_rx_chars (up, status); }serial8250_modem_status (up); -if (status &UART_LSR_THRE ) +if (!up->dma && (status &UART_LSR_THRE ))serial8250_tx_chars (up);spin_unlock_irqrestore (&port->lock, flags);
Greg Kroah-Hartman
maintainerPATCH 19/228 iwlwifi: add MODULE_FIRMWARE for 7265
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Emmanuel Grumbach <[email protected]>
commit 08a732f4e4a842f0101e5ea03d79e9d613ffadbe upstream.
It was missing.
--- drivers/net/wireless/iwlwifi/iwl-7000.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/iwlwifi/iwl-7000.c +1 -0
@@ -223,3 +223,4 @@ const struct iwl_cfg iwl7265_n_cfg = {MODULE_FIRMWARE (IWL7260_MODULE_FIRMWARE (IWL7260_UCODE_API_OK ));MODULE_FIRMWARE (IWL3160_MODULE_FIRMWARE (IWL3160_UCODE_API_OK )); +MODULE_FIRMWARE (IWL7265_MODULE_FIRMWARE (IWL7260_UCODE_API_OK ));
Greg Kroah-Hartman
maintainerPATCH 20/228 iwlwifi: mvm: rs: fix mimo delimiter in LQ cmd
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eyal Shapira <[email protected]>
commit d9088f60425e0acd8a8f05fdfcfdd288d3258641 upstream.
mimo_delim was always set to 0 instead of pointing to the first SISO entry after MIMO rates.
This can cause keep transmitting in MIMO even when we shouldn't. For example when the peer is requesting static SMPS.
--- drivers/net/wireless/iwlwifi/mvm/rs.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/iwlwifi/mvm/rs.c +1 -0
@@ -2469,6 +2469,7 @@ static void rs_build_rates_table(structif (is_siso (&rate)) { num_rates =RS_SECONDARY_SISO_NUM_RATES ; num_retries =RS_SECONDARY_SISO_RETRIES ; + lq_cmd->mimo_delim = index; }else if (is_legacy (&rate)) { num_rates =RS_SECONDARY_LEGACY_NUM_RATES ; num_retries =RS_LEGACY_RETRIES_PER_RATE ;
Greg Kroah-Hartman
maintainerPATCH 21/228 iwlwifi: add new 7265 HW IDs
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oren Givon <[email protected]>
commit 80f2679e589503bd6cbaaa1f9c1cd9dd7dfae032 upstream.
Add 2 new HW IDs for the 7265 series.
--- drivers/net/wireless/iwlwifi/pcie/drv.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wireless/iwlwifi/pcie/drv.c +2 -0
@@ -372,12 +372,14 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_ca {IWL_PCI_DEVICE(0x095A, 0x500A, iwl7265_2n_cfg)}, {IWL_PCI_DEVICE(0x095B, 0x5200, iwl7265_2n_cfg)}, {IWL_PCI_DEVICE(0x095A, 0x5002, iwl7265_n_cfg)}, + {IWL_PCI_DEVICE(0x095A, 0x5102, iwl7265_n_cfg)}, {IWL_PCI_DEVICE(0x095B, 0x5202, iwl7265_n_cfg)}, {IWL_PCI_DEVICE(0x095A, 0x9010, iwl7265_2ac_cfg)}, {IWL_PCI_DEVICE(0x095A, 0x9012, iwl7265_2ac_cfg)}, {IWL_PCI_DEVICE(0x095A, 0x9110, iwl7265_2ac_cfg)}, {IWL_PCI_DEVICE(0x095A, 0x9112, iwl7265_2ac_cfg)}, {IWL_PCI_DEVICE(0x095A, 0x9210, iwl7265_2ac_cfg)}, + {IWL_PCI_DEVICE(0x095A, 0x9200, iwl7265_2ac_cfg)}, {IWL_PCI_DEVICE(0x095A, 0x9510, iwl7265_2ac_cfg)}, {IWL_PCI_DEVICE(0x095A, 0x9310, iwl7265_2ac_cfg)}, {IWL_PCI_DEVICE(0x095A, 0x9410, iwl7265_2ac_cfg)},
Greg Kroah-Hartman
maintainerPATCH 22/228 iwlwifi: mvm: rs: fallback to legacy Tx columns
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eyal Shapira <[email protected]>
commit fd7dbee51b3d98402edb11fec0c93d96476e0ae1 upstream.
Allow switching back to legacy Tx columns so we'll stop doing HT/VHT in case we're far from the AP. Stop active aggregation when making a deciding to stay in a legacy column.
Despite having low legacy rates in the LQ table lower entries it doesn't help much in case we're doing aggregations as the aggregation was being transmitted in the initial rate of the table.
This should help traffic stalls when far from the AP.
--- drivers/net/wireless/iwlwifi/mvm/rs.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlwifi/mvm/rs.c +28 -2
@@ -142,7 +142,7 @@ enum rs_column_mode { RS_MIMO2, }; -#define MAX_NEXT_COLUMNS 5 +#define MAX_NEXT_COLUMNS 7#define MAX_COLUMN_CHECKS 3 typedef bool (*allow_column_func_t) (struct iwl_mvm *mvm,
@@ -214,6 +214,8 @@ static const struct rs_tx_column rs_tx_cRS_COLUMN_SISO_ANT_B ,RS_COLUMN_MIMO2 ,RS_COLUMN_MIMO2_SGI , +RS_COLUMN_INVALID , + RS_COLUMN_INVALID, }, }, [RS_COLUMN_LEGACY_ANT_B] = {
@@ -225,6 +227,8 @@ static const struct rs_tx_column rs_tx_cRS_COLUMN_SISO_ANT_B ,RS_COLUMN_MIMO2 ,RS_COLUMN_MIMO2_SGI , +RS_COLUMN_INVALID , + RS_COLUMN_INVALID, }, }, [RS_COLUMN_SISO_ANT_A] = {
@@ -236,6 +240,8 @@ static const struct rs_tx_column rs_tx_c RS_COLUMN_SISO_ANT_A_SGI,RS_COLUMN_SISO_ANT_B_SGI ,RS_COLUMN_MIMO2_SGI , +RS_COLUMN_LEGACY_ANT_A , +RS_COLUMN_LEGACY_ANT_B , }, .checks = { rs_siso_allow,
@@ -250,6 +256,8 @@ static const struct rs_tx_column rs_tx_c RS_COLUMN_SISO_ANT_B_SGI,RS_COLUMN_SISO_ANT_A_SGI ,RS_COLUMN_MIMO2_SGI , +RS_COLUMN_LEGACY_ANT_A , +RS_COLUMN_LEGACY_ANT_B , }, .checks = { rs_siso_allow,
@@ -265,6 +273,8 @@ static const struct rs_tx_column rs_tx_c RS_COLUMN_SISO_ANT_A,RS_COLUMN_SISO_ANT_B ,RS_COLUMN_MIMO2 , +RS_COLUMN_LEGACY_ANT_A , +RS_COLUMN_LEGACY_ANT_B , }, .checks = { rs_siso_allow,
@@ -281,6 +291,8 @@ static const struct rs_tx_column rs_tx_c RS_COLUMN_SISO_ANT_B,RS_COLUMN_SISO_ANT_A ,RS_COLUMN_MIMO2 , +RS_COLUMN_LEGACY_ANT_A , +RS_COLUMN_LEGACY_ANT_B , }, .checks = { rs_siso_allow,
@@ -296,6 +308,8 @@ static const struct rs_tx_column rs_tx_c RS_COLUMN_SISO_ANT_A_SGI,RS_COLUMN_SISO_ANT_B_SGI ,RS_COLUMN_MIMO2_SGI , +RS_COLUMN_LEGACY_ANT_A , +RS_COLUMN_LEGACY_ANT_B , }, .checks = { rs_mimo_allow,
@@ -311,6 +325,8 @@ static const struct rs_tx_column rs_tx_c RS_COLUMN_SISO_ANT_A,RS_COLUMN_SISO_ANT_B ,RS_COLUMN_MIMO2 , +RS_COLUMN_LEGACY_ANT_A , +RS_COLUMN_LEGACY_ANT_B , }, .checks = { rs_mimo_allow,
@@ -2032,8 +2048,18 @@ lq_update:* stay with best antenna legacy modulation for a while * before next round of mode comparisons. */ tbl1 = &(lq_sta->lq_info[lq_sta->active_tbl]); -if (is_legacy (&tbl1->rate) && !sta->ht_cap.ht_supported) { +if (is_legacy (&tbl1->rate)) {IWL_DEBUG_RATE (mvm,"LQ: STAY in legacy table\n" ); + +if (tid !=IWL_MAX_TID_COUNT ) { + tid_data = &sta_priv->tid_data[tid]; +if (tid_data->state !=IWL_AGG_OFF ) { +IWL_DEBUG_RATE (mvm, +"Stop aggregation on tid %d\n" , + tid); +ieee80211_stop_tx_ba_session (sta, tid); + } + }rs_set_stay_in_table (mvm,1 , lq_sta); }else {/* If we're in an HT mode, and all 3 mode switch actions
Greg Kroah-Hartman
maintainerPATCH 23/228 iwlwifi: mvm: avoid searching unnecessary columns
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eyal Shapira <[email protected]>
commit d8fff919ecd7820084675c2814913445e95640ac upstream.
Don't search columns which are unlikely to succeed as previous columns searched with less aggressive modulation failed.
--- drivers/net/wireless/iwlwifi/mvm/rs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/net/wireless/iwlwifi/mvm/rs.c +6 -6
@@ -212,8 +212,8 @@ static const struct rs_tx_column rs_tx_cRS_COLUMN_LEGACY_ANT_B ,RS_COLUMN_SISO_ANT_A ,RS_COLUMN_SISO_ANT_B , -RS_COLUMN_MIMO2 , -RS_COLUMN_MIMO2_SGI , +RS_COLUMN_INVALID , +RS_COLUMN_INVALID ,RS_COLUMN_INVALID , RS_COLUMN_INVALID, },
@@ -225,8 +225,8 @@ static const struct rs_tx_column rs_tx_cRS_COLUMN_LEGACY_ANT_A ,RS_COLUMN_SISO_ANT_A ,RS_COLUMN_SISO_ANT_B , -RS_COLUMN_MIMO2 , -RS_COLUMN_MIMO2_SGI , +RS_COLUMN_INVALID , +RS_COLUMN_INVALID ,RS_COLUMN_INVALID , RS_COLUMN_INVALID, },
@@ -239,9 +239,9 @@ static const struct rs_tx_column rs_tx_c RS_COLUMN_MIMO2,RS_COLUMN_SISO_ANT_A_SGI ,RS_COLUMN_SISO_ANT_B_SGI , -RS_COLUMN_MIMO2_SGI ,RS_COLUMN_LEGACY_ANT_A ,RS_COLUMN_LEGACY_ANT_B , +RS_COLUMN_INVALID , }, .checks = { rs_siso_allow,
@@ -255,9 +255,9 @@ static const struct rs_tx_column rs_tx_c RS_COLUMN_MIMO2,RS_COLUMN_SISO_ANT_B_SGI ,RS_COLUMN_SISO_ANT_A_SGI , -RS_COLUMN_MIMO2_SGI ,RS_COLUMN_LEGACY_ANT_A ,RS_COLUMN_LEGACY_ANT_B , +RS_COLUMN_INVALID , }, .checks = { rs_siso_allow,
Greg Kroah-Hartman
maintainerPATCH 24/228 iwlwifi: mvm: rs: fix and cleanup rs_get_rate_action
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eyal Shapira <[email protected]>
commit e53839eb9882c99d3781eab0fe1b2d4369a6a2cc upstream.
Change the down/upscale decision logic a bit to be based on different success ratio thresholds. This fixes the implementation compared to the rate scale algorithm which was planned to yield optimal results. Also fix a case where a lower rate wasn't explored despite being a potential for better throughput.
While at it rewrite rs_get_rate_action to be more clear and clean.
--- drivers/net/wireless/iwlwifi/mvm/rs.c | 135 +++++++++++++++------------------- drivers/net/wireless/iwlwifi/mvm/rs.h | 1 2 files changed, 64 insertions(+), 72 deletions(-)
drivers/net/wireless/iwlwifi/mvm/rs.c +63 -72
@@ -1644,85 +1644,76 @@ static enum rs_action rs_get_rate_action {enum rs_action action =RS_ACTION_STAY ; -/* Too many failures, decrease rate */ if ((sr <=RS_SR_FORCE_DECREASE ) || (current_tpt ==0 )) {IWL_DEBUG_RATE (mvm, -"decrease rate because of low SR\n" ); - action =RS_ACTION_DOWNSCALE ; -/* No throughput measured yet for adjacent rates; try increase. */ - }else if ((low_tpt ==IWL_INVALID_VALUE ) && - (high_tpt ==IWL_INVALID_VALUE )) { -if (high !=IWL_RATE_INVALID && sr >=IWL_RATE_INCREASE_TH ) { -IWL_DEBUG_RATE (mvm, -"Good SR and no high rate measurement. " -"Increase rate\n" ); - action =RS_ACTION_UPSCALE ; - }else if (low !=IWL_RATE_INVALID ) { -IWL_DEBUG_RATE (mvm, -"Remain in current rate\n" ); - action =RS_ACTION_STAY ; - } +"Decrease rate because of low SR\n" ); +return RS_ACTION_DOWNSCALE ; } -/* Both adjacent throughputs are measured, but neither one has better -* throughput; we're using the best rate, don't change it! -*/ -else if ((low_tpt !=IWL_INVALID_VALUE ) && - (high_tpt !=IWL_INVALID_VALUE ) && - (low_tpt < current_tpt) && - (high_tpt < current_tpt)) { -IWL_DEBUG_RATE (mvm, -"Both high and low are worse. " -"Maintain rate\n" ); - action =RS_ACTION_STAY ; - } - -/* At least one adjacent rate's throughput is measured, -* and may have better performance. -*/ -else { -/* Higher adjacent rate's throughput is measured */ -if (high_tpt !=IWL_INVALID_VALUE ) { -/* Higher rate has better throughput */ -if (high_tpt > current_tpt && - sr >=IWL_RATE_INCREASE_TH ) { -IWL_DEBUG_RATE (mvm, -"Higher rate is better and good " -"SR. Increate rate\n" ); - action =RS_ACTION_UPSCALE ; - }else { -IWL_DEBUG_RATE (mvm, -"Higher rate isn't better OR " -"no good SR. Maintain rate\n" ); - action =RS_ACTION_STAY ; - } - -/* Lower adjacent rate's throughput is measured */ - }else if (low_tpt !=IWL_INVALID_VALUE ) { -/* Lower rate has better throughput */ -if (low_tpt > current_tpt) { -IWL_DEBUG_RATE (mvm, -"Lower rate is better. " -"Decrease rate\n" ); - action =RS_ACTION_DOWNSCALE ; - }else if (sr >=IWL_RATE_INCREASE_TH ) { -IWL_DEBUG_RATE (mvm, -"Lower rate isn't better and " -"good SR. Increase rate\n" ); - action =RS_ACTION_UPSCALE ; - } - } +if ((low_tpt ==IWL_INVALID_VALUE ) && + (high_tpt ==IWL_INVALID_VALUE ) && + (high !=IWL_RATE_INVALID )) { +IWL_DEBUG_RATE (mvm, +"No data about high/low rates. Increase rate\n" ); +return RS_ACTION_UPSCALE ; } -/* Sanity check; asked for decrease, but success rate or throughput -* has been good at old rate. Don't change it. -*/ -if ((action ==RS_ACTION_DOWNSCALE ) && (low !=IWL_RATE_INVALID ) && - ((sr >IWL_RATE_HIGH_TH ) || - (current_tpt > (100 * tbl->expected_tpt[low])))) { +if ((high_tpt ==IWL_INVALID_VALUE ) && + (high !=IWL_RATE_INVALID ) && + (low_tpt !=IWL_INVALID_VALUE ) && + (low_tpt < current_tpt)) {IWL_DEBUG_RATE (mvm, -"Sanity check failed. Maintain rate\n" ); - action =RS_ACTION_STAY ; +"No data about high rate and low rate is worse. Increase rate\n" ); +return RS_ACTION_UPSCALE ; + } + +if ((high_tpt !=IWL_INVALID_VALUE ) && + (high_tpt > current_tpt)) { +IWL_DEBUG_RATE (mvm, +"Higher rate is better. Increate rate\n" ); +return RS_ACTION_UPSCALE ; + } + +if ((low_tpt !=IWL_INVALID_VALUE ) && + (high_tpt !=IWL_INVALID_VALUE ) && + (low_tpt < current_tpt) && + (high_tpt < current_tpt)) { +IWL_DEBUG_RATE (mvm, +"Both high and low are worse. Maintain rate\n" ); +return RS_ACTION_STAY ; + } + +if ((low_tpt !=IWL_INVALID_VALUE ) && + (low_tpt > current_tpt)) { +IWL_DEBUG_RATE (mvm, +"Lower rate is better\n" ); + action =RS_ACTION_DOWNSCALE ; + goto out; + } + +if ((low_tpt ==IWL_INVALID_VALUE ) && + (low !=IWL_RATE_INVALID )) { +IWL_DEBUG_RATE (mvm, +"No data about lower rate\n" ); + action =RS_ACTION_DOWNSCALE ; + goto out; + } + +IWL_DEBUG_RATE (mvm,"Maintain rate\n" ); + +out: +if ((action ==RS_ACTION_DOWNSCALE ) && (low !=IWL_RATE_INVALID )) { +if (sr >=RS_SR_NO_DECREASE ) { +IWL_DEBUG_RATE (mvm, +"SR is above NO DECREASE. Avoid downscale\n" ); + action =RS_ACTION_STAY ; + }else if (current_tpt > (100 * tbl->expected_tpt[low])) { +IWL_DEBUG_RATE (mvm, +"Current TPT is higher than max expected in low rate. Avoid downscale\n" ); + action =RS_ACTION_STAY ; + }else { +IWL_DEBUG_RATE (mvm,"Decrease rate\n" ); + } }return action;
drivers/net/wireless/iwlwifi/mvm/rs.h +1 -0
@@ -156,6 +156,7 @@ enum {#define IWL_RATE_HIGH_TH 10880/* 85% */ #define IWL_RATE_INCREASE_TH 6400/* 50% */ #define RS_SR_FORCE_DECREASE 1920/* 15% */ +#define RS_SR_NO_DECREASE 10880/* 85% */ #define LINK_QUAL_AGG_TIME_LIMIT_DEF (4000)/* 4 milliseconds */ #define LINK_QUAL_AGG_TIME_LIMIT_MAX (8000)
Greg Kroah-Hartman
maintainerPATCH 25/228 iwlwifi: mvm: rs: reinit rs if no tx for a long time
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eyal Shapira <[email protected]>
commit 87d5e4155c0088e6766b4f0193b63fa0eab71220 upstream.
After being idle for a long time (>5sec) the rs statistics will be stale so we prefer to reset rs and start from legacy rates again. This gives better results when the attenuation increased signficantly (e.g. we got further from the AP) and after a while we start Tx
Note that the first Tx after the idle period will still go out in the old modulation and rate but this seemed a simpler approach compared to adding a timer or modifying mac80211 for this. The negative impact is negligble as we'll recover quickly.
--- drivers/net/wireless/iwlwifi/mvm/rs.c | 22 +++++++++++++++++++++- drivers/net/wireless/iwlwifi/mvm/rs.h | 1 + 2 files changed, 22 insertions(+), 1 deletion(-)
drivers/net/wireless/iwlwifi/mvm/rs.c +21 -1
@@ -59,7 +59,7 @@/* max allowed rate miss before sync LQ cmd */ #define IWL_MISSED_RATE_MAX 15#define RS_STAY_IN_COLUMN_TIMEOUT (5*HZ) - +#define RS_IDLE_TIMEOUT (5*HZ)static u8 rs_ht_to_legacy[] = { [IWL_RATE_MCS_0_INDEX ] =IWL_RATE_6M_INDEX ,
@@ -991,6 +991,13 @@ static void rs_tx_status(void *mvm_r, streturn ; } +#ifdef CPTCFG_MAC80211_DEBUGFS +/* Disable last tx check if we are debugging with fixed rate */ +if (lq_sta->dbg_fixed_rate) { +IWL_DEBUG_RATE (mvm,"Fixed rate. avoid rate scaling\n" ); +return ; + } +#endif if (!ieee80211_is_data (hdr->frame_control) || info->flags &IEEE80211_TX_CTL_NO_ACK )return ;
@@ -1033,6 +1040,18 @@ static void rs_tx_status(void *mvm_r, st mac_index++; } +if (time_after (jiffies, + (unsigned long )(lq_sta->last_tx +RS_IDLE_TIMEOUT ))) { +int tid; +IWL_DEBUG_RATE (mvm,"Tx idle for too long. reinit rs\n" ); +for (tid =0 ; tid <IWL_MAX_TID_COUNT ; tid++) +ieee80211_stop_tx_ba_session (sta, tid); + +iwl_mvm_rs_rate_init (mvm, sta, sband->band, false); +return ; + } + lq_sta->last_tx = jiffies; +/* Here we actually compare this rate to the latest LQ command */ if ((mac_index < 0) || (rate.sgi != !!(mac_flags & IEEE80211_TX_RC_SHORT_GI)) ||
@@ -2286,6 +2305,7 @@ void iwl_mvm_rs_rate_init(struct iwl_mvmrs_rate_scale_clear_window (&lq_sta->lq_info[j].win[i]); lq_sta->flush_timer =0 ; + lq_sta->last_tx = jiffies; IWL_DEBUG_RATE(mvm, "LQ: *** rate scale station global init for station %d ***\n",
drivers/net/wireless/iwlwifi/mvm/rs.h +1 -0
@@ -311,6 +311,7 @@ struct iwl_lq_sta {u32 visited_columns;/* Bitmask marking which Tx columns were * explored during a search cycle */ +u64 last_tx;bool is_vht;enum ieee80211_band band;
Greg Kroah-Hartman
maintainerPATCH 26/228 iwlwifi: 7000: bump API to 9
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Emmanuel Grumbach <[email protected]>
commit 431031851ea72a25abb9ad4df56a0f3b997e3026 upstream.
This will allow to load the new firmware.
--- drivers/net/wireless/iwlwifi/iwl-7000.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlwifi/iwl-7000.c +2 -2
@@ -67,8 +67,8 @@#include "iwl-agn-hw.h" /* Highest firmware API version supported */ -#define IWL7260_UCODE_API_MAX 8 -#define IWL3160_UCODE_API_MAX 8 +#define IWL7260_UCODE_API_MAX 9 +#define IWL3160_UCODE_API_MAX 9/* Oldest version we won't warn about */ #define IWL7260_UCODE_API_OK 7
Greg Kroah-Hartman
maintainerPATCH 27/228 gpu: host1x: handle the correct # of syncpt regs
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Warren <[email protected]>
commit 22bbd5d949dc7fdd72a4e78e767fa09d8e54b446 upstream.
BIT_WORD() truncates rather than rounds, so the loops in syncpt_thresh_isr() and _host1x_intr_disable_all_syncpt_intrs() use <= rather than < in an attempt to process the correct number of registers when rounding of the conversion of count of bits to count of words is necessary. However, when rounding isn't necessary because the value is already a multiple of the divisor (as is the case for all values of nb_pts the code actually sees), this causes one too many registers to be processed.
Solve this by using and explicit DIV_ROUND_UP() call, rather than BIT_WORD(), and comparing with < rather than <=.
--- drivers/gpu/host1x/hw/intr_hw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/host1x/hw/intr_hw.c +2 -2
@@ -47,7 +47,7 @@ static irqreturn_t syncpt_thresh_isr(intunsigned long reg;int i, id; -for (i =0 ; i <=BIT_WORD (host->info->nb_pts); i++) { +for (i =0 ; i <DIV_ROUND_UP (host->info->nb_pts,32 ); i++) { reg =host1x_sync_readl (host,HOST1X_SYNC_SYNCPT_THRESH_CPU0_INT_STATUS (i));for_each_set_bit (id, ®,BITS_PER_LONG ) {
@@ -64,7 +64,7 @@ static void _host1x_intr_disable_all_syn {u32 i; -for (i =0 ; i <=BIT_WORD (host->info->nb_pts); ++i) { +for (i =0 ; i <DIV_ROUND_UP (host->info->nb_pts,32 ); ++i) {host1x_sync_writel (host,0xffffffffu ,HOST1X_SYNC_SYNCPT_THRESH_INT_DISABLE (i)); host1x_sync_writel(host, 0xffffffffu,
Greg Kroah-Hartman
maintainerPATCH 28/228 timer: Prevent overflow in apply_slack
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiri Bohac <[email protected]>
commit 98a01e779f3c66b0b11cd7e64d531c0e41c95762 upstream.
On architectures with sizeof(int) < sizeof (long), the computation of mask inside apply_slack() can be undefined if the computed bit is > 32.
E.g. with: expires = 0xffffe6f5 and slack = 25, we get:
expires_limit = 0x20000000e
bit = 33
mask = (1 << 33) - 1 /* undefined */
On x86, mask becomes 1 and and the slack is not applied properly. On s390, mask is -1, expires is set to 0 and the timer fires immediately.
Use 1UL << bit to solve that issue.
--- kernel/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/timer.c +1 -1
@@ -822,7 +822,7 @@ unsigned long apply_slack(struct timer_l bit =find_last_bit (&mask,BITS_PER_LONG ); - mask = (1 << bit) -1 ; + mask = (1UL << bit) -1 ; expires_limit = expires_limit & ~(mask);
Greg Kroah-Hartman
maintainerPATCH 29/228 ipmi: Fix a race restarting the timer
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bodo Stroesser <[email protected]>
commit 48e8ac2979920ffa39117e2d725afa3a749bfe8d upstream.
With recent changes it is possible for the timer handler to detect an idle interface and not start the timer, but the thread to start an operation at the same time. The thread will not start the timer in that instance, resulting in the timer not running.
Instead, move all timer operations under the lock and start the timer in the thread if it detect non-idle and the timer is not already running. Moving under locks allows the last timeout to be set in both the thread and the timer. 'Timer is not running' means that the timer is not pending and smi_timeout() is not running. So we need a flag to detect this correctly.
Also fix a few other timeout bugs: setting the last timeout when the interrupt has to be disabled and the timer started, and setting the last timeout in check_start_timer_thread possibly racing with the timer
--- drivers/char/ipmi/ipmi_si_intf.c | 46 +++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 18 deletions(-)
drivers/char/ipmi/ipmi_si_intf.c +28 -18
@@ -249,6 +249,9 @@ struct smi_info {/* The timer for this si. */ struct timer_list si_timer; +/* This flag is set, if the timer is running (timer_pending() isn't enough) */ +bool timer_running; +/* The time (in jiffies) the last timeout occurred at. */ unsigned long last_timeout_jiffies;
@@ -435,6 +438,13 @@ static void start_clear_flags(struct smi smi_info->si_state =SI_CLEARING_FLAGS ; } +static void smi_mod_timer (struct smi_info *smi_info,unsigned long new_val) +{ + smi_info->last_timeout_jiffies = jiffies; +mod_timer (&smi_info->si_timer, new_val); + smi_info->timer_running = true; +} +/* * When we have a situtaion where we run out of memory and cannot * allocate messages, we just leave them in the BMC and run the system
@@ -447,8 +457,7 @@ static inline void disable_si_irq(structstart_disable_irq (smi_info); smi_info->interrupt_disabled =1 ;if (!atomic_read (&smi_info->stop_operation)) -mod_timer (&smi_info->si_timer, - jiffies +SI_TIMEOUT_JIFFIES ); +smi_mod_timer (smi_info, jiffies +SI_TIMEOUT_JIFFIES ); } }
@@ -908,15 +917,7 @@ static void sender(void *list_add_tail (&msg->link, &smi_info->xmit_msgs);if (smi_info->si_state ==SI_NORMAL && smi_info->curr_msg ==NULL ) { -/* -* last_timeout_jiffies is updated here to avoid -* smi_timeout() handler passing very large time_diff -* value to smi_event_handler() that causes -* the send command to abort. -*/ - smi_info->last_timeout_jiffies = jiffies; - -mod_timer (&smi_info->si_timer, jiffies +SI_TIMEOUT_JIFFIES ); +smi_mod_timer (smi_info, jiffies +SI_TIMEOUT_JIFFIES );if (smi_info->thread)wake_up_process (smi_info->thread);
@@ -1005,6 +1006,17 @@ static int ipmi_thread(void *data)spin_lock_irqsave (&(smi_info->si_lock), flags); smi_result =smi_event_handler (smi_info,0 ); + +/* +* If the driver is doing something, there is a possible +* race with the timer. If the timer handler see idle, +* and the thread here sees something else, the timer +* handler won't restart the timer even though it is +* required. So start it here if necessary. +*/ +if (smi_result !=SI_SM_IDLE && !smi_info->timer_running) +smi_mod_timer (smi_info, jiffies +SI_TIMEOUT_JIFFIES ); +spin_unlock_irqrestore (&(smi_info->si_lock), flags); busy_wait =ipmi_thread_busy_wait (smi_result, smi_info, &busy_until);
@@ -1074,10 +1086,6 @@ static void smi_timeout(unsigned long da * SI_USEC_PER_JIFFY); smi_result =smi_event_handler (smi_info, time_diff); -spin_unlock_irqrestore (&(smi_info->si_lock), flags); - - smi_info->last_timeout_jiffies = jiffies_now; -if ((smi_info->irq) && (!smi_info->interrupt_disabled)) {/* Running with interrupts, only do long timeouts. */ timeout = jiffies +SI_TIMEOUT_JIFFIES ;
@@ -1099,7 +1107,10 @@ static void smi_timeout(unsigned long da do_mod_timer:if (smi_result !=SI_SM_IDLE ) -mod_timer (&(smi_info->si_timer), timeout); +smi_mod_timer (smi_info, timeout); +else + smi_info->timer_running = false; +spin_unlock_irqrestore (&(smi_info->si_lock), flags); }static irqreturn_t si_irq_handler (int irq,void *data)
@@ -1147,8 +1158,7 @@ static int smi_start_processing(void/* Set up the timer that drives the interface. */ setup_timer (&new_smi->si_timer, smi_timeout, (long )new_smi); - new_smi->last_timeout_jiffies = jiffies; -mod_timer (&new_smi->si_timer, jiffies +SI_TIMEOUT_JIFFIES ); +smi_mod_timer (new_smi, jiffies +SI_TIMEOUT_JIFFIES );/* * Check if the user forcefully enabled the daemon.
Greg Kroah-Hartman
maintainerPATCH 30/228 ipmi: Reset the KCS timeout when starting error recovery
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Corey Minyard <[email protected]>
commit eb6d78ec213e6938559b801421d64714dafcf4b2 upstream.
The OBF timer in KCS was not reset in one situation when error recovery was started, resulting in an immediate timeout.
--- drivers/char/ipmi/ipmi_kcs_sm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/char/ipmi/ipmi_kcs_sm.c +3 -2
@@ -251,8 +251,9 @@ static inline int check_obf(struct si_smif (!GET_STATUS_OBF (status)) { kcs->obf_timeout -= time;if (kcs->obf_timeout <0 ) { -start_error_recovery (kcs,"OBF not ready in time" ); -return 1 ; + kcs->obf_timeout =OBF_RETRY_TIMEOUT ; +start_error_recovery (kcs,"OBF not ready in time" ); +return 1 ; }return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 31/228 cfg80211: fix few minor issues in reg_process_hint()
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilan Peer <[email protected]>
commit 772f0389338cfcf96da1c178046dc7e1649ab554 upstream.
Fix the following issues in reg_process_hint():
1. Add verification that wiphy is valid before processing NL80211_REGDOMAIN_SET_BY_COUNTRY_IE.
2. Free the request in case of invalid initiator.
3. Remove WARN_ON check on reg_request->alpha2 as it is not a pointer.
--- net/wireless/reg.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
net/wireless/reg.c +10 -9
@@ -1683,17 +1683,9 @@ static void reg_process_hint(struct regustruct wiphy *wiphy =NULL ;enum reg_request_treatment treatment; -if (WARN_ON (!reg_request->alpha2)) -return ; -if (reg_request->wiphy_idx !=WIPHY_IDX_INVALID ) wiphy =wiphy_idx_to_wiphy (reg_request->wiphy_idx); -if (reg_request->initiator ==NL80211_REGDOM_SET_BY_DRIVER && !wiphy) { -kfree (reg_request); -return ; - } -switch (reg_request->initiator) {case NL80211_REGDOM_SET_BY_CORE :reg_process_hint_core (reg_request);
@@ -1706,20 +1698,29 @@ static void reg_process_hint(struct reguschedule_delayed_work (®_timeout,msecs_to_jiffies (3142 ));return ;case NL80211_REGDOM_SET_BY_DRIVER : +if (!wiphy) + goto out_free; treatment =reg_process_hint_driver (wiphy, reg_request);break ;case NL80211_REGDOM_SET_BY_COUNTRY_IE : +if (!wiphy) + goto out_free; treatment =reg_process_hint_country_ie (wiphy, reg_request);break ;default :WARN (1 ,"invalid initiator %d\n" , reg_request->initiator); -return ; + goto out_free; }/* This is required so that the orig_* parameters are saved */ if (treatment ==REG_REQ_ALREADY_SET && wiphy && wiphy->regulatory_flags ®ULATORY_STRICT_REG )wiphy_update_regulatory (wiphy, reg_request->initiator); + +return ; + +out_free: +kfree (reg_request); }/*
Greg Kroah-Hartman
maintainerPATCH 32/228 cfg80211: free sme on connection failures
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eliad Peller <[email protected]>
commit c1fbb258846dfc425507a093922d2d001e54c3ea upstream.
cfg80211 is notified about connection failures by__cfg80211_connect_result() call. However, this
function currently does not free cfg80211 sme.
This results in hanging connection attempts in some cases
e.g. when mac80211 authentication attempt is denied, we have this function call:ieee80211_rx_mgmt_auth() -> cfg80211_rx_mlme_mgmt() -> cfg80211_process_auth() -> cfg80211_sme_rx_auth() -> __cfg80211_connect_result()
but cfg80211_sme_free() is never get called.
--- net/wireless/sme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/wireless/sme.c +1 -1
@@ -235,7 +235,6 @@ void cfg80211_conn_work(struct work_struNULL ,0 ,NULL ,0 ,WLAN_STATUS_UNSPECIFIED_FAILURE , false, NULL); -cfg80211_sme_free (wdev); }wdev_unlock (wdev); }
@@ -649,6 +648,7 @@ void __cfg80211_connect_result(struct necfg80211_unhold_bss (bss_from_pub (bss));cfg80211_put_bss (wdev->wiphy, bss); } +cfg80211_sme_free (wdev);return ; }
Greg Kroah-Hartman
maintainerPATCH 33/228 cfg80211: add cfg80211_sched_scan_stopped_rtnl
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eliad Peller <[email protected]>
commit 792e6aa7a15ea0fb16f8687e93caede1ea9118c7 upstream.
Add locked-version for cfg80211_sched_scan_stopped. This is used for some users that might want to call it when rtnl is already locked.
--- include/net/cfg80211.h | 12 ++++++++++++ net/wireless/scan.c | 12 ++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-)
include/net/cfg80211.h +12 -0
@@ -3637,6 +3637,18 @@ void cfg80211_sched_scan_results(structvoid cfg80211_sched_scan_stopped (struct wiphy *wiphy);/** +* cfg80211_sched_scan_stopped_rtnl - notify that the scheduled scan has stopped +* +* @wiphy: the wiphy on which the scheduled scan stopped +* +* The driver can call this function to inform cfg80211 that the +* scheduled scan had to be stopped, for whatever reason. The driver +* is then called back via the sched_scan_stop operation when done. +* This function should be called with rtnl locked. +*/ +void cfg80211_sched_scan_stopped_rtnl (struct wiphy *wiphy); + +/** * cfg80211_inform_bss_width_frame - inform cfg80211 of a received BSS frame * * @wiphy: the wiphy reporting the BSS
net/wireless/scan.c +10 -2
@@ -284,14 +284,22 @@ void cfg80211_sched_scan_results(struct }EXPORT_SYMBOL (cfg80211_sched_scan_results); -void cfg80211_sched_scan_stopped (struct wiphy *wiphy) +void cfg80211_sched_scan_stopped_rtnl (struct wiphy *wiphy) {struct cfg80211_registered_device *rdev =wiphy_to_dev (wiphy); +ASSERT_RTNL (); +trace_cfg80211_sched_scan_stopped (wiphy); -rtnl_lock ();__cfg80211_stop_sched_scan (rdev, true); +} +EXPORT_SYMBOL (cfg80211_sched_scan_stopped_rtnl); + +void cfg80211_sched_scan_stopped (struct wiphy *wiphy) +{ +rtnl_lock (); +cfg80211_sched_scan_stopped_rtnl (wiphy);rtnl_unlock (); }EXPORT_SYMBOL (cfg80211_sched_scan_stopped);
Greg Kroah-Hartman
maintainerPATCH 34/228 mac80211: fix nested rtnl locking on ieee80211_reconfig
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eliad Peller <[email protected]>
commit e669ba2d06c6195662601956454ac959892f0762 upstream.
ieee80211_reconfig already holds rtnl, so callingcfg80211_sched_scan_stopped results in deadlock.
Use the rtnl-version of this function instead.
--- net/mac80211/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/util.c +1 -1
@@ -1754,7 +1754,7 @@ int ieee80211_reconfig(struct ieee80211_mutex_unlock (&local->mtx);if (sched_scan_stopped) -cfg80211_sched_scan_stopped (local->hw.wiphy); +cfg80211_sched_scan_stopped_rtnl (local->hw.wiphy);/* * If this is for hw restart things are still running.
Greg Kroah-Hartman
maintainerPATCH 35/228 mac80211: fix suspend vs. association race
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Emmanuel Grumbach <[email protected]>
commit c52666aef9f2dff39276eb53f15d99e2e229870f upstream.
If the association is in progress while we suspend, the stack will be in a messed up state. Clean it before we suspend.
This patch completes Johannes's patch:
1a1cb744de160ee70086a77afff605bbc275d291
Author: Johannes Berg <[email protected]>
mac80211: fix suspend vs. authentication race
--- net/mac80211/mlme.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
net/mac80211/mlme.c +13 -7
@@ -3511,18 +3511,24 @@ void ieee80211_mgd_quiesce(struct ieee80sdata_lock (sdata); -if (ifmgd->auth_data) { +if (ifmgd->auth_data || ifmgd->assoc_data) { +const u8 *bssid = ifmgd->auth_data ? + ifmgd->auth_data->bss->bssid : + ifmgd->assoc_data->bss->bssid; +/* -* If we are trying to authenticate while suspending, cfg80211 -* won't know and won't actually abort those attempts, thus we -* need to do that ourselves. +* If we are trying to authenticate / associate while suspending, +* cfg80211 won't know and won't actually abort those attempts, +* thus we need to do that ourselves. */ -ieee80211_send_deauth_disassoc (sdata, - ifmgd->auth_data->bss->bssid, +ieee80211_send_deauth_disassoc (sdata, bssid,IEEE80211_STYPE_DEAUTH ,WLAN_REASON_DEAUTH_LEAVING , false, frame_buf); -ieee80211_destroy_auth_data (sdata, false); +if (ifmgd->assoc_data) +ieee80211_destroy_assoc_data (sdata, false); +if (ifmgd->auth_data) +ieee80211_destroy_auth_data (sdata, false);cfg80211_tx_mlme_mgmt (sdata->dev, frame_buf,IEEE80211_DEAUTH_FRAME_LEN ); }
Greg Kroah-Hartman
maintainerPATCH 36/228 mac80211: fix on-channel remain-on-channel
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
commit b4b177a5556a686909e643f1e9b6434c10de079f upstream.
Jouni reported that if a remain-on-channel was active on the same channel as the current operating channel, then the ROC would start, but any frames transmitted using mgmt-tx on the same channel would get delayed until after the ROC.
The reason for this is that the ROC starts, but doesn't have any handling for "remain on the same channel", so it stops the interface queues. The later mgmt-tx then puts the frame on the interface queues (since it's on the current operating channel) and thus they get delayed until after the ROC.
To fix this, add some logic to handle remaining on the same channel specially and not stop the queues etc. in this case. This not only fixes the bug but also improves behaviour in this case as data frames etc. can continue to flow.
--- net/mac80211/ieee80211_i.h | 1 + net/mac80211/offchannel.c | 27 ++++++++++++++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-)
net/mac80211/ieee80211_i.h +1 -0
@@ -317,6 +317,7 @@ struct ieee80211_roc_work {bool started, abort, hw_begun, notified;bool to_be_freed; +bool on_channel;unsigned long hw_start_time;
net/mac80211/offchannel.c +20 -7
@@ -333,7 +333,7 @@ void ieee80211_sw_roc_work(struct work_s container_of(work, struct ieee80211_roc_work, work.work);struct ieee80211_sub_if_data *sdata = roc->sdata;struct ieee80211_local *local = sdata->local; -bool started; +bool started, on_channel;mutex_lock (&local->mtx);
@@ -354,14 +354,26 @@ void ieee80211_sw_roc_work(struct work_sif (!roc->started) {struct ieee80211_roc_work *dep; -/* start this ROC */ -ieee80211_offchannel_stop_vifs (local); +WARN_ON (local->use_chanctx); + +/* If actually operating on the desired channel (with at least +* 20 MHz channel width) don't stop all the operations but still +* treat it as though the ROC operation started properly, so +* other ROC operations won't interfere with this one. +*/ + roc->on_channel = roc->chan == local->_oper_chandef.chan && + local->_oper_chandef.width !=NL80211_CHAN_WIDTH_5 && + local->_oper_chandef.width !=NL80211_CHAN_WIDTH_10 ; -/* switch channel etc */ +/* start this ROC */ ieee80211_recalc_idle (local); - local->tmp_channel = roc->chan; -ieee80211_hw_config (local,0 ); +if (!roc->on_channel) { +ieee80211_offchannel_stop_vifs (local); + + local->tmp_channel = roc->chan; +ieee80211_hw_config (local,0 ); + }/* tell userspace or send frame */ ieee80211_handle_roc_started (roc);
@@ -380,9 +392,10 @@ void ieee80211_sw_roc_work(struct work_s finish:list_del (&roc->list); started = roc->started; + on_channel = roc->on_channel;ieee80211_roc_notify_destroy (roc, !roc->abort); -if (started) { +if (started && !on_channel) {ieee80211_flush_queues (local,NULL ); local->tmp_channel =NULL ;
Greg Kroah-Hartman
maintainerPATCH 37/228 mm, thp: close race between mremap() and split_huge_page()
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Kirill A. Shutemov" <[email protected]>
commit dd18dbc2d42af75fffa60c77e0f02220bc329829 upstream.
It's critical for split_huge_page() (and migration) to catch and freeze all PMDs on rmap walk. It gets tricky if there's concurrent fork() or mremap() since usually we copy/move page table entries on dup_mm() or move_page_tables() without rmap lock taken. To get it work we rely on rmap walk order to not miss any entry. We expect to see destination VMA after source one to work correctly.
But after switching rmap implementation to interval tree it's not always possible to preserve expected walk order.
It works fine for dup_mm() since new VMA has the same vma_start_pgoff() / vma_last_pgoff() and explicitly insert dst VMA after src one with vma_interval_tree_insert_after().
But on move_vma() destination VMA can be merged into adjacent one and as result shifted left in interval tree. Fortunately, we can detect the situation and prevent race with rmap walk by moving page table entries under rmap lock. See commit 38a76013ad80.
Problem is that we miss the lock when we move transhuge PMD. Most likely this bug caused the crash[1].
[1] http://thread.gmane.org/gmane.linux.kernel.mm/96473
--- mm/mremap.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
mm/mremap.c +8 -1
@@ -194,10 +194,17 @@ unsigned long move_page_tables(struct vmbreak ;if (pmd_trans_huge (*old_pmd)) {int err =0 ; -if (extent ==HPAGE_PMD_SIZE ) +if (extent ==HPAGE_PMD_SIZE ) { +VM_BUG_ON (vma->vm_file || !vma->anon_vma); +/* See comment in move_ptes() */ +if (need_rmap_locks) +anon_vma_lock_write (vma->anon_vma); err =move_huge_pmd (vma, new_vma, old_addr, new_addr, old_end, old_pmd, new_pmd); +if (need_rmap_locks) +anon_vma_unlock_write (vma->anon_vma); + }if (err >0 ) { need_flush = true;continue ;
Greg Kroah-Hartman
maintainerPATCH 38/228 drivers/rtc/rtc-hym8563.c: set uie_unsupported
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heiko Stuebner <[email protected]>
commit 282cba6b00a95f0277ed71551e3f6b0477e8836b upstream.
The alarm of the hym8563 only supports a minute accuracy, while the uie wants an alarm one second in the future. Therefore things like the select() syscall will fail with a timeout, because the next alarm will happen in a worst case of 60 seconds.
--- drivers/rtc/rtc-hym8563.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/rtc/rtc-hym8563.c +3 -0
@@ -569,6 +569,9 @@ static int hym8563_probe(struct i2c_clieif (IS_ERR (hym8563->rtc))return PTR_ERR (hym8563->rtc); +/* the hym8563 alarm only supports a minute accuracy */ + hym8563->rtc->uie_unsupported =1 ; +#ifdef CONFIG_COMMON_CLK hym8563_clkout_register_clk (hym8563);#endif
Greg Kroah-Hartman
maintainerPATCH 39/228 x86, mm, hugetlb: Add missing TLB page invalidation for hugetlb_cow()
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anthony Iliopoulos <[email protected]>
commit 9844f5462392b53824e8b86726e7c33b5ecbb676 upstream.
The invalidation is required in order to maintain proper semantics under CoW conditions. In scenarios where a process clones several threads, a thread operating on a core whose DTLB entry for a particular hugepage has not been invalidated, will be reading from the hugepage that belongs to the forked child process, even after hugetlb_cow().
The thread will not see the updated page as long as the stale DTLB entry remains cached, the thread attempts to write into the page, the child process exits, or the thread gets migrated to a different processor.
--- arch/x86/include/asm/hugetlb.h | 1 + 1 file changed, 1 insertion(+)
arch/x86/include/asm/hugetlb.h +1 -0
@@ -52,6 +52,7 @@ static inline pte_t huge_ptep_get_and_clstatic inline void huge_ptep_clear_flush (struct vm_area_struct *vma,unsigned long addr,pte_t *ptep) { +ptep_clear_flush (vma, addr, ptep); }static inline int huge_pte_none (pte_t pte)
Greg Kroah-Hartman
maintainerPATCH 40/228 arm64: fix pud_huge() for 2-level pagetables
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Salter <[email protected]>
commit 4797ec2dc83a43be35bad56037d1b53db9e2b5d5 upstream.
The following happens when trying to run a kvm guest on a kernel configured for 64k pages. This doesn't happen with 4k pages:
BUG: failure at include/linux/mm.h:297/put_page_testzero()! Kernel panic - not syncing: BUG! CPU: 2 PID: 4228 Comm: qemu-system-aar Tainted: GF 3.13.0-0.rc7.31.sa2.k32v1.aarch64.debug #1 Call trace: [<fffffe0000096034>] dump_backtrace+0x0/0x16c [<fffffe00000961b4>] show_stack+0x14/0x1c [<fffffe000066e648>] dump_stack+0x84/0xb0 [<fffffe0000668678>] panic+0xf4/0x220 [<fffffe000018ec78>] free_reserved_area+0x0/0x110 [<fffffe000018edd8>] free_pages+0x50/0x88 [<fffffe00000a759c>] kvm_free_stage2_pgd+0x30/0x40 [<fffffe00000a5354>] kvm_arch_destroy_vm+0x18/0x44 [<fffffe00000a1854>] kvm_put_kvm+0xf0/0x184 [<fffffe00000a1938>] kvm_vm_release+0x10/0x1c [<fffffe00001edc1c>] __fput+0xb0/0x288 [<fffffe00001ede4c>] ____fput+0xc/0x14 [<fffffe00000d5a2c>] task_work_run+0xa8/0x11c [<fffffe0000095c14>] do_notify_resume+0x54/0x58
In arch/arm/kvm/mmu.c:unmap_range(), we end up doing an extra put_page() on the stage2 pgd which leads to the BUG in put_page_testzero(). This happens because a pud_huge() test in unmap_range() returns true when it should always be false with 2-level pages tables used by 64k pages. This patch removes support for huge puds if 2-level pagetables are being used.
--- arch/arm64/mm/hugetlbpage.c | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm64/mm/hugetlbpage.c +4 -0
@@ -51,7 +51,11 @@ int pmd_huge(pmd_t pmd)int pud_huge (pud_t pud) { +#ifndef __PAGETABLE_PMD_FOLDEDreturn !(pud_val (pud) &PUD_TABLE_BIT ); +#else +return 0 ; +#endif }int pmd_huge_support (void )
Greg Kroah-Hartman
maintainerPATCH 41/228 hwpoison, hugetlb: lock_page/unlock_page does not match for handling a free hugepage
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Yucong <[email protected]>
commit b985194c8c0a130ed155b71662e39f7eaea4876f upstream.
For handling a free hugepage in memory failure, the race will happen if another thread hwpoisoned this hugepage concurrently. So we need to check PageHWPoison instead of !PageHWPoison.
If hwpoison_filter(p) returns true or a race happens, then we need to unlock_page(hpage).
--- mm/memory-failure.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
mm/memory-failure.c +8 -7
@@ -1085,15 +1085,16 @@ int memory_failure(unsigned long pfn, inreturn 0 ; }else if (PageHuge (hpage)) {/* -* Check "just unpoisoned", "filter hit", and -* "race with other subpage." +* Check "filter hit" and "race with other subpage." */ lock_page (hpage); -if (!PageHWPoison (hpage) - || (hwpoison_filter (p) &&TestClearPageHWPoison (p)) - || (p != hpage &&TestSetPageHWPoison (hpage))) { -atomic_long_sub (nr_pages, &num_poisoned_pages); -return 0 ; +if (PageHWPoison (hpage)) { +if ((hwpoison_filter (p) &&TestClearPageHWPoison (p)) + || (p != hpage &&TestSetPageHWPoison (hpage))) { +atomic_long_sub (nr_pages, &num_poisoned_pages); +unlock_page (hpage); +return 0 ; + } }set_page_hwpoison_huge_page (hpage); res =dequeue_hwpoisoned_huge_page (hpage);
Greg Kroah-Hartman
maintainerPATCH 42/228 iwlwifi: mvm: delay enabling smart FIFO until after beacon RX
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
commit 0229cdafb6f67064a217591d48b0f6abf14e8385 upstream.
If we have no beacon data before association, delay smart FIFO enablement until after we have this data.
Not doing so can cause association failures in extremely silent environments (usually only a shielded box/room) as beacon RX is not sent to the host immediately, and then the association time event ends without the host receiving any beacon even though it was on the air - it's just stuck on the FIFO.
--- drivers/net/wireless/iwlwifi/mvm/mac80211.c | 1 + drivers/net/wireless/iwlwifi/mvm/sf.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/iwlwifi/mvm/mac80211.c +1 -0
@@ -971,6 +971,7 @@ static void iwl_mvm_bss_info_changed_sta*/ iwl_mvm_remove_time_event (mvm, mvmvif, &mvmvif->time_event_data); +iwl_mvm_sf_update (mvm, vif, false); }else if (changes & (BSS_CHANGED_PS |BSS_CHANGED_P2P_PS |BSS_CHANGED_QOS )) { ret =iwl_mvm_power_update_mode (mvm, vif);
drivers/net/wireless/iwlwifi/mvm/sf.c +2 -1
@@ -274,7 +274,8 @@ int iwl_mvm_sf_update(struct iwl_mvm *mvreturn -EINVAL ;if (changed_vif->type !=NL80211_IFTYPE_STATION ) { new_state =SF_UNINIT ; - }else if (changed_vif->bss_conf.assoc) { + }else if (changed_vif->bss_conf.assoc && + changed_vif->bss_conf.dtim_period) { mvmvif =iwl_mvm_vif_from_mac80211 (changed_vif); sta_id = mvmvif->ap_sta_id; new_state =SF_FULL_ON ;
Greg Kroah-Hartman
maintainerPATCH 43/228 aio: fix potential leak in aio_run_iocb().
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leon Yu <[email protected]>
commit 754320d6e166d3a12cb4810a452bde00afbd4e9a upstream.
iovec should be reclaimed whenever caller of rw_copy_check_uvector() returns, but it doesn't hold when failure happens right after aio_setup_vectored_rw().
Fix that in a such way to avoid hairy goto.
--- fs/aio.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
fs/aio.c +2 -4
@@ -1299,10 +1299,8 @@ rw_common: &iovec, compat) :aio_setup_single_vector (req, rw, buf, &nr_segs, iovec); -if (ret) -return ret; - - ret =rw_verify_area (rw, file, &req->ki_pos, req->ki_nbytes); +if (!ret) + ret =rw_verify_area (rw, file, &req->ki_pos, req->ki_nbytes);if (ret <0 ) {if (iovec != &inline_vec)kfree (iovec);
Greg Kroah-Hartman
maintainerPATCH 44/228 module: remove warning about waiting module removal.
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rusty Russell <[email protected]>
commit 79465d2fd48e68940c2bdecddbdecd45bbba06fe upstream.
We remove the waiting module removal in commit 3f2b9c9cdf38 (September 2013), but it turns out that modprobe in kmod (< version 16) was asking for waiting module removal. No one noticed since modprobe would check for 0 usage immediately before trying to remove the module, and the race is unlikely.
However, it means that anyone running old (but not ancient) kmod versions is hitting the printk designed to see if anyone was running "rmmod -w". All reports so far have been false positives, so remove the warning.
--- kernel/module.c | 3 --- 1 file changed, 3 deletions(-)
kernel/module.c +0 -3
@@ -815,9 +815,6 @@ SYSCALL_DEFINE2(delete_module, const chareturn -EFAULT ; name[MODULE_NAME_LEN -1 ] ='\0' ; -if (!(flags &O_NONBLOCK )) -pr_warn ("waiting module removal not supported: please upgrade\n" ); -if (mutex_lock_interruptible (&module_mutex) !=0 )return -EINTR ;
Greg Kroah-Hartman
maintainerPATCH 45/228 Revert "hwmon: (coretemp) Refine TjMax detection"
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guenter Roeck <[email protected]>
commit c0940e95f7a78be0525c8d31df0b1f71e149e57e upstream.
This reverts commit 9fb6c9c73b11bef65ba80a362547fd116c1e1c9d.
Tjmax on some Intel CPUs is below 85 degrees C. One known example is L5630 with Tjmax of 71 degrees C. There are other Xeon processors with Tjmax of 70 or 80 degrees C. Also, the Intel IA32 System Programming document states that the temperature target is in bits 23:16 of MSR 0x1a2 (MSR_TEMPERATURE_TARGET), which is 8 bits, not 7.
So even if turbostat uses similar checks to validate Tjmax, there is no evidence that the checks are actually required. On the contrary, the checks are known to cause problems and therefore need to be removed.
This fixes https://bugzilla.kernel.org/show_bug.cgi?id=75071.
--- drivers/hwmon/coretemp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hwmon/coretemp.c +2 -2
@@ -369,12 +369,12 @@ static int get_tjmax(struct cpuinfo_x86if (cpu_has_tjmax (c))dev_warn (dev,"Unable to read TjMax from CPU %u\n" , id); }else { - val = (eax >>16 ) &0x7f ; + val = (eax >>16 ) &0xff ;/* * If the TjMax is not plausible, an assumption * will be used */ -if (val >=85 ) { +if (val) {dev_dbg (dev,"TjMax is %d degrees C\n" , val);return val *1000 ; }
Greg Kroah-Hartman
maintainerPATCH 46/228 hwmon: (emc1403) fix inverted store_hyst()
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Gajdusek <[email protected]>
commit 17c048fc4bd95efea208a1920f169547d8588f1f upstream.
Attempts to set the hysteresis value to a temperature below the target limit fails with "write error: Numerical result out of range" due to an inverted comparison.
--- drivers/hwmon/emc1403.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/emc1403.c +1 -1
@@ -163,7 +163,7 @@ static ssize_t store_hyst(struct deviceif (retval <0 ) goto fail; - hyst = val - retval *1000 ; + hyst = retval *1000 - val; hyst =DIV_ROUND_CLOSEST (hyst,1000 );if (hyst <0 || hyst >255 ) { retval = -ERANGE ;
Greg Kroah-Hartman
maintainerPATCH 47/228 hwmon: (emc1403) Fix resource leak on module unload
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jean Delvare <[email protected]>
commit 8759f9046550f463098148bf577ccd32cdb895e3 upstream.
Commit 454aee17f claims to convert driver emc1403 to use devm_hwmon_device_register_with_groups, however the patch itself makes use of hwmon_device_register_with_groups instead. As the driver remove function was still dropped, the hwmon device is no longer unregistered on driver removal, leading to a resource leak.
--- drivers/hwmon/emc1403.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/hwmon/emc1403.c +3 -3
@@ -355,9 +355,9 @@ static int emc1403_probe(struct i2c_clieif (id->driver_data) data->groups[1 ] = &emc1404_group; - hwmon_dev =hwmon_device_register_with_groups (&client->dev, - client->name, data, - data->groups); + hwmon_dev =devm_hwmon_device_register_with_groups (&client->dev, + client->name, data, + data->groups);if (IS_ERR (hwmon_dev))return PTR_ERR (hwmon_dev);
Greg Kroah-Hartman
maintainerPATCH 48/228 hwmon: (emc1403) Support full range of known chip revision numbers
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Gajdusek <[email protected]>
commit 3a18e1398fc2dc9c32bbdc50664da3a77959a8d1 upstream.
The datasheet for EMC1413/EMC1414, which is fully compatible to EMC1403/1404 and uses the same chip identification, references revision numbers 0x01, 0x03, and 0x04. Accept the full range of revision numbers from 0x01 to 0x04 to make sure none are missed.
--- drivers/hwmon/emc1403.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/emc1403.c +1 -1
@@ -330,7 +330,7 @@ static int emc1403_detect(struct i2c_cli } id =i2c_smbus_read_byte_data (client,THERMAL_REVISION_REG ); -if (id !=0x01 ) +if (id <0x01 || id >0x04 )return -ENODEV ;return 0 ;
Greg Kroah-Hartman
maintainerPATCH 49/228 drivercore: deferral race condition fix
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Grant Likely <[email protected]>
commit 58b116bce13612e5aa6fcd49ecbd4cf8bb59e835 upstream.
When the kernel is built with CONFIG_PREEMPT it is possible to reach a state when all modules loaded but some driver still stuck in the deferred list and there is a need for external event to kick the deferred queue to probe these drivers.
The issue has been observed on embedded systems with CONFIG_PREEMPT enabled, audio support built as modules and using nfsroot for root filesystem.
The following log fragment shows such sequence when all audio modules were loaded but the sound card is not present since the machine driver has failed to probe due to missing dependency during it's probe. The board is am335x-evmsk (McASP<->tlv320aic3106 codec) with davinci-evm machine driver:
...
[ 12.615118] davinci-mcasp 4803c000.mcasp: davinci_mcasp_probe: ENTER [ 12.719969] davinci_evm sound.3: davinci_evm_probe: ENTER [ 12.725753] davinci_evm sound.3: davinci_evm_probe: snd_soc_register_card [ 12.753846] davinci-mcasp 4803c000.mcasp: davinci_mcasp_probe: snd_soc_register_component [ 12.922051] davinci-mcasp 4803c000.mcasp: davinci_mcasp_probe: snd_soc_register_component DONE [ 12.950839] davinci_evm sound.3: ASoC: platform (null) not registered [ 12.957898] davinci_evm sound.3: davinci_evm_probe: snd_soc_register_card DONE (-517) [ 13.099026] davinci-mcasp 4803c000.mcasp: Kicking the deferred list [ 13.177838] davinci-mcasp 4803c000.mcasp: really_probe: probe_count = 2 [ 13.194130] davinci_evm sound.3: snd_soc_register_card failed (-517) [ 13.346755] davinci_mcasp_driver_init: LEAVE [ 13.377446] platform sound.3: Driver davinci_evm requests probe deferral [ 13.592527] platform sound.3: really_probe: probe_count = 0
In the log the machine driver enters it's probe at 12.719969 (this point it has been removed from the deferred lists). McASP driver already executing it's probing (since 12.615118).
The machine driver tries to construct the sound card (12.950839) but did not found one of the components so it fails. After this McASP driver registers all the ASoC components (the machine driver still in it's probe function after it failed to construct the card) and the deferred work is prepared at 13.099026 (note that this time the machine driver is not in the lists so it is not going to be handled when the work is executing). Lastly the machine driver exit from it's probe and the core places it to the deferred list but there will be no other driver going to load and the deferred queue is not going to be kicked again - till we have external event like connecting USB stick, etc.
The proposed solution is to try the deferred queue once more when the last driver is asking for deferring and we had drivers loaded while this last driver was probing.
This way we can avoid drivers stuck in the deferred queue.
--- drivers/base/dd.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
drivers/base/dd.c +17 -0
@@ -52,6 +52,7 @@ static DEFINE_MUTEX(deferred_probe_mutexstatic LIST_HEAD (deferred_probe_pending_list);static LIST_HEAD (deferred_probe_active_list);static struct workqueue_struct *deferred_wq; +static atomic_t deferred_trigger_count =ATOMIC_INIT (0 );/** * deferred_probe_work_func() - Retry probing devices in the active list.
@@ -135,6 +136,17 @@ static bool driver_deferred_probe_enable* This functions moves all devices from the pending list to the active * list and schedules the deferred probe workqueue to process them. It * should be called anytime a driver is successfully bound to a device. +* +* Note, there is a race condition in multi-threaded probe. In the case where +* more than one device is probing at the same time, it is possible for one +* probe to complete successfully while another is about to defer. If the second +* depends on the first, then it will get put on the pending list after the +* trigger event has already occured and will be stuck there. +* +* The atomic 'deferred_trigger_count' is used to determine if a successful +* trigger has occurred in the midst of probing a driver. If the trigger count +* changes in the midst of a probe, then deferred processing should be triggered +* again. */ static void driver_deferred_probe_trigger (void ) {
@@ -147,6 +159,7 @@ static void driver_deferred_probe_trigge* into the active list so they can be retried by the workqueue */ mutex_lock (&deferred_probe_mutex); +atomic_inc (&deferred_trigger_count);list_splice_tail_init (&deferred_probe_pending_list, &deferred_probe_active_list);mutex_unlock (&deferred_probe_mutex);
@@ -265,6 +278,7 @@ static DECLARE_WAIT_QUEUE_HEAD(probe_waistatic int really_probe (struct device *dev,struct device_driver *drv) {int ret =0 ; +int local_trigger_count =atomic_read (&deferred_trigger_count);atomic_inc (&probe_count); pr_debug("bus: '%s': %s: probing driver %s with device %s\n",
@@ -310,6 +324,9 @@ probe_failed:/* Driver requested deferred probing */ dev_info (dev,"Driver %s requests probe deferral\n" , drv->name);driver_deferred_probe_add (dev); +/* Did a trigger occur while probing? Need to re-trigger if yes */ +if (local_trigger_count !=atomic_read (&deferred_trigger_count)) +driver_deferred_probe_trigger (); }else if (ret != -ENODEV && ret != -ENXIO ) {/* driver matched but the probe failed */ printk(KERN_WARNING
Greg Kroah-Hartman
maintainerPATCH 50/228 hrtimer: Prevent all reprogramming if hang detected
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stuart Hayes <[email protected]>
commit 6c6c0d5a1c949d2e084706f9e5fb1fccc175b265 upstream.
If the last hrtimer interrupt detected a hang it sets hang_detected=1 and programs the clock event device with a delay to let the system make progress.
If hang_detected == 1, we prevent reprogramming of the clock event device in hrtimer_reprogram() but not in hrtimer_force_reprogram().
This can lead to the following situation:
hrtimer_interrupt()
hang_detected = 1;
program ce device to Xms from now (hang delay)
We have two timers pending:
T1 expires 50ms from now
T2 expires 5s from now
Now T1 gets canceled, which causes hrtimer_force_reprogram() to be invoked, which in turn programs the clock event device to T2 (5 seconds from now).
Any hrtimer_start after that will not reprogram the hardware due to hang_detected still being set. So we effectivly block all timers until the T2 event fires and cleans up the hang situation.
Add a check for hang_detected to hrtimer_force_reprogram() which prevents the reprogramming of the hang delay in the hardware timer. The subsequent hrtimer_interrupt will resolve all outstanding issues.
[ tglx: Rewrote subject and changelog and fixed up the comment in
hrtimer_force_reprogram() ]
--- kernel/hrtimer.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
kernel/hrtimer.c +17 -0
@@ -582,6 +582,23 @@ hrtimer_force_reprogram(struct hrtimer_c cpu_base->expires_next.tv64 = expires_next.tv64; +/* +* If a hang was detected in the last timer interrupt then we +* leave the hang delay active in the hardware. We want the +* system to make progress. That also prevents the following +* scenario: +* T1 expires 50ms from now +* T2 expires 5s from now +* +* T1 is removed, so this code is called and would reprogram +* the hardware to 5s from now. Any hrtimer_start after that +* will not reprogram the hardware due to hang_detected being +* set. So we'd effectivly block all timers until the T2 event +* fires. +*/ +if (cpu_base->hang_detected) +return ; +if (cpu_base->expires_next.tv64 !=KTIME_MAX )tick_program_event (cpu_base->expires_next,1 ); }
Greg Kroah-Hartman
maintainerPATCH 51/228 hrtimer: Prevent remote enqueue of leftmost timers
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leon Ma <[email protected]>
commit 012a45e3f4af68e86d85cce060c6c2fed56498b2 upstream.
If a cpu is idle and starts an hrtimer which is not pinned on that same cpu, the nohz code might target the timer to a different cpu.
In the case that we switch the cpu base of the timer we already have a sanity check in place, which determines whether the timer is earlier than the current leftmost timer on the target cpu. In that case we enqueue the timer on the current cpu because we cannot reprogram the clock event device on the target.
If the timers base is already the target CPU we do not have this sanity check in place so we enqueue the timer as the leftmost timer in the target cpus rb tree, but we cannot reprogram the clock event device on the target cpu. So the timer expires late and subsequently prevents the reprogramming of the target cpu clock event device until the previously programmed event fires or a timer with an earlier expiry time gets enqueued on the target cpu itself.
Add the same target check as we have for the switch base case and start the timer on the current cpu if it would become the leftmost timer on the target.
[ tglx: Rewrote subject and changelog ]
--- kernel/hrtimer.c | 5 +++++ 1 file changed, 5 insertions(+)
kernel/hrtimer.c +5 -0
@@ -247,6 +247,11 @@ again: goto again; } timer->base = new_base; + }else { +if (cpu != this_cpu &&hrtimer_check_target (timer, new_base)) { + cpu = this_cpu; + goto again; + } }return new_base; }
Greg Kroah-Hartman
maintainerPATCH 52/228 hrtimer: Set expiry time before switch_hrtimer_base()
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Viresh Kumar <[email protected]>
commit 84ea7fe37908254c3bd90910921f6e1045c1747a upstream.
switch_hrtimer_base() calls hrtimer_check_target() which ensures that we do not migrate a timer to a remote cpu if the timer expires before the current programmed expiry time on that remote cpu.
But __hrtimer_start_range_ns() calls switch_hrtimer_base() before the new expiry time is set. So the sanity check in hrtimer_check_target() is operating on stale or even uninitialized data.
Update expiry time before calling switch_hrtimer_base().
[ tglx: Rewrote changelog once again ]
--- kernel/hrtimer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/hrtimer.c +4 -4
@@ -1003,11 +1003,8 @@ int __hrtimer_start_range_ns(struct hrti/* Remove an active timer from the queue: */ ret =remove_hrtimer (timer, base); -/* Switch the timer base, if necessary: */ - new_base =switch_hrtimer_base (timer, base, mode &HRTIMER_MODE_PINNED ); -if (mode &HRTIMER_MODE_REL ) { - tim =ktime_add_safe (tim, new_base->get_time ()); + tim =ktime_add_safe (tim, base->get_time ());/* * CONFIG_TIME_LOW_RES is a temporary way for architectures * to signal that they simply return xtime in
@@ -1022,6 +1019,9 @@ int __hrtimer_start_range_ns(struct hrtihrtimer_set_expires_range_ns (timer, tim, delta_ns); +/* Switch the timer base, if necessary: */ + new_base =switch_hrtimer_base (timer, base, mode &HRTIMER_MODE_PINNED ); +timer_stats_hrtimer_set_start_info (timer); leftmost =enqueue_hrtimer (timer, new_base);
Greg Kroah-Hartman
maintainerPATCH 53/228 dm verity: fix biovecs hash calculation regression
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Milan Broz <[email protected]>
commit 3a7745215e7f73a5c7d9bcdc50661a55b39052a3 upstream.
Commit 003b5c5719f159f4f4bf97511c4702a0638313dd ("block: Convert drivers to immutable biovecs") incorrectly converted biovec iteration in dm-verity to always calculate the hash from a full biovec, but the function only needs to calculate the hash from part of the biovec (up to the calculated "todo" value).
Fix this issue by limiting hash input to only the requested data size.
This problem was identified using the cryptsetup regression test for veritysetup (verity-compat-test).
--- drivers/md/dm-verity.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
drivers/md/dm-verity.c +9 -6
@@ -330,15 +330,17 @@ test_block_hash:return r; } } - todo =1 << v->data_dev_block_bits; -while (io->iter.bi_size) { + do { u8 *page; + unsigned len; struct bio_vec bv = bio_iter_iovec(bio, io->iter); page = kmap_atomic(bv.bv_page); - r =crypto_shash_update (desc, page + bv.bv_offset, - bv.bv_len); + len = bv.bv_len; + if (likely(len >= todo)) + len = todo; + r = crypto_shash_update(desc, page + bv.bv_offset, len); kunmap_atomic(page); if (r < 0) {
@@ -346,8 +348,9 @@ test_block_hash:return r; } -bio_advance_iter (bio, &io->iter, bv.bv_len); - } +bio_advance_iter (bio, &io->iter, len); + todo -= len; + }while (todo);if (!v->version) { r =crypto_shash_update (desc, v->salt, v->salt_size);
Greg Kroah-Hartman
maintainerPATCH 54/228 dm cache: fix writethrough mode quiescing in cache_map
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Snitzer <[email protected]>
commit 131cd131a9ff63d4b84f3fe15073a2984ac30066 upstream.
Commit 2ee57d58735 ("dm cache: add passthrough mode") inadvertently removed the deferred set reference that was taken in cache_map()'s writethrough mode support. Restore taking this reference.
This issue was found with code inspection.
--- drivers/md/dm-cache-target.c | 1 + 1 file changed, 1 insertion(+)
drivers/md/dm-cache-target.c +1 -0
@@ -2506,6 +2506,7 @@ static int cache_map(struct dm_target *t }else {inc_hit_counter (cache, bio); + pb->all_io_entry =dm_deferred_entry_inc (cache->all_io_ds);if (bio_data_dir (bio) ==WRITE &&writethrough_mode (&cache->features) && !is_dirty (cache, lookup_result.cblock))
Greg Kroah-Hartman
maintainerPATCH 55/228 md/raid10: call wait_barrier() for each request submitted.
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: NeilBrown <[email protected]>
commit cc13b1d1500656a20e41960668f3392dda9fa6e2 upstream.
wait_barrier() includes a counter, so we must call it precisely once (unless balanced by allow_barrier()) for each request submitted.
Since
commit 20d0189b1012a37d2533a87fb451f7852f2418d1
block: Introduce new bio_split()
in 3.14-rc1, we don't call it for the extra requests generated when we need to split a bio.
When this happens the counter goes negative, any resync/recovery will never start, and "mdadm --stop" will hang.
--- drivers/md/raid10.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/md/raid10.c +7 -6
@@ -1172,6 +1172,13 @@ static void __make_request(struct mddevint max_sectors;int sectors; +/* +* Register the new request and wait if the reconstruction +* thread has put up a bar for new requests. +* Continue immediately if no resync is active currently. +*/ +wait_barrier (conf); + sectors =bio_sectors (bio); while (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) && bio->bi_iter.bi_sector < conf->reshape_progress &&
@@ -1552,12 +1559,6 @@ static void make_request(struct mddev *mmd_write_start (mddev, bio); -/* -* Register the new request and wait if the reconstruction -* thread has put up a bar for new requests. -* Continue immediately if no resync is active currently. -*/ -wait_barrier (conf); do {
Greg Kroah-Hartman
maintainerPATCH 56/228 md: avoid possible spinning md thread at shutdown.
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: NeilBrown <[email protected]>
commit 0f62fb220aa4ebabe8547d3a9ce4a16d3c045f21 upstream.
If an md array with externally managed metadata (e.g. DDF or IMSM) is in use, then we should not set safemode==2 at shutdown because:
1/ this is ineffective: user-space need to be involved in any 'safemode' handling, 2/ The safemode management code doesn't cope with safemode==2 on external metadata
and md_check_recover enters an infinite loop.
Even at shutdown, an infinite-looping process can be problematic, so this could cause shutdown to hang.
--- drivers/md/md.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/md/md.c +2 -1
@@ -8530,7 +8530,8 @@ static int md_notify_reboot(struct notifif (mddev_trylock (mddev)) {if (mddev->pers)__md_stop_writes (mddev); - mddev->safemode =2 ; +if (mddev->persistent) + mddev->safemode =2 ;mddev_unlock (mddev); } need_delay =1 ;
Greg Kroah-Hartman
maintainerPATCH 57/228 PNP / ACPI: Do not return errors if _DIS or _SRS are not present
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Rafael J. Wysocki" <[email protected]>
commit a8d22396302b7e4e5f0a594c1c1594388c29edaf upstream.
The ACPI PNP subsystem returns errors from pnpacpi_set_resources() and pnpacpi_disable_resources() if the _SRS or _DIS methods are not present, respectively, but it should not do that, because those methods are optional. For this reason, modify pnpacpi_set_resources() and pnpacpi_disable_resources(), respectively, to ignore missing _SRS or _DIS.
This problem has been uncovered by commit 202317a573b2 (ACPI / scan:
Add acpi_device objects for all device nodes in the namespace) and manifested itself by causing serial port suspend to fail on some systems.
References: https://bugzilla.kernel.org/show_bug.cgi?id=74371
--- drivers/pnp/pnpacpi/core.c | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-)
drivers/pnp/pnpacpi/core.c +26 -18
@@ -83,8 +83,7 @@ static int pnpacpi_set_resources(struct {struct acpi_device *acpi_dev;acpi_handle handle; -struct acpi_buffer buffer; -int ret; +int ret =0 ;pnp_dbg (&dev->dev,"set resources\n" );
@@ -97,19 +96,26 @@ static int pnpacpi_set_resources(structif (WARN_ON_ONCE (acpi_dev != dev->data)) dev->data = acpi_dev; - ret =pnpacpi_build_resource_template (dev, &buffer); -if (ret) -return ret; - ret =pnpacpi_encode_resources (dev, &buffer); -if (ret) { +if (acpi_has_method (handle,METHOD_NAME__SRS )) { +struct acpi_buffer buffer; + + ret =pnpacpi_build_resource_template (dev, &buffer); +if (ret) +return ret; + + ret =pnpacpi_encode_resources (dev, &buffer); +if (!ret) { +acpi_status status; + + status =acpi_set_current_resources (handle, &buffer); +if (ACPI_FAILURE (status)) + ret = -EIO ; + }kfree (buffer.pointer); -return ret; } -if (ACPI_FAILURE (acpi_set_current_resources (handle, &buffer))) - ret = -EINVAL ; -else if (acpi_bus_power_manageable (handle)) +if (!ret &&acpi_bus_power_manageable (handle)) ret =acpi_bus_set_power (handle,ACPI_STATE_D0 ); -kfree (buffer.pointer); +return ret; }
@@ -117,7 +123,7 @@ static int pnpacpi_disable_resources(str {struct acpi_device *acpi_dev;acpi_handle handle; -int ret; +acpi_status status;dev_dbg (&dev->dev,"disable resources\n" );
@@ -128,13 +134,15 @@ static int pnpacpi_disable_resources(str }/* acpi_unregister_gsi(pnp_irq(dev, 0)); */ - ret =0 ;if (acpi_bus_power_manageable (handle))acpi_bus_set_power (handle,ACPI_STATE_D3_COLD ); -/* continue even if acpi_bus_set_power() fails */ -if (ACPI_FAILURE (acpi_evaluate_object (handle,"_DIS" ,NULL ,NULL ))) - ret = -ENODEV ; -return ret; + +/* continue even if acpi_bus_set_power() fails */ + status =acpi_evaluate_object (handle,"_DIS" ,NULL ,NULL ); +if (ACPI_FAILURE (status) && status !=AE_NOT_FOUND ) +return -ENODEV ; + +return 0 ; }#ifdef CONFIG_ACPI_SLEEP
Greg Kroah-Hartman
maintainerPATCH 58/228 ACPI / EC: Process rather than discard events in acpi_ec_clear
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kieran Clancy <[email protected]>
commit 3eba563e280101209bad27d40bfc83ddf1489234 upstream.
Address a regression caused by commit ad332c8a4533:
(ACPI / EC: Clear stale EC events on Samsung systems)
After the earlier patch, there was found to be a race condition on some earlier Samsung systems (N150/N210/N220). The function acpi_ec_clear was sometimes discarding a new EC event before its GPE was triggered by the system. In the case of these systems, this meant that the "lid open" event was not registered on resume if that was the cause of the wake, leading to problems when attempting to close the lid to suspend again.
After testing on a number of Samsung systems, both those affected by the previous EC bug and those affected by the race condition, it seemed that the best course of action was to process rather than discard the events. On Samsung systems which accumulate stale EC events, there does not seem to be any adverse side-effects of running the associated _Q methods.
This patch adds an argument to the static function acpi_ec_sync_query so that it may be used within the acpi_ec_clear loop in place of acpi_ec_query_unlocked which was used previously.
With thanks to Stefan Biereigel for reporting the issue, and for all the people who helped test the new patch on affected systems.
References: https://lkml.kernel.org/r/[email protected]
References: https://bugzilla.kernel.org/show_bug.cgi?id=44161#c173
--- drivers/acpi/ec.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
drivers/acpi/ec.c +12 -9
@@ -206,13 +206,13 @@ unlock:spin_unlock_irqrestore (&ec->lock, flags); } -static int acpi_ec_sync_query (struct acpi_ec *ec); +static int acpi_ec_sync_query (struct acpi_ec *ec,u8 *data);static int ec_check_sci_sync (struct acpi_ec *ec,u8 state) {if (state &ACPI_EC_FLAG_SCI ) {if (!test_and_set_bit (EC_FLAGS_QUERY_PENDING , &ec->flags)) -return acpi_ec_sync_query (ec); +return acpi_ec_sync_query (ec,NULL ); }return 0 ; }
@@ -443,10 +443,8 @@ acpi_handle ec_get_handle(void)EXPORT_SYMBOL (ec_get_handle); -static int acpi_ec_query_unlocked (struct acpi_ec *ec,u8 *data); -/* -* Clears stale _Q events that might have accumulated in the EC. +* Process _Q events that might have accumulated in the EC. * Run with locked ec mutex. */ static void acpi_ec_clear (struct acpi_ec *ec)
@@ -455,7 +453,7 @@ static void acpi_ec_clear(struct acpi_ecu8 value =0 ;for (i =0 ; i <ACPI_EC_CLEAR_MAX ; i++) { - status =acpi_ec_query_unlocked (ec, &value); + status =acpi_ec_sync_query (ec, &value);if (status || !value)break ; }
@@ -582,13 +580,18 @@ static void acpi_ec_run(void *cxt)kfree (handler); } -static int acpi_ec_sync_query (struct acpi_ec *ec) +static int acpi_ec_sync_query (struct acpi_ec *ec,u8 *data) {u8 value =0 ;int status;struct acpi_ec_query_handler *handler, *copy; -if ((status =acpi_ec_query_unlocked (ec, &value))) + + status =acpi_ec_query_unlocked (ec, &value); +if (data) + *data = value; +if (status)return status; +list_for_each_entry (handler, &ec->list, node) {if (value == handler->query_bit) {/* have custom handler for this bit */
@@ -612,7 +615,7 @@ static void acpi_ec_gpe_query(void *ec_cif (!ec)return ;mutex_lock (&ec->mutex); -acpi_ec_sync_query (ec); +acpi_ec_sync_query (ec,NULL );mutex_unlock (&ec->mutex); }
Greg Kroah-Hartman
maintainerPATCH 59/228 irqchip: armada-370-xp: fix invalid cast of signed value into unsigned variable
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Petazzoni <[email protected]>
commit da343fc776e0bcb238b65d9d24610819b95d0ef4 upstream.
The armada_370_xp_alloc_msi() function returns a signed int, which is negative on error. However, we store the return value into an irq_hw_number_t, which is unsigned. Therefore, we actually never test if armada_370_xp_alloc_msi() returns an error or not, which may lead us to use hwirq numbers of as 0xffffffe4 (when armada_370_xp_alloc_msi() returns -ENOSPC).
This commit fixes that by storing the return value of armada_370_xp_alloc_msi() in a signed variable.
--- drivers/irqchip/irq-armada-370-xp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/irqchip/irq-armada-370-xp.c +1 -2
@@ -130,8 +130,7 @@ static int armada_370_xp_setup_msi_irq(s struct msi_desc *desc) {struct msi_msg msg; -irq_hw_number_t hwirq; -int virq; +int virq, hwirq; hwirq =armada_370_xp_alloc_msi ();if (hwirq <0 )
Greg Kroah-Hartman
maintainerPATCH 60/228 irqchip: armada-370-xp: implement the ->check_device() msi_chip operation
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Petazzoni <[email protected]>
commit 830cbe4b7a918613276aa3d3b28d24410623f92c upstream.
Until now, we were leaving the ->check_device() msi_chip operation empty, which leads the PCI core to believe that we support both MSI and MSI-X. In fact, we do not support MSI-X, so we have to tell this to the PCI core by providing an implementation of this operation.
--- drivers/irqchip/irq-armada-370-xp.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/irqchip/irq-armada-370-xp.c +10 -0
@@ -160,6 +160,15 @@ static void armada_370_xp_teardown_msi_iarmada_370_xp_free_msi (d->hwirq); } +static int armada_370_xp_check_msi_device (struct msi_chip *chip,struct pci_dev *dev, +int nvec,int type) +{ +/* We support MSI, but not MSI-X */ +if (type ==PCI_CAP_ID_MSI ) +return 0 ; +return -EINVAL ; +} +static struct irq_chip armada_370_xp_msi_irq_chip = { .name ="armada_370_xp_msi_irq" , .irq_enable = unmask_msi_irq,
@@ -198,6 +207,7 @@ static int armada_370_xp_msi_init(struct msi_chip->setup_irq = armada_370_xp_setup_msi_irq; msi_chip->teardown_irq = armada_370_xp_teardown_msi_irq; + msi_chip->check_device = armada_370_xp_check_msi_device; msi_chip->of_node = node; armada_370_xp_msi_domain =
Greg Kroah-Hartman
maintainerPATCH 61/228 irqchip: armada-370-xp: Fix releasing of MSIs
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Neil Greatorex <[email protected]>
commit ff3c664505bf8a8334bca5045e87b85cfe4d2277 upstream.
Store the value of d->hwirq in a local variable as the real value is wiped out by calling irq_dispose_mapping. Without this patch, the armada_370_xp_free_msi function would always free MSI#0, no matter what was passed to it.
--- drivers/irqchip/irq-armada-370-xp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/irqchip/irq-armada-370-xp.c +3 -1
@@ -156,8 +156,10 @@ static void armada_370_xp_teardown_msi_i unsigned int irq) {struct irq_data *d =irq_get_irq_data (irq); +unsigned long hwirq = d->hwirq; +irq_dispose_mapping (irq); -armada_370_xp_free_msi (d->hwirq); +armada_370_xp_free_msi (hwirq); } static int armada_370_xp_check_msi_device(struct msi_chip *chip, struct pci_dev *dev,
Greg Kroah-Hartman
maintainerPATCH 63/228 drm/i915: Dont check gmch state on inherited configs
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Vetter <[email protected]>
commit 9953599bc02dbc1d3330e6a0bfc6c50e9dffcac6 upstream.
... our current modeset code isn't good enough yet to handle this. The scenario is:
1. BIOS sets up a cloned config with lvds+external screen on the same pipe, e.g. pipe B.
2. We read out that state for pipe B and assign the gmch_pfit state to it.
3. The initial modeset switches the lvds to pipe A but due to lack of atomic modeset we don't recompute the config of pipe B.
-> both pipes now claim (in the sw pipe config structure) to use the gmch_pfit, which just won't work.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74081
--- drivers/gpu/drm/i915/intel_display.c | 23 ++++++++++++++++++----- drivers/gpu/drm/i915/intel_drv.h | 3 ++- 2 files changed, 20 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/intel_display.c +18 -5
@@ -9354,11 +9354,22 @@ intel_pipe_config_compare(struct drm_devPIPE_CONF_CHECK_I (pipe_src_w);PIPE_CONF_CHECK_I (pipe_src_h); -PIPE_CONF_CHECK_I (gmch_pfit.control); -/* pfit ratios are autocomputed by the hw on gen4+ */ -if (INTEL_INFO (dev)->gen <4 ) -PIPE_CONF_CHECK_I (gmch_pfit.pgm_ratios); -PIPE_CONF_CHECK_I (gmch_pfit.lvds_border_bits); +/* +* FIXME: BIOS likes to set up a cloned config with lvds+external +* screen. Since we don't yet re-compute the pipe config when moving +* just the lvds port away to another pipe the sw tracking won't match. +* +* Proper atomic modesets with recomputed global state will fix this. +* Until then just don't check gmch state for inherited modes. +*/ +if (!PIPE_CONF_QUIRK (PIPE_CONFIG_QUIRK_INHERITED_MODE )) { +PIPE_CONF_CHECK_I (gmch_pfit.control); +/* pfit ratios are autocomputed by the hw on gen4+ */ +if (INTEL_INFO (dev)->gen <4 ) +PIPE_CONF_CHECK_I (gmch_pfit.pgm_ratios); +PIPE_CONF_CHECK_I (gmch_pfit.lvds_border_bits); + } +PIPE_CONF_CHECK_I (pch_pfit.enabled);if (current_config->pch_pfit.enabled) {PIPE_CONF_CHECK_I (pch_pfit.pos);
@@ -11193,6 +11204,8 @@ static void intel_modeset_readout_hw_sta base.head) {memset (&crtc->config,0 ,sizeof (crtc->config)); + crtc->config.quirks |=PIPE_CONFIG_QUIRK_INHERITED_MODE ; + crtc->active = dev_priv->display.get_pipe_config (crtc, &crtc->config);
drivers/gpu/drm/i915/intel_drv.h +2 -1
@@ -219,7 +219,8 @@ struct intel_crtc_config {* tracked with quirk flags so that fastboot and state checker can act * accordingly. */ -#define PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS (1<<0)/* unreliable sync mode.flags */ +#define PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS (1<<0)/* unreliable sync mode.flags */ +#define PIPE_CONFIG_QUIRK_INHERITED_MODE (1<<1)/* mode inherited from firmware */ unsigned long quirks;/* User requested mode, only valid as a starting point to
Greg Kroah-Hartman
maintainerPATCH 64/228 drm/i915: Dont WARN nor handle unexpected hpd interrupts on gmch platforms
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Vetter <[email protected]>
commit 3ff04a160a891e56cdcee5c198d4c764d1c8c78b upstream.
The status bits are unconditionally set, the control bits only enable the actual interrupt generation. Which means if we get some random other interrupts we'll bogusly complain about them.
So restrict the WARN to platforms with a sane hotplug interrupt handling scheme. And even more important also don't attempt to process the hpd bit since we've detected a storm already. Instead just clear the bit silently.
This WARN has been introduced in
commit b8f102e8bf71cacf33326360fdf9dcfd1a63925b
Author: Egbert Eich <[email protected]> Date: Fri Jul 26 14:14:24 2013 +0200
drm/i915: Add messages useful for HPD storm detection debugging (v2)
before that we silently handled the hpd event and so partially defeated the storm detection.
v2: Pimp commit message (Jani)
--- drivers/gpu/drm/i915/i915_irq.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/i915_irq.c +14 -4
@@ -1252,10 +1252,20 @@ static inline void intel_hpd_irq_handlerspin_lock (&dev_priv->irq_lock);for (i =1 ; i <HPD_NUM_PINS ; i++) { -WARN_ONCE (hpd[i] & hotplug_trigger && - dev_priv->hpd_stats[i].hpd_mark ==HPD_DISABLED , -"Received HPD interrupt (0x%08x) on pin %d (0x%08x) although disabled\n" , - hotplug_trigger, i, hpd[i]); +if (hpd[i] & hotplug_trigger && + dev_priv->hpd_stats[i].hpd_mark ==HPD_DISABLED ) { +/* +* On GMCH platforms the interrupt mask bits only +* prevent irq generation, not the setting of the +* hotplug bits itself. So only WARN about unexpected +* interrupts on saner platforms. +*/ +WARN_ONCE (INTEL_INFO (dev)->gen >=5 && !IS_VALLEYVIEW (dev), +"Received HPD interrupt (0x%08x) on pin %d (0x%08x) although disabled\n" , + hotplug_trigger, i, hpd[i]); + +continue ; + }if (!(hpd[i] & hotplug_trigger) || dev_priv->hpd_stats[i].hpd_mark !=HPD_ENABLED )
Greg Kroah-Hartman
maintainerPATCH 65/228 drm/i915: Break encoder->crtc link separately in intel_sanitize_crtc()
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Egbert Eich <[email protected]>
commit 7f1950fbb989e8fc5463b307e062b4529d51c862 upstream.
Depending on the SDVO output_flags SDVO may have multiple connectors linking to the same encoder (in intel_connector->encoder->base). Only one of those connectors should be active (ie link to the encoder thru drm_connector->encoder).
If intel_connector_break_all_links() is called from intel_sanitize_crtc() we may break the crtc connection of an encoder thru an inactive connector in which case intel_connector_break_all_links() will not be called again for the active connector if this happens to come later in the list due to:
if (connector->encoder->base.crtc != &crtc->base)
continue;in intel_sanitize_crtc().
This will however leave the drm_connector->encoder linkage for this active connector in place. Subsequently this will cause multiple warnings in intel_connector_check_state() to trigger and the driver will eventually die in drm_encoder_crtc_ok() (because of crtc == NULL).
To avoid this remove intel_connector_break_all_links() and move its code to its two calling functions: intel_sanitize_crtc() and intel_sanitize_encoder().
This allows to implement the link breaking more flexibly matching the surrounding code: ie. in intel_sanitize_crtc() we can break the crtc link separatly after the links to the encoders have been broken which avoids above problem.
This regression has been introduced in:
commit 24929352481f085c5f85d4d4cbc919ddf106d381
Author: Daniel Vetter <[email protected]> Date: Mon Jul 2 20:28:59 2012 +0200
drm/i915: read out the modeset hw state at load and resume time
so goes back to the very beginning of the modeset rework.
v2: This patch takes care of the concernes voiced by Chris Wilson and Daniel Vetter that only breaking links if the drm_connector is linked to an encoder may miss some links.
v3: move all encoder handling to encoder loop as suggested by Daniel Vetter.
--- drivers/gpu/drm/i915/intel_display.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-)
drivers/gpu/drm/i915/intel_display.c +14 -12
@@ -10989,15 +10989,6 @@ void intel_modeset_init(struct drm_devicintel_disable_fbc (dev); } -static void -intel_connector_break_all_links (struct intel_connector *connector) -{ - connector->base.dpms =DRM_MODE_DPMS_OFF ; - connector->base.encoder =NULL ; - connector->encoder->connectors_active = false; - connector->encoder->base.crtc =NULL ; -} -static void intel_enable_pipe_a (struct drm_device *dev) {struct intel_connector *connector;
@@ -11079,8 +11070,17 @@ static void intel_sanitize_crtc(struct iif (connector->encoder->base.crtc != &crtc->base)continue ; -intel_connector_break_all_links (connector); + connector->base.dpms =DRM_MODE_DPMS_OFF ; + connector->base.encoder =NULL ; } +/* multiple connectors may have the same encoder: +* handle them and break crtc link separately */ +list_for_each_entry (connector, &dev->mode_config.connector_list, + base.head) +if (connector->encoder->base.crtc == &crtc->base) { + connector->encoder->base.crtc =NULL ; + connector->encoder->connectors_active = false; + }WARN_ON (crtc->active); crtc->base.enabled = false;
@@ -11151,6 +11151,8 @@ static void intel_sanitize_encoder(struc drm_get_encoder_name(&encoder->base)); encoder->disable (encoder); } + encoder->base.crtc =NULL ; + encoder->connectors_active = false;/* Inconsistent output/port/pipe state happens presumably due to * a bug in one of the get_hw_state functions. Or someplace else
@@ -11161,8 +11163,8 @@ static void intel_sanitize_encoder(struc base.head) {if (connector->encoder != encoder)continue ; - -intel_connector_break_all_links (connector); + connector->base.dpms =DRM_MODE_DPMS_OFF ; + connector->base.encoder =NULL ; } }/* Enabled encoders without active connectors will be fixed in
Greg Kroah-Hartman
maintainerPATCH 67/228 drm/radeon: fix runpm handling on APUs (v4)
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 90c4cde9d5a2bb6239cb3e253bb3832ed89dc75c upstream.
Don't try and runtime suspend the APU in PX systems. We only want to power down the dGPU.
v2: fix harder
v3: fix stupid typo
v4: consolidate runpm enablement to a single flag
bugs:
https://bugs.freedesktop.org/show_bug.cgi?id=75127
https://bugzilla.kernel.org/show_bug.cgi?id=72701
--- drivers/gpu/drm/radeon/radeon.h | 1 + drivers/gpu/drm/radeon/radeon_atpx_handler.c | 2 +- drivers/gpu/drm/radeon/radeon_device.c | 19 ++++++++++--------- drivers/gpu/drm/radeon/radeon_drv.c | 24 ++++-------------------- drivers/gpu/drm/radeon/radeon_family.h | 1 + drivers/gpu/drm/radeon/radeon_kms.c | 14 ++++++++++---- 6 files changed, 27 insertions(+), 34 deletions(-)
drivers/gpu/drm/radeon/radeon.h +1 -0
@@ -2242,6 +2242,7 @@ struct radeon_device {bool have_disp_power_ref; }; +bool radeon_is_px (struct drm_device *dev); int radeon_device_init(struct radeon_device *rdev, struct drm_device *ddev, struct pci_dev *pdev,
drivers/gpu/drm/radeon/radeon_atpx_handler.c +1 -1
@@ -59,7 +59,7 @@ struct atpx_mux {u16 mux; } __packed; -bool radeon_is_px (void ) { +bool radeon_has_atpx (void ) {return radeon_atpx_priv.atpx_detected; }
drivers/gpu/drm/radeon/radeon_device.c +10 -9
@@ -102,11 +102,14 @@ static const char radeon_family_name[][1 "LAST", }; -#if defined(CONFIG_VGA_SWITCHEROO ) -bool radeon_is_px (void ); -#else -static inline bool radeon_is_px (void ) {return false; } -#endif +bool radeon_is_px (struct drm_device *dev) +{ +struct radeon_device *rdev = dev->dev_private; + +if (rdev->flags &RADEON_IS_PX ) +return true; +return false; +}/** * radeon_program_register_sequence - program an array of registers.
@@ -1082,7 +1085,7 @@ static void radeon_switcheroo_set_state( {struct drm_device *dev =pci_get_drvdata (pdev); -if (radeon_is_px () && state ==VGA_SWITCHEROO_OFF ) +if (radeon_is_px (dev) && state ==VGA_SWITCHEROO_OFF )return ;if (state ==VGA_SWITCHEROO_ON ) {
@@ -1303,9 +1306,7 @@ int radeon_device_init(struct radeon_dev* ignore it */ vga_client_register (rdev->pdev, rdev,NULL , radeon_vga_set_decode); -if (radeon_runtime_pm ==1 ) - runtime = true; -if ((radeon_runtime_pm ==-1 ) &&radeon_is_px ()) +if (rdev->flags &RADEON_IS_PX ) runtime = true;vga_switcheroo_register_client (rdev->pdev, &radeon_switcheroo_ops, runtime);if (runtime)
drivers/gpu/drm/radeon/radeon_drv.c +4 -20
@@ -113,6 +113,7 @@ extern int radeon_get_crtc_scanoutpos(stunsigned int flags, int *vpos, int *hpos, ktime_t *stime, ktime_t *etime); +extern bool radeon_is_px (struct drm_device *dev);extern const struct drm_ioctl_desc radeon_ioctls_kms[];extern int radeon_max_kms_ioctl;int radeon_mmap (struct file *filp,struct vm_area_struct *vma);
@@ -142,11 +143,9 @@ void radeon_debugfs_cleanup(struct drm_m#if defined(CONFIG_VGA_SWITCHEROO )void radeon_register_atpx_handler (void );void radeon_unregister_atpx_handler (void ); -bool radeon_is_px (void );#else static inline void radeon_register_atpx_handler (void ) {}static inline void radeon_unregister_atpx_handler (void ) {} -static inline bool radeon_is_px (void ) {return false; }#endif int radeon_no_wb;
@@ -403,12 +402,7 @@ static int radeon_pmops_runtime_suspend(struct drm_device *drm_dev =pci_get_drvdata (pdev);int ret; -if (radeon_runtime_pm ==0 ) { -pm_runtime_forbid (dev); -return -EBUSY ; - } - -if (radeon_runtime_pm ==-1 && !radeon_is_px ()) { +if (!radeon_is_px (drm_dev)) {pm_runtime_forbid (dev);return -EBUSY ; }
@@ -432,10 +426,7 @@ static int radeon_pmops_runtime_resume(sstruct drm_device *drm_dev =pci_get_drvdata (pdev);int ret; -if (radeon_runtime_pm ==0 ) -return -EINVAL ; - -if (radeon_runtime_pm ==-1 && !radeon_is_px ()) +if (!radeon_is_px (drm_dev))return -EINVAL ; drm_dev->switch_power_state =DRM_SWITCH_POWER_CHANGING ;
@@ -460,14 +451,7 @@ static int radeon_pmops_runtime_idle(strstruct drm_device *drm_dev =pci_get_drvdata (pdev);struct drm_crtc *crtc; -if (radeon_runtime_pm ==0 ) { -pm_runtime_forbid (dev); -return -EBUSY ; - } - -/* are we PX enabled? */ -if (radeon_runtime_pm ==-1 && !radeon_is_px ()) { -DRM_DEBUG_DRIVER ("failing to power off - not px\n" ); +if (!radeon_is_px (drm_dev)) {pm_runtime_forbid (dev);return -EBUSY ; }
drivers/gpu/drm/radeon/radeon_family.h +1 -0
@@ -115,6 +115,7 @@ enum radeon_chip_flags {RADEON_NEW_MEMMAP =0x00400000UL ,RADEON_IS_PCI =0x00800000UL ,RADEON_IS_IGPGART =0x01000000UL , + RADEON_IS_PX = 0x02000000UL, };#endif
drivers/gpu/drm/radeon/radeon_kms.c +10 -4
@@ -35,9 +35,9 @@#include <linux/pm_runtime.h> #if defined(CONFIG_VGA_SWITCHEROO ) -bool radeon_is_px (void ); +bool radeon_has_atpx (void );#else -static inline bool radeon_is_px (void ) {return false; } +static inline bool radeon_has_atpx (void ) {return false; }#endif /**
@@ -107,6 +107,13 @@ int radeon_driver_load_kms(struct drm_de flags |=RADEON_IS_PCI ; } +if (radeon_runtime_pm ==1 ) + flags |=RADEON_IS_PX ; +else if ((radeon_runtime_pm ==-1 ) && +radeon_has_atpx () && + ((flags &RADEON_IS_IGP ) ==0 )) + flags |=RADEON_IS_PX ; +/* radeon_device_init should report only fatal error * like memory allocation failure or iomapping failure, * or memory manager initialization failure, it must
@@ -137,8 +144,7 @@ int radeon_driver_load_kms(struct drm_de "Error during ACPI methods call\n"); } -if ((radeon_runtime_pm ==1 ) || - ((radeon_runtime_pm ==-1 ) &&radeon_is_px ())) { +if (radeon_is_px (dev)) {pm_runtime_use_autosuspend (dev->dev);pm_runtime_set_autosuspend_delay (dev->dev,5000 );pm_runtime_set_active (dev->dev);
Greg Kroah-Hartman
maintainerPATCH 68/228 drm/radeon: disable mclk dpm on R7 260X
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 57700ad1f2f21d5d7ab7ee0e58d11b5954852434 upstream.
Setting higher mclks seems to cause stability issues on some R7 260X boards. Disable it for now for stability until we find a proper fix.
bug:
https://bugs.freedesktop.org/show_bug.cgi?id=75992
--- drivers/gpu/drm/radeon/ci_dpm.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/radeon/ci_dpm.c +4 -0
@@ -5106,6 +5106,10 @@ int ci_dpm_init(struct radeon_device *rd pi->mclk_dpm_key_disabled =0 ; pi->pcie_dpm_key_disabled =0 ; +/* mclk dpm is unstable on some R7 260X cards */ +if (rdev->pdev->device ==0x6658 ) + pi->mclk_dpm_key_disabled =1 ; + pi->caps_sclk_ds = true; pi->mclk_strobe_mode_threshold =40000 ;
Greg Kroah-Hartman
maintainerPATCH 69/228 drm/radeon: add support for newer mc ucode on SI (v2)
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 1ebe92802eaf0569784dce843bc28a78842d236c upstream.
May fix stability issues with some newer cards.
v2: print out mc firmware version used and size
--- drivers/gpu/drm/radeon/radeon_ucode.h | 3 ++ drivers/gpu/drm/radeon/si.c | 35 +++++++++++++++++++++------------- 2 files changed, 25 insertions(+), 13 deletions(-)
drivers/gpu/drm/radeon/radeon_ucode.h +3 -0
@@ -57,6 +57,9 @@#define BTC_MC_UCODE_SIZE 6024#define CAYMAN_MC_UCODE_SIZE 6037#define SI_MC_UCODE_SIZE 7769 +#define TAHITI_MC_UCODE_SIZE 7808 +#define PITCAIRN_MC_UCODE_SIZE 7775 +#define VERDE_MC_UCODE_SIZE 7875#define OLAND_MC_UCODE_SIZE 7863#define CIK_MC_UCODE_SIZE 7866#define HAWAII_MC_UCODE_SIZE 7933
drivers/gpu/drm/radeon/si.c +22 -13
@@ -39,30 +39,35 @@ MODULE_FIRMWARE("radeon/TAHITI_pfp.bin")MODULE_FIRMWARE ("radeon/TAHITI_me.bin" );MODULE_FIRMWARE ("radeon/TAHITI_ce.bin" );MODULE_FIRMWARE ("radeon/TAHITI_mc.bin" ); +MODULE_FIRMWARE ("radeon/TAHITI_mc2.bin" );MODULE_FIRMWARE ("radeon/TAHITI_rlc.bin" );MODULE_FIRMWARE ("radeon/TAHITI_smc.bin" );MODULE_FIRMWARE ("radeon/PITCAIRN_pfp.bin" );MODULE_FIRMWARE ("radeon/PITCAIRN_me.bin" );MODULE_FIRMWARE ("radeon/PITCAIRN_ce.bin" );MODULE_FIRMWARE ("radeon/PITCAIRN_mc.bin" ); +MODULE_FIRMWARE ("radeon/PITCAIRN_mc2.bin" );MODULE_FIRMWARE ("radeon/PITCAIRN_rlc.bin" );MODULE_FIRMWARE ("radeon/PITCAIRN_smc.bin" );MODULE_FIRMWARE ("radeon/VERDE_pfp.bin" );MODULE_FIRMWARE ("radeon/VERDE_me.bin" );MODULE_FIRMWARE ("radeon/VERDE_ce.bin" );MODULE_FIRMWARE ("radeon/VERDE_mc.bin" ); +MODULE_FIRMWARE ("radeon/VERDE_mc2.bin" );MODULE_FIRMWARE ("radeon/VERDE_rlc.bin" );MODULE_FIRMWARE ("radeon/VERDE_smc.bin" );MODULE_FIRMWARE ("radeon/OLAND_pfp.bin" );MODULE_FIRMWARE ("radeon/OLAND_me.bin" );MODULE_FIRMWARE ("radeon/OLAND_ce.bin" );MODULE_FIRMWARE ("radeon/OLAND_mc.bin" ); +MODULE_FIRMWARE ("radeon/OLAND_mc2.bin" );MODULE_FIRMWARE ("radeon/OLAND_rlc.bin" );MODULE_FIRMWARE ("radeon/OLAND_smc.bin" );MODULE_FIRMWARE ("radeon/HAINAN_pfp.bin" );MODULE_FIRMWARE ("radeon/HAINAN_me.bin" );MODULE_FIRMWARE ("radeon/HAINAN_ce.bin" );MODULE_FIRMWARE ("radeon/HAINAN_mc.bin" ); +MODULE_FIRMWARE ("radeon/HAINAN_mc2.bin" );MODULE_FIRMWARE ("radeon/HAINAN_rlc.bin" );MODULE_FIRMWARE ("radeon/HAINAN_smc.bin" );
@@ -1467,7 +1472,7 @@ int si_mc_load_microcode(struct radeon_dconst __be32 *fw_data;u32 running, blackout =0 ;u32 *io_mc_regs; -int i, ucode_size, regs_size; +int i, regs_size, ucode_size = rdev->mc_fw->size /4 ;if (!rdev->mc_fw)return -EINVAL ;
@@ -1475,28 +1480,23 @@ int si_mc_load_microcode(struct radeon_dswitch (rdev->family) {case CHIP_TAHITI : io_mc_regs = (u32 *)&tahiti_io_mc_regs; - ucode_size =SI_MC_UCODE_SIZE ; regs_size =TAHITI_IO_MC_REGS_SIZE ;break ;case CHIP_PITCAIRN : io_mc_regs = (u32 *)&pitcairn_io_mc_regs; - ucode_size =SI_MC_UCODE_SIZE ; regs_size =TAHITI_IO_MC_REGS_SIZE ;break ;case CHIP_VERDE :default : io_mc_regs = (u32 *)&verde_io_mc_regs; - ucode_size =SI_MC_UCODE_SIZE ; regs_size =TAHITI_IO_MC_REGS_SIZE ;break ;case CHIP_OLAND : io_mc_regs = (u32 *)&oland_io_mc_regs; - ucode_size =OLAND_MC_UCODE_SIZE ; regs_size =TAHITI_IO_MC_REGS_SIZE ;break ;case CHIP_HAINAN : io_mc_regs = (u32 *)&hainan_io_mc_regs; - ucode_size =OLAND_MC_UCODE_SIZE ; regs_size =TAHITI_IO_MC_REGS_SIZE ;break ; }
@@ -1552,7 +1552,7 @@ static int si_init_microcode(struct radeconst char *chip_name;const char *rlc_chip_name;size_t pfp_req_size, me_req_size, ce_req_size, rlc_req_size, mc_req_size; -size_t smc_req_size; +size_t smc_req_size, mc2_req_size;char fw_name[30 ];int err;
@@ -1567,6 +1567,7 @@ static int si_init_microcode(struct rade ce_req_size =SI_CE_UCODE_SIZE *4 ; rlc_req_size =SI_RLC_UCODE_SIZE *4 ; mc_req_size =SI_MC_UCODE_SIZE *4 ; + mc2_req_size =TAHITI_MC_UCODE_SIZE *4 ; smc_req_size =ALIGN (TAHITI_SMC_UCODE_SIZE ,4 );break ;case CHIP_PITCAIRN :
@@ -1577,6 +1578,7 @@ static int si_init_microcode(struct rade ce_req_size =SI_CE_UCODE_SIZE *4 ; rlc_req_size =SI_RLC_UCODE_SIZE *4 ; mc_req_size =SI_MC_UCODE_SIZE *4 ; + mc2_req_size =PITCAIRN_MC_UCODE_SIZE *4 ; smc_req_size =ALIGN (PITCAIRN_SMC_UCODE_SIZE ,4 );break ;case CHIP_VERDE :
@@ -1587,6 +1589,7 @@ static int si_init_microcode(struct rade ce_req_size =SI_CE_UCODE_SIZE *4 ; rlc_req_size =SI_RLC_UCODE_SIZE *4 ; mc_req_size =SI_MC_UCODE_SIZE *4 ; + mc2_req_size =VERDE_MC_UCODE_SIZE *4 ; smc_req_size =ALIGN (VERDE_SMC_UCODE_SIZE ,4 );break ;case CHIP_OLAND :
@@ -1596,7 +1599,7 @@ static int si_init_microcode(struct rade me_req_size =SI_PM4_UCODE_SIZE *4 ; ce_req_size =SI_CE_UCODE_SIZE *4 ; rlc_req_size =SI_RLC_UCODE_SIZE *4 ; - mc_req_size =OLAND_MC_UCODE_SIZE *4 ; + mc_req_size = mc2_req_size =OLAND_MC_UCODE_SIZE *4 ; smc_req_size =ALIGN (OLAND_SMC_UCODE_SIZE ,4 );break ;case CHIP_HAINAN :
@@ -1606,7 +1609,7 @@ static int si_init_microcode(struct rade me_req_size =SI_PM4_UCODE_SIZE *4 ; ce_req_size =SI_CE_UCODE_SIZE *4 ; rlc_req_size =SI_RLC_UCODE_SIZE *4 ; - mc_req_size =OLAND_MC_UCODE_SIZE *4 ; + mc_req_size = mc2_req_size =OLAND_MC_UCODE_SIZE *4 ; smc_req_size =ALIGN (HAINAN_SMC_UCODE_SIZE ,4 );break ;default :BUG ();
@@ -1659,16 +1662,22 @@ static int si_init_microcode(struct rade err = -EINVAL ; } -snprintf (fw_name,sizeof (fw_name),"radeon/%s_mc.bin" , chip_name); +snprintf (fw_name,sizeof (fw_name),"radeon/%s_mc2.bin" , chip_name); err =request_firmware (&rdev->mc_fw, fw_name, rdev->dev); -if (err) - goto out; -if (rdev->mc_fw->size != mc_req_size) { +if (err) { +snprintf (fw_name,sizeof (fw_name),"radeon/%s_mc.bin" , chip_name); + err =request_firmware (&rdev->mc_fw, fw_name, rdev->dev); +if (err) + goto out; + } +if ((rdev->mc_fw->size != mc_req_size) && + (rdev->mc_fw->size != mc2_req_size)) {printk (KERN_ERR "si_mc: Bogus length %zu in firmware \"%s\"\n" , rdev->mc_fw->size, fw_name); err = -EINVAL ; } +DRM_INFO ("%s: %zu bytes\n" , fw_name, rdev->mc_fw->size);snprintf (fw_name,sizeof (fw_name),"radeon/%s_smc.bin" , chip_name); err =request_firmware (&rdev->smc_fw, fw_name, rdev->dev);
Greg Kroah-Hartman
maintainerPATCH 70/228 drm/radeon: add support for newer mc ucode on CI (v2)
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 277babc374f6ecab6af182554f5d9f35a7768755 upstream.
Fixes mclk stability on certain asics.
v2: print out mc firmware version used and size
bug:
https://bugs.freedesktop.org/show_bug.cgi?id=75992
--- drivers/gpu/drm/radeon/cik.c | 26 +++++++++++++++++--------- drivers/gpu/drm/radeon/radeon_ucode.h | 4 +++- 2 files changed, 20 insertions(+), 10 deletions(-)
drivers/gpu/drm/radeon/cik.c +17 -9
@@ -38,6 +38,7 @@ MODULE_FIRMWARE("radeon/BONAIRE_me.bin")MODULE_FIRMWARE ("radeon/BONAIRE_ce.bin" );MODULE_FIRMWARE ("radeon/BONAIRE_mec.bin" );MODULE_FIRMWARE ("radeon/BONAIRE_mc.bin" ); +MODULE_FIRMWARE ("radeon/BONAIRE_mc2.bin" );MODULE_FIRMWARE ("radeon/BONAIRE_rlc.bin" );MODULE_FIRMWARE ("radeon/BONAIRE_sdma.bin" );MODULE_FIRMWARE ("radeon/BONAIRE_smc.bin" );
@@ -46,6 +47,7 @@ MODULE_FIRMWARE("radeon/HAWAII_me.bin");MODULE_FIRMWARE ("radeon/HAWAII_ce.bin" );MODULE_FIRMWARE ("radeon/HAWAII_mec.bin" );MODULE_FIRMWARE ("radeon/HAWAII_mc.bin" ); +MODULE_FIRMWARE ("radeon/HAWAII_mc2.bin" );MODULE_FIRMWARE ("radeon/HAWAII_rlc.bin" );MODULE_FIRMWARE ("radeon/HAWAII_sdma.bin" );MODULE_FIRMWARE ("radeon/HAWAII_smc.bin" );
@@ -1702,7 +1704,7 @@ int ci_mc_load_microcode(struct radeon_dconst __be32 *fw_data;u32 running, blackout =0 ;u32 *io_mc_regs; -int i, ucode_size, regs_size; +int i, regs_size, ucode_size = rdev->mc_fw->size /4 ;if (!rdev->mc_fw)return -EINVAL ;
@@ -1710,12 +1712,10 @@ int ci_mc_load_microcode(struct radeon_dswitch (rdev->family) {case CHIP_BONAIRE : io_mc_regs = (u32 *)&bonaire_io_mc_regs; - ucode_size =CIK_MC_UCODE_SIZE ; regs_size =BONAIRE_IO_MC_REGS_SIZE ;break ;case CHIP_HAWAII : io_mc_regs = (u32 *)&hawaii_io_mc_regs; - ucode_size =HAWAII_MC_UCODE_SIZE ; regs_size =HAWAII_IO_MC_REGS_SIZE ;break ;default :
@@ -1782,7 +1782,7 @@ static int cik_init_microcode(struct radconst char *chip_name;size_t pfp_req_size, me_req_size, ce_req_size, mec_req_size, rlc_req_size, mc_req_size =0 , - sdma_req_size, smc_req_size =0 ; + sdma_req_size, smc_req_size =0 , mc2_req_size =0 ;char fw_name[30 ];int err;
@@ -1796,7 +1796,8 @@ static int cik_init_microcode(struct rad ce_req_size =CIK_CE_UCODE_SIZE *4 ; mec_req_size =CIK_MEC_UCODE_SIZE *4 ; rlc_req_size =BONAIRE_RLC_UCODE_SIZE *4 ; - mc_req_size =CIK_MC_UCODE_SIZE *4 ; + mc_req_size =BONAIRE_MC_UCODE_SIZE *4 ; + mc2_req_size =BONAIRE_MC2_UCODE_SIZE *4 ; sdma_req_size =CIK_SDMA_UCODE_SIZE *4 ; smc_req_size =ALIGN (BONAIRE_SMC_UCODE_SIZE ,4 );break ;
@@ -1808,6 +1809,7 @@ static int cik_init_microcode(struct rad mec_req_size =CIK_MEC_UCODE_SIZE *4 ; rlc_req_size =BONAIRE_RLC_UCODE_SIZE *4 ; mc_req_size =HAWAII_MC_UCODE_SIZE *4 ; + mc2_req_size =HAWAII_MC2_UCODE_SIZE *4 ; sdma_req_size =CIK_SDMA_UCODE_SIZE *4 ; smc_req_size =ALIGN (HAWAII_SMC_UCODE_SIZE ,4 );break ;
@@ -1903,16 +1905,22 @@ static int cik_init_microcode(struct rad/* No SMC, MC ucode on APUs */ if (!(rdev->flags &RADEON_IS_IGP )) { -snprintf (fw_name,sizeof (fw_name),"radeon/%s_mc.bin" , chip_name); +snprintf (fw_name,sizeof (fw_name),"radeon/%s_mc2.bin" , chip_name); err =request_firmware (&rdev->mc_fw, fw_name, rdev->dev); -if (err) - goto out; -if (rdev->mc_fw->size != mc_req_size) { +if (err) { +snprintf (fw_name,sizeof (fw_name),"radeon/%s_mc.bin" , chip_name); + err =request_firmware (&rdev->mc_fw, fw_name, rdev->dev); +if (err) + goto out; + } +if ((rdev->mc_fw->size != mc_req_size) && + (rdev->mc_fw->size != mc2_req_size)){printk (KERN_ERR "cik_mc: Bogus length %zu in firmware \"%s\"\n" , rdev->mc_fw->size, fw_name); err = -EINVAL ; } +DRM_INFO ("%s: %zu bytes\n" , fw_name, rdev->mc_fw->size);snprintf (fw_name,sizeof (fw_name),"radeon/%s_smc.bin" , chip_name); err =request_firmware (&rdev->smc_fw, fw_name, rdev->dev);
drivers/gpu/drm/radeon/radeon_ucode.h +3 -1
@@ -61,8 +61,10 @@#define PITCAIRN_MC_UCODE_SIZE 7775#define VERDE_MC_UCODE_SIZE 7875#define OLAND_MC_UCODE_SIZE 7863 -#define CIK_MC_UCODE_SIZE 7866 +#define BONAIRE_MC_UCODE_SIZE 7866 +#define BONAIRE_MC2_UCODE_SIZE 7948#define HAWAII_MC_UCODE_SIZE 7933 +#define HAWAII_MC2_UCODE_SIZE 8091/* SDMA */ #define CIK_SDMA_UCODE_SIZE 1050
Greg Kroah-Hartman
maintainerPATCH 71/228 drm/radeon: re-enable mclk dpm on R7 260X asics
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 7e1858f9aff7d608b3d0abad4bda0130de887b89 upstream.
If the new mc ucode is available.
--- drivers/gpu/drm/radeon/ci_dpm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/ci_dpm.c +6 -2
@@ -21,8 +21,10 @@* */ +#include <linux/firmware.h> #include "drmP.h" #include "radeon.h" +#include "radeon_ucode.h" #include "cikd.h" #include "r600_dpm.h" #include "ci_dpm.h"
@@ -5106,9 +5108,11 @@ int ci_dpm_init(struct radeon_device *rd pi->mclk_dpm_key_disabled =0 ; pi->pcie_dpm_key_disabled =0 ; -/* mclk dpm is unstable on some R7 260X cards */ -if (rdev->pdev->device ==0x6658 ) +/* mclk dpm is unstable on some R7 260X cards with the old mc ucode */ +if ((rdev->pdev->device ==0x6658 ) && + (rdev->mc_fw->size == (BONAIRE_MC_UCODE_SIZE *4 ))) { pi->mclk_dpm_key_disabled =1 ; + } pi->caps_sclk_ds = true;
Greg Kroah-Hartman
maintainerPATCH 72/228 drm/radeon/si: make sure mc ucode is loaded before checking the size
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 8c79bae6a30f606b7a4e17c994bc5f72f8fdaf11 upstream.
Avoid a possible segfault.
--- drivers/gpu/drm/radeon/si.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/si.c +3 -1
@@ -1472,11 +1472,13 @@ int si_mc_load_microcode(struct radeon_dconst __be32 *fw_data;u32 running, blackout =0 ;u32 *io_mc_regs; -int i, regs_size, ucode_size = rdev->mc_fw->size /4 ; +int i, regs_size, ucode_size;if (!rdev->mc_fw)return -EINVAL ; + ucode_size = rdev->mc_fw->size /4 ; +switch (rdev->family) {case CHIP_TAHITI : io_mc_regs = (u32 *)&tahiti_io_mc_regs;
Greg Kroah-Hartman
maintainerPATCH 73/228 drm/radeon/ci: make sure mc ucode is loaded before checking the size
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit bcddee29b0b87af3aeda953840f97b356b24dc5e upstream.
Avoid a possible segfault.
--- drivers/gpu/drm/radeon/cik.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/cik.c +3 -1
@@ -1704,11 +1704,13 @@ int ci_mc_load_microcode(struct radeon_dconst __be32 *fw_data;u32 running, blackout =0 ;u32 *io_mc_regs; -int i, regs_size, ucode_size = rdev->mc_fw->size /4 ; +int i, regs_size, ucode_size;if (!rdev->mc_fw)return -EINVAL ; + ucode_size = rdev->mc_fw->size /4 ; +switch (rdev->family) {case CHIP_BONAIRE : io_mc_regs = (u32 *)&bonaire_io_mc_regs;
Greg Kroah-Hartman
maintainerPATCH 74/228 drm/radeon: properly unregister hwmon interface (v2)
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit cb3e4e7c59e4b43ac378631f6101f5c8de3a27a5 upstream.
Need to properly unregister the hwmon device on driver unload.
v2: minor clean up
bug:
https://bugzilla.kernel.org/show_bug.cgi?id=73931
--- drivers/gpu/drm/radeon/radeon_pm.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)
drivers/gpu/drm/radeon/radeon_pm.c +15 -6
@@ -603,7 +603,6 @@ static const struct attribute_group *hwmstatic int radeon_hwmon_init (struct radeon_device *rdev) {int err =0 ; -struct device *hwmon_dev;switch (rdev->pm.int_thermal_type) {case THERMAL_TYPE_RV6XX :
@@ -616,11 +615,11 @@ static int radeon_hwmon_init(struct radecase THERMAL_TYPE_KV :if (rdev->asic->pm.get_temperature ==NULL )return err; - hwmon_dev =hwmon_device_register_with_groups (rdev->dev, -"radeon" , rdev, - hwmon_groups); -if (IS_ERR (hwmon_dev)) { - err =PTR_ERR (hwmon_dev); + rdev->pm.int_hwmon_dev =hwmon_device_register_with_groups (rdev->dev, +"radeon" , rdev, + hwmon_groups); +if (IS_ERR (rdev->pm.int_hwmon_dev)) { + err =PTR_ERR (rdev->pm.int_hwmon_dev);dev_err (rdev->dev,"Unable to register hwmon device: %d\n" , err); }
@@ -632,6 +631,12 @@ static int radeon_hwmon_init(struct radereturn err; } +static void radeon_hwmon_fini (struct radeon_device *rdev) +{ +if (rdev->pm.int_hwmon_dev) +hwmon_device_unregister (rdev->pm.int_hwmon_dev); +} +static void radeon_dpm_thermal_work_handler (struct work_struct *work) { struct radeon_device *rdev =
@@ -1331,6 +1336,8 @@ static void radeon_pm_fini_old(struct radevice_remove_file (rdev->dev, &dev_attr_power_method); } +radeon_hwmon_fini (rdev); +if (rdev->pm.power_state)kfree (rdev->pm.power_state); }
@@ -1350,6 +1357,8 @@ static void radeon_pm_fini_dpm(struct ra }radeon_dpm_fini (rdev); +radeon_hwmon_fini (rdev); +if (rdev->pm.power_state)kfree (rdev->pm.power_state); }
Greg Kroah-Hartman
maintainerPATCH 76/228 drm/radeon/pm: dont walk the crtc list before it has been initialized (v2)
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 3ed9a335cfc64b2c83545f341cdddf2347b12b97 upstream.
Avoids a crash in certain cases when thermal irqs are generated before the display structures have been initialized.
v2: fix the vblank and vrefresh helpers as well
bug:
https://bugzilla.kernel.org/show_bug.cgi?id=73931
--- drivers/gpu/drm/radeon/r600_dpm.c | 35 +++++++++++++++++++---------------- drivers/gpu/drm/radeon/radeon_pm.c | 28 ++++++++++++++++------------ 2 files changed, 35 insertions(+), 28 deletions(-)
drivers/gpu/drm/radeon/r600_dpm.c +19 -16
@@ -158,16 +158,18 @@ u32 r600_dpm_get_vblank_time(struct radeu32 line_time_us, vblank_lines;u32 vblank_time_us =0xffffffff ;/* if the displays are off, vblank time is max */ -list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { - radeon_crtc =to_radeon_crtc (crtc); -if (crtc->enabled && radeon_crtc->enabled && radeon_crtc->hw_mode.clock) { - line_time_us = (radeon_crtc->hw_mode.crtc_htotal *1000 ) / - radeon_crtc->hw_mode.clock; - vblank_lines = radeon_crtc->hw_mode.crtc_vblank_end - - radeon_crtc->hw_mode.crtc_vdisplay + - (radeon_crtc->v_border *2 ); - vblank_time_us = vblank_lines * line_time_us; -break ; +if (rdev->num_crtc && rdev->mode_info.mode_config_initialized) { +list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { + radeon_crtc =to_radeon_crtc (crtc); +if (crtc->enabled && radeon_crtc->enabled && radeon_crtc->hw_mode.clock) { + line_time_us = (radeon_crtc->hw_mode.crtc_htotal *1000 ) / + radeon_crtc->hw_mode.clock; + vblank_lines = radeon_crtc->hw_mode.crtc_vblank_end - + radeon_crtc->hw_mode.crtc_vdisplay + + (radeon_crtc->v_border *2 ); + vblank_time_us = vblank_lines * line_time_us; +break ; + } } }
@@ -181,14 +183,15 @@ u32 r600_dpm_get_vrefresh(struct radeon_struct radeon_crtc *radeon_crtc;u32 vrefresh =0 ; -list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { - radeon_crtc =to_radeon_crtc (crtc); -if (crtc->enabled && radeon_crtc->enabled && radeon_crtc->hw_mode.clock) { - vrefresh = radeon_crtc->hw_mode.vrefresh; -break ; +if (rdev->num_crtc && rdev->mode_info.mode_config_initialized) { +list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { + radeon_crtc =to_radeon_crtc (crtc); +if (crtc->enabled && radeon_crtc->enabled && radeon_crtc->hw_mode.clock) { + vrefresh = radeon_crtc->hw_mode.vrefresh; +break ; + } } } -return vrefresh; }
drivers/gpu/drm/radeon/radeon_pm.c +16 -12
@@ -1384,12 +1384,14 @@ static void radeon_pm_compute_clocks_old rdev->pm.active_crtcs =0 ; rdev->pm.active_crtc_count =0 ; -list_for_each_entry (crtc, - &ddev->mode_config.crtc_list, head) { - radeon_crtc =to_radeon_crtc (crtc); -if (radeon_crtc->enabled) { - rdev->pm.active_crtcs |= (1 << radeon_crtc->crtc_id); - rdev->pm.active_crtc_count++; +if (rdev->num_crtc && rdev->mode_info.mode_config_initialized) { +list_for_each_entry (crtc, + &ddev->mode_config.crtc_list, head) { + radeon_crtc =to_radeon_crtc (crtc); +if (radeon_crtc->enabled) { + rdev->pm.active_crtcs |= (1 << radeon_crtc->crtc_id); + rdev->pm.active_crtc_count++; + } } }
@@ -1456,12 +1458,14 @@ static void radeon_pm_compute_clocks_dpm/* update active crtc counts */ rdev->pm.dpm.new_active_crtcs =0 ; rdev->pm.dpm.new_active_crtc_count =0 ; -list_for_each_entry (crtc, - &ddev->mode_config.crtc_list, head) { - radeon_crtc =to_radeon_crtc (crtc); -if (crtc->enabled) { - rdev->pm.dpm.new_active_crtcs |= (1 << radeon_crtc->crtc_id); - rdev->pm.dpm.new_active_crtc_count++; +if (rdev->num_crtc && rdev->mode_info.mode_config_initialized) { +list_for_each_entry (crtc, + &ddev->mode_config.crtc_list, head) { + radeon_crtc =to_radeon_crtc (crtc); +if (crtc->enabled) { + rdev->pm.dpm.new_active_crtcs |= (1 << radeon_crtc->crtc_id); + rdev->pm.dpm.new_active_crtc_count++; + } } }
Greg Kroah-Hartman
maintainerPATCH 77/228 drm/radeon: dont allow runpm=1 on systems with out ATPX
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 73acacc7397fe854ed2ab75f1c940fa00faaf15e upstream.
vgaswitcheroo and the ATPX ACPI methods are required to power down the dGPU.
bug:
https://bugzilla.kernel.org/show_bug.cgi?id=73901
--- drivers/gpu/drm/radeon/radeon_kms.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/gpu/drm/radeon/radeon_kms.c +3 -5
@@ -107,11 +107,9 @@ int radeon_driver_load_kms(struct drm_de flags |=RADEON_IS_PCI ; } -if (radeon_runtime_pm ==1 ) - flags |=RADEON_IS_PX ; -else if ((radeon_runtime_pm ==-1 ) && -radeon_has_atpx () && - ((flags &RADEON_IS_IGP ) ==0 )) +if ((radeon_runtime_pm !=0 ) && +radeon_has_atpx () && + ((flags &RADEON_IS_IGP ) ==0 )) flags |=RADEON_IS_PX ;/* radeon_device_init should report only fatal error
Greg Kroah-Hartman
maintainerPATCH 78/228 drm/radeon: disable dpm on rv770 by default
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 76e6dcece841faebbee78895780e8209ff40d922 upstream.
There seem to be stability issues on a number of cards.
bugs:
https://bugs.freedesktop.org/show_bug.cgi?id=76286
https://bugzilla.redhat.com/show_bug.cgi?id=1085785
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=741619
--- drivers/gpu/drm/radeon/radeon_pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_pm.c +1 -1
@@ -1240,6 +1240,7 @@ int radeon_pm_init(struct radeon_devicecase CHIP_RV670 :case CHIP_RS780 :case CHIP_RS880 : +case CHIP_RV770 :case CHIP_BARTS :case CHIP_TURKS :case CHIP_CAICOS :
@@ -1256,7 +1257,6 @@ int radeon_pm_init(struct radeon_deviceelse rdev->pm.pm_method =PM_METHOD_PROFILE ;break ; -case CHIP_RV770 :case CHIP_RV730 :case CHIP_RV710 :case CHIP_RV740 :
Greg Kroah-Hartman
maintainerPATCH 83/228 drm/tegra: Remove gratuitous pad field
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thierry Reding <[email protected]>
commit cbfbbabb89b37f6bad05f478d906a385149f288d upstream.
The version of the drm_tegra_submit structure that was merged all the way back in 3.10 contains a pad field that was originally intended to properly pad the following __u64 field. Unfortunately it seems like a different field was dropped during review that caused this padding to become unnecessary, but the pad field wasn't removed at that time.
One possible side-effect of this is that since the __u64 following the pad is now no longer properly aligned, the compiler may (or may not) introduce padding itself, which results in no predictable ABI.
Rectify this by removing the pad field so that all fields are again naturally aligned. Technically this is breaking existing userspace ABI, but given that there aren't any (released) userspace drivers that make use of this yet, the fallout should be minimal.
--- include/uapi/drm/tegra_drm.h | 1 - 1 file changed, 1 deletion(-)
include/uapi/drm/tegra_drm.h +0 -1
@@ -114,7 +114,6 @@ struct drm_tegra_submit {__u32 num_waitchks;__u32 waitchk_mask;__u32 timeout; -__u32 pad;__u64 syncpts;__u64 cmdbufs;__u64 relocs;
Greg Kroah-Hartman
maintainerPATCH 84/228 clk: tegra: Fix wrong value written to PLLE_AUX
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tuomas Tynkkynen <[email protected]>
commit d2c834abe2b39a2d5a6c38ef44de87c97cbb34b4 upstream.
The value written to PLLE_AUX was incorrect due to a wrong variable being used. Without this fix SATA does not work.
--- drivers/clk/tegra/clk-pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/tegra/clk-pll.c +1 -1
@@ -1718,7 +1718,7 @@ struct clk *tegra_clk_register_plle_tegr "pll_re_vco"); }else { val_aux &= ~(PLLE_AUX_PLLRE_SEL |PLLE_AUX_PLLP_SEL ); -pll_writel (val, pll_params->aux_reg, pll); +pll_writel (val_aux, pll_params->aux_reg, pll); } clk = _tegra_clk_register_pll(pll, name, parent_name, flags,
Greg Kroah-Hartman
maintainerPATCH 85/228 iio:imu:mpu6050: Fixed segfault in Invensens MPU driver due to null dereference
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Atilla Filiz <[email protected]>
commit b9b3a41893c3f1be67b5aacfa525969914bea0e9 upstream.
The driver segfaults when the kernel boots with device tree as the platform data is then not present and the pointer is deferenced without checking it is not null. This patch introduces such a check avoiding the crash.
--- drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +5 -2
@@ -661,6 +661,7 @@ static int inv_mpu_probe(struct i2c_clie { struct inv_mpu6050_state *st; struct iio_dev *indio_dev; + struct inv_mpu6050_platform_data *pdata; int result; if (!i2c_check_functionality(client->adapter,
@@ -673,8 +674,10 @@ static int inv_mpu_probe(struct i2c_clie st =iio_priv (indio_dev); st->client = client; - st->plat_data = *(struct inv_mpu6050_platform_data - *)dev_get_platdata (&client->dev); + pdata = (struct inv_mpu6050_platform_data + *)dev_get_platdata (&client->dev); +if (pdata) + st->plat_data = *pdata;/* power is turned on inside check chip type*/ result =inv_check_and_setup_chip (st, id);if (result)
Greg Kroah-Hartman
maintainerPATCH 86/228 fsl-usb: do not test for PHY_CLK_VALID bit on controller version 1.6
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nikita Yushchenko <[email protected]>
commit d183c81929beeba842b74422f754446ef2b8b49c upstream.
Per reference manuals of Freescale P1020 and P2020 SoCs, USB controller present in these SoCs has bit 17 of USBx_CONTROL register marked as Reserved - there is no PHY_CLK_VALID bit there.
Testing for this bit in ehci_fsl_setup_phy() behaves differently on two P1020RDB boards available here - on one board test passes and fsl-usb init succeeds, but on other board test fails, causing fsl-usb init to fail.
This patch changes ehci_fsl_setup_phy() not to test PHY_CLK_VALID on controller version 1.6 that (per manual) does not have this bit.
--- drivers/usb/host/ehci-fsl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/host/ehci-fsl.c +2 -1
@@ -248,7 +248,8 @@ static int ehci_fsl_setup_phy(struct usbbreak ; } -if (pdata->have_sysif_regs && pdata->controller_ver && +if (pdata->have_sysif_regs && + pdata->controller_ver >FSL_USB_VER_1_6 && (phy_mode ==FSL_USB2_PHY_ULPI )) {/* check PHY_CLK_VALID to get phy clk valid */ if (!(spin_event_timeout(in_be32(non_ehci + FSL_SOC_USB_CTRL) &
Greg Kroah-Hartman
maintainerPATCH 87/228 usb: gadget: at91-udc: fix irq and iomem resource retrieval
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jean-Jacques Hiblot <[email protected]>
commit 886c7c426d465732ec9d1b2bbdda5642fc2e7e05 upstream.
When using dt resources retrieval (interrupts and reg properties) there is no predefined order for these resources in the platform dev resource table. Also don't expect the number of resource to be always 2.
--- drivers/usb/gadget/at91_udc.c | 10 ---------- 1 file changed, 10 deletions(-)
drivers/usb/gadget/at91_udc.c +0 -10
@@ -1709,16 +1709,6 @@ static int at91udc_probe(struct platformreturn -ENODEV ; } -if (pdev->num_resources !=2 ) { -DBG ("invalid num_resources\n" ); -return -ENODEV ; - } -if ((pdev->resource[0 ].flags !=IORESOURCE_MEM ) - || (pdev->resource[1 ].flags !=IORESOURCE_IRQ )) { -DBG ("invalid resource type\n" ); -return -ENODEV ; - } - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 );if (!res)return -ENXIO ;
Greg Kroah-Hartman
maintainerPATCH 90/228 usb: storage: shuttle_usbat: fix discs being detected twice
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniele Forsi <[email protected]>
commit df602c2d2358f02c6e49cffc5b49b9daa16db033 upstream.
Even if the USB-to-ATAPI converter supported multiple LUNs, this driver would always detect the same physical device or media because it doesn't use srb->device->lun in any way.
Tested with an Hewlett-Packard CD-Writer Plus 8200e.
--- drivers/usb/storage/shuttle_usbat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/storage/shuttle_usbat.c +1 -1
@@ -1851,7 +1851,7 @@ static int usbat_probe(struct usb_interf us->transport_name ="Shuttle USBAT" ; us->transport = usbat_flash_transport; us->transport_reset = usb_stor_CB_reset; - us->max_lun =1 ; + us->max_lun =0 ; result =usb_stor_probe2 (us);return result;
Greg Kroah-Hartman
maintainerPATCH 91/228 USB: Nokia 305 should be treated as unusual dev
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Victor A. Santos" <[email protected]>
commit f0ef5d41792a46a1085dead9dfb0bdb2c574638e upstream.
--- drivers/usb/storage/unusual_devs.h | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/usb/storage/unusual_devs.h +7 -0
@@ -234,6 +234,13 @@ UNUSUAL_DEV( 0x0421, 0x0495, 0x0370, 0x USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_MAX_SECTORS_64 ), +/* Patch submitted by Victor A. Santos <[email protected]> */ +UNUSUAL_DEV (0x0421 ,0x05af ,0x0742 ,0x0742 , +"Nokia" , +"305" , +USB_SC_DEVICE ,USB_PR_DEVICE ,NULL , +US_FL_MAX_SECTORS_64 ), +/* Patch submitted by Mikhail Zolotaryov <[email protected]> */ UNUSUAL_DEV( 0x0421, 0x06aa, 0x1110, 0x1110, "Nokia",
Greg Kroah-Hartman
maintainerPATCH 92/228 USB: Nokia 5300 should be treated as unusual dev
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniele Forsi <[email protected]>
commit 6ed07d45d09bc2aa60e27b845543db9972e22a38 upstream.
--- drivers/usb/storage/unusual_devs.h | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/usb/storage/unusual_devs.h +7 -0
@@ -234,6 +234,13 @@ UNUSUAL_DEV( 0x0421, 0x0495, 0x0370, 0x USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_MAX_SECTORS_64 ), +/* Reported by Daniele Forsi <[email protected]> */ +UNUSUAL_DEV (0x0421 ,0x04b9 ,0x0350 ,0x0350 , +"Nokia" , +"5300" , +USB_SC_DEVICE ,USB_PR_DEVICE ,NULL , +US_FL_MAX_SECTORS_64 ), +/* Patch submitted by Victor A. Santos <[email protected]> */ UNUSUAL_DEV( 0x0421, 0x05af, 0x0742, 0x0742, "Nokia",
Greg Kroah-Hartman
maintainerPATCH 93/228 rt2x00: fix beaconing on USB
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanislaw Gruszka <[email protected]>
commit 8834d3608cc516f13e2e510f4057c263f3d2ce42 upstream.
When disable beaconing we clear register with beacon and newer set it back, what make we stop send beacons infinitely.
--- drivers/net/wireless/rt2x00/rt2x00mac.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-)
drivers/net/wireless/rt2x00/rt2x00mac.c +12 -10
@@ -621,20 +621,18 @@ void rt2x00mac_bss_info_changed(struct i bss_conf->bssid);/* -* Update the beacon. This is only required on USB devices. PCI -* devices fetch beacons periodically. -*/ -if (changes &BSS_CHANGED_BEACON &&rt2x00_is_usb (rt2x00dev)) -rt2x00queue_update_beacon (rt2x00dev, vif); - -/* * Start/stop beaconing. */ if (changes &BSS_CHANGED_BEACON_ENABLED ) {if (!bss_conf->enable_beacon && intf->enable_beacon) { -rt2x00queue_clear_beacon (rt2x00dev, vif); rt2x00dev->intf_beaconing--; intf->enable_beacon = false; +/* +* Clear beacon in the H/W for this vif. This is needed +* to disable beaconing on this particular interface +* and keep it running on other interfaces. +*/ +rt2x00queue_clear_beacon (rt2x00dev, vif);if (rt2x00dev->intf_beaconing ==0 ) {/*
@@ -645,11 +643,15 @@ void rt2x00mac_bss_info_changed(struct irt2x00queue_stop_queue (rt2x00dev->bcn);mutex_unlock (&intf->beacon_skb_mutex); } - - }else if (bss_conf->enable_beacon && !intf->enable_beacon) { rt2x00dev->intf_beaconing++; intf->enable_beacon = true; +/* +* Upload beacon to the H/W. This is only required on +* USB devices. PCI devices fetch beacons periodically. +*/ +if (rt2x00_is_usb (rt2x00dev)) +rt2x00queue_update_beacon (rt2x00dev, vif);if (rt2x00dev->intf_beaconing ==1 ) {/*
Greg Kroah-Hartman
maintainerPATCH 94/228 ALSA: usb-audio: work around corrupted TEAC UD-H01 feedback data
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Clemens Ladisch <[email protected]>
commit 7040b6d1febfdbd9c1595efb751d492cd2503f96 upstream.
The TEAC UD-H01 firmware sends wrong feedback frequency values, thus causing the PC to send the samples at a wrong rate, which results in clicks and crackles in the output.
Add a workaround to detect and fix the corruption.
[[email protected]: use sender->udh01_fb_quirk rather than
ep->udh01_fb_quirk in snd_usb_handle_sync_urb()]
--- sound/usb/card.h | 1 + sound/usb/endpoint.c | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-)
sound/usb/card.h +1 -0
@@ -92,6 +92,7 @@ struct snd_usb_endpoint {unsigned int curframesize;/* current packet size in frames (for capture) */ unsigned int syncmaxsize;/* sync endpoint packet size */ unsigned int fill_max:1; /* fill max packet size always */ + unsigned int udh01_fb_quirk:1; /* corrupted feedback data */unsigned int datainterval;/* log_2 of data packet interval */ unsigned int syncinterval;/* P for adaptive mode, 0 otherwise */ unsigned char silence_value;
sound/usb/endpoint.c +14 -1
@@ -469,6 +469,10 @@ struct snd_usb_endpoint *snd_usb_add_end ep->syncinterval =3 ; ep->syncmaxsize =le16_to_cpu (get_endpoint (alts,1 )->wMaxPacketSize); + +if (chip->usb_id ==USB_ID (0x0644 ,0x8038 )/* TEAC UD-H01 */ && + ep->syncmaxsize ==4 ) + ep->udh01_fb_quirk =1 ; }list_add_tail (&ep->list, &chip->ep_list);
@@ -1099,7 +1103,16 @@ void snd_usb_handle_sync_urb(struct snd_if (f ==0 )return ; -if (unlikely (ep->freqshift ==INT_MIN )) { +if (unlikely (sender->udh01_fb_quirk)) { +/* +* The TEAC UD-H01 firmware sometimes changes the feedback value +* by +/- 0x1.0000. +*/ +if (f < ep->freqn -0x8000 ) + f +=0x10000 ; +else if (f > ep->freqn +0x8000 ) + f -=0x10000 ; + }else if (unlikely (ep->freqshift ==INT_MIN )) {/* * The first time we see a feedback value, determine its format * by shifting it left or right until it matches the nominal
Greg Kroah-Hartman
maintainerPATCH 95/228 Bluetooth: Fix triggering BR/EDR L2CAP Connect too early
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hedberg <[email protected]>
commit 9eb1fbfa0a737fd4d3a6d12d71c5ea9af622b887 upstream.
Commit 1c2e004183178 introduced an event handler for the encryption key refresh complete event with the intent of fixing some LE/SMP cases. However, this event is shared with BR/EDR and there we actually want to act only on the auth_complete event (which comes after the key refresh).
If we do not do this we may trigger an L2CAP Connect Request too early and cause the remote side to return a security block error.
--- net/bluetooth/hci_event.c | 6 ++++++ 1 file changed, 6 insertions(+)
net/bluetooth/hci_event.c +6 -0
@@ -3006,6 +3006,12 @@ static void hci_key_refresh_complete_evtif (!conn) goto unlock; +/* For BR/EDR the necessary steps are taken through the +* auth_complete event. +*/ +if (conn->type !=LE_LINK ) + goto unlock; +if (!ev->status) conn->sec_level = conn->pending_sec_level;
Greg Kroah-Hartman
maintainerPATCH 96/228 Bluetooth: Fix redundant encryption request for reauthentication
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hedberg <[email protected]>
commit 09da1f3463eb81d59685df723b1c5950b7570340 upstream.
When we're performing reauthentication (in order to elevate the security level from an unauthenticated key to an authenticated one) we do not need to issue any encryption command once authentication completes. Since the trigger for the encryption HCI command is the ENCRYPT_PEND flag this flag should not be set in this scenario. Instead, the REAUTH_PEND flag takes care of all necessary steps for reauthentication.
--- net/bluetooth/hci_conn.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
net/bluetooth/hci_conn.c +6 -3
@@ -752,14 +752,17 @@ static int hci_conn_auth(struct hci_connif (!test_and_set_bit (HCI_CONN_AUTH_PEND , &conn->flags)) {struct hci_cp_auth_requested cp; -/* encrypt must be pending if auth is also pending */ -set_bit (HCI_CONN_ENCRYPT_PEND , &conn->flags); - cp.handle =cpu_to_le16 (conn->handle);hci_send_cmd (conn->hdev,HCI_OP_AUTH_REQUESTED ,sizeof (cp), &cp); + +/* If we're already encrypted set the REAUTH_PEND flag, +* otherwise set the ENCRYPT_PEND. +*/ if (conn->key_type !=0xff )set_bit (HCI_CONN_REAUTH_PEND , &conn->flags); +else +set_bit (HCI_CONN_ENCRYPT_PEND , &conn->flags); }return 0 ;
Greg Kroah-Hartman
maintainerPATCH 97/228 Bluetooth: Add support for Lite-on [04ca:3007]
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mohammed Habibulla <[email protected]>
commit 1fb4e09a7e780b915dbd172592ae7e2a4c071065 upstream.
Add support for the AR9462 chip
T: Bus=01 Lev=01 Prnt=01 Port=03 Cnt=03 Dev#= 3 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=04ca ProdID=3007 Rev= 0.01 C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms
--- drivers/bluetooth/ath3k.c | 2 ++ drivers/bluetooth/btusb.c | 1 + 2 files changed, 3 insertions(+)
drivers/bluetooth/ath3k.c +2 -0
@@ -82,6 +82,7 @@ static const struct usb_device_id ath3k_ { USB_DEVICE(0x04CA, 0x3004) }, { USB_DEVICE(0x04CA, 0x3005) }, { USB_DEVICE(0x04CA, 0x3006) }, + { USB_DEVICE(0x04CA, 0x3007) }, { USB_DEVICE(0x04CA, 0x3008) }, { USB_DEVICE(0x04CA, 0x300b) }, { USB_DEVICE(0x13d3, 0x3362) },
@@ -127,6 +128,7 @@ static const struct usb_device_id ath3k_ { USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x04ca, 0x3006), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x04ca, 0x3007), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x04ca, 0x300b), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
drivers/bluetooth/btusb.c +1 -0
@@ -149,6 +149,7 @@ static const struct usb_device_id blackl { USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x04ca, 0x3006), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x04ca, 0x3007), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x04ca, 0x300b), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
Greg Kroah-Hartman
maintainerPATCH 98/228 Revert "Bluetooth: Enable autosuspend for Intel Bluetooth device"
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marcel Holtmann <[email protected]>
commit 3c49aa852e00978ba2f1a4d1e4598a0c669a5347 upstream.
This reverts commit d2bee8fb6e18f6116aada39851918473761f7ab1.
Enabling autosuspend for Intel Bluetooth devices has been shown to not work reliable. It does work for some people with certain combinations of USB host controllers, but for others it puts the device to sleep and it will not wake up for any event.
These events can be important ones like HCI Inquiry Complete or HCI Connection Request. The events will arrive as soon as you poke the device with a new command, but that is not something we can do in these cases.
Initially there were patches to the xHCI USB controller that fixed this for some people, but not for all. This could be well a problem somewhere in the USB subsystem or in the USB host controllers or just plain a hardware issue somewhere. At this moment we just do not know and the only safe action is to revert this patch.
--- drivers/bluetooth/btusb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/bluetooth/btusb.c +1 -3
@@ -1479,10 +1479,8 @@ static int btusb_probe(struct usb_interfif (id->driver_info &BTUSB_BCM92035 ) hdev->setup = btusb_setup_bcm92035; -if (id->driver_info &BTUSB_INTEL ) { -usb_enable_autosuspend (data->udev); +if (id->driver_info &BTUSB_INTEL ) hdev->setup = btusb_setup_intel; - }/* Interface numbers are hardcoded in the specification */ data->isoc =usb_ifnum_to_if (data->udev,1 );
Greg Kroah-Hartman
maintainerPATCH 99/228 posix_acl: handle NULL ACL in posix_acl_equiv_mode
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christoph Hellwig <[email protected]>
commit 50c6e282bdf5e8dabf8d7cf7b162545a55645fd9 upstream.
Various filesystems don't bother checking for a NULL ACL in posix_acl_equiv_mode, and thus can dereference a NULL pointer when it gets passed one. This usually happens from the NFS server, as the ACL tools never pass a NULL ACL, but instead of one representing the mode bits.
Instead of adding boilerplat to all filesystems put this check into one place, which will allow us to remove the check from other filesystems as well later on.
--- fs/posix_acl.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/posix_acl.c +6 -0
@@ -246,6 +246,12 @@ posix_acl_equiv_mode(const struct posix_umode_t mode =0 ;int not_equiv =0 ; +/* +* A null ACL can always be presented as mode bits. +*/ +if (!acl) +return 0 ; + FOREACH_ACL_ENTRY(pa, acl, pe) {switch (pa->e_tag) {case ACL_USER_OBJ :
Greg Kroah-Hartman
maintainerPATCH 100/228 fs/affs/super.c: bugfix / double free
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fabian Frederick <[email protected]>
commit d353efd02357a74753cd45f367a2d3d357fd6904 upstream.
Commit 842a859db26b ("affs: use ->kill_sb() to simplify ->put_super() and failure exits of ->mount()") adds .kill_sb which frees sbi but doesn't remove sbi free in case of parse_options error causing double free+random crash.
--- fs/affs/super.c | 2 -- 1 file changed, 2 deletions(-)
fs/affs/super.c +0 -2
@@ -336,8 +336,6 @@ static int affs_fill_super(struct super_ &blocksize,&sbi->s_prefix, sbi->s_volume, &mount_flags)) {printk (KERN_ERR "AFFS: Error parsing options\n" ); -kfree (sbi->s_prefix); -kfree (sbi);return -EINVAL ; }/* N.B. after this point s_prefix must be released */
Greg Kroah-Hartman
maintainerPATCH 101/228 mm/page-writeback.c: fix divide by zero in pos_ratio_polynom
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rik van Riel <[email protected]>
commit d5c9fde3dae750889168807038243ff36431d276 upstream.
It is possible for "limit - setpoint + 1" to equal zero, after getting truncated to a 32 bit variable, and resulting in a divide by zero error.
Using the fully 64 bit divide functions avoids this problem. It also will cause pos_ratio_polynom() to return the correct value when (setpoint - limit) exceeds 2^32.
Also uninline pos_ratio_polynom, at Andrew's request.
--- mm/page-writeback.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
mm/page-writeback.c +3 -3
@@ -593,14 +593,14 @@ unsigned long bdi_dirty_limit(struct bac* (5) the closer to setpoint, the smaller |df/dx| (and the reverse) * => fast response on large errors; small oscillation near setpoint */ -static inline long long pos_ratio_polynom (unsigned long setpoint, +static long long pos_ratio_polynom (unsigned long setpoint,unsigned long dirty,unsigned long limit) {long long pos_ratio;long x; - x =div_s64 (((s64 )setpoint - (s64 )dirty) <<RATELIMIT_CALC_SHIFT , + x =div64_s64 (((s64 )setpoint - (s64 )dirty) <<RATELIMIT_CALC_SHIFT , limit - setpoint +1 ); pos_ratio = x; pos_ratio = pos_ratio * x >>RATELIMIT_CALC_SHIFT ;
@@ -842,7 +842,7 @@ static unsigned long bdi_position_ratio( x_intercept = bdi_setpoint + span;if (bdi_dirty < x_intercept - span /4 ) { - pos_ratio =div_u64 (pos_ratio * (x_intercept - bdi_dirty), + pos_ratio =div64_u64 (pos_ratio * (x_intercept - bdi_dirty), x_intercept - bdi_setpoint +1 ); }else pos_ratio /=4 ;
Greg Kroah-Hartman
maintainerPATCH 102/228 mm/compaction: make isolate_freepages start at pageblock boundary
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vlastimil Babka <[email protected]>
commit 49e068f0b73dd042c186ffa9b420a9943e90389a upstream.
The compaction freepage scanner implementation in isolate_freepages() starts by taking the current cc->free_pfn value as the first pfn. In a for loop, it scans from this first pfn to the end of the pageblock, and then subtracts pageblock_nr_pages from the first pfn to obtain the first pfn for the next for loop iteration.
This means that when cc->free_pfn starts at offset X rather than being aligned on pageblock boundary, the scanner will start at offset X in all scanned pageblock, ignoring potentially many free pages. Currently this can happen when
a) zone's end pfn is not pageblock aligned, or
b) through zone->compact_cached_free_pfn with CONFIG_HOLES_IN_ZONE enabled and a hole spanning the beginning of a pageblock
This patch fixes the problem by aligning the initial pfn in isolate_freepages() to pageblock boundary. This also permits replacing the end-of-pageblock alignment within the for loop with a simple pageblock_nr_pages increment.
--- mm/compaction.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-)
mm/compaction.c +12 -10
@@ -666,16 +666,20 @@ static void isolate_freepages(struct zon struct compact_control *cc) {struct page *page; -unsigned long high_pfn, low_pfn, pfn, z_end_pfn, end_pfn; +unsigned long high_pfn, low_pfn, pfn, z_end_pfn;int nr_freepages = cc->nr_freepages;struct list_head *freelist = &cc->freepages;/* * Initialise the free scanner. The starting point is where we last -* scanned from (or the end of the zone if starting). The low point -* is the end of the pageblock the migration scanner is using. +* successfully isolated from, zone-cached value, or the end of the +* zone when isolating for the first time. We need this aligned to +* the pageblock boundary, because we do pfn -= pageblock_nr_pages +* in the for loop. +* The low boundary is the end of the pageblock the migration scanner +* is using. */ - pfn = cc->free_pfn; + pfn = cc->free_pfn & ~(pageblock_nr_pages-1 ); low_pfn =ALIGN (cc->migrate_pfn +1 , pageblock_nr_pages);/*
@@ -695,6 +699,7 @@ static void isolate_freepages(struct zonfor (; pfn >= low_pfn && cc->nr_migratepages > nr_freepages; pfn -= pageblock_nr_pages) {unsigned long isolated; +unsigned long end_pfn;/* * This can iterate a massively long zone without finding any
@@ -729,13 +734,10 @@ static void isolate_freepages(struct zon isolated =0 ;/* -* As pfn may not start aligned, pfn+pageblock_nr_page -* may cross a MAX_ORDER_NR_PAGES boundary and miss -* a pfn_valid check. Ensure isolate_freepages_block() -* only scans within a pageblock +* Take care when isolating in last pageblock of a zone which +* ends in the middle of a pageblock. */ - end_pfn =ALIGN (pfn +1 , pageblock_nr_pages); - end_pfn =min (end_pfn, z_end_pfn); + end_pfn =min (pfn + pageblock_nr_pages, z_end_pfn); isolated =isolate_freepages_block (cc, pfn, end_pfn, freelist, false); nr_freepages += isolated;
Greg Kroah-Hartman
maintainerPATCH 103/228 revert "mm: vmscan: do not swap anon pages just because free+file is low"
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Weiner <[email protected]>
commit 623762517e2370be3b3f95f4fe08d6c063a49b06 upstream.
This reverts commit 0bf1457f0cfc ("mm: vmscan: do not swap anon pages just because free+file is low") because it introduced a regression in mostly-anonymous workloads, where reclaim would become ineffective and trap every allocating task in direct reclaim.
The problem is that there is a runaway feedback loop in the scan balance between file and anon, where the balance tips heavily towards a tiny thrashing file LRU and anonymous pages are no longer being looked at. The commit in question removed the safe guard that would detect such situations and respond with forced anonymous reclaim.
This commit was part of a series to fix premature swapping in loads with relatively little cache, and while it made a small difference, the cure is obviously worse than the disease. Revert it.
--- mm/vmscan.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
mm/vmscan.c +18 -0
@@ -1916,6 +1916,24 @@ static void get_scan_count(struct lruvec }/* +* Prevent the reclaimer from falling into the cache trap: as +* cache pages start out inactive, every cache fault will tip +* the scan balance towards the file LRU. And as the file LRU +* shrinks, so does the window for rotation from references. +* This means we have a runaway feedback loop where a tiny +* thrashing file LRU becomes infinitely more attractive than +* anon pages. Try to detect this based on file LRU size. +*/ +if (global_reclaim (sc)) { +unsigned long free =zone_page_state (zone,NR_FREE_PAGES ); + +if (unlikely (file + free <=high_wmark_pages (zone))) { + scan_balance =SCAN_ANON ; + goto out; + } + } + +/* * There is enough inactive page cache, do not reclaim * anything from the anonymous working set right now. */
Re: [PATCH 3.14 103/228] revert "mm: vmscan: do not swap anon pages just because free+file is low"
Quoted 4 lines · Greg Kroah-Hartman
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
Quoted 8 lines
From: Johannes Weiner <[email protected]>
commit
623762517e2370be3b3f95f4fe08d6c063a49b06upstream.This reverts commit
0bf1457f0cfc("mm: vmscan: do not swap anon pages just because free+file is low") because it introduced a regression in mostly-anonymous workloads, where reclaim would become ineffective and trap every allocating task in direct reclaim.
[...]
That commit was not included in 3.14 or in subsequent stable updates, so this 'revert' is not approriate. We now have duplicate checks:
/*
* If it's foreseeable that reclaiming the file cache won't be
* enough to get the zone back into a desirable shape, we have
* to swap. Better start now and leave the - probably heavily
* thrashing - remaining file pages alone.
*/
if (global_reclaim(sc)) {
free = zone_page_state(zone, NR_FREE_PAGES);
if (unlikely(file + free <= high_wmark_pages(zone))) {
scan_balance = SCAN_ANON;
goto out;
}
}
/*
* Prevent the reclaimer from falling into the cache trap: as
* cache pages start out inactive, every cache fault will tip
* the scan balance towards the file LRU. And as the file LRU
* shrinks, so does the window for rotation from references.
* This means we have a runaway feedback loop where a tiny
* thrashing file LRU becomes infinitely more attractive than
* anon pages. Try to detect this based on file LRU size.
*/
if (global_reclaim(sc)) {
unsigned long free = zone_page_state(zone, NR_FREE_PAGES);
if (unlikely(file + free <= high_wmark_pages(zone))) {
scan_balance = SCAN_ANON;
goto out;
}
}Ben.
Signature · 2 lines
Ben Hutchings Never attribute to conspiracy what can adequately be explained by stupidity.
Greg Kroah-Hartman
maintainerRe: [PATCH 3.14 103/228] revert "mm: vmscan: do not swap anon pages just because free+file is low"
Quoted 50 lines · Ben Hutchings
Quoted 4 lines · Greg Kroah-Hartman
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
Quoted 8 lines
From: Johannes Weiner <[email protected]>
commit
623762517e2370be3b3f95f4fe08d6c063a49b06upstream.This reverts commit
0bf1457f0cfc("mm: vmscan: do not swap anon pages just because free+file is low") because it introduced a regression in mostly-anonymous workloads, where reclaim would become ineffective and trap every allocating task in direct reclaim.[...]
That commit was not included in 3.14 or in subsequent stable updates, so this 'revert' is not approriate. We now have duplicate checks:
/* * If it's foreseeable that reclaiming the file cache won't be * enough to get the zone back into a desirable shape, we have * to swap. Better start now and leave the - probably heavily * thrashing - remaining file pages alone. */ if (global_reclaim(sc)) { free = zone_page_state(zone, NR_FREE_PAGES); if (unlikely(file + free <= high_wmark_pages(zone))) { scan_balance = SCAN_ANON; goto out; } } /* * Prevent the reclaimer from falling into the cache trap: as * cache pages start out inactive, every cache fault will tip * the scan balance towards the file LRU. And as the file LRU * shrinks, so does the window for rotation from references. * This means we have a runaway feedback loop where a tiny * thrashing file LRU becomes infinitely more attractive than * anon pages. Try to detect this based on file LRU size. */ if (global_reclaim(sc)) { unsigned long free = zone_page_state(zone, NR_FREE_PAGES); if (unlikely(file + free <= high_wmark_pages(zone))) { scan_balance = SCAN_ANON; goto out; } }
Quoted 1 line
Ben.
Ugh, good catch, thanks for this. I'll go revert it now.
greg k-h
Greg Kroah-Hartman
maintainerPATCH 104/228 ARM: orion5x: fix target ID for crypto SRAM window
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Petazzoni <[email protected]>
commit 1cc9d48145b81e307fab94a5cf6ee66ec2f0de60 upstream.
In commit 4ca2c04085a1caa903e92a5fc0da25362150aac2 ('ARM: orion5x:
Move to ID based window creation'), the mach-orion5x code was changed to use the new mvebu-mbus API. However, in the process, a mistake was made on the crypto SRAM window target ID: it should have been 0x9 (verified in the datasheet) and not 0x0.
--- arch/arm/mach-orion5x/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-orion5x/common.h +1 -1
@@ -21,7 +21,7 @@ struct mv_sata_platform_data;#define ORION_MBUS_DEVBUS_BOOT_ATTR 0x0f#define ORION_MBUS_DEVBUS_TARGET (cs) 0x01#define ORION_MBUS_DEVBUS_ATTR (cs) (~(1 << cs)) -#define ORION_MBUS_SRAM_TARGET 0x00 +#define ORION_MBUS_SRAM_TARGET 0x09#define ORION_MBUS_SRAM_ATTR 0x00/*
Greg Kroah-Hartman
maintainerPATCH 105/228 ARM: dts: kirkwood: fix mislocated pcie-controller nodes
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Hesselbarth <[email protected]>
commit 788296b2d19d16ec33aba0a5ad1544d50bb58601 upstream.
Commit 54397d85349f
("ARM: kirkwood: Relocate PCIe device tree nodes")
moved the pcie-controller nodes for the Kirkwood SoCs to the mbus bus node. For some reason, two boards were not properly converted and have their pci-controller nodes still in the ocp bus node.
As the corresponding SoC pcie-controller does not exist anymore, it is likely that pcie is broken on those boards since above commit. Fix it by moving the pcie related nodes to the correct location.
--- arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts | 18 ++++++++++-------- arch/arm/boot/dts/kirkwood-nsa310-common.dtsi | 18 ++++++++++-------- 2 files changed, 20 insertions(+), 16 deletions(-)
arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts +10 -8
@@ -30,6 +30,16 @@ bootargs = "console=ttyS0,115200n8 earlyprintk"; }; + mbus { + pcie-controller { + status = "okay"; + + pcie@1,0 { + status = "okay"; + }; + }; + }; + ocp@f1000000 { pinctrl@10000 { pmx_usb_led: pmx-usb-led {
@@ -73,14 +83,6 @@ ehci@50000 { status = "okay"; }; - - pcie-controller { - status = "okay"; - - pcie@1,0 { - status = "okay"; - }; - }; }; gpio-leds {
arch/arm/boot/dts/kirkwood-nsa310-common.dtsi +10 -8
@@ -4,6 +4,16 @@ / { model = "ZyXEL NSA310"; + mbus { + pcie-controller { + status = "okay"; + + pcie@1,0 { + status = "okay"; + }; + }; + }; + ocp@f1000000 { pinctrl: pinctrl@10000 {
@@ -26,14 +36,6 @@ status = "okay"; nr-ports = <2>; }; - - pcie-controller { - status = "okay"; - - pcie@1,0 { - status = "okay"; - }; - }; }; gpio_poweroff {
Greg Kroah-Hartman
maintainerPATCH 106/228 ARM: dts: i.MX53: Fix ipu register space size
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sascha Hauer <[email protected]>
commit 6d66da89bf4422c0a0693627fb3e25f74af50f92 upstream.
The IPU register space is 128MB, not 2GB.
--- arch/arm/boot/dts/imx53.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/imx53.dtsi +1 -1
@@ -87,7 +87,7 @@ ipu: ipu@18000000 { #crtc-cells = <1>; compatible = "fsl,imx53-ipu"; - reg = <0x18000000 0x080000000>; + reg = <0x18000000 0x08000000>; interrupts = <11 10>; clocks = <&clks 59>, <&clks 110>, <&clks 61>; clock-names = "bus", "di0", "di1";
Greg Kroah-Hartman
maintainerPATCH 107/228 ARM: common: edma: Fix xbar mapping
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
commit cf7eb979116c2568e8bc3b6a7269c7a359864ace upstream.
This is another great example of trainwreck engineering:
commit 2646a0e529 (ARM: edma: Add EDMA crossbar event mux support) added support for using EDMA on peripherals which have no direct EDMA event mapping.
The code compiles and does not explode in your face, but that's it.
1) Reading an u16 array from an u32 device tree array simply does not work. Even if the function is named "edma_of_read_u32_to_s16_array".
It merily calls of_property_read_u16_array. So the resulting 16bit array will have every other entry = 0.
2) The DT entry for the xbar registers related to xbar has length 0x10 instead of the real length: 0xfd0 - 0xf90 = 0x40.
Not a real problem as it does not cross a page boundary, but wrong nevertheless.
3) But none of this matters as the mapping never happens:
After reading nonsense edma_of_read_u32_to_s16_array() invalidates the first array entry pair, so nobody can ever notice the braindamage by immediate explosion.
Seems the QA criteria for this code was solely not to explode when someone adds edma-xbar-event-map entries to the DT. Goal achieved, congratulations!
Not really helpful if someone wants to use edma on a device which requires a xbar mapping.
Fix the issues by:
- annotating the device tree entry with "/bits/ 16" as documented in the of_property_read_u16_array kernel doc
- make the size of the xbar register mapping correct
- invalidating the end of the array and not the start
This convoluted mess wants to be completely rewritten as there is no point to keep the xbar_chan array memory and the iomapping of the xbar regs around forever. Marking the xbar mapped channels as used should be done right there.
But that's a different issue and this patch is small enough to make it work and allows a simple backport for stable.
--- Documentation/devicetree/bindings/dma/ti-edma.txt | 4 - arch/arm/boot/dts/am33xx.dtsi | 2 arch/arm/common/edma.c | 48 ++++++---------------- 3 files changed, 18 insertions(+), 36 deletions(-)
Documentation/devicetree/bindings/dma/ti-edma.txt +2 -2
@@ -29,6 +29,6 @@ edma: edma@49000000 { dma-channels = <64>; ti,edma-regions = <4>; ti,edma-slots = <256>; - ti,edma-xbar-event-map = <1 12 - 2 13>; + ti,edma-xbar-event-map = /bits/ 16 <1 12 + 2 13>; };
arch/arm/boot/dts/am33xx.dtsi +1 -1
@@ -140,7 +140,7 @@ compatible = "ti,edma3"; ti,hwmods = "tpcc", "tptc0", "tptc1", "tptc2"; reg = <0x49000000 0x10000>, - <0x44e10f90 0x10>; + <0x44e10f90 0x40>; interrupts = <12 13 14>; #dma-cells = <1>; dma-channels = <64>;
arch/arm/common/edma.c +15 -33
78 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 108/228 ARM: mvebu: fix NOR bus-width in Armada XP GP Device Tree
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Petazzoni <[email protected]>
commit 1a88f809ccb5db1509a7514b187c00b3a995fc82 upstream.
The mvebu-devbus driver had a serious bug, which lead to a 8 bits bus width declared in the Device Tree being considered as a 16 bits bus width when configuring the hardware.
This bug in mvebu-devbus driver was compensated by a symetric mistake in the Armada XP GP Device Tree: a 8 bits bus width was declared, even though the hardware actually has a 16 bits bus width connection with the NOR flash.
Now that we have fixed the mvebu-devbus driver to behave according to its Device Tree binding, this commit fixes the problematic Device Tree files as well.
This bug was introduced in commit da8d1b38356853c37116f9afa29f15648d7fb159 ('ARM: mvebu: Add support for NOR flash device on Armada XP-GP board') which was merged in v3.10.
--- arch/arm/boot/dts/armada-xp-gp.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/armada-xp-gp.dts +1 -1
@@ -49,7 +49,7 @@ /* Device Bus parameters are required */ /* Read parameters */ - devbus,bus-width = <8>; + devbus,bus-width = <16>; devbus,turn-off-ps = <60000>; devbus,badr-skew-ps = <0>; devbus,acc-first-ps = <124000>;
Greg Kroah-Hartman
maintainerPATCH 109/228 ARM: mvebu: fix NOR bus-width in Armada XP DB Device Tree
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Petazzoni <[email protected]>
commit f3aec8f3f05025e7b450102dae0759375346706e upstream.
The mvebu-devbus driver had a serious bug, which lead to a 8 bits bus width declared in the Device Tree being considered as a 16 bits bus width when configuring the hardware.
This bug in mvebu-devbus driver was compensated by a symetric mistake in the Armada XP DB Device Tree: a 8 bits bus width was declared, even though the hardware actually has a 16 bits bus width connection with the NOR flash.
Now that we have fixed the mvebu-devbus driver to behave according to its Device Tree binding, this commit fixes the problematic Device Tree files as well.
This bug was introduced in commit b484ff42df475c5087d614c4d477273e1906bcb9 ('ARM: mvebu: Add support for NOR flash device on Armada XP-DB board') which was merged in v3.11.
--- arch/arm/boot/dts/armada-xp-db.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/armada-xp-db.dts +1 -1
@@ -40,7 +40,7 @@ /* Device Bus parameters are required */ /* Read parameters */ - devbus,bus-width = <8>; + devbus,bus-width = <16>; devbus,turn-off-ps = <60000>; devbus,badr-skew-ps = <0>; devbus,acc-first-ps = <124000>;
Greg Kroah-Hartman
maintainerPATCH 110/228 ARM: mvebu: fix NOR bus-width in Armada XP OpenBlocks AX3 Device Tree
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Petazzoni <[email protected]>
commit 6e20bae8a39c40d4e03698e4160bad2d2629062b upstream.
The mvebu-devbus driver had a serious bug, which lead to a 8 bits bus width declared in the Device Tree being considered as a 16 bits bus width when configuring the hardware.
This bug in mvebu-devbus driver was compensated by a symetric mistake in the Armada XP OpenBlocks AX3 Device Tree: a 8 bits bus width was declared, even though the hardware actually has a 16 bits bus width connection with the NOR flash.
Now that we have fixed the mvebu-devbus driver to behave according to its Device Tree binding, this commit fixes the problematic Device Tree files as well.
This bug was introduced in commit a7d4f81821f7eec3175f8e23dd6949c71ab2da43 ('ARM: mvebu: Add support for NOR flash device on Openblocks AX3 board') which was merged in v3.10.
--- arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts +1 -1
@@ -37,7 +37,7 @@ /* Device Bus parameters are required */ /* Read parameters */ - devbus,bus-width = <8>; + devbus,bus-width = <16>; devbus,turn-off-ps = <60000>; devbus,badr-skew-ps = <0>; devbus,acc-first-ps = <124000>;
Greg Kroah-Hartman
maintainerPATCH 111/228 arm: dts: Fix missing device_type="memory" for ste-ccu8540
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leif Lindholm <[email protected]>
commit bfaed5abad998bfc88a66e6e71c7b08dcf82f04e upstream.
The current .dts for ste-ccu8540 lacks a 'device_type = "memory"' for its memory node, relying on an old ppc quirk in order to discover its memory. Fix the data so that all parsing code can handle it correctly.
--- arch/arm/boot/dts/ste-ccu8540.dts | 1 + 1 file changed, 1 insertion(+)
arch/arm/boot/dts/ste-ccu8540.dts +1 -0
@@ -18,6 +18,7 @@ compatible = "st-ericsson,ccu8540", "st-ericsson,u8540"; memory at 0 { + device_type = "memory"; reg = <0x20000000 0x1f000000>, <0xc0000000 0x3f000000>; };
Greg Kroah-Hartman
maintainerPATCH 112/228 ARM: 8012/1: kdump: Avoid overflow when converting pfn to physaddr
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liu Hua <[email protected]>
commit 8fad87bca7ac9737e413ba5f1656f1114a8c314d upstream.
When we configure CONFIG_ARM_LPAE=y, pfn << PAGE_SHIFT will overflow if pfn >= 0x100000 in copy_oldmem_page. So use __pfn_to_phys for converting.
--- arch/arm/kernel/crash_dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/kernel/crash_dump.c +1 -1
@@ -39,7 +39,7 @@ ssize_t copy_oldmem_page(unsigned long pif (!csize)return 0 ; - vaddr =ioremap (pfn <<PAGE_SHIFT ,PAGE_SIZE ); + vaddr =ioremap (__pfn_to_phys (pfn),PAGE_SIZE );if (!vaddr)return -ENOMEM ;
Greg Kroah-Hartman
maintainerPATCH 113/228 rtl8192cu: Fix unbalanced irq enable in error path of rtl92cu_hw_init()
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
commit 3234f5b06fc3094176a86772cc64baf3decc98fc upstream.
--- drivers/net/wireless/rtlwifi/rtl8192cu/hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/rtlwifi/rtl8192cu/hw.c +1 -1
@@ -1001,7 +1001,7 @@ int rtl92cu_hw_init(struct ieee80211_hw err =_rtl92cu_init_mac (hw);if (err) {RT_TRACE (rtlpriv,COMP_ERR ,DBG_EMERG ,"init mac failed!\n" ); -return err; + goto exit; } err =rtl92c_download_fw (hw);if (err) {
Greg Kroah-Hartman
maintainerPATCH 114/228 drm/nouveau/acpi: allow non-optimus setups to load vbios from acpi
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilia Mirkin <[email protected]>
commit a3d0b1218d351c6e6f3cea36abe22236a08cb246 upstream.
There appear to be a crop of new hardware where the vbios is not available from PROM/PRAMIN, but there is a valid _ROM method in ACPI. The data read from PCIROM almost invariably contains invalid instructions (still has the x86 opcodes), which makes this a low-risk way to try to obtain a valid vbios image.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76475
--- drivers/gpu/drm/nouveau/nouveau_acpi.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/nouveau/nouveau_acpi.c +0 -3
@@ -389,9 +389,6 @@ bool nouveau_acpi_rom_supported(struct pacpi_status status;acpi_handle dhandle, rom_handle; -if (!nouveau_dsm_priv.dsm_detected && !nouveau_dsm_priv.optimus_detected) -return false; - dhandle =ACPI_HANDLE (&pdev->dev);if (!dhandle)return false;
Greg Kroah-Hartman
maintainerPATCH 115/228 drm/nouveau: fix another lock unbalance in nouveau_crtc_page_flip
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maarten Lankhorst <[email protected]>
commit 806cbc5026933a781b66adecf6d1658fde9138e6 upstream.
Fixes a regression introduced by 060810d7abaabca "drm/nouveau: fix locking issues in page flipping paths". chan->cli->mutex is unlocked a second time in the fail_unreserve path, fix this by moving mutex_unlock down.
--- drivers/gpu/drm/nouveau/nouveau_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nouveau_display.c +1 -1
@@ -762,9 +762,9 @@ nouveau_crtc_page_flip(struct drm_crtc * } ret =nouveau_page_flip_emit (chan, old_bo, new_bo, s, &fence); -mutex_unlock (&chan->cli->mutex);if (ret) goto fail_unreserve; +mutex_unlock (&chan->cli->mutex);/* Update the crtc struct and cleanup */ crtc->fb = fb;
Greg Kroah-Hartman
maintainerPATCH 116/228 drm/i915/vlv: reset VLV media force wake request register
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jani Nikula <[email protected]>
commit 05adaf1f101f25f40f12c29403e6488f0e45f6b6 upstream.
Media force wake get hangs the machine when the system is booted without displays attached. The assumption is that (at least some versions of) the firmware has skipped some initialization in that case.
Empirical evidence suggests we need to reset the media force wake request register in addition to the render one to avoid hangs.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75895
--- drivers/gpu/drm/i915/intel_uncore.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/intel_uncore.c +2 -0
@@ -177,6 +177,8 @@ static void vlv_force_wake_reset(struct {__raw_i915_write32 (dev_priv,FORCEWAKE_VLV ,_MASKED_BIT_DISABLE (0xffff )); +__raw_i915_write32 (dev_priv,FORCEWAKE_MEDIA_VLV , +_MASKED_BIT_DISABLE (0xffff ));/* something from same cacheline, but !FORCEWAKE_VLV */ __raw_posting_read (dev_priv,FORCEWAKE_ACK_VLV ); }
Greg Kroah-Hartman
maintainerPATCH 117/228 drm/i915: restore backlight precision when converting from ACPI
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aaron Lu <[email protected]>
commit 721e82c08c1afd6b47367b0e0c4a62140b0667f3 upstream.
When we set backlight on behalf of ACPI opregion, we will convert the backlight value in the 0-255 range defined in opregion to the actual hardware level. Commit 22505b82a2 (drm/i915: avoid brightness overflow when doing scale) is meant to fix the overflow problem when doing the conversion, but it also caused a problem that the converted hardware level doesn't quite represent the intended value: say user wants maximum backlight level(255 in opregion's range), then we will calculate the actual hardware level to be: level = freq / max * level, where freq is the hardware's max backlight level(937 on an user's box), and max and level are all 255. The converted value should be 937 but the above calculation will yield 765.
To fix this issue, just use 64 bits to do the calculation to keep the precision and avoid overflow at the same time.
--- drivers/gpu/drm/i915/intel_panel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_panel.c +4 -4
@@ -501,6 +501,7 @@ void intel_panel_set_backlight(struct inenum pipe pipe =intel_get_pipe_from_connector (connector);u32 freq;unsigned long flags; +u64 n;if (!panel->backlight.present || pipe ==INVALID_PIPE )return ;
@@ -511,10 +512,9 @@ void intel_panel_set_backlight(struct in/* scale to hardware max, but be careful to not overflow */ freq = panel->backlight.max; -if (freq < max) - level = level * freq / max; -else - level = freq / max * level; + n = (u64 )level * freq; +do_div (n, max); + level = n; panel->backlight.level = level;if (panel->backlight.device)
Greg Kroah-Hartman
maintainerPATCH 118/228 i40e: potential array underflow in i40e_vc_process_vf_msg()
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit c243e96335c56e56dcf6a00593104554fb06b689 upstream.
If "vf_id" is smaller than hw->func_caps.vf_base_id then it leads to an array underflow of the pf->vf[] array. This is unlikely to happen unless the hardware is bad, but it's a small change and it silences a static checker warning.
--- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +1 -1
@@ -1776,7 +1776,7 @@ int i40e_vc_process_vf_msg(struct i40e_p u32 v_retval, u8 *msg, u16 msglen) { struct i40e_hw *hw = &pf->hw; -int local_vf_id = vf_id - hw->func_caps.vf_base_id; +unsigned int local_vf_id = vf_id - hw->func_caps.vf_base_id;struct i40e_vf *vf;int ret;
Greg Kroah-Hartman
maintainerPATCH 119/228 igb: Fix Null-pointer dereference in igb_reset_q_vector
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christoph Paasch <[email protected]>
commit cb06d102327eadcd1bdc480bfd9f8876251d1007 upstream.
When igb_set_interrupt_capability() calls igb_reset_interrupt_capability() (e.g., because CONFIG_PCI_MSI is unset), num_q_vectors has been set but no vector has yet been allocated.
igb_reset_interrupt_capability() will then call igb_reset_q_vector, which assumes that the vector is allocated. As this is not the case, we are accessing a NULL-pointer.
This patch fixes it by checking that q_vector is indeed different from NULL.
--- drivers/net/ethernet/intel/igb/igb_main.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/ethernet/intel/igb/igb_main.c +6 -0
@@ -1014,6 +1014,12 @@ static void igb_reset_q_vector(struct ig {struct igb_q_vector *q_vector = adapter->q_vector[v_idx]; +/* Coming from igb_set_interrupt_capability, the vectors are not yet +* allocated. So, q_vector is NULL so we should stop here. +*/ +if (!q_vector) +return ; +if (q_vector->tx.ring) adapter->tx_ring[q_vector->tx.ring->queue_index] =NULL ;
Greg Kroah-Hartman
maintainerPATCH 120/228 igb: Unset IGB_FLAG_HAS_MSIX-flag when falling back to msi-only
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christoph Paasch <[email protected]>
commit b709323d2477614823a38c2f2a9a206e087e28fc upstream.
Prior to cd14ef54d25 (igb: Change to use statically allocated array for MSIx entries), having msix_entries different from NULL was an indicator that MSIX is enabled.
In igb_set_interrupt_capabiliy we may fall back to MSI-only. Prior to the above patch msix_entries was set to NULL by igb_reset_interrupt_capability.
However, now we are checking the flag for IGB_FLAG_HAS_MSIX and so the stack gets completly confused:
[ 42.659791] ------------[ cut here ]------------ [ 42.715032] WARNING: CPU: 7 PID: 0 at net/sched/sch_generic.c:264 dev_watchdog+0x15c/0x1fb() [ 42.848263] NETDEV WATCHDOG: eth0 (igb): transmit queue 0 timed out [ 42.923253] Modules linked in: [ 42.959875] CPU: 7 PID: 0 Comm: swapper/7 Not tainted 3.14.0-rc2-mptcp #437 [ 43.043184] Hardware name: HP ProLiant DL165 G7, BIOS O37 01/26/2011 [ 43.119215] 0000000000000108 ffff88023fdc3da8 ffffffff81487847 0000000000000108 [ 43.208165] ffff88023fdc3df8 ffff88023fdc3de8 ffffffff81034e7d ffff88023fdc3dd8 [ 43.297120] ffffffff813fff10 ffff880236018000 ffff880236b178c0 0000000000000008 [ 43.386071] Call Trace: [ 43.415303] <IRQ> [<ffffffff81487847>] dump_stack+0x49/0x62 [ 43.484174] [<ffffffff81034e7d>] warn_slowpath_common+0x77/0x91 [ 43.556049] [<ffffffff813fff10>] ? dev_watchdog+0x15c/0x1fb [ 43.623759] [<ffffffff81034f2b>] warn_slowpath_fmt+0x41/0x43 [ 43.692511] [<ffffffff813fff10>] dev_watchdog+0x15c/0x1fb [ 43.758141] [<ffffffff813ffdb4>] ? __netdev_watchdog_up+0x64/0x64 [ 43.832091] [<ffffffff8103cd04>] call_timer_fn+0x17/0x6f [ 43.896682] [<ffffffff8103cebe>] run_timer_softirq+0x162/0x1a2 [ 43.967511] [<ffffffff81038520>] __do_softirq+0xcd/0x1cc [ 44.032104] [<ffffffff81038689>] irq_exit+0x3a/0x48 [ 44.091492] [<ffffffff81026d43>] smp_apic_timer_interrupt+0x43/0x50 [ 44.167525] [<ffffffff8148c24a>] apic_timer_interrupt+0x6a/0x70 [ 44.239392] <EOI> [<ffffffff8100992c>] ? default_idle+0x6/0x8 [ 44.310343] [<ffffffff81009b31>] arch_cpu_idle+0x13/0x18 [ 44.374934] [<ffffffff81066126>] cpu_startup_entry+0xa7/0x101 [ 44.444724] [<ffffffff81025660>] start_secondary+0x1b2/0x1b7 [ 44.513472] ---[ end trace a5a075fd4e7f854f ]--- [ 44.568753] igb 0000:04:00.0 eth0: Reset adapter [ 46.206945] random: nonblocking pool is initialized [ 46.465670] irq 44: nobody cared (try booting with the "irqpoll" option) [ 46.545862] CPU: 7 PID: 0 Comm: swapper/7 Tainted: G W 3.14.0-rc2-mptcp #437 [ 46.640610] Hardware name: HP ProLiant DL165 G7, BIOS O37 01/26/2011 [ 46.716641] ffff8802363f8c84 ffff88023fdc3e38 ffffffff81487847 00000000a03cdb6d [ 46.805598] ffff8802363f8c00 ffff88023fdc3e68 ffffffff81068489 0000007f81825400 [ 46.894539] ffff8802363f8c00 0000000000000000 0000000000000000 ffff88023fdc3ea8 [ 46.983484] Call Trace: [ 47.012714] <IRQ> [<ffffffff81487847>] dump_stack+0x49/0x62 [ 47.081585] [<ffffffff81068489>] __report_bad_irq+0x35/0xc1 [ 47.149295] [<ffffffff81068683>] note_interrupt+0x16e/0x1ea [ 47.217006] [<ffffffff8106679e>] handle_irq_event_percpu+0x116/0x12e [ 47.294075] [<ffffffff810667e9>] handle_irq_event+0x33/0x4f [ 47.361787] [<ffffffff81068c95>] handle_fasteoi_irq+0x83/0xd1 [ 47.431577] [<ffffffff81003d5b>] handle_irq+0x1f/0x28 [ 47.493047] [<ffffffff81003567>] do_IRQ+0x4e/0xd4 [ 47.550358] [<ffffffff8148b06a>] common_interrupt+0x6a/0x6a [ 47.618066] <EOI> [<ffffffff8100992c>] ? default_idle+0x6/0x8 [ 47.689016] [<ffffffff81009b31>] arch_cpu_idle+0x13/0x18 [ 47.753605] [<ffffffff81066126>] cpu_startup_entry+0xa7/0x101 [ 47.823397] [<ffffffff81025660>] start_secondary+0x1b2/0x1b7 [ 47.892146] handlers: [ 47.919301] [<ffffffff812fbd7d>] igb_intr
So, this patch unsets the flag to indicate that we are not using MSIX. This patch does exactly this: Unsetting the flag when falling back to MSI.
--- drivers/net/ethernet/intel/igb/igb_main.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/igb/igb_main.c +1 -0
@@ -1127,6 +1127,7 @@ static void igb_set_interrupt_capability/* If we can't do MSI-X, try MSI */ msi_only: + adapter->flags &= ~IGB_FLAG_HAS_MSIX ;#ifdef CONFIG_PCI_IOV /* disable SR-IOV for non MSI-X configurations */ if (adapter->vf_data) {
Greg Kroah-Hartman
maintainerPATCH 122/228 leds: leds-pwm: properly clean up after probe failure
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Russell King <[email protected]>
commit 392369019eb96e914234ea21eda806cb51a1073e upstream.
When probing with DT, we add each LED one at a time. If we find a LED without a PWM device (because it is not available yet) we fail the initialisation, unregister previous LEDs, and then by way of managed resources, we free the structure.
The problem with this is we may have a scheduled and active work_struct in this structure, and this results in a nasty kernel oops.
We need to cancel this work_struct properly upon cleanup - and the cleanup we require is the same cleanup as we do when the LED platform device is removed. Rather than writing this same code three times, move it into a separate function and use it in all three places.
--- drivers/leds/leds-pwm.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-)
drivers/leds/leds-pwm.c +13 -10
@@ -84,6 +84,15 @@ static inline size_t sizeof_pwm_leds_pri (sizeof (struct led_pwm_data ) * num_leds); } +static void led_pwm_cleanup (struct led_pwm_priv *priv) +{ +while (priv->num_leds--) { +led_classdev_unregister (&priv->leds[priv->num_leds].cdev); +if (priv->leds[priv->num_leds].can_sleep) +cancel_work_sync (&priv->leds[priv->num_leds].work); + } +} +static int led_pwm_create_of (struct platform_device *pdev,struct led_pwm_priv *priv) {
@@ -131,8 +140,7 @@ static int led_pwm_create_of(struct platreturn 0 ; err: -while (priv->num_leds--) -led_classdev_unregister (&priv->leds[priv->num_leds].cdev); +led_pwm_cleanup (priv);return ret; }
@@ -200,8 +208,8 @@ static int led_pwm_probe(struct platformreturn 0 ; err: -while (i--) -led_classdev_unregister (&priv->leds[i].cdev); + priv->num_leds = i; +led_pwm_cleanup (priv);return ret; }
@@ -209,13 +217,8 @@ err:static int led_pwm_remove (struct platform_device *pdev) {struct led_pwm_priv *priv =platform_get_drvdata (pdev); -int i; -for (i =0 ; i < priv->num_leds; i++) { -led_classdev_unregister (&priv->leds[i].cdev); -if (priv->leds[i].can_sleep) -cancel_work_sync (&priv->leds[i].work); - } +led_pwm_cleanup (priv);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 123/228 brcmsmac: fix deadlock on missing firmware
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Emil Goode <[email protected]>
commit 8fc1e8c240aab968db658b2d8d079b4391207a36 upstream.
When brcm80211 firmware is not installed networking hangs. A deadlock happens because we call ieee80211_unregister_hw() from the .start callback of struct ieee80211_ops. When .start is called we are under rtnl lock and ieee80211_unregister_hw() tries to take it again.
Function call stack:
dev_change_flags()
__dev_change_flags() __dev_open() ASSERT_RTNL() <-- Assert rtnl lock ops->ndo_open()
.ndo_open = ieee80211_open,
ieee80211_open()
ieee80211_do_open() drv_start() local->ops->start()
.start = brcms_ops_start,
brcms_ops_start()
brcms_remove() ieee80211_unregister_hw() rtnl_lock() <-- Here we deadlock
Introduced by:
commit 25b5632fb35ca61b8ae3eee235edcdc2883f7a5e ("brcmsmac: request firmware in .start() callback")
This patch fixes the bug by removing the call to brcms_remove() and moves the brcms_request_fw() call to the top of the .start callback to not initiate anything unless firmware is installed.
--- drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +6 -8
@@ -426,6 +426,12 @@ static int brcms_ops_start(struct ieee80bool blocked;int err; +if (!wl->ucode.bcm43xx_bomminor) { + err =brcms_request_fw (wl, wl->wlc->hw->d11core); +if (err) +return -ENOENT ; + } +ieee80211_wake_queues (hw);spin_lock_bh (&wl->lock); blocked =brcms_rfkill_set_hw_state (wl);
@@ -433,14 +439,6 @@ static int brcms_ops_start(struct ieee80if (!blocked)wiphy_rfkill_stop_polling (wl->pub->ieee_hw->wiphy); -if (!wl->ucode.bcm43xx_bomminor) { - err =brcms_request_fw (wl, wl->wlc->hw->d11core); -if (err) { -brcms_remove (wl->wlc->hw->d11core); -return -ENOENT ; - } - } -spin_lock_bh (&wl->lock);/* avoid acknowledging frames before a non-monitor device is added */ wl->mute_tx = true;
Greg Kroah-Hartman
maintainerPATCH 124/228 Documentation: Update stable address in Chinese and Japanese translations
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
commit 98b0f811aade1b7c6e7806c86aa0befd5919d65f upstream.
The English and Korean translations were updated, the Chinese and Japanese weren't.
--- Documentation/ja_JP/HOWTO | 2 +- Documentation/ja_JP/stable_kernel_rules.txt | 6 +++--- Documentation/zh_CN/HOWTO | 2 +- Documentation/zh_CN/stable_kernel_rules.txt | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-)
Documentation/ja_JP/HOWTO +1 -1
@@ -315,7 +315,7 @@ Andrew Morton が Linux-kernel メーリ もし、3.x.y カーネルが存在しない場合には、番号が一番大きい 3.x が 最新の安定版カーネルです。 -3.x.y は "stable" チーム <[email protected]> でメンテされており、必 +3.x.y は "stable" チーム <[email protected]> でメンテされており、必 要に応じてリリースされます。通常のリリース期間は 2週間毎ですが、差し迫っ た問題がなければもう少し長くなることもあります。セキュリティ関連の問題 の場合はこれに対してだいたいの場合、すぐにリリースがされます。
Documentation/ja_JP/stable_kernel_rules.txt +3 -3
@@ -50,16 +50,16 @@ linux-2.6.29/Documentation/stable_kernel -stable ツリーにパッチを送付する手続き- - - 上記の規則に従っているかを確認した後に、[email protected] にパッチ + - 上記の規則に従っているかを確認した後に、[email protected] にパッチ を送る。 - 送信者はパッチがキューに受け付けられた際には ACK を、却下された場合 には NAK を受け取る。この反応は開発者たちのスケジュールによって、数 日かかる場合がある。 - もし受け取られたら、パッチは他の開発者たちと関連するサブシステムの メンテナーによるレビューのために -stable キューに追加される。 - - パッチに [email protected] のアドレスが付加されているときには、それ + - パッチに [email protected] のアドレスが付加されているときには、それ が Linus のツリーに入る時に自動的に stable チームに email される。 - - セキュリティパッチはこのエイリアス ([email protected]) に送られるべ + - セキュリティパッチはこのエイリアス ([email protected]) に送られるべ きではなく、代わりに [email protected] のアドレスに送られる。 レビューサイクル-
Documentation/zh_CN/HOWTO +1 -1
@@ -237,7 +237,7 @@ kernel.org网站的pub/linux/kernel/v2.6 如果没有2.6.x.y版本内核存在,那么最新的2.6.x版本内核就相当于是当前的稳定 版内核。 -2.6.x.y版本由“稳定版”小组(邮件地址<[email protected]>)维护,一般隔周发 +2.6.x.y版本由“稳定版”小组(邮件地址<[email protected]>)维护,一般隔周发 布新版本。 内核源码中的Documentation/stable_kernel_rules.txt文件具体描述了可被稳定
Documentation/zh_CN/stable_kernel_rules.txt +1 -1
@@ -42,7 +42,7 @@ Documentation/stable_kernel_rules.txt � 向稳定版代码树提交补丁的过程: - - 在确认了补丁符合以上的规则后,将补丁发送到[email protected]。 + - 在确认了补丁符合以上的规则后,将补丁发送到[email protected]。 - 如果补丁被接受到队列里,发送者会收到一个ACK回复,如果没有被接受,收 到的是NAK回复。回复需要几天的时间,这取决于开发者的时间安排。 - 被接受的补丁会被加到稳定版本队列里,等待其他开发者的审查。
Greg Kroah-Hartman
maintainerPATCH 125/228 device_cgroup: rework device access check and exception checking
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aristeu Rozanski <[email protected]>
commit 79d719749d23234e9b725098aa49133f3ef7299d upstream.
Whenever a device file is opened and checked against current device cgroup rules, it uses the same function (may_access()) as when a new exception rule is added by writing devices.{allow,deny}. And in both cases, the algorithm is the same, doesn't matter the behavior.
First problem is having device access to be considered the same as rule checking. Consider the following structure:
A (default behavior: allow, exceptions disallow access)
\
B (default behavior: allow, exceptions disallow access)
A new exception is added to B by writing devices.deny:
c 12:34 rw
When checking if that exception is allowed in may_access():
if (dev_cgroup->behavior == DEVCG_DEFAULT_ALLOW) {
if (behavior == DEVCG_DEFAULT_ALLOW) {
/* the exception will deny access to certain devices */
return true;Which is ok, since B is not getting more privileges than A, it doesn't matter and the rule is accepted
Now, consider it's a device file open check and the process belongs to cgroup B. The access will be generated as:
behavior: allow exception: c 12:34 rw
The very same chunk of code will allow it, even if there's an explicit exception telling to do otherwise.
A simple test case:
# mkdir new_group # cd new_group # echo $$ >tasks # echo "c 1:3 w" >devices.deny # echo >/dev/null # echo $? 0
This is a serious bug and was introduced on
c39a2a3018f8 devcg: prepare may_access() for hierarchy support
To solve this problem, the device file open function was split from the new exception check.
Second problem is how exceptions are processed by may_access(). The first part of the said function tries to match fully with an existing exception:
list_for_each_entry_rcu(ex, &dev_cgroup->exceptions, list) {
if ((refex->type & DEV_BLOCK) && !(ex->type & DEV_BLOCK))
continue;
if ((refex->type & DEV_CHAR) && !(ex->type & DEV_CHAR))
continue;
if (ex->major != ~0 && ex->major != refex->major)
continue;
if (ex->minor != ~0 && ex->minor != refex->minor)
continue;
if (refex->access & (~ex->access))
continue;
match = true;
break;
}That means the new exception should be contained into an existing one to be considered a match:
New exception Existing match? notes b 12:34 rwm b 12:34 rwm yes b 12:34 r b *:34 rw yes b 12:34 rw b 12:34 w no extra "r" b *:34 rw b 12:34 rw no too broad "*" b *:34 rw b *:34 rwm yes
Which is fine in some cases. Consider:
A (default behavior: deny, exceptions allow access)
\
B (default behavior: deny, exceptions allow access)
In this case the full match makes sense, the new exception cannot add more access than the parent allows
But this doesn't always work, consider:
A (default behavior: allow, exceptions disallow access)
\
B (default behavior: deny, exceptions allow access)
In this case, a new exception in B shouldn't match any of the exceptions in A, after all you can't allow something that was forbidden by A. But consider this scenario:
New exception Existing in A match? outcome b 12:34 rw b 12:34 r no exception is accepted
Because the new exception has "w" as extra, it doesn't match, so it'll be added to B's exception list.
The same problem can happen during a file access check. Consider a cgroup with allow as default behavior:
Access Exception match? b 12:34 rw b 12:34 r no
In this case, the access didn't match any of the exceptions in the cgroup, which is required since exceptions will disallow access.
To solve this problem, two new functions were created to match an exception either fully or partially. In the example above, a partial check will be performed and it'll produce a match since at least "b 12:34 r" from "b 12:34 rw" access matches.
--- security/device_cgroup.c | 162 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 122 insertions(+), 40 deletions(-)
security/device_cgroup.c +122 -40
@@ -308,57 +308,139 @@ static int devcgroup_seq_show(struct seq }/** -* may_access - verifies if a new exception is part of what is allowed -* by a dev cgroup based on the default policy + -* exceptions. This is used to make sure a child cgroup -* won't have more privileges than its parent or to -* verify if a certain access is allowed. -* @dev_cgroup: dev cgroup to be tested against -* @refex: new exception -* @behavior: behavior of the exception +* match_exception - iterates the exception list trying to match a rule +* based on type, major, minor and access type. It is +* considered a match if an exception is found that +* will contain the entire range of provided parameters. +* @exceptions: list of exceptions +* @type: device type (DEV_BLOCK or DEV_CHAR) +* @major: device file major number, ~0 to match all +* @minor: device file minor number, ~0 to match all +* @access: permission mask (ACC_READ, ACC_WRITE, ACC_MKNOD) +* +* returns: true in case it matches an exception completely */ -static bool may_access (struct dev_cgroup *dev_cgroup, -struct dev_exception_item *refex, -enum devcg_behavior behavior) +static bool match_exception (struct list_head *exceptions,short type, +u32 major,u32 minor,short access) {struct dev_exception_item *ex; -bool match = false; -rcu_lockdep_assert (rcu_read_lock_held () || -lockdep_is_held (&devcgroup_mutex), -"device_cgroup::may_access() called without proper synchronization" ); +list_for_each_entry_rcu (ex, exceptions, list) { +if ((type &DEV_BLOCK ) && !(ex->type &DEV_BLOCK )) +continue ; +if ((type &DEV_CHAR ) && !(ex->type &DEV_CHAR )) +continue ; +if (ex->major != ~0 && ex->major != major) +continue ; +if (ex->minor != ~0 && ex->minor != minor) +continue ; +/* provided access cannot have more than the exception rule */ +if (access & (~ex->access)) +continue ; +return true; + } +return false; +} + +/** +* match_exception_partial - iterates the exception list trying to match a rule +* based on type, major, minor and access type. It is +* considered a match if an exception's range is +* found to contain *any* of the devices specified by +* provided parameters. This is used to make sure no +* extra access is being granted that is forbidden by +* any of the exception list. +* @exceptions: list of exceptions +* @type: device type (DEV_BLOCK or DEV_CHAR) +* @major: device file major number, ~0 to match all +* @minor: device file minor number, ~0 to match all +* @access: permission mask (ACC_READ, ACC_WRITE, ACC_MKNOD) +* +* returns: true in case the provided range mat matches an exception completely +*/ +static bool match_exception_partial (struct list_head *exceptions,short type, +u32 major,u32 minor,short access) +{ +struct dev_exception_item *ex; -list_for_each_entry_rcu (ex, &dev_cgroup->exceptions, list) { -if ((refex->type &DEV_BLOCK ) && !(ex->type &DEV_BLOCK )) +list_for_each_entry_rcu (ex, exceptions, list) { +if ((type &DEV_BLOCK ) && !(ex->type &DEV_BLOCK ))continue ; -if ((refex->type &DEV_CHAR ) && !(ex->type &DEV_CHAR )) +if ((type &DEV_CHAR ) && !(ex->type &DEV_CHAR ))continue ; -if (ex->major != ~0 && ex->major != refex->major) +/* +* We must be sure that both the exception and the provided +* range aren't masking all devices +*/ +if (ex->major != ~0 && major != ~0 && ex->major != major)continue ; -if (ex->minor != ~0 && ex->minor != refex->minor) +if (ex->minor != ~0 && minor != ~0 && ex->minor != minor)continue ; -if (refex->access & (~ex->access)) +/* +* In order to make sure the provided range isn't matching +* an exception, all its access bits shouldn't match the +* exception's access bits +*/ +if (!(access & ex->access))continue ; - match = true; -break ; +return true; } +return false; +} + +/** +* verify_new_ex - verifies if a new exception is part of what is allowed +* by a dev cgroup based on the default policy + +* exceptions. This is used to make sure a child cgroup +* won't have more privileges than its parent +* @dev_cgroup: dev cgroup to be tested against +* @refex: new exception +* @behavior: behavior of the exception's dev_cgroup +*/ +static bool verify_new_ex (struct dev_cgroup *dev_cgroup, +struct dev_exception_item *refex, +enum devcg_behavior behavior) +{ +bool match = false; + +rcu_lockdep_assert (rcu_read_lock_held () || +lockdep_is_held (&devcgroup_mutex), +"device_cgroup:verify_new_ex called without proper synchronization" );if (dev_cgroup->behavior ==DEVCG_DEFAULT_ALLOW ) {if (behavior ==DEVCG_DEFAULT_ALLOW ) { -/* the exception will deny access to certain devices */ +/* +* new exception in the child doesn't matter, only +* adding extra restrictions +*/ return true; }else { -/* the exception will allow access to certain devices */ +/* +* new exception in the child will add more devices +* that can be acessed, so it can't match any of +* parent's exceptions, even slightly +*/ + match =match_exception_partial (&dev_cgroup->exceptions, + refex->type, + refex->major, + refex->minor, + refex->access); +if (match) -/* -* a new exception allowing access shouldn't -* match an parent's exception -*/ return false;return true; } }else { -/* only behavior == DEVCG_DEFAULT_DENY allowed here */ +/* +* Only behavior == DEVCG_DEFAULT_DENY allowed here, therefore +* the new exception will add access to more devices and must +* be contained completely in an parent's exception to be +* allowed +*/ + match =match_exception (&dev_cgroup->exceptions, refex->type, + refex->major, refex->minor, + refex->access); +if (match)/* parent has an exception that matches the proposed */ return true;
@@ -380,7 +462,7 @@ static int parent_has_perm(struct dev_cgif (!parent)return 1 ; -return may_access (parent, ex, childcg->behavior); +return verify_new_ex (parent, ex, childcg->behavior); }/**
@@ -708,18 +790,18 @@ static int __devcgroup_check_permission( short access) {struct dev_cgroup *dev_cgroup; -struct dev_exception_item ex; -int rc; - -memset (&ex,0 ,sizeof (ex)); - ex.type = type; - ex.major = major; - ex.minor = minor; - ex.access = access; +bool rc;rcu_read_lock (); dev_cgroup =task_devcgroup (current); - rc =may_access (dev_cgroup, &ex, dev_cgroup->behavior); +if (dev_cgroup->behavior ==DEVCG_DEFAULT_ALLOW ) +/* Can't match any of the exceptions, even partially */ + rc = !match_exception_partial (&dev_cgroup->exceptions, + type, major, minor, access); +else +/* Need to match completely one exception to be allowed */ + rc =match_exception (&dev_cgroup->exceptions, type, major, + minor, access);rcu_read_unlock ();if (!rc)
Greg Kroah-Hartman
maintainerPATCH 126/228 device_cgroup: check if exception removal is allowed
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aristeu Rozanski <[email protected]>
commit d2c2b11cfa134f4fbdcc34088824da26a084d8de upstream.
[PATCH v3 1/2] device_cgroup: check if exception removal is allowed
When the device cgroup hierarchy was introduced in
bd2953ebbb53 - devcg: propagate local changes down the hierarchy
a specific case was overlooked. Consider the hierarchy bellow:
A default policy: ALLOW, exceptions will deny access
\
B default policy: ALLOW, exceptions will deny access
There's no need to verify when an new exception is added to B because in this case exceptions will deny access to further devices, which is always fine. Hierarchy in device cgroup only makes sure B won't have more access than A.
But when an exception is removed (by writing devices.allow), it isn't checked if the user is in fact removing an inherited exception from A, thus giving more access to B.
Example:
# echo 'a' >A/devices.allow # echo 'c 1:3 rw' >A/devices.deny # echo $$ >A/B/tasks # echo >/dev/null -bash: /dev/null: Operation not permitted # echo 'c 1:3 w' >A/B/devices.allow # echo >/dev/null #
This shouldn't be allowed and this patch fixes it by making sure to never allow exceptions in this case to be removed if the exception is partially or fully present on the parent.
v3: missing '*' in function description
v2: improved log message and formatting fixes
--- security/device_cgroup.c | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-)
security/device_cgroup.c +38 -3
@@ -466,6 +466,37 @@ static int parent_has_perm(struct dev_cg }/** +* parent_allows_removal - verify if it's ok to remove an exception +* @childcg: child cgroup from where the exception will be removed +* @ex: exception being removed +* +* When removing an exception in cgroups with default ALLOW policy, it must +* be checked if removing it will give the child cgroup more access than the +* parent. +* +* Return: true if it's ok to remove exception, false otherwise +*/ +static bool parent_allows_removal (struct dev_cgroup *childcg, +struct dev_exception_item *ex) +{ +struct dev_cgroup *parent =css_to_devcgroup (css_parent (&childcg->css)); + +if (!parent) +return true; + +/* It's always allowed to remove access to devices */ +if (childcg->behavior ==DEVCG_DEFAULT_DENY ) +return true; + +/* +* Make sure you're not removing part or a whole exception existing in +* the parent cgroup +*/ +return !match_exception_partial (&parent->exceptions, ex->type, + ex->major, ex->minor, ex->access); +} + +/** * may_allow_all - checks if it's possible to change the behavior to * allow based on parent's rules. * @parent: device cgroup's parent
@@ -700,17 +731,21 @@ static int devcgroup_update_access(strucswitch (filetype) {case DEVCG_ALLOW : -if (!parent_has_perm (devcgroup, &ex)) -return -EPERM ;/* * If the default policy is to allow by default, try to remove * an matching exception instead. And be silent about it: we * don't want to break compatibility */ if (devcgroup->behavior ==DEVCG_DEFAULT_ALLOW ) { +/* Check if the parent allows removing it first */ +if (!parent_allows_removal (devcgroup, &ex)) +return -EPERM ;dev_exception_rm (devcgroup, &ex); -return 0 ; +break ; } + +if (!parent_has_perm (devcgroup, &ex)) +return -EPERM ; rc =dev_exception_add (devcgroup, &ex);break ;case DEVCG_DENY :
Greg Kroah-Hartman
maintainerPATCH 127/228 crypto: crypto_wq - Fix late crypto work queue initialization
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tim Chen <[email protected]>
commit 130fa5bc81b44b6cc1fbdea3abf6db0da22964e0 upstream.
The crypto algorithm modules utilizing the crypto daemon could be used early when the system start up. Using module_init does not guarantee that the daemon's work queue is initialized when the cypto alorithm depending on crypto_wq starts. It is necessary to initialize the crypto work queue earlier at the subsystem init time to make sure that it is initialized
when used.
--- crypto/crypto_wq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/crypto_wq.c +1 -1
@@ -33,7 +33,7 @@ static void __exit crypto_wq_exit(void)destroy_workqueue (kcrypto_wq); } -module_init (crypto_wq_init); +subsys_initcall (crypto_wq_init);module_exit (crypto_wq_exit);MODULE_LICENSE ("GPL" );
Greg Kroah-Hartman
maintainerPATCH 128/228 clk: vexpress: NULL dereference on error path
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit 6b4ed8b00e93bd31f24a25f59ed8d1b808d0cc00 upstream.
If the allocation fails then we dereference the NULL in the error path. Just return directly.
--- drivers/clk/versatile/clk-vexpress-osc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/versatile/clk-vexpress-osc.c +1 -1
@@ -102,7 +102,7 @@ void __init vexpress_osc_of_setup(struct osc =kzalloc (sizeof (*osc),GFP_KERNEL );if (!osc) - goto error; +return ; osc->func =vexpress_config_func_get_by_node (node);if (!osc->func) {
Greg Kroah-Hartman
maintainerPATCH 130/228 i2c: i801: enable Intel BayTrail SMBUS
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Chew, Kean ho" <[email protected]>
commit 1b31e9b76ef8c62291e698dfdb973499986a7f68 upstream.
Add Device ID of Intel BayTrail SMBus Controller.
--- Documentation/i2c/busses/i2c-i801 | 1 + drivers/i2c/busses/Kconfig | 1 + drivers/i2c/busses/i2c-i801.c | 3 +++ 3 files changed, 5 insertions(+)
Documentation/i2c/busses/i2c-i801 +1 -0
@@ -26,6 +26,7 @@ Supported adapters: * Intel Wellsburg (PCH) * Intel Coleto Creek (PCH) * Intel Wildcat Point-LP (PCH) + * Intel BayTrail (SOC) Datasheets: Publicly available at the Intel website On Intel Patsburg and later chipsets, both the normal host SMBus controller
drivers/i2c/busses/Kconfig +1 -0
@@ -110,6 +110,7 @@ config I2C_I801 Wellsburg (PCH) Coleto Creek (PCH) Wildcat Point-LP (PCH) + BayTrail (SOC) This driver can also be built as a module. If so, the module will be called i2c-i801.
drivers/i2c/busses/i2c-i801.c +3 -0
@@ -60,6 +60,7 @@ Wellsburg (PCH) MS 0x8d7f 32 hard yes yes yes Coleto Creek (PCH) 0x23b0 32 hard yes yes yes Wildcat Point-LP (PCH) 0x9ca2 32 hard yes yes yes + BayTrail (SOC) 0x0f12 32 hard yes yes yes Features supported by this driver: Software PEC no
@@ -161,6 +162,7 @@ STATUS_ERROR_FLAGS)/* Older devices have their ID defined in <linux/pci_ids.h> */ +#define PCI_DEVICE_ID_INTEL_BAYTRAIL_SMBUS 0x0f12#define PCI_DEVICE_ID_INTEL_COUGARPOINT_SMBUS 0x1c22#define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS 0x1d22/* Patsburg also has three 'Integrated Device Function' SMBus controllers */
@@ -822,6 +824,7 @@ static DEFINE_PCI_DEVICE_TABLE(i801_ids) { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_WELLSBURG_SMBUS_MS2) }, { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_COLETOCREEK_SMBUS) }, { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_WILDCATPOINT_LP_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BAYTRAIL_SMBUS) }, { 0, } };
Greg Kroah-Hartman
maintainerPATCH 131/228 Input: serio - add firmware_id sysfs attribute
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit 0456c66f4e905e1ca839318219c770988b47975c upstream.
serio devices exposed via platform firmware interfaces such as ACPI may provide additional identifying information of use to userspace.
We don't associate the serio devices with the firmware device (we don't set it as parent), so there's no way for userspace to make use of this information.
We cannot change the parent for serio devices instantiated though a firmware interface as that would break suspend / resume ordering.
Therefore this patch adds a new firmware_id sysfs attribute so that userspace can get a string from there with any additional identifying information the firmware interface may provide.
--- drivers/input/serio/serio.c | 14 ++++++++++++++ include/linux/serio.h | 1 + 2 files changed, 15 insertions(+)
drivers/input/serio/serio.c +14 -0
@@ -451,6 +451,13 @@ static ssize_t serio_set_bind_mode(strucreturn retval; } +static ssize_t firmware_id_show (struct device *dev,struct device_attribute *attr,char *buf) +{ +struct serio *serio =to_serio_port (dev); + +return sprintf (buf,"%s\n" , serio->firmware_id); +} +static DEVICE_ATTR_RO (type);static DEVICE_ATTR_RO (proto);static DEVICE_ATTR_RO (id);
@@ -473,12 +480,14 @@ static DEVICE_ATTR_RO(modalias);static DEVICE_ATTR_WO (drvctl); static DEVICE_ATTR(description, S_IRUGO, serio_show_description, NULL); static DEVICE_ATTR(bind_mode, S_IWUSR | S_IRUGO, serio_show_bind_mode, serio_set_bind_mode); +static DEVICE_ATTR_RO (firmware_id);static struct attribute *serio_device_attrs[] = { &dev_attr_modalias.attr, &dev_attr_description.attr, &dev_attr_drvctl.attr, &dev_attr_bind_mode.attr, + &dev_attr_firmware_id.attr,NULL };
@@ -921,9 +930,14 @@ static int serio_uevent(struct device *dSERIO_ADD_UEVENT_VAR ("SERIO_PROTO=%02x" , serio->id.proto);SERIO_ADD_UEVENT_VAR ("SERIO_ID=%02x" , serio->id.id);SERIO_ADD_UEVENT_VAR ("SERIO_EXTRA=%02x" , serio->id.extra); +SERIO_ADD_UEVENT_VAR ("MODALIAS=serio:ty%02Xpr%02Xid%02Xex%02X" , serio->id.type, serio->id.proto, serio->id.id, serio->id.extra); +if (serio->firmware_id[0 ]) +SERIO_ADD_UEVENT_VAR ("SERIO_FIRMWARE_ID=%s" , + serio->firmware_id); +return 0 ; }#undef SERIO_ADD_UEVENT_VAR
include/linux/serio.h +1 -0
@@ -23,6 +23,7 @@ struct serio {char name[32 ];char phys[32 ]; +char firmware_id[128 ];bool manual_bind;
Greg Kroah-Hartman
maintainerPATCH 132/228 Input: i8042 - add firmware_id support
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit a7c5868c3482127cb308c779b8a6460a3353c17f upstream.
Fill in the new serio firmware_id sysfs attribute for pnp instantiated 8042 serio ports.
--- drivers/input/serio/i8042-x86ia64io.h | 15 +++++++++++++++ drivers/input/serio/i8042.c | 6 ++++++ 2 files changed, 21 insertions(+)
drivers/input/serio/i8042-x86ia64io.h +15 -0
@@ -702,6 +702,17 @@ static int i8042_pnp_aux_irq;static char i8042_pnp_kbd_name[32 ];static char i8042_pnp_aux_name[32 ]; +static void i8042_pnp_id_to_string (struct pnp_id *id,char *dst,int dst_size) +{ +strlcpy (dst,"PNP:" , dst_size); + +while (id) { +strlcat (dst," " , dst_size); +strlcat (dst, id->id, dst_size); + id = id->next; + } +} +static int i8042_pnp_kbd_probe (struct pnp_dev *dev,const struct pnp_device_id *did) {if (pnp_port_valid (dev,0 ) &&pnp_port_len (dev,0 ) ==1 )
@@ -718,6 +729,8 @@ static int i8042_pnp_kbd_probe(struct pnstrlcat (i8042_pnp_kbd_name,":" ,sizeof (i8042_pnp_kbd_name));strlcat (i8042_pnp_kbd_name,pnp_dev_name (dev),sizeof (i8042_pnp_kbd_name)); } +i8042_pnp_id_to_string (dev->id, i8042_kbd_firmware_id, +sizeof (i8042_kbd_firmware_id));/* Keyboard ports are always supposed to be wakeup-enabled */ device_set_wakeup_enable (&dev->dev, true);
@@ -742,6 +755,8 @@ static int i8042_pnp_aux_probe(struct pnstrlcat (i8042_pnp_aux_name,":" ,sizeof (i8042_pnp_aux_name));strlcat (i8042_pnp_aux_name,pnp_dev_name (dev),sizeof (i8042_pnp_aux_name)); } +i8042_pnp_id_to_string (dev->id, i8042_aux_firmware_id, +sizeof (i8042_aux_firmware_id)); i8042_pnp_aux_devices++;return 0 ;
drivers/input/serio/i8042.c +6 -0
@@ -87,6 +87,8 @@ MODULE_PARM_DESC(debug, "Turn i8042 debu#endif static bool i8042_bypass_aux_irq_test; +static char i8042_kbd_firmware_id[128 ]; +static char i8042_aux_firmware_id[128 ];#include "i8042.h"
@@ -1218,6 +1220,8 @@ static int __init i8042_create_kbd_port( serio->dev.parent = &i8042_platform_device->dev;strlcpy (serio->name,"i8042 KBD port" ,sizeof (serio->name));strlcpy (serio->phys,I8042_KBD_PHYS_DESC ,sizeof (serio->phys)); +strlcpy (serio->firmware_id, i8042_kbd_firmware_id, +sizeof (serio->firmware_id)); port->serio = serio; port->irq =I8042_KBD_IRQ ;
@@ -1244,6 +1248,8 @@ static int __init i8042_create_aux_port(if (idx <0 ) {strlcpy (serio->name,"i8042 AUX port" ,sizeof (serio->name));strlcpy (serio->phys,I8042_AUX_PHYS_DESC ,sizeof (serio->phys)); +strlcpy (serio->firmware_id, i8042_aux_firmware_id, +sizeof (serio->firmware_id)); serio->close = i8042_port_close; }else {snprintf (serio->name,sizeof (serio->name),"i8042 AUX%d port" , idx);
Greg Kroah-Hartman
maintainerPATCH 133/228 Input: Add INPUT_PROP_TOPBUTTONPAD device property
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit f37c013409bb78ebb958821aa10d069e707cabac upstream.
On some newer laptops with a trackpoint the physical buttons for the trackpoint have been removed to allow for a larger touchpad. On these laptops the buttonpad has clearly marked areas on the top which are to be used as trackpad buttons.
Users of the event device-node need to know about this, so that they can properly interpret BTN_LEFT events as being a left / right / middle click depending on where on the button pad the clicking finger is.
This commits adds a INPUT_PROP_TOPBUTTONPAD device property which drivers for such buttonpads will use to signal to the user that this buttonpad not only has the normal bottom button area, but also a top button area.
--- include/uapi/linux/input.h | 1 + 1 file changed, 1 insertion(+)
include/uapi/linux/input.h +1 -0
@@ -164,6 +164,7 @@ struct input_keymap_entry {#define INPUT_PROP_DIRECT 0x01/* direct input devices */ #define INPUT_PROP_BUTTONPAD 0x02/* has button(s) under pad */ #define INPUT_PROP_SEMI_MT 0x03/* touch rectangle only */ +#define INPUT_PROP_TOPBUTTONPAD 0x04/* softbuttons at top of pad */ #define INPUT_PROP_MAX 0x1f#define INPUT_PROP_CNT (INPUT_PROP_MAX + 1)
Greg Kroah-Hartman
maintainerPATCH 134/228 Input: synaptics - report INPUT_PROP_TOPBUTTONPAD property
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit 43e19888b1fe2a3e8a5543030c5b286cde38b3f5 upstream.
Check PNP ID of the PS/2 AUX port and report INPUT_PROP_TOPBUTTONPAD property for for touchpads with top button areas.
--- drivers/input/mouse/synaptics.c | 55 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-)
drivers/input/mouse/synaptics.c +53 -2
@@ -117,6 +117,44 @@ void synaptics_reset(struct psmouse *psm }#ifdef CONFIG_MOUSE_PS2_SYNAPTICS +/* This list has been kindly provided by Synaptics. */ +static const char *const topbuttonpad_pnp_ids[] = { +"LEN0017" , +"LEN0018" , +"LEN0019" , +"LEN0023" , +"LEN002A" , +"LEN002B" , +"LEN002C" , +"LEN002D" , +"LEN002E" , +"LEN0033" ,/* Helix */ +"LEN0034" ,/* T431s, T540, X1 Carbon 2nd */ +"LEN0035" ,/* X240 */ +"LEN0036" ,/* T440 */ +"LEN0037" , +"LEN0038" , +"LEN0041" , +"LEN0042" ,/* Yoga */ +"LEN0045" , +"LEN0046" , +"LEN0047" , +"LEN0048" , +"LEN0049" , +"LEN2000" , +"LEN2001" , +"LEN2002" , +"LEN2003" , +"LEN2004" ,/* L440 */ +"LEN2005" , +"LEN2006" , +"LEN2007" , +"LEN2008" , +"LEN2009" , +"LEN200A" , +"LEN200B" , +NULL +};/***************************************************************************** * Synaptics communications functions
@@ -1255,8 +1293,10 @@ static void set_abs_position_params(struinput_abs_set_res (dev, y_code, priv->y_res); } -static void set_input_params (struct input_dev *dev,struct synaptics_data *priv) +static void set_input_params (struct psmouse *psmouse, +struct synaptics_data *priv) { +struct input_dev *dev = psmouse->dev;int i;/* Things that apply to both modes */
@@ -1325,6 +1365,17 @@ static void set_input_params(struct inpuif (SYN_CAP_CLICKPAD (priv->ext_cap_0c)) {__set_bit (INPUT_PROP_BUTTONPAD , dev->propbit); +/* See if this buttonpad has a top button area */ +if (!strncmp (psmouse->ps2dev.serio->firmware_id,"PNP:" ,4 )) { +for (i =0 ; topbuttonpad_pnp_ids[i]; i++) { +if (strstr (psmouse->ps2dev.serio->firmware_id, + topbuttonpad_pnp_ids[i])) { +__set_bit (INPUT_PROP_TOPBUTTONPAD , + dev->propbit); +break ; + } + } + }/* Clickpads report only left button */ __clear_bit (BTN_RIGHT , dev->keybit);__clear_bit (BTN_MIDDLE , dev->keybit);
@@ -1643,7 +1694,7 @@ static int __synaptics_init(struct psmou priv->capabilities, priv->ext_cap, priv->ext_cap_0c, priv->board_id, priv->firmware_id); -set_input_params (psmouse->dev, priv); +set_input_params (psmouse, priv);/* * Encode touchpad model so that it can be used to set
Greg Kroah-Hartman
maintainerPATCH 135/228 e1000e: Fix no connectivity when driver loaded with cable out
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Ertman <[email protected]>
commit b20a774495671f037e7160ea2ce8789af6b61533 upstream.
In commit da1e2046e5, the flow for enabling/disabling an Si errata workaround (e1000_lv_jumbo_workaround_ich8lan) was changed to fix a problem with iAMT connections dropping on interface down with jumbo frames set. Part of this change was to move the function call disabling the workaround to e1000e_down() from the e1000_setup_rctl() function. The mechanic for disabling of this workaround involves writing several MAC and PHY registers back to hardware defaults.
After this commit, when the driver is loaded with the cable out, the PHY registers are not programmed with the correct default values. This causes the device to be capable of transmitting packets, but is unable to recieve them until this workaround is called.
The flow of e1000e's open code relies upon calling the above workaround to expicitly program these registers either with jumbo frame appropriate settings or h/w defaults on 82579 and newer hardware.
Fix this issue by adding logic to e1000_setup_rctl() that not only calls e1000_lv_jumbo_workaround_ich8lan() when jumbo frames are set, to enable the workaround, but also calls this function to explicitly disable the workaround in the case that jumbo frames are not set.
--- drivers/net/ethernet/intel/e1000e/netdev.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-)
drivers/net/ethernet/intel/e1000e/netdev.c +15 -5
@@ -2976,11 +2976,21 @@ static void e1000_setup_rctl(struct e100u32 rctl, rfctl;u32 pages =0 ; -/* Workaround Si errata on PCHx - configure jumbo frame flow */ -if ((hw->mac.type >= e1000_pch2lan) && - (adapter->netdev->mtu >ETH_DATA_LEN ) && -e1000_lv_jumbo_workaround_ich8lan (hw, true)) -e_dbg ("failed to enable jumbo frame workaround mode\n" ); +/* Workaround Si errata on PCHx - configure jumbo frame flow. +* If jumbo frames not set, program related MAC/PHY registers +* to h/w defaults +*/ +if (hw->mac.type >= e1000_pch2lan) { +s32 ret_val; + +if (adapter->netdev->mtu >ETH_DATA_LEN ) + ret_val =e1000_lv_jumbo_workaround_ich8lan (hw, true); +else + ret_val =e1000_lv_jumbo_workaround_ich8lan (hw, false); + +if (ret_val) +e_dbg ("failed to enable|disable jumbo frame workaround mode\n" ); + }/* Program MC offset vector base */ rctl =er32 (RCTL );
Greg Kroah-Hartman
maintainerPATCH 136/228 ceph: clear directorys completeness when creating file
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Yan, Zheng" <[email protected]>
commit 0a8a70f96fe1bd3e07c15bb86fd247e76102398a upstream.
When creating a file, ceph_set_dentry_offset() puts the new dentry at the end of directory's d_subdirs, then set the dentry's offset based on directory's max offset. The offset does not reflect the real postion of the dentry in directory. Later readdir reply from MDS may change the dentry's position/offset. This inconsistency can cause missing/duplicate entries in readdir result if readdir is partly satisfied by dcache_readdir().
The fix is clear directory's completeness after creating/renaming file. It prevents later readdir from using dcache_readdir().
--- fs/ceph/dir.c | 9 +++---- fs/ceph/inode.c | 71 ++++++++++++-------------------------------------------- fs/ceph/super.h | 1 3 files changed, 21 insertions(+), 60 deletions(-)
fs/ceph/dir.c +5 -4
@@ -446,7 +446,6 @@ more:if (atomic_read (&ci->i_release_count) == fi->dir_release_count) {dout (" marking %p complete\n" , inode);__ceph_dir_set_complete (ci, fi->dir_release_count); - ci->i_max_offset = ctx->pos; }spin_unlock (&ci->i_ceph_lock);
@@ -932,14 +931,16 @@ static int ceph_rename(struct inode *old* to do it here. */ -/* d_move screws up d_subdirs order */ -ceph_dir_clear_complete (new_dir); -d_move (old_dentry, new_dentry);/* ensure target dentry is invalidated, despite rehashing bug in vfs_rename_dir */ ceph_invalidate_dentry_lease (new_dentry); + +/* d_move screws up sibling dentries' offsets */ +ceph_dir_clear_complete (old_dir); +ceph_dir_clear_complete (new_dir); + }ceph_mdsc_put_request (req);return err;
fs/ceph/inode.c +16 -55
137 lines not on this page · raw message
fs/ceph/super.h +0 -1
@@ -266,7 +266,6 @@ struct ceph_inode_info {struct timespec i_rctime;u64 i_rbytes, i_rfiles, i_rsubdirs;u64 i_files, i_subdirs; -u64 i_max_offset;/* largest readdir offset, set with complete dir */ struct rb_root i_fragtree;struct mutex i_fragtree_mutex;
Greg Kroah-Hartman
maintainerPATCH 137/228 autofs: fix lockref lookup
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Kent <[email protected]>
commit 6b6751f7feba68d8f5c72b72cc69a1c5a625529c upstream.
autofs needs to be able to see private data dentry flags for its dentrys that are being created but not yet hashed and for its dentrys that have been rmdir()ed but not yet freed. It needs to do this so it can block processes in these states until a status has been returned to indicate the given operation is complete.
It does this by keeping two lists, active and expring, of dentrys in this state and uses ->d_release() to keep them stable while it checks the reference count to determine if they should be used.
But with the recent lockref changes dentrys being freed sometimes don't transition to a reference count of 0 before being freed so autofs can occassionally use a dentry that is invalid which can lead to a panic.
--- fs/autofs4/root.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/autofs4/root.c +2 -2
@@ -179,7 +179,7 @@ static struct dentry *autofs4_lookup_actspin_lock (&active->d_lock);/* Already gone? */ -if (!d_count (active)) +if ((int )d_count (active) <=0 ) goto next; qstr = &active->d_name;
@@ -230,7 +230,7 @@ static struct dentry *autofs4_lookup_expspin_lock (&expiring->d_lock); -/* Bad luck, we've already been dentry_iput */ +/* We've already been dentry_iput or unlinked */ if (!expiring->d_inode) goto next;
Greg Kroah-Hartman
maintainerPATCH 138/228 fix races between __d_instantiate() and checks of dentry flags
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Al Viro <[email protected]>
commit 22213318af7ae265bc6cd8aef2febbc2d69a2440 upstream.
in non-lazy walk we need to be careful about dentry switching from negative to positive - both ->d_flags and ->d_inode are updated, and in some places we might see only one store. The cases where dentry has been obtained by dcache lookup with ->i_mutex held on parent are safe - ->d_lock and ->i_mutex provide all the barriers we need. However, there are several places where we run into trouble:
* do_last() fetches ->d_inode, then checks ->d_flags and
assumes that inode won't be NULL unless d_is_negative() is true. Race with e.g. creat() - we might have fetched the old value of ->d_inode (still NULL) and new value of ->d_flags (already not DCACHE_MISS_TYPE). Lin Ming has observed and reported the resulting oops.
* a bunch of places checks ->d_inode for being non-NULL,
then checks ->d_flags for "is it a symlink". Race with symlink(2) in case if our CPU sees ->d_inode update first - we see non-NULL there, but ->d_flags still contains DCACHE_MISS_TYPE instead of DCACHE_SYMLINK_TYPE. Result: false negative on "should we follow link here?", with subsequent unpleasantness.
--- fs/dcache.c | 3 +-- fs/namei.c | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-)
fs/dcache.c +1 -2
@@ -1647,8 +1647,7 @@ static void __d_instantiate(struct dentrunsigned add_flags =d_flags_for_inode (inode);spin_lock (&dentry->d_lock); - dentry->d_flags &= ~DCACHE_ENTRY_TYPE ; - dentry->d_flags |= add_flags; +__d_set_type (dentry, add_flags);if (inode)hlist_add_head (&dentry->d_alias, &inode->i_dentry); dentry->d_inode = inode;
fs/namei.c +3 -3
@@ -1537,7 +1537,7 @@ static inline int walk_component(struct inode = path->dentry->d_inode; } err = -ENOENT ; -if (!inode) +if (!inode ||d_is_negative (path->dentry)) goto out_path_put;if (should_follow_link (path->dentry, follow)) {
@@ -2240,7 +2240,7 @@ mountpoint_last(struct nameidata *nd, stmutex_unlock (&dir->d_inode->i_mutex); done: -if (!dentry->d_inode) { +if (!dentry->d_inode ||d_is_negative (dentry)) { error = -ENOENT ;dput (dentry); goto out;
@@ -2982,7 +2982,7 @@ retry_lookup: finish_lookup:/* we _can_ be in RCU mode here */ error = -ENOENT ; -if (d_is_negative (path->dentry)) { +if (!inode ||d_is_negative (path->dentry)) {path_to_nameidata (path, nd); goto out; }
Greg Kroah-Hartman
maintainerPATCH 139/228 trace: module: Maintain a valid user count
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Romain Izard <[email protected]>
commit 098507ae3ec2331476fb52e85d4040c1cc6d0ef4 upstream.
The replacement of the 'count' variable by two variables 'incs' and 'decs' to resolve some race conditions during module unloading was done in parallel with some cleanup in the trace subsystem, and was integrated as a merge.
Unfortunately, the formula for this replacement was wrong in the tracing code, and the refcount in the traces was not usable as a result.
Use 'count = incs - decs' to compute the user count.
--- include/trace/events/module.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/trace/events/module.h +1 -1
@@ -78,7 +78,7 @@ DECLARE_EVENT_CLASS(module_refcnt,TP_fast_assign ( __entry->ip = ip; - __entry->refcnt =__this_cpu_read (mod->refptr->incs) +__this_cpu_read (mod->refptr->decs); + __entry->refcnt =__this_cpu_read (mod->refptr->incs) -__this_cpu_read (mod->refptr->decs);__assign_str (name, mod->name); ),
Greg Kroah-Hartman
maintainerPATCH 140/228 Input: atkbd - fix keyboard not working on some LG laptops
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sheng-Liang Song <[email protected]>
commit 3d725caa9dcc78c3dc9e7ea0c04f626468edd9c9 upstream.
After issuing ATKBD_CMD_RESET_DIS, keyboard on some LG laptops stops working. The workaround is to stop issuing ATKBD_CMD_RESET_DIS commands.
In order to keep changes in atkbd driver to the minimum we check DMI signature and only skip ATKBD_CMD_RESET_DIS if we are running on LG LW25-B7HV or P1-J273B.
--- drivers/input/keyboard/atkbd.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-)
drivers/input/keyboard/atkbd.c +28 -1
@@ -243,6 +243,12 @@ static void (*atkbd_platform_fixup)(strustatic void *atkbd_platform_fixup_data;static unsigned int (*atkbd_platform_scancode_fixup)(struct atkbd *,unsigned int ); +/* +* Certain keyboards to not like ATKBD_CMD_RESET_DIS and stop responding +* to many commands until full reset (ATKBD_CMD_RESET_BAT) is performed. +*/ +static bool atkbd_skip_deactivate; +static ssize_t atkbd_attr_show_helper (struct device *dev,char *buf,ssize_t (*handler)(struct atkbd *,char *)); static ssize_t atkbd_attr_set_helper(struct device *dev, const char *buf, size_t count,
@@ -768,7 +774,8 @@ static int atkbd_probe(struct atkbd *atk* Make sure nothing is coming from the keyboard and disturbs our * internal state. */ -atkbd_deactivate (atkbd); +if (!atkbd_skip_deactivate) +atkbd_deactivate (atkbd);return 0 ; }
@@ -1638,6 +1645,12 @@ static int __init atkbd_setup_scancode_freturn 1 ; } +static int __init atkbd_deactivate_fixup (const struct dmi_system_id *id) +{ + atkbd_skip_deactivate = true; +return 1 ; +} +static const struct dmi_system_id atkbd_dmi_quirk_table[]__initconst = { { .matches = {
@@ -1775,6 +1788,20 @@ static const struct dmi_system_id atkbd_ .callback = atkbd_setup_scancode_fixup, .driver_data = atkbd_oqo_01plus_scancode_fixup, }, + { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"), + DMI_MATCH(DMI_PRODUCT_NAME, "LW25-B7HV"), + }, + .callback = atkbd_deactivate_fixup, + }, + { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"), + DMI_MATCH(DMI_PRODUCT_NAME, "P1-J273B"), + }, + .callback = atkbd_deactivate_fixup, + }, { } };
Greg Kroah-Hartman
maintainerPATCH 141/228 Input: elantech - fix touchpad initialization on Gigabyte U2442
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit 36189cc3cd57ab0f1cd75241f93fe01de928ac06 upstream.
The hw_version 3 Elantech touchpad on the Gigabyte U2442 does not accept 0x0b as initialization value for r10, this stand-alone version of the
driver: http://planet76.com/drivers/elantech/psmouse-elantech-v6.tar.bz2
Uses 0x03 which does work, so this means not setting bit 3 of r10 which
sets: "Enable Real H/W Resolution In Absolute mode"
Which will result in half the x and y resolution we get with that bit set, so simply not setting it everywhere is not a solution. We've been unable to find a way to identify touchpads where setting the bit will fail, so this patch uses a dmi based blacklist for this.
https://bugzilla.kernel.org/show_bug.cgi?id=61151
--- Documentation/input/elantech.txt | 5 ++++- drivers/input/mouse/elantech.c | 26 +++++++++++++++++++++++++- drivers/input/mouse/elantech.h | 1 + 3 files changed, 30 insertions(+), 2 deletions(-)
Documentation/input/elantech.txt +4 -1
@@ -504,9 +504,12 @@ byte 5: * reg_10 bit 7 6 5 4 3 2 1 0 - 0 0 0 0 0 0 0 A + 0 0 0 0 R F T A A: 1 = enable absolute tracking + T: 1 = enable two finger mode auto correct + F: 1 = disable ABS Position Filter + R: 1 = enable real hardware resolution 6.2 Native absolute mode 6 byte packet format ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/input/mouse/elantech.c +25 -1
@@ -11,6 +11,7 @@*/ #include <linux/delay.h> +#include <linux/dmi.h> #include <linux/slab.h> #include <linux/module.h> #include <linux/input.h>
@@ -831,7 +832,11 @@ static int elantech_set_absolute_mode(stbreak ;case 3 : - etd->reg_10 =0x0b ; +if (etd->set_hw_resolution) + etd->reg_10 =0x0b ; +else + etd->reg_10 =0x03 ; +if (elantech_write_reg (psmouse,0x10 , etd->reg_10)) rc =-1 ;
@@ -1331,6 +1336,22 @@ static int elantech_reconnect(struct psm }/* +* Some hw_version 3 models go into error state when we try to set bit 3 of r10 +*/ +static const struct dmi_system_id no_hw_res_dmi_table[] = { +#if defined(CONFIG_DMI) && defined(CONFIG_X86) + { +/* Gigabyte U2442 */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"GIGABYTE" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"U2442" ), + }, + }, +#endif + { } +}; + +/* * determine hardware version and set some properties according to it. */ static int elantech_set_properties (struct elantech_data *etd)
@@ -1389,6 +1410,9 @@ static int elantech_set_properties(struc*/ etd->crc_enabled = ((etd->fw_version &0x4000 ) ==0x4000 ); +/* Enable real hardware resolution on hw_version 3 ? */ + etd->set_hw_resolution = !dmi_check_system (no_hw_res_dmi_table); +return 0 ; }
drivers/input/mouse/elantech.h +1 -0
@@ -130,6 +130,7 @@ struct elantech_data {bool jumpy_cursor;bool reports_pressure;bool crc_enabled; +bool set_hw_resolution;unsigned char hw_version;unsigned int fw_version;unsigned int single_finger_reports;
Greg Kroah-Hartman
maintainerPATCH 142/228 Input: synaptics - add min/max quirk for the ThinkPad W540
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit 0b5fe736fe923f1f5e05413878d5990e92ffbdf5 upstream.
https://bugzilla.redhat.com/show_bug.cgi?id=1096436
--- drivers/input/mouse/synaptics.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/input/mouse/synaptics.c +8 -0
@@ -1614,6 +1614,14 @@ static const struct dmi_system_id min_ma .driver_data = (int []){1024, 5112, 2024, 4832}, }, { +/* Lenovo ThinkPad W540 */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W540"), + }, + .driver_data = (int []){1024, 5112, 2024, 4832}, + }, + {/* Lenovo Yoga S1 */ .matches = { DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
Greg Kroah-Hartman
maintainerPATCH 143/228 Input: synaptics - T540p - unify with other LEN0034 models
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit 6d396ede224dc596d92d7cab433713536e68916c upstream.
The T540p has a touchpad with pnp-id LEN0034, all the models with this pnp-id have the same min/max values, except the T540p where the values are slightly off. Fix them to be identical.
This is a preparation patch for simplifying the quirk table.
--- drivers/input/mouse/synaptics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/mouse/synaptics.c +1 -1
@@ -1603,7 +1603,7 @@ static const struct dmi_system_id min_maDMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T540"), }, - .driver_data = (int []){1024, 5056, 2058, 4832}, + .driver_data = (int []){1024, 5112, 2024, 4832}, }, {/* Lenovo ThinkPad L540 */
Greg Kroah-Hartman
maintainerPATCH 144/228 Input: synaptics - add a matches_pnp_id helper function
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit e2f611029b370bb7a04236215ad4b36aa8cb98cd upstream.
This is a preparation patch for simplifying the min/max quirk table.
--- drivers/input/mouse/synaptics.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-)
drivers/input/mouse/synaptics.c +14 -11
@@ -156,6 +156,18 @@ static const char * const topbuttonpad_p NULL }; +static bool matches_pnp_id (struct psmouse *psmouse,const char *const ids[]) +{ +int i; + +if (!strncmp (psmouse->ps2dev.serio->firmware_id,"PNP:" ,4 )) +for (i =0 ; ids[i]; i++) +if (strstr (psmouse->ps2dev.serio->firmware_id, ids[i])) +return true; + +return false; +} +/***************************************************************************** * Synaptics communications functions ****************************************************************************/
@@ -1365,17 +1377,8 @@ static void set_input_params(struct psmoif (SYN_CAP_CLICKPAD (priv->ext_cap_0c)) {__set_bit (INPUT_PROP_BUTTONPAD , dev->propbit); -/* See if this buttonpad has a top button area */ -if (!strncmp (psmouse->ps2dev.serio->firmware_id,"PNP:" ,4 )) { -for (i =0 ; topbuttonpad_pnp_ids[i]; i++) { -if (strstr (psmouse->ps2dev.serio->firmware_id, - topbuttonpad_pnp_ids[i])) { -__set_bit (INPUT_PROP_TOPBUTTONPAD , - dev->propbit); -break ; - } - } - } +if (matches_pnp_id (psmouse, topbuttonpad_pnp_ids)) +__set_bit (INPUT_PROP_TOPBUTTONPAD , dev->propbit);/* Clickpads report only left button */ __clear_bit (BTN_RIGHT , dev->keybit);__clear_bit (BTN_MIDDLE , dev->keybit);
Greg Kroah-Hartman
maintainerPATCH 145/228 Input: synaptics - change min/max quirk table to pnp-id matching
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit 0f68f39c393bc06ac5ccc8794f0e2ed841e41c3e upstream.
Most of the affected models share pnp-ids for the touchpad. So switching to pnp-ids give us 2 advantages:
1) It shrinks the quirk list
2) It will lower the new quirk addition frequency, ie the recently added W540 quirk would not have been necessary since it uses the same LEN0034 pnp ids as other models already added before it
As an added bonus it actually puts the quirk on the actual psmouse, rather then on the machine, which is technically more correct.
--- drivers/input/mouse/synaptics.c | 149 +++++++++------------------------------- 1 file changed, 36 insertions(+), 113 deletions(-)
drivers/input/mouse/synaptics.c +36 -113
@@ -117,6 +117,31 @@ void synaptics_reset(struct psmouse *psm }#ifdef CONFIG_MOUSE_PS2_SYNAPTICS +struct min_max_quirk { +const char *const *pnp_ids; +int x_min, x_max, y_min, y_max; +}; + +static const struct min_max_quirk min_max_pnpid_table[] = { + { + (const char *const []){"LEN0033" ,NULL }, +1024 ,5052 ,2258 ,4832 + }, + { + (const char *const []){"LEN0035" ,"LEN0042" ,NULL }, +1232 ,5710 ,1156 ,4696 + }, + { + (const char *const []){"LEN0034" ,"LEN0036" ,"LEN2004" ,NULL }, +1024 ,5112 ,2024 ,4832 + }, + { + (const char *const []){"LEN2001" ,NULL }, +1024 ,5022 ,2508 ,4832 + }, + { } +}; +/* This list has been kindly provided by Synaptics. */ static const char *const topbuttonpad_pnp_ids[] = { "LEN0017",
@@ -129,7 +154,7 @@ static const char * const topbuttonpad_p"LEN002D" ,"LEN002E" ,"LEN0033" ,/* Helix */ -"LEN0034" ,/* T431s, T540, X1 Carbon 2nd */ +"LEN0034" ,/* T431s, L440, L540, T540, W540, X1 Carbon 2nd */ "LEN0035" ,/* X240 */ "LEN0036" ,/* T440 */ "LEN0037",
@@ -142,7 +167,7 @@ static const char * const topbuttonpad_p"LEN0048" ,"LEN0049" ,"LEN2000" , -"LEN2001" , +"LEN2001" ,/* Edge E431 */ "LEN2002" ,"LEN2003" , "LEN2004", /* L440 */
@@ -316,20 +341,20 @@ static int synaptics_identify(struct psm* Resolution is left zero if touchpad does not support the query */ -static const int *quirk_min_max; -static int synaptics_resolution (struct psmouse *psmouse) {struct synaptics_data *priv = psmouse->private;unsigned char resp[3 ]; +int i; -if (quirk_min_max) { - priv->x_min = quirk_min_max[0 ]; - priv->x_max = quirk_min_max[1 ]; - priv->y_min = quirk_min_max[2 ]; - priv->y_max = quirk_min_max[3 ]; -return 0 ; - } +for (i =0 ; min_max_pnpid_table[i].pnp_ids; i++) +if (matches_pnp_id (psmouse, min_max_pnpid_table[i].pnp_ids)) { + priv->x_min = min_max_pnpid_table[i].x_min; + priv->x_max = min_max_pnpid_table[i].x_max; + priv->y_min = min_max_pnpid_table[i].y_min; + priv->y_max = min_max_pnpid_table[i].y_max; +return 0 ; + }if (SYN_ID_MAJOR (priv->identity) <4 )return 0 ;
@@ -1550,112 +1575,10 @@ static const struct dmi_system_id olpc_d { } }; -static const struct dmi_system_id min_max_dmi_table[]__initconst = { -#if defined(CONFIG_DMI) - { -/* Lenovo ThinkPad Helix */ - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), -DMI_MATCH (DMI_PRODUCT_VERSION ,"ThinkPad Helix" ), - }, - .driver_data = (int []){1024 ,5052 ,2258 ,4832 }, - }, - { -/* Lenovo ThinkPad X240 */ - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), -DMI_MATCH (DMI_PRODUCT_VERSION ,"ThinkPad X240" ), - }, - .driver_data = (int []){1232 ,5710 ,1156 ,4696 }, - }, - { -/* Lenovo ThinkPad Edge E431 */ - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), -DMI_MATCH (DMI_PRODUCT_VERSION ,"ThinkPad Edge E431" ), - }, - .driver_data = (int []){1024 ,5022 ,2508 ,4832 }, - }, - { -/* Lenovo ThinkPad T431s */ - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), -DMI_MATCH (DMI_PRODUCT_VERSION ,"ThinkPad T431" ), - }, - .driver_data = (int []){1024 ,5112 ,2024 ,4832 }, - }, - { -/* Lenovo ThinkPad T440s */ - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), -DMI_MATCH (DMI_PRODUCT_VERSION ,"ThinkPad T440" ), - }, - .driver_data = (int []){1024 ,5112 ,2024 ,4832 }, - }, - { -/* Lenovo ThinkPad L440 */ - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), -DMI_MATCH (DMI_PRODUCT_VERSION ,"ThinkPad L440" ), - }, - .driver_data = (int []){1024 ,5112 ,2024 ,4832 }, - }, - { -/* Lenovo ThinkPad T540p */ - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), -DMI_MATCH (DMI_PRODUCT_VERSION ,"ThinkPad T540" ), - }, - .driver_data = (int []){1024 ,5112 ,2024 ,4832 }, - }, - { -/* Lenovo ThinkPad L540 */ - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), -DMI_MATCH (DMI_PRODUCT_VERSION ,"ThinkPad L540" ), - }, - .driver_data = (int []){1024 ,5112 ,2024 ,4832 }, - }, - { -/* Lenovo ThinkPad W540 */ - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), -DMI_MATCH (DMI_PRODUCT_VERSION ,"ThinkPad W540" ), - }, - .driver_data = (int []){1024 ,5112 ,2024 ,4832 }, - }, - { -/* Lenovo Yoga S1 */ - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), -DMI_EXACT_MATCH (DMI_PRODUCT_VERSION , -"ThinkPad S1 Yoga" ), - }, - .driver_data = (int []){1232 ,5710 ,1156 ,4696 }, - }, - { -/* Lenovo ThinkPad X1 Carbon Haswell (3rd generation) */ - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), -DMI_MATCH (DMI_PRODUCT_VERSION , -"ThinkPad X1 Carbon 2nd" ), - }, - .driver_data = (int []){1024 ,5112 ,2024 ,4832 }, - }, -#endif - { } -}; -void __init synaptics_module_init (void ) { -const struct dmi_system_id *min_max_dmi; - impaired_toshiba_kbc =dmi_check_system (toshiba_dmi_table); broken_olpc_ec =dmi_check_system (olpc_dmi_table); - - min_max_dmi =dmi_first_match (min_max_dmi_table); -if (min_max_dmi) - quirk_min_max = min_max_dmi->driver_data; }static int __synaptics_init (struct psmouse *psmouse,bool absolute_mode)
Greg Kroah-Hartman
maintainerPATCH 146/228 ALSA: hda - hdmi: Set converter channel count even without sink
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anssi Hannula <[email protected]>
commit f06ab794af7055d0949b09885f79f8b493deec64 upstream.
Since commit 1df5a06a ("ALSA: hda - hdmi: Fix programmed active channel count") channel count is no longer being set if monitor_present is 0. This is because setting the count was moved after the CA value is determined, which is only after the monitor_present check in hdmi_setup_audio_infoframe().
Unfortunately, in some cases, such as with a non-spec-compliant codec or with a problematic video driver, monitor_present is always 0. As a specific example, this seems to happen with gen1 ATV (SiI1390 codec), causing left-channel-only stereo playback (multi-channel playback has apparently never worked with this codec despite it reporting 8 channels, reason unknown).
Simply setting converter channel count without setting the pin infoframe and channel mapping as well does not theoretically make much sense as this will just mean they are out-of-sync and multichannel playback will have a wrong channel mapping.
However, adding back just setting the converter channel count even in no-monitor case is the safest change which at least fixes the stereo playback regression on SiI1390 codec. Do that.
--- sound/pci/hda/patch_hdmi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/pci/hda/patch_hdmi.c +3 -1
@@ -1123,8 +1123,10 @@ static void hdmi_setup_audio_infoframe(s AMP_OUT_UNMUTE); eld = &per_pin->sink_eld; -if (!eld->monitor_present) +if (!eld->monitor_present) { +hdmi_set_channel_count (codec, per_pin->cvt_nid, channels);return ; + }if (!non_pcm && per_pin->chmap_set) ca =hdmi_manual_channel_allocation (channels, per_pin->chmap);
Greg Kroah-Hartman
maintainerPATCH 147/228 ALSA: hda - Fix onboard audio on Intel H97/Z97 chipsets
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 77f07800cb456bed6e5c345e6e4e83e8eda62437 upstream.
The recent Intel H97/Z97 chipsets need the similar setups like other Intel chipsets for snooping, etc. Especially without snooping, the audio playback stutters or gets corrupted. This fix patch just adds the corresponding PCI ID entry with the proper flags.
--- sound/pci/hda/hda_intel.c | 3 +++ 1 file changed, 3 insertions(+)
sound/pci/hda/hda_intel.c +3 -0
@@ -3988,6 +3988,9 @@ static DEFINE_PCI_DEVICE_TABLE(azx_ids)/* Lynx Point */ { PCI_DEVICE(0x8086, 0x8c20), .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH }, + /* 9 Series */ + { PCI_DEVICE(0x8086, 0x8ca0), + .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH }, /* Wellsburg */ { PCI_DEVICE(0x8086, 0x8d20), .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
Greg Kroah-Hartman
maintainerPATCH 148/228 NFSd: Move default initialisers from create_client() to alloc_client()
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
commit 5694c93e6c4954fa9424c215f75eeb919bddad64 upstream.
Aside from making it clearer what is non-trivial in create_client(), it also fixes a bug whereby we can call free_client() before idr_init() has been called.
--- fs/nfsd/nfs4state.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
fs/nfsd/nfs4state.c +12 -12
@@ -1078,6 +1078,18 @@ static struct nfs4_client *alloc_client(return NULL ; } clp->cl_name.len = name.len; +INIT_LIST_HEAD (&clp->cl_sessions); +idr_init (&clp->cl_stateids); +atomic_set (&clp->cl_refcount,0 ); + clp->cl_cb_state =NFSD4_CB_UNKNOWN ; +INIT_LIST_HEAD (&clp->cl_idhash); +INIT_LIST_HEAD (&clp->cl_openowners); +INIT_LIST_HEAD (&clp->cl_delegations); +INIT_LIST_HEAD (&clp->cl_lru); +INIT_LIST_HEAD (&clp->cl_callbacks); +INIT_LIST_HEAD (&clp->cl_revoked); +spin_lock_init (&clp->cl_lock); +rpc_init_wait_queue (&clp->cl_cb_waitq,"Backchannel slot table" );return clp; }
@@ -1347,7 +1359,6 @@ static struct nfs4_client *create_clientif (clp ==NULL )return NULL ; -INIT_LIST_HEAD (&clp->cl_sessions); ret =copy_cred (&clp->cl_cred, &rqstp->rq_cred);if (ret) {spin_lock (&nn->client_lock);
@@ -1355,20 +1366,9 @@ static struct nfs4_client *create_clientspin_unlock (&nn->client_lock);return NULL ; } -idr_init (&clp->cl_stateids); -atomic_set (&clp->cl_refcount,0 ); - clp->cl_cb_state =NFSD4_CB_UNKNOWN ; -INIT_LIST_HEAD (&clp->cl_idhash); -INIT_LIST_HEAD (&clp->cl_openowners); -INIT_LIST_HEAD (&clp->cl_delegations); -INIT_LIST_HEAD (&clp->cl_lru); -INIT_LIST_HEAD (&clp->cl_callbacks); -INIT_LIST_HEAD (&clp->cl_revoked); -spin_lock_init (&clp->cl_lock);nfsd4_init_callback (&clp->cl_cb_null); clp->cl_time =get_seconds ();clear_bit (0 , &clp->cl_cb_slot_busy); -rpc_init_wait_queue (&clp->cl_cb_waitq,"Backchannel slot table" );copy_verf (clp, verf);rpc_copy_addr ((struct sockaddr *) &clp->cl_addr, sa);gen_confirm (clp);
Greg Kroah-Hartman
maintainerPATCH 149/228 NFSd: call rpc_destroy_wait_queue() from free_client()
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
commit 4cb57e3032d4e4bf5e97780e9907da7282b02b0c upstream.
Mainly to ensure that we don't leave any hanging timers.
--- fs/nfsd/nfs4state.c | 1 + 1 file changed, 1 insertion(+)
fs/nfsd/nfs4state.c +1 -0
@@ -1107,6 +1107,7 @@ free_client(struct nfs4_client *clp)WARN_ON_ONCE (atomic_read (&ses->se_ref));free_session (ses); } +rpc_destroy_wait_queue (&clp->cl_cb_waitq);free_svc_cred (&clp->cl_cred);kfree (clp->cl_name.data);idr_destroy (&clp->cl_stateids);
Greg Kroah-Hartman
maintainerPATCH 150/228 NFSD: Call ->set_acl with a NULL ACL structure if no entries
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kinglong Mee <[email protected]>
commit aa07c713ecfc0522916f3cd57ac628ea6127c0ec upstream.
After setting ACL for directory, I got two problems that caused by the cached zero-length default posix acl.
This patch make sure nfsd4_set_nfs4_acl calls ->set_acl with a NULL ACL structure if there are no entries.
Thanks for Christoph Hellwig's advice.
First problem:
............ hang ...........
Second problem:
[ 1610.167668] ------------[ cut here ]------------ [ 1610.168320] kernel BUG at /root/nfs/linux/fs/nfsd/nfs4acl.c:239! [ 1610.168320] invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC [ 1610.168320] Modules linked in: nfsv4(OE) nfs(OE) nfsd(OE)
rpcsec_gss_krb5 fscache ip6t_rpfilter ip6t_REJECT cfg80211 xt_conntrack rfkill ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw ip6table_filter ip6_tables iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_security iptable_raw auth_rpcgss nfs_acl snd_intel8x0 ppdev lockd snd_ac97_codec ac97_bus snd_pcm snd_timer e1000 pcspkr parport_pc snd parport serio_raw joydev i2c_piix4 sunrpc(OE) microcode soundcore i2c_core ata_generic pata_acpi [last unloaded: nfsd]
[ 1610.168320] CPU: 0 PID: 27397 Comm: nfsd Tainted: G OE 3.15.0-rc1+ #15 [ 1610.168320] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 [ 1610.168320] task: ffff88005ab653d0 ti: ffff88005a944000 task.ti: ffff88005a944000 [ 1610.168320] RIP: 0010:[<ffffffffa034d5ed>] [<ffffffffa034d5ed>] _posix_to_nfsv4_one+0x3cd/0x3d0 [nfsd] [ 1610.168320] RSP: 0018:ffff88005a945b00 EFLAGS: 00010293 [ 1610.168320] RAX: 0000000000000001 RBX: ffff88006700bac0 RCX: 0000000000000000 [ 1610.168320] RDX: 0000000000000000 RSI: ffff880067c83f00 RDI: ffff880068233300 [ 1610.168320] RBP: ffff88005a945b48 R08: ffffffff81c64830 R09: 0000000000000000 [ 1610.168320] R10: ffff88004ea85be0 R11: 000000000000f475 R12: ffff880068233300 [ 1610.168320] R13: 0000000000000003 R14: 0000000000000002 R15: ffff880068233300 [ 1610.168320] FS: 0000000000000000(0000) GS:ffff880077800000(0000) knlGS:0000000000000000 [ 1610.168320] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b [ 1610.168320] CR2: 00007f5bcbd3b0b9 CR3: 0000000001c0f000 CR4: 00000000000006f0 [ 1610.168320] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 1610.168320] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 1610.168320] Stack: [ 1610.168320] ffffffff00000000 0000000b67c83500 000000076700bac0 0000000000000000 [ 1610.168320] ffff88006700bac0 ffff880068233300 ffff88005a945c08 0000000000000002 [ 1610.168320] 0000000000000000 ffff88005a945b88 ffffffffa034e2d5 000000065a945b68 [ 1610.168320] Call Trace: [ 1610.168320] [<ffffffffa034e2d5>] nfsd4_get_nfs4_acl+0x95/0x150 [nfsd] [ 1610.168320] [<ffffffffa03400d6>] nfsd4_encode_fattr+0x646/0x1e70 [nfsd] [ 1610.168320] [<ffffffff816a6e6e>] ? kmemleak_alloc+0x4e/0xb0 [ 1610.168320] [<ffffffffa0327962>] ? nfsd_setuser_and_check_port+0x52/0x80 [nfsd] [ 1610.168320] [<ffffffff812cd4bb>] ? selinux_cred_prepare+0x1b/0x30 [ 1610.168320] [<ffffffffa0341caa>] nfsd4_encode_getattr+0x5a/0x60 [nfsd] [ 1610.168320] [<ffffffffa0341e07>] nfsd4_encode_operation+0x67/0x110 [nfsd] [ 1610.168320] [<ffffffffa033844d>] nfsd4_proc_compound+0x21d/0x810 [nfsd] [ 1610.168320] [<ffffffffa0324d9b>] nfsd_dispatch+0xbb/0x200 [nfsd] [ 1610.168320] [<ffffffffa00850cd>] svc_process_common+0x46d/0x6d0 [sunrpc] [ 1610.168320] [<ffffffffa0085433>] svc_process+0x103/0x170 [sunrpc] [ 1610.168320] [<ffffffffa032472f>] nfsd+0xbf/0x130 [nfsd] [ 1610.168320] [<ffffffffa0324670>] ? nfsd_destroy+0x80/0x80 [nfsd] [ 1610.168320] [<ffffffff810a5202>] kthread+0xd2/0xf0 [ 1610.168320] [<ffffffff810a5130>] ? insert_kthread_work+0x40/0x40 [ 1610.168320] [<ffffffff816c1ebc>] ret_from_fork+0x7c/0xb0 [ 1610.168320] [<ffffffff810a5130>] ? insert_kthread_work+0x40/0x40 [ 1610.168320] Code: 78 02 e9 e7 fc ff ff 31 c0 31 d2 31 c9 66 89 45 ce 41 8b 04 24 66 89 55 d0 66 89 4d d2 48 8d 04 80 49 8d 5c 84 04 e9 37 fd ff ff <0f> 0b 90 0f 1f 44 00 00 55 8b 56 08 c7 07 00 00 00 00 8b 46 0c [ 1610.168320] RIP [<ffffffffa034d5ed>] _posix_to_nfsv4_one+0x3cd/0x3d0 [nfsd] [ 1610.168320] RSP <ffff88005a945b00> [ 1610.257313] ---[ end trace 838254e3e352285b ]---
--- fs/nfsd/nfs4acl.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
fs/nfsd/nfs4acl.c +9 -8
@@ -402,8 +402,10 @@ sort_pacl(struct posix_acl *pacl)* by uid/gid. */ int i, j; -if (pacl->a_count <=4 ) -return ;/* no users or groups */ +/* no users or groups */ +if (!pacl || pacl->a_count <=4 ) +return ; + i =1 ;while (pacl->a_entries[i].e_tag ==ACL_USER ) i++;
@@ -530,13 +532,12 @@ posix_state_to_acl(struct posix_acl_stat/* * ACLs with no ACEs are treated differently in the inheritable -* and effective cases: when there are no inheritable ACEs, we -* set a zero-length default posix acl: +* and effective cases: when there are no inheritable ACEs, +* calls ->set_acl with a NULL ACL structure. */ -if (state->empty && (flags &NFS4_ACL_TYPE_DEFAULT )) { - pacl =posix_acl_alloc (0 ,GFP_KERNEL ); -return pacl ? pacl :ERR_PTR (-ENOMEM ); - } +if (state->empty && (flags &NFS4_ACL_TYPE_DEFAULT )) +return NULL ; +/* * When there are no effective ACEs, the following will end * up setting a 3-element effective posix ACL with all
Greg Kroah-Hartman
maintainerPATCH 151/228 nfsd4: warn on finding lockowner without stateids
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: "J. Bruce Fields" <[email protected]>
commit 27b11428b7de097c42f205beabb1764f4365443b upstream.
The current code assumes a one-to-one lockowner<->lock stateid correspondance.
--- fs/nfsd/nfs4state.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/nfsd/nfs4state.c +4 -0
@@ -4156,6 +4156,10 @@ static bool same_lockowner_ino(struct nfif (!same_owner_str (&lo->lo_owner, owner, clid))return false; +if (list_empty (&lo->lo_owner.so_stateids)) { +WARN_ON_ONCE (1 ); +return false; + } lst =list_first_entry (&lo->lo_owner.so_stateids, struct nfs4_ol_stateid, st_perstateowner);return lst->st_file->fi_inode == inode;
Greg Kroah-Hartman
maintainerPATCH 152/228 nfsd4: remove lockowner when removing lock stateid
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: "J. Bruce Fields" <[email protected]>
commit a1b8ff4c97b4375d21b6d6c45d75877303f61b3b upstream.
The nfsv4 state code has always assumed a one-to-one correspondance between lock stateid's and lockowners even if it appears not to in some places.
We may actually change that, but for now when FREE_STATEID releases a lock stateid it also needs to release the parent lockowner.
Symptoms were a subsequent LOCK crashing in find_lockowner_str when it calls same_lockowner_ino on a lockowner that unexpectedly has an empty so_stateids list.
--- fs/nfsd/nfs4state.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
fs/nfsd/nfs4state.c +9 -2
@@ -3714,9 +3714,16 @@ out:static __be32 nfsd4_free_lock_stateid (struct nfs4_ol_stateid *stp) { -if (check_for_locks (stp->st_file,lockowner (stp->st_stateowner))) +struct nfs4_lockowner *lo =lockowner (stp->st_stateowner); + +if (check_for_locks (stp->st_file, lo))return nfserr_locks_held; -release_lock_stateid (stp); +/* +* Currently there's a 1-1 lock stateid<->lockowner +* correspondance, and we have to delete the lockowner when we +* delete the lock stateid: +*/ +unhash_lockowner (lo);return nfs_ok; }
Greg Kroah-Hartman
maintainerPATCH 153/228 workqueue: fix bugs in wq_update_unbound_numa() failure path
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daeseok Youn <[email protected]>
commit 77f300b198f93328c26191b52655ce1b62e202cf upstream.
wq_update_unbound_numa() failure path has the following two bugs.
- alloc_unbound_pwq() is called without holding wq->mutex; however, if the allocation fails, it jumps to out_unlock which tries to unlock wq->mutex.
- The function should switch to dfl_pwq on failure but didn't do so after alloc_unbound_pwq() failure.
Fix it by regrabbing wq->mutex and jumping to use_dfl_pwq on alloc_unbound_pwq() failure.
--- kernel/workqueue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/workqueue.c +2 -1
@@ -4093,7 +4093,8 @@ static void wq_update_unbound_numa(strucif (!pwq) {pr_warning ("workqueue: allocation failed while updating NUMA affinity of \"%s\"\n" , wq->name); - goto out_unlock; +mutex_lock (&wq->mutex); + goto use_dfl_pwq; }/*
Greg Kroah-Hartman
maintainerPATCH 154/228 workqueue: fix a possible race condition between rescuer and pwq-release
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lai Jiangshan <[email protected]>
commit 77668c8b559e4fe2acf2a0749c7c83cde49a5025 upstream.
There is a race condition between rescuer_thread() and pwq_unbound_release_workfn().
Even after a pwq is scheduled for rescue, the associated work items may be consumed by any worker. If all of them are consumed before the rescuer gets to them and the pwq's base ref was put due to attribute change, the pwq may be released while still being linked on @wq->maydays list making the rescuer dereference already freed pwq later.
Make send_mayday() pin the target pwq until the rescuer is done with it.
tj: Updated comment and patch description.
--- kernel/workqueue.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
kernel/workqueue.c +12 -0
@@ -1909,6 +1909,12 @@ static void send_mayday(struct work_stru/* mayday mayday mayday */ if (list_empty (&pwq->mayday_node)) { +/* +* If @pwq is for an unbound wq, its base ref may be put at +* any time due to an attribute change. Pin @pwq until the +* rescuer is done with it. +*/ +get_pwq (pwq);list_add_tail (&pwq->mayday_node, &wq->maydays);wake_up_process (wq->rescuer->task); }
@@ -2438,6 +2444,12 @@ repeat:process_scheduled_works (rescuer);/* +* Put the reference grabbed by send_mayday(). @pool won't +* go away while we're holding its lock. +*/ +put_pwq (pwq); + +/* * Leave this pool. If keep_working() is %true, notify a * regular worker; otherwise, we end up with 0 concurrency * and stalling the execution.
Greg Kroah-Hartman
maintainerPATCH 155/228 workqueue: make rescuer_thread() empty wq->maydays list before exiting
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lai Jiangshan <[email protected]>
commit 4d595b866d2c653dc90a492b9973a834eabfa354 upstream.
After a @pwq is scheduled for emergency execution, other workers may consume the affectd work items before the rescuer gets to them. This means that a workqueue many have pwqs queued on @wq->maydays list while not having any work item pending or in-flight. If destroy_workqueue() executes in such condition, the rescuer may exit without emptying @wq->maydays.
This currently doesn't cause any actual harm. destroy_workqueue() can safely destroy all the involved data structures whether @wq->maydays is populated or not as nobody access the list once the rescuer exits.
However, this is nasty and makes future development difficult. Let's update rescuer_thread() so that it empties @wq->maydays after seeing should_stop to guarantee that the list is empty on rescuer exit.
tj: Updated comment and patch description.
--- kernel/workqueue.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-)
kernel/workqueue.c +16 -5
@@ -2397,6 +2397,7 @@ static int rescuer_thread(void *__rescuestruct worker *rescuer = __rescuer;struct workqueue_struct *wq = rescuer->rescue_wq;struct list_head *scheduled = &rescuer->scheduled; +bool should_stop;set_user_nice (current,RESCUER_NICE_LEVEL );
@@ -2408,11 +2409,15 @@ static int rescuer_thread(void *__rescue repeat:set_current_state (TASK_INTERRUPTIBLE ); -if (kthread_should_stop ()) { -__set_current_state (TASK_RUNNING ); - rescuer->task->flags &= ~PF_WQ_WORKER ; -return 0 ; - } +/* +* By the time the rescuer is requested to stop, the workqueue +* shouldn't have any work pending, but @wq->maydays may still have +* pwq(s) queued. This can happen by non-rescuer workers consuming +* all the work items before the rescuer got to them. Go through +* @wq->maydays processing before acting on should_stop so that the +* list is always empty on exit. +*/ + should_stop =kthread_should_stop ();/* see whether any pwq is asking for help */ spin_lock_irq (&wq_mayday_lock);
@@ -2464,6 +2469,12 @@ repeat:spin_unlock_irq (&wq_mayday_lock); +if (should_stop) { +__set_current_state (TASK_RUNNING ); + rescuer->task->flags &= ~PF_WQ_WORKER ; +return 0 ; + } +/* rescuers should never participate in concurrency management */ WARN_ON_ONCE (!(rescuer->flags &WORKER_NOT_RUNNING ));schedule ();
Greg Kroah-Hartman
maintainerPATCH 156/228 memory: mvebu-devbus: fix the conversion of the bus width
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Petazzoni <[email protected]>
commit ce965c3d2e68c5325dd5624eb101d70423022fef upstream.
According to the Armada 370 and Armada XP datasheets, the part of the Device Bus register that configure the bus width should contain 0 for a 8 bits bus width, and 1 for a 16 bits bus width (other values are unsupported/reserved).
However, the current conversion done in the driver to convert from a bus width in bits to the value expected by the register leads to setting the register to 1 for a 8 bits bus, and 2 for a 16 bits bus.
This mistake was compensated by a mistake in the existing Device Tree files for Armada 370/XP platforms: they were declaring a 8 bits bus width, while the hardware in fact uses a 16 bits bus width.
This commit fixes that by adjusting the conversion logic.
This patch fixes a bug that was introduced in 3edad321b1bd2e6c8b5f38146c115c8982438f06 ('drivers: memory: Introduce Marvell EBU Device Bus driver'), which was merged in v3.11.
--- drivers/memory/mvebu-devbus.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/memory/mvebu-devbus.c +13 -2
@@ -108,8 +108,19 @@ static int devbus_set_timing_params(stru node->full_name);return err; } -/* Convert bit width to byte width */ - r.bus_width /=8 ; + +/* +* The bus width is encoded into the register as 0 for 8 bits, +* and 1 for 16 bits, so we do the necessary conversion here. +*/ +if (r.bus_width ==8 ) + r.bus_width =0 ; +else if (r.bus_width ==16 ) + r.bus_width =1 ; +else { +dev_err (devbus->dev,"invalid bus width %d\n" , r.bus_width); +return -EINVAL ; + } err =get_timing_param_ps (devbus, node,"devbus,badr-skew-ps" , &r.badr_skew);
Greg Kroah-Hartman
maintainerPATCH 157/228 PCI: mvebu: fix off-by-one in the computed size of the mbus windows
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Willy Tarreau <[email protected]>
commit b6d07e0273d3296cfbdc88145b8a00ddbefb310a upstream.
mvebu_pcie_handle_membase_change() and mvebu_pcie_handle_iobase_change() do not correctly compute the window size. PCI uses an inclusive start/end address pair, which requires a +1 when converting to size.
This only worked because a bug in the mbus driver allowed it to silently accept and round up bogus sizes.
Fix this by adding one to the computed size.
--- drivers/pci/host/pci-mvebu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/host/pci-mvebu.c +2 -2
@@ -329,7 +329,7 @@ static void mvebu_pcie_handle_iobase_cha port->iowin_base = port->pcie->io.start + iobase; port->iowin_size = ((0xFFF | ((port->bridge.iolimit &0xF0 ) <<8 ) | (port->bridge.iolimitupper <<16 )) - - iobase); + iobase) +1 ; mvebu_mbus_add_window_remap_by_id(port->io_target, port->io_attr, port->iowin_base, port->iowin_size,
@@ -362,7 +362,7 @@ static void mvebu_pcie_handle_membase_ch port->memwin_base = ((port->bridge.membase &0xFFF0 ) <<16 ); port->memwin_size = (((port->bridge.memlimit &0xFFF0 ) <<16 ) |0xFFFFF ) - - port->memwin_base; + port->memwin_base +1 ;mvebu_mbus_add_window_by_id (port->mem_target, port->mem_attr, port->memwin_base, port->memwin_size);
Greg Kroah-Hartman
maintainerPATCH 158/228 bus: mvebu-mbus: allow several windows with the same target/attribute
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Petazzoni <[email protected]>
commit b566e782be32145664d96ada3e389f17d32742e5 upstream.
Having multiple windows with the same target and attribute is actually legal, and can be useful for PCIe windows, when PCIe BARs have a size that isn't a power of two, and we therefore need to create several MBus windows to cover the PCIe BAR for a given PCIe interface.
--- drivers/bus/mvebu-mbus.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/bus/mvebu-mbus.c +0 -6
@@ -222,12 +222,6 @@ static int mvebu_mbus_window_conflicts(s*/ if ((u64 )base < wend && end > wbase)return 0 ; - -/* -* Check if target/attribute conflicts -*/ -if (target == wtarget && attr == wattr) -return 0 ; }return 1 ;
Greg Kroah-Hartman
maintainerPATCH 159/228 PCI: mvebu: split PCIe BARs into multiple MBus windows when needed
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Petazzoni <[email protected]>
commit 398f5d5e10b6b917cd9d35ef21d545b0afbada22 upstream.
MBus windows are used on Marvell platforms to map certain peripherals in the physical address space. In the PCIe context, MBus windows are needed to map PCIe I/O and memory regions in the physical address.
However, those MBus windows can only have power of two sizes, while PCIe BAR do not necessarily guarantee this. For this reason, the current pci-mvebu breaks on platforms where PCIe devices have BARs that don't sum up to a power of two size at the emulated bridge level.
This commit fixes this by allowing the pci-mvebu driver to create multiple contiguous MBus windows (each having a power of two size) to cover a given PCIe BAR.
To achieve this, two functions are added: mvebu_pcie_add_windows() and mvebu_pcie_del_windows() to respectively add and remove all the MBus windows that are needed to map the provided PCIe region base and size. The emulated PCI bridge code now calls those functions, instead of directly calling the mvebu-mbus driver functions.
--- drivers/pci/host/pci-mvebu.c | 88 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 74 insertions(+), 14 deletions(-)
drivers/pci/host/pci-mvebu.c +74 -14
@@ -291,6 +291,58 @@ static int mvebu_pcie_hw_wr_conf(structreturn PCIBIOS_SUCCESSFUL ; } +/* +* Remove windows, starting from the largest ones to the smallest +* ones. +*/ +static void mvebu_pcie_del_windows (struct mvebu_pcie_port *port, +phys_addr_t base,size_t size) +{ +while (size) { +size_t sz =1 << (fls (size) -1 ); + +mvebu_mbus_del_window (base, sz); + base += sz; + size -= sz; + } +} + +/* +* MBus windows can only have a power of two size, but PCI BARs do not +* have this constraint. Therefore, we have to split the PCI BAR into +* areas each having a power of two size. We start from the largest +* one (i.e highest order bit set in the size). +*/ +static void mvebu_pcie_add_windows (struct mvebu_pcie_port *port, +unsigned int target,unsigned int attribute, +phys_addr_t base,size_t size, +phys_addr_t remap) +{ +size_t size_mapped =0 ; + +while (size) { +size_t sz =1 << (fls (size) -1 ); +int ret; + + ret =mvebu_mbus_add_window_remap_by_id (target, attribute, base, + sz, remap); +if (ret) { +dev_err (&port->pcie->pdev->dev, +"Could not create MBus window at 0x%x, size 0x%x: %d\n" , + base, sz, ret); +mvebu_pcie_del_windows (port, base - size_mapped, + size_mapped); +return ; + } + + size -= sz; + size_mapped += sz; + base += sz; +if (remap !=MVEBU_MBUS_NO_REMAP ) + remap += sz; + } +} +static void mvebu_pcie_handle_iobase_change (struct mvebu_pcie_port *port) {phys_addr_t iobase;
@@ -302,8 +354,8 @@ static void mvebu_pcie_handle_iobase_cha/* If a window was configured, remove it */ if (port->iowin_base) { -mvebu_mbus_del_window (port->iowin_base, - port->iowin_size); +mvebu_pcie_del_windows (port, port->iowin_base, + port->iowin_size); port->iowin_base =0 ; port->iowin_size =0 ; }
@@ -331,9 +383,9 @@ static void mvebu_pcie_handle_iobase_cha (port->bridge.iolimitupper << 16)) - iobase) + 1; -mvebu_mbus_add_window_remap_by_id (port->io_target, port->io_attr, - port->iowin_base, port->iowin_size, - iobase); +mvebu_pcie_add_windows (port, port->io_target, port->io_attr, + port->iowin_base, port->iowin_size, + iobase); }static void mvebu_pcie_handle_membase_change (struct mvebu_pcie_port *port)
@@ -344,8 +396,8 @@ static void mvebu_pcie_handle_membase_ch/* If a window was configured, remove it */ if (port->memwin_base) { -mvebu_mbus_del_window (port->memwin_base, - port->memwin_size); +mvebu_pcie_del_windows (port, port->memwin_base, + port->memwin_size); port->memwin_base =0 ; port->memwin_size =0 ; }
@@ -364,8 +416,9 @@ static void mvebu_pcie_handle_membase_ch (((port->bridge.memlimit &0xFFF0 ) <<16 ) |0xFFFFF ) - port->memwin_base +1 ; -mvebu_mbus_add_window_by_id (port->mem_target, port->mem_attr, - port->memwin_base, port->memwin_size); +mvebu_pcie_add_windows (port, port->mem_target, port->mem_attr, + port->memwin_base, port->memwin_size, +MVEBU_MBUS_NO_REMAP ); }/*
@@ -721,14 +774,21 @@ static resource_size_t mvebu_pcie_align_/* * On the PCI-to-PCI bridge side, the I/O windows must have at -* least a 64 KB size and be aligned on their size, and the -* memory windows must have at least a 1 MB size and be -* aligned on their size +* least a 64 KB size and the memory windows must have at +* least a 1 MB size. Moreover, MBus windows need to have a +* base address aligned on their size, and their size must be +* a power of two. This means that if the BAR doesn't have a +* power of two size, several MBus windows will actually be +* created. We need to ensure that the biggest MBus window +* (which will be the first one) is aligned on its size, which +* explains the rounddown_pow_of_two() being done here. */ if (res->flags &IORESOURCE_IO ) -return round_up (start,max_t (resource_size_t,SZ_64K , size)); +return round_up (start,max_t (resource_size_t,SZ_64K , +rounddown_pow_of_two (size)));else if (res->flags &IORESOURCE_MEM ) -return round_up (start,max_t (resource_size_t,SZ_1M , size)); +return round_up (start,max_t (resource_size_t,SZ_1M , +rounddown_pow_of_two (size)));else return start; }
Greg Kroah-Hartman
maintainerPATCH 160/228 ARM: mvebu: mvebu-soc-id: add missing clk_put() call
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Petazzoni <[email protected]>
commit 42a18d1cf484d02e23afadfa5dc09356e6bef9fa upstream.
The mvebu-soc-id code in mach-mvebu/ needs to enable a clock to read the SoC device ID and revision number. To do so, it does a clk_get(), then a clk_prepare_enable(), reads the value, and disables the clock with clk_disable_unprepare(). However, it forgets to clk_put() the clock. This commit fixes this issue.
--- arch/arm/mach-mvebu/mvebu-soc-id.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-mvebu/mvebu-soc-id.c +1 -0
@@ -108,6 +108,7 @@ static int __init mvebu_soc_id_init(void res_ioremap:clk_disable_unprepare (clk); +clk_put (clk); clk_err:of_node_put (child);
Greg Kroah-Hartman
maintainerPATCH 161/228 ARM: mvebu: mvebu-soc-id: keep clock enabled if PCIe unit is enabled
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Petazzoni <[email protected]>
commit b25bcf1bcaf6687991ae08dd76cd784bf9fe3d05 upstream.
Since the mvebu-soc-id code in mach-mvebu/ was introduced, several users have noticed a regression: the PCIe card connected in the first PCIe interface is not detected properly.
This is due to the fact that the mvebu-soc-id code enables the PCIe clock of the first PCIe interface, reads the SoC device ID and revision number (yes this information is made available as part of PCIe registers), and then disables the clock. However, by doing this, we gate the clock and therefore loose the complex PCIe configuration that was done by the bootloader.
Unfortunately, as of today, the kernel is not capable of doing this complex configuration by itself, so we really need to keep the PCIe clock enabled. However, we don't want to keep it enabled
unconditionally: if the PCIe interface is not enabled or PCI support is not compiled into the kernel, there is no reason to keep the PCIe clock running.
This issue was discussed with Kevin Hilman, and the suggested solution was to make the mvebu-soc-id code keep the clock enabled in case it will be needed for PCIe. This is therefore the solution implemented in this patch.
Long term, we hope to make the kernel more capable in terms of PCIe configuration for this platform, which will anyway be needed to support the compilation of the PCIe host controller driver as a module. In the mean time however, we don't have much other choice than to implement the currently proposed solution.
--- arch/arm/mach-mvebu/mvebu-soc-id.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
arch/arm/mach-mvebu/mvebu-soc-id.c +12 -2
@@ -107,8 +107,18 @@ static int __init mvebu_soc_id_init(voidiounmap (pci_base); res_ioremap: -clk_disable_unprepare (clk); -clk_put (clk); +/* +* If the PCIe unit is actually enabled and we have PCI +* support in the kernel, we intentionally do not release the +* reference to the clock. We want to keep it running since +* the bootloader does some PCIe link configuration that the +* kernel is for now unable to do, and gating the clock would +* make us loose this precious configuration. +*/ +if (!of_device_is_available (child) || !IS_ENABLED (CONFIG_PCI_MVEBU )) { +clk_disable_unprepare (clk); +clk_put (clk); + } clk_err:of_node_put (child);
Greg Kroah-Hartman
maintainerPATCH 162/228 percpu: make pcpu_alloc_chunk() use pcpu_mem_free() instead of kfree()
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jianyu Zhan <[email protected]>
commit 5a838c3b60e3a36ade764cf7751b8f17d7c9c2da upstream.
pcpu_chunk_struct_size = sizeof(struct pcpu_chunk) +
BITS_TO_LONGS(pcpu_unit_pages) * sizeof(unsigned long)
It hardly could be ever bigger than PAGE_SIZE even for large-scale machine, but for consistency with its couterpart pcpu_mem_zalloc(),
use pcpu_mem_free() instead.
Commit b4916cb17c26 ("percpu: make pcpu_free_chunk() use pcpu_mem_free() instead of kfree()") addressed this problem, but missed this one.
tj: commit message updated
--- mm/percpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/percpu.c +1 -1
@@ -612,7 +612,7 @@ static struct pcpu_chunk *pcpu_alloc_chu chunk->map =pcpu_mem_zalloc (PCPU_DFL_MAP_ALLOC *sizeof (chunk->map[0 ]));if (!chunk->map) { -kfree (chunk); +pcpu_mem_free (chunk, pcpu_chunk_struct_size);return NULL ; }
Greg Kroah-Hartman
maintainerPATCH 163/228 iwlwifi: pcie: disable interrupts upon PCIe alloc
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Emmanuel Grumbach <[email protected]>
commit 83f7a85f1134c6e914453f5747435415a23d516b upstream.
In case RFKILL is in KILL position, the NIC will issue an interrupt straight away. This interrupt won't be sent because it is masked in the hardware.
But if our interrupt service routine is called for another reason (SHARED_IRQ), then we'll look at the interrupt cause and service it. This can cause bad things if we are not ready yet.
Explicitly clean the interrupt cause register to make sure we won't service anything before we are ready to.
--- drivers/net/wireless/iwlwifi/pcie/trans.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/net/wireless/iwlwifi/pcie/trans.c +6 -4
@@ -1563,6 +1563,10 @@ struct iwl_trans *iwl_trans_pcie_alloc(s* PCI Tx retries from interfering with C3 CPU state */ pci_write_config_byte (pdev,PCI_CFG_RETRY_TIMEOUT ,0x00 ); + trans->dev = &pdev->dev; + trans_pcie->pci_dev = pdev; +iwl_disable_interrupts (trans); + err =pci_enable_msi (pdev);if (err) {dev_err (&pdev->dev,"pci_enable_msi failed(0X%x)\n" , err);
@@ -1574,8 +1578,6 @@ struct iwl_trans *iwl_trans_pcie_alloc(s } } - trans->dev = &pdev->dev; - trans_pcie->pci_dev = pdev; trans->hw_rev =iwl_read32 (trans,CSR_HW_REV ); trans->hw_id = (pdev->device <<16 ) + pdev->subsystem_device; snprintf(trans->hw_id_str, sizeof(trans->hw_id_str),
@@ -1601,8 +1603,6 @@ struct iwl_trans *iwl_trans_pcie_alloc(s goto out_pci_disable_msi; } - trans_pcie->inta_mask =CSR_INI_SET_MASK ; -if (iwl_pcie_alloc_ict (trans)) goto out_free_cmd_pool;
@@ -1614,6 +1614,8 @@ struct iwl_trans *iwl_trans_pcie_alloc(s goto out_free_ict; } + trans_pcie->inta_mask =CSR_INI_SET_MASK ; +return trans; out_free_ict:
Greg Kroah-Hartman
maintainerPATCH 164/228 iwlwifi: mvm: fix setting channel in monitor mode
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Emmanuel Grumbach <[email protected]>
commit 1c4abec0baf25ffb92a28cc99d4231feeaa4d3f3 upstream.
There was a deadlock in monitor mode when we were setting the channel if the channel was not 1.
======================================================
[ INFO: possible circular locking dependency detected ]
3.14.3 #4 Not tainted
-------------------------------------------------------
iw/3323 is trying to acquire lock:
(&local->chanctx_mtx){+.+.+.}, at: [<ffffffffa062e2f2>] ieee80211_vif_release_channel+0x42/0xb0 [mac80211]
but task is already holding lock:
(&local->iflist_mtx){+.+...}, at: [<ffffffffa0609e0a>] ieee80211_set_monitor_channel+0x5a/0x1b0 [mac80211]
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #2 (&local->iflist_mtx){+.+...}:
[<ffffffff810d95bb>] __lock_acquire+0xb3b/0x13b0
[<ffffffff810d9ee0>] lock_acquire+0xb0/0x1f0
[<ffffffff817eb9c8>] mutex_lock_nested+0x78/0x4f0
[<ffffffffa06225cf>] ieee80211_iterate_active_interfaces+0x2f/0x60 [mac80211]
[<ffffffffa0518189>] iwl_mvm_recalc_multicast+0x49/0xa0 [iwlmvm]
[<ffffffffa051822e>] iwl_mvm_configure_filter+0x4e/0x70 [iwlmvm]
[<ffffffffa05e6d43>] ieee80211_configure_filter+0x153/0x5f0 [mac80211]
[<ffffffffa05e71f5>] ieee80211_reconfig_filter+0x15/0x20 [mac80211]
[snip]-> #1 (&mvm->mutex){+.+.+.}:
[<ffffffff810d95bb>] __lock_acquire+0xb3b/0x13b0
[<ffffffff810d9ee0>] lock_acquire+0xb0/0x1f0
[<ffffffff817eb9c8>] mutex_lock_nested+0x78/0x4f0
[<ffffffffa0517246>] iwl_mvm_add_chanctx+0x56/0xe0 [iwlmvm]
[<ffffffffa062ca1e>] ieee80211_new_chanctx+0x13e/0x410 [mac80211]
[<ffffffffa062d953>] ieee80211_vif_use_channel+0x1c3/0x5a0 [mac80211]
[<ffffffffa06035ab>] ieee80211_add_virtual_monitor+0x1ab/0x6b0 [mac80211]
[<ffffffffa06052ea>] ieee80211_do_open+0xe6a/0x15a0 [mac80211]
[<ffffffffa0605a79>] ieee80211_open+0x59/0x60 [mac80211]
[snip]-> #0 (&local->chanctx_mtx){+.+.+.}:
[<ffffffff810d6cb7>] check_prevs_add+0x977/0x980
[<ffffffff810d95bb>] __lock_acquire+0xb3b/0x13b0
[<ffffffff810d9ee0>] lock_acquire+0xb0/0x1f0
[<ffffffff817eb9c8>] mutex_lock_nested+0x78/0x4f0
[<ffffffffa062e2f2>] ieee80211_vif_release_channel+0x42/0xb0 [mac80211]
[<ffffffffa0609ec3>] ieee80211_set_monitor_channel+0x113/0x1b0 [mac80211]
[<ffffffffa058fb37>] cfg80211_set_monitor_channel+0x77/0x2b0 [cfg80211]
[<ffffffffa056e0b2>] __nl80211_set_channel+0x122/0x140 [cfg80211]
[<ffffffffa0581374>] nl80211_set_wiphy+0x284/0xaf0 [cfg80211]
[snip]other info that might help us debug this:
Chain exists of: &local->chanctx_mtx --> &mvm->mutex --> &local->iflist_mtx Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&local->iflist_mtx);
lock(&mvm->mutex);
lock(&local->iflist_mtx); lock(&local->chanctx_mtx);
*** DEADLOCK ***
This deadlock actually occurs:
INFO: task iw:3323 blocked for more than 120 seconds.
Not tainted 3.14.3 #4"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
iw D ffff8800c8afcd80 4192 3323 3322 0x00000000
ffff880078fdb7e0 0000000000000046 ffff8800c8afcd80 ffff880078fdbfd8 00000000001d5540 00000000001d5540 ffff8801141b0000 ffff8800c8afcd80 ffff880078ff9e38 ffff880078ff9e38 ffff880078ff9e40 0000000000000246
Call Trace: [<ffffffff817ea841>] schedule_preempt_disabled+0x31/0x80 [<ffffffff817ebaed>] mutex_lock_nested+0x19d/0x4f0 [<ffffffffa06225cf>] ? ieee80211_iterate_active_interfaces+0x2f/0x60 [mac80211] [<ffffffffa06225cf>] ? ieee80211_iterate_active_interfaces+0x2f/0x60 [mac80211] [<ffffffffa052a680>] ? iwl_mvm_power_mac_update_mode+0xc0/0xc0 [iwlmvm] [<ffffffffa06225cf>] ieee80211_iterate_active_interfaces+0x2f/0x60 [mac80211] [<ffffffffa0529357>] _iwl_mvm_power_update_binding+0x27/0x80 [iwlmvm] [<ffffffffa0516eb1>] iwl_mvm_unassign_vif_chanctx+0x81/0xc0 [iwlmvm] [<ffffffffa062d3ff>] __ieee80211_vif_release_channel+0xdf/0x470 [mac80211] [<ffffffffa062e2fa>] ieee80211_vif_release_channel+0x4a/0xb0 [mac80211] [<ffffffffa0609ec3>] ieee80211_set_monitor_channel+0x113/0x1b0 [mac80211] [<ffffffffa058fb37>] cfg80211_set_monitor_channel+0x77/0x2b0 [cfg80211] [<ffffffffa056e0b2>] __nl80211_set_channel+0x122/0x140 [cfg80211] [<ffffffffa0581374>] nl80211_set_wiphy+0x284/0xaf0 [cfg80211]
This fixes https://bugzilla.kernel.org/show_bug.cgi?id=75541
--- drivers/net/wireless/iwlwifi/mvm/mac80211.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlwifi/mvm/mac80211.c +2 -2
@@ -796,7 +796,7 @@ static void iwl_mvm_mc_iface_iterator(vomemcpy (cmd->bssid, vif->bss_conf.bssid,ETH_ALEN ); len =roundup (sizeof (*cmd) + cmd->count *ETH_ALEN ,4 ); - ret =iwl_mvm_send_cmd_pdu (mvm,MCAST_FILTER_CMD ,CMD_SYNC , len, cmd); + ret =iwl_mvm_send_cmd_pdu (mvm,MCAST_FILTER_CMD ,CMD_ASYNC , len, cmd);if (ret)IWL_ERR (mvm,"mcast filter cmd error. ret=%d\n" , ret); }
@@ -812,7 +812,7 @@ static void iwl_mvm_recalc_multicast(strif (WARN_ON_ONCE (!mvm->mcast_filter_cmd))return ; -ieee80211_iterate_active_interfaces ( +ieee80211_iterate_active_interfaces_atomic ( mvm->hw,IEEE80211_IFACE_ITER_NORMAL , iwl_mvm_mc_iface_iterator, &iter_data); }
Greg Kroah-Hartman
maintainerPATCH 165/228 ASoC: dapm: Skip CODEC<->CODEC links in connect_dai_link_widgets()
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lars-Peter Clausen <[email protected]>
commit ca5106ae3da0179dcee3ae21f3ea94f62e9fdb0c upstream.
For CODEC to CODEC DAI links the paths are created in snd_soc_dapm_new_pcm(). Also for CODEC to CODEC links the widgets are connected cross-over via a DAI link widget, meaning that the capture widget of one CODEC will be connected to the playback widget of the other and vice versa. Whereas snd_soc_dapm_connect_dai_link_widgets() directly connects the playback widget of the CPU DAI to the playback widget of the CODEC DAI and the capture widget of the CPU DAI to the capture widget of the CODEC DAI. So not skipping CODEC<->CODEC links in snd_soc_dapm_connect_dai_link_widgets() will create incorrect connections between the two CODECs which will cause DAPM to detect active paths where there are none and unnecessarily power up widgets.
--- sound/soc/soc-dapm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
sound/soc/soc-dapm.c +5 -2
@@ -3649,8 +3649,11 @@ void snd_soc_dapm_connect_dai_link_widge cpu_dai = rtd->cpu_dai; codec_dai = rtd->codec_dai; -/* dynamic FE links have no fixed DAI mapping */ -if (rtd->dai_link->dynamic) +/* +* dynamic FE links have no fixed DAI mapping. +* CODEC<->CODEC links have no direct connection. +*/ +if (rtd->dai_link->dynamic || rtd->dai_link->params)continue ;/* there is no point in connecting BE DAI links with dummies */
Greg Kroah-Hartman
maintainerPATCH 166/228 ASoC: wm8962: Update register CLASS_D_CONTROL_1 to be non-volatile
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Keepax <[email protected]>
commit 44330ab516c15dda8a1e660eeaf0003f84e43e3f upstream.
The register CLASS_D_CONTROL_1 is marked as volatile because it contains a bit, DAC_MUTE, which is also mirrored in the ADC_DAC_CONTROL_1 register. This causes problems for the "Speaker Switch" control, which will report an error if the CODEC is suspended because it relies on a volatile register.
To resolve this issue mark CLASS_D_CONTROL_1 as non-volatile and manually keep the register cache in sync by updating both bits when changing the mute status.
--- sound/soc/codecs/wm8962.c | 15 ++++++++++++--- sound/soc/codecs/wm8962.h | 4 ++++ 2 files changed, 16 insertions(+), 3 deletions(-)
sound/soc/codecs/wm8962.c +12 -3
@@ -154,6 +154,7 @@ static struct reg_default wm8962_reg[] = { 40, 0x0000 }, /* R40 - SPKOUTL volume */ { 41, 0x0000 }, /* R41 - SPKOUTR volume */ + { 49, 0x0010 }, /* R49 - Class D Control 1 */ { 51, 0x0003 }, /* R51 - Class D Control 2 */ { 56, 0x0506 }, /* R56 - Clocking 4 */
@@ -795,7 +796,6 @@ static bool wm8962_volatile_register(strcase WM8962_ALC2 :case WM8962_THERMAL_SHUTDOWN_STATUS :case WM8962_ADDITIONAL_CONTROL_4 : -case WM8962_CLASS_D_CONTROL_1 :case WM8962_DC_SERVO_6 :case WM8962_INTERRUPT_STATUS_1 :case WM8962_INTERRUPT_STATUS_2 :
@@ -2922,13 +2922,22 @@ static int wm8962_set_fll(struct snd_socstatic int wm8962_mute (struct snd_soc_dai *dai,int mute) {struct snd_soc_codec *codec = dai->codec; -int val; +int val, ret;if (mute) - val =WM8962_DAC_MUTE ; + val =WM8962_DAC_MUTE |WM8962_DAC_MUTE_ALT ;else val =0 ; +/** +* The DAC mute bit is mirrored in two registers, update both to keep +* the register cache consistent. +*/ + ret =snd_soc_update_bits (codec,WM8962_CLASS_D_CONTROL_1 , +WM8962_DAC_MUTE_ALT , val); +if (ret <0 ) +return ret; +return snd_soc_update_bits (codec,WM8962_ADC_DAC_CONTROL_1 ,WM8962_DAC_MUTE , val); }
sound/soc/codecs/wm8962.h +4 -0
@@ -1954,6 +1954,10 @@#define WM8962_SPKOUTL_ENA_MASK 0x0040/* SPKOUTL_ENA */ #define WM8962_SPKOUTL_ENA_SHIFT 6/* SPKOUTL_ENA */ #define WM8962_SPKOUTL_ENA_WIDTH 1/* SPKOUTL_ENA */ +#define WM8962_DAC_MUTE_ALT 0x0010/* DAC_MUTE */ +#define WM8962_DAC_MUTE_ALT_MASK 0x0010/* DAC_MUTE */ +#define WM8962_DAC_MUTE_ALT_SHIFT 4/* DAC_MUTE */ +#define WM8962_DAC_MUTE_ALT_WIDTH 1/* DAC_MUTE */ #define WM8962_SPKOUTL_PGA_MUTE 0x0002/* SPKOUTL_PGA_MUTE */ #define WM8962_SPKOUTL_PGA_MUTE_MASK 0x0002/* SPKOUTL_PGA_MUTE */ #define WM8962_SPKOUTL_PGA_MUTE_SHIFT 1/* SPKOUTL_PGA_MUTE */
Greg Kroah-Hartman
maintainerPATCH 167/228 parisc: ratelimit userspace segfault printing
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Helge Deller <[email protected]>
commit fef47e2a2e1e75fe50a10f634a80f16808348cc6 upstream.
Ratelimit printing of userspace segfaults and make it runtime configurable via the /proc/sys/debug/exception-trace variable. This should resolve syslog from growing way too fast and thus prevents possible system service attacks.
--- arch/parisc/Kconfig | 1 arch/parisc/kernel/traps.c | 54 ++++++++++++++++++++------------------------- arch/parisc/mm/fault.c | 44 +++++++++++++++++++++++++----------- 3 files changed, 56 insertions(+), 43 deletions(-)
arch/parisc/Kconfig +1 -0
@@ -22,6 +22,7 @@ config PARISC select GENERIC_SMP_IDLE_THREAD select GENERIC_STRNCPY_FROM_USER select SYSCTL_ARCH_UNALIGN_ALLOW + select SYSCTL_EXCEPTION_TRACE select HAVE_MOD_ARCH_SPECIFIC select VIRT_TO_BUS select MODULES_USE_ELF_RELA
arch/parisc/kernel/traps.c +25 -29
99 lines not on this page · raw message
arch/parisc/mm/fault.c +30 -14
68 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 168/228 parisc: Improve LWS-CAS performance
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: John David Anglin <[email protected]>
commit c776cd89fc705fc8b5c2e5ad906bf5d791620fed upstream.
The attached change significantly improves the performance of the LWS-CAS code in syscall.S.
This allows a number of packages to build (e.g., zeromq3, gtest and libxs) that previously failed because slow LWS-CAS performance under contention. In particular, interrupts taken while the lock was taken degraded performance significantly.
The change does the following:
1) Disables interrupts around the CAS operation, and
2) Changes the loads and stores to use the ordered completer, "o", on PA 2.0. "o" and "ma" with a zero offset are equivalent. The latter is accepted on both PA 1.X and 2.0.
The use of ordered loads and stores probably makes no difference on all existing hardware, but it seemed pedantically correct. In particular, the CAS operation must complete before LDCW lock is released. As written before, a processor could reorder the operations.
I don't believe the period interrupts are disabled is long enough to significantly increase interrupt latency. For example, the TLB insert code is longer. Worst case is a memory fault in the CAS operation.
--- arch/parisc/kernel/syscall.S | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
arch/parisc/kernel/syscall.S +9 -3
@@ -589,10 +589,13 @@ cas_nocontend: # endif /* ENABLE_LWS_DEBUG */ + rsm PSW_SM_I, %r0 /* Disable interrupts */ + /* COW breaks can cause contention on UP systems */ LDCW 0(%sr2,%r20), %r28 /* Try to acquire the lock */ cmpb,<>,n %r0, %r28, cas_action /* Did we get it? */ cas_wouldblock: ldo 2(%r0), %r28 /* 2nd case */ + ssm PSW_SM_I, %r0 b lws_exit /* Contended... */ ldo -EAGAIN(%r0), %r21 /* Spin in userspace */
@@ -619,15 +622,17 @@ cas_action: stw %r1, 4(%sr2,%r20) #endif /* The load and store could fail */ -1: ldw 0(%sr3,%r26), %r28 +1: ldw,ma 0(%sr3,%r26), %r28 sub,<> %r28, %r25, %r0 -2: stw %r24, 0(%sr3,%r26) +2: stw,ma %r24, 0(%sr3,%r26) /* Free lock */ - stw %r20, 0(%sr2,%r20) + stw,ma %r20, 0(%sr2,%r20) #if ENABLE_LWS_DEBUG /* Clear thread register indicator */ stw %r0, 4(%sr2,%r20) #endif + /* Enable interrupts */ + ssm PSW_SM_I, %r0 /* Return to userspace, set no error */ b lws_exit copy %r0, %r21
@@ -639,6 +644,7 @@ cas_action: #if ENABLE_LWS_DEBUG stw %r0, 4(%sr2,%r20) #endif + ssm PSW_SM_I, %r0 b lws_exit ldo -EFAULT(%r0),%r21 /* set errno */ nop
Greg Kroah-Hartman
maintainerPATCH 169/228 metag: fix memory barriers
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <[email protected]>
commit 2425ce84026c385b73ae72039f90d042d49e0394 upstream.
Volatile access doesn't really imply the compiler barrier. Volatile access is only ordered with respect to other volatile accesses, it isn't ordered with respect to general memory accesses. Gcc may reorder memory accesses around volatile access, as we can see in this simple example (if we compile it with optimization, both increments of *b will be collapsed to just one):
void fn(volatile int *a, long *b)
{
(*b)++;
*a = 10;
(*b)++;
}Consequently, we need the compiler barrier after a write to the volatile variable, to make sure that the compiler doesn't reorder the volatile write with something else.
--- arch/metag/include/asm/barrier.h | 3 +++ 1 file changed, 3 insertions(+)
arch/metag/include/asm/barrier.h +3 -0
@@ -15,6 +15,7 @@ static inline void wr_fence(void)volatile int *flushptr = (volatile int *)LINSYSEVENT_WR_FENCE ;barrier (); *flushptr =0 ; + barrier(); }#else /* CONFIG_METAG_META21 */
@@ -35,6 +36,7 @@ static inline void wr_fence(void) *flushptr =0 ; *flushptr =0 ; *flushptr =0 ; + barrier(); }#endif /* !CONFIG_METAG_META21 */
@@ -68,6 +70,7 @@ static inline void fence(void)volatile int *flushptr = (volatile int *)LINSYSEVENT_WR_ATOMIC_UNLOCK ;barrier (); *flushptr =0 ; +barrier (); }#define smp_mb () fence()#define smp_rmb () fence()