Skip to content

Commit

Permalink
treewide: Linux 4.14.195
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanhh0 committed Sep 7, 2020
1 parent 41b5ee7 commit 84dd684
Show file tree
Hide file tree
Showing 48 changed files with 399 additions and 171 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 4
PATCHLEVEL = 14
SUBLEVEL = 194
SUBLEVEL = 195
EXTRAVERSION =
NAME = Petit Gorille

Expand Down
8 changes: 4 additions & 4 deletions arch/alpha/include/asm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,10 @@ extern inline void writeq(u64 b, volatile void __iomem *addr)
}
#endif

#define ioread16be(p) be16_to_cpu(ioread16(p))
#define ioread32be(p) be32_to_cpu(ioread32(p))
#define iowrite16be(v,p) iowrite16(cpu_to_be16(v), (p))
#define iowrite32be(v,p) iowrite32(cpu_to_be32(v), (p))
#define ioread16be(p) swab16(ioread16(p))
#define ioread32be(p) swab32(ioread32(p))
#define iowrite16be(v,p) iowrite16(swab16(v), (p))
#define iowrite32be(v,p) iowrite32(swab32(v), (p))

#define inb_p inb
#define inw_p inw
Expand Down
6 changes: 3 additions & 3 deletions arch/m68k/include/asm/m53xxacr.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@
* coherency though in all cases. And for copyback caches we will need
* to push cached data as well.
*/
#define CACHE_INIT CACR_CINVA
#define CACHE_INVALIDATE CACR_CINVA
#define CACHE_INVALIDATED CACR_CINVA
#define CACHE_INIT (CACHE_MODE + CACR_CINVA - CACR_EC)
#define CACHE_INVALIDATE (CACHE_MODE + CACR_CINVA)
#define CACHE_INVALIDATED (CACHE_MODE + CACR_CINVA)

#define ACR0_MODE ((CONFIG_RAMBASE & 0xff000000) + \
(0x000f0000) + \
Expand Down
55 changes: 38 additions & 17 deletions arch/powerpc/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/pagemap.h>
#include <linux/ptrace.h>
#include <linux/mman.h>
#include <linux/mm.h>
Expand Down Expand Up @@ -66,15 +67,11 @@ static inline bool notify_page_fault(struct pt_regs *regs)
}

