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

Commit

Permalink
Merge remote-tracking branch 'android-linux-stable/kernel.lnx.4.4.r34…
Browse files Browse the repository at this point in the history
…-rel' into pie

* android-linux-stable/kernel.lnx.4.4.r34-rel: (132 commits)
  Linux 4.4.178
  stm class: Hide STM-specific options if STM is disabled
  coresight: removing bind/unbind options from sysfs
  arm64: support keyctl() system call in 32-bit mode
  Revert "USB: core: only clean up what we allocated"
  xhci: Fix port resume done detection for SS ports with LPM enabled
  KVM: Reject device ioctls from processes other than the VM's creator
  x86/smp: Enforce CONFIG_HOTPLUG_CPU when SMP=y
  perf intel-pt: Fix TSC slip
  gpio: adnp: Fix testing wrong value in adnp_gpio_direction_input
  fs/proc/proc_sysctl.c: fix NULL pointer dereference in put_links
  Disable kgdboc failed by echo space to /sys/module/kgdboc/parameters/kgdboc
  USB: serial: option: add Olicard 600
  USB: serial: option: set driver_info for SIM5218 and compatibles
  USB: serial: mos7720: fix mos_parport refcount imbalance on error path
  USB: serial: ftdi_sio: add additional NovaTech products
  USB: serial: cp210x: add new device id
  serial: sh-sci: Fix setting SCSCR_TIE while transferring data
  serial: max310x: Fix to avoid potential NULL pointer dereference
  staging: vt6655: Fix interrupt race condition on device start up.
  ...

Signed-off-by: Akhil Narang <akhilnarang.1999@gmail.com>
  • Loading branch information
akhilnarang committed Apr 3, 2019
2 parents a9c8d8d + 9415f72 commit 53170dc
Show file tree
Hide file tree
Showing 88 changed files with 556 additions and 338 deletions.
16 changes: 11 additions & 5 deletions Documentation/virtual/kvm/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ of a virtual machine. The ioctls belong to three classes

- VM ioctls: These query and set attributes that affect an entire virtual
machine, for example memory layout. In addition a VM ioctl is used to
create virtual cpus (vcpus).
create virtual cpus (vcpus) and devices.

Only run VM ioctls from the same process (address space) that was used
to create the VM.
Expand All @@ -24,6 +24,11 @@ of a virtual machine. The ioctls belong to three classes
Only run vcpu ioctls from the same thread that was used to create the
vcpu.

- device ioctls: These query and set attributes that control the operation
of a single device.

device ioctls must be issued from the same process (address space) that
was used to create the VM.

2. File descriptors
-------------------
Expand All @@ -32,10 +37,11 @@ The kvm API is centered around file descriptors. An initial
open("/dev/kvm") obtains a handle to the kvm subsystem; this handle
can be used to issue system ioctls. A KVM_CREATE_VM ioctl on this
handle will create a VM file descriptor which can be used to issue VM
ioctls. A KVM_CREATE_VCPU ioctl on a VM fd will create a virtual cpu
and return a file descriptor pointing to it. Finally, ioctls on a vcpu
fd can be used to control the vcpu, including the important task of
actually running guest code.
ioctls. A KVM_CREATE_VCPU or KVM_CREATE_DEVICE ioctl on a VM fd will
create a virtual cpu or device and return a file descriptor pointing to
the new resource. Finally, ioctls on a vcpu or device fd can be used
to control the vcpu or device. For vcpus, this includes the important
task of actually running guest code.

In general file descriptors can be migrated among processes by means
of fork() and the SCM_RIGHTS facility of unix domain socket. These
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 = 177
SUBLEVEL = 178
EXTRAVERSION =
NAME = Blurry Fish Butt

Expand Down
27 changes: 10 additions & 17 deletions arch/arm/mach-imx/cpuidle-imx6q.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,23 @@
#include "cpuidle.h"
#include "hardware.h"

