Skip to content
This repository has been archived by the owner on Dec 28, 2020. It is now read-only.

Commit

Permalink
Merge 4.9.196 into neutrino-msm-fajita-4.9
Browse files Browse the repository at this point in the history
Changes in 4.9.196: (48 commits)
        drm/bridge: tc358767: Increase AUX transfer length limit
        video: ssd1307fb: Start page range at page_offset
        drm/radeon: Fix EEH during kexec
        gpu: drm: radeon: Fix a possible null-pointer dereference in radeon_connector_set_property()
        ipmi_si: Only schedule continuously in the thread in maintenance mode
        clk: qoriq: Fix -Wunused-const-variable
        clk: sirf: Don't reference clk_init_data after registration
        powerpc/rtas: use device model APIs and serialization during LPM
        powerpc/futex: Fix warning: 'oldval' may be used uninitialized in this function
        powerpc/pseries/mobility: use cond_resched when updating device tree
        pinctrl: tegra: Fix write barrier placement in pmx_writel
        vfio_pci: Restore original state on release
        drm/amdgpu/si: fix ASIC tests
        powerpc/64s/exception: machine check use correct cfar for late handler
        powerpc/pseries: correctly track irq state in default idle
        arm64: fix unreachable code issue with cmpxchg
        clk: at91: select parent if main oscillator or bypass is enabled
        scsi: core: Reduce memory required for SCSI logging
        MIPS: tlbex: Explicitly cast _PAGE_NO_EXEC to a boolean
        mfd: intel-lpss: Remove D3cold delay
        PCI: tegra: Fix OF node reference leak
        ARM: 8898/1: mm: Don't treat faults reported from cache maintenance as writes
        HID: apple: Fix stuck function keys when using FN
        security: smack: Fix possible null-pointer dereferences in smack_socket_sock_rcv_skb()
        ARM: 8903/1: ensure that usable memory in bank 0 starts from a PMD-aligned address
        fat: work around race with userspace's read via blockdev while mounting
        hypfs: Fix error number left in struct pointer member
        ocfs2: wait for recovering done after direct unlock request
        kmemleak: increase DEBUG_KMEMLEAK_EARLY_LOG_SIZE default to 16K
        ANDROID: binder: remove waitqueue when thread exits.
        ANDROID: binder: synchronize_rcu() when using POLLFREE.
        cxgb4:Fix out-of-bounds MSI-X info array access
        hso: fix NULL-deref on tty open
        ipv6: drop incoming packets having a v4mapped source address
        net: ipv4: avoid mixed n_redirects and rate_tokens usage
        net: qlogic: Fix memory leak in ql_alloc_large_buffers
        net: Unpublish sk from sk_reuseport_cb before call_rcu
        nfc: fix memory leak in llcp_sock_bind()
        qmi_wwan: add support for Cinterion CLS8 devices
        sch_dsmark: fix potential NULL deref in dsmark_init()
        net/rds: Fix error handling in rds_ib_add_one()
        xen-netfront: do not use ~0U as error return value for xennet_fill_frags()
        sch_cbq: validate TCA_CBQ_WRROPT to avoid crash
        ipv6: Handle missing host route in __ipv6_ifa_notify
        Smack: Don't ignore other bprm->unsafe flags if LSM_UNSAFE_PTRACE is set
        smack: use GFP_NOFS while holding inode_smack::smk_lock
        NFC: fix attrs checks in netlink interface
        Linux 4.9.196

Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>

Conflicts:
	drivers/android/binder.c
  • Loading branch information
0ctobot committed Oct 9, 2019
2 parents 0c4e25b + 140fcbe commit 827633e
Show file tree
Hide file tree
Showing 48 changed files with 302 additions and 163 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = 4
PATCHLEVEL = 9
SUBLEVEL = 195
SUBLEVEL = 196
EXTRAVERSION =
NAME = Roaring Lionus

Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ static inline bool access_error(unsigned int fsr, struct vm_area_struct *vma)
{
unsigned int mask = VM_READ | VM_WRITE | VM_EXEC;

if (fsr & FSR_WRITE)
if ((fsr & FSR_WRITE) && !(fsr & FSR_CM))
mask = VM_WRITE;
if (fsr & FSR_LNX_PF)
mask = VM_EXEC;
Expand Down Expand Up @@ -284,7 +284,7 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)

