Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

Commit

Permalink
Merge tag 'v4.4.186' into pie
Browse files Browse the repository at this point in the history
This is the 4.4.186 stable release

* tag 'v4.4.186': (41 commits)
  Linux 4.4.186
  KVM: x86: protect KVM_CREATE_PIT/KVM_CREATE_PIT2 with kvm->lock
  s390/qdio: don't touch the dsci in tiqdio_add_input_queues()
  s390/qdio: (re-)initialize tiqdio list entries
  s390: fix stfle zero padding
  ARC: hide unused function unw_hdr_alloc
  kvm: x86: avoid warning on repeated KVM_SET_TSS_ADDR
  dm verity: use message limit for data block corruption message
  sis900: fix TX completion
  ppp: mppe: Add softdep to arc4
  be2net: fix link failure after ethtool offline test
  ARM: omap2: remove incorrect __init annotation
  perf/core: Fix perf_sample_regs_user() mm check
  e1000e: start network tx queue only when link is up
  MIPS: Remove superfluous check for __linux__
  VMCI: Fix integer overflow in VMCI handle arrays
  carl9170: fix misuse of device driver API
  staging: comedi: amplc_pci230: fix null pointer deref on interrupt
  staging: comedi: dt282x: fix a null pointer deref on interrupt
  usb: renesas_usbhs: add a workaround for a race condition of workqueue
  ...

Signed-off-by: Akhil Narang <akhilnarang.1999@gmail.com>
  • Loading branch information
akhilnarang committed Jul 21, 2019
2 parents e7646c7 + a3e421f commit 981d2f9
Show file tree
Hide file tree
Showing 48 changed files with 435 additions and 239 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Required properties:
- compatible: Should be one of the following:
- "microchip,mcp2510" for MCP2510.
- "microchip,mcp2515" for MCP2515.
- "microchip,mcp25625" for MCP25625.
- reg: SPI chip select.
- clocks: The clock feeding the CAN controller.
- interrupt-parent: The parent interrupt controller.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = 4
PATCHLEVEL = 4
SUBLEVEL = 185
SUBLEVEL = 186
EXTRAVERSION =
NAME = Blurry Fish Butt

Expand Down
9 changes: 4 additions & 5 deletions arch/arc/kernel/unwind.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,6 @@ static void *__init unw_hdr_alloc_early(unsigned long sz)
MAX_DMA_ADDRESS);
}

static void *unw_hdr_alloc(unsigned long sz)
{
return kmalloc(sz, GFP_KERNEL);
}

static void init_unwind_table(struct unwind_table *table, const char *name,
const void *core_start, unsigned long core_size,
const void *init_start, unsigned long init_size,
Expand Down Expand Up @@ -368,6 +363,10 @@ static void init_unwind_hdr(struct unwind_table *table,
}

#ifdef CONFIG_MODULES
static void *unw_hdr_alloc(unsigned long sz)
{
return kmalloc(sz, GFP_KERNEL);
}

static struct unwind_table *last_table;

Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-davinci/board-da850-evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1479,6 +1479,8 @@ static __init void da850_evm_init(void)
if (ret)
pr_warn("%s: dsp/rproc registration failed: %d\n",
__func__, ret);

regulator_has_full_constraints();
}

#ifdef CONFIG_SERIAL_8250_CONSOLE
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/mach-davinci/devices-da8xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,9 @@ static struct platform_device da8xx_lcdc_device = {
.id = 0,
.num_resources = ARRAY_SIZE(da8xx_lcdc_resources),
.resource = da8xx_lcdc_resources,
.dev = {
.coherent_dma_mask = DMA_BIT_MASK(32),
}
};

