4.4.24-stable review
Subsystems (5)
Greg Kroah-Hartman
maintainercover 4.4.24-stable review
This is the start of the stable review cycle for the 4.4.24 release. There are 93 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 Sat Oct 8 07:47:15 UTC 2016. 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/v4.x/stable-review/patch-4.4.24-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 4.4.24-rc1
Takashi Iwai <[email protected]>
ALSA: hda - Add the top speaker pin config for HP Spectre x360
Hui Wang <[email protected]>
ALSA: hda - Fix headset mic detection problem for several Dell laptops
Prarit Bhargava <[email protected]>
ACPICA: acpi_get_sleep_type_data: Reduce warnings
Hui Wang <[email protected]>
ALSA: hda - Adding one more ALC255 pin definition for headset problem
Greg Kroah-Hartman <[email protected]>
Revert "usbtmc: convert to devm_kzalloc"
Kyle Jones <[email protected]>
USB: serial: cp210x: Add ID for a Juniper console
Ksenija Stanojevic <[email protected]>
Staging: fbtft: Fix bug in fbtft-core
Greg Kroah-Hartman <[email protected]>
usb: misc: legousbtower: Fix NULL pointer deference
Konstantin Shkolnyy <[email protected]>
USB: serial: cp210x: fix hardware flow-control disable
Mikulas Patocka <[email protected]>
dm log writes: fix bug with too large bios
Loc Ho <[email protected]>
clk: xgene: Add missing parenthesis when clearing divider value
Jann Horn <[email protected]>
aio: mark AIO pseudo-fs noexec
Marek Lindner <[email protected]>
batman-adv: remove unused callback from batadv_algo_ops struct
Jack Morgenstein <[email protected]>
IB/mlx4: Use correct subnet-prefix in QP1 mads under SR-IOV
Jack Morgenstein <[email protected]>
IB/mlx4: Fix code indentation in QP1 MAD flow
Alex Vesker <[email protected]>
IB/mlx4: Fix incorrect MC join state bit-masking on SR-IOV
Alex Vesker <[email protected]>
IB/ipoib: Don't allow MC joins during light MC flush
Erez Shitrit <[email protected]>
IB/core: Fix use after free in send_leave function
Erez Shitrit <[email protected]>
IB/ipoib: Fix memory corruption in ipoib cm mode connect flow
Radim Krčmář <[email protected]>
KVM: nVMX: postpone VMCS changes on MSR_IA32_APICBASE write
Wei Yongjun <[email protected]>
dmaengine: at_xdmac: fix to pass correct device identity to free_irq()
Michal Hocko <[email protected]>
kernel/fork: fix CLONE_CHILD_CLEARTID regression in nscd
Peter Ujfalusi <[email protected]>
ASoC: omap-mcpdm: Fix irq resource handling
Subash Abhinov Kasiviswanathan <[email protected]>
sysctl: handle error writing UINT_MAX to u32 fields
Michael Ellerman <[email protected]>
powerpc/prom: Fix sub-processor option passed to ibm, client-architecture-support
Florian Fainelli <[email protected]>
brcmsmac: Initialize power in brcms_c_stf_ss_algo_channel_get()
Florian Fainelli <[email protected]>
brcmsmac: Free packet if dma_mapping_error() fails in dma_rxfill
Florian Fainelli <[email protected]>
brcmfmac: Fix glob_skb leak in brcmf_sdiod_recv_chain
Wei Yongjun <[email protected]>
ASoC: Intel: Skylake: Fix error return code in skl_probe()
Trond Myklebust <[email protected]>
pNFS/flexfiles: Fix layoutcommit after a commit to DS
Trond Myklebust <[email protected]>
pNFS/files: Fix layoutcommit after a commit to DS
Chuck Lever <[email protected]>
NFS: Don't drop CB requests with invalid principals
Chuck Lever <[email protected]>
svc: Avoid garbage replies when pc_func() returns rpc_drop_reply
Alexandre Belloni <[email protected]>
dmaengine: at_xdmac: fix debug string
Dan Carpenter <[email protected]>
fnic: pci_dma_mapping_error() doesn't return an error code
Dan Carpenter <[email protected]>
avr32: off by one in at32_init_pio()
Sven Eckelmann <[email protected]>
ath9k: Fix programming of minCCA power threshold
Arnd Bergmann <[email protected]>
gspca: avoid unused variable warnings
Dan Carpenter <[email protected]>
em28xx-i2c: rt_mutex_trylock() returns zero on failure
Geert Uytterhoeven <[email protected]>
NFC: fdp: Detect errors from fdp_nci_create_conn()
striebit <[email protected]>
iwlmvm: mvm: set correct state in smart-fifo configuration
James Hogan <[email protected]>
tile: Define AT_VECTOR_SIZE_ARCH for ARCH_DLINFO
Geliang Tang <[email protected]>
pstore: drop file opened reference count
Omar Sandoval <[email protected]>
blk-mq: actually hook up defer list when running requests
Nishanth Menon <[email protected]>
hwrng: omap - Fix assumption that runtime_get_sync will always succeed
Russell King <[email protected]>
ARM: sa1111: fix pcmcia suspend/resume
Wolfram Sang <[email protected]>
ARM: shmobile: fix regulator quirk for Gen2
Russell King <[email protected]>
ARM: sa1100: clear reset status prior to reboot
Russell King <[email protected]>
ARM: sa1100: fix 3.6864MHz clock
Russell King <[email protected]>
ARM: sa1100: register clocks early
Hugo Grostabussiat <[email protected]>
ARM: sun5i: Fix typo in trip point temperature
Stephen Boyd <[email protected]>
regulator: qcom_smd: Fix voltage ranges for pm8x41
Stephen Boyd <[email protected]>
regulator: qcom_spmi: Update mvs1/mvs2 switches on pm8941
Stephen Boyd <[email protected]>
regulator: qcom_spmi: Add support for get_mode/set_mode on switches
Stephen Boyd <[email protected]>
regulator: qcom_spmi: Add support for S4 supply on pm8941
[email protected] <[email protected]>
tpm: fix byte-order for the value read by tpm2_get_tpm_pt
Nicolas Iooss <[email protected]>
printk: fix parsing of "brl=" option
Marcin Nowakowski <[email protected]>
MIPS: uprobes: fix use of uninitialised variable
Paul Burton <[email protected]>
MIPS: Malta: Fix IOCU disable switch read for MIPS64
Marcin Nowakowski <[email protected]>
MIPS: fix uretprobe implementation
Marcin Nowakowski <[email protected]>
MIPS: uprobes: remove incorrect set_orig_insn
Will Deacon <[email protected]>
arm64: debug: avoid resetting stepping state machine when TIF_SINGLESTEP
Srinivas Ramana <[email protected]>
ARM: 8618/1: decompressor: reset ttbcr fields to use TTBR0 on ARMv7
James Morse <[email protected]>
irqchip/gicv3: Silence noisy DEBUG_PER_CPU_MAPS warning
Russell King <[email protected]>
gpio: sa1100: fix irq probing for ucb1x00
Dan Carpenter <[email protected]>
usb: gadget: fsl_qe_udc: signedness bug in qe_get_frame()
Yan, Zheng <[email protected]>
ceph: fix race during filling readdir cache
Emmanuel Grumbach <[email protected]>
iwlwifi: mvm: don't use ret when not initialised
Sara Sharon <[email protected]>
iwlwifi: pcie: fix access to scratch buffer
Geert Uytterhoeven <[email protected]>
spi: sh-msiof: Avoid invalid clock generator parameters
Michael Walle <[email protected]>
hwmon: (adt7411) set bit 3 in CFG1 register
Guenter Roeck <[email protected]>
nvmem: Declare nvmem_cell_read() consistently
Quentin Armitage <[email protected]>
ipvs: fix bind to link-local mcast IPv6 address in backup
Dan Carpenter <[email protected]>
tools/vm/slabinfo: fix an unintentional printf
Robert Jarzmik <[email protected]>
mmc: pxamci: fix potential oops
Stefan Wahren <[email protected]>
drivers/perf: arm_pmu: Fix leak in error path
Andy Shevchenko <[email protected]>
pinctrl: Flag strict is a field in struct pinmux_ops
Masahiro Yamada <[email protected]>
pinctrl: uniphier: fix .pin_dbg_show() callback
Heinrich Schuchardt <[email protected]>
i40e: avoid null pointer dereference
Mark Rutland <[email protected]>
perf/core: Fix pmu::filter_match for SW-led groups
Johannes Berg <[email protected]>
iwlwifi: mvm: fix a few firmware capability checks
Cristian Birsan <[email protected]>
usb: musb: fix DMA for host mode
Cristian Birsan <[email protected]>
usb: musb: Fix DMA desired mode for Mentor DMA engine
Roger Quadros <[email protected]>
ARM: 8617/1: dma: fix dma_max_pfn()
Robin Murphy <[email protected]>
ARM: 8616/1: dt: Respect property size when parsing CPUs
Alex Deucher <[email protected]>
drm/radeon/si/dpm: add workaround for for Jet parts
Ilia Mirkin <[email protected]>
drm/nouveau/fifo/nv04: avoid ramht race against cookie insertion
Andy Lutomirski <[email protected]>
x86/boot: Initialize FPU and X86_FEATURE_ALWAYS even if we don't have CPUID
Andy Lutomirski <[email protected]>
x86/init: Fix cr4_init_shadow() on CR4-less machines
Sergei Miroshnichenko <[email protected]>
can: dev: fix deadlock reported after bus-off
zhong jiang <[email protected]>
mm,ksm: fix endless looping in allocating memory when ksm enable
Karl Beldan <[email protected]>
mtd: nand: davinci: Reinitialize the HW ECC engine in 4bit hwctl
Joonwoo Park <[email protected]>
cpuset: handle race between CPU hotplug and cpuset_hotplug_work
-------------
Diffstat:
.../bindings/regulator/qcom,spmi-regulator.txt | 6 +-- Documentation/pinctrl.txt | 2 +- Makefile | 4 +- arch/arm/boot/compressed/head.S | 2 +- arch/arm/boot/dts/sun5i-a13.dtsi | 2 +- arch/arm/common/sa1111.c | 22 ++++---- arch/arm/include/asm/dma-mapping.h | 2 +- arch/arm/kernel/devtree.c | 14 +++-- arch/arm/mach-sa1100/clock.c | 5 +- arch/arm/mach-sa1100/generic.c | 4 ++ arch/arm/mach-sa1100/generic.h | 2 + arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c | 62 +++++++++------------- arch/arm64/kernel/debug-monitors.c | 6 ++- arch/avr32/mach-at32ap/pio.c | 2 +- arch/mips/include/asm/uprobes.h | 1 - arch/mips/kernel/uprobes.c | 25 ++------- arch/mips/mti-malta/malta-setup.c | 8 ++- arch/powerpc/kernel/prom_init.c | 9 ++-- arch/tile/include/asm/elf.h | 1 + arch/tile/include/uapi/asm/auxvec.h | 2 + arch/x86/include/asm/tlbflush.h | 2 +- arch/x86/kernel/cpu/common.c | 23 ++++---- arch/x86/kvm/vmx.c | 13 +++++ block/blk-mq.c | 2 +- drivers/acpi/acpica/hwxface.c | 24 ++++++--- drivers/char/hw_random/omap-rng.c | 16 +++++- drivers/char/tpm/tpm2-cmd.c | 2 +- drivers/clk/clk-xgene.c | 4 +- drivers/dma/at_xdmac.c | 8 +-- drivers/gpio/gpio-sa1100.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/fifo/dmanv04.c | 3 ++ drivers/gpu/drm/radeon/si_dpm.c | 6 +++ drivers/hwmon/adt7411.c | 5 +- drivers/infiniband/core/multicast.c | 13 +---- drivers/infiniband/hw/mlx4/mad.c | 23 ++++++++ drivers/infiniband/hw/mlx4/mcg.c | 14 ++--- drivers/infiniband/hw/mlx4/mlx4_ib.h | 2 +- drivers/infiniband/hw/mlx4/qp.c | 37 +++++++------ drivers/infiniband/ulp/ipoib/ipoib.h | 1 + drivers/infiniband/ulp/ipoib/ipoib_cm.c | 16 ++++++ drivers/infiniband/ulp/ipoib/ipoib_ib.c | 9 ++++ drivers/infiniband/ulp/ipoib/ipoib_main.c | 2 +- drivers/irqchip/irq-gic-v3.c | 7 +-- drivers/md/dm-log-writes.c | 4 +- drivers/media/usb/em28xx/em28xx-i2c.c | 5 +- drivers/media/usb/gspca/cpia1.c | 2 +- drivers/media/usb/gspca/konica.c | 2 +- drivers/media/usb/gspca/t613.c | 2 +- drivers/mmc/host/pxamci.c | 16 +++--- drivers/mtd/nand/davinci_nand.c | 3 ++ drivers/net/can/dev.c | 27 ++++++---- drivers/net/ethernet/intel/i40e/i40e_common.c | 4 +- drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 2 +- drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c | 4 +- drivers/net/wireless/brcm80211/brcmsmac/dma.c | 4 +- drivers/net/wireless/brcm80211/brcmsmac/stf.c | 2 +- drivers/net/wireless/iwlwifi/mvm/fw.c | 3 +- drivers/net/wireless/iwlwifi/mvm/mac80211.c | 8 +-- drivers/net/wireless/iwlwifi/mvm/sf.c | 2 +- drivers/net/wireless/iwlwifi/pcie/tx.c | 4 +- drivers/nfc/fdp/fdp.c | 4 +- drivers/perf/arm_pmu.c | 1 + drivers/pinctrl/uniphier/pinctrl-uniphier-core.c | 6 +++ drivers/regulator/qcom_smd-regulator.c | 17 +++--- drivers/regulator/qcom_spmi-regulator.c | 7 ++- drivers/scsi/fnic/fnic_fcs.c | 8 +-- drivers/spi/spi-sh-msiof.c | 3 ++ drivers/staging/fbtft/fbtft-core.c | 4 +- drivers/usb/class/usbtmc.c | 3 +- drivers/usb/gadget/udc/fsl_qe_udc.c | 7 +-- drivers/usb/misc/legousbtower.c | 35 ++++++------ drivers/usb/musb/musb_host.c | 8 ++- drivers/usb/serial/cp210x.c | 3 +- fs/aio.c | 7 ++- fs/ceph/inode.c | 9 +++- fs/nfs/callback_xdr.c | 6 ++- fs/nfs/filelayout/filelayout.c | 3 +- fs/nfs/flexfilelayout/flexfilelayout.c | 3 +- fs/pstore/inode.c | 1 - include/linux/can/dev.h | 3 +- include/linux/nvmem-consumer.h | 2 +- include/linux/sysctl.h | 2 + kernel/cpuset.c | 17 ++++-- kernel/events/core.c | 23 +++++++- kernel/fork.c | 10 ++-- kernel/printk/braille.c | 4 +- kernel/sysctl.c | 45 +++++++++++++++- mm/ksm.c | 3 +- net/batman-adv/originator.c | 6 --- net/batman-adv/types.h | 3 -- net/netfilter/ipvs/ip_vs_sync.c | 6 ++- net/sunrpc/svc.c | 8 ++- sound/pci/hda/patch_conexant.c | 10 ++++ sound/pci/hda/patch_realtek.c | 17 ++++++ sound/soc/intel/skylake/skl.c | 4 +- sound/soc/omap/omap-mcpdm.c | 5 +- tools/vm/slabinfo.c | 3 +- 97 files changed, 526 insertions(+), 289 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/93 cpuset: handle race between CPU hotplug and cpuset_hotplug_work
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joonwoo Park <[email protected]>
commit 28b89b9e6f7b6c8fef7b3af39828722bca20cfee upstream.
A discrepancy between cpu_online_mask and cpuset's effective_cpus mask is inevitable during hotplug since cpuset defers updating of effective_cpus mask using a workqueue, during which time nothing prevents the system from more hotplug operations. For that reason guarantee_online_cpus() walks up the cpuset hierarchy until it finds an intersection under the assumption that top cpuset's effective_cpus mask intersects with cpu_online_mask even with such a race occurring.
However a sequence of CPU hotplugs can open a time window, during which none of the effective CPUs in the top cpuset intersect with cpu_online_mask.
For example when there are 4 possible CPUs 0-3 and only CPU0 is online:
======================== ===========================
cpu_online_mask top_cpuset.effective_cpus
======================== ===========================
echo 1 > cpu2/online.
CPU hotplug notifier woke up hotplug work but not yet scheduled.
[0,2] [0]
echo 0 > cpu0/online.
The workqueue is still runnable.
[2] [0]
======================== ===========================
Now there is no intersection between cpu_online_mask and top_cpuset.effective_cpus. Thus invoking sys_sched_setaffinity() at this moment can cause following:
Unable to handle kernel NULL pointer dereference at virtual address 000000d0 ------------[ cut here ]------------ Kernel BUG at ffffffc0001389b0 [verbose debug info unavailable] Internal error: Oops - BUG: 96000005 [#1] PREEMPT SMP Modules linked in: CPU: 2 PID: 1420 Comm: taskset Tainted: G W 4.4.8+ #98 task: ffffffc06a5c4880 ti: ffffffc06e124000 task.ti: ffffffc06e124000 PC is at guarantee_online_cpus+0x2c/0x58 LR is at cpuset_cpus_allowed+0x4c/0x6c <snip> Process taskset (pid: 1420, stack limit = 0xffffffc06e124020) Call trace: [<ffffffc0001389b0>] guarantee_online_cpus+0x2c/0x58 [<ffffffc00013b208>] cpuset_cpus_allowed+0x4c/0x6c [<ffffffc0000d61f0>] sched_setaffinity+0xc0/0x1ac [<ffffffc0000d6374>] SyS_sched_setaffinity+0x98/0xac [<ffffffc000085cb0>] el0_svc_naked+0x24/0x28
The top cpuset's effective_cpus are guaranteed to be identical to cpu_online_mask eventually. Hence fall back to cpu_online_mask when there is no intersection between top cpuset's effective_cpus and cpu_online_mask.
--- kernel/cpuset.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
kernel/cpuset.c +14 -3
@@ -324,8 +324,7 @@ static struct file_system_type cpuset_fs/* * Return in pmask the portion of a cpusets's cpus_allowed that * are online. If none are online, walk up the cpuset hierarchy -* until we find one that does have some online cpus. The top -* cpuset always has some cpus online. +* until we find one that does have some online cpus. * * One way or another, we guarantee to return some non-empty subset * of cpu_online_mask.
@@ -334,8 +333,20 @@ static struct file_system_type cpuset_fs*/ static void guarantee_online_cpus (struct cpuset *cs,struct cpumask *pmask) { -while (!cpumask_intersects (cs->effective_cpus, cpu_online_mask)) +while (!cpumask_intersects (cs->effective_cpus, cpu_online_mask)) { cs =parent_cs (cs); +if (unlikely (!cs)) { +/* +* The top cpuset doesn't have any online cpu as a +* consequence of a race between cpuset_hotplug_work +* and cpu hotplug notifier. But we know the top +* cpuset's effective_cpus is on its way to to be +* identical to cpu_online_mask. +*/ +cpumask_copy (pmask, cpu_online_mask); +return ; + } + }cpumask_and (pmask, cs->effective_cpus, cpu_online_mask); }
Greg Kroah-Hartman
maintainerPATCH 2/93 mtd: nand: davinci: Reinitialize the HW ECC engine in 4bit hwctl
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Beldan <[email protected]>
commit f6d7c1b5598b6407c3f1da795dd54acf99c1990c upstream.
This fixes subpage writes when using 4-bit HW ECC.
There has been numerous reports about ECC errors with devices using this driver for a while. Also the 4-bit ECC has been reported as broken with subpages in [1] and with 16 bits NANDs in the driver and in mach* board files both in mainline and in the vendor BSPs.
What I saw with 4-bit ECC on a 16bits NAND (on an LCDK) which got me to try reinitializing the ECC engine:
- R/W on whole pages properly generates/checks RS code
- try writing the 1st subpage only of a blank page, the subpage is well written and the RS code properly generated, re-reading the same page the HW detects some ECC error, reading the same page again no ECC error is detected
Note that the ECC engine is already reinitialized in the 1-bit case.
Tested on my LCDK with UBI+UBIFS using subpages.
This could potentially get rid of the issue workarounded in [1].
[1] 28c015a9daab ("mtd: davinci-nand: disable subpage write for keystone-nand")
--- drivers/mtd/nand/davinci_nand.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/mtd/nand/davinci_nand.c +3 -0
@@ -241,6 +241,9 @@ static void nand_davinci_hwctl_4bit(struunsigned long flags;u32 val; +/* Reset ECC hardware */ +davinci_nand_readl (info,NAND_4BIT_ECC1_OFFSET ); +spin_lock_irqsave (&davinci_nand_lock, flags);/* Start 4-bit ECC calculation for read/write */
Greg Kroah-Hartman
maintainerPATCH 3/93 mm,ksm: fix endless looping in allocating memory when ksm enable
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: zhong jiang <[email protected]>
commit 5b398e416e880159fe55eefd93c6588fa072cd66 upstream.
I hit the following hung task when runing a OOM LTP test case with 4.1 kernel.
Call trace: [<ffffffc000086a88>] __switch_to+0x74/0x8c [<ffffffc000a1bae0>] __schedule+0x23c/0x7bc [<ffffffc000a1c09c>] schedule+0x3c/0x94 [<ffffffc000a1eb84>] rwsem_down_write_failed+0x214/0x350 [<ffffffc000a1e32c>] down_write+0x64/0x80 [<ffffffc00021f794>] __ksm_exit+0x90/0x19c [<ffffffc0000be650>] mmput+0x118/0x11c [<ffffffc0000c3ec4>] do_exit+0x2dc/0xa74 [<ffffffc0000c46f8>] do_group_exit+0x4c/0xe4 [<ffffffc0000d0f34>] get_signal+0x444/0x5e0 [<ffffffc000089fcc>] do_signal+0x1d8/0x450 [<ffffffc00008a35c>] do_notify_resume+0x70/0x78
The oom victim cannot terminate because it needs to take mmap_sem for write while the lock is held by ksmd for read which loops in the page allocator
ksm_do_scan
scan_get_next_rmap_item
down_read
get_next_rmap_item
alloc_rmap_item #ksmd will loop permanently.
There is no way forward because the oom victim cannot release any memory in 4.1 based kernel. Since 4.6 we have the oom reaper which would solve this problem because it would release the memory asynchronously. Nevertheless we can relax alloc_rmap_item requirements and use __GFP_NORETRY because the allocation failure is acceptable as ksm_do_scan would just retry later after the lock got dropped.
Such a patch would be also easy to backport to older stable kernels which do not have oom_reaper.
While we are at it add GFP_NOWARN so the admin doesn't have to be alarmed by the allocation failure.
--- mm/ksm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
mm/ksm.c +2 -1
@@ -283,7 +283,8 @@ static inline struct rmap_item *alloc_rm {struct rmap_item *rmap_item; - rmap_item =kmem_cache_zalloc (rmap_item_cache,GFP_KERNEL ); + rmap_item =kmem_cache_zalloc (rmap_item_cache,GFP_KERNEL | + __GFP_NORETRY | __GFP_NOWARN);if (rmap_item) ksm_rmap_items++;return rmap_item;
Greg Kroah-Hartman
maintainerPATCH 4/93 can: dev: fix deadlock reported after bus-off
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sergei Miroshnichenko <[email protected]>
commit 9abefcb1aaa58b9d5aa40a8bb12c87d02415e4c8 upstream.
A timer was used to restart after the bus-off state, leading to a relatively large can_restart() executed in an interrupt context, which in turn sets up pinctrl. When this happens during system boot, there is a high probability of grabbing the pinctrl_list_mutex, which is locked already by the probe() of other device, making the kernel suspect a deadlock condition [1].
To resolve this issue, the restart_timer is replaced by a delayed work.
[1] https://github.com/victronenergy/venus/issues/24
--- drivers/net/can/dev.c | 27 +++++++++++++++++---------- include/linux/can/dev.h | 3 ++- 2 files changed, 19 insertions(+), 11 deletions(-)
drivers/net/can/dev.c +17 -10
@@ -21,6 +21,7 @@#include <linux/slab.h> #include <linux/netdevice.h> #include <linux/if_arp.h> +#include <linux/workqueue.h> #include <linux/can.h> #include <linux/can/dev.h> #include <linux/can/skb.h>
@@ -471,9 +472,8 @@ EXPORT_SYMBOL_GPL(can_free_echo_skb);/* * CAN device restart for bus-off recovery */ -static void can_restart (unsigned long data) +static void can_restart (struct net_device *dev) { -struct net_device *dev = (struct net_device *)data;struct can_priv *priv =netdev_priv (dev);struct net_device_stats *stats = &dev->stats;struct sk_buff *skb;
@@ -513,6 +513,14 @@ restart:netdev_err (dev,"Error %d during restart" , err); } +static void can_restart_work (struct work_struct *work) +{ +struct delayed_work *dwork =to_delayed_work (work); + struct can_priv *priv = container_of(dwork, struct can_priv, restart_work); + +can_restart (priv->dev); +} +int can_restart_now (struct net_device *dev) {struct can_priv *priv =netdev_priv (dev);
@@ -526,8 +534,8 @@ int can_restart_now(struct net_device *dif (priv->state !=CAN_STATE_BUS_OFF )return -EBUSY ; -/* Runs as soon as possible in the timer context */ -mod_timer (&priv->restart_timer, jiffies); +cancel_delayed_work_sync (&priv->restart_work); +can_restart (dev);return 0 ; }
@@ -548,8 +556,8 @@ void can_bus_off(struct net_device *dev)netif_carrier_off (dev);if (priv->restart_ms) -mod_timer (&priv->restart_timer, - jiffies + (priv->restart_ms *HZ ) /1000 ); +schedule_delayed_work (&priv->restart_work, +msecs_to_jiffies (priv->restart_ms)); }EXPORT_SYMBOL_GPL (can_bus_off);
@@ -658,6 +666,7 @@ struct net_device *alloc_candev(int sizereturn NULL ; priv =netdev_priv (dev); + priv->dev = dev;if (echo_skb_max) { priv->echo_skb_max = echo_skb_max;
@@ -667,7 +676,7 @@ struct net_device *alloc_candev(int size priv->state =CAN_STATE_STOPPED ; -init_timer (&priv->restart_timer); +INIT_DELAYED_WORK (&priv->restart_work, can_restart_work);return dev; }
@@ -748,8 +757,6 @@ int open_candev(struct net_device *dev)if (!netif_carrier_ok (dev))netif_carrier_on (dev); -setup_timer (&priv->restart_timer, can_restart, (unsigned long )dev); -return 0 ; }EXPORT_SYMBOL_GPL (open_candev);
@@ -764,7 +771,7 @@ void close_candev(struct net_device *dev {struct can_priv *priv =netdev_priv (dev); -del_timer_sync (&priv->restart_timer); +cancel_delayed_work_sync (&priv->restart_work);can_flush_echo_skb (dev); }EXPORT_SYMBOL_GPL (close_candev);
include/linux/can/dev.h +2 -1
@@ -32,6 +32,7 @@ enum can_mode {* CAN common private data */ struct can_priv { +struct net_device *dev;struct can_device_stats can_stats;struct can_bittiming bittiming, data_bittiming;
@@ -47,7 +48,7 @@ struct can_priv {u32 ctrlmode_static;/* static enabled options for driver/hardware */ int restart_ms; -struct timer_list restart_timer; +struct delayed_work restart_work;int (*do_set_bittiming)(struct net_device *dev);int (*do_set_data_bittiming)(struct net_device *dev);
Greg Kroah-Hartman
maintainerPATCH 5/93 x86/init: Fix cr4_init_shadow() on CR4-less machines
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Lutomirski <[email protected]>
commit e1bfc11c5a6f40222a698a818dc269113245820e upstream.
cr4_init_shadow() will panic on 486-like machines without CR4. Fix it using __read_cr4_safe().
--- arch/x86/include/asm/tlbflush.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/tlbflush.h +1 -1
@@ -32,7 +32,7 @@ DECLARE_PER_CPU_SHARED_ALIGNED(struct tl/* Initialize cr4 shadow for this CPU. */ static inline void cr4_init_shadow (void ) { -this_cpu_write (cpu_tlbstate.cr4,__read_cr4 ()); +this_cpu_write (cpu_tlbstate.cr4,__read_cr4_safe ()); }/* Set in this cpu's CR4. */
Greg Kroah-Hartman
maintainerPATCH 6/93 x86/boot: Initialize FPU and X86_FEATURE_ALWAYS even if we dont have CPUID
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Lutomirski <[email protected]>
commit 05fb3c199bb09f5b85de56cc3ede194ac95c5e1f upstream.
Otherwise arch_task_struct_size == 0 and we die. While we're at it, set X86_FEATURE_ALWAYS, too.
--- arch/x86/kernel/cpu/common.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-)
arch/x86/kernel/cpu/common.c +14 -15
@@ -737,21 +737,20 @@ static void __init early_identify_cpu(stidentify_cpu_without_cpuid (c);/* cyrix could have cpuid enabled via c_identify()*/ -if (!have_cpuid_p ()) -return ; - -cpu_detect (c); -get_cpu_vendor (c); -get_cpu_cap (c); - -if (this_cpu->c_early_init) - this_cpu->c_early_init (c); - - c->cpu_index =0 ; -filter_cpuid_features (c, false); - -if (this_cpu->c_bsp_init) - this_cpu->c_bsp_init (c); +if (have_cpuid_p ()) { +cpu_detect (c); +get_cpu_vendor (c); +get_cpu_cap (c); + +if (this_cpu->c_early_init) + this_cpu->c_early_init (c); + + c->cpu_index =0 ; +filter_cpuid_features (c, false); + +if (this_cpu->c_bsp_init) + this_cpu->c_bsp_init (c); + }setup_force_cpu_cap (X86_FEATURE_ALWAYS );fpu__init_system (c);
Greg Kroah-Hartman
maintainerPATCH 7/93 drm/nouveau/fifo/nv04: avoid ramht race against cookie insertion
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilia Mirkin <[email protected]>
commit 666ca3d8f19082f40745d75f3cc7cc0200ee87e3 upstream.
--- drivers/gpu/drm/nouveau/nvkm/engine/fifo/dmanv04.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/nouveau/nvkm/engine/fifo/dmanv04.c +3 -0
@@ -36,7 +36,10 @@ nv04_fifo_dma_object_dtor(struct nvkm_fi {struct nv04_fifo_chan *chan =nv04_fifo_chan (base);struct nvkm_instmem *imem = chan->fifo->base.engine.subdev.device->imem; + +mutex_lock (&chan->fifo->base.engine.subdev.mutex);nvkm_ramht_remove (imem->ramht, cookie); +mutex_unlock (&chan->fifo->base.engine.subdev.mutex); } static int
Greg Kroah-Hartman
maintainerPATCH 8/93 drm/radeon/si/dpm: add workaround for for Jet parts
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 670bb4fd21c966d0d2a59ad4a99bb4889f9a2987 upstream.
Add clock quirks for Jet parts.
--- drivers/gpu/drm/radeon/si_dpm.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/radeon/si_dpm.c +6 -0
@@ -3015,6 +3015,12 @@ static void si_apply_state_adjust_rules(if (rdev->pdev->device ==0x6811 && rdev->pdev->revision ==0x81 ) max_mclk =120000 ; +/* limit sclk/mclk on Jet parts for stability */ +if (rdev->pdev->device ==0x6665 && + rdev->pdev->revision ==0xc3 ) { + max_sclk =75000 ; + max_mclk =80000 ; + }if (rps->vce_active) { rps->evclk = rdev->pm.dpm.vce_states[rdev->pm.dpm.vce_level].evclk;
Greg Kroah-Hartman
maintainerPATCH 9/93 ARM: 8616/1: dt: Respect property size when parsing CPUs
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Robin Murphy <[email protected]>
commit ba6dea4f7cedb4b1c17e36f4087675d817c2e24b upstream.
Whilst MPIDR values themselves are less than 32 bits, it is still perfectly valid for a DT to have #address-cells > 1 in the CPUs node, resulting in the "reg" property having leading zero cell(s). In that situation, the big-endian nature of the data conspires with the current behaviour of only reading the first cell to cause the kernel to think all CPUs have ID 0, and become resoundingly unhappy as a consequence.
Take the full property length into account when parsing CPUs so as to be correct under any circumstances.
--- arch/arm/kernel/devtree.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
arch/arm/kernel/devtree.c +11 -3
@@ -87,6 +87,8 @@ void __init arm_dt_init_cpu_maps(void)return ;for_each_child_of_node (cpus, cpu) { +const __be32 *cell; +int prop_bytes;u32 hwid;if (of_node_cmp (cpu->type,"cpu" ))
@@ -98,7 +100,8 @@ void __init arm_dt_init_cpu_maps(void)* properties is considered invalid to build the * cpu_logical_map. */ -if (of_property_read_u32 (cpu,"reg" , &hwid)) { + cell =of_get_property (cpu,"reg" , &prop_bytes); +if (!cell || prop_bytes <sizeof (*cell)) {pr_debug (" * %s missing reg property\n" , cpu->full_name);of_node_put (cpu);
@@ -106,10 +109,15 @@ void __init arm_dt_init_cpu_maps(void) }/* -* 8 MSBs must be set to 0 in the DT since the reg property +* Bits n:24 must be set to 0 in the DT since the reg property * defines the MPIDR[23:0]. */ -if (hwid & ~MPIDR_HWID_BITMASK ) { +do { + hwid =be32_to_cpu (*cell++); + prop_bytes -=sizeof (*cell); + }while (!hwid && prop_bytes >0 ); + +if (prop_bytes || (hwid & ~MPIDR_HWID_BITMASK )) {of_node_put (cpu);return ; }
Greg Kroah-Hartman
maintainerPATCH 10/93 ARM: 8617/1: dma: fix dma_max_pfn()
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Roger Quadros <[email protected]>
commit d248220f0465b818887baa9829e691fe662b2c5e upstream.
Since commit 6ce0d2001692 ("ARM: dma: Use dma_pfn_offset for dma address translation"), dma_to_pfn() already returns the PFN with the physical memory start offset so we don't need to add it again.
This fixes USB mass storage lock-up problem on systems that can't do DMA over the entire physical memory range (e.g.) Keystone 2 systems with 4GB RAM can only do DMA over the first 2GB. [K2E-EVM].
What happens there is that without this patch SCSI layer sets a wrong bounce buffer limit in scsi_calculate_bounce_limit() for the USB mass storage device. dma_max_pfn() evaluates to 0x8fffff and bounce_limit is set to 0x8fffff000 whereas maximum DMA'ble physical memory on Keystone 2 is 0x87fffffff. This results in non DMA'ble pages being given to the USB controller and hence the lock-up.
NOTE: in the above case, USB-SCSI-device's dma_pfn_offset was showing as 0. This should have really been 0x780000 as on K2e, LOWMEM_START is 0x80000000 and HIGHMEM_START is 0x800000000. DMA zone is 2GB so dma_max_pfn should be 0x87ffff. The incorrect dma_pfn_offset for the USB storage device is because USB devices are not correctly inheriting the dma_pfn_offset from the USB host controller. This will be fixed by a separate patch.
--- arch/arm/include/asm/dma-mapping.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/include/asm/dma-mapping.h +1 -1
@@ -119,7 +119,7 @@ static inline dma_addr_t virt_to_dma(str/* The ARM override for dma_max_pfn() */ static inline unsigned long dma_max_pfn (struct device *dev) { -return PHYS_PFN_OFFSET +dma_to_pfn (dev, *dev->dma_mask); +return dma_to_pfn (dev, *dev->dma_mask); }#define dma_max_pfn (dev) dma_max_pfn(dev)
Greg Kroah-Hartman
maintainerPATCH 11/93 usb: musb: Fix DMA desired mode for Mentor DMA engine
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cristian Birsan <[email protected]>
commit bba40e6948b94cba71965285fbac31bd078c024a upstream.
Commit 754fe4a92c07 ("usb: musb: Remove ifdefs for TX DMA for musb_host.c") introduces a problem setting the desired channel mode for the Mentor DMA engine.
There is a case where an address is incorrectly assigned to the DMA channel desired mode when it should instead be assigned the actual mode value. This results in the value of channel->desired_mode not being correct.
--- drivers/usb/musb/musb_host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/musb/musb_host.c +1 -1
@@ -661,7 +661,7 @@ static int musb_tx_dma_set_mode_mentor(s csr &= ~(MUSB_TXCSR_AUTOSET |MUSB_TXCSR_DMAMODE ); csr |=MUSB_TXCSR_DMAENAB ;/* against programmer's guide */ } - channel->desired_mode = mode; + channel->desired_mode = *mode;musb_writew (epio,MUSB_TXCSR , csr);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 12/93 usb: musb: fix DMA for host mode
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cristian Birsan <[email protected]>
commit 4c2ba0c67394514f3f75c660c9f5d02e66a7efd4 upstream.
Commit ac33cdb16681 ("usb: musb: Remove ifdefs for musb_host_rx in musb_host.c part5") introduces a problem setting DMA host mode.
The musb_advance_schedule() is called immediately after receiving an endpoint RX interrupt without waiting for the DMA transfer to complete.
As a consequence when the dma complete interrupt arrives the in_qh member of hw_ep is already null an the musb_host_rx() exits on !urb error case. Fix the done condition that advances the musb schedule.
--- drivers/usb/musb/musb_host.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/usb/musb/musb_host.c +2 -4
@@ -2008,10 +2008,8 @@ void musb_host_rx(struct musb *musb, u8 qh->offset, urb->transfer_buffer_length); - done =musb_rx_dma_in_inventra_cppi41 (c, hw_ep, qh, - urb, xfer_len, - iso_err); -if (done) +if (musb_rx_dma_in_inventra_cppi41 (c, hw_ep, qh, urb, + xfer_len, iso_err)) goto finish;else dev_err (musb->controller,"error: rx_dma failed\n" );
Greg Kroah-Hartman
maintainerPATCH 13/93 iwlwifi: mvm: fix a few firmware capability checks
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
commit 280a3efa82fccc9532c968a77e5162cb9f0af497 upstream.
My cleanup in "iwlwifi: prepare for higher API/CAPA bits" accidentally inverted a few tests - fix them.
--- drivers/net/wireless/iwlwifi/mvm/mac80211.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/iwlwifi/mvm/mac80211.c +4 -4
@@ -3992,8 +3992,8 @@ static int iwl_mvm_mac_get_survey(structif (idx !=0 )return -ENOENT ; -if (fw_has_capa (&mvm->fw->ucode_capa, -IWL_UCODE_TLV_CAPA_RADIO_BEACON_STATS )) +if (!fw_has_capa (&mvm->fw->ucode_capa, +IWL_UCODE_TLV_CAPA_RADIO_BEACON_STATS ))return -ENOENT ;mutex_lock (&mvm->mutex);
@@ -4039,8 +4039,8 @@ static void iwl_mvm_mac_sta_statistics(sstruct iwl_mvm_vif *mvmvif =iwl_mvm_vif_from_mac80211 (vif);struct iwl_mvm_sta *mvmsta =iwl_mvm_sta_from_mac80211 (sta); -if (fw_has_capa (&mvm->fw->ucode_capa, -IWL_UCODE_TLV_CAPA_RADIO_BEACON_STATS )) +if (!fw_has_capa (&mvm->fw->ucode_capa, +IWL_UCODE_TLV_CAPA_RADIO_BEACON_STATS ))return ;/* if beacon filtering isn't on mac80211 does it anyway */
Greg Kroah-Hartman
maintainerPATCH 14/93 perf/core: Fix pmu::filter_match for SW-led groups
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Rutland <[email protected]>
commit 2c81a6477081966fe80b8c6daa68459bca896774 upstream.
The following commit:
66eb579e66ec ("perf: allow for PMU-specific event filtering")
added the pmu::filter_match() callback. This was intended to avoid HW constraints on events from resulting in extremely pessimistic scheduling.
However, pmu::filter_match() is only called for the leader of each event group. When the leader is a SW event, we do not filter the groups, and may fail at pmu::add() time, and when this happens we'll give up on scheduling any event groups later in the list until they are rotated ahead of the failing group.
This can result in extremely sub-optimal event scheduling behaviour, e.g. if running the following on a big.LITTLE platform:
$ taskset -c 0 ./perf stat \
-e 'a57{context-switches,armv8_cortex_a57/config=0x11/}' \
-e 'a53{context-switches,armv8_cortex_a53/config=0x11/}' \
ls <not counted> context-switches (0.00%)
<not counted> armv8_cortex_a57/config=0x11/ (0.00%)
24 context-switches (37.36%)
57589154 armv8_cortex_a53/config=0x11/ (37.36%)Here the 'a53' event group was always eligible to be scheduled, but the 'a57' group never eligible to be scheduled, as the task was always affine to a Cortex-A53 CPU. The SW (group leader) event in the 'a57' group was eligible, but the HW event failed at pmu::add() time, resulting in ctx_flexible_sched_in giving up on scheduling further groups with HW events.
One way of avoiding this is to check pmu::filter_match() on siblings as well as the group leader. If any of these fail their pmu::filter_match() call, we must skip the entire group before attempting to add any events.
--- kernel/events/core.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-)
kernel/events/core.c +22 -1
@@ -1539,12 +1539,33 @@ static int __init perf_workqueue_init(vocore_initcall (perf_workqueue_init); -static inline int pmu_filter_match (struct perf_event *event) +static inline int __pmu_filter_match (struct perf_event *event) {struct pmu *pmu = event->pmu;return pmu->filter_match ? pmu->filter_match (event) :1 ; } +/* +* Check whether we should attempt to schedule an event group based on +* PMU-specific filtering. An event group can consist of HW and SW events, +* potentially with a SW leader, so we must check all the filters, to +* determine whether a group is schedulable: +*/ +static inline int pmu_filter_match (struct perf_event *event) +{ +struct perf_event *child; + +if (!__pmu_filter_match (event)) +return 0 ; + +list_for_each_entry (child, &event->sibling_list, group_entry) { +if (!__pmu_filter_match (child)) +return 0 ; + } + +return 1 ; +} +static inline int event_filter_match (struct perf_event *event) {
Greg Kroah-Hartman
maintainerPATCH 15/93 i40e: avoid null pointer dereference
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heinrich Schuchardt <[email protected]>
commit cd956722167ba4fdba9c1ce3eed251b04ea2e10f upstream.
In function i40e_debug_aq parameter desc is assumed to be possibly NULL. Do not dereference it before checking the value.
--- drivers/net/ethernet/intel/i40e/i40e_common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_common.c +3 -1
@@ -302,13 +302,15 @@ void i40e_debug_aq(struct i40e_hw *hw, e void *buffer, u16 buf_len) {struct i40e_aq_desc *aq_desc = (struct i40e_aq_desc *)desc; -u16 len =le16_to_cpu (aq_desc->datalen); +u16 len;u8 *buf = (u8 *)buffer;u16 i =0 ;if ((!(mask & hw->debug_mask)) || (desc ==NULL ))return ; + len =le16_to_cpu (aq_desc->datalen); + i40e_debug(hw, mask, "AQ CMD: opcode 0x%04X, flags 0x%04X, datalen 0x%04X, retval 0x%04X\n", le16_to_cpu(aq_desc->opcode),
Greg Kroah-Hartman
maintainerPATCH 16/93 pinctrl: uniphier: fix .pin_dbg_show() callback
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masahiro Yamada <[email protected]>
commit 10ef8277ec658bf6619da9b3fd65c2db7353c2a4 upstream.
Without this, reading the "pins" in the debugfs causes kernel BUG.
--- drivers/pinctrl/uniphier/pinctrl-uniphier-core.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/pinctrl/uniphier/pinctrl-uniphier-core.c +6 -0
@@ -73,6 +73,12 @@ static void uniphier_pctl_pin_dbg_show(scase UNIPHIER_PIN_PULL_DOWN : pull_dir ="DOWN" ;break ; +case UNIPHIER_PIN_PULL_UP_FIXED : + pull_dir ="UP(FIXED)" ; +break ; +case UNIPHIER_PIN_PULL_DOWN_FIXED : + pull_dir ="DOWN(FIXED)" ; +break ;case UNIPHIER_PIN_PULL_NONE : pull_dir ="NONE" ;break ;
Greg Kroah-Hartman
maintainerPATCH 17/93 pinctrl: Flag strict is a field in struct pinmux_ops
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Shevchenko <[email protected]>
commit 7440926ed9623dceca3310c5f437d06c859dc02b upstream.
Documentation incorrectly refers to struct pinctrl_desc, where no such flag is available. Replace the name of the struct.
--- Documentation/pinctrl.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/pinctrl.txt +1 -1
@@ -831,7 +831,7 @@ separate memory range only intended for range dealing with pin config and pin multiplexing get placed into a different memory range and a separate section of the data sheet. -A flag "strict" in struct pinctrl_desc is available to check and deny +A flag "strict" in struct pinmux_ops is available to check and deny simultaneous access to the same pin from GPIO and pin multiplexing consumers on hardware of this type. The pinctrl driver should set this flag accordingly.
Greg Kroah-Hartman
maintainerPATCH 18/93 drivers/perf: arm_pmu: Fix leak in error path
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Wahren <[email protected]>
commit 753246840d012ae34ea80a1d40bc1546c62fb957 upstream.
In case of a IRQ type mismatch in of_pmu_irq_cfg() the device node for interrupt affinity isn't freed. So fix this issue by calling of_node_put().
--- drivers/perf/arm_pmu.c | 1 + 1 file changed, 1 insertion(+)
drivers/perf/arm_pmu.c +1 -0
@@ -815,6 +815,7 @@ static int of_pmu_irq_cfg(struct arm_pmuif (i >0 && spi != using_spi) {pr_err ("PPI/SPI IRQ type mismatch for %s!\n" , dn->name); +of_node_put (dn);kfree (irqs);return -EINVAL ; }
Greg Kroah-Hartman
maintainerPATCH 19/93 mmc: pxamci: fix potential oops
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Robert Jarzmik <[email protected]>
commit b3802db5eb72d2a96f4aa4ff0abb937033df2acf upstream.
As reported by Dan in his report in [1], there is a potential NULL pointer derefence if these conditions are met :
- there is no platform_data provided, ie. host->pdata = NULL
Fix this by only using the platform data ro_invert when a gpio for read-only is provided by the platform data.
This doesn't appear yet as every pxa board provides a platform_data, and calls pxa_set_mci_info() with a non NULL pointer.
[1] [bug report] mmc: pxamci: fix card detect with slot-gpio API. The commit fd546ee6a7dc ("mmc: pxamci: fix card detect with slot-gpio API") from Sep 26, 2015, leads to the following static checker warning:
drivers/mmc/host/pxamci.c:809 pxamci_probe() warn: variable dereferenced before check 'host->pdata' (see line 798)
--- drivers/mmc/host/pxamci.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/mmc/host/pxamci.c +9 -7
@@ -798,14 +798,16 @@ static int pxamci_probe(struct platform_gpio_direction_output (gpio_power, host->pdata->gpio_power_invert); } -if (gpio_is_valid (gpio_ro)) +if (gpio_is_valid (gpio_ro)) { ret =mmc_gpio_request_ro (mmc, gpio_ro); -if (ret) { -dev_err (&pdev->dev,"Failed requesting gpio_ro %d\n" , gpio_ro); - goto out; - }else { - mmc->caps2 |= host->pdata->gpio_card_ro_invert ? -0 :MMC_CAP2_RO_ACTIVE_HIGH ; +if (ret) { +dev_err (&pdev->dev,"Failed requesting gpio_ro %d\n" , + gpio_ro); + goto out; + }else { + mmc->caps2 |= host->pdata->gpio_card_ro_invert ? +0 :MMC_CAP2_RO_ACTIVE_HIGH ; + } }if (gpio_is_valid (gpio_cd))
Greg Kroah-Hartman
maintainerPATCH 20/93 tools/vm/slabinfo: fix an unintentional printf
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit 2d6a4d64812bb12dda53704943b61a7496d02098 upstream.
The curly braces are missing here so we print stuff unintentionally.
--- tools/vm/slabinfo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/vm/slabinfo.c +2 -1
@@ -510,10 +510,11 @@ static void slab_stats(struct slabinfo * s->alloc_node_mismatch, (s->alloc_node_mismatch * 100) / total); } -if (s->cmpxchg_double_fail || s->cmpxchg_double_cpu_fail) +if (s->cmpxchg_double_fail || s->cmpxchg_double_cpu_fail) {printf ("\nCmpxchg_double Looping\n------------------------\n" );printf ("Locked Cmpxchg Double redos %lu\nUnlocked Cmpxchg Double redos %lu\n" , s->cmpxchg_double_fail, s->cmpxchg_double_cpu_fail); + } }static void report (struct slabinfo *s)
Greg Kroah-Hartman
maintainerPATCH 21/93 ipvs: fix bind to link-local mcast IPv6 address in backup
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Quentin Armitage <[email protected]>
commit 3777ed688fba82d0bd43f9fc1ebbc6abe788576d upstream.
When using HEAD from
https://git.kernel.org/cgit/utils/kernel/ipvsadm/ipvsadm.git/,
the command:
ipvsadm --start-daemon backup --mcast-interface eth0.60 \
--mcast-group ff02::1:81fails with the error message:
Argument list too long
whereas both:
ipvsadm --start-daemon master --mcast-interface eth0.60 \
--mcast-group ff02::1:81
and:
ipvsadm --start-daemon backup --mcast-interface eth0.60 \
--mcast-group 224.0.0.81are successful.
The error message "Argument list too long" isn't helpful. The error occurs because an IPv6 address is given in backup mode.
The error is in make_receive_sock() in net/netfilter/ipvs/ip_vs_sync.c, since it fails to set the interface on the address or the socket before calling inet6_bind() (via sock->ops->bind), where the test 'if (!sk->sk_bound_dev_if)' failed.
Setting sock->sk->sk_bound_dev_if on the socket before calling inet6_bind() resolves the issue.
--- net/netfilter/ipvs/ip_vs_sync.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/netfilter/ipvs/ip_vs_sync.c +4 -2
@@ -1545,7 +1545,8 @@ error:/* * Set up receiving multicast socket over UDP */ -static struct socket *make_receive_sock (struct netns_ipvs *ipvs,int id) +static struct socket *make_receive_sock (struct netns_ipvs *ipvs,int id, +int ifindex) {/* multicast addr */ union ipvs_sockaddr mcast_addr;
@@ -1566,6 +1567,7 @@ static struct socket *make_receive_sock(set_sock_size (sock->sk,0 , result);get_mcast_sockaddr (&mcast_addr, &salen, &ipvs->bcfg, id); + sock->sk->sk_bound_dev_if = ifindex; result = sock->ops->bind (sock, (struct sockaddr *)&mcast_addr, salen);if (result <0 ) {pr_err ("Error binding to the multicast addr\n" );
@@ -1868,7 +1870,7 @@ int start_sync_thread(struct netns_ipvsif (state ==IP_VS_STATE_MASTER ) sock =make_send_sock (ipvs, id);else - sock =make_receive_sock (ipvs, id); + sock =make_receive_sock (ipvs, id, dev->ifindex);if (IS_ERR (sock)) { result =PTR_ERR (sock); goto outtinfo;
Greg Kroah-Hartman
maintainerPATCH 22/93 nvmem: Declare nvmem_cell_read() consistently
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guenter Roeck <[email protected]>
commit a6c50912508d80164a5e607993b617be85a46d73 upstream.
nvmem_cell_read() is declared as void * if CONFIG_NVMEM is enabled, and as char * otherwise. This can result in a build warning if CONFIG_NVMEM is not enabled and a caller asigns the result to a type other than char * without using a typecast. Use a consistent declaration to avoid the problem.
--- include/linux/nvmem-consumer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/nvmem-consumer.h +1 -1
@@ -74,7 +74,7 @@ static inline void nvmem_cell_put(struct { } -static inline char *nvmem_cell_read (struct nvmem_cell *cell,size_t *len) +static inline void *nvmem_cell_read (struct nvmem_cell *cell,size_t *len) {return ERR_PTR (-ENOSYS ); }
Greg Kroah-Hartman
maintainerPATCH 23/93 hwmon: (adt7411) set bit 3 in CFG1 register
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Walle <[email protected]>
commit b53893aae441a034bf4dbbad42fe218561d7d81f upstream.
According to the datasheet you should only write 1 to this bit. If it is not set, at least AIN3 will return bad values on newer silicon revisions.
--- drivers/hwmon/adt7411.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/hwmon/adt7411.c +4 -1
@@ -30,6 +30,7 @@#define ADT7411_REG_CFG1 0x18#define ADT7411_CFG1_START_MONITOR (1 << 0) +#define ADT7411_CFG1_RESERVED_BIT3 (1 << 3)#define ADT7411_REG_CFG2 0x19#define ADT7411_CFG2_DISABLE_AVG (1 << 5)
@@ -296,8 +297,10 @@ static int adt7411_probe(struct i2c_cliemutex_init (&data->device_lock);mutex_init (&data->update_lock); +/* According to the datasheet, we must only write 1 to bit 3 */ ret =adt7411_modify_bit (client,ADT7411_REG_CFG1 , -ADT7411_CFG1_START_MONITOR ,1 ); +ADT7411_CFG1_RESERVED_BIT3 + |ADT7411_CFG1_START_MONITOR ,1 );if (ret <0 )return ret;
Greg Kroah-Hartman
maintainerPATCH 24/93 spi: sh-msiof: Avoid invalid clock generator parameters
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
commit c3ccf357c3d75bd2924e049b6a991f7c0c111068 upstream.
The conversion from a look-up table to a calculation for clock generator parameters forgot to take into account that BRDV x 1/1 is valid only if BRPS is x 1/1 or x 1/2, leading to undefined behavior (e.g. arbitrary clock rates).
This limitation is documented for the MSIOF module in all supported SH/R-Mobile and R-Car Gen2/Gen3 ARM SoCs.
Tested on r8a7791/koelsch and r8a7795/salvator-x.
--- drivers/spi/spi-sh-msiof.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/spi/spi-sh-msiof.c +3 -0
@@ -263,6 +263,9 @@ static void sh_msiof_spi_set_clk_regs(stfor (k =0 ; k <ARRAY_SIZE (sh_msiof_spi_div_table); k++) { brps =DIV_ROUND_UP (div, sh_msiof_spi_div_table[k].div); +/* SCR_BRDV_DIV_1 is valid only if BRPS is x 1/1 or x 1/2 */ +if (sh_msiof_spi_div_table[k].div ==1 && brps >2 ) +continue ;if (brps <=32 )/* max of brdv is 32 */ break ; }
Greg Kroah-Hartman
maintainerPATCH 25/93 iwlwifi: pcie: fix access to scratch buffer
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sara Sharon <[email protected]>
commit d5d0689aefc59c6a5352ca25d7e6d47d03f543ce upstream.
This fixes a pretty ancient bug that hasn't manifested itself until now.
The scratchbuf for command queue is allocated only for 32 slots but is accessed with the queue write pointer - which can be up to 256.
Since the scratch buf size was 16 and there are up to 256 TFDs we never passed a page boundary when accessing the scratch buffer, but when attempting to increase the size of the scratch buffer a panic was quick to follow when trying to access the address resulted in a page boundary.
--- drivers/net/wireless/iwlwifi/pcie/tx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlwifi/pcie/tx.c +2 -2
@@ -1508,9 +1508,9 @@ static int iwl_pcie_enqueue_hcmd(struct/* start the TFD with the scratchbuf */ scratch_size =min_t (int, copy_size,IWL_HCMD_SCRATCHBUF_SIZE ); -memcpy (&txq->scratchbufs[q->write_ptr], &out_cmd->hdr, scratch_size); +memcpy (&txq->scratchbufs[idx], &out_cmd->hdr, scratch_size);iwl_pcie_txq_build_tfd (trans, txq, -iwl_pcie_get_scratchbuf_dma (txq, q->write_ptr), +iwl_pcie_get_scratchbuf_dma (txq, idx), scratch_size, true);/* map first command fragment, if any remains */
Greg Kroah-Hartman
maintainerPATCH 26/93 iwlwifi: mvm: dont use ret when not initialised
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Emmanuel Grumbach <[email protected]>
commit ff6e58e648ed5f3cc43891767811d5c3c88bbd41 upstream.
fw-dbg code return ret but that variable was either 0 or not initialised. Return 0 always.
--- drivers/net/wireless/iwlwifi/mvm/fw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/iwlwifi/mvm/fw.c +2 -1
@@ -935,7 +935,8 @@ int iwl_mvm_start_fw_dbg_conf(struct iwl } mvm->fw_dbg_conf = conf_id; -return ret; + +return 0 ; }static int iwl_mvm_config_ltr (struct iwl_mvm *mvm)
Greg Kroah-Hartman
maintainerPATCH 27/93 ceph: fix race during filling readdir cache
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yan, Zheng <[email protected]>
commit af5e5eb574776cdf1b756a27cc437bff257e22fe upstream.
Readdir cache uses page cache to save dentry pointers. When adding dentry pointers to middle of a page, we need to make sure the page already exists. Otherwise the beginning part of the page will be invalid pointers.
--- fs/ceph/inode.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
fs/ceph/inode.c +7 -2
@@ -1358,15 +1358,20 @@ static int fill_readdir_cache(struct inoif (!ctl->page || pgoff !=page_index (ctl->page)) {ceph_readdir_cache_release (ctl); - ctl->page =grab_cache_page (&dir->i_data, pgoff); +if (idx ==0 ) + ctl->page =grab_cache_page (&dir->i_data, pgoff); +else + ctl->page =find_lock_page (&dir->i_data, pgoff);if (!ctl->page) { ctl->index =-1 ; -return -ENOMEM ; +return idx ==0 ? -ENOMEM :0 ; }/* reading/filling the cache are serialized by * i_mutex, no need to use page lock */ unlock_page (ctl->page); ctl->dentries =kmap (ctl->page); +if (idx ==0 ) +memset (ctl->dentries,0 ,PAGE_CACHE_SIZE ); } if (req->r_dir_release_cnt == atomic64_read(&ci->i_release_count) &&
Greg Kroah-Hartman
maintainerPATCH 28/93 usb: gadget: fsl_qe_udc: signedness bug in qe_get_frame()
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit f4693b08cc901912a87369c46537b94ed4084ea0 upstream.
We can't assign -EINVAL to a u16.
--- drivers/usb/gadget/udc/fsl_qe_udc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/usb/gadget/udc/fsl_qe_udc.c +2 -5
@@ -1878,11 +1878,8 @@ static int qe_get_frame(struct usb_gadge tmp =in_be16 (&udc->usb_param->frame_n);if (tmp &0x8000 ) - tmp = tmp &0x07ff ; -else - tmp = -EINVAL ; - -return (int )tmp; +return tmp &0x07ff ; +return -EINVAL ; } static int fsl_qe_start(struct usb_gadget *gadget,
Greg Kroah-Hartman
maintainerPATCH 29/93 gpio: sa1100: fix irq probing for ucb1x00
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Russell King <[email protected]>
commit 56beac95cb88c188d2a885825a5da131edb41fe3 upstream.
ucb1x00 has used IRQ probing since it's dawn to find the GPIO interrupt that it's connected to. However, commit 23393d49fb75 ("gpio: kill off set_irq_flags usage") broke this by disabling IRQ probing on GPIO interrupts. Fix this.
--- drivers/gpio/gpio-sa1100.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-sa1100.c +1 -1
@@ -155,7 +155,7 @@ static int sa1100_gpio_irqdomain_map(str {irq_set_chip_and_handler (irq, &sa1100_gpio_irq_chip, handle_edge_irq); -irq_set_noprobe (irq); +irq_set_probe (irq);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 30/93 irqchip/gicv3: Silence noisy DEBUG_PER_CPU_MAPS warning
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Morse <[email protected]>
commit 727653d6ce7103b245eb8041f55dd5885f4c3289 upstream.
gic_raise_softirq() walks the list of cpus using for_each_cpu(), it calls gic_compute_target_list() which advances the iterator by the number of CPUs in the cluster.
If gic_compute_target_list() reaches the last CPU it leaves the iterator pointing at the last CPU. This means the next time round the for_each_cpu() loop cpumask_next() will be called with an invalid CPU.
This triggers a warning when built with CONFIG_DEBUG_PER_CPU_MAPS:
[ 3.077738] GICv3: CPU1: found redistributor 1 region 0:0x000000002f120000 [ 3.077943] CPU1: Booted secondary processor [410fd0f0] [ 3.078542] ------------[ cut here ]------------ [ 3.078746] WARNING: CPU: 1 PID: 0 at ../include/linux/cpumask.h:121 gic_raise_softirq+0x12c/0x170 [ 3.078812] Modules linked in: [ 3.078869] [ 3.078930] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.8.0-rc5+ #5188 [ 3.078994] Hardware name: Foundation-v8A (DT) [ 3.079059] task: ffff80087a1a0080 task.stack: ffff80087a19c000 [ 3.079145] PC is at gic_raise_softirq+0x12c/0x170 [ 3.079226] LR is at gic_raise_softirq+0xa4/0x170 [ 3.079296] pc : [<ffff0000083ead24>] lr : [<ffff0000083eac9c>] pstate: 200001c9 [ 3.081139] Call trace: [ 3.081202] Exception stack(0xffff80087a19fbe0 to 0xffff80087a19fd10)
[ 3.082269] [<ffff0000083ead24>] gic_raise_softirq+0x12c/0x170 [ 3.082354] [<ffff00000808e614>] smp_send_reschedule+0x34/0x40 [ 3.082433] [<ffff0000080e80a0>] resched_curr+0x50/0x88 [ 3.082512] [<ffff0000080e89d0>] check_preempt_curr+0x60/0xd0 [ 3.082593] [<ffff0000080e8a60>] ttwu_do_wakeup+0x20/0xe8 [ 3.082672] [<ffff0000080e8bb8>] ttwu_do_activate+0x90/0xc0 [ 3.082753] [<ffff0000080ea9a4>] try_to_wake_up+0x224/0x370 [ 3.082836] [<ffff0000080eabc8>] default_wake_function+0x10/0x18 [ 3.082920] [<ffff000008103134>] __wake_up_common+0x5c/0xa0 [ 3.083003] [<ffff0000081031f4>] __wake_up_locked+0x14/0x20 [ 3.083086] [<ffff000008103f80>] complete+0x40/0x60 [ 3.083168] [<ffff00000808df7c>] secondary_start_kernel+0x15c/0x1d0 [ 3.083240] [<00000000808911a4>] 0x808911a4 [ 3.113401] Detected PIPT I-cache on CPU2
Avoid updating the iterator if the next call to cpumask_next() would cause the for_each_cpu() loop to exit.
There is no change to gic_raise_softirq()'s behaviour, (cpumask_next()s eventual call to _find_next_bit() will return early as start >= nbits), this patch just silences the warning.
--- drivers/irqchip/irq-gic-v3.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/irqchip/irq-gic-v3.c +4 -3
@@ -544,7 +544,7 @@ static struct notifier_block gic_cpu_notstatic u16 gic_compute_target_list (int *base_cpu,const struct cpumask *mask,unsigned long cluster_id) { -int cpu = *base_cpu; +int next_cpu, cpu = *base_cpu;unsigned long mpidr =cpu_logical_map (cpu);u16 tlist =0 ;
@@ -558,9 +558,10 @@ static u16 gic_compute_target_list(int * tlist |=1 << (mpidr &0xf ); - cpu =cpumask_next (cpu, mask); -if (cpu >= nr_cpu_ids) + next_cpu =cpumask_next (cpu, mask); +if (next_cpu >= nr_cpu_ids) goto out; + cpu = next_cpu; mpidr =cpu_logical_map (cpu);
Greg Kroah-Hartman
maintainerPATCH 31/93 ARM: 8618/1: decompressor: reset ttbcr fields to use TTBR0 on ARMv7
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srinivas Ramana <[email protected]>
commit 117e5e9c4cfcb7628f08de074fbfefec1bb678b7 upstream.
If the bootloader uses the long descriptor format and jumps to kernel decompressor code, TTBCR may not be in a right state. Before enabling the MMU, it is required to clear the TTBCR.PD0 field to use TTBR0 for translation table walks.
The commit dbece45894d3a ("ARM: 7501/1: decompressor:
reset ttbcr for VMSA ARMv7 cores") does the reset of TTBCR.N, but doesn't consider all the bits for the size of TTBCR.N.
Clear TTBCR.PD0 field and reset all the three bits of TTBCR.N to indicate the use of TTBR0 and the correct base address width.
--- arch/arm/boot/compressed/head.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/compressed/head.S +1 -1
@@ -776,7 +776,7 @@ __armv7_mmu_cache_on: orrne r0, r0, #1 @ MMU enabled movne r1, #0xfffffffd @ domain 0 = client bic r6, r6, #1 << 31 @ 32-bit translation system - bic r6, r6, #3 << 0 @ use only ttbr0 + bic r6, r6, #(7 << 0) | (1 << 4) @ use only ttbr0 mcrne p15, 0, r3, c2, c0, 0 @ load page table pointer mcrne p15, 0, r1, c3, c0, 0 @ load domain access control mcrne p15, 0, r6, c2, c0, 2 @ load ttb control
Greg Kroah-Hartman
maintainerPATCH 32/93 arm64: debug: avoid resetting stepping state machine when TIF_SINGLESTEP
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <[email protected]>
commit 3a402a709500c5a3faca2111668c33d96555e35a upstream.
When TIF_SINGLESTEP is set for a task, the single-step state machine is enabled and we must take care not to reset it to the active-not-pending state if it is already in the active-pending state.
Unfortunately, that's exactly what user_enable_single_step does, by unconditionally setting the SS bit in the SPSR for the current task. This causes failures in the GDB testsuite, where GDB ends up missing expected step traps if the instruction being stepped generates another trap, e.g. PTRACE_EVENT_FORK from an SVC instruction.
This patch fixes the problem by preserving the current state of the stepping state machine when TIF_SINGLESTEP is set on the current thread.
--- arch/arm64/kernel/debug-monitors.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
arch/arm64/kernel/debug-monitors.c +4 -2
@@ -422,8 +422,10 @@ int kernel_active_single_step(void)/* ptrace API */ void user_enable_single_step (struct task_struct *task) { -set_ti_thread_flag (task_thread_info (task),TIF_SINGLESTEP ); -set_regs_spsr_ss (task_pt_regs (task)); +struct thread_info *ti =task_thread_info (task); + +if (!test_and_set_ti_thread_flag (ti,TIF_SINGLESTEP )) +set_regs_spsr_ss (task_pt_regs (task)); }void user_disable_single_step (struct task_struct *task)
Greg Kroah-Hartman
maintainerPATCH 33/93 MIPS: uprobes: remove incorrect set_orig_insn
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marcin Nowakowski <[email protected]>
commit ddabfa5c2e33f1b495f3e0176de7057850915c0b upstream.
Generic kernel code implements a weak version of set_orig_insn that moves cached 'insn' from arch_uprobe to the original code location when the trap is removed.
MIPS variant used arch_uprobe->orig_inst which was never initialised properly, so this code only inserted a nop instead of the original instruction. With that change orig_inst can also be safely removed.
Patchwork: https://patchwork.linux-mips.org/patch/14299/
--- arch/mips/include/asm/uprobes.h | 1 - arch/mips/kernel/uprobes.c | 18 ------------------ 2 files changed, 19 deletions(-)
arch/mips/include/asm/uprobes.h +0 -1
@@ -36,7 +36,6 @@ struct arch_uprobe {unsigned long resume_epc;u32 insn[2 ];u32 ixol[2 ]; -union mips_instruction orig_inst[MAX_UINSN_BYTES /4 ]; };struct arch_uprobe_task {
arch/mips/kernel/uprobes.c +0 -18
@@ -280,24 +280,6 @@ int __weak set_swbp(struct arch_uprobe *return uprobe_write_opcode (mm, vaddr,UPROBE_SWBP_INSN ); } -/** -* set_orig_insn - Restore the original instruction. -* @mm: the probed process address space. -* @auprobe: arch specific probepoint information. -* @vaddr: the virtual address to insert the opcode. -* -* For mm @mm, restore the original opcode (opcode) at @vaddr. -* Return 0 (success) or a negative errno. -* -* This overrides the weak version in kernel/events/uprobes.c. -*/ -int set_orig_insn (struct arch_uprobe *auprobe,struct mm_struct *mm, -unsigned long vaddr) -{ -return uprobe_write_opcode (mm, vaddr, - *(uprobe_opcode_t *)&auprobe->orig_inst[0 ].word); -} -void __weak arch_uprobe_copy_ixol (struct page *page,unsigned long vaddr,void *src,unsigned long len) {
Greg Kroah-Hartman
maintainerPATCH 34/93 MIPS: fix uretprobe implementation
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marcin Nowakowski <[email protected]>
commit db06068a4fd44a57b642b369d2a295b8448f6b65 upstream.
arch_uretprobe_hijack_return_addr should replace the return address for a call with a trampoline address.
Patchwork: https://patchwork.linux-mips.org/patch/14298/
--- arch/mips/kernel/uprobes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/kernel/uprobes.c +1 -1
@@ -257,7 +257,7 @@ unsigned long arch_uretprobe_hijack_retu ra = regs->regs[31 ];/* Replace the return address with the trampoline address */ - regs->regs[31 ] = ra; + regs->regs[31 ] = trampoline_vaddr;return ra; }
Greg Kroah-Hartman
maintainerPATCH 35/93 MIPS: Malta: Fix IOCU disable switch read for MIPS64
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Burton <[email protected]>
commit 305723ab439e14debc1d339aa04e835d488b8253 upstream.
Malta boards used with CPU emulators feature a switch to disable use of an IOCU. Software has to check this switch & ignore any present IOCU if the switch is closed. The read used to do this was unsafe for 64 bit kernels, as it simply casted the address 0xbf403000 to a pointer & dereferenced it. Whilst in a 32 bit kernel this would access kseg1, in a 64 bit kernel this attempts to access xuseg & results in an address error exception.
Fix by accessing a correctly formed ckseg1 address generated using the CKSEG1ADDR macro.
Whilst modifying this code, define the name of the register and the bit we care about within it, which indicates whether PCI DMA is routed to the IOCU or straight to DRAM. The code previously checked that bit 0 was also set, but the least significant 7 bits of the CONFIG_GEN0 register contain the value of the MReqInfo signal provided to the IOCU OCP bus, so singling out bit 0 makes little sense & that part of the check is dropped.
Patchwork: https://patchwork.linux-mips.org/patch/14187/
--- arch/mips/mti-malta/malta-setup.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
arch/mips/mti-malta/malta-setup.c +7 -1
@@ -39,6 +39,9 @@#include <linux/console.h> #endif +#define ROCIT_CONFIG_GEN0 0x1f403000 +#define ROCIT_CONFIG_GEN0_PCI_IOCU BIT(7) +extern void malta_be_init (void );extern int malta_be_handler (struct pt_regs *regs,int is_fixup);
@@ -107,6 +110,8 @@ static void __init fd_activate(void)static int __init plat_enable_iocoherency (void ) {int supported =0 ; +u32 cfg; +if (mips_revision_sconid ==MIPS_REVISION_SCON_BONITO ) {if (BONITO_PCICACHECTRL &BONITO_PCICACHECTRL_CPUCOH_PRES ) {BONITO_PCICACHECTRL |=BONITO_PCICACHECTRL_CPUCOH_EN ;
@@ -129,7 +134,8 @@ static int __init plat_enable_iocoherenc }else if (mips_cm_numiocu () !=0 ) {/* Nothing special needs to be done to enable coherency */ pr_info ("CMP IOCU detected\n" ); -if ((*(unsigned int *)0xbf403000 &0x81 ) !=0x81 ) { + cfg =__raw_readl ((u32 *)CKSEG1ADDR (ROCIT_CONFIG_GEN0 )); +if (!(cfg &ROCIT_CONFIG_GEN0_PCI_IOCU )) {pr_crit ("IOCU OPERATION DISABLED BY SWITCH - DEFAULTING TO SW IO COHERENCY\n" );return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 36/93 MIPS: uprobes: fix use of uninitialised variable
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marcin Nowakowski <[email protected]>
commit ca86c9ef2b322ebf24772009fdea037688cbdac1 upstream.
arch_uprobe_pre_xol needs to emulate a branch if a branch instruction has been replaced with a breakpoint, but in fact an uninitialised local variable was passed to the emulator routine instead of the original instruction
Patchwork: https://patchwork.linux-mips.org/patch/14300/
--- arch/mips/kernel/uprobes.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
arch/mips/kernel/uprobes.c +2 -3
@@ -157,7 +157,6 @@ bool is_trap_insn(uprobe_opcode_t *insn)int arch_uprobe_pre_xol (struct arch_uprobe *aup,struct pt_regs *regs) {struct uprobe_task *utask = current->utask; -union mips_instruction insn;/* * Now find the EPC where to resume after the breakpoint has been
@@ -168,10 +167,10 @@ int arch_uprobe_pre_xol(struct arch_uprounsigned long epc; epc = regs->cp0_epc; -__compute_return_epc_for_insn (regs, insn); +__compute_return_epc_for_insn (regs, + (union mips_instruction ) aup->insn[0 ]); aup->resume_epc = regs->cp0_epc; } - utask->autask.saved_trap_nr = current->thread.trap_nr; current->thread.trap_nr =UPROBE_TRAP_NR ; regs->cp0_epc = current->utask->xol_vaddr;
Greg Kroah-Hartman
maintainerPATCH 37/93 printk: fix parsing of "brl=" option
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolas Iooss <[email protected]>
commit ae6c33ba6e37eea3012fe2640b22400ef3f2d0f3 upstream.
Commit bbeddf52adc1 ("printk: move braille console support into separate braille.[ch] files") moved the parsing of braille-related options into _braille_console_setup(), changing the type of variable str from char* to char**. In this commit, memcmp(str, "brl,", 4) was correctly updated to memcmp(*str, "brl,", 4) but not memcmp(str, "brl=", 4).
Update the code to make "brl=" option work again and replace memcmp() with strncmp() to make the compiler able to detect such an issue.
--- kernel/printk/braille.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/printk/braille.c +2 -2
@@ -9,10 +9,10 @@char *_braille_console_setup (char **str,char **brl_options) { -if (!memcmp (*str,"brl," ,4 )) { +if (!strncmp (*str,"brl," ,4 )) { *brl_options ="" ; *str +=4 ; - }else if (!memcmp (str,"brl=" ,4 )) { + }else if (!strncmp (*str,"brl=" ,4 )) { *brl_options = *str +4 ; *str =strchr (*brl_options,',' );if (!*str)
Greg Kroah-Hartman
maintainerPATCH 38/93 tpm: fix byte-order for the value read by tpm2_get_tpm_pt
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: [email protected] <[email protected]>
commit 1b0612b04090e416828c0dd5ed197b0913d834a0 upstream.
The result must be converted from BE byte order, which is used by the TPM2 protocol. This has not popped out because tpm2_get_tpm_pt() has been only used for probing.
--- drivers/char/tpm/tpm2-cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm2-cmd.c +1 -1
@@ -657,7 +657,7 @@ ssize_t tpm2_get_tpm_pt(struct tpm_chip rc =tpm_transmit_cmd (chip, &cmd,sizeof (cmd), desc);if (!rc) - *value = cmd.params.get_tpm_pt_out.value; + *value =be32_to_cpu (cmd.params.get_tpm_pt_out.value);return rc; }
Greg Kroah-Hartman
maintainerPATCH 39/93 regulator: qcom_spmi: Add support for S4 supply on pm8941
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Boyd <[email protected]>
commit c333dfe8dba7d3e47e97e1cee3c38123e19ae73c upstream.
The S4 supply is sometimes called the boost regulator because it outputs 5V. Typically it's connected to the 5vs1 and 5vs2 switches for use in USB OTG and HDMI applications. Add support for this regulator which was mistakenly left out from the initial submission of this driver.
--- Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.txt | 4 ++-- drivers/regulator/qcom_spmi-regulator.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.txt +2 -2
@@ -81,8 +81,8 @@ pm8916: l14, l15, l16, l17, l18 pm8941: - s1, s2, s3, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, l14, - l15, l16, l17, l18, l19, l20, l21, l22, l23, l24, lvs1, lvs2, lvs3, + s1, s2, s3, s4, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, + l14, l15, l16, l17, l18, l19, l20, l21, l22, l23, l24, lvs1, lvs2, lvs3, mvs1, mvs2 The content of each sub-node is defined by the standard binding for regulators -
drivers/regulator/qcom_spmi-regulator.c +1 -0
@@ -1440,6 +1440,7 @@ static const struct spmi_regulator_data { "s1", 0x1400, "vdd_s1", }, { "s2", 0x1700, "vdd_s2", }, { "s3", 0x1a00, "vdd_s3", }, + { "s4", 0xa000, }, { "l1", 0x4000, "vdd_l1_l3", }, { "l2", 0x4100, "vdd_l2_lvs_1_2_3", }, { "l3", 0x4200, "vdd_l1_l3", },
Greg Kroah-Hartman
maintainerPATCH 40/93 regulator: qcom_spmi: Add support for get_mode/set_mode on switches
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Boyd <[email protected]>
commit 919163f6362ac23138d31fc8befdd52e5d7e488d upstream.
The voltage switches support mode switching, so add support for these ops to those types of regulators.
--- drivers/regulator/qcom_spmi-regulator.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/regulator/qcom_spmi-regulator.c +2 -0
@@ -1050,6 +1050,8 @@ static struct regulator_ops spmi_vs_ops .set_pull_down = spmi_regulator_common_set_pull_down, .set_soft_start = spmi_regulator_common_set_soft_start, .set_over_current_protection = spmi_regulator_vs_ocp, + .set_mode = spmi_regulator_common_set_mode, + .get_mode = spmi_regulator_common_get_mode, };static struct regulator_ops spmi_boost_ops = {
Greg Kroah-Hartman
maintainerPATCH 41/93 regulator: qcom_spmi: Update mvs1/mvs2 switches on pm8941
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Boyd <[email protected]>
commit 93bfe79b03365f410aa91caf04263173c008ecdf upstream.
The mvs1 and mvs2 switches are actually called 5vs1 and 5vs2 on some datasheets. Let's rename them to match the datasheets and also match the RPM based regulator driver which calls these by their 5vs names (see qcom_smd-regulator.c). There aren't any users of these regulators so far, so there aren't any concerns of DT ABI breakage here. While we're here making updates to the switches, also mandate usage of the OCP irq for these switches too.
--- Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.txt | 2 +- drivers/regulator/qcom_spmi-regulator.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.txt +1 -1
@@ -83,7 +83,7 @@ pm8916: pm8941: s1, s2, s3, s4, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, l14, l15, l16, l17, l18, l19, l20, l21, l22, l23, l24, lvs1, lvs2, lvs3, - mvs1, mvs2 + 5vs1, 5vs2 The content of each sub-node is defined by the standard binding for regulators - see regulator.txt - with additional custom properties described below:
drivers/regulator/qcom_spmi-regulator.c +2 -2
@@ -1470,8 +1470,8 @@ static const struct spmi_regulator_data { "lvs1", 0x8000, "vdd_l2_lvs_1_2_3", }, { "lvs2", 0x8100, "vdd_l2_lvs_1_2_3", }, { "lvs3", 0x8200, "vdd_l2_lvs_1_2_3", }, - { "mvs1", 0x8300, "vin_5vs", }, - { "mvs2", 0x8400, "vin_5vs", }, + { "5vs1", 0x8300, "vin_5vs", "ocp-5vs1", }, + { "5vs2", 0x8400, "vin_5vs", "ocp-5vs2", }, { } };
Greg Kroah-Hartman
maintainerPATCH 42/93 regulator: qcom_smd: Fix voltage ranges for pm8x41
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Boyd <[email protected]>
commit 290284776bb281759b11faa287b8abccaf74bfcb upstream.
The voltage ranges listed here are wrong. The correct ranges can be seen in the "native" spmi regulator driver qcom_spmi-regulator.c at pldo_ranges[], ftsmps_ranges[] and boost_ranges[] for the pldo, ftsmps, and boost type regulators. Port these ranges over to the RPM SMD regulator driver so that we list the appropriate set of supported voltages on pldos.
Doing this allows us to specify a voltage like 3075000 for l24, whereas before that wasn't a supported voltage.
--- drivers/regulator/qcom_smd-regulator.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/regulator/qcom_smd-regulator.c +9 -8
@@ -166,29 +166,30 @@ static const struct regulator_desc pm8x4static const struct regulator_desc pm8841_ftsmps = { .linear_ranges = (struct regulator_linear_range []) {REGULATOR_LINEAR_RANGE (350000 ,0 ,184 ,5000 ), -REGULATOR_LINEAR_RANGE (700000 ,185 ,339 ,10000 ), +REGULATOR_LINEAR_RANGE (1280000 ,185 ,261 ,10000 ), }, .n_linear_ranges =2 , - .n_voltages =340 , + .n_voltages =262 , .ops = &rpm_smps_ldo_ops, };static const struct regulator_desc pm8941_boost = { .linear_ranges = (struct regulator_linear_range []) { -REGULATOR_LINEAR_RANGE (4000000 ,0 ,15 ,100000 ), +REGULATOR_LINEAR_RANGE (4000000 ,0 ,30 ,50000 ), }, .n_linear_ranges =1 , - .n_voltages =16 , + .n_voltages =31 , .ops = &rpm_smps_ldo_ops, };static const struct regulator_desc pm8941_pldo = { .linear_ranges = (struct regulator_linear_range []) { -REGULATOR_LINEAR_RANGE (750000 ,0 ,30 ,25000 ), -REGULATOR_LINEAR_RANGE (1500000 ,31 ,99 ,50000 ), +REGULATOR_LINEAR_RANGE (750000 ,0 ,63 ,12500 ), +REGULATOR_LINEAR_RANGE (1550000 ,64 ,126 ,25000 ), +REGULATOR_LINEAR_RANGE (3100000 ,127 ,163 ,50000 ), }, - .n_linear_ranges =2 , - .n_voltages =100 , + .n_linear_ranges =3 , + .n_voltages =164 , .ops = &rpm_smps_ldo_ops, };
Greg Kroah-Hartman
maintainerPATCH 44/93 ARM: sa1100: register clocks early
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Russell King <[email protected]>
commit 198b51e8a6a31d3a6f8e9dd9cade3635d0291f26 upstream.
Since we switched to use pxa_timer, we need to provide the OSTIMER0 clock. However, as the clock is initialised early, we need to provide the clock early as well, so that pxa_timer can find it. Adding the clock to the clkdev table at core_initcall() time is way too late.
Move the initialisation earlier.
--- arch/arm/mach-sa1100/clock.c | 3 +-- arch/arm/mach-sa1100/generic.c | 1 + arch/arm/mach-sa1100/generic.h | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-)
arch/arm/mach-sa1100/clock.c +1 -2
@@ -140,9 +140,8 @@ static struct clk_lookup sa11xx_clkregs[ CLKDEV_INIT(NULL, "OSTIMER0", &clk_36864), }; -static int __init sa11xx_clk_init (void ) +int __init sa11xx_clk_init (void ) {clkdev_add_table (sa11xx_clkregs,ARRAY_SIZE (sa11xx_clkregs));return 0 ; } -core_initcall (sa11xx_clk_init);
arch/arm/mach-sa1100/generic.c +1 -0
@@ -388,6 +388,7 @@ void __init sa1100_init_irq(void)sa11x0_init_irq_nodt (IRQ_GPIO0_SC , irq_resource.start);sa1100_init_gpio (); +sa11xx_clk_init (); }/*
arch/arm/mach-sa1100/generic.h +2 -0
@@ -44,3 +44,5 @@ int sa11x0_pm_init(void);#else static inline int sa11x0_pm_init (void ) {return 0 ; }#endif + +int sa11xx_clk_init (void );
Greg Kroah-Hartman
maintainerPATCH 45/93 ARM: sa1100: fix 3.6864MHz clock
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Russell King <[email protected]>
commit 02ba38a5b6d6e0bc89c7b74651f1873055028a56 upstream.
pxa_timer wants to be able to call clk_enable() etc on this clock, but our clk_enable() implementation expects non-NULL enable/disable operations. Provide these dummy implementations.
Unable to handle kernel NULL pointer dereference at virtual address 00000000 pgd = c0204000 [00000000] *pgd=00000000 Internal error: Oops: 80000005 [#1] ARM Modules linked in: CPU: 0 PID: 0 Comm: swapper Not tainted 4.8.0-rc2+ #887 Hardware name: Intel-Assabet task: c0644590 task.stack: c0640000 PC is at 0x0 LR is at clk_enable+0x40/0x58 pc : [<00000000>] lr : [<c021b178>] psr: 600000d3
sp : c0641f60 ip : c0641f4c fp : c0641f74
r10: c1ffc7a0 r9 : 6901b118 r8 : 00000001
r7 : c0639a34 r6 : 0000001b r5 : a00000d3 r4 : c0645d70 r3 : c0645d78 r2 : 00000001 r1 : c0641ef0 r0 : c0645d70
Flags: nZCv IRQs off FIQs off Mode SVC_32 ISA ARM Segment none
Control: c020717f Table: c020717f DAC: 00000053 Process swapper (pid: 0, stack limit = 0xc0640188)
Stack: (0xc0641f60 to 0xc0642000)
1f60: 00384000 c08762e4 c0641f98 c0641f78 c063308c c021b144 00000000 00000000 1f80: 00000000 c0660b20 ffffffff c0641fa8 c0641f9c c06220ec c0633058 c0641fb8 1fa0: c0641fac c061f114 c06220dc c0641ff4 c0641fbc c061bb68 c061f0fc ffffffff 1fc0: ffffffff 00000000 c061b6cc c0639a34 c0660cd4 c0642038 c0639a30 c0645434 1fe0: c0204000 c06380f8 00000000 c0641ff8 c0208048 c061b954 00000000 00000000
Backtrace: [<c021b138>] (clk_enable) from [<c063308c>] (pxa_timer_nodt_init+0x40/0x120) r5:c08762e4 r4:00384000 [<c063304c>] (pxa_timer_nodt_init) from [<c06220ec>] (sa1100_timer_init+0x1c/0x20) r6:ffffffff r5:c0660b20 r4:00000000 [<c06220d0>] (sa1100_timer_init) from [<c061f114>] (time_init+0x24/0x2c) [<c061f0f0>] (time_init) from [<c061bb68>] (start_kernel+0x220/0x42c) [<c061b948>] (start_kernel) from [<c0208048>] (0xc0208048) r10:c06380f8 r8:c0204000 r7:c0645434 r6:c0639a30 r5:c0642038 r4:c0660cd4 Code: bad PC value ---[ end trace 0000000000000000 ]--- Kernel panic - not syncing: Attempted to kill the idle task!
--- arch/arm/mach-sa1100/clock.c | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/mach-sa1100/clock.c +2 -0
@@ -125,6 +125,8 @@ static unsigned long clk_36864_get_rate( }static struct clkops clk_36864_ops = { + .enable = clk_cpu_enable, + .disable = clk_cpu_disable, .get_rate = clk_36864_get_rate, };
Greg Kroah-Hartman
maintainerPATCH 46/93 ARM: sa1100: clear reset status prior to reboot
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Russell King <[email protected]>
commit da60626e7d02a4f385cae80e450afc8b07035368 upstream.
Clear the current reset status prior to rebooting the platform. This adds the bit missing from 04fef228fb00 ("[ARM] pxa: introduce reset_status and clear_reset_status for driver's usage").
--- arch/arm/mach-sa1100/generic.c | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/mach-sa1100/generic.c +3 -0
@@ -34,6 +34,7 @@#include <mach/hardware.h> #include <mach/irqs.h> +#include <mach/reset.h> #include "generic.h" #include <clocksource/pxa.h>
@@ -95,6 +96,8 @@ static void sa1100_power_off(void)void sa11x0_restart (enum reboot_mode mode,const char *cmd) { +clear_reset_status (RESET_STATUS_ALL ); +if (mode ==REBOOT_SOFT ) {/* Jump into ROM at address 0 */ soft_restart (0 );
Greg Kroah-Hartman
maintainerPATCH 47/93 ARM: shmobile: fix regulator quirk for Gen2
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wolfram Sang <[email protected]>
commit c2f321126e31cd69365e65ecd4a7c774e4fc71d2 upstream.
The current implementation only works if the da9xxx devices are added before their drivers are registered. Only then it can apply the fixes to both devices. Otherwise, the driver for the first device gets probed before the fix for the second device can be applied. This is what fails when using the IP core switcher or when having the i2c master driver as a module.
So, we need to disable both da9xxx once we detected one of them. We now use i2c_transfer with hardcoded i2c_messages and device addresses, so we don't need the da9xxx client devices to be instantiated. Because the fixup is used on specific boards only, the addresses are not going to change.
--- arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c | 62 ++++++++------------- 1 file changed, 26 insertions(+), 36 deletions(-)
arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c +26 -36
@@ -41,39 +41,26 @@#define REGULATOR_IRQ_MASK BIT(2)/* IRQ2, active low */ -static void __iomem *irqc; - -static const u8 da9063_mask_regs[] = { -DA9063_REG_IRQ_MASK_A , -DA9063_REG_IRQ_MASK_B , -DA9063_REG_IRQ_MASK_C , -DA9063_REG_IRQ_MASK_D , -}; - -/* DA9210 System Control and Event Registers */ +/* start of DA9210 System Control and Event Registers */ #define DA9210_REG_MASK_A 0x54 -#define DA9210_REG_MASK_B 0x55 - -static const u8 da9210_mask_regs[] = { -DA9210_REG_MASK_A , -DA9210_REG_MASK_B , -}; -static void da9xxx_mask_irqs (struct i2c_client *client,const u8 regs[], -unsigned int nregs) -{ -unsigned int i; - -dev_info (&client->dev,"Masking %s interrupt sources\n" , client->name); +static void __iomem *irqc; -for (i =0 ; i < nregs; i++) { -int error =i2c_smbus_write_byte_data (client, regs[i], ~0 ); -if (error) { -dev_err (&client->dev,"i2c error %d\n" , error); -return ; - } - } -} +/* first byte sets the memory pointer, following are consecutive reg values */ +static u8 da9063_irq_clr[] = {DA9063_REG_IRQ_MASK_A ,0xff ,0xff ,0xff ,0xff }; +static u8 da9210_irq_clr[] = {DA9210_REG_MASK_A ,0xff ,0xff }; + +static struct i2c_msg da9xxx_msgs[2 ] = { + { + .addr =0x58 , + .len =ARRAY_SIZE (da9063_irq_clr), + .buf = da9063_irq_clr, + }, { + .addr =0x68 , + .len =ARRAY_SIZE (da9210_irq_clr), + .buf = da9210_irq_clr, + }, +};static int regulator_quirk_notify (struct notifier_block *nb,unsigned long action,void *data)
@@ -93,12 +80,15 @@ static int regulator_quirk_notify(struct client =to_i2c_client (dev);dev_dbg (dev,"Detected %s\n" , client->name); -if ((client->addr ==0x58 && !strcmp (client->name,"da9063" ))) -da9xxx_mask_irqs (client, da9063_mask_regs, -ARRAY_SIZE (da9063_mask_regs)); -else if (client->addr ==0x68 && !strcmp (client->name,"da9210" )) -da9xxx_mask_irqs (client, da9210_mask_regs, -ARRAY_SIZE (da9210_mask_regs)); +if ((client->addr ==0x58 && !strcmp (client->name,"da9063" )) || + (client->addr ==0x68 && !strcmp (client->name,"da9210" ))) { +int ret; + +dev_info (&client->dev,"clearing da9063/da9210 interrupts\n" ); + ret =i2c_transfer (client->adapter, da9xxx_msgs,ARRAY_SIZE (da9xxx_msgs)); +if (ret !=ARRAY_SIZE (da9xxx_msgs)) +dev_err (&client->dev,"i2c error %d\n" , ret); + } mon =ioread32 (irqc +IRQC_MONITOR );if (mon ®ULATOR_IRQ_MASK )
Greg Kroah-Hartman
maintainerPATCH 48/93 ARM: sa1111: fix pcmcia suspend/resume
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Russell King <[email protected]>
commit 06dfe5cc0cc684e735cb0232fdb756d30780b05d upstream.
SA1111 PCMCIA was broken when PCMCIA switched to using dev_pm_ops for the PCMCIA socket class. PCMCIA used to handle suspend/resume via the socket hosting device, which happened at normal device suspend/resume time.
However, the referenced commit changed this: much of the resume now happens much earlier, in the noirq resume handler of dev_pm_ops.
However, on SA1111, the PCMCIA device is not accessible as the SA1111 has not been resumed at _noirq time. It's slightly worse than that, because the SA1111 has already been put to sleep at _noirq time, so suspend doesn't work properly.
Fix this by converting the core SA1111 code to use dev_pm_ops as well, and performing its own suspend/resume at noirq time.
This fixes these errors in the kernel log:
pcmcia_socket pcmcia_socket0: time out after reset pcmcia_socket pcmcia_socket1: time out after reset
and the resulting lack of PCMCIA cards after a S2RAM cycle.
--- arch/arm/common/sa1111.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-)
arch/arm/common/sa1111.c +13 -9
@@ -869,9 +869,9 @@ struct sa1111_save_data {#ifdef CONFIG_PM -static int sa1111_suspend (struct platform_device *dev,pm_message_t state) +static int sa1111_suspend_noirq (struct device *dev) { -struct sa1111 *sachip =platform_get_drvdata (dev); +struct sa1111 *sachip =dev_get_drvdata (dev);struct sa1111_save_data *save;unsigned long flags;unsigned int val;
@@ -934,9 +934,9 @@ static int sa1111_suspend(struct platfor* restored by their respective drivers, and must be called * via LDM after this function. */ -static int sa1111_resume (struct platform_device *dev) +static int sa1111_resume_noirq (struct device *dev) { -struct sa1111 *sachip =platform_get_drvdata (dev); +struct sa1111 *sachip =dev_get_drvdata (dev);struct sa1111_save_data *save;unsigned long flags, id;void __iomem *base;
@@ -952,7 +952,7 @@ static int sa1111_resume(struct platform id =sa1111_readl (sachip->base +SA1111_SKID );if ((id &SKID_ID_MASK ) !=SKID_SA1111_ID ) {__sa1111_remove (sachip); -platform_set_drvdata (dev,NULL ); +dev_set_drvdata (dev,NULL );kfree (save);return 0 ; }
@@ -1003,8 +1003,8 @@ static int sa1111_resume(struct platform }#else -#define sa1111_suspend NULL -#define sa1111_resume NULL +#define sa1111_suspend_noirq NULL +#define sa1111_resume_noirq NULL#endif static int sa1111_probe (struct platform_device *pdev)
@@ -1038,6 +1038,11 @@ static int sa1111_remove(struct platformreturn 0 ; } +static struct dev_pm_ops sa1111_pm_ops = { + .suspend_noirq = sa1111_suspend_noirq, + .resume_noirq = sa1111_resume_noirq, +}; +/* * Not sure if this should be on the system bus or not yet. * We really want some way to register a system device at
@@ -1050,10 +1055,9 @@ static int sa1111_remove(struct platformstatic struct platform_driver sa1111_device_driver = { .probe = sa1111_probe, .remove = sa1111_remove, - .suspend = sa1111_suspend, - .resume = sa1111_resume, .driver = { .name ="sa1111" , + .pm = &sa1111_pm_ops, }, };
Greg Kroah-Hartman
maintainerPATCH 49/93 hwrng: omap - Fix assumption that runtime_get_sync will always succeed
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nishanth Menon <[email protected]>
commit 61dc0a446e5d08f2de8a24b45f69a1e302bb1b1b upstream.
pm_runtime_get_sync does return a error value that must be checked for error conditions, else, due to various reasons, the device maynot be enabled and the system will crash due to lack of clock to the hardware module.
Before:
12.562784] [00000000] *pgd=fe193835
12.562792] Internal error: : 1406 [#1] SMP ARM
[...]
12.562864] CPU: 1 PID: 241 Comm: modprobe Not tainted 4.7.0-rc4-next-20160624 #2 12.562867] Hardware name: Generic DRA74X (Flattened Device Tree) 12.562872] task: ed51f140 ti: ed44c000 task.ti: ed44c000
12.562886] PC is at omap4_rng_init+0x20/0x84 [omap_rng]
12.562899] LR is at set_current_rng+0xc0/0x154 [rng_core]
[...]
After the proper checks:
[ 94.366705] omap_rng 48090000.rng: _od_fail_runtime_resume: FIXME: missing hwmod/omap_dev info [ 94.375767] omap_rng 48090000.rng: Failed to runtime_get device -19 [ 94.382351] omap_rng 48090000.rng: initialization failed.
--- drivers/char/hw_random/omap-rng.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/char/hw_random/omap-rng.c +14 -2
@@ -384,7 +384,12 @@ static int omap_rng_probe(struct platfor }pm_runtime_enable (&pdev->dev); -pm_runtime_get_sync (&pdev->dev); + ret =pm_runtime_get_sync (&pdev->dev); +if (ret) { +dev_err (&pdev->dev,"Failed to runtime_get device: %d\n" , ret); +pm_runtime_put_noidle (&pdev->dev); + goto err_ioremap; + } ret = (dev->of_node) ?of_get_omap_rng_device_details (priv, pdev) :get_omap_rng_device_details (priv);
@@ -435,8 +440,15 @@ static int __maybe_unused omap_rng_suspestatic int __maybe_unused omap_rng_resume (struct device *dev) {struct omap_rng_dev *priv =dev_get_drvdata (dev); +int ret; + + ret =pm_runtime_get_sync (dev); +if (ret) { +dev_err (dev,"Failed to runtime_get device: %d\n" , ret); +pm_runtime_put_noidle (dev); +return ret; + } -pm_runtime_get_sync (dev); priv->pdata->init (priv);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 50/93 blk-mq: actually hook up defer list when running requests
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Omar Sandoval <[email protected]>
commit 52b9c330c6a8a4b5a1819bdaddf4ec76ab571e81 upstream.
If ->queue_rq() returns BLK_MQ_RQ_QUEUE_OK, we use continue and skip over the rest of the loop body. However, dptr is assigned later in the loop body, and the BLK_MQ_RQ_QUEUE_OK case is exactly the case that we'd want it for.
NVMe isn't actually using BLK_MQ_F_DEFER_ISSUE yet, nor is any other in-tree driver, but if the code's going to be there, it might as well work.
--- block/blk-mq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block/blk-mq.c +1 -1
@@ -780,7 +780,7 @@ static void __blk_mq_run_hw_queue(structswitch (ret) {case BLK_MQ_RQ_QUEUE_OK : queued++; -continue ; +break ;case BLK_MQ_RQ_QUEUE_BUSY :list_add (&rq->queuelist, &rq_list);__blk_mq_requeue_request (rq);
Greg Kroah-Hartman
maintainerPATCH 51/93 pstore: drop file opened reference count
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geliang Tang <[email protected]>
commit 52d210d961a62a9662e27f14d6505d6741b2fb02 upstream.
In ee1d267423a1 ("pstore: add pstore unregister") I added:
.owner = THIS_MODULE,
in both pstore_fs_type and pstore_file_operations to increase a reference count when pstore filesystem is mounted and pstore file is opened.
But, it's repetitive. There is no need to increase the opened reference count. We only need to increase the mounted reference count. When a file is opened, the filesystem can't be unmounted. Hence the pstore module can't be unloaded either.
So I drop the opened reference count in this patch.
--- fs/pstore/inode.c | 1 - 1 file changed, 1 deletion(-)
fs/pstore/inode.c +0 -1
@@ -178,7 +178,6 @@ static loff_t pstore_file_llseek(struct }static const struct file_operations pstore_file_operations = { - .owner =THIS_MODULE , .open = pstore_file_open, .read = pstore_file_read, .llseek = pstore_file_llseek,
Greg Kroah-Hartman
maintainerPATCH 52/93 tile: Define AT_VECTOR_SIZE_ARCH for ARCH_DLINFO
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Hogan <[email protected]>
commit cdf8b4633075f2171d440d2e37c9c2609019a81a upstream.
AT_VECTOR_SIZE_ARCH should be defined with the maximum number of NEW_AUX_ENT entries that ARCH_DLINFO can contain, but it wasn't defined for tile at all even though ARCH_DLINFO will contain one NEW_AUX_ENT for the VDSO address.
This shouldn't be a problem as AT_VECTOR_SIZE_BASE includes space for AT_BASE_PLATFORM which tile doesn't use, but lets define it now and add the comment above ARCH_DLINFO as found in several other architectures to remind future modifiers of ARCH_DLINFO to keep AT_VECTOR_SIZE_ARCH up to date.
--- arch/tile/include/asm/elf.h | 1 + arch/tile/include/uapi/asm/auxvec.h | 2 ++ 2 files changed, 3 insertions(+)
arch/tile/include/asm/elf.h +1 -0
@@ -129,6 +129,7 @@ extern int dump_task_regs(struct task_ststruct linux_binprm ;extern int arch_setup_additional_pages (struct linux_binprm *bprm,int executable_stack); +/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */ #define ARCH_DLINFO \ do { \ NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_BASE); \
arch/tile/include/uapi/asm/auxvec.h +2 -0
@@ -18,4 +18,6 @@/* The vDSO location. */ #define AT_SYSINFO_EHDR 33 +#define AT_VECTOR_SIZE_ARCH 1/* entries in ARCH_DLINFO */ +#endif /* _ASM_TILE_AUXVEC_H */
Greg Kroah-Hartman
maintainerPATCH 53/93 iwlmvm: mvm: set correct state in smart-fifo configuration
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: striebit <[email protected]>
commit 849a9627299100ae3f0ce573fc87d2b476f3bb59 upstream.
Currently the state sent in SF configuration is always FULL_ON.
This commit sets the correct state (e.g. INIT_OFF when station is not associated).
--- drivers/net/wireless/iwlwifi/mvm/sf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/iwlwifi/mvm/sf.c +1 -1
@@ -215,7 +215,7 @@ static int iwl_mvm_sf_config(struct iwl_ enum iwl_sf_state new_state) {struct iwl_sf_cfg_cmd sf_cmd = { - .state =cpu_to_le32 (SF_FULL_ON ), + .state =cpu_to_le32 (new_state), };struct ieee80211_sta *sta;int ret =0 ;
Greg Kroah-Hartman
maintainerPATCH 55/93 em28xx-i2c: rt_mutex_trylock() returns zero on failure
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit e44c153b30c9a0580fc2b5a93f3c6d593def2278 upstream.
The code is checking for negative returns but it should be checking for zero.
--- drivers/media/usb/em28xx/em28xx-i2c.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/media/usb/em28xx/em28xx-i2c.c +2 -3
@@ -507,9 +507,8 @@ static int em28xx_i2c_xfer(struct i2c_adif (dev->disconnected)return -ENODEV ; - rc =rt_mutex_trylock (&dev->i2c_bus_lock); -if (rc <0 ) -return rc; +if (!rt_mutex_trylock (&dev->i2c_bus_lock)) +return -EAGAIN ;/* Switch I2C bus if needed */ if (bus != dev->cur_i2c_bus &&
Greg Kroah-Hartman
maintainerPATCH 56/93 gspca: avoid unused variable warnings
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit d7e92e15e92fc987640772bf110586898b5f15aa upstream.
When CONFIG_INPUT is disabled, multiple gspca backend drivers print compile-time warnings about unused variables:
media/usb/gspca/cpia1.c: In function 'sd_stopN':media/usb/gspca/cpia1.c:1627:13: error: unused variable 'sd' [-Werror=unused-variable] media/usb/gspca/konica.c: In function 'sd_stopN':media/usb/gspca/konica.c:246:13: error: unused variable 'sd' [-Werror=unused-variable]
This annotates the variables as __maybe_unused, to let the compiler know that they are declared intentionally.
--- drivers/media/usb/gspca/cpia1.c | 2 +- drivers/media/usb/gspca/konica.c | 2 +- drivers/media/usb/gspca/t613.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/media/usb/gspca/cpia1.c +1 -1
@@ -1624,7 +1624,7 @@ static int sd_start(struct gspca_dev *gsstatic void sd_stopN (struct gspca_dev *gspca_dev) { -struct sd *sd = (struct sd *) gspca_dev; +struct sd *sd__maybe_unused = (struct sd *) gspca_dev;command_pause (gspca_dev);
drivers/media/usb/gspca/konica.c +1 -1
@@ -243,7 +243,7 @@ static int sd_start(struct gspca_dev *gsstatic void sd_stopN (struct gspca_dev *gspca_dev) { -struct sd *sd = (struct sd *) gspca_dev; +struct sd *sd__maybe_unused = (struct sd *) gspca_dev;konica_stream_off (gspca_dev);#if IS_ENABLED (CONFIG_INPUT )
drivers/media/usb/gspca/t613.c +1 -1
@@ -837,7 +837,7 @@ static void sd_pkt_scan(struct gspca_dev u8 *data, /* isoc packet */ int len) /* iso packet length */ { -struct sd *sd = (struct sd *) gspca_dev; +struct sd *sd__maybe_unused = (struct sd *) gspca_dev;int pkt_type;if (data[0 ] ==0x5a ) {
Greg Kroah-Hartman
maintainerPATCH 57/93 ath9k: Fix programming of minCCA power threshold
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sven Eckelmann <[email protected]>
commit aaab50fcea78ae3414c3afc25aae8d0603df34d0 upstream.
The function ar9003_hw_apply_minccapwr_thresh takes as second parameter not a pointer to the channel but a boolean value describing whether the channel is 2.4GHz or not. This broke (according to the origin commit) the ETSI regulatory compliance on 5GHz channels.
--- drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +1 -1
@@ -4176,7 +4176,7 @@ static void ath9k_hw_ar9300_set_board_vaif (!AR_SREV_9330 (ah) && !AR_SREV_9340 (ah) && !AR_SREV_9531 (ah))ar9003_hw_internal_regulator_apply (ah);ar9003_hw_apply_tuning_caps (ah); -ar9003_hw_apply_minccapwr_thresh (ah, chan); +ar9003_hw_apply_minccapwr_thresh (ah, is2ghz);ar9003_hw_txend_to_xpa_off_apply (ah, is2ghz);ar9003_hw_thermometer_apply (ah);ar9003_hw_thermo_cal_apply (ah);
Greg Kroah-Hartman
maintainerPATCH 58/93 avr32: off by one in at32_init_pio()
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit 55f1cf83d5cf885c75267269729805852039c834 upstream.
The pio_dev[] array has MAX_NR_PIO_DEVICES elements so the > should be
Quoted 1 line
=.
--- arch/avr32/mach-at32ap/pio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/avr32/mach-at32ap/pio.c +1 -1
@@ -435,7 +435,7 @@ void __init at32_init_pio(struct platforstruct resource *regs;struct pio_device *pio; -if (pdev->id >MAX_NR_PIO_DEVICES ) { +if (pdev->id >=MAX_NR_PIO_DEVICES ) {dev_err (&pdev->dev,"only %d PIO devices supported\n" ,MAX_NR_PIO_DEVICES );return ;
Greg Kroah-Hartman
maintainerPATCH 59/93 fnic: pci_dma_mapping_error() doesnt return an error code
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit dd7328e4c53649c1c7ec36bc1cf5b229b8662047 upstream.
pci_dma_mapping_error() returns true on error and false on success.
--- drivers/scsi/fnic/fnic_fcs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/scsi/fnic/fnic_fcs.c +4 -4
@@ -954,8 +954,8 @@ int fnic_alloc_rq_frame(struct vnic_rq *skb_put (skb, len); pa =pci_map_single (fnic->pdev, skb->data, len,PCI_DMA_FROMDEVICE ); - r =pci_dma_mapping_error (fnic->pdev, pa); -if (r) { +if (pci_dma_mapping_error (fnic->pdev, pa)) { + r = -ENOMEM ;printk (KERN_ERR "PCI mapping failed with error %d\n" , r); goto free_skb; }
@@ -1093,8 +1093,8 @@ static int fnic_send_frame(struct fnic * pa =pci_map_single (fnic->pdev, eth_hdr, tot_len,PCI_DMA_TODEVICE ); - ret =pci_dma_mapping_error (fnic->pdev, pa); -if (ret) { +if (pci_dma_mapping_error (fnic->pdev, pa)) { + ret = -ENOMEM ;printk (KERN_ERR "DMA map failed with error %d\n" , ret); goto free_skb_on_err; }
Greg Kroah-Hartman
maintainerPATCH 60/93 dmaengine: at_xdmac: fix debug string
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexandre Belloni <[email protected]>
commit 3935e08768ff777da6496521b1fc36f72823672c upstream.
mbr_ds is an integer, don't use %pad to print it.
--- drivers/dma/at_xdmac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/dma/at_xdmac.c +2 -2
@@ -1183,8 +1183,8 @@ static struct at_xdmac_desc *at_xdmac_me desc->lld.mbr_cfg = chan_cc;dev_dbg (chan2dev (chan), -"%s: lld: mbr_da=%pad, mbr_ds=%pad, mbr_ubc=0x%08x, mbr_cfg=0x%08x\n" , - __func__, &desc->lld.mbr_da, &desc->lld.mbr_ds, desc->lld.mbr_ubc, +"%s: lld: mbr_da=%pad, mbr_ds=0x%08x, mbr_ubc=0x%08x, mbr_cfg=0x%08x\n" , + __func__, &desc->lld.mbr_da, desc->lld.mbr_ds, desc->lld.mbr_ubc, desc->lld.mbr_cfg);return desc;
Greg Kroah-Hartman
maintainerPATCH 61/93 svc: Avoid garbage replies when pc_func() returns rpc_drop_reply
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chuck Lever <[email protected]>
commit 0533b13072f4bf35738290d2cf9e299c7bc6c42a upstream.
If an RPC program does not set vs_dispatch and pc_func() returns rpc_drop_reply, the server sends a reply anyway containing a single word containing the value RPC_DROP_REPLY (in network byte-order, of course). This is a nonsense RPC message.
--- net/sunrpc/svc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/sunrpc/svc.c +2 -1
@@ -1188,7 +1188,8 @@ svc_process_common(struct svc_rqst *rqst *statp = procp->pc_func (rqstp, rqstp->rq_argp, rqstp->rq_resp);/* Encode reply */ -if (test_bit (RQ_DROPME , &rqstp->rq_flags)) { +if (*statp == rpc_drop_reply || +test_bit (RQ_DROPME , &rqstp->rq_flags)) {if (procp->pc_release) procp->pc_release (rqstp,NULL , rqstp->rq_resp); goto dropit;
Greg Kroah-Hartman
maintainerPATCH 62/93 NFS: Dont drop CB requests with invalid principals
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chuck Lever <[email protected]>
commit a4e187d83d88eeaba6252aac0a2ffe5eaa73a818 upstream.
Before commit 778be232a207 ("NFS do not find client in NFSv4 pg_authenticate"), the Linux callback server replied with RPC_AUTH_ERROR / RPC_AUTH_BADCRED, instead of dropping the CB request. Let's restore that behavior so the server has a chance to do something useful about it, and provide a warning that helps admins correct the problem.
--- fs/nfs/callback_xdr.c | 6 +++++- net/sunrpc/svc.c | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-)
fs/nfs/callback_xdr.c +5 -1
@@ -912,7 +912,7 @@ static __be32 nfs4_callback_compound(strif (hdr_arg.minorversion ==0 ) { cps.clp =nfs4_find_client_ident (SVC_NET (rqstp), hdr_arg.cb_ident);if (!cps.clp || !check_gss_callback_principal (cps.clp, rqstp)) -return rpc_drop_reply; + goto out_invalidcred; } cps.minorversion = hdr_arg.minorversion;
@@ -940,6 +940,10 @@ static __be32 nfs4_callback_compound(strnfs_put_client (cps.clp);dprintk ("%s: done, status = %u\n" , __func__,ntohl (status));return rpc_success; + +out_invalidcred: +pr_warn_ratelimited ("NFS: NFSv4 callback contains invalid cred\n" ); +return rpc_autherr_badcred; }/*
net/sunrpc/svc.c +5 -0
@@ -1194,6 +1194,11 @@ svc_process_common(struct svc_rqst *rqst procp->pc_release (rqstp,NULL , rqstp->rq_resp); goto dropit; } +if (*statp == rpc_autherr_badcred) { +if (procp->pc_release) + procp->pc_release (rqstp,NULL , rqstp->rq_resp); + goto err_bad_auth; + }if (*statp == rpc_success && (xdr = procp->pc_encode) && !xdr (rqstp, resv->iov_base+resv->iov_len, rqstp->rq_resp)) {
Greg Kroah-Hartman
maintainerPATCH 63/93 pNFS/files: Fix layoutcommit after a commit to DS
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
commit 73e6c5d854d3f7f75e8b46d3e54aeb5d83fe6b1f upstream.
According to the errata
https://www.rfc-editor.org/errata_search.php?rfc=5661&eid=2751
we should always send layout commit after a commit to DS.
--- fs/nfs/filelayout/filelayout.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/nfs/filelayout/filelayout.c +1 -2
@@ -374,8 +374,7 @@ static int filelayout_commit_done_cb(strreturn -EAGAIN ; } -if (data->verf.committed ==NFS_UNSTABLE ) -pnfs_set_layoutcommit (data->inode, data->lseg, data->lwb); +pnfs_set_layoutcommit (data->inode, data->lseg, data->lwb);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 64/93 pNFS/flexfiles: Fix layoutcommit after a commit to DS
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
commit c001c87a63aa2f35358e33eb05e45e4cbcb34f54 upstream.
We should always do a layoutcommit after commit to DS, except if the layout segment we're using has set FF_FLAGS_NO_LAYOUTCOMMIT.
--- fs/nfs/flexfilelayout/flexfilelayout.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/nfs/flexfilelayout/flexfilelayout.c +1 -2
@@ -1414,8 +1414,7 @@ static int ff_layout_commit_done_cb(strureturn -EAGAIN ; } -if (data->verf.committed ==NFS_UNSTABLE - &&ff_layout_need_layoutcommit (data->lseg)) +if (ff_layout_need_layoutcommit (data->lseg))pnfs_set_layoutcommit (data->inode, data->lseg, data->lwb);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 65/93 ASoC: Intel: Skylake: Fix error return code in skl_probe()
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Yongjun <[email protected]>
commit 979cf59acc9d634cc140aadd0d2915947ab303cc upstream.
Fix to return error code -ENODEV from the error handling case instead of 0, as done elsewhere in this function.
--- sound/soc/intel/skylake/skl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/intel/skylake/skl.c +3 -1
@@ -464,8 +464,10 @@ static int skl_probe(struct pci_dev *pci skl->nhlt =skl_nhlt_init (bus->dev); -if (skl->nhlt ==NULL ) +if (skl->nhlt ==NULL ) { + err = -ENODEV ; goto out_free; + }pci_set_drvdata (skl->pci, ebus);
Greg Kroah-Hartman
maintainerPATCH 66/93 brcmfmac: Fix glob_skb leak in brcmf_sdiod_recv_chain
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Fainelli <[email protected]>
commit 3bdae810721b33061d2e541bd78a70f86ca42af3 upstream.
In case brcmf_sdiod_recv_chain() cannot complete a succeful call to brcmf_sdiod_buffrw, we would be leaking glom_skb and not free it as we should, fix this.
--- drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +3 -1
@@ -726,8 +726,10 @@ int brcmf_sdiod_recv_chain(struct brcmf_return -ENOMEM ; err =brcmf_sdiod_buffrw (sdiodev,SDIO_FUNC_2 , false, addr, glom_skb); -if (err) +if (err) { +brcmu_pkt_buf_free_skb (glom_skb); goto done; + } skb_queue_walk(pktq, skb) {memcpy (skb->data, glom_skb->data, skb->len);
Greg Kroah-Hartman
maintainerPATCH 67/93 brcmsmac: Free packet if dma_mapping_error() fails in dma_rxfill
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Fainelli <[email protected]>
commit 5c5fa1f464ac954982df1d96b9f9a5103d21aedd upstream.
In case dma_mapping_error() returns an error in dma_rxfill, we would be leaking a packet that we allocated with brcmu_pkt_buf_get_skb().
--- drivers/net/wireless/brcm80211/brcmsmac/dma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/brcm80211/brcmsmac/dma.c +3 -1
@@ -1079,8 +1079,10 @@ bool dma_rxfill(struct dma_pub *pub) pa =dma_map_single (di->dmadev, p->data, di->rxbufsize,DMA_FROM_DEVICE ); -if (dma_mapping_error (di->dmadev, pa)) +if (dma_mapping_error (di->dmadev, pa)) { +brcmu_pkt_buf_free_skb (p);return false; + }/* save the free packet pointer */ di->rxp[rxout] = p;
Greg Kroah-Hartman
maintainerPATCH 68/93 brcmsmac: Initialize power in brcms_c_stf_ss_algo_channel_get()
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Fainelli <[email protected]>
commit f823a2aa8f4674c095a5413b9e3ba12d82df06f2 upstream.
wlc_phy_txpower_get_current() does a logical OR of power->flags, which presumes that power.flags was initiliazed earlier by the caller, unfortunately, this is not the case, so make sure we zero out the struct tx_power before calling into wlc_phy_txpower_get_current().
--- drivers/net/wireless/brcm80211/brcmsmac/stf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/brcm80211/brcmsmac/stf.c +1 -1
@@ -87,7 +87,7 @@ void brcms_c_stf_ss_algo_channel_get(struct brcms_c_info *wlc, u16 *ss_algo_channel, u16 chanspec) { - struct tx_power power; + struct tx_power power = { };u8 siso_mcs_id, cdd_mcs_id, stbc_mcs_id;/* Clear previous settings */
Greg Kroah-Hartman
maintainerPATCH 69/93 powerpc/prom: Fix sub-processor option passed to ibm, client-architecture-support
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Ellerman <[email protected]>
commit 66443efa83dc73775100b7442962ce2cb0d4472e upstream.
When booting from an OpenFirmware which supports it, we use the "ibm,client-architecture-support" firmware call to communicate our capabilities to firmware.
The format of the structure we pass to firmware is specified in PAPR (Power Architecture Platform Requirements), or the public version LoPAPR (Linux on Power Architecture Platform Reference).
Referring to table 244 in LoPAPR v1.1, option vector 5 contains a 4 byte field at bytes 17-20 for the "Platform Facilities Enable". This is followed by a 1 byte field at byte 21 for "Sub-Processor Represenation Level".
Comparing to the code, there we have the Platform Facilities options (OV5_PFO_*) at byte 17, but we fail to pad that field out to its full width of 4 bytes. This means the OV5_SUB_PROCESSORS option is incorrectly placed at byte 18.
Fix it by adding zero bytes for bytes 18, 19, 20, and comment the bytes to hopefully make it clearer in future.
As far as I'm aware nothing actually consumes this value at this time, so the effect of this bug is nil in practice.
It does mean we've been incorrectly setting bit 15 of the "Platform Facilities Enable" option for the past ~3 1/2 years, so we should avoid allocating that bit to anything else in future.
--- arch/powerpc/kernel/prom_init.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
arch/powerpc/kernel/prom_init.c +6 -3
@@ -694,7 +694,7 @@ unsigned char ibm_architecture_vec[] = {OV4_MIN_ENT_CAP ,/* minimum VP entitled capacity */ /* option vector 5: PAPR/OF options */ -VECTOR_LENGTH (18 ),/* length */ +VECTOR_LENGTH (21 ),/* length */ 0 ,/* don't ignore, don't halt */ OV5_FEAT (OV5_LPAR ) |OV5_FEAT (OV5_SPLPAR ) |OV5_FEAT (OV5_LARGE_PAGES ) | OV5_FEAT(OV5_DRCONF_MEMORY) | OV5_FEAT(OV5_DONATE_DEDICATE_CPU) |
@@ -725,8 +725,11 @@ unsigned char ibm_architecture_vec[] = {0 ,0 ,OV5_FEAT (OV5_PFO_HW_RNG ) |OV5_FEAT (OV5_PFO_HW_ENCR ) | -OV5_FEAT (OV5_PFO_HW_842 ), -OV5_FEAT (OV5_SUB_PROCESSORS ), +OV5_FEAT (OV5_PFO_HW_842 ),/* Byte 17 */ +0 ,/* Byte 18 */ +0 ,/* Byte 19 */ +0 ,/* Byte 20 */ +OV5_FEAT (OV5_SUB_PROCESSORS ),/* Byte 21 */ /* option vector 6: IBM PAPR hints */ VECTOR_LENGTH(3), /* length */
Greg Kroah-Hartman
maintainerPATCH 70/93 sysctl: handle error writing UINT_MAX to u32 fields
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Subash Abhinov Kasiviswanathan <[email protected]>
commit e7d316a02f683864a12389f8808570e37fb90aa3 upstream.
We have scripts which write to certain fields on 3.18 kernels but this seems to be failing on 4.4 kernels. An entry which we write to here is xfrm_aevent_rseqth which is u32.
echo 4294967295 > /proc/sys/net/core/xfrm_aevent_rseqth
Commit 230633d109e3 ("kernel/sysctl.c: detect overflows when converting to int") prevented writing to sysctl entries when integer overflow occurs. However, this does not apply to unsigned integers.
Heinrich suggested that we introduce a new option to handle 64 bit limits and set min as 0 and max as UINT_MAX. This might not work as it leads to issues similar to __do_proc_doulongvec_minmax. Alternatively, we would need to change the datatype of the entry to 64 bit.
static int __do_proc_doulongvec_minmax(void *data, struct ctl_table
{
i = (unsigned long *) data; //This cast is causing to read beyond the size of data (u32)
vleft = table->maxlen / sizeof(unsigned long); //vleft is 0 because maxlen is sizeof(u32) which is lesser than sizeof(unsigned long) on x86_64.
Introduce a new proc handler proc_douintvec. Individual proc entries will need to be updated to use the new handler.
--- include/linux/sysctl.h | 2 ++ kernel/sysctl.c | 45 +++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 2 deletions(-)
include/linux/sysctl.h +2 -0
@@ -41,6 +41,8 @@ extern int proc_dostring(struct ctl_tabl void __user *, size_t *, loff_t *);extern int proc_dointvec (struct ctl_table *,int ,void __user *,size_t *,loff_t *); +extern int proc_douintvec (struct ctl_table *,int , +void __user *,size_t *,loff_t *);extern int proc_dointvec_minmax (struct ctl_table *,int ,void __user *,size_t *,loff_t *); extern int proc_dointvec_jiffies(struct ctl_table *, int,
kernel/sysctl.c +43 -2
69 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 71/93 ASoC: omap-mcpdm: Fix irq resource handling
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Ujfalusi <[email protected]>
commit a8719670687c46ed2e904c0d05fa4cd7e4950cd1 upstream.
Managed irq request will not doing any good in ASoC probe level as it is not going to free up the irq when the driver is unbound from the sound card.
--- sound/soc/omap/omap-mcpdm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
sound/soc/omap/omap-mcpdm.c +3 -2
@@ -390,8 +390,8 @@ static int omap_mcpdm_probe(struct snd_spm_runtime_get_sync (mcpdm->dev);omap_mcpdm_write (mcpdm,MCPDM_REG_CTRL ,0x00 ); - ret =devm_request_irq (mcpdm->dev, mcpdm->irq, omap_mcpdm_irq_handler, -0 ,"McPDM" , (void *)mcpdm); + ret =request_irq (mcpdm->irq, omap_mcpdm_irq_handler,0 ,"McPDM" , + (void *)mcpdm);pm_runtime_put_sync (mcpdm->dev);
@@ -416,6 +416,7 @@ static int omap_mcpdm_remove(struct snd_ {struct omap_mcpdm *mcpdm =snd_soc_dai_get_drvdata (dai); +free_irq (mcpdm->irq, (void *)mcpdm);pm_runtime_disable (mcpdm->dev);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 72/93 kernel/fork: fix CLONE_CHILD_CLEARTID regression in nscd
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Hocko <[email protected]>
commit 735f2770a770156100f534646158cb58cb8b2939 upstream.
Commit fec1d0115240 ("[PATCH] Disable CLONE_CHILD_CLEARTID for abnormal exit") has caused a subtle regression in nscd which uses CLONE_CHILD_CLEARTID to clear the nscd_certainly_running flag in the shared databases, so that the clients are notified when nscd is restarted. Now, when nscd uses a non-persistent database, clients that have it mapped keep thinking the database is being updated by nscd, when in fact nscd has created a new (anonymous) one (for non-persistent databases it uses an unlinked file as backend).
The original proposal for the CLONE_CHILD_CLEARTID change claimed
(https://lkml.org/lkml/2006/10/25/233):
: The NPTL library uses the CLONE_CHILD_CLEARTID flag on clone() syscalls : on behalf of pthread_create() library calls. This feature is used to : request that the kernel clear the thread-id in user space (at an address : provided in the syscall) when the thread disassociates itself from the : address space, which is done in mm_release().
:
: Unfortunately, when a multi-threaded process incurs a core dump (such as : from a SIGSEGV), the core-dumping thread sends SIGKILL signals to all of : the other threads, which then proceed to clear their user-space tids : before synchronizing in exit_mm() with the start of core dumping. This : misrepresents the state of process's address space at the time of the : SIGSEGV and makes it more difficult for someone to debug NPTL and glibc : problems (misleading him/her to conclude that the threads had gone away : before the fault).
:
: The fix below is to simply avoid the CLONE_CHILD_CLEARTID action if a : core dump has been initiated.
The resulting patch from Roland (https://lkml.org/lkml/2006/10/26/269)
seems to have a larger scope than the original patch asked for. It seems that limitting the scope of the check to core dumping should work for SIGSEGV issue describe above.
--- kernel/fork.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
kernel/fork.c +4 -6
@@ -901,14 +901,12 @@ void mm_release(struct task_struct *tsk,deactivate_mm (tsk, mm);/* -* If we're exiting normally, clear a user-space tid field if -* requested. We leave this alone when dying by signal, to leave -* the value intact in a core dump, and to save the unnecessary -* trouble, say, a killed vfork parent shouldn't touch this mm. -* Userland only wants this done for a sys_exit. +* Signal userspace if we're not exiting with a core dump +* because we want to leave the value intact for debugging +* purposes. */ if (tsk->clear_child_tid) { -if (!(tsk->flags &PF_SIGNALED ) && +if (!(tsk->signal->flags &SIGNAL_GROUP_COREDUMP ) &&atomic_read (&mm->mm_users) >1 ) {/* * We don't check the error code - if userspace has
Greg Kroah-Hartman
maintainerPATCH 73/93 dmaengine: at_xdmac: fix to pass correct device identity to free_irq()
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Yongjun <[email protected]>
commit 6a8b0c6b18f62a277ffb2139d0c0253fe35d7feb upstream.
free_irq() expects the same device identity that was passed to corresponding request_irq(), otherwise the IRQ is not freed.
--- drivers/dma/at_xdmac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/dma/at_xdmac.c +2 -2
@@ -2055,7 +2055,7 @@ err_dma_unregister: err_clk_disable:clk_disable_unprepare (atxdmac->clk); err_free_irq: -free_irq (atxdmac->irq, atxdmac->dma.dev); +free_irq (atxdmac->irq, atxdmac);return ret; }
@@ -2071,7 +2071,7 @@ static int at_xdmac_remove(struct platfosynchronize_irq (atxdmac->irq); -free_irq (atxdmac->irq, atxdmac->dma.dev); +free_irq (atxdmac->irq, atxdmac);for (i =0 ; i < atxdmac->dma.chancnt; i++) {struct at_xdmac_chan *atchan = &atxdmac->chan[i];
Greg Kroah-Hartman
maintainerPATCH 75/93 IB/ipoib: Fix memory corruption in ipoib cm mode connect flow
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Erez Shitrit <[email protected]>
commit 546481c2816ea3c061ee9d5658eb48070f69212e upstream.
When a new CM connection is being requested, ipoib driver copies data from the path pointer in the CM/tx object, the path object might be invalid at the point and memory corruption will happened later when now the CM driver will try using that data.
The next scenario demonstrates it:
neigh_add_path --> ipoib_cm_create_tx --> queue_work (pointer to path is in the cm/tx struct) #while the work is still in the queue, #the port goes down and causes the ipoib_flush_paths: ipoib_flush_paths --> path_free --> kfree(path) #at this point the work scheduled starts. ipoib_cm_tx_start --> copy from the (invalid)path pointer: (memcpy(&pathrec, &p->path->pathrec, sizeof pathrec);) -> memory corruption.
To fix that the driver now starts the CM/tx connection only if that specific path exists in the general paths database.
This check is protected with the relevant locks, and uses the gid from the neigh member in the CM/tx object which is valid according to the ref count that was taken by the CM/tx.
--- drivers/infiniband/ulp/ipoib/ipoib.h | 1 + drivers/infiniband/ulp/ipoib/ipoib_cm.c | 16 ++++++++++++++++ drivers/infiniband/ulp/ipoib/ipoib_main.c | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-)
drivers/infiniband/ulp/ipoib/ipoib.h +1 -0
@@ -472,6 +472,7 @@ void ipoib_send(struct net_device *dev, struct ipoib_ah *address, u32 qpn);void ipoib_reap_ah (struct work_struct *work); +struct ipoib_path *__path_find (struct net_device *dev,void *gid);void ipoib_mark_paths_invalid (struct net_device *dev);void ipoib_flush_paths (struct net_device *dev);struct ipoib_dev_priv *ipoib_intf_alloc (const char *format);
drivers/infiniband/ulp/ipoib/ipoib_cm.c +16 -0
@@ -1299,6 +1299,8 @@ void ipoib_cm_destroy_tx(struct ipoib_cm } } +#define QPN_AND_OPTIONS_OFFSET 4 +static void ipoib_cm_tx_start (struct work_struct *work) { struct ipoib_dev_priv *priv = container_of(work, struct ipoib_dev_priv,
@@ -1307,6 +1309,7 @@ static void ipoib_cm_tx_start(struct worstruct ipoib_neigh *neigh;struct ipoib_cm_tx *p;unsigned long flags; +struct ipoib_path *path;int ret;struct ib_sa_path_rec pathrec;
@@ -1319,7 +1322,19 @@ static void ipoib_cm_tx_start(struct wor p =list_entry (priv->cm.start_list.next,typeof (*p), list);list_del_init (&p->list); neigh = p->neigh; + qpn =IPOIB_QPN (neigh->daddr); +/* +* As long as the search is with these 2 locks, +* path existence indicates its validity. +*/ + path =__path_find (dev, neigh->daddr +QPN_AND_OPTIONS_OFFSET ); +if (!path) { +pr_info ("%s ignore not valid path %pI6\n" , + __func__, + neigh->daddr +QPN_AND_OPTIONS_OFFSET ); + goto free_neigh; + }memcpy (&pathrec, &p->path->pathrec,sizeof pathrec);spin_unlock_irqrestore (&priv->lock, flags);
@@ -1331,6 +1346,7 @@ static void ipoib_cm_tx_start(struct worspin_lock_irqsave (&priv->lock, flags);if (ret) { +free_neigh: neigh = p->neigh;if (neigh) { neigh->cm =NULL ;
drivers/infiniband/ulp/ipoib/ipoib_main.c +1 -1
@@ -481,7 +481,7 @@ int ipoib_set_mode(struct net_device *dereturn -EINVAL ; } -static struct ipoib_path *__path_find (struct net_device *dev,void *gid) +struct ipoib_path *__path_find (struct net_device *dev,void *gid) {struct ipoib_dev_priv *priv =netdev_priv (dev);struct rb_node *n = priv->path_tree.rb_node;
Greg Kroah-Hartman
maintainerPATCH 76/93 IB/core: Fix use after free in send_leave function
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Erez Shitrit <[email protected]>
commit 68c6bcdd8bd00394c234b915ab9b97c74104130c upstream.
The function send_leave sets the member: group->query_id (group->query_id = ret) after calling the sa_query, but leave_handler can be executed before the setting and it might delete the group object, and will get a memory corruption.
Additionally, this patch gets rid of group->query_id variable which is not used.
--- drivers/infiniband/core/multicast.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)
drivers/infiniband/core/multicast.c +2 -11
@@ -106,7 +106,6 @@ struct mcast_group {atomic_t refcount;enum mcast_group_state state;struct ib_sa_query *query; -int query_id;u16 pkey_index;u8 leave_state;int retries;
@@ -339,11 +338,7 @@ static int send_join(struct mcast_group member->multicast.comp_mask,3000 ,GFP_KERNEL , join_handler, group, &group->query); -if (ret >=0 ) { - group->query_id = ret; - ret =0 ; - } -return ret; +return (ret >0 ) ?0 : ret; }static int send_leave (struct mcast_group *group,u8 leave_state)
@@ -363,11 +358,7 @@ static int send_leave(struct mcast_groupIB_SA_MCMEMBER_REC_JOIN_STATE ,3000 ,GFP_KERNEL , leave_handler, group, &group->query); -if (ret >=0 ) { - group->query_id = ret; - ret =0 ; - } -return ret; +return (ret >0 ) ?0 : ret; } static void join_group(struct mcast_group *group, struct mcast_member *member,
Greg Kroah-Hartman
maintainerPATCH 77/93 IB/ipoib: Dont allow MC joins during light MC flush
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Vesker <[email protected]>
commit 344bacca8cd811809fc33a249f2738ab757d327f upstream.
This fix solves a race between light flush and on the fly joins. Light flush doesn't set the device to down and unset IPOIB_OPER_UP flag, this means that if while flushing we have a MC join in progress and the QP was attached to BC MGID we can have a mismatches when re-attaching a QP to the BC MGID.
The light flush would set the broadcast group to NULL causing an on the fly join to rejoin and reattach to the BC MCG as well as adding the BC MGID to the multicast list. The flush process would later on remove the BC MGID and detach it from the QP. On the next flush the BC MGID is present in the multicast list but not found when trying to detach it because of the previous double attach and single detach.
[18332.714265] ------------[ cut here ]------------ [18332.717775] WARNING: CPU: 6 PID: 3767 at drivers/infiniband/core/verbs.c:280 ib_dealloc_pd+0xff/0x120 [ib_core] ... [18332.775198] Hardware name: Red Hat KVM, BIOS Bochs 01/01/2011 [18332.779411] 0000000000000000 ffff8800b50dfbb0 ffffffff813fed47 0000000000000000 [18332.784960] 0000000000000000 ffff8800b50dfbf0 ffffffff8109add1 0000011832f58300 [18332.790547] ffff880226a596c0 ffff880032482000 ffff880032482830 ffff880226a59280 [18332.796199] Call Trace: [18332.798015] [<ffffffff813fed47>] dump_stack+0x63/0x8c [18332.801831] [<ffffffff8109add1>] __warn+0xd1/0xf0 [18332.805403] [<ffffffff8109aebd>] warn_slowpath_null+0x1d/0x20 [18332.809706] [<ffffffffa025d90f>] ib_dealloc_pd+0xff/0x120 [ib_core] [18332.814384] [<ffffffffa04f3d7c>] ipoib_transport_dev_cleanup+0xfc/0x1d0 [ib_ipoib] [18332.820031] [<ffffffffa04ed648>] ipoib_ib_dev_cleanup+0x98/0x110 [ib_ipoib] [18332.825220] [<ffffffffa04e62c8>] ipoib_dev_cleanup+0x2d8/0x550 [ib_ipoib] [18332.830290] [<ffffffffa04e656f>] ipoib_uninit+0x2f/0x40 [ib_ipoib] [18332.834911] [<ffffffff81772a8a>] rollback_registered_many+0x1aa/0x2c0 [18332.839741] [<ffffffff81772bd1>] rollback_registered+0x31/0x40 [18332.844091] [<ffffffff81773b18>] unregister_netdevice_queue+0x48/0x80 [18332.848880] [<ffffffffa04f489b>] ipoib_vlan_delete+0x1fb/0x290 [ib_ipoib] [18332.853848] [<ffffffffa04df1cd>] delete_child+0x7d/0xf0 [ib_ipoib] [18332.858474] [<ffffffff81520c08>] dev_attr_store+0x18/0x30 [18332.862510] [<ffffffff8127fe4a>] sysfs_kf_write+0x3a/0x50 [18332.866349] [<ffffffff8127f4e0>] kernfs_fop_write+0x120/0x170 [18332.870471] [<ffffffff81207198>] __vfs_write+0x28/0xe0 [18332.874152] [<ffffffff810e09bf>] ? percpu_down_read+0x1f/0x50 [18332.878274] [<ffffffff81208062>] vfs_write+0xa2/0x1a0 [18332.881896] [<ffffffff812093a6>] SyS_write+0x46/0xa0 [18332.885632] [<ffffffff810039b7>] do_syscall_64+0x57/0xb0 [18332.889709] [<ffffffff81883321>] entry_SYSCALL64_slow_path+0x25/0x25 [18332.894727] ---[ end trace 09ebbe31f831ef17 ]---
--- drivers/infiniband/ulp/ipoib/ipoib_ib.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/infiniband/ulp/ipoib/ipoib_ib.c +9 -0
@@ -1028,8 +1028,17 @@ static void __ipoib_ib_dev_flush(struct }if (level ==IPOIB_FLUSH_LIGHT ) { +int oper_up;ipoib_mark_paths_invalid (dev); +/* Set IPoIB operation as down to prevent races between: +* the flush flow which leaves MCG and on the fly joins +* which can happen during that time. mcast restart task +* should deal with join requests we missed. +*/ + oper_up =test_and_clear_bit (IPOIB_FLAG_OPER_UP , &priv->flags);ipoib_mcast_dev_flush (dev); +if (oper_up) +set_bit (IPOIB_FLAG_OPER_UP , &priv->flags);ipoib_flush_ah (dev); }
Greg Kroah-Hartman
maintainerPATCH 78/93 IB/mlx4: Fix incorrect MC join state bit-masking on SR-IOV
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Vesker <[email protected]>
commit e5ac40cd66c2f3cd11bc5edc658f012661b16347 upstream.
Because of an incorrect bit-masking done on the join state bits, when handling a join request we failed to detect a difference between the group join state and the request join state when joining as send only full member (0x8). This caused the MC join request not to be sent. This issue is relevant only when SRIOV is enabled and SM supports send only full member.
This fix separates scope bits and join states bits a nibble each.
--- drivers/infiniband/hw/mlx4/mcg.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/infiniband/hw/mlx4/mcg.c +7 -7
@@ -489,7 +489,7 @@ static u8 get_leave_state(struct mcast_gif (!group->members[i]) leave_state |= (1 << i); -return leave_state & (group->rec.scope_join_state &7 ); +return leave_state & (group->rec.scope_join_state &0xf ); }static int join_group (struct mcast_group *group,int slave,u8 join_mask)
@@ -564,8 +564,8 @@ static void mlx4_ib_mcg_timeout_handler( }else mcg_warn_group (group,"DRIVER BUG\n" ); }else if (group->state ==MCAST_LEAVE_SENT ) { -if (group->rec.scope_join_state &7 ) - group->rec.scope_join_state &=0xf8 ; +if (group->rec.scope_join_state &0xf ) + group->rec.scope_join_state &=0xf0 ; group->state =MCAST_IDLE ;mutex_unlock (&group->lock);if (release_group (group,1 ))
@@ -605,7 +605,7 @@ static int handle_leave_req(struct mcaststatic int handle_join_req (struct mcast_group *group,u8 join_mask,struct mcast_req *req) { -u8 group_join_state = group->rec.scope_join_state &7 ; +u8 group_join_state = group->rec.scope_join_state &0xf ;int ref =0 ;u16 status;struct ib_sa_mcmember_data *sa_data = (struct ib_sa_mcmember_data *)req->sa_mad.data;
@@ -690,8 +690,8 @@ static void mlx4_ib_mcg_work_handler(stru8 cur_join_state; resp_join_state = ((struct ib_sa_mcmember_data *) - group->response_sa_mad.data)->scope_join_state &7 ; - cur_join_state = group->rec.scope_join_state &7 ; + group->response_sa_mad.data)->scope_join_state &0xf ; + cur_join_state = group->rec.scope_join_state &0xf ;if (method ==IB_MGMT_METHOD_GET_RESP ) {/* successfull join */
@@ -710,7 +710,7 @@ process_requests: req = list_first_entry(&group->pending_list, struct mcast_req, group_list); sa_data = (struct ib_sa_mcmember_data *)req->sa_mad.data; - req_join_state = sa_data->scope_join_state &0x7 ; + req_join_state = sa_data->scope_join_state &0xf ;/* For a leave request, we will immediately answer the VF, and * update our internal counters. The actual leave will be sent
Greg Kroah-Hartman
maintainerPATCH 79/93 IB/mlx4: Fix code indentation in QP1 MAD flow
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jack Morgenstein <[email protected]>
commit baa0be7026e2f7d1d40bfd45909044169e9e3c68 upstream.
The indentation in the QP1 GRH flow in procedure build_mlx_header is really confusing. Fix it, in preparation for a commit which touches this code.
--- drivers/infiniband/hw/mlx4/qp.c | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-)
drivers/infiniband/hw/mlx4/qp.c +19 -17
@@ -2331,24 +2331,26 @@ static int build_mlx_header(struct mlx4_ sqp->ud_header.grh.flow_label = ah->av.ib.sl_tclass_flowlabel &cpu_to_be32 (0xfffff ); sqp->ud_header.grh.hop_limit = ah->av.ib.hop_limit; -if (is_eth) +if (is_eth) {memcpy (sqp->ud_header.grh.source_gid.raw, sgid.raw,16 ); -else { -if (mlx4_is_mfunc (to_mdev (ib_dev)->dev)) { -/* When multi-function is enabled, the ib_core gid -* indexes don't necessarily match the hw ones, so -* we must use our own cache */ - sqp->ud_header.grh.source_gid.global.subnet_prefix = -to_mdev (ib_dev)->sriov.demux[sqp->qp.port -1 ]. - subnet_prefix; - sqp->ud_header.grh.source_gid.global.interface_id = -to_mdev (ib_dev)->sriov.demux[sqp->qp.port -1 ]. - guid_cache[ah->av.ib.gid_index]; - }else -ib_get_cached_gid (ib_dev, -be32_to_cpu (ah->av.ib.port_pd) >>24 , - ah->av.ib.gid_index, - &sqp->ud_header.grh.source_gid,NULL ); + }else { +if (mlx4_is_mfunc (to_mdev (ib_dev)->dev)) { +/* When multi-function is enabled, the ib_core gid +* indexes don't necessarily match the hw ones, so +* we must use our own cache +*/ + sqp->ud_header.grh.source_gid.global.subnet_prefix = +to_mdev (ib_dev)->sriov.demux[sqp->qp.port -1 ]. + subnet_prefix; + sqp->ud_header.grh.source_gid.global.interface_id = +to_mdev (ib_dev)->sriov.demux[sqp->qp.port -1 ]. + guid_cache[ah->av.ib.gid_index]; + }else { +ib_get_cached_gid (ib_dev, +be32_to_cpu (ah->av.ib.port_pd) >>24 , + ah->av.ib.gid_index, + &sqp->ud_header.grh.source_gid,NULL ); + } }memcpy (sqp->ud_header.grh.destination_gid.raw, ah->av.ib.dgid,16 );
Greg Kroah-Hartman
maintainerPATCH 80/93 IB/mlx4: Use correct subnet-prefix in QP1 mads under SR-IOV
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jack Morgenstein <[email protected]>
commit 8ec07bf8a8b57d6c58927a16a0a22c0115cf2855 upstream.
When sending QP1 MAD packets which use a GRH, the source GID (which consists of the 64-bit subnet prefix, and the 64 bit port GUID) must be included in the packet GRH.
For SR-IOV, a GID cache is used, since the source GID needs to be the slave's source GID, and not the Hypervisor's GID. This cache also included a subnet_prefix. Unfortunately, the subnet_prefix field in the cache was never initialized (to the default subnet prefix 0xfe80::0). As a result, this field remained all zeroes. Therefore, when SR-IOV was active, all QP1 packets which included a GRH had a source GID subnet prefix of all-zeroes.
However, the subnet-prefix should initially be 0xfe80::0 (the default subnet prefix). In addition, if OpenSM modifies a port's subnet prefix, the new subnet prefix must be used in the GRH when sending QP1 packets. To fix this we now initialize the subnet prefix in the SR-IOV GID cache to the default subnet prefix. We update the cached value if/when OpenSM modifies the port's subnet prefix. We take this cached value when sending QP1 packets when SR-IOV is active.
Note that the value is stored as an atomic64. This eliminates any need for locking when the subnet prefix is being updated.
Note also that we depend on the FW generating the "port management change" event for tracking subnet-prefix changes performed by OpenSM. If running early FW (before 2.9.4630), subnet prefix changes will not be tracked (but the default subnet prefix still will be stored in the cache; therefore users who do not modify the subnet prefix will not have a problem). IF there is a need for such tracking also for early FW, we will add that capability in a subsequent patch.
--- drivers/infiniband/hw/mlx4/mad.c | 23 +++++++++++++++++++++++ drivers/infiniband/hw/mlx4/mlx4_ib.h | 2 +- drivers/infiniband/hw/mlx4/qp.c | 5 +++-- 3 files changed, 27 insertions(+), 3 deletions(-)
drivers/infiniband/hw/mlx4/mad.c +23 -0
@@ -1080,6 +1080,27 @@ void handle_port_mgmt_change_event(struc/* Generate GUID changed event */ if (changed_attr &MLX4_EQ_PORT_INFO_GID_PFX_CHANGE_MASK ) { +if (mlx4_is_master (dev->dev)) { +union ib_gid gid; +int err =0 ; + +if (!eqe->event.port_mgmt_change.params.port_info.gid_prefix) + err =__mlx4_ib_query_gid (&dev->ib_dev, port,0 , &gid,1 ); +else + gid.global.subnet_prefix = + eqe->event.port_mgmt_change.params.port_info.gid_prefix; +if (err) { +pr_warn ("Could not change QP1 subnet prefix for port %d: query_gid error (%d)\n" , + port, err); + }else { +pr_debug ("Changing QP1 subnet prefix for port %d. old=0x%llx. new=0x%llx\n" , + port, + (u64 )atomic64_read (&dev->sriov.demux[port -1 ].subnet_prefix), +be64_to_cpu (gid.global.subnet_prefix)); +atomic64_set (&dev->sriov.demux[port -1 ].subnet_prefix, +be64_to_cpu (gid.global.subnet_prefix)); + } + }mlx4_ib_dispatch_event (dev, port,IB_EVENT_GID_CHANGE );/*if master, notify all slaves*/ if (mlx4_is_master (dev->dev))
@@ -2154,6 +2175,8 @@ int mlx4_ib_init_sriov(struct mlx4_ib_deif (err) goto demux_err; dev->sriov.demux[i].guid_cache[0 ] = gid.global.interface_id; +atomic64_set (&dev->sriov.demux[i].subnet_prefix, +be64_to_cpu (gid.global.subnet_prefix)); err =alloc_pv_object (dev,mlx4_master_func_num (dev->dev), i +1 , &dev->sriov.sqps[i]);if (err)
drivers/infiniband/hw/mlx4/mlx4_ib.h +1 -1
@@ -441,7 +441,7 @@ struct mlx4_ib_demux_ctx {struct workqueue_struct *wq;struct workqueue_struct *ud_wq;spinlock_t ud_lock; -__be64 subnet_prefix; +atomic64_t subnet_prefix;__be64 guid_cache[128 ];struct mlx4_ib_dev *dev;/* the following lock protects both mcg_table and mcg_mgid0_list */
drivers/infiniband/hw/mlx4/qp.c +3 -2
@@ -2340,8 +2340,9 @@ static int build_mlx_header(struct mlx4_* we must use our own cache */ sqp->ud_header.grh.source_gid.global.subnet_prefix = -to_mdev (ib_dev)->sriov.demux[sqp->qp.port -1 ]. - subnet_prefix; +cpu_to_be64 (atomic64_read (&(to_mdev (ib_dev)->sriov. + demux[sqp->qp.port -1 ]. + subnet_prefix))); sqp->ud_header.grh.source_gid.global.interface_id =to_mdev (ib_dev)->sriov.demux[sqp->qp.port -1 ]. guid_cache[ah->av.ib.gid_index];
Greg Kroah-Hartman
maintainerPATCH 82/93 aio: mark AIO pseudo-fs noexec
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jann Horn <[email protected]>
commit 22f6b4d34fcf039c63a94e7670e0da24f8575a5a upstream.
This ensures that do_mmap() won't implicitly make AIO memory mappings executable if the READ_IMPLIES_EXEC personality flag is set. Such behavior is problematic because the security_mmap_file LSM hook doesn't catch this case, potentially permitting an attacker to bypass a W^X policy enforced by SELinux.
I have tested the patch on my machine.
To test the behavior, compile and run this:
#define _GNU_SOURCE
#include <unistd.h>
#include <sys/personality.h>
#include <linux/aio_abi.h>
#include <err.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/syscall.h>
int main(void) {
personality(READ_IMPLIES_EXEC);
aio_context_t ctx = 0;
if (syscall(__NR_io_setup, 1, &ctx))
err(1, "io_setup");
char cmd[1000];
sprintf(cmd, "cat /proc/%d/maps | grep -F '/[aio]'",
(int)getpid());
system(cmd);
return 0;
}In the output, "rw-s" is good, "rwxs" is bad.
--- fs/aio.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
fs/aio.c +6 -1
@@ -239,7 +239,12 @@ static struct dentry *aio_mount(struct fstatic const struct dentry_operations ops = { .d_dname = simple_dname, }; -return mount_pseudo (fs_type,"aio:" ,NULL , &ops,AIO_RING_MAGIC ); +struct dentry *root =mount_pseudo (fs_type,"aio:" ,NULL , &ops, +AIO_RING_MAGIC ); + +if (!IS_ERR (root)) + root->d_sb->s_iflags |=SB_I_NOEXEC ; +return root; }/* aio_setup
Greg Kroah-Hartman
maintainerPATCH 83/93 clk: xgene: Add missing parenthesis when clearing divider value
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Loc Ho <[email protected]>
commit 0f4c7a138dfefb0ebdbaf56e3ba2acd2958a6605 upstream.
In the initial fix for non-zero divider shift value, the parenthesis was missing after the negate operation. This patch adds the required parenthesis. Otherwise, lower bits may be cleared unintentionally.
--- drivers/clk/clk-xgene.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/clk-xgene.c +2 -2
@@ -351,8 +351,8 @@ static int xgene_clk_set_rate(struct clk/* Set new divider */ data =xgene_clk_read (pclk->param.divider_reg + pclk->param.reg_divider_offset); - data &= ~((1 << pclk->param.reg_divider_width) -1 ) - << pclk->param.reg_divider_shift; + data &= ~(((1 << pclk->param.reg_divider_width) -1 ) + << pclk->param.reg_divider_shift); data |= divider;xgene_clk_write (data, pclk->param.divider_reg + pclk->param.reg_divider_offset);
Greg Kroah-Hartman
maintainerPATCH 84/93 dm log writes: fix bug with too large bios
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <[email protected]>
commit 7efb367320f56fc4d549875b6f3a6940018ef2e5 upstream.
bio_alloc() can allocate a bio with at most BIO_MAX_PAGES (256) vector entries. However, the incoming bio may have more vector entries if it was allocated by other means. For example, bcache submits bios with more than BIO_MAX_PAGES entries. This results in bio_alloc() failure.
To avoid the failure, change the code so that it allocates bio with at most BIO_MAX_PAGES entries. If the incoming bio has more entries, bio_add_page() will fail and a new bio will be allocated - the code that handles bio_add_page() failure already exists in the dm-log-writes target.
--- drivers/md/dm-log-writes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/md/dm-log-writes.c +2 -2
@@ -259,7 +259,7 @@ static int log_one_block(struct log_writ sector++;atomic_inc (&lc->io_blocks); - bio =bio_alloc (GFP_KERNEL , block->vec_cnt); + bio =bio_alloc (GFP_KERNEL ,min (block->vec_cnt,BIO_MAX_PAGES ));if (!bio) {DMERR ("Couldn't alloc log bio" ); goto error;
@@ -280,7 +280,7 @@ static int log_one_block(struct log_writif (ret != block->vecs[i].bv_len) {atomic_inc (&lc->io_blocks);submit_bio (WRITE , bio); - bio =bio_alloc (GFP_KERNEL , block->vec_cnt - i); + bio =bio_alloc (GFP_KERNEL ,min (block->vec_cnt - i,BIO_MAX_PAGES ));if (!bio) {DMERR ("Couldn't alloc log bio" ); goto error;
Greg Kroah-Hartman
maintainerPATCH 85/93 USB: serial: cp210x: fix hardware flow-control disable
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konstantin Shkolnyy <[email protected]>
commit a377f9e906af4df9071ba8ddba60188cb4013d93 upstream.
A bug in the CRTSCTS handling caused RTS to alternate between
CRTSCTS=0 => "RTS is transmit active signal" and CRTSCTS=1 => "RTS is used for receive flow control"
instead of
CRTSCTS=0 => "RTS is statically active" and CRTSCTS=1 => "RTS is used for receive flow control"
This only happened after first having enabled CRTSCTS.
---
This is a backport of an upstream fix to v4.4, which should apply too earlier stable trees as well.
Johan
drivers/usb/serial/cp210x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/serial/cp210x.c +1 -1
@@ -784,7 +784,7 @@ static void cp210x_set_termios(struct tt }else { modem_ctl[0 ] &= ~0x7B ; modem_ctl[0 ] |=0x01 ; - modem_ctl[1 ] |=0x40 ; + modem_ctl[1 ] =0x40 ;dev_dbg (dev,"%s - flow control = NONE\n" , __func__); }
Greg Kroah-Hartman
maintainerPATCH 86/93 usb: misc: legousbtower: Fix NULL pointer deference
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <[email protected]>
commit 2fae9e5a7babada041e2e161699ade2447a01989 upstream.
This patch fixes a NULL pointer dereference caused by a race codition in the probe function of the legousbtower driver. It re-structures the probe function to only register the interface after successfully reading the board's firmware ID.
The probe function does not deregister the usb interface after an error receiving the devices firmware ID. The device file registered (/dev/usb/legousbtower%d) may be read/written globally before the probe function returns. When tower_delete is called in the probe function (after an r/w has been initiated), core dev structures are deleted while the file operation functions are still running. If the 0 address is mappable on the machine, this vulnerability can be used to create a Local Priviege Escalation exploit via a write-what-where condition by remapping dev->interrupt_out_buffer in tower_write. A forged USB device and local program execution would be required for LPE. The USB device would have to delay the control message in tower_probe and accept the control urb in tower_open whilst guest code initiated a write to the device file as tower_delete is called from the error in tower_probe.
This bug has existed since 2003. Patch tested by emulated device.
--- drivers/usb/misc/legousbtower.c | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-)
drivers/usb/misc/legousbtower.c +17 -18
@@ -898,24 +898,6 @@ static int tower_probe (struct usb_inter dev->interrupt_in_interval = interrupt_in_interval ? interrupt_in_interval : dev->interrupt_in_endpoint->bInterval; dev->interrupt_out_interval = interrupt_out_interval ? interrupt_out_interval : dev->interrupt_out_endpoint->bInterval; -/* we can register the device now, as it is ready */ -usb_set_intfdata (interface, dev); - - retval =usb_register_dev (interface, &tower_class); - -if (retval) { -/* something prevented us from registering this driver */ -dev_err (idev,"Not able to get a minor for this device.\n" ); -usb_set_intfdata (interface,NULL ); - goto error; - } - dev->minor = interface->minor; - -/* let the user know what node this device is now attached to */ -dev_info (&interface->dev,"LEGO USB Tower #%d now attached to major " -"%d minor %d\n" , (dev->minor -LEGO_USB_TOWER_MINOR_BASE ), -USB_MAJOR , dev->minor); -/* get the firmware version and log it */ result = usb_control_msg (udev, usb_rcvctrlpipe(udev, 0),
@@ -936,6 +918,23 @@ static int tower_probe (struct usb_inter get_version_reply.minor, le16_to_cpu(get_version_reply.build_no)); +/* we can register the device now, as it is ready */ +usb_set_intfdata (interface, dev); + + retval =usb_register_dev (interface, &tower_class); + +if (retval) { +/* something prevented us from registering this driver */ +dev_err (idev,"Not able to get a minor for this device.\n" ); +usb_set_intfdata (interface,NULL ); + goto error; + } + dev->minor = interface->minor; + +/* let the user know what node this device is now attached to */ +dev_info (&interface->dev,"LEGO USB Tower #%d now attached to major " +"%d minor %d\n" , (dev->minor -LEGO_USB_TOWER_MINOR_BASE ), +USB_MAJOR , dev->minor); exit:return retval;
Greg Kroah-Hartman
maintainerPATCH 87/93 Staging: fbtft: Fix bug in fbtft-core
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ksenija Stanojevic <[email protected]>
commit fc1e2c8ea85e109acf09e74789e9b852f6eed251 upstream.
Commit 367e8560e8d7a62d96e9b1d644028a3816e04206 introduced a bug in fbtft-core where fps is always 0, this is because variable update_time is not assigned correctly.
--- drivers/staging/fbtft/fbtft-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/fbtft/fbtft-core.c +2 -2
@@ -392,11 +392,11 @@ static void fbtft_update_display(structif (unlikely (timeit)) { ts_end =ktime_get (); -if (ktime_to_ns (par->update_time)) +if (!ktime_to_ns (par->update_time)) par->update_time = ts_start; - par->update_time = ts_start; fps =ktime_us_delta (ts_start, par->update_time); + par->update_time = ts_start; fps = fps ?1000000 / fps :0 ; throughput =ktime_us_delta (ts_end, ts_start);
Greg Kroah-Hartman
maintainerPATCH 88/93 USB: serial: cp210x: Add ID for a Juniper console
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Jones <[email protected]>
commit decc5360f23e9efe0252094f47f57f254dcbb3a9 upstream.
--- drivers/usb/serial/cp210x.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/serial/cp210x.c +1 -0
@@ -117,6 +117,7 @@ static const struct usb_device_id id_tab { USB_DEVICE(0x10C4, 0x8411) }, /* Kyocera GPS Module */ { USB_DEVICE(0x10C4, 0x8418) }, /* IRZ Automation Teleport SG-10 GSM/GPRS Modem */ { USB_DEVICE(0x10C4, 0x846E) }, /* BEI USB Sensor Interface (VCP) */ + { USB_DEVICE(0x10C4, 0x8470) }, /* Juniper Networks BX Series System Console */ { USB_DEVICE(0x10C4, 0x8477) }, /* Balluff RFID */ { USB_DEVICE(0x10C4, 0x84B6) }, /* Starizona Hyperion */ { USB_DEVICE(0x10C4, 0x85EA) }, /* AC-Services IBUS-IF */
Greg Kroah-Hartman
maintainerPATCH 89/93 Revert "usbtmc: convert to devm_kzalloc"
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <[email protected]>
commit ab21b63e8aedfc73565dd9cdd51eb338341177cb upstream.
This reverts commit e6c7efdcb76f11b04e3d3f71c8d764ab75c9423b.
Turns out it was totally wrong. The memory is supposed to be bound to the kref, as the original code was doing correctly, not the device/driver binding as the devm_kzalloc() would cause.
This fixes an oops when read would be called after the device was unbound from the driver.
--- drivers/usb/class/usbtmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/class/usbtmc.c +2 -1
@@ -121,6 +121,7 @@ static void usbtmc_delete(struct kref *kstruct usbtmc_device_data *data =to_usbtmc_data (kref);usb_put_dev (data->usb_dev); +kfree (data); }static int usbtmc_open (struct inode *inode,struct file *filp)
@@ -1104,7 +1105,7 @@ static int usbtmc_probe(struct usb_interdev_dbg (&intf->dev,"%s called\n" , __func__); - data =devm_kzalloc (&intf->dev,sizeof (*data),GFP_KERNEL ); + data =kmalloc (sizeof (*data),GFP_KERNEL );if (!data)return -ENOMEM ;
Greg Kroah-Hartman
maintainerPATCH 90/93 ALSA: hda - Adding one more ALC255 pin definition for headset problem
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hui Wang <[email protected]>
commit 392c9da24a994f238c5d7ea611c6245be4617014 upstream.
We have two new Dell laptop models, they have the same ALC255 pin definition, but not in the pin quirk table yet, as a result, the headset microphone can't work. After adding the definition in the table, the headset microphone works well.
--- sound/pci/hda/patch_realtek.c | 4 ++++ 1 file changed, 4 insertions(+)
sound/pci/hda/patch_realtek.c +4 -0
@@ -5830,6 +5830,10 @@ static const struct snd_hda_pin_quirk al {0x14, 0x90170120}, {0x21, 0x02211030}),SND_HDA_PIN_QUIRK (0x10ec0255 ,0x1028 ,"Dell" ,ALC255_FIXUP_DELL1_MIC_NO_PRESENCE , + {0x14, 0x90170110}, + {0x1b, 0x02011020}, + {0x21, 0x0221101f}), +SND_HDA_PIN_QUIRK (0x10ec0255 ,0x1028 ,"Dell" ,ALC255_FIXUP_DELL1_MIC_NO_PRESENCE , {0x14, 0x90170130}, {0x1b, 0x01014020}, {0x21, 0x0221103f}),
Greg Kroah-Hartman
maintainerPATCH 91/93 ACPICA: acpi_get_sleep_type_data: Reduce warnings
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Prarit Bhargava <[email protected]>
commit a59b679ab85635737947310323f2f2bcfa0664a7 upstream.
ACPICA commit 7bb77313091e52a846df4c9c2bea90be31bfb9d8
Eliminate warnings for "not found" _Sx errors, since these are optional. Original NOT_FOUND status is still returned.
Original changes by Prarit Bhargava.
ACPICA BZ 1208.
--- drivers/acpi/acpica/hwxface.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-)
drivers/acpi/acpica/hwxface.c +17 -7
@@ -504,11 +504,20 @@ acpi_get_sleep_type_data(u8 sleep_state,* Evaluate the \_Sx namespace object containing the register values * for this state */ - info->relative_pathname = -ACPI_CAST_PTR (char, acpi_gbl_sleep_state_names[sleep_state]); + info->relative_pathname =ACPI_CAST_PTR (char, + acpi_gbl_sleep_state_names + [sleep_state]); + status =acpi_ns_evaluate (info);if (ACPI_FAILURE (status)) { - goto cleanup; +if (status ==AE_NOT_FOUND ) { + +/* The _Sx states are optional, ignore NOT_FOUND */ + + goto final_cleanup; + } + + goto warning_cleanup; }/* Must have a return object */
@@ -517,7 +526,7 @@ acpi_get_sleep_type_data(u8 sleep_state,ACPI_ERROR ((AE_INFO ,"No Sleep State object returned from [%s]" , info->relative_pathname)); status =AE_AML_NO_RETURN_VALUE ; - goto cleanup; + goto warning_cleanup; }/* Return object must be of type Package */
@@ -526,7 +535,7 @@ acpi_get_sleep_type_data(u8 sleep_state,ACPI_ERROR ((AE_INFO ,"Sleep State return object is not a Package" )); status =AE_AML_OPERAND_TYPE ; - goto cleanup1; + goto return_value_cleanup; }/*
@@ -570,16 +579,17 @@ acpi_get_sleep_type_data(u8 sleep_state,break ; } -cleanup1: +return_value_cleanup:acpi_ut_remove_reference (info->return_object); -cleanup: +warning_cleanup:if (ACPI_FAILURE (status)) {ACPI_EXCEPTION ((AE_INFO , status,"While evaluating Sleep State [%s]" , info->relative_pathname)); } +final_cleanup:ACPI_FREE (info);return_ACPI_STATUS (status); }
Greg Kroah-Hartman
maintainerPATCH 92/93 ALSA: hda - Fix headset mic detection problem for several Dell laptops
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hui Wang <[email protected]>
commit 3f640970a41429f0a076c01270bbd014c9eae61c upstream.
One of the laptops has the codec ALC256 on it, applying the ALC255_FIXUP_DELL1_MIC_NO_PRESENCE can fix the problem, the rest of laptops have the codec ALC295 on them, they are similar to machines with ALC225, applying the ALC269_FIXUP_DELL1_MIC_NO_PRESENCE can fix the problem.
--- sound/pci/hda/patch_realtek.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
sound/pci/hda/patch_realtek.c +13 -0
@@ -5790,6 +5790,13 @@ static const struct hda_model_fixup alc2 {0x14, 0x90170110}, \ {0x15, 0x0221401f} +#define ALC295_STANDARD_PINS \ + {0x12, 0xb7a60130}, \ + {0x14, 0x90170110}, \ + {0x17, 0x21014020}, \ + {0x18, 0x21a19030}, \ + {0x21, 0x04211020} +#define ALC298_STANDARD_PINS \ {0x12, 0x90a60130}, \ {0x21, 0x03211020}
@@ -5899,6 +5906,10 @@ static const struct snd_hda_pin_quirk al {0x14, 0x90170120}, {0x21, 0x02211030}), SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, + {0x12, 0xb7a60130}, + {0x14, 0x90170110}, + {0x21, 0x02211020}), + SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, ALC256_STANDARD_PINS), SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4, {0x12, 0x90a60130},
@@ -6009,6 +6020,8 @@ static const struct snd_hda_pin_quirk alSND_HDA_PIN_QUIRK (0x10ec0293 ,0x1028 ,"Dell" ,ALC293_FIXUP_DELL1_MIC_NO_PRESENCE ,ALC292_STANDARD_PINS , {0x13, 0x90a60140}), +SND_HDA_PIN_QUIRK (0x10ec0295 ,0x1028 ,"Dell" ,ALC269_FIXUP_DELL1_MIC_NO_PRESENCE , +ALC295_STANDARD_PINS ),SND_HDA_PIN_QUIRK (0x10ec0298 ,0x1028 ,"Dell" ,ALC298_FIXUP_DELL1_MIC_NO_PRESENCE ,ALC298_STANDARD_PINS , {0x17, 0x90170110}),
Greg Kroah-Hartman
maintainerPATCH 93/93 ALSA: hda - Add the top speaker pin config for HP Spectre x360
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 0eec880966e77bdbee0112989a2be67d92e39929 upstream.
HP Spectre x360 with CX20724 codec has two speaker outputs while the BIOS sets up only the bottom one (NID 0x17) and disables the top one (NID 0x1d).
This patch adds a fixup simply defining the proper pincfg for NID 0x1d so that the top speaker works as is.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=169071
--- sound/pci/hda/patch_conexant.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
sound/pci/hda/patch_conexant.c +10 -0
@@ -261,6 +261,7 @@ enum {CXT_FIXUP_HP_530 ,CXT_FIXUP_CAP_MIX_AMP_5047 ,CXT_FIXUP_MUTE_LED_EAPD , + CXT_FIXUP_HP_SPECTRE, };/* for hda_fixup_thinkpad_acpi() */
@@ -765,6 +766,14 @@ static const struct hda_fixup cxt_fixups .type = HDA_FIXUP_FUNC, .v.func = cxt_fixup_mute_led_eapd, }, + [CXT_FIXUP_HP_SPECTRE] = { + .type = HDA_FIXUP_PINS, + .v.pins = (const struct hda_pintbl []) { +/* enable NID 0x1d for the speaker on top */ + {0x1d ,0x91170111 }, + { } + } + }, };static const struct snd_pci_quirk cxt5045_fixups[] = {
@@ -814,6 +823,7 @@ static const struct snd_pci_quirk cxt506SND_PCI_QUIRK (0x1025 ,0x0543 ,"Acer Aspire One 522" ,CXT_FIXUP_STEREO_DMIC ),SND_PCI_QUIRK (0x1025 ,0x054c ,"Acer Aspire 3830TG" ,CXT_FIXUP_ASPIRE_DMIC ),SND_PCI_QUIRK (0x1025 ,0x054f ,"Acer Aspire 4830T" ,CXT_FIXUP_ASPIRE_DMIC ), +SND_PCI_QUIRK (0x103c ,0x8174 ,"HP Spectre x360" ,CXT_FIXUP_HP_SPECTRE ),SND_PCI_QUIRK (0x1043 ,0x138d ,"Asus" ,CXT_FIXUP_HEADPHONE_MIC_PIN ),SND_PCI_QUIRK (0x152d ,0x0833 ,"OLPC XO-1.5" ,CXT_FIXUP_OLPC_XO ), SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400", CXT_PINCFG_LENOVO_TP410),
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.4.24 release. There are 93 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 Sat Oct 8 07:47:15 UTC 2016. Anything received after that time might be too late.
Build results:
total: 149 pass: 149 fail: 0 Qemu test results: total: 101 pass: 101 fail: 0
Details are available at http://kerneltests.org/builders.
Guenter
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.4.24 release. There are 93 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 Sat Oct 8 07:47:15 UTC 2016. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.24-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.4.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions,
thanks,
-- Shuah
Signature · 5 lines
Shuah Khan Sr. Linux Kernel Developer Open Source Innovation Group Samsung Research America(Silicon Valley) [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Greg Kroah-Hartman
maintainerQuoted 12 lines · kernelci.org bot
stable-rc boot: 164 boots: 1 failed, 158 passed with 5 offline (v4.4.23-94-g5dba8e95fccc)
Full Boot Summary: https://kernelci.org/boot/all/job/stable-rc/kernel/v4.4.23-94-g5dba8e95fccc/
Full Build Summary: https://kernelci.org/build/stable-rc/kernel/v4.4.23-94-g5dba8e95fccc/Tree: stable-rc
Branch: local/linux-4.4.y
Git Describe: v4.4.23-94-g5dba8e95fccc
Git Commit:5dba8e95fccc45d6934b70128e6ce72e4cbc44e1
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
Tested: 41 unique boards, 13 SoC families, 22 builds out of 201
Quoted 6 lines
Boot Failure Detected: https://kernelci.org/boot/?v4.4.23-94-g5dba8e95fccc&fail
arm:
multi_v7_defconfig+CONFIG_PROVE_LOCKING=y:
at91-sama5d3_xplained: 1 failed lab
Yeah, same failure!
thanks for the report,
greg k-h
Quoted 15 lines · Greg Kroah-Hartman
Quoted 14 lines · kernelci.org bot
stable-rc boot: 164 boots: 1 failed, 158 passed with 5 offline (v4.4.23-94-g5dba8e95fccc)
Full Boot Summary: https://kernelci.org/boot/all/job/stable-rc/kernel/v4.4.23-94-g5dba8e95fccc/
Full Build Summary: https://kernelci.org/build/stable-rc/kernel/v4.4.23-94-g5dba8e95fccc/Tree: stable-rc
Branch: local/linux-4.4.y
Git Describe: v4.4.23-94-g5dba8e95fccc
Git Commit:5dba8e95fccc45d6934b70128e6ce72e4cbc44e1
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
Tested: 41 unique boards, 13 SoC families, 22 builds out of 201Boot Failure Detected: https://kernelci.org/boot/?v4.4.23-94-g5dba8e95fccc&fail
Quoted 8 lines
Quoted 4 lines
arm:
multi_v7_defconfig+CONFIG_PROVE_LOCKING=y:
at91-sama5d3_xplained: 1 failed labYeah, same failure!
thanks for the report,
Pretty sure this one is related to the bootloader settings not properly dealing with the larger image size created by CONFIG_PROVE_LOCKING=y, but still waiting for the Free Electrons guys (cc'd) to have a closer look.
Kevin