Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

Commit

Permalink
Merge 4.14.195 into neutrino-msm-hotdogb-4.14
Browse files Browse the repository at this point in the history
Changes in 4.14.195: (51 commits)
        drm/vgem: Replace opencoded version of drm_gem_dumb_map_offset()
        perf probe: Fix memory leakage when the probe point is not found
        khugepaged: khugepaged_test_exit() check mmget_still_valid()
        khugepaged: adjust VM_BUG_ON_MM() in __khugepaged_enter()
        powerpc/mm: Only read faulting instruction when necessary in do_page_fault()
        powerpc: Allow 4224 bytes of stack expansion for the signal frame
        btrfs: export helpers for subvolume name/id resolution
        btrfs: don't show full path of bind mounts in subvol=
        btrfs: Move free_pages_out label in inline extent handling branch in compress_file_range
        btrfs: inode: fix NULL pointer dereference if inode doesn't need compression
        btrfs: sysfs: use NOFS for device creation
        romfs: fix uninitialized memory leak in romfs_dev_read()
        kernel/relay.c: fix memleak on destroy relay channel
        mm: include CMA pages in lowmem_reserve at boot
        mm, page_alloc: fix core hung in free_pcppages_bulk()
        ext4: fix checking of directory entry validity for inline directories
        jbd2: add the missing unlock_buffer() in the error path of jbd2_write_superblock()
        spi: Prevent adding devices below an unregistering controller
        scsi: ufs: Add DELAY_BEFORE_LPM quirk for Micron devices
        media: budget-core: Improve exception handling in budget_register()
        rtc: goldfish: Enable interrupt in set_alarm() when necessary
        media: vpss: clean up resources in init
        Input: psmouse - add a newline when printing 'proto' by sysfs
        m68knommu: fix overwriting of bits in ColdFire V3 cache control
        xfs: fix inode quota reservation checks
        jffs2: fix UAF problem
        cpufreq: intel_pstate: Fix cpuinfo_max_freq when MSR_TURBO_RATIO_LIMIT is 0
        scsi: libfc: Free skb in fc_disc_gpn_id_resp() for valid cases
        virtio_ring: Avoid loop when vq is broken in virtqueue_poll
        xfs: Fix UBSAN null-ptr-deref in xfs_sysfs_init
        alpha: fix annotation of io{read,write}{16,32}be()
        ext4: fix potential negative array index in do_split()
        i40e: Set RX_ONLY mode for unicast promiscuous on VLAN
        i40e: Fix crash during removing i40e driver
        net: fec: correct the error path for regulator disable in probe
        bonding: show saner speed for broadcast mode
        bonding: fix a potential double-unregister
        ASoC: msm8916-wcd-analog: fix register Interrupt offset
        ASoC: intel: Fix memleak in sst_media_open
        vfio/type1: Add proper error unwind for vfio_iommu_replay()
        bonding: fix active-backup failover for current ARP slave
        hv_netvsc: Fix the queue_mapping in netvsc_vf_xmit()
        net: dsa: b53: check for timeout
        powerpc/pseries: Do not initiate shutdown when system is running on UPS
        epoll: Keep a reference on files added to the check list
        do_epoll_ctl(): clean the failure exits up a bit
        mm/hugetlb: fix calculation of adjust_range_if_pmd_sharing_possible
        xen: don't reschedule in preemption off sections
        clk: Evict unregistered clks from parent caches
        KVM: arm/arm64: Don't reschedule in unmap_stage2_range()
        Linux 4.14.195

[@0ctobot: clk: Mark orphan_list as __maybe_unused]
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>

Conflicts:
	drivers/clk/clk.c
  • Loading branch information
0ctobot committed Aug 31, 2020
2 parents e90cdde + d7e78d0 commit eb63148
Show file tree
Hide file tree
Showing 48 changed files with 399 additions and 171 deletions.
2 changes: 1 addition & 1 deletion Makefile
@@ -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
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
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
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
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
Expand Up @@ -63,6 +63,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 __maybe_unused *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
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
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
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
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
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);

0 comments on commit eb63148

Please sign in to comment.