static atomic_t master = ATOMIC_INIT(0);
static DEFINE_SPINLOCK(master_lock);
static int num_idle_cpus = 0;
static DEFINE_SPINLOCK(cpuidle_lock);

static int imx6q_enter_wait(struct cpuidle_device *dev,
struct cpuidle_driver *drv, int index)
{
if (atomic_inc_return(&master) == num_online_cpus()) {
/*
* With this lock, we prevent other cpu to exit and enter
* this function again and become the master.
*/
if (!spin_trylock(&master_lock))
goto idle;
spin_lock(&cpuidle_lock);
if (++num_idle_cpus == num_online_cpus())
imx6_set_lpm(WAIT_UNCLOCKED);
cpu_do_idle();
imx6_set_lpm(WAIT_CLOCKED);
spin_unlock(&master_lock);
goto done;
}
spin_unlock(&cpuidle_lock);

idle:
cpu_do_idle();
done:
atomic_dec(&master);

spin_lock(&cpuidle_lock);
if (num_idle_cpus-- == num_online_cpus())
imx6_set_lpm(WAIT_CLOCKED);
spin_unlock(&cpuidle_lock);

return index;
}
Expand Down
5 changes: 4 additions & 1 deletion arch/arm64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ config ARM64
select PERF_USE_VMALLOC
select POWER_RESET
select POWER_SUPPLY
select RTC_LIB
select SPARSE_IRQ
select SYSCTL_EXCEPTION_TRACE
select HAVE_CONTEXT_TRACKING
Expand Down Expand Up @@ -1265,6 +1264,10 @@ config CROSS_COMPILE_ARM32
Same as setting CROSS_COMPILE_ARM32 in the environment, but saved for
future builds. The environment variable overrides this config option.

config KEYS_COMPAT
def_bool y
depends on COMPAT && KEYS

endmenu