if (user_mode(regs))
flags |= FAULT_FLAG_USER;
if (fsr & FSR_WRITE)
if ((fsr & FSR_WRITE) && !(fsr & FSR_CM))
flags |= FAULT_FLAG_WRITE;

/*
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mm/fault.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Fault status register encodings. We steal bit 31 for our own purposes.
*/
#define FSR_LNX_PF (1 << 31)
#define FSR_CM (1 << 13)
#define FSR_WRITE (1 << 11)
#define FSR_FS4 (1 << 10)
#define FSR_FS3_0 (15)
Expand Down
16 changes: 16 additions & 0 deletions arch/arm/mm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,22 @@ void __init adjust_lowmem_bounds(void)
*/
vmalloc_limit = (u64)(uintptr_t)vmalloc_min - PAGE_OFFSET + PHYS_OFFSET;

/*
* The first usable region must be PMD aligned. Mark its start
* as MEMBLOCK_NOMAP if it isn't
*/
for_each_memblock(memory, reg) {
if (!memblock_is_nomap(reg)) {
if (!IS_ALIGNED(reg->base, PMD_SIZE)) {
phys_addr_t len;

len = round_up(reg->base, PMD_SIZE) - reg->base;
memblock_mark_nomap(reg->base, len);
}
break;
}
}

for_each_memblock(memory, reg) {
phys_addr_t block_start = reg->base;
phys_addr_t block_end = reg->base + reg->size;
Expand Down
6 changes: 3 additions & 3 deletions arch/arm64/include/asm/cmpxchg.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ __XCHG_CASE( , , mb_8, dmb ish, nop, , a, l, "memory")
#undef __XCHG_CASE

#define __XCHG_GEN(sfx) \
static inline unsigned long __xchg##sfx(unsigned long x, \
static __always_inline unsigned long __xchg##sfx(unsigned long x, \
volatile void *ptr, \
int size) \
{ \
Expand Down Expand Up @@ -115,7 +115,7 @@ __XCHG_GEN(_mb)
#define xchg(...) __xchg_wrapper( _mb, __VA_ARGS__)

#define __CMPXCHG_GEN(sfx) \
static inline unsigned long __cmpxchg##sfx(volatile void *ptr, \
static __always_inline unsigned long __cmpxchg##sfx(volatile void *ptr, \
unsigned long old, \
unsigned long new, \
int size) \
Expand Down Expand Up @@ -248,7 +248,7 @@ __CMPWAIT_CASE( , , 8);
#undef __CMPWAIT_CASE

