3.10.91-stable review
Subsystems (2)
Greg Kroah-Hartman
maintainerPATCH 5/54 x86/apic: Serialize LVTT and TSC_DEADLINE writes
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shaohua Li <[email protected]>
commit 5d7c631d926b59aa16f3c56eaeb83f1036c81dc7 upstream.
The APIC LVTT register is MMIO mapped but the TSC_DEADLINE register is an MSR. The write to the TSC_DEADLINE MSR is not serializing, so it's not guaranteed that the write to LVTT has reached the APIC before the TSC_DEADLINE MSR is written. In such a case the write to the MSR is ignored and as a consequence the local timer interrupt never fires.
The SDM decribes this issue for xAPIC and x2APIC modes. The serialization methods recommended by the SDM differ.
xAPIC:
"1. Memory-mapped write to LVT Timer Register, setting bits 18:17 to 10b.
2. WRMSR to the IA32_TSC_DEADLINE MSR a value much larger than current time-stamp counter.
3. If RDMSR of the IA32_TSC_DEADLINE MSR returns zero, go to step 2.
4. WRMSR to the IA32_TSC_DEADLINE MSR the desired deadline."
x2APIC:
"To allow for efficient access to the APIC registers in x2APIC mode,
the serializing semantics of WRMSR are relaxed when writing to the APIC registers. Thus, system software should not use 'WRMSR to APIC registers in x2APIC mode' as a serializing instruction. Read and write accesses to the APIC registers will occur in program order. A WRMSR to an APIC register may complete before all preceding stores are globally visible; software can prevent this by inserting a serializing instruction, an SFENCE, or an MFENCE before the WRMSR."
The xAPIC method is to just wait for the memory mapped write to hit the LVTT by checking whether the MSR write has reached the hardware. There is no reason why a proper MFENCE after the memory mapped write would not do the same. Andi Kleen confirmed that MFENCE is sufficient for the xAPIC case as well.
Issue MFENCE before writing to the TSC_DEADLINE MSR. This can be done unconditionally as all CPUs which have TSC_DEADLINE also have MFENCE support.
[ tglx: Massaged the changelog ]
--- arch/x86/kernel/apic/apic.c | 7 +++++++ 1 file changed, 7 insertions(+)
arch/x86/kernel/apic/apic.c +7 -0
@@ -350,6 +350,13 @@ static void __setup_APIC_LVTT(unsigned iapic_write (APIC_LVTT , lvtt_value);if (lvtt_value &APIC_LVT_TIMER_TSCDEADLINE ) { +/* +* See Intel SDM: TSC-Deadline Mode chapter. In xAPIC mode, +* writing to the APIC LVTT and TSC_DEADLINE MSR isn't serialized. +* According to Intel, MFENCE can do the serialization here. +*/ + asmvolatile ("mfence" : : :"memory" ); +printk_once (KERN_DEBUG "TSC deadline timer enabled\n" );return ; }
Greg Kroah-Hartman
maintainerPATCH 11/54 spi: spi-pxa2xx: Check status register to determine if SSSR_TINT is disabled
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Tan, Jui Nee" <[email protected]>
commit 02bc933ebb59208f42c2e6305b2c17fd306f695d upstream.
On Intel Baytrail, there is case when interrupt handler get called, no SPI message is captured. The RX FIFO is indeed empty when RX timeout pending interrupt (SSSR_TINT) happens.
Use the BIOS version where both HSUART and SPI are on the same IRQ. Both drivers are using IRQF_SHARED when calling the request_irq function. When running two separate and independent SPI and HSUART application that generate data traffic on both components, user will see messages like below on the console:
pxa2xx-spi pxa2xx-spi.0: bad message state in interrupt handler
This commit will fix this by first checking Receiver Time-out Interrupt, if it is disabled, ignore the request and return without servicing.
--- drivers/spi/spi-pxa2xx.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/spi/spi-pxa2xx.c +4 -0
@@ -546,6 +546,10 @@ static irqreturn_t ssp_int(int irq, voidif (!(sccr1_reg &SSCR1_TIE )) mask &= ~SSSR_TFS ; +/* Ignore RX timeout interrupt if it is disabled */ +if (!(sccr1_reg &SSCR1_TINTE )) + mask &= ~SSSR_TINT ; +if (!(status & mask))return IRQ_NONE ;
Greg Kroah-Hartman
maintainerPATCH 12/54 mm: hugetlbfs: skip shared VMAs when unmapping private pages to satisfy a fault
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mel Gorman <[email protected]>
commit 2f84a8990ebbe235c59716896e017c6b2ca1200f upstream.
SunDong reported the following on
https://bugzilla.kernel.org/show_bug.cgi?id=103841
I think I find a linux bug, I have the test cases is constructed. I can stable recurring problems in fedora22(4.0.4) kernel version, arch for x86_64. I construct transparent huge page, when the parent and child process with MAP_SHARE, MAP_PRIVATE way to access the same huge page area, it has the opportunity to lead to huge page copy on write failure, and then it will munmap the child corresponding mmap area, but then the child mmap area with VM_MAYSHARE attributes, child process munmap this area can trigger VM_BUG_ON in set_vma_resv_flags functions (vma - > vm_flags & VM_MAYSHARE).
There were a number of problems with the report (e.g. it's hugetlbfs that triggers this, not transparent huge pages) but it was fundamentally correct in that a VM_BUG_ON in set_vma_resv_flags() can be triggered that looks like this
vma ffff8804651fd0d0 start 00007fc474e00000 end 00007fc475e00000 next ffff8804651fd018 prev ffff8804651fd188 mm ffff88046b1b1800 prot 8000000000000027 anon_vma (null) vm_ops ffffffff8182a7a0 pgoff 0 file ffff88106bdb9800 private_data (null) flags: 0x84400fb(read|write|shared|mayread|maywrite|mayexec|mayshare|dontexpand|hugetlb) ------------ kernel BUG at mm/hugetlb.c:462! SMP Modules linked in: xt_pkttype xt_LOG xt_limit [..] CPU: 38 PID: 26839 Comm: map Not tainted 4.0.4-default #1 Hardware name: Dell Inc. PowerEdge R810/0TT6JF, BIOS 2.7.4 04/26/2012 set_vma_resv_flags+0x2d/0x30
The VM_BUG_ON is correct because private and shared mappings have different reservation accounting but the warning clearly shows that the VMA is shared.
When a private COW fails to allocate a new page then only the process that created the VMA gets the page -- all the children unmap the page. If the children access that data in the future then they get killed.
The problem is that the same file is mapped shared and private. During the COW, the allocation fails, the VMAs are traversed to unmap the other private pages but a shared VMA is found and the bug is triggered. This patch identifies such VMAs and skips them.
--- mm/hugetlb.c | 8 ++++++++ 1 file changed, 8 insertions(+)
mm/hugetlb.c +8 -0
@@ -2573,6 +2573,14 @@ static int unmap_ref_private(struct mm_scontinue ;/* +* Shared VMAs have their own reserves and do not affect +* MAP_PRIVATE accounting but it is possible that a shared +* VMA is using the same page so check and skip such VMAs. +*/ +if (iter_vma->vm_flags &VM_MAYSHARE ) +continue ; + +/* * Unmap the page from other VMAs without their own reserves. * They get marked to be SIGKILLed if they fault in these * areas. This is because a future no-page fault on this VMA
Greg Kroah-Hartman
maintainerPATCH 28/54 Initialize msg/shm IPC objects before doing ipc_addid()
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
commit b9a532277938798b53178d5a66af6e2915cb27cf upstream.
As reported by Dmitry Vyukov, we really shouldn't do ipc_addid() before having initialized the IPC object state. Yes, we initialize the IPC object in a locked state, but with all the lockless RCU lookup work, that IPC object lock no longer means that the state cannot be seen.
We already did this for the IPC semaphore code (see commit e8577d1f0329:
"ipc/sem.c: fully initialize sem_array before making it visible") but we clearly forgot about msg and shm.
--- ipc/msg.c | 14 +++++++------- ipc/shm.c | 12 ++++++------ ipc/util.c | 8 ++++---- 3 files changed, 17 insertions(+), 17 deletions(-)
ipc/msg.c +7 -7
@@ -202,13 +202,6 @@ static int newque(struct ipc_namespace *return retval; } -/* ipc_addid() locks msq upon success. */ - id =ipc_addid (&msg_ids (ns), &msq->q_perm, ns->msg_ctlmni); -if (id <0 ) { -ipc_rcu_putref (msq, msg_rcu_free); -return id; - } - msq->q_stime = msq->q_rtime =0 ; msq->q_ctime =get_seconds (); msq->q_cbytes = msq->q_qnum =0 ;
@@ -218,6 +211,13 @@ static int newque(struct ipc_namespace *INIT_LIST_HEAD (&msq->q_receivers);INIT_LIST_HEAD (&msq->q_senders); +/* ipc_addid() locks msq upon success. */ + id =ipc_addid (&msg_ids (ns), &msq->q_perm, ns->msg_ctlmni); +if (id <0 ) { +ipc_rcu_putref (msq, msg_rcu_free); +return id; + } +ipc_unlock_object (&msq->q_perm);rcu_read_unlock ();
ipc/shm.c +6 -6
@@ -544,12 +544,6 @@ static int newseg(struct ipc_namespace *if (IS_ERR (file)) goto no_file; - id =ipc_addid (&shm_ids (ns), &shp->shm_perm, ns->shm_ctlmni); -if (id <0 ) { - error = id; - goto no_id; - } - shp->shm_cprid =task_tgid_vnr (current); shp->shm_lprid =0 ; shp->shm_atim = shp->shm_dtim =0 ;
@@ -559,6 +553,12 @@ static int newseg(struct ipc_namespace * shp->shm_file = file; shp->shm_creator = current; + id =ipc_addid (&shm_ids (ns), &shp->shm_perm, ns->shm_ctlmni); +if (id <0 ) { + error = id; + goto no_id; + } +/* * shmid gets reported as "inode#" in /proc/pid/maps. * proc-ps tools use this. Changing this will break them.
ipc/util.c +4 -4
@@ -292,6 +292,10 @@ int ipc_addid(struct ipc_ids* ids, strucrcu_read_lock ();spin_lock (&new->lock); +current_euid_egid (&euid, &egid); + new->cuid = new->uid = euid; + new->gid = new->cgid = egid; + id =idr_alloc (&ids->ipcs_idr, new, (next_id <0 ) ?0 :ipcid_to_idx (next_id),0 ,GFP_NOWAIT );
@@ -304,10 +308,6 @@ int ipc_addid(struct ipc_ids* ids, struc ids->in_use++; -current_euid_egid (&euid, &egid); - new->cuid = new->uid = euid; - new->gid = new->cgid = egid; -if (next_id <0 ) { new->seq = ids->seq++;if (ids->seq > ids->seq_max)
Greg Kroah-Hartman
maintainerPATCH 29/54 ipvs: do not use random local source address for tunnels
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Julian Anastasov <[email protected]>
commit 4754957f04f5f368792a0eb7dab0ae89fb93dcfd upstream.
Michael Vallaly reports about wrong source address used in rare cases for tunneled traffic. Looks like __ip_vs_get_out_rt in 3.10+ is providing uninitialized dest_dst->dst_saddr.ip because ip_vs_dest_dst_alloc uses kmalloc. While we retry after seeing EINVAL from routing for data that does not look like valid local address, it still succeeded when this memory was previously used from other dests and with different local addresses. As result, we can use valid local address that is not suitable for our real server.
Fix it by providing 0.0.0.0 every time our cache is refreshed. By this way we will get preferred source address from routing.
--- net/netfilter/ipvs/ip_vs_xmit.c | 1 - 1 file changed, 1 deletion(-)
net/netfilter/ipvs/ip_vs_xmit.c +0 -1
@@ -129,7 +129,6 @@ static struct rtable *do_output_route4(smemset (&fl4,0 ,sizeof (fl4)); fl4.daddr = daddr; - fl4.saddr = (rt_mode &IP_VS_RT_MODE_CONNECT ) ? *saddr :0 ; fl4.flowi4_flags = (rt_mode &IP_VS_RT_MODE_KNOWN_NH ) ?FLOWI_FLAG_KNOWN_NH :0 ;
Greg Kroah-Hartman
maintainerPATCH 32/54 regmap: debugfs: Ensure we dont underflow when printing access masks
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <[email protected]>
commit b763ec17ac762470eec5be8ebcc43e4f8b2c2b82 upstream.
If a read is attempted which is smaller than the line length then we may underflow the subtraction we're doing with the unsigned size_t type so move some of the calculation to be additions on the right hand side instead in order to avoid this.
--- drivers/base/regmap/regmap-debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/regmap/regmap-debugfs.c +1 -1
@@ -419,7 +419,7 @@ static ssize_t regmap_access_read_file(s/* If we're in the region the user is trying to read */ if (p >= *ppos) {/* ...but not beyond it */ -if (buf_pos >= count -1 - tot_len) +if (buf_pos + tot_len +1 >= count)break ;/* Format the register */
Greg Kroah-Hartman
maintainerPATCH 48/54 bonding: correct the MAC address for "follow" fail_over_mac policy
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: dingtianhong <[email protected]>
[ Upstream commit a951bc1e6ba58f11df5ed5ddc41311e10f5fd20b ]
The "follow" fail_over_mac policy is useful for multiport devices that either become confused or incur a performance penalty when multiple ports are programmed with the same MAC address, but the same MAC address still may happened by this steps for this policy:
1) echo +eth0 > /sys/class/net/bond0/bonding/slaves bond0 has the same mac address with eth0, it is MAC1.
2) echo +eth1 > /sys/class/net/bond0/bonding/slaves eth1 is backup, eth1 has MAC2.
3) ifconfig eth0 down
eth1 became active slave, bond will swap MAC for eth0 and eth1, so eth1 has MAC1, and eth0 has MAC2.
4) ifconfig eth1 down
there is no active slave, and eth1 still has MAC1, eth2 has MAC2.
5) ifconfig eth0 up
the eth0 became active slave again, the bond set eth0 to MAC1.
Something wrong here, then if you set eth1 up, the eth0 and eth1 will have the same MAC address, it will break this policy for ACTIVE_BACKUP mode.
This patch will fix this problem by finding the old active slave and swap them MAC address before change active slave.
--- drivers/net/bonding/bond_main.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
drivers/net/bonding/bond_main.c +20 -0
@@ -876,6 +876,23 @@ static void bond_mc_swap(struct bonding } } +static struct slave *bond_get_old_active (struct bonding *bond, +struct slave *new_active) +{ +struct slave *slave; +int i; + +bond_for_each_slave (bond, slave, i) { +if (slave == new_active) +continue ; + +if (ether_addr_equal (bond->dev->dev_addr, slave->dev->dev_addr)) +return slave; + } + +return NULL ; +} +/* * bond_do_fail_over_mac *
@@ -919,6 +936,9 @@ static void bond_do_fail_over_mac(structwrite_unlock_bh (&bond->curr_slave_lock);read_unlock (&bond->lock); +if (!old_active) + old_active =bond_get_old_active (bond, new_active); +if (old_active) {memcpy (tmp_mac, new_active->dev->dev_addr,ETH_ALEN ); memcpy(saddr.sa_data, old_active->dev->dev_addr,
Greg Kroah-Hartman
maintainerPATCH 1/54 scsi: fix scsi_error_handler vs. scsi_host_dev_release race
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Hocko <[email protected]>
commit 537b604c8b3aa8b96fe35f87dd085816552e294c upstream.
b9d5c6b7ef57 ("[SCSI] cleanup setting task state in scsi_error_handler()") has introduced a race between scsi_error_handler and scsi_host_dev_release resulting in the hang when the device goes away because scsi_error_handler might miss a wake up:
CPU0 CPU1scsi_error_handler scsi_host_dev_release
kthread_stop()
kthread_should_stop()
test_bit(KTHREAD_SHOULD_STOP)
set_bit(KTHREAD_SHOULD_STOP) wake_up_process() wait_for_completion()
set_current_state(TASK_INTERRUPTIBLE)
schedule()
The most straightforward solution seems to be to invert the ordering of the set_current_state and kthread_should_stop.
The issue has been noticed during reboot test on a 3.0 based kernel but the current code seems to be affected in the same way.
--- drivers/scsi/scsi_error.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/scsi/scsi_error.c +10 -1
@@ -1849,8 +1849,17 @@ int scsi_error_handler(void *data)* We never actually get interrupted because kthread_run * disables signal delivery for the created thread. */ -while (!kthread_should_stop ()) { +while (true) { +/* +* The sequence in kthread_stop() sets the stop flag first +* then wakes the process. To avoid missed wakeups, the task +* should always be in a non running state before the stop +* flag is checked +*/ set_current_state (TASK_INTERRUPTIBLE ); +if (kthread_should_stop ()) +break ; +if ((shost->host_failed ==0 && shost->host_eh_scheduled ==0 ) || shost->host_failed != shost->host_busy) { SCSI_LOG_ERROR_RECOVERY(1,
Greg Kroah-Hartman
maintainerPATCH 10/54 spi: Fix documentation of spi_alloc_master()
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guenter Roeck <[email protected]>
commit a394d635193b641f2c86ead5ada5b115d57c51f8 upstream.
Actually, spi_master_put() after spi_alloc_master() must _not_ be followed by kfree(). The memory is already freed with the call to spi_master_put() through spi_master_class, which registers a release function. Calling both spi_master_put() and kfree() results in often nasty (and delayed) crashes elsewhere in the kernel, often in the networking stack.
This reverts commit eb4af0f5349235df2e4a5057a72fc8962d00308a.
Link to patch and concerns: https://lkml.org/lkml/2012/9/3/269
or
http://lkml.iu.edu/hypermail/linux/kernel/1209.0/00790.html
Alexey Klimov: This revert becomes valid after 94c69f765f1b4a658d96905ec59928e3e3e07e6a when spi-imx.c has been fixed and there is no need to call kfree() so comment for spi_alloc_master() should be fixed.
--- drivers/spi/spi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/spi/spi.c +1 -2
@@ -1030,8 +1030,7 @@ static struct class spi_master_class = {* * The caller is responsible for assigning the bus number and initializing * the master's methods before calling spi_register_master(); and (after errors -* adding the device) calling spi_master_put() and kfree() to prevent a memory -* leak. +* adding the device) calling spi_master_put() to prevent a memory leak. */ struct spi_master *spi_alloc_master (struct device *dev,unsigned size) {
Greg Kroah-Hartman
maintainerPATCH 13/54 ALSA: synth: Fix conflicting OSS device registration on AWE32
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 225db5762dc1a35b26850477ffa06e5cd0097243 upstream.
When OSS emulation is loaded on ISA SB AWE32 chip, we get now kernel warnings like:
WARNING: CPU: 0 PID: 2791 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x51/0x80() sysfs: cannot create duplicate filename '/devices/isa/sbawe.0/sound/card0/seq-oss-0-0'
It's because both emux synth and opl3 drivers try to register their OSS device object with the same static index number 0. This hasn't been a big problem until the recent rewrite of device management code (that exposes sysfs at the same time), but it's been an obvious bug.
This patch works around it just by using a different index number of emux synth object. There can be a more elegant way to fix, but it's enough for now, as this code won't be touched so often, in anyway.
--- sound/synth/emux/emux_oss.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
sound/synth/emux/emux_oss.c +2 -1
@@ -69,7 +69,8 @@ snd_emux_init_seq_oss(struct snd_emux *estruct snd_seq_oss_reg *arg;struct snd_seq_device *dev; -if (snd_seq_device_new (emu->card,0 ,SNDRV_SEQ_DEV_ID_OSS , +/* using device#1 here for avoiding conflicts with OPL3 */ +if (snd_seq_device_new (emu->card,1 ,SNDRV_SEQ_DEV_ID_OSS ,sizeof (struct snd_seq_oss_reg ), &dev) <0 )return ;
Greg Kroah-Hartman
maintainerPATCH 14/54 ASoC: fix broken pxa SoC support
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Robert Jarzmik <[email protected]>
commit 3c8f7710c1c44fb650bc29b6ef78ed8b60cfaa28 upstream.
The previous fix of pxa library support, which was introduced to fix the library dependency, broke the previous SoC behavior, where a machine code binding pxa2xx-ac97 with a coded relied on :
- sound/soc/pxa/pxa2xx-ac97.c
- sound/soc/codecs/XXX.c
For example, the mioa701_wm9713.c machine code is currently broken. The "select ARM" statement wrongly selects the soc/arm/pxa2xx-ac97 for compilation, as per an unfortunate fate SND_PXA2XX_AC97 is both declared in sound/arm/Kconfig and sound/soc/pxa/Kconfig.
Fix this by ensuring that SND_PXA2XX_SOC correctly triggers the correct pxa2xx-ac97 compilation.
--- sound/arm/Kconfig | 15 ++++++++------- sound/soc/pxa/Kconfig | 2 -- 2 files changed, 8 insertions(+), 9 deletions(-)
sound/arm/Kconfig +8 -7
@@ -9,6 +9,14 @@ menuconfig SND_ARM Drivers that are implemented on ASoC can be found in "ALSA for SoC audio support" section. +config SND_PXA2XX_LIB + tristate + select SND_AC97_CODEC if SND_PXA2XX_LIB_AC97 + select SND_DMAENGINE_PCM + +config SND_PXA2XX_LIB_AC97 + bool + if SND_ARM config SND_ARMAACI
@@ -21,13 +29,6 @@ config SND_PXA2XX_PCM tristate select SND_PCM -config SND_PXA2XX_LIB - tristate - select SND_AC97_CODEC if SND_PXA2XX_LIB_AC97 - -config SND_PXA2XX_LIB_AC97 - bool - config SND_PXA2XX_AC97 tristate "AC97 driver for the Intel PXA2xx chip" depends on ARCH_PXA
sound/soc/pxa/Kconfig +0 -2
@@ -1,7 +1,6 @@ config SND_PXA2XX_SOC tristate "SoC Audio for the Intel PXA2xx chip" depends on ARCH_PXA - select SND_ARM select SND_PXA2XX_LIB help Say Y or M if you want to add support for codecs attached to
@@ -24,7 +23,6 @@ config SND_PXA2XX_AC97 config SND_PXA2XX_SOC_AC97 tristate select AC97_BUS - select SND_ARM select SND_PXA2XX_LIB_AC97 select SND_SOC_AC97_BUS
Greg Kroah-Hartman
maintainerPATCH 15/54 ASoC: dwc: correct irq clear method
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yitian Bu <[email protected]>
commit 4873867e5f2bd90faad861dd94865099fc3140f3 upstream.
from Designware I2S datasheet, tx/rx XRUN irq is cleared by reading register TOR/ROR, rather than by writing into them.
--- sound/soc/dwc/designware_i2s.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/dwc/designware_i2s.c +2 -2
@@ -100,10 +100,10 @@ static inline void i2s_clear_irqs(structif (stream ==SNDRV_PCM_STREAM_PLAYBACK ) {for (i =0 ; i <4 ; i++) -i2s_write_reg (dev->i2s_base,TOR (i),0 ); +i2s_read_reg (dev->i2s_base,TOR (i)); }else {for (i =0 ; i <4 ; i++) -i2s_write_reg (dev->i2s_base,ROR (i),0 ); +i2s_read_reg (dev->i2s_base,ROR (i)); } }
Greg Kroah-Hartman
maintainerPATCH 16/54 btrfs: skip waiting on ordered range for special files
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Mahoney <[email protected]>
commit a30e577c96f59b1e1678ea5462432b09bf7d5cbc upstream.
In btrfs_evict_inode, we properly truncate the page cache for evicted inodes but then we call btrfs_wait_ordered_range for every inode as well. It's the right thing to do for regular files but results in incorrect behavior for device inodes for block devices.
filemap_fdatawrite_range gets called with inode->i_mapping which gets resolved to the block device inode before getting passed to wbc_attach_fdatawrite_inode and ultimately to inode_to_bdi. What happens next depends on whether there's an open file handle associated with the inode. If there is, we write to the block device, which is unexpected behavior. If there isn't, we through normally and inode->i_data is used. We can also end up racing against open/close which can result in crashes when i_mapping points to a block device inode that has been closed.
Since there can't be any page cache associated with special file inodes, it's safe to skip the btrfs_wait_ordered_range call entirely and avoid the problem.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=100911
--- fs/btrfs/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/btrfs/inode.c +2 -1
@@ -4650,7 +4650,8 @@ void btrfs_evict_inode(struct inode *ino goto no_delete; }/* do we really want it for ->i_nlink > 0 and zero btrfs_root_refs? */ -btrfs_wait_ordered_range (inode,0 , (u64)-1 ); +if (!special_file (inode->i_mode)) +btrfs_wait_ordered_range (inode,0 , (u64)-1 );if (root->fs_info->log_root_recovering) { BUG_ON(test_bit(BTRFS_INODE_HAS_ORPHAN_ITEM,
Greg Kroah-Hartman
maintainerPATCH 2/54 perf header: Fixup reading of HEADER_NRCPUS feature
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnaldo Carvalho de Melo <[email protected]>
commit caa470475d9b59eeff093ae650800d34612c4379 upstream.
The original patch introducing this header wrote the number of CPUs available and online in one order and then swapped those values when reading, fix it.
Before:
# perf record usleep 1 # perf report --header-only | grep 'nrcpus \(online\|avail\)' # nrcpus online : 4 # nrcpus avail : 4 # echo 0 > /sys/devices/system/cpu/cpu2/online # perf record usleep 1 # perf report --header-only | grep 'nrcpus \(online\|avail\)' # nrcpus online : 4 # nrcpus avail : 3 # echo 0 > /sys/devices/system/cpu/cpu1/online # perf record usleep 1 # perf report --header-only | grep 'nrcpus \(online\|avail\)' # nrcpus online : 4 # nrcpus avail : 2
After the fix, bringing back the CPUs online:
# perf report --header-only | grep 'nrcpus \(online\|avail\)' # nrcpus online : 2 # nrcpus avail : 4 # echo 1 > /sys/devices/system/cpu/cpu2/online # perf record usleep 1 # perf report --header-only | grep 'nrcpus \(online\|avail\)' # nrcpus online : 3 # nrcpus avail : 4 # echo 1 > /sys/devices/system/cpu/cpu1/online # perf record usleep 1 # perf report --header-only | grep 'nrcpus \(online\|avail\)' # nrcpus online : 4 # nrcpus avail : 4
--- tools/perf/util/header.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/util/header.c +2 -2
@@ -1729,7 +1729,7 @@ static int process_nrcpus(struct perf_fiif (ph->needs_swap) nr =bswap_32 (nr); - ph->env.nr_cpus_online = nr; + ph->env.nr_cpus_avail = nr; ret =readn (fd, &nr,sizeof (nr));if (ret !=sizeof (nr))
@@ -1738,7 +1738,7 @@ static int process_nrcpus(struct perf_fiif (ph->needs_swap) nr =bswap_32 (nr); - ph->env.nr_cpus_avail = nr; + ph->env.nr_cpus_online = nr;return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 3/54 ARM: 8429/1: disable GCC SRA optimization
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ard Biesheuvel <[email protected]>
commit a077224fd35b2f7fbc93f14cf67074fc792fbac2 upstream.
While working on the 32-bit ARM port of UEFI, I noticed a strange corruption in the kernel log. The following snprintf() statement (in drivers/firmware/efi/efi.c:efi_md_typeattr_format())
snprintf(pos, size, "|%3s|%2s|%2s|%2s|%3s|%2s|%2s|%2s|%2s]",
was producing the following output in the log:
| | | | | |WB|WT|WC|UC] | | | | | |WB|WT|WC|UC] | | | | | |WB|WT|WC|UC] |RUN| | | | |WB|WT|WC|UC]* |RUN| | | | |WB|WT|WC|UC]* | | | | | |WB|WT|WC|UC] |RUN| | | | |WB|WT|WC|UC]* | | | | | |WB|WT|WC|UC] |RUN| | | | | | | |UC] |RUN| | | | | | | |UC]
As it turns out, this is caused by incorrect code being emitted for the string() function in lib/vsprintf.c. The following code
if (!(spec.flags & LEFT)) {
while (len < spec.field_width--) {
if (buf < end)
*buf = ' ';
++buf;
}
}
for (i = 0; i < len; ++i) {
if (buf < end)
*buf = *s;
++buf; ++s;
}
while (len < spec.field_width--) {
if (buf < end)
*buf = ' ';
++buf;
}when called with len == 0, triggers an issue in the GCC SRA optimization pass (Scalar Replacement of Aggregates), which handles promotion of signed struct members incorrectly. This is a known but as yet unresolved issue.
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65932). In this particular case, it is causing the second while loop to be executed erroneously a single time, causing the additional space characters to be printed.
So disable the optimization by passing -fno-ipa-sra.
--- arch/arm/Makefile | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/arm/Makefile +8 -0
@@ -55,6 +55,14 @@ endif comma = , +# +# The Scalar Replacement of Aggregates (SRA) optimization pass in GCC 4.9 and +# later may result in code being generated that handles signed short and signed +# char struct members incorrectly. So disable it. +# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65932) +# +KBUILD_CFLAGS += $(call cc-option,-fno-ipa-sra) + # This selects which instruction set is used. # Note that GCC does not numerically define an architecture version # macro, but instead defines a whole series of macros which makes
Greg Kroah-Hartman
maintainerPATCH 4/54 windfarm: decrement client count when unregistering
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Bolle <[email protected]>
commit fe2b592173ff0274e70dc44d1d28c19bb995aa7c upstream.
wf_unregister_client() increments the client count when a client unregisters. That is obviously incorrect. Decrement that client count instead.
--- drivers/macintosh/windfarm_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/macintosh/windfarm_core.c +1 -1
@@ -435,7 +435,7 @@ int wf_unregister_client(struct notifier {mutex_lock (&wf_lock);blocking_notifier_chain_unregister (&wf_client_list, nb); - wf_client_count++; + wf_client_count--;if (wf_client_count ==0 )wf_stop_thread ();mutex_unlock (&wf_lock);
Greg Kroah-Hartman
maintainerPATCH 6/54 x86/platform: Fix Geode LX timekeeping in the generic x86 build
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Woodhouse <[email protected]>
commit 03da3ff1cfcd7774c8780d2547ba0d995f7dc03d upstream.
In 2007, commit 07190a08eef36 ("Mark TSC on GeodeLX reliable") bypassed verification of the TSC on Geode LX. However, this code (now in the check_system_tsc_reliable() function in arch/x86/kernel/tsc.c) was only present if CONFIG_MGEODE_LX was set.
OpenWRT has recently started building its generic Geode target for Geode GX, not LX, to include support for additional platforms. This broke the timekeeping on LX-based devices, because the TSC wasn't marked as reliable:
https://dev.openwrt.org/ticket/20531
By adding a runtime check on is_geode_lx(), we can also include the fix if CONFIG_MGEODEGX1 or CONFIG_X86_GENERIC are set, thus fixing the problem.
--- arch/x86/kernel/tsc.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
arch/x86/kernel/tsc.c +10 -7
@@ -20,6 +20,7 @@#include <asm/hypervisor.h> #include <asm/nmi.h> #include <asm/x86_init.h> +#include <asm/geode.h> unsigned int __read_mostly cpu_khz;/* TSC clocks / usec, not used here */ EXPORT_SYMBOL (cpu_khz);
@@ -806,15 +807,17 @@ EXPORT_SYMBOL_GPL(mark_tsc_unstable);static void __init check_system_tsc_reliable (void ) { -#ifdef CONFIG_MGEODE_LX -/* RTSC counts during suspend */ +#if defined(CONFIG_MGEODEGX1 ) || defined(CONFIG_MGEODE_LX ) || defined(CONFIG_X86_GENERIC ) +if (is_geode_lx ()) { +/* RTSC counts during suspend */ #define RTSC_SUSP 0x100 -unsigned long res_low, res_high; +unsigned long res_low, res_high; -rdmsr_safe (MSR_GEODE_BUSCONT_CONF0 , &res_low, &res_high); -/* Geode_LX - the OLPC CPU has a very reliable TSC */ -if (res_low &RTSC_SUSP ) - tsc_clocksource_reliable =1 ; +rdmsr_safe (MSR_GEODE_BUSCONT_CONF0 , &res_low, &res_high); +/* Geode_LX - the OLPC CPU has a very reliable TSC */ +if (res_low &RTSC_SUSP ) + tsc_clocksource_reliable =1 ; + }#endif if (boot_cpu_has (X86_FEATURE_TSC_RELIABLE )) tsc_clocksource_reliable =1 ;
Greg Kroah-Hartman
maintainerPATCH 7/54 Use WARN_ON_ONCE for missing X86_FEATURE_NRIPS
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Dirk=20M=C3=BCller?= <[email protected]>
commit d2922422c48df93f3edff7d872ee4f3191fefb08 upstream.
The cpu feature flags are not ever going to change, so warning everytime can cause a lot of kernel log spam
(in our case more than 10GB/hour).
The warning seems to only occur when nested virtualization is enabled, so it's probably triggered by a KVM bug. This is a sensible and safe change anyway, and the KVM bug fix might not be suitable for stable releases anyway.
--- arch/x86/kvm/svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/svm.c +1 -1
@@ -496,7 +496,7 @@ static void skip_emulated_instruction(ststruct vcpu_svm *svm =to_svm (vcpu);if (svm->vmcb->control.next_rip !=0 ) { -WARN_ON (!static_cpu_has (X86_FEATURE_NRIPS )); +WARN_ON_ONCE (!static_cpu_has (X86_FEATURE_NRIPS )); svm->next_rip = svm->vmcb->control.next_rip; }
Greg Kroah-Hartman
maintainerPATCH 8/54 x86/mm: Set NX on gap between __ex_table and rodata
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Smalley <[email protected]>
commit ab76f7b4ab2397ffdd2f1eb07c55697d19991d10 upstream.
Unused space between the end of __ex_table and the start of rodata can be left W+x in the kernel page tables. Extend the setting of the NX bit to cover this gap by starting from text_end rather than rodata_start.
Before:
---[ High Kernel Mapping ]---
0xffffffff80000000-0xffffffff81000000 16M pmd 0xffffffff81000000-0xffffffff81600000 6M ro PSE GLB x pmd 0xffffffff81600000-0xffffffff81754000 1360K ro GLB x pte 0xffffffff81754000-0xffffffff81800000 688K RW GLB x pte 0xffffffff81800000-0xffffffff81a00000 2M ro PSE GLB NX pmd 0xffffffff81a00000-0xffffffff81b3b000 1260K ro GLB NX pte 0xffffffff81b3b000-0xffffffff82000000 4884K RW GLB NX pte 0xffffffff82000000-0xffffffff82200000 2M RW PSE GLB NX pmd
0xffffffff82200000-0xffffffffa0000000 478M pmd
After:
---[ High Kernel Mapping ]---
0xffffffff80000000-0xffffffff81000000 16M pmd 0xffffffff81000000-0xffffffff81600000 6M ro PSE GLB x pmd 0xffffffff81600000-0xffffffff81754000 1360K ro GLB x pte 0xffffffff81754000-0xffffffff81800000 688K RW GLB NX pte 0xffffffff81800000-0xffffffff81a00000 2M ro PSE GLB NX pmd 0xffffffff81a00000-0xffffffff81b3b000 1260K ro GLB NX pte 0xffffffff81b3b000-0xffffffff82000000 4884K RW GLB NX pte 0xffffffff82000000-0xffffffff82200000 2M RW PSE GLB NX pmd
0xffffffff82200000-0xffffffffa0000000 478M pmd
--- arch/x86/mm/init_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/mm/init_64.c +1 -1
@@ -1163,7 +1163,7 @@ void mark_rodata_ro(void)* has been zapped already via cleanup_highmem(). */ all_end =roundup ((unsigned long )_brk_end,PMD_SIZE ); -set_memory_nx (rodata_start, (all_end - rodata_start) >>PAGE_SHIFT ); +set_memory_nx (text_end, (all_end - text_end) >>PAGE_SHIFT );rodata_test ();
Greg Kroah-Hartman
maintainerPATCH 9/54 x86/xen: Support kexec/kdump in HVM guests by doing a soft reset
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vitaly Kuznetsov <[email protected]>
commit 0b34a166f291d255755be46e43ed5497cdd194f2 upstream.
Currently there is a number of issues preventing PVHVM Xen guests from doing successful kexec/kdump:
- Bound event channels.
- Registered vcpu_info.
- PIRQ/emuirq mappings.
- shared_info frame after XENMAPSPACE_shared_info operation.
- Active grant mappings.
Basically, newly booted kernel stumbles upon already set up Xen interfaces and there is no way to reestablish them. In Xen-4.7 a new feature called 'soft reset' is coming. A guest performing kexec/kdump operation is supposed to call SCHEDOP_shutdown hypercall with SHUTDOWN_soft_reset reason before jumping to new kernel. Hypervisor (with some help from toolstack) will do full domain cleanup (but keeping its memory and vCPU contexts intact) returning the guest to the state it had when it was first booted and thus allowing it to start over.
Doing SHUTDOWN_soft_reset on Xen hypervisors which don't support it is probably OK as by default all unknown shutdown reasons cause domain destroy with a message in toolstack log: 'Unknown shutdown reason code
5. Destroying domain.' which gives a clue to what the problem is and eliminates false expectations.
--- arch/x86/xen/enlighten.c | 23 +++++++++++++++++++++++ include/xen/interface/sched.h | 8 ++++++++ 2 files changed, 31 insertions(+)
arch/x86/xen/enlighten.c +23 -0
@@ -33,6 +33,10 @@#include <linux/memblock.h> #include <linux/edd.h> +#ifdef CONFIG_KEXEC_CORE +#include <linux/kexec.h> +#endif +#include <xen/xen.h> #include <xen/events.h> #include <xen/interface/xen.h>
@@ -1744,6 +1748,21 @@ static struct notifier_block xen_hvm_cpu .notifier_call = xen_hvm_cpu_notify, }; +#ifdef CONFIG_KEXEC_CORE +static void xen_hvm_shutdown (void ) +{ +native_machine_shutdown (); +if (kexec_in_progress) +xen_reboot (SHUTDOWN_soft_reset); +} + +static void xen_hvm_crash_shutdown (struct pt_regs *regs) +{ +native_machine_crash_shutdown (regs); +xen_reboot (SHUTDOWN_soft_reset); +} +#endif +static void __init xen_hvm_guest_init (void ) {init_hvm_pv_info ();
@@ -1758,6 +1777,10 @@ static void __init xen_hvm_guest_init(vo x86_init.irqs.intr_init = xen_init_IRQ;xen_hvm_init_time_ops ();xen_hvm_init_mmu_ops (); +#ifdef CONFIG_KEXEC_CORE + machine_ops.shutdown = xen_hvm_shutdown; + machine_ops.crash_shutdown = xen_hvm_crash_shutdown; +#endif }static bool __init xen_hvm_platform (void )
include/xen/interface/sched.h +8 -0
@@ -107,5 +107,13 @@ struct sched_watchdog {#define SHUTDOWN_suspend 2/* Clean up, save suspend info, kill. */ #define SHUTDOWN_crash 3/* Tell controller we've crashed. */ #define SHUTDOWN_watchdog 4/* Restart because watchdog time expired. */ +/* +* Domain asked to perform 'soft reset' for it. The expected behavior is to +* reset internal Xen state for the domain returning it to the point where it +* was created but leaving the domain's memory contents and vCPU contexts +* intact. This will allow the domain to start over and set up all Xen specific +* interfaces again. +*/ +#define SHUTDOWN_soft_reset 5#endif /* __XEN_PUBLIC_SCHED_H__ */
Greg Kroah-Hartman
maintainercover 3.10.91-stable review
This is the start of the stable review cycle for the 3.10.91 release. There are 54 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 Tue Oct 20 02:00:19 UTC 2015. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.10.91-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 3.10.91-rc1
Christoph Hellwig <[email protected]>
3w-9xxx: don't unmap bounce buffered commands
[email protected] <[email protected]>
staging: speakup: fix speakup-r regression
Joe Thornber <[email protected]>
dm cache: fix NULL pointer when switching from cleaner policy
Andi Kleen <[email protected]>
x86: Add 1/2/4/8 byte optimization to 64bit __copy_{from,to}_user_inatomicBen Hutchings <[email protected]>
genirq: Fix race in register_irq_proc()
Roland Dreier <[email protected]>
fib_rules: Fix dump_rules() not to exit early
dingtianhong <[email protected]>
bonding: correct the MAC address for "follow" fail_over_mac policy
Andreas Schwab <[email protected]>
m68k: Define asmlinkage_protect
Mark Salyzyn <[email protected]>
arm64: readahead: fault retry breaks mmap file read random detection
Eric W. Biederman <[email protected]>
vfs: Test for and handle paths that are unreachable from their mnt_root
Eric W. Biederman <[email protected]>
dcache: Handle escaped paths in prepend_path
Mike Marciniszyn <[email protected]>
IB/qib: Change lkey table allocation to support more MRs
shengyong <[email protected]>
UBI: return ENOSPC if no enough space available
Richard Weinberger <[email protected]>
UBI: Validate data_size
Paul Mackerras <[email protected]>
powerpc/MSI: Fix race condition in tearing down MSI interrupts
NeilBrown <[email protected]>
md: flush ->event_work before stopping array.
James Hogan <[email protected]>
MIPS: dma-default: Fix 32-bit fall back to GFP_DMA
Yao-Wen Mao <[email protected]>
USB: Add reset-resume quirk for two Plantronics usb headphones.
Vincent Palatin <[email protected]>
usb: Add device quirk for Logitech PTZ cameras
Mathias Nyman <[email protected]>
usb: Use the USB_SS_MULT() macro to get the burst multiplier.
Jann Horn <[email protected]>
security: fix typo in security_task_prctl
Mark Brown <[email protected]>
regmap: debugfs: Don't bother actually printing when calculating max length
Mark Brown <[email protected]>
regmap: debugfs: Ensure we don't underflow when printing access masks
Jan Kara <[email protected]>
udf: Check length of extended attributes and allocation descriptors
Julian Anastasov <[email protected]>
ipvs: fix crash with sync protocol v0 and FTP
Julian Anastasov <[email protected]>
ipvs: do not use random local source address for tunnels
Linus Torvalds <[email protected]>
Initialize msg/shm IPC objects before doing ipc_addid()
Reyad Attiyat <[email protected]>
usb: xhci: Add support for URB_ZERO_PACKET to bulk/sg transfers
Mathias Nyman <[email protected]>
xhci: change xhci 1.0 only restrictions to support xhci 1.1
Roger Quadros <[email protected]>
usb: xhci: Clear XHCI_STATE_DYING on start
Johan Hovold <[email protected]>
USB: whiteheat: fix potential null-deref at probe
Daniel Vetter <[email protected]>
drm: Reject DRI1 hw lock ioctl functions for kms drivers
Steve French <[email protected]>
disabling oplocks/leases via module parm enable_oplocks broken for SMB3
Joe Stringer <[email protected]>
netfilter: nf_conntrack: Support expectations in different zones
Mikulas Patocka <[email protected]>
dm raid: fix round up of default region size
Liu.Zhao <[email protected]>
USB: option: add ZTE PIDs
Joe Thornber <[email protected]>
dm btree: add ref counting ops for the leaves of top level btrees
Ian Abbott <[email protected]>
staging: comedi: adl_pci7x3x: fix digital output on PCI-7230
Jeff Mahoney <[email protected]>
btrfs: skip waiting on ordered range for special files
Yitian Bu <[email protected]>
ASoC: dwc: correct irq clear method
Robert Jarzmik <[email protected]>
ASoC: fix broken pxa SoC support
Takashi Iwai <[email protected]>
ALSA: synth: Fix conflicting OSS device registration on AWE32
Mel Gorman <[email protected]>
mm: hugetlbfs: skip shared VMAs when unmapping private pages to satisfy a fault
Tan, Jui Nee <[email protected]>
spi: spi-pxa2xx: Check status register to determine if SSSR_TINT is disabled
Guenter Roeck <[email protected]>
spi: Fix documentation of spi_alloc_master()
Vitaly Kuznetsov <[email protected]>
x86/xen: Support kexec/kdump in HVM guests by doing a soft reset
Stephen Smalley <[email protected]>
x86/mm: Set NX on gap between __ex_table and rodata
Dirk Müller <[email protected]>
Use WARN_ON_ONCE for missing X86_FEATURE_NRIPS
David Woodhouse <[email protected]>
x86/platform: Fix Geode LX timekeeping in the generic x86 build
Shaohua Li <[email protected]>
x86/apic: Serialize LVTT and TSC_DEADLINE writes
Paul Bolle <[email protected]>
windfarm: decrement client count when unregistering
Ard Biesheuvel <[email protected]>
ARM: 8429/1: disable GCC SRA optimization
Arnaldo Carvalho de Melo <[email protected]>
perf header: Fixup reading of HEADER_NRCPUS feature
Michal Hocko <[email protected]>
scsi: fix scsi_error_handler vs. scsi_host_dev_release race
-------------
Diffstat:
Makefile | 4 +- arch/arm/Makefile | 8 +++ arch/arm64/mm/fault.c | 1 + arch/m68k/include/asm/linkage.h | 30 +++++++++++ arch/mips/mm/dma-default.c | 2 +- arch/powerpc/platforms/powernv/pci.c | 5 +- arch/powerpc/sysdev/fsl_msi.c | 5 +- arch/powerpc/sysdev/mpic_pasemi_msi.c | 6 ++- arch/powerpc/sysdev/mpic_u3msi.c | 5 +- arch/powerpc/sysdev/ppc4xx_msi.c | 5 +- arch/x86/include/asm/uaccess_64.h | 24 ++++++--- arch/x86/kernel/apic/apic.c | 7 +++ arch/x86/kernel/tsc.c | 17 ++++--- arch/x86/kvm/svm.c | 2 +- arch/x86/mm/init_64.c | 2 +- arch/x86/xen/enlighten.c | 23 +++++++++ drivers/base/regmap/regmap-debugfs.c | 5 +- drivers/gpu/drm/drm_lock.c | 6 +++ drivers/infiniband/hw/qib/qib.h | 27 ++++------ drivers/infiniband/hw/qib/qib_keys.c | 4 ++ drivers/infiniband/hw/qib/qib_verbs.c | 14 ++++-- drivers/infiniband/hw/qib/qib_verbs.h | 2 + drivers/macintosh/windfarm_core.c | 2 +- drivers/md/dm-cache-policy-cleaner.c | 2 +- drivers/md/dm-raid.c | 3 +- drivers/md/md.c | 2 + drivers/md/persistent-data/dm-btree-internal.h | 6 +++ drivers/md/persistent-data/dm-btree-remove.c | 12 ++--- drivers/md/persistent-data/dm-btree-spine.c | 37 ++++++++++++++ drivers/md/persistent-data/dm-btree.c | 7 +-- drivers/mtd/ubi/io.c | 5 ++ drivers/mtd/ubi/vtbl.c | 1 + drivers/mtd/ubi/wl.c | 1 + drivers/net/bonding/bond_main.c | 20 ++++++++ drivers/scsi/3w-9xxx.c | 28 ++++++++--- drivers/scsi/scsi_error.c | 11 +++- drivers/spi/spi-pxa2xx.c | 4 ++ drivers/spi/spi.c | 3 +- drivers/staging/comedi/drivers/adl_pci7x3x.c | 15 +++++- drivers/staging/speakup/fakekey.c | 1 + drivers/usb/core/config.c | 5 +- drivers/usb/core/quirks.c | 13 +++++ drivers/usb/host/xhci-mem.c | 6 +-- drivers/usb/host/xhci-ring.c | 70 ++++++++++++++++++++------ drivers/usb/host/xhci.c | 8 ++- drivers/usb/serial/option.c | 24 +++++++++ drivers/usb/serial/whiteheat.c | 31 ++++++++++++ fs/btrfs/inode.c | 3 +- fs/cifs/smb2ops.c | 8 ++- fs/dcache.c | 10 ++++ fs/namei.c | 29 ++++++++++- fs/udf/inode.c | 10 ++++ include/linux/security.h | 2 +- include/xen/interface/sched.h | 8 +++ ipc/msg.c | 14 +++--- ipc/shm.c | 12 ++--- ipc/util.c | 8 +-- kernel/irq/proc.c | 19 ++++++- mm/hugetlb.c | 8 +++ net/core/fib_rules.c | 2 +- net/netfilter/ipvs/ip_vs_sync.c | 2 +- net/netfilter/ipvs/ip_vs_xmit.c | 1 - net/netfilter/nf_conntrack_expect.c | 3 +- sound/arm/Kconfig | 15 +++--- sound/soc/dwc/designware_i2s.c | 4 +- sound/soc/pxa/Kconfig | 2 - sound/synth/emux/emux_oss.c | 3 +- tools/perf/util/header.c | 4 +- 68 files changed, 541 insertions(+), 147 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 18/54 dm btree: add ref counting ops for the leaves of top level btrees
3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Thornber <[email protected]>
commit b0dc3c8bc157c60b1d470163882be8c13e1950af upstream.
When using nested btrees, the top leaves of the top levels contain block addresses for the root of the next tree down. If we shadow a shared leaf node the leaf values (sub tree roots) should be incremented accordingly.
This is only an issue if there is metadata sharing in the top levels. Which only occurs if metadata snapshots are being used (as is possible with dm-thinp). And could result in a block from the thinp metadata snap being reused early, thus corrupting the thinp metadata snap.
--- drivers/md/persistent-data/dm-btree-internal.h | 6 ++++ drivers/md/persistent-data/dm-btree-remove.c | 12 ++------ drivers/md/persistent-data/dm-btree-spine.c | 37 +++++++++++++++++++++++++ drivers/md/persistent-data/dm-btree.c | 7 ---- 4 files changed, 47 insertions(+), 15 deletions(-)
drivers/md/persistent-data/dm-btree-internal.h +6 -0
@@ -138,4 +138,10 @@ int lower_bound(struct btree_node *n, uiextern struct dm_block_validator btree_node_validator; +/* +* Value type for upper levels of multi-level btrees. +*/ +extern void init_le64_type (struct dm_transaction_manager *tm, +struct dm_btree_value_type *vt); +#endif /* DM_BTREE_INTERNAL_H */
drivers/md/persistent-data/dm-btree-remove.c +3 -9
@@ -544,14 +544,6 @@ static int remove_raw(struct shadow_spinreturn r; } -static struct dm_btree_value_type le64_type = { - .context =NULL , - .size =sizeof (__le64), - .inc =NULL , - .dec =NULL , - .equal =NULL -}; -int dm_btree_remove (struct dm_btree_info *info,dm_block_t root,uint64_t *keys,dm_block_t *new_root) {
@@ -559,12 +551,14 @@ int dm_btree_remove(struct dm_btree_infoint index =0 , r =0 ;struct shadow_spine spine;struct btree_node *n; +struct dm_btree_value_type le64_vt; +init_le64_type (info->tm, &le64_vt);init_shadow_spine (&spine, info);for (level =0 ; level < info->levels; level++) { r =remove_raw (&spine, info, (level == last_level ? - &info->value_type : &le64_type), + &info->value_type : &le64_vt), root, keys[level], (unsigned *)&index);if (r <0 )break ;
drivers/md/persistent-data/dm-btree-spine.c +37 -0
@@ -249,3 +249,40 @@ int shadow_root(struct shadow_spine *s) {return s->root; } + +static void le64_inc (void *context,const void *value_le) +{ +struct dm_transaction_manager *tm = context; +__le64 v_le; + +memcpy (&v_le, value_le,sizeof (v_le)); +dm_tm_inc (tm,le64_to_cpu (v_le)); +} + +static void le64_dec (void *context,const void *value_le) +{ +struct dm_transaction_manager *tm = context; +__le64 v_le; + +memcpy (&v_le, value_le,sizeof (v_le)); +dm_tm_dec (tm,le64_to_cpu (v_le)); +} + +static int le64_equal (void *context,const void *value1_le,const void *value2_le) +{ +__le64 v1_le, v2_le; + +memcpy (&v1_le, value1_le,sizeof (v1_le)); +memcpy (&v2_le, value2_le,sizeof (v2_le)); +return v1_le == v2_le; +} + +void init_le64_type (struct dm_transaction_manager *tm, +struct dm_btree_value_type *vt) +{ + vt->context = tm; + vt->size =sizeof (__le64); + vt->inc = le64_inc; + vt->dec = le64_dec; + vt->equal = le64_equal; +}
drivers/md/persistent-data/dm-btree.c +1 -6
@@ -651,12 +651,7 @@ static int insert(struct dm_btree_info *struct btree_node *n;struct dm_btree_value_type le64_type; - le64_type.context =NULL ; - le64_type.size =sizeof (__le64); - le64_type.inc =NULL ; - le64_type.dec =NULL ; - le64_type.equal =NULL ; - +init_le64_type (info->tm, &le64_type);init_shadow_spine (&spine, info);for (level =0 ; level < (info->levels -1 ); level++) {
Greg Kroah-Hartman
maintainerPATCH 27/54 usb: xhci: Add support for URB_ZERO_PACKET to bulk/sg transfers
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Reyad Attiyat <[email protected]>
commit 4758dcd19a7d9ba9610b38fecb93f65f56f86346 upstream.
This commit checks for the URB_ZERO_PACKET flag and creates an extra zero-length td if the urb transfer length is a multiple of the endpoint's max packet length.
--- drivers/usb/host/xhci-ring.c | 66 +++++++++++++++++++++++++++++++++---------- drivers/usb/host/xhci.c | 5 +++ 2 files changed, 57 insertions(+), 14 deletions(-)
drivers/usb/host/xhci-ring.c +52 -14
@@ -3167,9 +3167,11 @@ static int queue_bulk_sg_tx(struct xhci_struct xhci_td *td;struct scatterlist *sg;int num_sgs; -int trb_buff_len, this_sg_len, running_total; +int trb_buff_len, this_sg_len, running_total, ret;unsigned int total_packet_count; +bool zero_length_needed;bool first_trb; +int last_trb_num;u64 addr;bool more_trbs_coming;
@@ -3185,13 +3187,27 @@ static int queue_bulk_sg_tx(struct xhci_ total_packet_count =DIV_ROUND_UP (urb->transfer_buffer_length,usb_endpoint_maxp (&urb->ep->desc)); - trb_buff_len =prepare_transfer (xhci, xhci->devs[slot_id], + ret =prepare_transfer (xhci, xhci->devs[slot_id], ep_index, urb->stream_id, num_trbs, urb,0 , mem_flags); -if (trb_buff_len <0 ) -return trb_buff_len; +if (ret <0 ) +return ret; urb_priv = urb->hcpriv; + +/* Deal with URB_ZERO_PACKET - need one more td/trb */ + zero_length_needed = urb->transfer_flags &URB_ZERO_PACKET && + urb_priv->length ==2 ; +if (zero_length_needed) { + num_trbs++; +xhci_dbg (xhci,"Creating zero length td.\n" ); + ret =prepare_transfer (xhci, xhci->devs[slot_id], + ep_index, urb->stream_id, +1 , urb,1 , mem_flags); +if (ret <0 ) +return ret; + } + td = urb_priv->td[0 ];/*
@@ -3221,6 +3237,7 @@ static int queue_bulk_sg_tx(struct xhci_ trb_buff_len = urb->transfer_buffer_length; first_trb = true; + last_trb_num = zero_length_needed ?2 :1 ;/* Queue the first TRB, even if it's zero-length */ do { u32 field = 0;
@@ -3238,12 +3255,15 @@ static int queue_bulk_sg_tx(struct xhci_/* Chain all the TRBs together; clear the chain bit in the last * TRB to indicate it's the last TRB in the chain. */ -if (num_trbs >1 ) { +if (num_trbs > last_trb_num) { field |=TRB_CHAIN ; - }else { -/* FIXME - add check for ZERO_PACKET flag before this */ + }else if (num_trbs == last_trb_num) { td->last_trb = ep_ring->enqueue; field |=TRB_IOC ; + }else if (zero_length_needed && num_trbs ==1 ) { + trb_buff_len =0 ; + urb_priv->td[1 ]->last_trb = ep_ring->enqueue; + field |=TRB_IOC ; }/* Only set interrupt on short packet for IN endpoints */
@@ -3305,7 +3325,7 @@ static int queue_bulk_sg_tx(struct xhci_if (running_total + trb_buff_len > urb->transfer_buffer_length) trb_buff_len = urb->transfer_buffer_length - running_total; - }while (running_total < urb->transfer_buffer_length); + }while (num_trbs >0 );check_trb_math (urb, num_trbs, running_total); giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id,
@@ -3323,7 +3343,9 @@ int xhci_queue_bulk_tx(struct xhci_hcd *int num_trbs;struct xhci_generic_trb *start_trb;bool first_trb; +int last_trb_num;bool more_trbs_coming; +bool zero_length_needed;int start_cycle;u32 field, length_field;
@@ -3354,7 +3376,6 @@ int xhci_queue_bulk_tx(struct xhci_hcd * num_trbs++; running_total +=TRB_MAX_BUFF_SIZE ; } -/* FIXME: this doesn't deal with URB_ZERO_PACKET - need one more */ ret = prepare_transfer(xhci, xhci->devs[slot_id], ep_index, urb->stream_id,
@@ -3363,6 +3384,20 @@ int xhci_queue_bulk_tx(struct xhci_hcd *return ret; urb_priv = urb->hcpriv; + +/* Deal with URB_ZERO_PACKET - need one more td/trb */ + zero_length_needed = urb->transfer_flags &URB_ZERO_PACKET && + urb_priv->length ==2 ; +if (zero_length_needed) { + num_trbs++; +xhci_dbg (xhci,"Creating zero length td.\n" ); + ret =prepare_transfer (xhci, xhci->devs[slot_id], + ep_index, urb->stream_id, +1 , urb,1 , mem_flags); +if (ret <0 ) +return ret; + } + td = urb_priv->td[0 ];/*
@@ -3384,7 +3419,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd * trb_buff_len = urb->transfer_buffer_length; first_trb = true; - + last_trb_num = zero_length_needed ?2 :1 ;/* Queue the first TRB, even if it's zero-length */ do { u32 remainder = 0;
@@ -3401,12 +3436,15 @@ int xhci_queue_bulk_tx(struct xhci_hcd */* Chain all the TRBs together; clear the chain bit in the last * TRB to indicate it's the last TRB in the chain. */ -if (num_trbs >1 ) { +if (num_trbs > last_trb_num) { field |=TRB_CHAIN ; - }else { -/* FIXME - add check for ZERO_PACKET flag before this */ + }else if (num_trbs == last_trb_num) { td->last_trb = ep_ring->enqueue; field |=TRB_IOC ; + }else if (zero_length_needed && num_trbs ==1 ) { + trb_buff_len =0 ; + urb_priv->td[1 ]->last_trb = ep_ring->enqueue; + field |=TRB_IOC ; }/* Only set interrupt on short packet for IN endpoints */
@@ -3444,7 +3482,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd * trb_buff_len = urb->transfer_buffer_length - running_total;if (trb_buff_len >TRB_MAX_BUFF_SIZE ) trb_buff_len =TRB_MAX_BUFF_SIZE ; - }while (running_total < urb->transfer_buffer_length); + }while (num_trbs >0 );check_trb_math (urb, num_trbs, running_total); giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id,
drivers/usb/host/xhci.c +5 -0
@@ -1300,6 +1300,11 @@ int xhci_urb_enqueue(struct usb_hcd *hcdif (usb_endpoint_xfer_isoc (&urb->ep->desc)) size = urb->number_of_packets; +else if (usb_endpoint_is_bulk_out (&urb->ep->desc) && + urb->transfer_buffer_length >0 && + urb->transfer_flags &URB_ZERO_PACKET && + !(urb->transfer_buffer_length %usb_endpoint_maxp (&urb->ep->desc))) + size =2 ;else size =1 ;
Greg Kroah-Hartman
maintainerPATCH 30/54 ipvs: fix crash with sync protocol v0 and FTP
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Julian Anastasov <[email protected]>
commit 56184858d1fc95c46723436b455cb7261cd8be6f upstream.
Fix crash in 3.5+ if FTP is used after switchingsync_version to 0.
--- net/netfilter/ipvs/ip_vs_sync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/ipvs/ip_vs_sync.c +1 -1
@@ -599,7 +599,7 @@ static void ip_vs_sync_conn_v0(struct ne pkts =atomic_add_return (1 , &cp->in_pkts); else pkts =sysctl_sync_threshold (ipvs); -ip_vs_sync_conn (net, cp->control, pkts); +ip_vs_sync_conn (net, cp, pkts); } }
Greg Kroah-Hartman
maintainerPATCH 31/54 udf: Check length of extended attributes and allocation descriptors
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <[email protected]>
commit 23b133bdc452aa441fcb9b82cbf6dd05cfd342d0 upstream.
Check length of extended attributes and allocation descriptors when loading inodes from disk. Otherwise corrupted filesystems could confuse the code and make the kernel oops.
[Jan and Jiri fixed it in 3.12 stable, i ported it to 3.10 stable,
replaced bs by inode->i_sb->s_blocksize]
--- fs/udf/inode.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
fs/udf/inode.c +10 -0
@@ -1495,6 +1495,16 @@ static void udf_fill_inode(struct inode iinfo->i_checkpoint =le32_to_cpu (efe->checkpoint); } +/* +* Sanity check length of allocation descriptors and extended attrs to +* avoid integer overflows +*/ +if (iinfo->i_lenEAttr > inode->i_sb->s_blocksize || iinfo->i_lenAlloc > inode->i_sb->s_blocksize) +return ; +/* Now do exact checks */ +if (udf_file_entry_alloc_offset (inode) + iinfo->i_lenAlloc > inode->i_sb->s_blocksize) +return ; +switch (fe->icbTag.fileType) {case ICBTAG_FILE_TYPE_DIRECTORY : inode->i_op = &udf_dir_inode_operations;
Greg Kroah-Hartman
maintainerPATCH 33/54 regmap: debugfs: Dont bother actually printing when calculating max length
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <[email protected]>
commit 176fc2d5770a0990eebff903ba680d2edd32e718 upstream.
The in kernel snprintf() will conveniently return the actual length of the printed string even if not given an output beffer at all so just do that rather than relying on the user to pass in a suitable buffer, ensuring that we don't need to worry if the buffer was truncated due to the size of the buffer passed in.
--- drivers/base/regmap/regmap-debugfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/base/regmap/regmap-debugfs.c +1 -2
@@ -23,8 +23,7 @@ static struct dentry *regmap_debugfs_roo/* Calculate the length of a fixed format */ static size_t regmap_calc_reg_len (int max_val,char *buf,size_t buf_size) { -snprintf (buf, buf_size,"%x" , max_val); -return strlen (buf); +return snprintf (NULL ,0 ,"%x" , max_val); } static ssize_t regmap_name_read_file(struct file *file,
Greg Kroah-Hartman
maintainerPATCH 34/54 security: fix typo in security_task_prctl
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jann Horn <[email protected]>
commit b7f76ea2ef6739ee484a165ffbac98deb855d3d3 upstream.
--- include/linux/security.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/security.h +1 -1
@@ -2394,7 +2394,7 @@ static inline int security_task_prctl(inunsigned long arg4, unsigned long arg5) { - return cap_task_prctl(option, arg2, arg3, arg3, arg5); + return cap_task_prctl(option, arg2, arg3, arg4, arg5); }static inline void security_task_to_inode (struct task_struct *p,struct inode *inode)
Greg Kroah-Hartman
maintainerPATCH 19/54 USB: option: add ZTE PIDs
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Liu.Zhao" <[email protected]>
commit 19ab6bc5674a30fdb6a2436b068d19a3c17dc73e upstream.
This is intended to add ZTE device PIDs on kernel.
--- drivers/usb/serial/option.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
drivers/usb/serial/option.c +24 -0
@@ -276,6 +276,10 @@ static void option_instat_callback(struc#define ZTE_PRODUCT_MF622 0x0001#define ZTE_PRODUCT_MF628 0x0015#define ZTE_PRODUCT_MF626 0x0031 +#define ZTE_PRODUCT_ZM8620_X 0x0396 +#define ZTE_PRODUCT_ME3620_MBIM 0x0426 +#define ZTE_PRODUCT_ME3620_X 0x1432 +#define ZTE_PRODUCT_ME3620_L 0x1433#define ZTE_PRODUCT_AC2726 0xfff1#define ZTE_PRODUCT_CDMA_TECH 0xfffe#define ZTE_PRODUCT_AC8710T 0xffff
@@ -549,6 +553,18 @@ static const struct option_blacklist_inf .sendsetup = BIT(1) | BIT(2) | BIT(3), }; +static const struct option_blacklist_info zte_me3620_mbim_blacklist = { + .reserved =BIT (2 ) |BIT (3 ) |BIT (4 ), +}; + +static const struct option_blacklist_info zte_me3620_xl_blacklist = { + .reserved =BIT (3 ) |BIT (4 ) |BIT (5 ), +}; + +static const struct option_blacklist_info zte_zm8620_x_blacklist = { + .reserved =BIT (3 ) |BIT (4 ) |BIT (5 ), +}; +static const struct option_blacklist_info huawei_cdc12_blacklist = { .reserved =BIT (1 ) |BIT (2 ), };
@@ -1579,6 +1595,14 @@ static const struct usb_device_id option .driver_info = (kernel_ulong_t)&zte_ad3812_z_blacklist }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2716, 0xff, 0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_mc2716_z_blacklist }, + { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_ME3620_L), + .driver_info = (kernel_ulong_t)&zte_me3620_xl_blacklist }, + { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_ME3620_MBIM), + .driver_info = (kernel_ulong_t)&zte_me3620_mbim_blacklist }, + { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_ME3620_X), + .driver_info = (kernel_ulong_t)&zte_me3620_xl_blacklist }, + { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_ZM8620_X), + .driver_info = (kernel_ulong_t)&zte_zm8620_x_blacklist }, { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x01) }, { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x05) }, { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x86, 0x10) },
Greg Kroah-Hartman
maintainerPATCH 35/54 usb: Use the USB_SS_MULT() macro to get the burst multiplier.
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Nyman <[email protected]>
commit ff30cbc8da425754e8ab96904db1d295bd034f27 upstream.
Bits 1:0 of the bmAttributes are used for the burst multiplier. The rest of the bits used to be reserved (zero), but USB3.1 takes bit 7 into use.
Use the existing USB_SS_MULT() macro instead to make sure the mult value and hence max packet calculations are correct for USB3.1 devices.
Note that burst multiplier in bmAttributes is zero based and that the USB_SS_MULT() macro adds one.
--- drivers/usb/core/config.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/usb/core/config.c +3 -2
@@ -114,7 +114,7 @@ static void usb_parse_ss_endpoint_compan cfgno, inum, asnum, ep->desc.bEndpointAddress); ep->ss_ep_comp.bmAttributes =16 ; }else if (usb_endpoint_xfer_isoc (&ep->desc) && - desc->bmAttributes >2 ) { +USB_SS_MULT (desc->bmAttributes) >3 ) { dev_warn(ddev, "Isoc endpoint has Mult of %d in " "config %d interface %d altsetting %d ep %d: " "setting to 3\n", desc->bmAttributes + 1,
@@ -123,7 +123,8 @@ static void usb_parse_ss_endpoint_compan }if (usb_endpoint_xfer_isoc (&ep->desc)) - max_tx = (desc->bMaxBurst +1 ) * (desc->bmAttributes +1 ) * + max_tx = (desc->bMaxBurst +1 ) * + (USB_SS_MULT (desc->bmAttributes)) *usb_endpoint_maxp (&ep->desc);else if (usb_endpoint_xfer_int (&ep->desc)) max_tx = usb_endpoint_maxp(&ep->desc) *
Greg Kroah-Hartman
maintainerPATCH 36/54 usb: Add device quirk for Logitech PTZ cameras
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vincent Palatin <[email protected]>
commit 72194739f54607bbf8cfded159627a2015381557 upstream.
Add a device quirk for the Logitech PTZ Pro Camera and its sibling the ConferenceCam CC3000e Camera.
This fixes the failed camera enumeration on some boot, particularly on machines with fast CPU.
Tested by connecting a Logitech PTZ Pro Camera to a machine with a Haswell Core i7-4600U CPU @ 2.10GHz, and doing thousands of reboot cycles while recording the kernel logs and taking camera picture after each boot. Before the patch, more than 7% of the boots show some enumeration transfer failures and in a few of them, the kernel is giving up before actually enumerating the webcam. After the patch, the enumeration has been correct on every reboot.
--- drivers/usb/core/quirks.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/usb/core/quirks.c +7 -0
@@ -53,6 +53,13 @@ static const struct usb_device_id usb_qu { USB_DEVICE(0x046d, 0x082d), .driver_info = USB_QUIRK_DELAY_INIT }, { USB_DEVICE(0x046d, 0x0843), .driver_info = USB_QUIRK_DELAY_INIT }, + /* Logitech ConferenceCam CC3000e */ + { USB_DEVICE(0x046d, 0x0847), .driver_info = USB_QUIRK_DELAY_INIT }, + { USB_DEVICE(0x046d, 0x0848), .driver_info = USB_QUIRK_DELAY_INIT }, + + /* Logitech PTZ Pro Camera */ + { USB_DEVICE(0x046d, 0x0853), .driver_info = USB_QUIRK_DELAY_INIT }, + /* Logitech Quickcam Fusion */ { USB_DEVICE(0x046d, 0x08c1), .driver_info = USB_QUIRK_RESET_RESUME },
Greg Kroah-Hartman
maintainerPATCH 37/54 USB: Add reset-resume quirk for two Plantronics usb headphones.
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yao-Wen Mao <[email protected]>
commit 8484bf2981b3d006426ac052a3642c9ce1d8d980 upstream.
These two headphones need a reset-resume quirk to properly resume to original volume level.
--- drivers/usb/core/quirks.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/usb/core/quirks.c +6 -0
@@ -84,6 +84,12 @@ static const struct usb_device_id usb_qu/* Philips PSC805 audio device */ { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME }, + /* Plantronic Audio 655 DSP */ + { USB_DEVICE(0x047f, 0xc008), .driver_info = USB_QUIRK_RESET_RESUME }, + + /* Plantronic Audio 648 USB */ + { USB_DEVICE(0x047f, 0xc013), .driver_info = USB_QUIRK_RESET_RESUME }, + /* Artisman Watchdog Dongle */ { USB_DEVICE(0x04b4, 0x0526), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS },
Greg Kroah-Hartman
maintainerPATCH 38/54 MIPS: dma-default: Fix 32-bit fall back to GFP_DMA
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Hogan <[email protected]>
commit 53960059d56ecef67d4ddd546731623641a3d2d1 upstream.
If there is a DMA zone (usually 24bit = 16MB I believe), but no DMA32 zone, as is the case for some 32-bit kernels, then massage_gfp_flags() will cause DMA memory allocated for devices with a 32..63-bit coherent_dma_mask to fall back to using __GFP_DMA, even though there may only be 32-bits of physical address available anyway.
Correct that case to compare against a mask the size of phys_addr_t instead of always using a 64-bit mask.
Patchwork: https://patchwork.linux-mips.org/patch/9610/
--- arch/mips/mm/dma-default.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/mm/dma-default.c +1 -1
@@ -91,7 +91,7 @@ static gfp_t massage_gfp_flags(const str else#endif #if defined(CONFIG_ZONE_DMA ) && !defined(CONFIG_ZONE_DMA32 ) -if (dev->coherent_dma_mask <DMA_BIT_MASK (64 )) +if (dev->coherent_dma_mask <DMA_BIT_MASK (sizeof (phys_addr_t) *8 )) dma_flag = __GFP_DMA; else#endif
Greg Kroah-Hartman
maintainerPATCH 39/54 md: flush ->event_work before stopping array.
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: NeilBrown <[email protected]>
commit ee5d004fd0591536a061451eba2b187092e9127c upstream.
The 'event_work' worker used by dm-raid may still be running when the array is stopped. This can result in an oops.
So flush the workqueue on which it is run after detaching and before destroying the device.
--- drivers/md/md.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/md/md.c +2 -0
@@ -5306,6 +5306,8 @@ EXPORT_SYMBOL_GPL(md_stop_writes);static void __md_stop (struct mddev *mddev) { mddev->ready =0 ; +/* Ensure ->event_work is done */ +flush_workqueue (md_misc_wq); mddev->pers->stop (mddev);if (mddev->pers->sync_request && mddev->to_remove ==NULL ) mddev->to_remove = &md_redundancy_group;
Greg Kroah-Hartman
maintainerPATCH 40/54 powerpc/MSI: Fix race condition in tearing down MSI interrupts
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Mackerras <[email protected]>
commit e297c939b745e420ef0b9dc989cb87bda617b399 upstream.
This fixes a race which can result in the same virtual IRQ number being assigned to two different MSI interrupts. The most visible consequence of that is usually a warning and stack trace from the sysfs code about an attempt to create a duplicate entry in sysfs.
The race happens when one CPU (say CPU 0) is disposing of an MSI while another CPU (say CPU 1) is setting up an MSI. CPU 0 calls (for example) pnv_teardown_msi_irqs(), which calls msi_bitmap_free_hwirqs() to indicate that the MSI (i.e. its hardware IRQ number) is no longer in use. Then, before CPU 0 gets to calling irq_dispose_mapping() to free up the virtal IRQ number, CPU 1 comes in and calls msi_bitmap_alloc_hwirqs() to allocate an MSI, and gets the same hardware IRQ number that CPU 0 just freed. CPU 1 then calls irq_create_mapping() to get a virtual IRQ number, which sees that there is currently a mapping for that hardware IRQ number and returns the corresponding virtual IRQ number (which is the same virtual IRQ number that CPU 0 was using). CPU 0 then calls irq_dispose_mapping() and frees that virtual IRQ number. Now, if another CPU comes along and calls irq_create_mapping(), it is likely to get the virtual IRQ number that was just freed, resulting in the same virtual IRQ number apparently being used for two different hardware interrupts.
To fix this race, we just move the call to msi_bitmap_free_hwirqs() to after the call to irq_dispose_mapping(). Since virq_to_hw() doesn't work for the virtual IRQ number after irq_dispose_mapping() has been called, we need to call it before irq_dispose_mapping() and remember the result for the msi_bitmap_free_hwirqs() call.
The pattern of calling msi_bitmap_free_hwirqs() before irq_dispose_mapping() appears in 5 places under arch/powerpc, and appears to have originated in commit 05af7bd2d75e ("[POWERPC] MPIC U3/U4 MSI backend") from 2007.
--- arch/powerpc/platforms/powernv/pci.c | 5 +++-- arch/powerpc/sysdev/fsl_msi.c | 5 +++-- arch/powerpc/sysdev/mpic_pasemi_msi.c | 6 ++++-- arch/powerpc/sysdev/mpic_u3msi.c | 5 +++-- arch/powerpc/sysdev/ppc4xx_msi.c | 5 +++-- 5 files changed, 16 insertions(+), 10 deletions(-)
arch/powerpc/platforms/powernv/pci.c +3 -2
@@ -106,6 +106,7 @@ static void pnv_teardown_msi_irqs(structstruct pci_controller *hose =pci_bus_to_host (pdev->bus);struct pnv_phb *phb = hose->private_data;struct msi_desc *entry; +irq_hw_number_t hwirq;if (WARN_ON (!phb))return ;
@@ -113,10 +114,10 @@ static void pnv_teardown_msi_irqs(structlist_for_each_entry (entry, &pdev->msi_list, list) {if (entry->irq ==NO_IRQ )continue ; + hwirq =virq_to_hw (entry->irq);irq_set_msi_desc (entry->irq,NULL ); -msi_bitmap_free_hwirqs (&phb->msi_bmp, -virq_to_hw (entry->irq) - phb->msi_base,1 );irq_dispose_mapping (entry->irq); +msi_bitmap_free_hwirqs (&phb->msi_bmp, hwirq - phb->msi_base,1 ); } }#endif /* CONFIG_PCI_MSI */
arch/powerpc/sysdev/fsl_msi.c +3 -2
@@ -108,15 +108,16 @@ static void fsl_teardown_msi_irqs(struct {struct msi_desc *entry;struct fsl_msi *msi_data; +irq_hw_number_t hwirq;list_for_each_entry (entry, &pdev->msi_list, list) {if (entry->irq ==NO_IRQ )continue ; + hwirq =virq_to_hw (entry->irq); msi_data =irq_get_chip_data (entry->irq);irq_set_msi_desc (entry->irq,NULL ); -msi_bitmap_free_hwirqs (&msi_data->bitmap, -virq_to_hw (entry->irq),1 );irq_dispose_mapping (entry->irq); +msi_bitmap_free_hwirqs (&msi_data->bitmap, hwirq,1 ); }return ;
arch/powerpc/sysdev/mpic_pasemi_msi.c +4 -2
@@ -74,6 +74,7 @@ static int pasemi_msi_check_device(strucstatic void pasemi_msi_teardown_msi_irqs (struct pci_dev *pdev) {struct msi_desc *entry; +irq_hw_number_t hwirq;pr_debug ("pasemi_msi_teardown_msi_irqs, pdev %p\n" , pdev);
@@ -81,10 +82,11 @@ static void pasemi_msi_teardown_msi_irqsif (entry->irq ==NO_IRQ )continue ; + hwirq =virq_to_hw (entry->irq);irq_set_msi_desc (entry->irq,NULL ); -msi_bitmap_free_hwirqs (&msi_mpic->msi_bitmap, -virq_to_hw (entry->irq),ALLOC_CHUNK );irq_dispose_mapping (entry->irq); +msi_bitmap_free_hwirqs (&msi_mpic->msi_bitmap, + hwirq,ALLOC_CHUNK ); }return ;
arch/powerpc/sysdev/mpic_u3msi.c +3 -2
@@ -124,15 +124,16 @@ static int u3msi_msi_check_device(structstatic void u3msi_teardown_msi_irqs (struct pci_dev *pdev) {struct msi_desc *entry; +irq_hw_number_t hwirq;list_for_each_entry (entry, &pdev->msi_list, list) {if (entry->irq ==NO_IRQ )continue ; + hwirq =virq_to_hw (entry->irq);irq_set_msi_desc (entry->irq,NULL ); -msi_bitmap_free_hwirqs (&msi_mpic->msi_bitmap, -virq_to_hw (entry->irq),1 );irq_dispose_mapping (entry->irq); +msi_bitmap_free_hwirqs (&msi_mpic->msi_bitmap, hwirq,1 ); }return ;
arch/powerpc/sysdev/ppc4xx_msi.c +3 -2
@@ -121,16 +121,17 @@ void ppc4xx_teardown_msi_irqs(struct pci {struct msi_desc *entry;struct ppc4xx_msi *msi_data = &ppc4xx_msi; +irq_hw_number_t hwirq;dev_dbg (&dev->dev,"PCIE-MSI: tearing down msi irqs\n" );list_for_each_entry (entry, &dev->msi_list, list) {if (entry->irq ==NO_IRQ )continue ; + hwirq =virq_to_hw (entry->irq);irq_set_msi_desc (entry->irq,NULL ); -msi_bitmap_free_hwirqs (&msi_data->bitmap, -virq_to_hw (entry->irq),1 );irq_dispose_mapping (entry->irq); +msi_bitmap_free_hwirqs (&msi_data->bitmap, hwirq,1 ); } }
Greg Kroah-Hartman
maintainerPATCH 41/54 UBI: Validate data_size
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Richard Weinberger <[email protected]>
commit 281fda27673f833a01d516658a64d22a32c8e072 upstream.
Make sure that data_size is less than LEB size. Otherwise a handcrafted UBI image is able to trigger an out of bounds memory access in ubi_compare_lebs().
--- drivers/mtd/ubi/io.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/mtd/ubi/io.c +5 -0
@@ -931,6 +931,11 @@ static int validate_vid_hdr(const struct goto bad; } +if (data_size > ubi->leb_size) { +ubi_err ("bad data_size" ); + goto bad; + } +if (vol_type ==UBI_VID_STATIC ) {/* * Although from high-level point of view static volumes may
Greg Kroah-Hartman
maintainerPATCH 42/54 UBI: return ENOSPC if no enough space available
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: shengyong <[email protected]>
commit 7c7feb2ebfc9c0552c51f0c050db1d1a004faac5 upstream.
UBI: attaching mtd1 to ubi0
UBI: scanning is finished
UBI error: init_volumes: not enough PEBs, required 706, available 686 UBI error: ubi_wl_init: no enough physical eraseblocks (-20, need 1) UBI error: ubi_attach_mtd_dev: failed to attach mtd1, error -12 <= NOT ENOMEM UBI error: ubi_init: cannot attach mtd1
If available PEBs are not enough when initializing volumes, return -ENOSPC directly. If available PEBs are not enough when initializing WL, return -ENOSPC instead of -ENOMEM.
--- drivers/mtd/ubi/vtbl.c | 1 + drivers/mtd/ubi/wl.c | 1 + 2 files changed, 2 insertions(+)
drivers/mtd/ubi/vtbl.c +1 -0
@@ -651,6 +651,7 @@ static int init_volumes(struct ubi_devicif (ubi->corr_peb_count)ubi_err ("%d PEBs are corrupted and not used" , ubi->corr_peb_count); +return -ENOSPC ; } ubi->rsvd_pebs += reserved_pebs; ubi->avail_pebs -= reserved_pebs;
drivers/mtd/ubi/wl.c +1 -0
@@ -1978,6 +1978,7 @@ int ubi_wl_init(struct ubi_device *ubi,if (ubi->corr_peb_count)ubi_err ("%d PEBs are corrupted and not used" , ubi->corr_peb_count); + err = -ENOSPC ; goto out_free; } ubi->avail_pebs -= reserved_pebs;
Greg Kroah-Hartman
maintainerPATCH 43/54 IB/qib: Change lkey table allocation to support more MRs
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Marciniszyn <[email protected]>
commit d6f1c17e162b2a11e708f28fa93f2f79c164b442 upstream.
The lkey table is allocated with with a get_user_pages() with an order based on a number of index bits from a module parameter.
The underlying kernel code cannot allocate that many contiguous pages.
There is no reason the underlying memory needs to be physically contiguous.
This patch:
- switches the allocation/deallocation to vmalloc/vfree
- caps the number of bits to 23 to insure at least 1 generation bit
o this matches the module parameter description
--- drivers/infiniband/hw/qib/qib.h | 27 +++++++++++---------------- drivers/infiniband/hw/qib/qib_keys.c | 4 ++++ drivers/infiniband/hw/qib/qib_verbs.c | 14 ++++++++++---- drivers/infiniband/hw/qib/qib_verbs.h | 2 ++ 4 files changed, 27 insertions(+), 20 deletions(-)
drivers/infiniband/hw/qib/qib.h +11 -16
@@ -1467,27 +1467,22 @@ extern struct mutex qib_mutex;* first to avoid possible serial port delays from printk. */ #define qib_early_err (dev, fmt, ...) \ - do { \ - dev_err(dev, fmt, ##__VA_ARGS__); \ - } while (0) + dev_err(dev, fmt, ##__VA_ARGS__)#define qib_dev_err (dd, fmt, ...) \ - do { \ - dev_err(&(dd)->pcidev->dev, "%s: " fmt, \ - qib_get_unit_name((dd)->unit), ##__VA_ARGS__); \ - } while (0) + dev_err(&(dd)->pcidev->dev, "%s: " fmt, \ + qib_get_unit_name((dd)->unit), ##__VA_ARGS__) -#define qib_dev_porterr (dd, port, fmt, ...) \ - do { \ - dev_err(&(dd)->pcidev->dev, "%s: IB%u:%u " fmt, \ - qib_get_unit_name((dd)->unit), (dd)->unit, (port), \ - ##__VA_ARGS__); \ - } while (0) +#define qib_dev_warn (dd, fmt, ...) \ + dev_warn(&(dd)->pcidev->dev, "%s: " fmt, \ + qib_get_unit_name((dd)->unit), ##__VA_ARGS__) +#define qib_dev_porterr (dd, port, fmt, ...) \ + dev_err(&(dd)->pcidev->dev, "%s: IB%u:%u " fmt, \ + qib_get_unit_name((dd)->unit), (dd)->unit, (port), \ + ##__VA_ARGS__)#define qib_devinfo (pcidev, fmt, ...) \ - do { \ - dev_info(&(pcidev)->dev, fmt, ##__VA_ARGS__); \ - } while (0) + dev_info(&(pcidev)->dev, fmt, ##__VA_ARGS__)/* * this is used for formatting hw error messages...
drivers/infiniband/hw/qib/qib_keys.c +4 -0
@@ -86,6 +86,10 @@ int qib_alloc_lkey(struct qib_mregion *m* unrestricted LKEY. */ rkt->gen++; +/* +* bits are capped in qib_verbs.c to insure enough bits +* for generation number +*/ mr->lkey = (r << (32 - ib_qib_lkey_table_size)) | ((((1 << (24 - ib_qib_lkey_table_size)) -1 ) & rkt->gen) <<8 );
drivers/infiniband/hw/qib/qib_verbs.c +10 -4
@@ -40,6 +40,7 @@#include <linux/rculist.h> #include <linux/mm.h> #include <linux/random.h> +#include <linux/vmalloc.h> #include "qib.h" #include "qib_common.h"
@@ -2084,10 +2085,16 @@ int qib_register_ib_device(struct qib_de* the LKEY). The remaining bits act as a generation number or tag. */ spin_lock_init (&dev->lk_table.lock); +/* insure generation is at least 4 bits see keys.c */ +if (ib_qib_lkey_table_size >MAX_LKEY_TABLE_BITS ) { +qib_dev_warn (dd,"lkey bits %u too large, reduced to %u\n" , + ib_qib_lkey_table_size,MAX_LKEY_TABLE_BITS ); + ib_qib_lkey_table_size =MAX_LKEY_TABLE_BITS ; + } dev->lk_table.max =1 << ib_qib_lkey_table_size; lk_tab_size = dev->lk_table.max *sizeof (*dev->lk_table.table); dev->lk_table.table = (struct qib_mregion __rcu **) -__get_free_pages (GFP_KERNEL ,get_order (lk_tab_size)); +vmalloc (lk_tab_size);if (dev->lk_table.table ==NULL ) { ret = -ENOMEM ; goto err_lk;
@@ -2260,7 +2267,7 @@ err_tx:sizeof (struct qib_pio_header ), dev->pio_hdrs, dev->pio_hdrs_phys); err_hdrs: -free_pages ((unsigned long ) dev->lk_table.table,get_order (lk_tab_size)); +vfree (dev->lk_table.table); err_lk:kfree (dev->qp_table); err_qpt:
@@ -2314,8 +2321,7 @@ void qib_unregister_ib_device(struct qibsizeof (struct qib_pio_header ), dev->pio_hdrs, dev->pio_hdrs_phys); lk_tab_size = dev->lk_table.max *sizeof (*dev->lk_table.table); -free_pages ((unsigned long ) dev->lk_table.table, -get_order (lk_tab_size)); +vfree (dev->lk_table.table);kfree (dev->qp_table); }
drivers/infiniband/hw/qib/qib_verbs.h +2 -0
@@ -645,6 +645,8 @@ struct qib_qpn_table {struct qpn_map map[QPNMAP_ENTRIES ]; }; +#define MAX_LKEY_TABLE_BITS 23 +struct qib_lkey_table {spinlock_t lock;/* protect changes in this struct */ u32 next;/* next unused index (speeds search) */
Greg Kroah-Hartman
maintainerPATCH 44/54 dcache: Handle escaped paths in prepend_path
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Eric W. Biederman" <[email protected]>
commit cde93be45a8a90d8c264c776fab63487b5038a65 upstream.
A rename can result in a dentry that by walking up d_parent will never reach it's mnt_root. For lack of a better term I call this an escaped path.
prepend_path is called by four different functions __d_path, d_absolute_path, d_path, and getcwd.
__d_path only wants to see paths are connected to the root it passes in. So __d_path needs prepend_path to return an error.
d_absolute_path similarly wants to see paths that are connected to some root. Escaped paths are not connected to any mnt_root so d_absolute_path needs prepend_path to return an error greater than 1. So escaped paths will be treated like paths on lazily unmounted mounts.
getcwd needs to prepend "(unreachable)" so getcwd also needs prepend_path to return an error.
d_path is the interesting hold out. d_path just wants to print something, and does not care about the weird cases. Which raises the question what should be printed?
Given that <escaped_path>/<anything> should result in -ENOENT I believe it is desirable for escaped paths to be printed as empty paths. As there are not really any meaninful path components when considered from the perspective of a mount tree.
So tweak prepend_path to return an empty path with an new error code of 3 when it encounters an escaped path.
fs/dcache.c +10 -0
@@ -2534,6 +2534,8 @@ static int prepend_path(const struct path *path,struct dentry *dentry = path->dentry;struct vfsmount *vfsmnt = path->mnt;struct mount *mnt =real_mount (vfsmnt); +char *orig_buffer = *buffer; +int orig_len = *buflen;bool slash = false;int error =0 ;
@@ -2541,6 +2543,14 @@ static int prepend_path(const struct path *path,struct dentry * parent;if (dentry == vfsmnt->mnt_root ||IS_ROOT (dentry)) { +/* Escaped? */ +if (dentry != vfsmnt->mnt_root) { + *buffer = orig_buffer; + *buflen = orig_len; + slash = false; + error =3 ; + goto global_root; + }/* Global root? */ if (!mnt_has_parent (mnt)) goto global_root;
Signature · 1 line
2.2.1
Greg Kroah-Hartman
maintainerPATCH 45/54 vfs: Test for and handle paths that are unreachable from their mnt_root
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Eric W. Biederman" <[email protected]>
commit 397d425dc26da728396e66d392d5dcb8dac30c37 upstream.
In rare cases a directory can be renamed out from under a bind mount. In those cases without special handling it becomes possible to walk up the directory tree to the root dentry of the filesystem and down from the root dentry to every other file or directory on the filesystem.
Like division by zero .. from an unconnected path can not be given a useful semantic as there is no predicting at which path component the code will realize it is unconnected. We certainly can not match the current behavior as the current behavior is a security hole.
Therefore when encounting .. when following an unconnected path return -ENOENT.
- Add a function path_connected to verify path->dentry is reachable from path->mnt.mnt_root. AKA to validate that rename did not do something nasty to the bind mount.
To avoid races path_connected must be called after following a path component to it's next path component.
--- fs/namei.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-)
fs/namei.c +27 -2
@@ -473,6 +473,24 @@ void path_put(const struct path *path) }EXPORT_SYMBOL (path_put); +/** +* path_connected - Verify that a path->dentry is below path->mnt.mnt_root +* @path: nameidate to verify +* +* Rename can sometimes move a file or directory outside of a bind +* mount, path_connected allows those cases to be detected. +*/ +static bool path_connected (const struct path *path) +{ +struct vfsmount *mnt = path->mnt; + +/* Only bind mounts can have disconnected paths */ +if (mnt->mnt_root == mnt->mnt_sb->s_root) +return true; + +return is_subdir (path->dentry, mnt->mnt_root); +} +/* * Path walking has 2 modes, rcu-walk and ref-walk (see * Documentation/filesystems/path-lookup.txt). In situations when we can't
@@ -1148,6 +1166,8 @@ static int follow_dotdot_rcu(struct name goto failed; nd->path.dentry = parent; nd->seq = seq; +if (unlikely (!path_connected (&nd->path))) + goto failed;break ; }if (!follow_up_rcu (&nd->path))
@@ -1231,7 +1251,7 @@ static void follow_mount(struct path *pa } } -static void follow_dotdot (struct nameidata *nd) +static int follow_dotdot (struct nameidata *nd) {set_root (nd);
@@ -1246,6 +1266,10 @@ static void follow_dotdot(struct nameida/* rare case of legitimate dget_parent()... */ nd->path.dentry =dget_parent (nd->path.dentry);dput (old); +if (unlikely (!path_connected (&nd->path))) { +path_put (&nd->path); +return -ENOENT ; + }break ; }if (!follow_up (&nd->path))
@@ -1253,6 +1277,7 @@ static void follow_dotdot(struct nameida }follow_mount (&nd->path); nd->inode = nd->path.dentry->d_inode; +return 0 ; }/*
@@ -1476,7 +1501,7 @@ static inline int handle_dots(struct namif (follow_dotdot_rcu (nd))return -ECHILD ; }else -follow_dotdot (nd); +return follow_dotdot (nd); }return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 46/54 arm64: readahead: fault retry breaks mmap file read random detection
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Salyzyn <[email protected]>
commit 569ba74a7ba69f46ce2950bf085b37fea2408385 upstream.
This is the arm64 portion of commit 45cac65b0fcd ("readahead: fault retry breaks mmap file read random detection"), which was absent from the initial port and has since gone unnoticed. The original commit says:
Quoted 7 lines
.fault now can retry. The retry can break state machine of .fault. In
filemap_fault, if page is miss,ra->mmap_missis increased. In the second try, since the page is in page cache now,ra->mmap_missis decreased. And these are done in one fault, so we can't detect random mmap file access.Add a new flag to indicate .fault is tried once. In the second try, skip
ra->mmap_missdecreasing. Thefilemap_faultstate machine is ok with it.
With this change, Mark reports that:
Quoted 2 lines
Random read improves by 250%, sequential read improves by 40%, and random write by 400% to an eMMC device with dm crypto wrapped around it.
--- arch/arm64/mm/fault.c | 1 + 1 file changed, 1 insertion(+)
arch/arm64/mm/fault.c +1 -0
@@ -278,6 +278,7 @@ retry:* starvation. */ mm_flags &= ~FAULT_FLAG_ALLOW_RETRY ; + mm_flags |=FAULT_FLAG_TRIED ; goto retry; } }
Greg Kroah-Hartman
maintainerPATCH 20/54 dm raid: fix round up of default region size
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <[email protected]>
commit 042745ee53a0a7c1f5aff191a4a24213c6dcfb52 upstream.
Commit 3a0f9aaee028 ("dm raid: round region_size to power of two") intended to make sure that the default region size is a power of two. However, the logic in that commit is incorrect and sets the variable region_size to 0 or 1, depending on whether min_region_size is a power of two.
Fix this logic, using roundup_pow_of_two(), so that region_size is properly rounded up to the next power of two.
--- drivers/md/dm-raid.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/md/dm-raid.c +1 -2
@@ -325,8 +325,7 @@ static int validate_region_size(struct r*/ if (min_region_size > (1 <<13 )) {/* If not a power of 2, make it the next power of 2 */ -if (min_region_size & (min_region_size -1 )) - region_size =1 <<fls (region_size); + region_size =roundup_pow_of_two (min_region_size);DMINFO ("Choosing default region size of %lu sectors" , region_size); }else {
Greg Kroah-Hartman
maintainerPATCH 47/54 m68k: Define asmlinkage_protect
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andreas Schwab <[email protected]>
commit 8474ba74193d302e8340dddd1e16c85cc4b98caf upstream.
Make sure the compiler does not modify arguments of syscall functions. This can happen if the compiler generates a tailcall to another function. For example, without asmlinkage_protect sys_openat is compiled into this function:
sys_openat:
clr.l %d0 move.w 18(%sp),%d0 move.l %d0,16(%sp) jbra do_sys_open
Note how the fourth argument is modified in place, modifying the register %d4 that gets restored from this stack slot when the function returns to user-space. The caller may expect the register to be unmodified across system calls.
--- arch/m68k/include/asm/linkage.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
arch/m68k/include/asm/linkage.h +30 -0
@@ -4,4 +4,34 @@#define __ALIGN .align 4#define __ALIGN_STR ".align 4" +/* +* Make sure the compiler doesn't do anything stupid with the +* arguments on the stack - they are owned by the *caller*, not +* the callee. This just fools gcc into not spilling into them, +* and keeps it from doing tailcall recursion and/or using the +* stack slots for temporaries, since they are live and "used" +* all the way to the end of the function. +*/ +#define asmlinkage_protect(n, ret, args...) \ + __asmlinkage_protect##n(ret, ##args) +#define __asmlinkage_protect_n(ret, args...) \ + __asm__ __volatile__ ("" : "=r" (ret) : "0" (ret), ##args) +#define __asmlinkage_protect0 (ret) \ + __asmlinkage_protect_n(ret) +#define __asmlinkage_protect1 (ret, arg1) \ + __asmlinkage_protect_n(ret, "m" (arg1)) +#define __asmlinkage_protect2 (ret, arg1, arg2) \ + __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2)) +#define __asmlinkage_protect3 (ret, arg1, arg2, arg3) \ + __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2), "m" (arg3)) +#define __asmlinkage_protect4 (ret, arg1, arg2, arg3, arg4) \ + __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2), "m" (arg3), \ + "m" (arg4)) +#define __asmlinkage_protect5 (ret, arg1, arg2, arg3, arg4, arg5) \ + __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2), "m" (arg3), \ + "m" (arg4), "m" (arg5)) +#define __asmlinkage_protect6 (ret, arg1, arg2, arg3, arg4, arg5, arg6) \ + __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2), "m" (arg3), \ + "m" (arg4), "m" (arg5), "m" (arg6)) +#endif
Greg Kroah-Hartman
maintainerPATCH 49/54 fib_rules: Fix dump_rules() not to exit early
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Roland Dreier <[email protected]>
Backports of 41fc014332d9 ("fib_rules: fix fib rule dumps across multiple skbs") introduced a regression in "ip rule show" - it ends up dumping the first rule over and over and never exiting, because 3.19 and earlier are missing commit 053c095a82cf ("netlink: make nlmsg_end() and genlmsg_end() void"), so fib_nl_fill_rule() ends up returning skb->len (i.e. > 0) in the success case.
Fix this by checking the return code for < 0 instead of != 0.
--- net/core/fib_rules.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/fib_rules.c +1 -1
@@ -606,7 +606,7 @@ static int dump_rules(struct sk_buff *sk err =fib_nl_fill_rule (skb, rule,NETLINK_CB (cb->skb).portid, cb->nlh->nlmsg_seq,RTM_NEWRULE ,NLM_F_MULTI , ops); -if (err) +if (err <0 )break ; skip: idx++;
Greg Kroah-Hartman
maintainerPATCH 50/54 genirq: Fix race in register_irq_proc()
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
commit 95c2b17534654829db428f11bcf4297c059a2a7e upstream.
Per-IRQ directories in procfs are created only when a handler is first added to the irqdesc, not when the irqdesc is created. In the case of a shared IRQ, multiple tasks can race to create a directory. This race condition seems to have been present forever, but is easier to hit with async probing.
--- kernel/irq/proc.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
kernel/irq/proc.c +17 -2
@@ -12,6 +12,7 @@#include <linux/seq_file.h> #include <linux/interrupt.h> #include <linux/kernel_stat.h> +#include <linux/mutex.h> #include "internals.h"
@@ -309,18 +310,29 @@ void register_handler_proc(unsigned intvoid register_irq_proc (unsigned int irq,struct irq_desc *desc) { +static DEFINE_MUTEX (register_lock);char name [MAX_NAMELEN ]; -if (!root_irq_dir || (desc->irq_data.chip == &no_irq_chip) || desc->dir) +if (!root_irq_dir || (desc->irq_data.chip == &no_irq_chip))return ; +/* +* irq directories are registered only when a handler is +* added, not when the descriptor is created, so multiple +* tasks might try to register at the same time. +*/ +mutex_lock (®ister_lock); + +if (desc->dir) + goto out_unlock; +memset (name,0 ,MAX_NAMELEN );sprintf (name,"%d" , irq);/* create /proc/irq/1234 */ desc->dir =proc_mkdir (name, root_irq_dir);if (!desc->dir) -return ; + goto out_unlock;#ifdef CONFIG_SMP /* create /proc/irq/<irq>/smp_affinity */
@@ -341,6 +353,9 @@ void register_irq_proc(unsigned int irq,proc_create_data ("spurious" ,0444 , desc->dir, &irq_spurious_proc_fops, (void *)(long )irq); + +out_unlock: +mutex_unlock (®ister_lock); }void unregister_irq_proc (unsigned int irq,struct irq_desc *desc)
Greg Kroah-Hartman
maintainerPATCH 51/54 x86: Add 1/2/4/8 byte optimization to 64bit __copy_{from,to}_user_inatomic
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andi Kleen <[email protected]>
commit ff47ab4ff3cddfa7bc1b25b990e24abe2ae474ff upstream.
The 64bit __copy_{from,to}_user_inatomic always called copy_from_user_generic, but skipped the special optimizations for 1/2/4/8 byte accesses.
This especially hurts the futex call, which accesses the 4 byte futex user value with a complicated fast string operation in a function call, instead of a single movl.
Use __copy_{from,to}_user for _inatomic instead to get the same optimizations. The only problem was the might_fault() in those functions. So move that to new wrapper and call __copy_{f,t}_user_nocheck() from *_inatomic directly.
32bit already did this correctly by duplicating the code.
--- arch/x86/include/asm/uaccess_64.h | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-)
arch/x86/include/asm/uaccess_64.h +18 -6
@@ -77,11 +77,10 @@ int copy_to_user(void __user *dst, const }static __always_inline __must_check -int __copy_from_user(void *dst, const void __user *src, unsigned size) +int __copy_from_user_nocheck(void *dst, const void __user *src, unsigned size) {int ret =0 ; -might_fault ();if (!__builtin_constant_p (size))return copy_user_generic (dst, (__force void *)src, size);switch (size) {
@@ -121,11 +120,17 @@ int __copy_from_user(void *dst, const vo }static __always_inline __must_check -int __copy_to_user(void __user *dst, const void *src, unsigned size) +int __copy_from_user(void *dst, const void __user *src, unsigned size) +{ +might_fault (); +return __copy_from_user_nocheck (dst, src, size); +} + +static __always_inline __must_check +int __copy_to_user_nocheck(void __user *dst, const void *src, unsigned size) {int ret =0 ; -might_fault ();if (!__builtin_constant_p (size))return copy_user_generic ((__force void *)dst, src, size);switch (size) {
@@ -165,6 +170,13 @@ int __copy_to_user(void __user *dst, con }static __always_inline __must_check +int __copy_to_user(void __user *dst, const void *src, unsigned size) +{ +might_fault (); +return __copy_to_user_nocheck (dst, src, size); +} + +static __always_inline __must_check int __copy_in_user(void __user *dst, const void __user *src, unsigned size) {int ret =0 ;
@@ -220,13 +232,13 @@ int __copy_in_user(void __user *dst, con static __must_check __always_inline int__copy_from_user_inatomic (void *dst,const void __user *src,unsigned size) { -return copy_user_generic (dst, (__force const void *)src, size); +return __copy_from_user_nocheck (dst, (__force const void *)src, size); } static __must_check __always_inline int__copy_to_user_inatomic (void __user *dst,const void *src,unsigned size) { -return copy_user_generic ((__force void *)dst, src, size); +return __copy_to_user_nocheck ((__force void *)dst, src, size); } extern long __copy_user_nocache(void *dst, const void __user *src,
Greg Kroah-Hartman
maintainerPATCH 52/54 dm cache: fix NULL pointer when switching from cleaner policy
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Thornber <[email protected]>
commit 2bffa1503c5c06192eb1459180fac4416575a966 upstream.
The cleaner policy doesn't make use of the per cache block hint space in the metadata (unlike the other policies). When switching from the cleaner policy to mq or smq a NULL pointer crash (in dm_tm_new_block) was observed. The crash was caused by bugs in dm-cache-metadata.c when trying to skip creation of the hint btree.
The minimal fix is to change hint size for the cleaner policy to 4 bytes (only hint size supported).
--- drivers/md/dm-cache-policy-cleaner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/dm-cache-policy-cleaner.c +1 -1
@@ -434,7 +434,7 @@ static struct dm_cache_policy *wb_createstatic struct dm_cache_policy_type wb_policy_type = { .name ="cleaner" , .version = {1 ,0 ,0 }, - .hint_size =0 , + .hint_size =4 , .owner =THIS_MODULE , .create = wb_create };
Greg Kroah-Hartman
maintainerPATCH 53/54 staging: speakup: fix speakup-r regression
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: "[email protected]" <[email protected]>
commit b1d562acc78f0af46de0dfe447410bc40bdb7ece upstream.
Here is a patch to make speakup-r work again.
It broke in 3.6 due to commit 4369c64c79a22b98d3b7eff9d089196cd878a10a "Input: Send events one packet at a time)
The problem was that the fakekey.c routine to fake a down arrow no longer functioned properly and putting the input_sync fixed it.
--- drivers/staging/speakup/fakekey.c | 1 + 1 file changed, 1 insertion(+)
drivers/staging/speakup/fakekey.c +1 -0
@@ -81,6 +81,7 @@ void speakup_fake_down_arrow(void)__this_cpu_write (reporting_keystroke, true);input_report_key (virt_keyboard,KEY_DOWN ,PRESSED );input_report_key (virt_keyboard,KEY_DOWN ,RELEASED ); +input_sync (virt_keyboard);__this_cpu_write (reporting_keystroke, false);/* reenable preemption */
Greg Kroah-Hartman
maintainerPATCH 21/54 netfilter: nf_conntrack: Support expectations in different zones
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Stringer <[email protected]>
commit 4b31814d20cbe5cd4ccf18089751e77a04afe4f2 upstream.
When zones were originally introduced, the expectation functions were all extended to perform lookup using the zone. However, insertion was not modified to check the zone. This means that two expectations which are intended to apply for different connections that have the same tuple but exist in different zones cannot both be tracked.
--- net/netfilter/nf_conntrack_expect.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/netfilter/nf_conntrack_expect.c +2 -1
@@ -202,7 +202,8 @@ static inline int expect_clash(const str a->mask.src.u3.all[count] & b->mask.src.u3.all[count]; } -return nf_ct_tuple_mask_cmp (&a->tuple, &b->tuple, &intersect_mask); +return nf_ct_tuple_mask_cmp (&a->tuple, &b->tuple, &intersect_mask) && +nf_ct_zone (a->master) ==nf_ct_zone (b->master); } static inline int expect_matches(const struct nf_conntrack_expect *a,
Greg Kroah-Hartman
maintainerPATCH 22/54 disabling oplocks/leases via module parm enable_oplocks broken for SMB3
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steve French <[email protected]>
commit e0ddde9d44e37fbc21ce893553094ecf1a633ab5 upstream.
leases (oplocks) were always requested for SMB2/SMB3 even when oplocks disabled in the cifs.ko module.
--- fs/cifs/smb2ops.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
fs/cifs/smb2ops.c +6 -2
@@ -48,9 +48,13 @@ change_conf(struct TCP_Server_Info *servbreak ;default : server->echoes = true; - server->oplocks = true; +if (enable_oplocks) { + server->oplocks = true; + server->oplock_credits =1 ; + }else + server->oplocks = false; + server->echo_credits =1 ; - server->oplock_credits =1 ; } server->credits -= server->echo_credits + server->oplock_credits;return 0 ;
Greg Kroah-Hartman
maintainerPATCH 23/54 drm: Reject DRI1 hw lock ioctl functions for kms drivers
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Vetter <[email protected]>
commit da168d81b44898404d281d5dbe70154ab5f117c1 upstream.
I've done some extensive history digging across libdrm, mesa and xf86-video-{intel,nouveau,ati}. The only potential user of this with kms drivers I could find was ttmtest, which once used drmGetLock still. But that mistake was quickly fixed up. Even the intel xvmc library (which otherwise was really good with using dri1 stuff in kms mode) managed to never take the hw lock for dri2 (and hence kms).
Hence it should be save to unconditionally disallow this.
--- drivers/gpu/drm/drm_lock.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/drm_lock.c +6 -0
@@ -58,6 +58,9 @@ int drm_lock(struct drm_device *dev, voistruct drm_master *master = file_priv->master;int ret =0 ; +if (drm_core_check_feature (dev,DRIVER_MODESET )) +return -EINVAL ; + ++file_priv->lock_count;if (lock->context ==DRM_KERNEL_CONTEXT ) {
@@ -151,6 +154,9 @@ int drm_unlock(struct drm_device *dev, vstruct drm_lock *lock = data;struct drm_master *master = file_priv->master; +if (drm_core_check_feature (dev,DRIVER_MODESET )) +return -EINVAL ; +if (lock->context ==DRM_KERNEL_CONTEXT ) {DRM_ERROR ("Process %d using kernel context %d\n" ,task_pid_nr (current), lock->context);
Greg Kroah-Hartman
maintainerPATCH 24/54 USB: whiteheat: fix potential null-deref at probe
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit cbb4be652d374f64661137756b8f357a1827d6a4 upstream.
Fix potential null-pointer dereference at probe by making sure that the required endpoints are present.
The whiteheat driver assumes there are at least five pairs of bulk endpoints, of which the final pair is used for the "command port". An attempt to bind to an interface with fewer bulk endpoints would currently lead to an oops.
Fixes CVE-2015-5257.
--- drivers/usb/serial/whiteheat.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
drivers/usb/serial/whiteheat.c +31 -0
@@ -81,6 +81,8 @@ static int whiteheat_firmware_download(static int whiteheat_firmware_attach (struct usb_serial *serial);/* function prototypes for the Connect Tech WhiteHEAT serial converter */ +static int whiteheat_probe (struct usb_serial *serial, +const struct usb_device_id *id);static int whiteheat_attach (struct usb_serial *serial);static void whiteheat_release (struct usb_serial *serial);static int whiteheat_port_probe (struct usb_serial_port *port);
@@ -117,6 +119,7 @@ static struct usb_serial_driver whitehea .description = "Connect Tech - WhiteHEAT", .id_table = id_table_std, .num_ports = 4, + .probe = whiteheat_probe, .attach = whiteheat_attach, .release = whiteheat_release, .port_probe = whiteheat_port_probe,
@@ -218,6 +221,34 @@ static int whiteheat_firmware_attach(str/***************************************************************************** * Connect Tech's White Heat serial driver functions *****************************************************************************/ + +static int whiteheat_probe (struct usb_serial *serial, +const struct usb_device_id *id) +{ +struct usb_host_interface *iface_desc; +struct usb_endpoint_descriptor *endpoint; +size_t num_bulk_in =0 ; +size_t num_bulk_out =0 ; +size_t min_num_bulk; +unsigned int i; + + iface_desc = serial->interface->cur_altsetting; + +for (i =0 ; i < iface_desc->desc.bNumEndpoints; i++) { + endpoint = &iface_desc->endpoint[i].desc; +if (usb_endpoint_is_bulk_in (endpoint)) + ++num_bulk_in; +if (usb_endpoint_is_bulk_out (endpoint)) + ++num_bulk_out; + } + + min_num_bulk =COMMAND_PORT +1 ; +if (num_bulk_in < min_num_bulk || num_bulk_out < min_num_bulk) +return -ENODEV ; + +return 0 ; +} +static int whiteheat_attach (struct usb_serial *serial) {struct usb_serial_port *command_port;
Greg Kroah-Hartman
maintainerPATCH 25/54 usb: xhci: Clear XHCI_STATE_DYING on start
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Roger Quadros <[email protected]>
commit e5bfeab0ad515b4f6df39fe716603e9dc6d3dfd0 upstream.
For whatever reason if XHCI died in the previous instant then it will never recover on the next xhci_start unless we clear the DYING flag.
--- drivers/usb/host/xhci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/host/xhci.c +2 -1
@@ -139,7 +139,8 @@ static int xhci_start(struct xhci_hcd *x"waited %u microseconds.\n" , XHCI_MAX_HALT_USEC);if (!ret) - xhci->xhc_state &= ~XHCI_STATE_HALTED ; + xhci->xhc_state &= ~(XHCI_STATE_HALTED |XHCI_STATE_DYING ); +return ret; }
Greg Kroah-Hartman
maintainerPATCH 17/54 staging: comedi: adl_pci7x3x: fix digital output on PCI-7230
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Abbott <[email protected]>
commit ad83dbd974feb2e2a8cc071a1d28782bd4d2c70e upstream.
The "adl_pci7x3x" driver replaced the "adl_pci7230" and "adl_pci7432" drivers in commits 8f567c373c4b ("staging: comedi: new adl_pci7x3x driver") and 657f77d173d3 ("staging: comedi: remove adl_pci7230 and adl_pci7432 drivers"). Although the new driver code agrees with the user manuals for the respective boards, digital outputs stopped working on the PCI-7230. This has 16 digital output channels and the previous adl_pci7230 driver shifted the 16 bit output state left by 16 bits before writing to the hardware register. The new adl_pci7x3x driver doesn't do that. Fix it in adl_pci7x3x_do_insn_bits() by checking for the special case of the subdevice having only 16 channels and duplicating the 16 bit output state into both halves of the 32-bit register. That should work both for what the board actually does and for what the user manual says it should do.
--- drivers/staging/comedi/drivers/adl_pci7x3x.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/staging/comedi/drivers/adl_pci7x3x.c +13 -2
@@ -119,10 +119,21 @@ static int adl_pci7x3x_do_insn_bits(struunsigned int bits = data[1 ];if (mask) { +unsigned int val; + s->state &= ~mask; s->state |= (bits & mask); - -outl (s->state, dev->iobase + reg); + val = s->state; +if (s->n_chan ==16 ) { +/* +* It seems the PCI-7230 needs the 16-bit DO state +* to be shifted left by 16 bits before being written +* to the 32-bit register. Set the value in both +* halves of the register to be sure. +*/ + val |= val <<16 ; + } +outl (val, dev->iobase + reg); }/*
Greg Kroah-Hartman
maintainerPATCH 26/54 xhci: change xhci 1.0 only restrictions to support xhci 1.1
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Nyman <[email protected]>
commit dca7794539eff04b786fb6907186989e5eaaa9c2 upstream.
Some changes between xhci 0.96 and xhci 1.0 specifications forced us to check the hci version in code, some of these checks were implemented as hci_version == 1.0, which will not work with new xhci 1.1 controllers.
xhci 1.1 behaves similar to xhci 1.0 in these cases, so change these checks to hci_version >= 1.0
--- drivers/usb/host/xhci-mem.c | 6 +++--- drivers/usb/host/xhci-ring.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/usb/host/xhci-mem.c +3 -3
@@ -1473,10 +1473,10 @@ int xhci_endpoint_init(struct xhci_hcd ** use Event Data TRBs, and we don't chain in a link TRB on short * transfers, we're basically dividing by 1. * -* xHCI 1.0 specification indicates that the Average TRB Length should -* be set to 8 for control endpoints. +* xHCI 1.0 and 1.1 specification indicates that the Average TRB Length +* should be set to 8 for control endpoints. */ -if (usb_endpoint_xfer_control (&ep->desc) && xhci->hci_version ==0x100 ) +if (usb_endpoint_xfer_control (&ep->desc) && xhci->hci_version >=0x100 ) ep_ctx->tx_info |=cpu_to_le32 (AVG_TRB_LENGTH_FOR_EP (8 ));else ep_ctx->tx_info |=
drivers/usb/host/xhci-ring.c +2 -2
@@ -3511,8 +3511,8 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *if (start_cycle ==0 ) field |=0x1 ; -/* xHCI 1.0 6.4.1.2.1: Transfer Type field */ -if (xhci->hci_version ==0x100 ) { +/* xHCI 1.0/1.1 6.4.1.2.1: Transfer Type field */ +if (xhci->hci_version >=0x100 ) {if (urb->transfer_buffer_length >0 ) {if (setup->bRequestType &USB_DIR_IN ) field |=TRB_TX_TYPE (TRB_DATA_IN );
Greg,
neither 3.10.91-rc1 nor 3.14.55-rc1 are online. I guess you forgot to upload them. 4.1.11-rc1 and 4.2.4-rc1 are there however.
Thanks,
Willy
Greg Kroah-Hartman
maintainerQuoted 4 lines · Willy Tarreau
Greg,
neither 3.10.91-rc1 nor 3.14.55-rc1 are online. I guess you forgot to upload them. 4.1.11-rc1 and 4.2.4-rc1 are there however.
Hm, something did go wrong with my scripts and the patches didn't get signed properly, so they didn't get uploaded, thanks for noticing, should now be fixed.
greg k-h
Quoted 9 lines · Greg Kroah-Hartman
Quoted 4 lines · Willy Tarreau
Greg,
neither 3.10.91-rc1 nor 3.14.55-rc1 are online. I guess you forgot to upload them. 4.1.11-rc1 and 4.2.4-rc1 are there however.
Hm, something did go wrong with my scripts and the patches didn't get signed properly, so they didn't get uploaded, thanks for noticing, should now be fixed.
Confirmed, thank you. And it boots and works fine. I hereby also confirm that the "ip rule" regression in 3.10.90 is fixed as well.
Cheers,
Willy
Greg Kroah-Hartman
maintainerQuoted 7 lines · Willy Tarreau
Quoted 6 lines · Greg Kroah-Hartman
Quoted 4 lines · Willy Tarreau
Greg,
neither 3.10.91-rc1 nor 3.14.55-rc1 are online. I guess you forgot to upload them. 4.1.11-rc1 and 4.2.4-rc1 are there however.
Quoted 6 lines
Quoted 3 lines
Hm, something did go wrong with my scripts and the patches didn't get signed properly, so they didn't get uploaded, thanks for noticing, should now be fixed.
Confirmed, thank you. And it boots and works fine. I hereby also confirm that the "ip rule" regression in 3.10.90 is fixed as well.
Great, thanks for testing and letting me know.
greg k-h
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.10.91 release. There are 54 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 Tue Oct 20 02:00:19 UTC 2015. Anything received after that time might be too late.
Build results:
total: 121 pass: 121 fail: 0 Qemu test results: total: 70 pass: 70 fail: 0
Details are available at http://server.roeck-us.net:8010/builders.
Guenter
Greg Kroah-Hartman
maintainerQuoted 9 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.10.91 release. There are 54 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 Tue Oct 20 02:00:19 UTC 2015. Anything received after that time might be too late.
Quoted 6 lines
Build results:
total: 121 pass: 121 fail: 0 Qemu test results: total: 70 pass: 70 fail: 0Details are available at http://server.roeck-us.net:8010/builders.
Thanks for testing and letting me know.
greg k-h
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.10.91 release. There are 54 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 7 lines
Responses should be made by Tue Oct 20 02:00:19 UTC 2015. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.10.91-rc1.gzand the diffstat can be found below.
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] | (970) 217-8978
Greg Kroah-Hartman
maintainerQuoted 9 lines · Shuah Khan
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.10.91 release. There are 54 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 Tue Oct 20 02:00:19 UTC 2015. Anything received after that time might be too late.
Quoted 6 lines
Quoted 4 lines
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.10.91-rc1.gzand the diffstat can be found below.
Compiled and booted on my test system. No dmesg regressions.
Thanks for testing all of these and letting me know.
greg k-h