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

Commit

Permalink
Merge branch 'dev/neutrino-msm-mata-4.4' of https://github.com/0ctobo…
Browse files Browse the repository at this point in the history
…t/neutrino-staging into neutrino-msm-mata-4.4

* dev/neutrino-msm-mata-4.4: (1 commit)
  Merge 4.4.161 into neutrino-msm-mata-4.4

Signed-off-by: Adam W. Willis <[email protected]>
  • Loading branch information
0ctobot committed Oct 19, 2018
2 parents c7b6477 + 28c47d2 commit 93fd7e4
Show file tree
Hide file tree
Showing 31 changed files with 433 additions and 232 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 = 160
SUBLEVEL = 161
EXTRAVERSION =
NAME = Blurry Fish Butt

Expand Down
20 changes: 20 additions & 0 deletions arch/arc/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,26 @@ int copy_thread(unsigned long clone_flags,
task_thread_info(current)->thr_ptr;
}


/*
* setup usermode thread pointer #1:
* when child is picked by scheduler, __switch_to() uses @c_callee to
* populate usermode callee regs: this works (despite being in a kernel
* function) since special return path for child @ret_from_fork()
* ensures those regs are not clobbered all the way to RTIE to usermode
*/
c_callee->r25 = task_thread_info(p)->thr_ptr;

#ifdef CONFIG_ARC_CURR_IN_REG
/*
* setup usermode thread pointer #2:
* however for this special use of r25 in kernel, __switch_to() sets
* r25 for kernel needs and only in the final return path is usermode
* r25 setup, from pt_regs->user_r25. So set that up as well
*/
c_regs->user_r25 = c_callee->r25;
#endif

return 0;
}

Expand Down
23 changes: 15 additions & 8 deletions arch/powerpc/kernel/fadump.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,9 @@ static int __init early_fadump_reserve_mem(char *p)
}
early_param("fadump_reserve_mem", early_fadump_reserve_mem);

static void register_fw_dump(struct fadump_mem_struct *fdm)
static int register_fw_dump(struct fadump_mem_struct *fdm)
{
int rc;
int rc, err;
unsigned int wait_time;

pr_debug("Registering for firmware-assisted kernel dump...\n");
Expand All @@ -379,26 +379,34 @@ static void register_fw_dump(struct fadump_mem_struct *fdm)

} while (wait_time);

err = -EIO;
switch (rc) {
default:
pr_err("Failed to register. Unknown Error(%d).\n", rc);
break;
case -1:
printk(KERN_ERR "Failed to register firmware-assisted kernel"
" dump. Hardware Error(%d).\n", rc);
break;
case -3:
printk(KERN_ERR "Failed to register firmware-assisted kernel"
" dump. Parameter Error(%d).\n", rc);
err = -EINVAL;
break;
case -9:
printk(KERN_ERR "firmware-assisted kernel dump is already "
" registered.");
fw_dump.dump_registered = 1;
err = -EEXIST;
break;
case 0:
printk(KERN_INFO "firmware-assisted kernel dump registration"
" is successful\n");
fw_dump.dump_registered = 1;
err = 0;
break;
}
return err;
}

void crash_fadump(struct pt_regs *regs, const char *str)
Expand Down Expand Up @@ -997,7 +1005,7 @@ static unsigned long init_fadump_header(unsigned long addr)
return addr;
}

static void register_fadump(void)
static int register_fadump(void)
{
unsigned long addr;
void *vaddr;
Expand All @@ -1008,7 +1016,7 @@ static void register_fadump(void)
* assisted dump.
*/
if (!fw_dump.reserve_dump_area_size)
return;
return -ENODEV;

ret = fadump_setup_crash_memory_ranges();
if (ret)
Expand All @@ -1023,7 +1031,7 @@ static void register_fadump(void)
fadump_create_elfcore_headers(vaddr);

/* register the future kernel dump with firmware. */
register_fw_dump(&fdm);
return register_fw_dump(&fdm);
}