#define __CMPWAIT_GEN(sfx) \
static inline void __cmpwait##sfx(volatile void *ptr, \
static __always_inline void __cmpwait##sfx(volatile void *ptr, \
unsigned long val, \
int size) \
{ \
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/mm/tlbex.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ static __maybe_unused void build_convert_pte_to_entrylo(u32 **p,
return;
}

if (cpu_has_rixi && _PAGE_NO_EXEC) {
if (cpu_has_rixi && !!_PAGE_NO_EXEC) {
if (fill_includes_sw_bits) {
UASM_i_ROTR(p, reg, reg, ilog2(_PAGE_GLOBAL));
} else {
Expand Down
3 changes: 1 addition & 2 deletions arch/powerpc/include/asm/futex.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ static inline int arch_futex_atomic_op_inuser(int op, int oparg, int *oval,

pagefault_enable();

if (!ret)
*oval = oldval;
*oval = oldval;

return ret;
}
Expand Down
4 changes: 4 additions & 0 deletions arch/powerpc/kernel/exceptions-64s.S
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,10 @@ EXC_COMMON_BEGIN(machine_check_handle_early)
RFI_TO_USER_OR_KERNEL
9:
/* Deliver the machine check to host kernel in V mode. */
BEGIN_FTR_SECTION
ld r10,ORIG_GPR3(r1)
mtspr SPRN_CFAR,r10
END_FTR_SECTION_IFSET(CPU_FTR_CFAR)
MACHINE_CHECK_HANDLER_WINDUP
b machine_check_pSeries

Expand Down
11 changes: 8 additions & 3 deletions arch/powerpc/kernel/rtas.c
Original file line number Diff line number Diff line change
Expand Up @@ -874,15 +874,17 @@ static int rtas_cpu_state_change_mask(enum rtas_cpu_state state,
return 0;

for_each_cpu(cpu, cpus) {
struct device *dev = get_cpu_device(cpu);

switch (state) {
case DOWN:
cpuret = cpu_down(cpu);
cpuret = device_offline(dev);
break;
case UP:
cpuret = cpu_up(cpu);
cpuret = device_online(dev);
break;
}
if (cpuret) {
if (cpuret < 0) {
pr_debug("%s: cpu_%s for cpu#%d returned %d.\n",
__func__,
((state == UP) ? "up" : "down"),
Expand Down Expand Up @@ -971,6 +973,8 @@ int rtas_ibm_suspend_me(u64 handle)
data.token = rtas_token("ibm,suspend-me");
data.complete = &done;

lock_device_hotplug();

/* All present CPUs must be online */
cpumask_andnot(offline_mask, cpu_present_mask, cpu_online_mask);
cpuret = rtas_online_cpus_mask(offline_mask);
Expand Down Expand Up @@ -1002,6 +1006,7 @@ int rtas_ibm_suspend_me(u64 handle)
__func__);

out:
unlock_device_hotplug();
free_cpumask_var(offline_mask);
return atomic_read(&data.error);
}
Expand Down
9 changes: 9 additions & 0 deletions arch/powerpc/platforms/pseries/mobility.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include <linux/kernel.h>
#include <linux/kobject.h>
#include <linux/sched.h>
#include <linux/smp.h>
#include <linux/stat.h>
#include <linux/completion.h>
Expand Down Expand Up @@ -206,7 +207,11 @@ static int update_dt_node(__be32 phandle, s32 scope)

prop_data += vd;
}

cond_resched();
}

cond_resched();
} while (rtas_rc == 1);

of_node_put(dn);
Expand Down Expand Up @@ -282,8 +287,12 @@ int pseries_devicetree_update(s32 scope)
add_dt_node(phandle, drc_index);
break;
}

cond_resched();
}
}

cond_resched();
} while (rc == 1);

kfree(rtas_buf);
Expand Down
3 changes: 3 additions & 0 deletions arch/powerpc/platforms/pseries/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ static void pseries_lpar_idle(void)
* low power mode by ceding processor to hypervisor
*/

if (!prep_irq_for_idle())
return;

/* Indicate to hypervisor that we are idle. */
get_lppaca()->idle = 1;

Expand Down
9 changes: 5 additions & 4 deletions arch/s390/hypfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ static int hypfs_show_options(struct seq_file *s, struct dentry *root)
static int hypfs_fill_super(struct super_block *sb, void *data, int silent)
{
struct inode *root_inode;
struct dentry *root_dentry;
struct dentry *root_dentry, *update_file;
int rc = 0;
struct hypfs_sb_info *sbi;

Expand Down Expand Up @@ -298,9 +298,10 @@ static int hypfs_fill_super(struct super_block *sb, void *data, int silent)
rc = hypfs_diag_create_files(root_dentry);
if (rc)
return rc;
sbi->update_file = hypfs_create_update_file(root_dentry);
if (IS_ERR(sbi->update_file))
return PTR_ERR(sbi->update_file);
update_file = hypfs_create_update_file(root_dentry);
if (IS_ERR(update_file))
return PTR_ERR(update_file);
sbi->update_file = update_file;
hypfs_update_update(sb);
pr_info("Hypervisor filesystem mounted\n");
return 0;
Expand Down
24 changes: 19 additions & 5 deletions drivers/char/ipmi/ipmi_si_intf.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,9 @@ struct smi_info {
*/
bool irq_enable_broken;

/* Is the driver in maintenance mode? */
bool in_maintenance_mode;

/*
* Did we get an attention that we did not handle?
*/
Expand Down Expand Up @@ -1093,20 +1096,30 @@ static int ipmi_thread(void *data)
spin_unlock_irqrestore(&(smi_info->si_lock), flags);
busy_wait = ipmi_thread_busy_wait(smi_result, smi_info,
&busy_until);
if (smi_result == SI_SM_CALL_WITHOUT_DELAY)
if (smi_result == SI_SM_CALL_WITHOUT_DELAY) {
; /* do nothing */
else if (smi_result == SI_SM_CALL_WITH_DELAY && busy_wait)
schedule();
else if (smi_result == SI_SM_IDLE) {
} else if (smi_result == SI_SM_CALL_WITH_DELAY && busy_wait) {
/*
* In maintenance mode we run as fast as
* possible to allow firmware updates to
* complete as fast as possible, but normally
* don't bang on the scheduler.
*/
if (smi_info->in_maintenance_mode)
schedule();
else
usleep_range(100, 200);
} else if (smi_result == SI_SM_IDLE) {
if (atomic_read(&smi_info->need_watch)) {
schedule_timeout_interruptible(100);
} else {
/* Wait to be woken up when we are needed. */
__set_current_state(TASK_INTERRUPTIBLE);
schedule();
}
} else
} else {
schedule_timeout_interruptible(1);
}
}
return 0;
}
Expand Down Expand Up @@ -1285,6 +1298,7 @@ static void set_maintenance_mode(void *send_info, bool enable)