menu "Power management options"
Expand Down
33 changes: 23 additions & 10 deletions arch/arm64/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,20 +686,33 @@ asmlinkage int __exception do_debug_exception(unsigned long addr,
{
const struct fault_info *inf = debug_fault_info + DBG_ESR_EVT(esr);
struct siginfo info;
int rv;

if (!inf->fn(addr, esr, regs))
return 1;
/*
* Tell lockdep we disabled irqs in entry.S. Do nothing if they were
* already disabled to preserve the last enabled/disabled addresses.
*/
if (interrupts_enabled(regs))
trace_hardirqs_off();

pr_alert("Unhandled debug exception: %s (0x%08x) at 0x%016lx\n",
inf->name, esr, addr);
if (!inf->fn(addr, esr, regs)) {
rv = 1;
} else {
pr_alert("Unhandled debug exception: %s (0x%08x) at 0x%016lx\n",
inf->name, esr, addr);

info.si_signo = inf->sig;
info.si_errno = 0;
info.si_code = inf->code;
info.si_addr = (void __user *)addr;
arm64_notify_die("", regs, &info, 0);
rv = 0;
}

info.si_signo = inf->sig;
info.si_errno = 0;
info.si_code = inf->code;
info.si_addr = (void __user *)addr;
arm64_notify_die("", regs, &info, 0);
if (interrupts_enabled(regs))
trace_hardirqs_on();

return 0;
return rv;
}
NOKPROBE_SYMBOL(do_debug_exception);

Expand Down
8 changes: 4 additions & 4 deletions arch/mips/include/asm/jump_label.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
#endif

#ifdef CONFIG_CPU_MICROMIPS
#define NOP_INSN "nop32"
#define B_INSN "b32"
#else
#define NOP_INSN "nop"
#define B_INSN "b"
#endif

static __always_inline bool arch_static_branch(struct static_key *key, bool branch)
{
asm_volatile_goto("1:\t" NOP_INSN "\n\t"
"nop\n\t"
asm_volatile_goto("1:\t" B_INSN " 2f\n\t"
"2:\tnop\n\t"
".pushsection __jump_table, \"aw\"\n\t"
WORD_INSN " 1b, %l[l_yes], %0\n\t"
".popsection\n\t"
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/loongson64/lemote-2f/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ static struct irqaction ip6_irqaction = {
static struct irqaction cascade_irqaction = {
.handler = no_action,
.name = "cascade",
.flags = IRQF_NO_THREAD,
.flags = IRQF_NO_THREAD | IRQF_NO_SUSPEND,
};

void __init mach_init_irq(void)
Expand Down
8 changes: 1 addition & 7 deletions arch/x86/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1993,14 +1993,8 @@ config PHYSICAL_ALIGN
Don't change this unless you know what you are doing.

config HOTPLUG_CPU
bool "Support for hot-pluggable CPUs"
def_bool y
depends on SMP
---help---
Say Y here to allow turning CPUs off and on. CPUs can be
controlled through /sys/devices/system/cpu.
( Note: power management support will enable this option
automatically on SMP systems. )
Say N if you want to disable CPU hotplug.

config BOOTPARAM_HOTPLUG_CPU0
bool "Set default setting of cpu0_hotpluggable"
Expand Down
3 changes: 3 additions & 0 deletions drivers/extcon/extcon-usb-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ static int usb_extcon_resume(struct device *dev)
}

enable_irq(info->id_irq);
if (!device_may_wakeup(dev))
queue_delayed_work(system_power_efficient_wq,
&info->wq_detcable, 0);

return ret;
}
Expand Down
6 changes: 4 additions & 2 deletions drivers/gpio/gpio-adnp.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,10 @@ static int adnp_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
if (err < 0)
goto out;

if (err & BIT(pos))
err = -EACCES;
if (value & BIT(pos)) {
err = -EPERM;
goto out;
}

err = 0;

Expand Down
12 changes: 3 additions & 9 deletions drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,11 +531,9 @@ static int vmw_fb_set_par(struct fb_info *info)
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC)
};
struct drm_display_mode *old_mode;
struct drm_display_mode *mode;
int ret;

old_mode = par->set_mode;
mode = drm_mode_duplicate(vmw_priv->dev, &new_mode);
if (!mode) {
DRM_ERROR("Could not create new fb mode.\n");
Expand All @@ -546,11 +544,7 @@ static int vmw_fb_set_par(struct fb_info *info)
mode->vdisplay = var->yres;
vmw_guess_mode_timing(mode);

if (old_mode && drm_mode_equal(old_mode, mode)) {
drm_mode_destroy(vmw_priv->dev, mode);
mode = old_mode;
old_mode = NULL;
} else if (!vmw_kms_validate_mode_vram(vmw_priv,
if (!vmw_kms_validate_mode_vram(vmw_priv,
mode->hdisplay *
DIV_ROUND_UP(var->bits_per_pixel, 8),
mode->vdisplay)) {
Expand Down Expand Up @@ -613,8 +607,8 @@ static int vmw_fb_set_par(struct fb_info *info)
schedule_delayed_work(&par->local_work, 0);

out_unlock:
if (old_mode)
drm_mode_destroy(vmw_priv->dev, old_mode);
if (par->set_mode)
drm_mode_destroy(vmw_priv->dev, par->set_mode);
par->set_mode = mode;

drm_modeset_unlock_all(vmw_priv->dev);
Expand Down
11 changes: 1 addition & 10 deletions drivers/hwtracing/coresight/coresight-etb10.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,15 +489,6 @@ static int etb_probe(struct amba_device *adev, const struct amba_id *id)
return ret;
}

static int etb_remove(struct amba_device *adev)
{
struct etb_drvdata *drvdata = amba_get_drvdata(adev);

misc_deregister(&drvdata->miscdev);
coresight_unregister(drvdata->csdev);
return 0;
}

#ifdef CONFIG_PM
static int etb_runtime_suspend(struct device *dev)
{
Expand Down Expand Up @@ -537,10 +528,10 @@ static struct amba_driver etb_driver = {
.name = "coresight-etb10",
.owner = THIS_MODULE,
.pm = &etb_dev_pm_ops,
.suppress_bind_attrs = true,

},
.probe = etb_probe,
.remove = etb_remove,
.id_table = etb_ids,
};

Expand Down
13 changes: 1 addition & 12 deletions drivers/hwtracing/coresight/coresight-etm3x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1877,17 +1877,6 @@ static int etm_probe(struct amba_device *adev, const struct amba_id *id)
return ret;
}

static int etm_remove(struct amba_device *adev)
{
struct etm_drvdata *drvdata = amba_get_drvdata(adev);

coresight_unregister(drvdata->csdev);
if (--etm_count == 0)
unregister_hotcpu_notifier(&etm_cpu_notifier);

return 0;
}

#ifdef CONFIG_PM
static int etm_runtime_suspend(struct device *dev)
{
Expand Down Expand Up @@ -1948,9 +1937,9 @@ static struct amba_driver etm_driver = {
.name = "coresight-etm3x",
.owner = THIS_MODULE,
.pm = &etm_dev_pm_ops,
.suppress_bind_attrs = true,
},
.probe = etm_probe,
.remove = etm_remove,
.id_table = etm_ids,
};

Expand Down
2 changes: 1 addition & 1 deletion drivers/hwtracing/coresight/coresight-etm4x.c
Original file line number Diff line number Diff line change
Expand Up @@ -2240,7 +2240,7 @@ static ssize_t name##_show(struct device *_dev, \
return scnprintf(buf, PAGE_SIZE, "0x%x\n", \
readl_relaxed(drvdata->base + offset)); \
} \
DEVICE_ATTR_RO(name)
static DEVICE_ATTR_RO(name)

coresight_cross_read(trcoslsr, TRCOSLSR);
coresight_cross_read(trcpdcr, TRCPDCR);
Expand Down
10 changes: 1 addition & 9 deletions drivers/hwtracing/coresight/coresight-funnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,6 @@ static int funnel_probe(struct amba_device *adev, const struct amba_id *id)
return 0;
}

static int funnel_remove(struct amba_device *adev)
{
struct funnel_drvdata *drvdata = amba_get_drvdata(adev);

coresight_unregister(drvdata->csdev);
return 0;
}

#ifdef CONFIG_PM
static int funnel_runtime_suspend(struct device *dev)
{
Expand Down Expand Up @@ -273,9 +265,9 @@ static struct amba_driver funnel_driver = {
.name = "coresight-funnel",
.owner = THIS_MODULE,
.pm = &funnel_dev_pm_ops,
.suppress_bind_attrs = true,
},
.probe = funnel_probe,
.remove = funnel_remove,
.id_table = funnel_ids,
};

Expand Down
11 changes: 1 addition & 10 deletions drivers/hwtracing/coresight/coresight-replicator-qcom.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,6 @@ static int replicator_probe(struct amba_device *adev, const struct amba_id *id)
return 0;
}

static int replicator_remove(struct amba_device *adev)
{
struct replicator_state *drvdata = amba_get_drvdata(adev);

pm_runtime_disable(&adev->dev);
coresight_unregister(drvdata->csdev);
return 0;
}

#ifdef CONFIG_PM
static int replicator_runtime_suspend(struct device *dev)
{
Expand Down Expand Up @@ -206,9 +197,9 @@ static struct amba_driver replicator_driver = {
.drv = {
.name = "coresight-replicator-qcom",
.pm = &replicator_dev_pm_ops,
.suppress_bind_attrs = true,
},
.probe = replicator_probe,
.remove = replicator_remove,
.id_table = replicator_ids,
};

Expand Down
Loading

0 comments on commit 53170dc

Please sign in to comment.