/*
* Check whether the instruction at regs->nip is a store using
* Check whether the instruction inst is a store using
* an update addressing form which will update r1.
*/
static bool store_updates_sp(struct pt_regs *regs)
static bool store_updates_sp(unsigned int inst)
{
unsigned int inst;

if (get_user(inst, (unsigned int __user *)regs->nip))
return false;
/* check for 1 in the rA field */
if (((inst >> 16) & 0x1f) != 1)
return false;
Expand Down Expand Up @@ -227,20 +224,24 @@ static bool bad_kernel_fault(bool is_exec, unsigned long error_code,
return is_exec || (address >= TASK_SIZE);
}

// This comes from 64-bit struct rt_sigframe + __SIGNAL_FRAMESIZE
#define SIGFRAME_MAX_SIZE (4096 + 128)

static bool bad_stack_expansion(struct pt_regs *regs, unsigned long address,
struct vm_area_struct *vma,
bool store_update_sp)
struct vm_area_struct *vma, unsigned int flags,
bool *must_retry)
{
/*
* N.B. The POWER/Open ABI allows programs to access up to
* 288 bytes below the stack pointer.
* The kernel signal delivery code writes up to about 1.5kB
* The kernel signal delivery code writes a bit over 4KB
* below the stack pointer (r1) before decrementing it.
* The exec code can write slightly over 640kB to the stack
* before setting the user r1. Thus we allow the stack to
* expand to 1MB without further checks.
*/
if (address + 0x100000 < vma->vm_end) {
unsigned int __user *nip = (unsigned int __user *)regs->nip;
/* get user regs even if this fault is in kernel mode */
struct pt_regs *uregs = current->thread.regs;
if (uregs == NULL)
Expand All @@ -258,8 +259,22 @@ static bool bad_stack_expansion(struct pt_regs *regs, unsigned long address,
* between the last mapped region and the stack will
* expand the stack rather than segfaulting.
*/
if (address + 2048 < uregs->gpr[1] && !store_update_sp)
return true;
if (address + SIGFRAME_MAX_SIZE >= uregs->gpr[1])
return false;

if ((flags & FAULT_FLAG_WRITE) && (flags & FAULT_FLAG_USER) &&
access_ok(VERIFY_READ, nip, sizeof(*nip))) {
unsigned int inst;
int res;

pagefault_disable();
res = __get_user_inatomic(inst, nip);
pagefault_enable();
if (!res)
return !store_updates_sp(inst);
*must_retry = true;
}
return true;
}
return false;
}
Expand Down Expand Up @@ -392,7 +407,7 @@ static int __do_page_fault(struct pt_regs *regs, unsigned long address,
int is_user = user_mode(regs);
int is_write = page_fault_is_write(error_code);
int fault, major = 0;
bool store_update_sp = false;
bool must_retry = false;

if (notify_page_fault(regs))
return 0;
Expand Down Expand Up @@ -439,9 +454,6 @@ static int __do_page_fault(struct pt_regs *regs, unsigned long address,
* can result in fault, which will cause a deadlock when called with
* mmap_sem held
*/
if (is_write && is_user)
store_update_sp = store_updates_sp(regs);

if (is_user)
flags |= FAULT_FLAG_USER;
if (is_write)
Expand Down Expand Up @@ -488,8 +500,17 @@ static int __do_page_fault(struct pt_regs *regs, unsigned long address,
return bad_area(regs, address);

/* The stack is being expanded, check if it's valid */
if (unlikely(bad_stack_expansion(regs, address, vma, store_update_sp)))
return bad_area(regs, address);
if (unlikely(bad_stack_expansion(regs, address, vma, flags,
&must_retry))) {
if (!must_retry)
return bad_area(regs, address);

up_read(&mm->mmap_sem);
if (fault_in_pages_readable((const char __user *)regs->nip,
sizeof(unsigned int)))
return bad_area_nosemaphore(regs, address);
goto retry;
}

/* Try to expand it */
if (unlikely(expand_stack(vma, address)))
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/platforms/pseries/ras.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ static void handle_system_shutdown(char event_modifier)
case EPOW_SHUTDOWN_ON_UPS:
pr_emerg("Loss of system power detected. System is running on"
" UPS/battery. Check RTAS error log for details\n");
orderly_poweroff(true);
break;

case EPOW_SHUTDOWN_LOSS_OF_CRITICAL_FUNCTIONS:
Expand Down
52 changes: 41 additions & 11 deletions drivers/clk/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@ static DEFINE_MUTEX(vdd_class_list_lock);
*/
static LIST_HEAD(clk_rate_change_list);

static struct hlist_head *all_lists[] = {
&clk_root_list,
&clk_orphan_list,
NULL,
};

static struct hlist_head *orphan_list[] = {
&clk_orphan_list,
NULL,
};

/*** private data structures ***/

struct clk_core {
Expand Down Expand Up @@ -2693,17 +2704,6 @@ static u32 debug_suspend;
static DEFINE_MUTEX(clk_debug_lock);
static HLIST_HEAD(clk_debug_list);

static struct hlist_head *all_lists[] = {
&clk_root_list,
&clk_orphan_list,
NULL,
};

static struct hlist_head *orphan_list[] = {
&clk_orphan_list,
NULL,
};

static void clk_state_subtree(struct clk_core *c)
{
int vdd_level = 0;
Expand Down Expand Up @@ -3974,6 +3974,34 @@ static const struct clk_ops clk_nodrv_ops = {
.set_parent = clk_nodrv_set_parent,
};

static void clk_core_evict_parent_cache_subtree(struct clk_core *root,
struct clk_core *target)
{
int i;
struct clk_core *child;

for (i = 0; i < root->num_parents; i++)
if (root->parents[i] == target)
root->parents[i] = NULL;

hlist_for_each_entry(child, &root->children, child_node)
clk_core_evict_parent_cache_subtree(child, target);
}

/* Remove this clk from all parent caches */
static void clk_core_evict_parent_cache(struct clk_core *core)
{
struct hlist_head **lists;
struct clk_core *root;

lockdep_assert_held(&prepare_lock);

for (lists = all_lists; *lists; lists++)
hlist_for_each_entry(root, *lists, child_node)
clk_core_evict_parent_cache_subtree(root, core);

}

/**
* clk_unregister - unregister a currently registered clock
* @clk: clock to unregister
Expand Down Expand Up @@ -4012,6 +4040,8 @@ void clk_unregister(struct clk *clk)
clk_core_set_parent(child, NULL);
}

clk_core_evict_parent_cache(clk->core);

hlist_del_init(&clk->core->child_node);

if (clk->core->prepare_count)
Expand Down
1 change: 1 addition & 0 deletions drivers/cpufreq/intel_pstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,7 @@ static void intel_pstate_get_cpu_pstates(struct cpudata *cpu)

intel_pstate_get_hwp_max(cpu->cpu, &phy_max, &current_max);
cpu->pstate.turbo_freq = phy_max * cpu->pstate.scaling;
cpu->pstate.turbo_pstate = phy_max;
} else {
cpu->pstate.turbo_freq = cpu->pstate.turbo_pstate * cpu->pstate.scaling;
}
Expand Down
27 changes: 0 additions & 27 deletions drivers/gpu/drm/vgem/vgem_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,32 +220,6 @@ static int vgem_gem_dumb_create(struct drm_file *file, struct drm_device *dev,
return 0;
}

static int vgem_gem_dumb_map(struct drm_file *file, struct drm_device *dev,
uint32_t handle, uint64_t *offset)
{
struct drm_gem_object *obj;
int ret;

obj = drm_gem_object_lookup(file, handle);
if (!obj)
return -ENOENT;

if (!obj->filp) {
ret = -EINVAL;
goto unref;
}

ret = drm_gem_create_mmap_offset(obj);
if (ret)
goto unref;

*offset = drm_vma_node_offset_addr(&obj->vma_node);
unref:
drm_gem_object_put_unlocked(obj);

return ret;
}

static struct drm_ioctl_desc vgem_ioctls[] = {
DRM_IOCTL_DEF_DRV(VGEM_FENCE_ATTACH, vgem_fence_attach_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
DRM_IOCTL_DEF_DRV(VGEM_FENCE_SIGNAL, vgem_fence_signal_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
Expand Down Expand Up @@ -439,7 +413,6 @@ static struct drm_driver vgem_driver = {
.fops = &vgem_driver_fops,

.dumb_create = vgem_gem_dumb_create,
.dumb_map_offset = vgem_gem_dumb_map,

.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/mouse/psmouse-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -2012,7 +2012,7 @@ static int psmouse_get_maxproto(char *buffer, const struct kernel_param *kp)
{
int type = *((unsigned int *)kp->arg);

return sprintf(buffer, "%s", psmouse_protocol_by_type(type)->name);
return sprintf(buffer, "%s\n", psmouse_protocol_by_type(type)->name);
}

static int __init psmouse_init(void)
Expand Down
11 changes: 8 additions & 3 deletions drivers/media/pci/ttpci/budget-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,20 +383,25 @@ static int budget_register(struct budget *budget)
ret = dvbdemux->dmx.add_frontend(&dvbdemux->dmx, &budget->hw_frontend);

if (ret < 0)
return ret;
goto err_release_dmx;

budget->mem_frontend.source = DMX_MEMORY_FE;
ret = dvbdemux->dmx.add_frontend(&dvbdemux->dmx, &budget->mem_frontend);
if (ret < 0)
return ret;
goto err_release_dmx;

ret = dvbdemux->dmx.connect_frontend(&dvbdemux->dmx, &budget->hw_frontend);
if (ret < 0)
return ret;
goto err_release_dmx;

dvb_net_init(&budget->dvb_adapter, &budget->dvb_net, &dvbdemux->dmx);

return 0;

err_release_dmx:
dvb_dmxdev_release(&budget->dmxdev);
dvb_dmx_release(&budget->demux);
return ret;
}

static void budget_unregister(struct budget *budget)
Expand Down
20 changes: 16 additions & 4 deletions drivers/media/platform/davinci/vpss.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,19 +514,31 @@ static void vpss_exit(void)

static int __init vpss_init(void)
{
int ret;

if (!request_mem_region(VPSS_CLK_CTRL, 4, "vpss_clock_control"))
return -EBUSY;

oper_cfg.vpss_regs_base2 = ioremap(VPSS_CLK_CTRL, 4);
if (unlikely(!oper_cfg.vpss_regs_base2)) {
release_mem_region(VPSS_CLK_CTRL, 4);
return -ENOMEM;
ret = -ENOMEM;
goto err_ioremap;
}

writel(VPSS_CLK_CTRL_VENCCLKEN |
VPSS_CLK_CTRL_DACCLKEN, oper_cfg.vpss_regs_base2);
VPSS_CLK_CTRL_DACCLKEN, oper_cfg.vpss_regs_base2);

ret = platform_driver_register(&vpss_driver);
if (ret)
goto err_pd_register;

return 0;

return platform_driver_register(&vpss_driver);
err_pd_register:
iounmap(oper_cfg.vpss_regs_base2);
err_ioremap:
release_mem_region(VPSS_CLK_CTRL, 4);
return ret;
}
subsys_initcall(vpss_init);
module_exit(vpss_exit);
Loading

0 comments on commit 84dd684

Please sign in to comment.