if (!enable)
atomic_set(&smi_info->req_events, 0);
smi_info->in_maintenance_mode = enable;
}

static const struct ipmi_smi_handlers handlers = {
Expand Down
10 changes: 7 additions & 3 deletions drivers/clk/at91/clk-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@

#define MOR_KEY_MASK (0xff << 16)

#define clk_main_parent_select(s) (((s) & \
(AT91_PMC_MOSCEN | \
AT91_PMC_OSCBYPASS)) ? 1 : 0)

struct clk_main_osc {
struct clk_hw hw;
struct regmap *regmap;
Expand Down Expand Up @@ -119,7 +123,7 @@ static int clk_main_osc_is_prepared(struct clk_hw *hw)

regmap_read(regmap, AT91_PMC_SR, &status);

return (status & AT91_PMC_MOSCS) && (tmp & AT91_PMC_MOSCEN);
return (status & AT91_PMC_MOSCS) && clk_main_parent_select(tmp);
}

static const struct clk_ops main_osc_ops = {
Expand Down Expand Up @@ -530,7 +534,7 @@ static u8 clk_sam9x5_main_get_parent(struct clk_hw *hw)

regmap_read(clkmain->regmap, AT91_CKGR_MOR, &status);

return status & AT91_PMC_MOSCEN ? 1 : 0;
return clk_main_parent_select(status);
}