static int fadump_unregister_dump(struct fadump_mem_struct *fdm)
Expand Down Expand Up @@ -1208,19 +1216,18 @@ static ssize_t fadump_register_store(struct kobject *kobj,
switch (buf[0]) {
case '0':
if (fw_dump.dump_registered == 0) {
ret = -EINVAL;
goto unlock_out;
}
/* Un-register Firmware-assisted dump */
fadump_unregister_dump(&fdm);
break;
case '1':
if (fw_dump.dump_registered == 1) {
ret = -EINVAL;
ret = -EEXIST;
goto unlock_out;
}
/* Register Firmware-assisted dump */
register_fadump();
ret = register_fadump();
break;
default:
ret = -EINVAL;
Expand Down
26 changes: 14 additions & 12 deletions arch/x86/entry/vdso/vclock_gettime.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,19 @@ extern u8 pvclock_page
notrace static long vdso_fallback_gettime(long clock, struct timespec *ts)
{
long ret;
asm("syscall" : "=a" (ret) :
"0" (__NR_clock_gettime), "D" (clock), "S" (ts) : "memory");
asm ("syscall" : "=a" (ret), "=m" (*ts) :
"0" (__NR_clock_gettime), "D" (clock), "S" (ts) :
"memory", "rcx", "r11");
return ret;
}

notrace static long vdso_fallback_gtod(struct timeval *tv, struct timezone *tz)
{
long ret;

asm("syscall" : "=a" (ret) :
"0" (__NR_gettimeofday), "D" (tv), "S" (tz) : "memory");
asm ("syscall" : "=a" (ret), "=m" (*tv), "=m" (*tz) :
"0" (__NR_gettimeofday), "D" (tv), "S" (tz) :
"memory", "rcx", "r11");
return ret;
}

Expand Down Expand Up @@ -143,13 +145,13 @@ notrace static long vdso_fallback_gettime(long clock, struct timespec *ts)
{
long ret;

asm(
asm (
"mov %%ebx, %%edx \n"
"mov %2, %%ebx \n"
"mov %[clock], %%ebx \n"
"call __kernel_vsyscall \n"
"mov %%edx, %%ebx \n"
: "=a" (ret)
: "0" (__NR_clock_gettime), "g" (clock), "c" (ts)
: "=a" (ret), "=m" (*ts)
: "0" (__NR_clock_gettime), [clock] "g" (clock), "c" (ts)
: "memory", "edx");
return ret;
}
Expand All @@ -158,13 +160,13 @@ notrace static long vdso_fallback_gtod(struct timeval *tv, struct timezone *tz)
{
long ret;

asm(
asm (
"mov %%ebx, %%edx \n"
"mov %2, %%ebx \n"
"mov %[tv], %%ebx \n"
"call __kernel_vsyscall \n"
"mov %%edx, %%ebx \n"
: "=a" (ret)
: "0" (__NR_gettimeofday), "g" (tv), "c" (tz)
: "=a" (ret), "=m" (*tv), "=m" (*tz)
: "0" (__NR_gettimeofday), [tv] "g" (tv), "c" (tz)
: "memory", "edx");
return ret;
}
Expand Down
5 changes: 4 additions & 1 deletion drivers/base/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1360,8 +1360,10 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)

dpm_wait_for_children(dev, async);

if (async_error)
if (async_error) {
dev->power.direct_complete = false;
goto Complete;
}

/*
* If a device configured to wake up the system from sleep states
Expand All @@ -1376,6 +1378,7 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
pm_get_active_wakeup_sources(suspend_abort,
MAX_SUSPEND_ABORT_LEN);
log_suspend_abort_reason(suspend_abort);
dev->power.direct_complete = false;
async_error = -EBUSY;
goto Complete;
}
Expand Down
2 changes: 2 additions & 0 deletions drivers/infiniband/core/ucma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1709,6 +1709,8 @@ static int ucma_close(struct inode *inode, struct file *filp)
mutex_lock(&mut);
if (!ctx->closing) {
mutex_unlock(&mut);
ucma_put_ctx(ctx);
wait_for_completion(&ctx->comp);
/* rdma_destroy_id ensures that no event handlers are
* inflight for that id before releasing it.
*/
Expand Down
9 changes: 7 additions & 2 deletions drivers/md/dm-cache-target.c
Original file line number Diff line number Diff line change
Expand Up @@ -3388,8 +3388,13 @@ static dm_cblock_t get_cache_dev_size(struct cache *cache)

static bool can_resize(struct cache *cache, dm_cblock_t new_size)
{
if (from_cblock(new_size) > from_cblock(cache->cache_size))
return true;
if (from_cblock(new_size) > from_cblock(cache->cache_size)) {
if (cache->sized) {
DMERR("%s: unable to extend cache due to missing cache table reload",
cache_device_name(cache));
return false;
}
}

/*
* We can't drop a dirty block when shrinking the cache.
Expand Down
12 changes: 4 additions & 8 deletions drivers/net/wireless/ath/ath10k/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,36 +152,32 @@ TRACE_EVENT(ath10k_log_dbg_dump,
);

TRACE_EVENT(ath10k_wmi_cmd,
TP_PROTO(struct ath10k *ar, int id, const void *buf, size_t buf_len,
int ret),
TP_PROTO(struct ath10k *ar, int id, const void *buf, size_t buf_len),

TP_ARGS(ar, id, buf, buf_len, ret),
TP_ARGS(ar, id, buf, buf_len),

TP_STRUCT__entry(
__string(device, dev_name(ar->dev))
__string(driver, dev_driver_string(ar->dev))
__field(unsigned int, id)
__field(size_t, buf_len)
__dynamic_array(u8, buf, buf_len)
__field(int, ret)
),

TP_fast_assign(
__assign_str(device, dev_name(ar->dev));
__assign_str(driver, dev_driver_string(ar->dev));
__entry->id = id;
__entry->buf_len = buf_len;
__entry->ret = ret;
memcpy(__get_dynamic_array(buf), buf, buf_len);
),

TP_printk(
"%s %s id %d len %zu ret %d",
"%s %s id %d len %zu",
__get_str(driver),
__get_str(device),
__entry->id,
__entry->buf_len,
__entry->ret
__entry->buf_len
)
);

Expand Down
8 changes: 4 additions & 4 deletions drivers/net/wireless/ath/ath10k/wmi-tlv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1575,10 +1575,10 @@ ath10k_wmi_tlv_op_gen_start_scan(struct ath10k *ar,
bssid_len = arg->n_bssids * sizeof(struct wmi_mac_addr);
ie_len = roundup(arg->ie_len, 4);
len = (sizeof(*tlv) + sizeof(*cmd)) +
(arg->n_channels ? sizeof(*tlv) + chan_len : 0) +
(arg->n_ssids ? sizeof(*tlv) + ssid_len : 0) +
(arg->n_bssids ? sizeof(*tlv) + bssid_len : 0) +
(arg->ie_len ? sizeof(*tlv) + ie_len : 0);
sizeof(*tlv) + chan_len +
sizeof(*tlv) + ssid_len +
sizeof(*tlv) + bssid_len +
sizeof(*tlv) + ie_len;

skb = ath10k_wmi_alloc_skb(ar, len);
if (!skb)
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath10k/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1711,8 +1711,8 @@ int ath10k_wmi_cmd_send_nowait(struct ath10k *ar, struct sk_buff *skb,
cmd_hdr->cmd_id = __cpu_to_le32(cmd);

memset(skb_cb, 0, sizeof(*skb_cb));
trace_ath10k_wmi_cmd(ar, cmd_id, skb->data, skb->len);
ret = ath10k_htc_send(&ar->htc, ar->wmi.eid, skb);
trace_ath10k_wmi_cmd(ar, cmd_id, skb->data, skb->len, ret);

if (ret)
goto err_pull;
Expand Down
28 changes: 19 additions & 9 deletions drivers/of/unittest.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,9 @@ static void __init of_unittest_parse_interrupts(void)
struct of_phandle_args args;
int i, rc;

if (of_irq_workarounds & OF_IMAP_OLDWORLD_MAC)
return;

np = of_find_node_by_path("/testcase-data/interrupts/interrupts0");
if (!np) {
pr_err("missing testcase data\n");
Expand Down Expand Up @@ -627,6 +630,9 @@ static void __init of_unittest_parse_interrupts_extended(void)
struct of_phandle_args args;
int i, rc;

if (of_irq_workarounds & OF_IMAP_OLDWORLD_MAC)
return;

np = of_find_node_by_path("/testcase-data/interrupts/interrupts-extended0");
if (!np) {
pr_err("missing testcase data\n");
Expand Down Expand Up @@ -778,15 +784,19 @@ static void __init of_unittest_platform_populate(void)
pdev = of_find_device_by_node(np);
unittest(pdev, "device 1 creation failed\n");

irq = platform_get_irq(pdev, 0);
unittest(irq == -EPROBE_DEFER, "device deferred probe failed - %d\n", irq);

/* Test that a parsing failure does not return -EPROBE_DEFER */
np = of_find_node_by_path("/testcase-data/testcase-device2");
pdev = of_find_device_by_node(np);
unittest(pdev, "device 2 creation failed\n");
irq = platform_get_irq(pdev, 0);
unittest(irq < 0 && irq != -EPROBE_DEFER, "device parsing error failed - %d\n", irq);
if (!(of_irq_workarounds & OF_IMAP_OLDWORLD_MAC)) {
irq = platform_get_irq(pdev, 0);
unittest(irq == -EPROBE_DEFER,
"device deferred probe failed - %d\n", irq);

/* Test that a parsing failure does not return -EPROBE_DEFER */
np = of_find_node_by_path("/testcase-data/testcase-device2");
pdev = of_find_device_by_node(np);
unittest(pdev, "device 2 creation failed\n");
irq = platform_get_irq(pdev, 0);
unittest(irq < 0 && irq != -EPROBE_DEFER,
"device parsing error failed - %d\n", irq);
}

np = of_find_node_by_path("/testcase-data/platform-tests");
unittest(np, "No testcase data in device tree\n");
Expand Down
Loading

0 comments on commit 93fd7e4

Please sign in to comment.