Skip to content

Commit

Permalink
Merge tag 'char-misc-4.13-rc1' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…kernel/git/gregkh/char-misc

Pull char/misc driver fixes from Greg KH:
 "Here are some small char and misc driver fixes for 4.13-rc2. All fix
  reported problems with 4.13-rc1 or older kernels (like the binder
  fixes). Full details in the shortlog.

  All have been in linux-next with no reported issues"

* tag 'char-misc-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  w1: omap-hdq: fix error return code in omap_hdq_probe()
  regmap: regmap-w1: Fix build troubles
  w1: Fix slave count on 1-Wire bus (resend)
  mux: mux-core: unregister mux_class in mux_exit()
  mux: remove the Kconfig question for the subsystem
  nvmem: rockchip-efuse: amend compatible rk322x-efuse to rk3228-efuse
  drivers/fsi: fix fsi_slave_mode prototype
  fsi: core: register with postcore_initcall
  thunderbolt: Correct access permissions for active NVM contents
  vmbus: re-enable channel tasklet
  spmi: pmic-arb: Always allocate ppid_to_apid table
  MAINTAINERS: Add entry for SPMI subsystem
  spmi: Include OF based modalias in device uevent
  binder: Use wake up hint for synchronous transactions.
  binder: use group leader instead of open thread
  Revert "android: binder: Sanity check at binder ioctl"
  • Loading branch information
torvalds committed Jul 22, 2017
2 parents 55fd939 + c89876d commit dedaff2
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 44 deletions.
2 changes: 1 addition & 1 deletion Documentation/devicetree/bindings/nvmem/rockchip-efuse.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Required properties:
- compatible: Should be one of the following.
- "rockchip,rk3066a-efuse" - for RK3066a SoCs.
- "rockchip,rk3188-efuse" - for RK3188 SoCs.
- "rockchip,rk322x-efuse" - for RK322x SoCs.
- "rockchip,rk3228-efuse" - for RK3228 SoCs.
- "rockchip,rk3288-efuse" - for RK3288 SoCs.
- "rockchip,rk3399-efuse" - for RK3399 SoCs.
- reg: Should contain the registers location and exact eFuse size
Expand Down
9 changes: 9 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -12356,6 +12356,15 @@ S: Supported
F: Documentation/networking/spider_net.txt
F: drivers/net/ethernet/toshiba/spider_net*

SPMI SUBSYSTEM
R: Stephen Boyd <[email protected]>
L: [email protected]
F: Documentation/devicetree/bindings/spmi/
F: drivers/spmi/
F: include/dt-bindings/spmi/spmi.h
F: include/linux/spmi.h
F: include/trace/events/spmi.h

SPU FILE SYSTEM
M: Jeremy Kerr <[email protected]>
L: [email protected]
Expand Down
17 changes: 8 additions & 9 deletions drivers/android/binder.c
Original file line number Diff line number Diff line change
Expand Up @@ -2200,8 +2200,12 @@ static void binder_transaction(struct binder_proc *proc,
list_add_tail(&t->work.entry, target_list);
tcomplete->type = BINDER_WORK_TRANSACTION_COMPLETE;
list_add_tail(&tcomplete->entry, &thread->todo);
if (target_wait)
wake_up_interruptible(target_wait);
if (target_wait) {
if (reply || !(t->flags & TF_ONE_WAY))
wake_up_interruptible_sync(target_wait);
else
wake_up_interruptible(target_wait);
}
return;

err_translate_failed:
Expand Down Expand Up @@ -3247,10 +3251,6 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
/*pr_info("binder_ioctl: %d:%d %x %lx\n",
proc->pid, current->pid, cmd, arg);*/

if (unlikely(current->mm != proc->vma_vm_mm)) {
pr_err("current mm mismatch proc mm\n");
return -EINVAL;
}
trace_binder_ioctl(cmd, arg);

ret = wait_event_interruptible(binder_user_error_wait, binder_stop_on_user_error < 2);
Expand Down Expand Up @@ -3464,9 +3464,8 @@ static int binder_open(struct inode *nodp, struct file *filp)
proc = kzalloc(sizeof(*proc), GFP_KERNEL);
if (proc == NULL)
return -ENOMEM;
get_task_struct(current);
proc->tsk = current;
proc->vma_vm_mm = current->mm;
get_task_struct(current->group_leader);
proc->tsk = current->group_leader;
INIT_LIST_HEAD(&proc->todo);
init_waitqueue_head(&proc->wait);
proc->default_priority = task_nice(current);
Expand Down
7 changes: 3 additions & 4 deletions drivers/fsi/fsi-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ static inline uint32_t fsi_smode_sid(int x)
return (x & FSI_SMODE_SID_MASK) << FSI_SMODE_SID_SHIFT;
}