static const struct clk_ops sam9x5_main_ops = {
Expand Down Expand Up @@ -572,7 +576,7 @@ at91_clk_register_sam9x5_main(struct regmap *regmap,
clkmain->hw.init = &init;
clkmain->regmap = regmap;
regmap_read(clkmain->regmap, AT91_CKGR_MOR, &status);
clkmain->parent = status & AT91_PMC_MOSCEN ? 1 : 0;
clkmain->parent = clk_main_parent_select(status);

hw = &clkmain->hw;
ret = clk_hw_register(NULL, &clkmain->hw);
Expand Down
2 changes: 1 addition & 1 deletion drivers/clk/clk-qoriq.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ static const struct clockgen_chipinfo chipinfo[] = {
.guts_compat = "fsl,qoriq-device-config-1.0",
.init_periph = p5020_init_periph,
.cmux_groups = {
&p2041_cmux_grp1, &p2041_cmux_grp2
&p5020_cmux_grp1, &p5020_cmux_grp2
},
.cmux_to_group = {
0, 1, -1
Expand Down
12 changes: 8 additions & 4 deletions drivers/clk/sirf/clk-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,10 @@ static u8 dmn_clk_get_parent(struct clk_hw *hw)
{
struct clk_dmn *clk = to_dmnclk(hw);
u32 cfg = clkc_readl(clk->regofs);
const char *name = clk_hw_get_name(hw);

/* parent of io domain can only be pll3 */
if (strcmp(hw->init->name, "io") == 0)
if (strcmp(name, "io") == 0)
return 4;

WARN_ON((cfg & (BIT(3) - 1)) > 4);
Expand All @@ -312,9 +313,10 @@ static int dmn_clk_set_parent(struct clk_hw *hw, u8 parent)
{
struct clk_dmn *clk = to_dmnclk(hw);
u32 cfg = clkc_readl(clk->regofs);
const char *name = clk_hw_get_name(hw);

/* parent of io domain can only be pll3 */
if (strcmp(hw->init->name, "io") == 0)
if (strcmp(name, "io") == 0)
return -EINVAL;

cfg &= ~(BIT(3) - 1);
Expand Down Expand Up @@ -354,7 +356,8 @@ static long dmn_clk_round_rate(struct clk_hw *hw, unsigned long rate,
{
unsigned long fin;
unsigned ratio, wait, hold;
unsigned bits = (strcmp(hw->init->name, "mem") == 0) ? 3 : 4;
const char *name = clk_hw_get_name(hw);
unsigned bits = (strcmp(name, "mem") == 0) ? 3 : 4;

fin = *parent_rate;
ratio = fin / rate;
Expand All @@ -376,7 +379,8 @@ static int dmn_clk_set_rate(struct clk_hw *hw, unsigned long rate,
struct clk_dmn *clk = to_dmnclk(hw);
unsigned long fin;
unsigned ratio, wait, hold, reg;
unsigned bits = (strcmp(hw->init->name, "mem") == 0) ? 3 : 4;
const char *name = clk_hw_get_name(hw);
unsigned bits = (strcmp(name, "mem") == 0) ? 3 : 4;

fin = parent_rate;
ratio = fin / rate;
Expand Down
6 changes: 3 additions & 3 deletions drivers/gpu/drm/amd/amdgpu/si.c
Original file line number Diff line number Diff line change
Expand Up @@ -1606,7 +1606,7 @@ static void si_program_aspm(struct amdgpu_device *adev)
if (orig != data)
si_pif_phy1_wreg(adev,PB1_PIF_PWRDOWN_1, data);

if ((adev->family != CHIP_OLAND) && (adev->family != CHIP_HAINAN)) {
if ((adev->asic_type != CHIP_OLAND) && (adev->asic_type != CHIP_HAINAN)) {
orig = data = si_pif_phy0_rreg(adev,PB0_PIF_PWRDOWN_0);
data &= ~PLL_RAMP_UP_TIME_0_MASK;
if (orig != data)
Expand Down Expand Up @@ -1655,14 +1655,14 @@ static void si_program_aspm(struct amdgpu_device *adev)

orig = data = si_pif_phy0_rreg(adev,PB0_PIF_CNTL);
data &= ~LS2_EXIT_TIME_MASK;
if ((adev->family == CHIP_OLAND) || (adev->family == CHIP_HAINAN))
if ((adev->asic_type == CHIP_OLAND) || (adev->asic_type == CHIP_HAINAN))
data |= LS2_EXIT_TIME(5);
if (orig != data)
si_pif_phy0_wreg(adev,PB0_PIF_CNTL, data);

orig = data = si_pif_phy1_rreg(adev,PB1_PIF_CNTL);
data &= ~LS2_EXIT_TIME_MASK;
if ((adev->family == CHIP_OLAND) || (adev->family == CHIP_HAINAN))
if ((adev->asic_type == CHIP_OLAND) || (adev->asic_type == CHIP_HAINAN))
data |= LS2_EXIT_TIME(5);
if (orig != data)
si_pif_phy1_wreg(adev,PB1_PIF_CNTL, data);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/bridge/tc358767.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ static ssize_t tc_aux_transfer(struct drm_dp_aux *aux,
struct drm_dp_aux_msg *msg)
{
struct tc_data *tc = aux_to_tc(aux);
size_t size = min_t(size_t, 8, msg->size);
size_t size = min_t(size_t, DP_AUX_MAX_PAYLOAD_BYTES - 1, msg->size);
u8 request = msg->request & ~DP_AUX_I2C_MOT;
u8 *buf = msg->buffer;
u32 tmp = 0;
Expand Down
Loading

0 comments on commit 827633e

Please sign in to comment.