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

Commit

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

* tag 'v4.4.196':
  Linux 4.4.196
  NFC: fix attrs checks in netlink interface
  smack: use GFP_NOFS while holding inode_smack::smk_lock
  Smack: Don't ignore other bprm->unsafe flags if LSM_UNSAFE_PTRACE is set
  sch_cbq: validate TCA_CBQ_WRROPT to avoid crash
  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_dsmark: fix potential NULL deref in dsmark_init()
  nfc: fix memory leak in llcp_sock_bind()
  net: qlogic: Fix memory leak in ql_alloc_large_buffers
  net: ipv4: avoid mixed n_redirects and rate_tokens usage
  ipv6: drop incoming packets having a v4mapped source address
  hso: fix NULL-deref on tty open
  ANDROID: binder: synchronize_rcu() when using POLLFREE.
  ANDROID: binder: remove waitqueue when thread exits.
  kmemleak: increase DEBUG_KMEMLEAK_EARLY_LOG_SIZE default to 16K
  ocfs2: wait for recovering done after direct unlock request
  hypfs: Fix error number left in struct pointer member
  fat: work around race with userspace's read via blockdev while mounting
  security: smack: Fix possible null-pointer dereferences in smack_socket_sock_rcv_skb()
  HID: apple: Fix stuck function keys when using FN
  ARM: 8898/1: mm: Don't treat faults reported from cache maintenance as writes
  mfd: intel-lpss: Remove D3cold delay
  scsi: core: Reduce memory required for SCSI logging
  powerpc/pseries: correctly track irq state in default idle
  powerpc/64s/exception: machine check use correct cfar for late handler
  vfio_pci: Restore original state on release
  pinctrl: tegra: Fix write barrier placement in pmx_writel
  powerpc/pseries/mobility: use cond_resched when updating device tree
  powerpc/futex: Fix warning: 'oldval' may be used uninitialized in this function
  powerpc/rtas: use device model APIs and serialization during LPM
  clk: sirf: Don't reference clk_init_data after registration
  clk: qoriq: Fix -Wunused-const-variable
  ipmi_si: Only schedule continuously in the thread in maintenance mode
  gpu: drm: radeon: Fix a possible null-pointer dereference in radeon_connector_set_property()
  video: ssd1307fb: Start page range at page_offset

Signed-off-by: Abhishek AN <[email protected]>
  • Loading branch information
DarkAbhi committed Oct 7, 2019
2 parents 9248630 + c61ebb6 commit c2ec909
Show file tree
Hide file tree
Showing 36 changed files with 221 additions and 134 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 = 4
SUBLEVEL = 195
SUBLEVEL = 196
EXTRAVERSION =
NAME = Blurry Fish Butt

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 @@ -211,7 +211,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 @@ -281,7 +281,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
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 @@ -1465,6 +1465,10 @@ 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 @@ -857,15 +857,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 @@ -954,6 +956,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 @@ -985,6 +989,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 @@ -369,6 +369,9 @@ static void pseries_lpar_idle(void)
* low power mode by cedeing 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 @@ -281,6 +281,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 @@ -1091,20 +1094,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 @@ -1283,6 +1296,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
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
2 changes: 1 addition & 1 deletion drivers/gpu/drm/radeon/radeon_connectors.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ static int radeon_connector_set_property(struct drm_connector *connector, struct

radeon_encoder->output_csc = val;

if (connector->encoder->crtc) {
if (connector->encoder && connector->encoder->crtc) {
struct drm_crtc *crtc = connector->encoder->crtc;
const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
Expand Down
49 changes: 28 additions & 21 deletions drivers/hid/hid-apple.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ MODULE_PARM_DESC(swap_opt_cmd, "Swap the Option (\"Alt\") and Command (\"Flag\")
struct apple_sc {
unsigned long quirks;
unsigned int fn_on;
DECLARE_BITMAP(pressed_fn, KEY_CNT);
DECLARE_BITMAP(pressed_numlock, KEY_CNT);
};

Expand Down Expand Up @@ -182,6 +181,8 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
{
struct apple_sc *asc = hid_get_drvdata(hid);
const struct apple_key_translation *trans, *table;
bool do_translate;
u16 code = 0;

if (usage->code == KEY_FN) {
asc->fn_on = !!value;
Expand All @@ -190,8 +191,6 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
}

if (fnmode) {
int do_translate;

if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI &&
hid->product <= USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS)
table = macbookair_fn_keys;
Expand All @@ -203,25 +202,33 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
trans = apple_find_translation (table, usage->code);

if (trans) {
if (test_bit(usage->code, asc->pressed_fn))
do_translate = 1;
else if (trans->flags & APPLE_FLAG_FKEY)
do_translate = (fnmode == 2 && asc->fn_on) ||
(fnmode == 1 && !asc->fn_on);
else
do_translate = asc->fn_on;

if (do_translate) {
if (value)
set_bit(usage->code, asc->pressed_fn);
else
clear_bit(usage->code, asc->pressed_fn);

input_event(input, usage->type, trans->to,
value);

return 1;
if (test_bit(trans->from, input->key))
code = trans->from;
else if (test_bit(trans->to, input->key))
code = trans->to;

if (!code) {
if (trans->flags & APPLE_FLAG_FKEY) {
switch (fnmode) {
case 1:
do_translate = !asc->fn_on;
break;
case 2:
do_translate = asc->fn_on;
break;
default:
/* should never happen */
do_translate = false;
}
} else {
do_translate = asc->fn_on;
}

code = do_translate ? trans->to : trans->from;
}

input_event(input, usage->type, code, value);
return 1;
}

if (asc->quirks & APPLE_NUMLOCK_EMULATION &&
Expand Down
2 changes: 2 additions & 0 deletions drivers/mfd/intel-lpss-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ static int intel_lpss_pci_probe(struct pci_dev *pdev,
info->mem = &pdev->resource[0];
info->irq = pdev->irq;

pdev->d3cold_delay = 0;

/* Probably it is enough to set this for iDMA capable devices only */
pci_set_master(pdev);

Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/qlogic/qla3xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2783,6 +2783,7 @@ static int ql_alloc_large_buffers(struct ql3_adapter *qdev)
netdev_err(qdev->ndev,
"PCI mapping failed with error: %d\n",
err);
dev_kfree_skb_irq(skb);
ql_free_large_buffers(qdev);
return -ENOMEM;
}
Expand Down
12 changes: 8 additions & 4 deletions drivers/net/usb/hso.c
Original file line number Diff line number Diff line change
Expand Up @@ -2650,14 +2650,18 @@ static struct hso_device *hso_create_bulk_serial_device(
*/
if (serial->tiocmget) {
tiocmget = serial->tiocmget;
tiocmget->endp = hso_get_ep(interface,
USB_ENDPOINT_XFER_INT,
USB_DIR_IN);
if (!tiocmget->endp) {
dev_err(&interface->dev, "Failed to find INT IN ep\n");
goto exit;
}

tiocmget->urb = usb_alloc_urb(0, GFP_KERNEL);
if (tiocmget->urb) {
mutex_init(&tiocmget->mutex);
init_waitqueue_head(&tiocmget->waitq);
tiocmget->endp = hso_get_ep(
interface,
USB_ENDPOINT_XFER_INT,
USB_DIR_IN);
} else
hso_free_tiomget(serial);
}
Expand Down
Loading

0 comments on commit c2ec909

Please sign in to comment.