static const uint32_t fsi_slave_smode(int id)
static uint32_t fsi_slave_smode(int id)
{
return FSI_SMODE_WSC | FSI_SMODE_ECRC
| fsi_smode_sid(id)
Expand Down Expand Up @@ -883,17 +883,16 @@ struct bus_type fsi_bus_type = {
};
EXPORT_SYMBOL_GPL(fsi_bus_type);

static int fsi_init(void)
static int __init fsi_init(void)
{
return bus_register(&fsi_bus_type);
}
postcore_initcall(fsi_init);

static void fsi_exit(void)
{
bus_unregister(&fsi_bus_type);
}

module_init(fsi_init);
module_exit(fsi_exit);
module_param(discard_errors, int, 0664);
MODULE_LICENSE("GPL");
Expand Down
2 changes: 2 additions & 0 deletions drivers/hv/channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,8 @@ static int vmbus_close_internal(struct vmbus_channel *channel)
get_order(channel->ringbuffer_pagecount * PAGE_SIZE));

out:
/* re-enable tasklet for use on re-open */
tasklet_enable(&channel->callback_event);
return ret;
}

Expand Down
19 changes: 5 additions & 14 deletions drivers/mux/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,11 @@
# Multiplexer devices
#

menuconfig MULTIPLEXER
tristate "Multiplexer subsystem"
help
Multiplexer controller subsystem. Multiplexers are used in a
variety of settings, and this subsystem abstracts their use
so that the rest of the kernel sees a common interface. When
multiple parallel multiplexers are controlled by one single
multiplexer controller, this subsystem also coordinates the
multiplexer accesses.

To compile the subsystem as a module, choose M here: the module will
be called mux-core.
config MULTIPLEXER
tristate

if MULTIPLEXER
menu "Multiplexer drivers"
depends on MULTIPLEXER

config MUX_ADG792A
tristate "Analog Devices ADG792A/ADG792G Multiplexers"
Expand Down Expand Up @@ -56,4 +47,4 @@ config MUX_MMIO
To compile the driver as a module, choose M here: the module will
be called mux-mmio.

endif
endmenu
2 changes: 1 addition & 1 deletion drivers/mux/mux-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static int __init mux_init(void)

