Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'char-misc-4.16-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc driver fixes from Greg KH:
"Here are a handful of char/misc driver fixes for 4.16-rc3.

There are some binder driver fixes to resolve reported issues in
stress testing the recent binder changes, some extcon driver fixes,
and a few mei driver fixes and new device ids.

All of these, with the exception of the mei driver id additions, have
been in linux-next for a while. I forgot to push out the mei driver id
additions to kernel.org until today, but all build tests pass with
them enabled"

* tag 'char-misc-4.16-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
mei: me: add cannon point device ids for 4th device
mei: me: add cannon point device ids
mei: set device client to the disconnected state upon suspend.
ANDROID: binder: synchronize_rcu() when using POLLFREE.
binder: replace "%p" with "%pK"
ANDROID: binder: remove WARN() for redundant txn error
binder: check for binder_thread allocation failure in binder_poll()
extcon: int3496: process id-pin first so that we start with the right status
Revert "extcon: axp288: Redo charger type detection a couple of seconds after probe()"
extcon: axp288: Constify the axp288_pwr_up_down_info array

+45 -45
+23 -6
drivers/android/binder.c
··· 1991 1991 &target_thread->reply_error.work); 1992 1992 wake_up_interruptible(&target_thread->wait); 1993 1993 } else { 1994 - WARN(1, "Unexpected reply error: %u\n", 1995 - target_thread->reply_error.cmd); 1994 + /* 1995 + * Cannot get here for normal operation, but 1996 + * we can if multiple synchronous transactions 1997 + * are sent without blocking for responses. 1998 + * Just ignore the 2nd error in this case. 1999 + */ 2000 + pr_warn("Unexpected reply error: %u\n", 2001 + target_thread->reply_error.cmd); 1996 2002 } 1997 2003 binder_inner_proc_unlock(target_thread->proc); 1998 2004 binder_thread_dec_tmpref(target_thread); ··· 2199 2193 int debug_id = buffer->debug_id; 2200 2194 2201 2195 binder_debug(BINDER_DEBUG_TRANSACTION, 2202 - "%d buffer release %d, size %zd-%zd, failed at %p\n", 2196 + "%d buffer release %d, size %zd-%zd, failed at %pK\n", 2203 2197 proc->pid, buffer->debug_id, 2204 2198 buffer->data_size, buffer->offsets_size, failed_at); 2205 2199 ··· 3711 3705 } 3712 3706 } 3713 3707 binder_debug(BINDER_DEBUG_DEAD_BINDER, 3714 - "%d:%d BC_DEAD_BINDER_DONE %016llx found %p\n", 3708 + "%d:%d BC_DEAD_BINDER_DONE %016llx found %pK\n", 3715 3709 proc->pid, thread->pid, (u64)cookie, 3716 3710 death); 3717 3711 if (death == NULL) { ··· 4382 4376 4383 4377 binder_inner_proc_unlock(thread->proc); 4384 4378 4379 + /* 4380 + * This is needed to avoid races between wake_up_poll() above and 4381 + * and ep_remove_waitqueue() called for other reasons (eg the epoll file 4382 + * descriptor being closed); ep_remove_waitqueue() holds an RCU read 4383 + * lock, so we can be sure it's done after calling synchronize_rcu(). 4384 + */ 4385 + if (thread->looper & BINDER_LOOPER_STATE_POLL) 4386 + synchronize_rcu(); 4387 + 4385 4388 if (send_reply) 4386 4389 binder_send_failed_reply(send_reply, BR_DEAD_REPLY); 4387 4390 binder_release_work(proc, &thread->todo); ··· 4406 4391 bool wait_for_proc_work; 4407 4392 4408 4393 thread = binder_get_thread(proc); 4394 + if (!thread) 4395 + return POLLERR; 4409 4396 4410 4397 binder_inner_proc_lock(thread->proc); 4411 4398 thread->looper |= BINDER_LOOPER_STATE_POLL; ··· 5051 5034 spin_lock(&t->lock); 5052 5035 to_proc = t->to_proc; 5053 5036 seq_printf(m, 5054 - "%s %d: %p from %d:%d to %d:%d code %x flags %x pri %ld r%d", 5037 + "%s %d: %pK from %d:%d to %d:%d code %x flags %x pri %ld r%d", 5055 5038 prefix, t->debug_id, t, 5056 5039 t->from ? t->from->proc->pid : 0, 5057 5040 t->from ? t->from->pid : 0, ··· 5075 5058 } 5076 5059 if (buffer->target_node) 5077 5060 seq_printf(m, " node %d", buffer->target_node->debug_id); 5078 - seq_printf(m, " size %zd:%zd data %p\n", 5061 + seq_printf(m, " size %zd:%zd data %pK\n", 5079 5062 buffer->data_size, buffer->offsets_size, 5080 5063 buffer->data); 5081 5064 }
+4 -32
drivers/extcon/extcon-axp288.c
··· 1 1 /* 2 2 * extcon-axp288.c - X-Power AXP288 PMIC extcon cable detection driver 3 3 * 4 - * Copyright (C) 2016-2017 Hans de Goede <hdegoede@redhat.com> 5 4 * Copyright (C) 2015 Intel Corporation 6 5 * Author: Ramakrishna Pallala <ramakrishna.pallala@intel.com> 7 6 * ··· 97 98 struct device *dev; 98 99 struct regmap *regmap; 99 100 struct regmap_irq_chip_data *regmap_irqc; 100 - struct delayed_work det_work; 101 101 int irq[EXTCON_IRQ_END]; 102 102 struct extcon_dev *edev; 103 103 unsigned int previous_cable; 104 - bool first_detect_done; 105 104 }; 106 105 107 106 /* Power up/down reason string array */ 108 - static char *axp288_pwr_up_down_info[] = { 107 + static const char * const axp288_pwr_up_down_info[] = { 109 108 "Last wake caused by user pressing the power button", 110 109 "Last wake caused by a charger insertion", 111 110 "Last wake caused by a battery insertion", ··· 121 124 */ 122 125 static void axp288_extcon_log_rsi(struct axp288_extcon_info *info) 123 126 { 124 - char **rsi; 127 + const char * const *rsi; 125 128 unsigned int val, i, clear_mask = 0; 126 129 int ret; 127 130 ··· 135 138 136 139 /* Clear the register value for next reboot (write 1 to clear bit) */ 137 140 regmap_write(info->regmap, AXP288_PS_BOOT_REASON_REG, clear_mask); 138 - } 139 - 140 - static void axp288_chrg_detect_complete(struct axp288_extcon_info *info) 141 - { 142 - /* 143 - * We depend on other drivers to do things like mux the data lines, 144 - * enable/disable vbus based on the id-pin, etc. Sometimes the BIOS has 145 - * not set these things up correctly resulting in the initial charger 146 - * cable type detection giving a wrong result and we end up not charging 147 - * or charging at only 0.5A. 148 - * 149 - * So we schedule a second cable type detection after 2 seconds to 150 - * give the other drivers time to load and do their thing. 151 - */ 152 - if (!info->first_detect_done) { 153 - queue_delayed_work(system_wq, &info->det_work, 154 - msecs_to_jiffies(2000)); 155 - info->first_detect_done = true; 156 - } 157 141 } 158 142 159 143 static int axp288_handle_chrg_det_event(struct axp288_extcon_info *info) ··· 201 223 info->previous_cable = cable; 202 224 } 203 225 204 - axp288_chrg_detect_complete(info); 205 - 206 226 return 0; 207 227 208 228 dev_det_ret: ··· 222 246 return IRQ_HANDLED; 223 247 } 224 248 225 - static void axp288_extcon_det_work(struct work_struct *work) 249 + static void axp288_extcon_enable(struct axp288_extcon_info *info) 226 250 { 227 - struct axp288_extcon_info *info = 228 - container_of(work, struct axp288_extcon_info, det_work.work); 229 - 230 251 regmap_update_bits(info->regmap, AXP288_BC_GLOBAL_REG, 231 252 BC_GLOBAL_RUN, 0); 232 253 /* Enable the charger detection logic */ ··· 245 272 info->regmap = axp20x->regmap; 246 273 info->regmap_irqc = axp20x->regmap_irqc; 247 274 info->previous_cable = EXTCON_NONE; 248 - INIT_DELAYED_WORK(&info->det_work, axp288_extcon_det_work); 249 275 250 276 platform_set_drvdata(pdev, info); 251 277 ··· 290 318 } 291 319 292 320 /* Start charger cable type detection */ 293 - queue_delayed_work(system_wq, &info->det_work, 0); 321 + axp288_extcon_enable(info); 294 322 295 323 return 0; 296 324 }
+2 -1
drivers/extcon/extcon-intel-int3496.c
··· 153 153 return ret; 154 154 } 155 155 156 - /* queue initial processing of id-pin */ 156 + /* process id-pin so that we start with the right status */ 157 157 queue_delayed_work(system_wq, &data->work, 0); 158 + flush_delayed_work(&data->work); 158 159 159 160 platform_set_drvdata(pdev, data); 160 161
-6
drivers/misc/mei/bus.c
··· 548 548 goto out; 549 549 } 550 550 551 - if (bus->dev_state == MEI_DEV_POWER_DOWN) { 552 - dev_dbg(bus->dev, "Device is powering down, don't bother with disconnection\n"); 553 - err = 0; 554 - goto out; 555 - } 556 - 557 551 err = mei_cl_disconnect(cl); 558 552 if (err < 0) 559 553 dev_err(bus->dev, "Could not disconnect from the ME client\n");
+6
drivers/misc/mei/client.c
··· 945 945 return 0; 946 946 } 947 947 948 + if (dev->dev_state == MEI_DEV_POWER_DOWN) { 949 + cl_dbg(dev, cl, "Device is powering down, don't bother with disconnection\n"); 950 + mei_cl_set_disconnected(cl); 951 + return 0; 952 + } 953 + 948 954 rets = pm_runtime_get(dev->dev); 949 955 if (rets < 0 && rets != -EINPROGRESS) { 950 956 pm_runtime_put_noidle(dev->dev);
+5
drivers/misc/mei/hw-me-regs.h
··· 132 132 #define MEI_DEV_ID_KBP 0xA2BA /* Kaby Point */ 133 133 #define MEI_DEV_ID_KBP_2 0xA2BB /* Kaby Point 2 */ 134 134 135 + #define MEI_DEV_ID_CNP_LP 0x9DE0 /* Cannon Point LP */ 136 + #define MEI_DEV_ID_CNP_LP_4 0x9DE4 /* Cannon Point LP 4 (iTouch) */ 137 + #define MEI_DEV_ID_CNP_H 0xA360 /* Cannon Point H */ 138 + #define MEI_DEV_ID_CNP_H_4 0xA364 /* Cannon Point H 4 (iTouch) */ 139 + 135 140 /* 136 141 * MEI HW Section 137 142 */
+5
drivers/misc/mei/pci-me.c
··· 98 98 {MEI_PCI_DEVICE(MEI_DEV_ID_KBP, MEI_ME_PCH8_CFG)}, 99 99 {MEI_PCI_DEVICE(MEI_DEV_ID_KBP_2, MEI_ME_PCH8_CFG)}, 100 100 101 + {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_LP, MEI_ME_PCH8_CFG)}, 102 + {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_LP_4, MEI_ME_PCH8_CFG)}, 103 + {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_H, MEI_ME_PCH8_CFG)}, 104 + {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_H_4, MEI_ME_PCH8_CFG)}, 105 + 101 106 /* required last entry */ 102 107 {0, } 103 108 };