int __init da8xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata)
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/prm3xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ static void omap3_prm_reconfigure_io_chain(void)
* registers, and omap3xxx_prm_reconfigure_io_chain() must be called.
* No return value.
*/
static void __init omap3xxx_prm_enable_io_wakeup(void)
static void omap3xxx_prm_enable_io_wakeup(void)
{
if (prm_features & PRM_HAS_IO_WAKEUP)
omap2_prm_set_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD,
Expand Down
8 changes: 0 additions & 8 deletions arch/mips/include/uapi/asm/sgidefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@
#ifndef __ASM_SGIDEFS_H
#define __ASM_SGIDEFS_H

/*
* Using a Linux compiler for building Linux seems logic but not to
* everybody.
*/
#ifndef __linux__
#error Use a Linux compiler or give up.
#endif

/*
* Definitions for the ISA levels
*
Expand Down
21 changes: 14 additions & 7 deletions arch/s390/include/asm/facility.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ static inline int test_facility(unsigned long nr)
return __test_facility(nr, &S390_lowcore.stfle_fac_list);
}

static inline unsigned long __stfle_asm(u64 *stfle_fac_list, int size)
{
register unsigned long reg0 asm("0") = size - 1;

asm volatile(
".insn s,0xb2b00000,0(%1)" /* stfle */
: "+d" (reg0)
: "a" (stfle_fac_list)
: "memory", "cc");
return reg0;
}

/**
* stfle - Store facility list extended
* @stfle_fac_list: array where facility list can be stored
Expand All @@ -70,13 +82,8 @@ static inline void stfle(u64 *stfle_fac_list, int size)
memcpy(stfle_fac_list, &S390_lowcore.stfl_fac_list, 4);
if (S390_lowcore.stfl_fac_list & 0x01000000) {
/* More facility bits available with stfle */
register unsigned long reg0 asm("0") = size - 1;

asm volatile(".insn s,0xb2b00000,0(%1)" /* stfle */
: "+d" (reg0)
: "a" (stfle_fac_list)
: "memory", "cc");
nr = (reg0 + 1) * 8; /* # bytes stored by stfle */
nr = __stfle_asm(stfle_fac_list, size);
nr = min_t(unsigned long, (nr + 1) * 8, size * 8);
}
memset((char *) stfle_fac_list + nr, 0, size * 8 - nr);
preempt_enable();
Expand Down
5 changes: 4 additions & 1 deletion arch/x86/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <linux/rcupdate.h>
#include <linux/export.h>
#include <linux/context_tracking.h>
#include <linux/nospec.h>