static void __exit mux_exit(void)
{
class_register(&mux_class);
class_unregister(&mux_class);
ida_destroy(&mux_ida);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/nvmem/rockchip-efuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ static const struct of_device_id rockchip_efuse_match[] = {
.data = (void *)&rockchip_rk3288_efuse_read,
},
{
.compatible = "rockchip,rk322x-efuse",
.compatible = "rockchip,rk3228-efuse",
.data = (void *)&rockchip_rk3288_efuse_read,
},
{
Expand Down
17 changes: 7 additions & 10 deletions drivers/spmi/spmi-pmic-arb.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ struct apid_data {
* @spmic: SPMI controller object
* @ver_ops: version dependent operations.
* @ppid_to_apid in-memory copy of PPID -> channel (APID) mapping table.
* v2 only.
*/
struct spmi_pmic_arb {
void __iomem *rd_base;
Expand Down Expand Up @@ -1016,6 +1015,13 @@ static int spmi_pmic_arb_probe(struct platform_device *pdev)
goto err_put_ctrl;
}

pa->ppid_to_apid = devm_kcalloc(&ctrl->dev, PMIC_ARB_MAX_PPID,
sizeof(*pa->ppid_to_apid), GFP_KERNEL);
if (!pa->ppid_to_apid) {
err = -ENOMEM;
goto err_put_ctrl;
}

hw_ver = readl_relaxed(core + PMIC_ARB_VERSION);

if (hw_ver < PMIC_ARB_VERSION_V2_MIN) {
Expand Down Expand Up @@ -1048,15 +1054,6 @@ static int spmi_pmic_arb_probe(struct platform_device *pdev)
err = PTR_ERR(pa->wr_base);
goto err_put_ctrl;
}

pa->ppid_to_apid = devm_kcalloc(&ctrl->dev,
PMIC_ARB_MAX_PPID,
sizeof(*pa->ppid_to_apid),
GFP_KERNEL);
if (!pa->ppid_to_apid) {
err = -ENOMEM;
goto err_put_ctrl;
}
}

dev_info(&ctrl->dev, "PMIC arbiter version %s (0x%x)\n",
Expand Down
12 changes: 12 additions & 0 deletions drivers/spmi/spmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,23 @@ static int spmi_drv_remove(struct device *dev)
return 0;
}

static int spmi_drv_uevent(struct device *dev, struct kobj_uevent_env *env)
{
int ret;

ret = of_device_uevent_modalias(dev, env);
if (ret != -ENODEV)
return ret;

return 0;
}

static struct bus_type spmi_bus_type = {
.name = "spmi",
.match = spmi_device_match,
.probe = spmi_drv_probe,
.remove = spmi_drv_remove,
.uevent = spmi_drv_uevent,
};

/**
Expand Down
3 changes: 2 additions & 1 deletion drivers/thunderbolt/switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,11 @@ static struct nvmem_device *register_nvmem(struct tb_switch *sw, int id,
if (active) {
config.name = "nvm_active";
config.reg_read = tb_switch_nvm_read;
config.read_only = true;
} else {
config.name = "nvm_non_active";
config.reg_write = tb_switch_nvm_write;
config.root_only = true;
}

config.id = id;
Expand All @@ -292,7 +294,6 @@ static struct nvmem_device *register_nvmem(struct tb_switch *sw, int id,
config.size = size;
config.dev = &sw->dev;
config.owner = THIS_MODULE;
config.root_only = true;
config.priv = sw;

return nvmem_register(&config);
Expand Down
3 changes: 2 additions & 1 deletion drivers/w1/masters/omap_hdq.c
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,8 @@ static int omap_hdq_probe(struct platform_device *pdev)

irq = platform_get_irq(pdev, 0);
if (irq < 0) {
ret = -ENXIO;
dev_dbg(&pdev->dev, "Failed to get IRQ: %d\n", irq);
ret = irq;
goto err_irq;
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/w1/w1.c
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,7 @@ int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn)
memcpy(&sl->reg_num, rn, sizeof(sl->reg_num));
atomic_set(&sl->refcnt, 1);
atomic_inc(&sl->master->refcnt);
dev->slave_count++;

/* slave modules need to be loaded in a context with unlocked mutex */
mutex_unlock(&dev->mutex);
Expand All @@ -747,19 +748,18 @@ int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn)

sl->family = f;


err = __w1_attach_slave_device(sl);
if (err < 0) {
dev_err(&dev->dev, "%s: Attaching %s failed.\n", __func__,
sl->name);
dev->slave_count--;
w1_family_put(sl->family);
atomic_dec(&sl->master->refcnt);
kfree(sl);
return err;
}

sl->ttl = dev->slave_ttl;
dev->slave_count++;

memcpy(msg.id.id, rn, sizeof(msg.id));
msg.type = W1_SLAVE_ADD;
Expand Down

0 comments on commit dedaff2

Please sign in to comment.