#include <asm/uaccess.h>
#include <asm/pgtable.h>
Expand Down Expand Up @@ -697,9 +698,11 @@ static unsigned long ptrace_get_debugreg(struct task_struct *tsk, int n)
{
struct thread_struct *thread = &tsk->thread;
unsigned long val = 0;
int index = n;

if (n < HBP_NUM) {
struct perf_event *bp = thread->ptrace_bps[n];
struct perf_event *bp = thread->ptrace_bps[index];
index = array_index_nospec(index, HBP_NUM);

if (bp)
val = bp->hw.info.address;
Expand Down
9 changes: 7 additions & 2 deletions arch/x86/kernel/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <linux/user.h>
#include <linux/regset.h>
#include <linux/syscalls.h>
#include <linux/nospec.h>

#include <asm/uaccess.h>
#include <asm/desc.h>
Expand Down Expand Up @@ -177,15 +178,19 @@ int do_get_thread_area(struct task_struct *p, int idx,
struct user_desc __user *u_info)
{
struct user_desc info;
int index;

if (idx == -1 && get_user(idx, &u_info->entry_number))
return -EFAULT;

if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX)
return -EINVAL;

fill_user_desc(&info, idx,
&p->thread.tls_array[idx - GDT_ENTRY_TLS_MIN]);
index = idx - GDT_ENTRY_TLS_MIN;
index = array_index_nospec(index,
GDT_ENTRY_TLS_MAX - GDT_ENTRY_TLS_MIN + 1);

fill_user_desc(&info, idx, &p->thread.tls_array[index]);

if (copy_to_user(u_info, &info, sizeof(info)))
return -EFAULT;
Expand Down
5 changes: 3 additions & 2 deletions arch/x86/kvm/i8254.c
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,6 @@ static const struct kvm_io_device_ops speaker_dev_ops = {
.write = speaker_ioport_write,
};

/* Caller must hold slots_lock */
struct kvm_pit *kvm_create_pit(struct kvm *kvm, u32 flags)
{
struct kvm_pit *pit;
Expand Down Expand Up @@ -733,6 +732,7 @@ struct kvm_pit *kvm_create_pit(struct kvm *kvm, u32 flags)
pit->mask_notifier.func = pit_mask_notifer;
kvm_register_irq_mask_notifier(kvm, 0, &pit->mask_notifier);

mutex_lock(&kvm->slots_lock);
kvm_iodevice_init(&pit->dev, &pit_dev_ops);
ret = kvm_io_bus_register_dev(kvm, KVM_PIO_BUS, KVM_PIT_BASE_ADDRESS,
KVM_PIT_MEM_LENGTH, &pit->dev);
Expand All @@ -747,13 +747,14 @@ struct kvm_pit *kvm_create_pit(struct kvm *kvm, u32 flags)
if (ret < 0)
goto fail_unregister;
}
mutex_unlock(&kvm->slots_lock);

return pit;

fail_unregister:
kvm_io_bus_unregister_dev(kvm, KVM_PIO_BUS, &pit->dev);

fail:
mutex_unlock(&kvm->slots_lock);
kvm_unregister_irq_mask_notifier(kvm, 0, &pit->mask_notifier);
kvm_unregister_irq_ack_notifier(kvm, &pit_state->irq_ack_notifier);
kvm_free_irq_source_id(kvm, pit->irq_source_id);
Expand Down
6 changes: 3 additions & 3 deletions arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -3867,7 +3867,7 @@ long kvm_arch_vm_ioctl(struct file *filp,
sizeof(struct kvm_pit_config)))
goto out;
create_pit:
mutex_lock(&kvm->slots_lock);
mutex_lock(&kvm->lock);
r = -EEXIST;
if (kvm->arch.vpit)
goto create_pit_unlock;
Expand All @@ -3876,7 +3876,7 @@ long kvm_arch_vm_ioctl(struct file *filp,
if (kvm->arch.vpit)
r = 0;
create_pit_unlock:
mutex_unlock(&kvm->slots_lock);
mutex_unlock(&kvm->lock);
break;
case KVM_GET_IRQCHIP: {
/* 0: PIC master, 1: PIC slave, 2: IOAPIC */
Expand Down Expand Up @@ -7799,7 +7799,7 @@ int __x86_set_memory_region(struct kvm *kvm, int id, gpa_t gpa, u32 size)

slot = id_to_memslot(slots, id);
if (size) {
if (WARN_ON(slot->npages))
if (slot->npages)
return -EEXIST;

/*
Expand Down
18 changes: 14 additions & 4 deletions drivers/input/keyboard/imx_keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,12 @@ static int imx_keypad_probe(struct platform_device *pdev)
return 0;
}

static int __maybe_unused imx_kbd_suspend(struct device *dev)
static int __maybe_unused imx_kbd_noirq_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct imx_keypad *kbd = platform_get_drvdata(pdev);
struct input_dev *input_dev = kbd->input_dev;
unsigned short reg_val = readw(kbd->mmio_base + KPSR);

/* imx kbd can wake up system even clock is disabled */
mutex_lock(&input_dev->mutex);
Expand All @@ -544,13 +545,20 @@ static int __maybe_unused imx_kbd_suspend(struct device *dev)

mutex_unlock(&input_dev->mutex);

if (device_may_wakeup(&pdev->dev))
if (device_may_wakeup(&pdev->dev)) {
if (reg_val & KBD_STAT_KPKD)
reg_val |= KBD_STAT_KRIE;
if (reg_val & KBD_STAT_KPKR)
reg_val |= KBD_STAT_KDIE;
writew(reg_val, kbd->mmio_base + KPSR);

enable_irq_wake(kbd->irq);
}

return 0;
}

static int __maybe_unused imx_kbd_resume(struct device *dev)
static int __maybe_unused imx_kbd_noirq_resume(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct imx_keypad *kbd = platform_get_drvdata(pdev);
Expand All @@ -574,7 +582,9 @@ static int __maybe_unused imx_kbd_resume(struct device *dev)
return ret;
}

static SIMPLE_DEV_PM_OPS(imx_kbd_pm_ops, imx_kbd_suspend, imx_kbd_resume);
static const struct dev_pm_ops imx_kbd_pm_ops = {
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(imx_kbd_noirq_suspend, imx_kbd_noirq_resume)
};

static struct platform_driver imx_keypad_driver = {
.driver = {
Expand Down
2 changes: 2 additions & 0 deletions drivers/input/mouse/elantech.c
Original file line number Diff line number Diff line change
Expand Up @@ -1191,6 +1191,8 @@ static const char * const middle_button_pnp_ids[] = {
"LEN2132", /* ThinkPad P52 */
"LEN2133", /* ThinkPad P72 w/ NFC */
"LEN2134", /* ThinkPad P72 */
"LEN0407",
"LEN0408",
NULL
};

Expand Down
4 changes: 2 additions & 2 deletions drivers/md/dm-verity-target.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ static int verity_handle_err(struct dm_verity *v, enum verity_block_type type,
BUG();
}

DMERR("%s: %s block %llu is corrupted", v->data_dev->name, type_str,
block);
DMERR_LIMIT("%s: %s block %llu is corrupted", v->data_dev->name,
type_str, block);

if (v->corrupted_errs == DM_VERITY_MAX_CORRUPTED_ERRS)
DMERR("%s: reached maximum errors", v->data_dev->name);
Expand Down
36 changes: 22 additions & 14 deletions drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -7226,9 +7226,9 @@ static void status_unused(struct seq_file *seq)
static int status_resync(struct seq_file *seq, struct mddev *mddev)
{
sector_t max_sectors, resync, res;
unsigned long dt, db;
sector_t rt;
int scale;
unsigned long dt, db = 0;
sector_t rt, curr_mark_cnt, resync_mark_cnt;
int scale, recovery_active;
unsigned int per_milli;

if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery) ||
Expand Down Expand Up @@ -7298,22 +7298,30 @@ static int status_resync(struct seq_file *seq, struct mddev *mddev)
* db: blocks written from mark until now
* rt: remaining time
*
* rt is a sector_t, so could be 32bit or 64bit.
* So we divide before multiply in case it is 32bit and close
* to the limit.
* We scale the divisor (db) by 32 to avoid losing precision
* near the end of resync when the number of remaining sectors
* is close to 'db'.
* We then divide rt by 32 after multiplying by db to compensate.
* The '+1' avoids division by zero if db is very small.
* rt is a sector_t, which is always 64bit now. We are keeping
* the original algorithm, but it is not really necessary.
*
* Original algorithm:
* So we divide before multiply in case it is 32bit and close
* to the limit.
* We scale the divisor (db) by 32 to avoid losing precision
* near the end of resync when the number of remaining sectors
* is close to 'db'.
* We then divide rt by 32 after multiplying by db to compensate.
* The '+1' avoids division by zero if db is very small.
*/
dt = ((jiffies - mddev->resync_mark) / HZ);
if (!dt) dt++;
db = (mddev->curr_mark_cnt - atomic_read(&mddev->recovery_active))
- mddev->resync_mark_cnt;

curr_mark_cnt = mddev->curr_mark_cnt;
recovery_active = atomic_read(&mddev->recovery_active);
resync_mark_cnt = mddev->resync_mark_cnt;

if (curr_mark_cnt >= (recovery_active + resync_mark_cnt))
db = curr_mark_cnt - (recovery_active + resync_mark_cnt);

rt = max_sectors - resync; /* number of remaining sectors */
sector_div(rt, db/32+1);
rt = div64_u64(rt, db/32+1);
rt *= dt;
rt >>= 5;

Expand Down
Loading

0 comments on commit 981d2f9

Please sign in to comment.