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

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

+783 -578
+7 -3
Documentation/devicetree/bindings/input/gpio-keys.txt
··· 10 10 Each button (key) is represented as a sub-node of "gpio-keys": 11 11 Subnode properties: 12 12 13 + - gpios: OF device-tree gpio specification. 14 + - interrupts: the interrupt line for that input. 13 15 - label: Descriptive name of the key. 14 16 - linux,code: Keycode to emit. 15 17 16 - Required mutual exclusive subnode-properties: 17 - - gpios: OF device-tree gpio specification. 18 - - interrupts: the interrupt line for that input 18 + Note that either "interrupts" or "gpios" properties can be omitted, but not 19 + both at the same time. Specifying both properties is allowed. 19 20 20 21 Optional subnode-properties: 21 22 - linux,input-type: Specify event type this button/key generates. ··· 24 23 - debounce-interval: Debouncing interval time in milliseconds. 25 24 If not specified defaults to 5. 26 25 - gpio-key,wakeup: Boolean, button can wake-up the system. 26 + - linux,can-disable: Boolean, indicates that button is connected 27 + to dedicated (not shared) interrupt which can be disabled to 28 + suppress events from the button. 27 29 28 30 Example nodes: 29 31
+2
Documentation/devicetree/bindings/input/stmpe-keypad.txt
··· 8 8 - debounce-interval : Debouncing interval time in milliseconds 9 9 - st,scan-count : Scanning cycles elapsed before key data is updated 10 10 - st,no-autorepeat : If specified device will not autorepeat 11 + - keypad,num-rows : See ./matrix-keymap.txt 12 + - keypad,num-columns : See ./matrix-keymap.txt 11 13 12 14 Example: 13 15
+1 -1
Makefile
··· 1 1 VERSION = 3 2 2 PATCHLEVEL = 19 3 3 SUBLEVEL = 0 4 - EXTRAVERSION = -rc2 4 + EXTRAVERSION = -rc3 5 5 NAME = Diseased Newt 6 6 7 7 # *DOCUMENTATION*
-24
arch/arm/boot/dts/armada-370-db.dts
··· 203 203 compatible = "linux,spdif-dir"; 204 204 }; 205 205 }; 206 - 207 - &pinctrl { 208 - /* 209 - * These pins might be muxed as I2S by 210 - * the bootloader, but it conflicts 211 - * with the real I2S pins that are 212 - * muxed using i2s_pins. We must mux 213 - * those pins to a function other than 214 - * I2S. 215 - */ 216 - pinctrl-0 = <&hog_pins1 &hog_pins2>; 217 - pinctrl-names = "default"; 218 - 219 - hog_pins1: hog-pins1 { 220 - marvell,pins = "mpp6", "mpp8", "mpp10", 221 - "mpp12", "mpp13"; 222 - marvell,function = "gpio"; 223 - }; 224 - 225 - hog_pins2: hog-pins2 { 226 - marvell,pins = "mpp5", "mpp7", "mpp9"; 227 - marvell,function = "gpo"; 228 - }; 229 - };
+1
arch/arm/configs/multi_v7_defconfig
··· 338 338 CONFIG_USB_XHCI_HCD=y 339 339 CONFIG_USB_XHCI_MVEBU=y 340 340 CONFIG_USB_EHCI_HCD=y 341 + CONFIG_USB_EHCI_EXYNOS=y 341 342 CONFIG_USB_EHCI_TEGRA=y 342 343 CONFIG_USB_EHCI_HCD_STI=y 343 344 CONFIG_USB_EHCI_HCD_PLATFORM=y
+9
arch/arm/kernel/setup.c
··· 1046 1046 seq_printf(m, "model name\t: %s rev %d (%s)\n", 1047 1047 cpu_name, cpuid & 15, elf_platform); 1048 1048 1049 + #if defined(CONFIG_SMP) 1050 + seq_printf(m, "BogoMIPS\t: %lu.%02lu\n", 1051 + per_cpu(cpu_data, i).loops_per_jiffy / (500000UL/HZ), 1052 + (per_cpu(cpu_data, i).loops_per_jiffy / (5000UL/HZ)) % 100); 1053 + #else 1054 + seq_printf(m, "BogoMIPS\t: %lu.%02lu\n", 1055 + loops_per_jiffy / (500000/HZ), 1056 + (loops_per_jiffy / (5000/HZ)) % 100); 1057 + #endif 1049 1058 /* dump out the processor features */ 1050 1059 seq_puts(m, "Features\t: "); 1051 1060
+12
arch/arm/kernel/smp.c
··· 387 387 388 388 void __init smp_cpus_done(unsigned int max_cpus) 389 389 { 390 + int cpu; 391 + unsigned long bogosum = 0; 392 + 393 + for_each_online_cpu(cpu) 394 + bogosum += per_cpu(cpu_data, cpu).loops_per_jiffy; 395 + 396 + printk(KERN_INFO "SMP: Total of %d processors activated " 397 + "(%lu.%02lu BogoMIPS).\n", 398 + num_online_cpus(), 399 + bogosum / (500000/HZ), 400 + (bogosum / (5000/HZ)) % 100); 401 + 390 402 hyp_mode_check(); 391 403 } 392 404
+1 -1
arch/ia64/include/asm/unistd.h
··· 11 11 12 12 13 13 14 - #define NR_syscalls 318 /* length of syscall table */ 14 + #define NR_syscalls 319 /* length of syscall table */ 15 15 16 16 /* 17 17 * The following defines stop scripts/checksyscalls.sh from complaining about
+1
arch/ia64/include/uapi/asm/unistd.h
··· 331 331 #define __NR_getrandom 1339 332 332 #define __NR_memfd_create 1340 333 333 #define __NR_bpf 1341 334 + #define __NR_execveat 1342 334 335 335 336 #endif /* _UAPI_ASM_IA64_UNISTD_H */
+1
arch/ia64/kernel/entry.S
··· 1779 1779 data8 sys_getrandom 1780 1780 data8 sys_memfd_create // 1340 1781 1781 data8 sys_bpf 1782 + data8 sys_execveat 1782 1783 1783 1784 .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls 1784 1785 #endif /* __IA64_ASM_PARAVIRTUALIZED_NATIVE */
+1
arch/nios2/kernel/cpuinfo.c
··· 72 72 cpuinfo.has_div = fcpu_has(cpu, "altr,has-div"); 73 73 cpuinfo.has_mul = fcpu_has(cpu, "altr,has-mul"); 74 74 cpuinfo.has_mulx = fcpu_has(cpu, "altr,has-mulx"); 75 + cpuinfo.mmu = fcpu_has(cpu, "altr,has-mmu"); 75 76 76 77 if (IS_ENABLED(CONFIG_NIOS2_HW_DIV_SUPPORT) && !cpuinfo.has_div) 77 78 err_cpu("DIV");
+2 -18
arch/nios2/kernel/entry.S
··· 365 365 GET_THREAD_INFO r1 366 366 ldw r4, TI_PREEMPT_COUNT(r1) 367 367 bne r4, r0, restore_all 368 - 369 - need_resched: 370 368 ldw r4, TI_FLAGS(r1) /* ? Need resched set */ 371 369 BTBZ r10, r4, TIF_NEED_RESCHED, restore_all 372 370 ldw r4, PT_ESTATUS(sp) /* ? Interrupts off */ 373 371 andi r10, r4, ESTATUS_EPIE 374 372 beq r10, r0, restore_all 375 - movia r4, PREEMPT_ACTIVE 376 - stw r4, TI_PREEMPT_COUNT(r1) 377 - rdctl r10, status /* enable intrs again */ 378 - ori r10, r10 ,STATUS_PIE 379 - wrctl status, r10 380 - PUSH r1 381 - call schedule 382 - POP r1 383 - mov r4, r0 384 - stw r4, TI_PREEMPT_COUNT(r1) 385 - rdctl r10, status /* disable intrs */ 386 - andi r10, r10, %lo(~STATUS_PIE) 387 - wrctl status, r10 388 - br need_resched 389 - #else 390 - br restore_all 373 + call preempt_schedule_irq 391 374 #endif 375 + br restore_all 392 376 393 377 /*********************************************************************** 394 378 * A few syscall wrappers
+10
arch/powerpc/include/asm/kexec.h
··· 86 86 extern void reserve_crashkernel(void); 87 87 extern void machine_kexec_mask_interrupts(void); 88 88 89 + static inline bool kdump_in_progress(void) 90 + { 91 + return crashing_cpu >= 0; 92 + } 93 + 89 94 #else /* !CONFIG_KEXEC */ 90 95 static inline void crash_kexec_secondary(struct pt_regs *regs) { } 91 96 ··· 109 104 static inline int crash_shutdown_unregister(crash_shutdown_t handler) 110 105 { 111 106 return 0; 107 + } 108 + 109 + static inline bool kdump_in_progress(void) 110 + { 111 + return false; 112 112 } 113 113 114 114 #endif /* CONFIG_KEXEC */
+1
arch/powerpc/include/asm/systbl.h
··· 366 366 SYSCALL_SPU(getrandom) 367 367 SYSCALL_SPU(memfd_create) 368 368 SYSCALL_SPU(bpf) 369 + COMPAT_SYS(execveat)
+1 -1
arch/powerpc/include/asm/unistd.h
··· 12 12 #include <uapi/asm/unistd.h> 13 13 14 14 15 - #define __NR_syscalls 362 15 + #define __NR_syscalls 363 16 16 17 17 #define __NR__exit __NR_exit 18 18 #define NR_syscalls __NR_syscalls
+1
arch/powerpc/include/uapi/asm/unistd.h
··· 384 384 #define __NR_getrandom 359 385 385 #define __NR_memfd_create 360 386 386 #define __NR_bpf 361 387 + #define __NR_execveat 362 387 388 388 389 #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */
+1 -1
arch/powerpc/kernel/machine_kexec_64.c
··· 330 330 * using debugger IPI. 331 331 */ 332 332 333 - if (crashing_cpu == -1) 333 + if (!kdump_in_progress()) 334 334 kexec_prepare_cpus(); 335 335 336 336 pr_debug("kexec: Starting switchover sequence.\n");
+1 -8
arch/powerpc/kernel/smp.c
··· 700 700 smp_store_cpu_info(cpu); 701 701 set_dec(tb_ticks_per_jiffy); 702 702 preempt_disable(); 703 + cpu_callin_map[cpu] = 1; 703 704 704 705 if (smp_ops->setup_cpu) 705 706 smp_ops->setup_cpu(cpu); ··· 738 737 smp_wmb(); 739 738 notify_cpu_starting(cpu); 740 739 set_cpu_online(cpu, true); 741 - 742 - /* 743 - * CPU must be marked active and online before we signal back to the 744 - * master, because the scheduler needs to see the cpu_online and 745 - * cpu_active bits set. 746 - */ 747 - smp_wmb(); 748 - cpu_callin_map[cpu] = 1; 749 740 750 741 local_irq_enable(); 751 742
+7 -1
arch/powerpc/platforms/pseries/lpar.c
··· 43 43 #include <asm/trace.h> 44 44 #include <asm/firmware.h> 45 45 #include <asm/plpar_wrappers.h> 46 + #include <asm/kexec.h> 46 47 #include <asm/fadump.h> 47 48 48 49 #include "pseries.h" ··· 268 267 * out to the user, but at least this will stop us from 269 268 * continuing on further and creating an even more 270 269 * difficult to debug situation. 270 + * 271 + * There is a known problem when kdump'ing, if cpus are offline 272 + * the above call will fail. Rather than panicking again, keep 273 + * going and hope the kdump kernel is also little endian, which 274 + * it usually is. 271 275 */ 272 - if (rc) 276 + if (rc && !kdump_in_progress()) 273 277 panic("Could not enable big endian exceptions"); 274 278 } 275 279 #endif
+1
arch/um/Kconfig.common
··· 3 3 default y 4 4 select HAVE_ARCH_AUDITSYSCALL 5 5 select HAVE_UID16 6 + select HAVE_FUTEX_CMPXCHG if FUTEX 6 7 select GENERIC_IRQ_SHOW 7 8 select GENERIC_CPU_DEVICES 8 9 select GENERIC_IO
+1 -1
arch/x86/um/sys_call_table_32.c
··· 34 34 35 35 extern asmlinkage void sys_ni_syscall(void); 36 36 37 - const sys_call_ptr_t sys_call_table[] __cacheline_aligned = { 37 + const sys_call_ptr_t sys_call_table[] ____cacheline_aligned = { 38 38 /* 39 39 * Smells like a compiler bug -- it doesn't work 40 40 * when the & below is removed.
+1 -1
arch/x86/um/sys_call_table_64.c
··· 47 47 48 48 extern void sys_ni_syscall(void); 49 49 50 - const sys_call_ptr_t sys_call_table[] __cacheline_aligned = { 50 + const sys_call_ptr_t sys_call_table[] ____cacheline_aligned = { 51 51 /* 52 52 * Smells like a compiler bug -- it doesn't work 53 53 * when the & below is removed.
+3
crypto/af_alg.c
··· 455 455 { 456 456 struct af_alg_completion *completion = req->data; 457 457 458 + if (err == -EINPROGRESS) 459 + return; 460 + 458 461 completion->err = err; 459 462 complete(&completion->completion); 460 463 }
+2 -1
drivers/char/ipmi/ipmi_ssif.c
··· 969 969 970 970 do_gettimeofday(&t); 971 971 pr_info("**Enqueue %02x %02x: %ld.%6.6ld\n", 972 - msg->data[0], msg->data[1], t.tv_sec, t.tv_usec); 972 + msg->data[0], msg->data[1], 973 + (long) t.tv_sec, (long) t.tv_usec); 973 974 } 974 975 } 975 976
+1 -1
drivers/clocksource/arm_arch_timer.c
··· 463 463 464 464 /* Register the CP15 based counter if we have one */ 465 465 if (type & ARCH_CP15_TIMER) { 466 - if (arch_timer_use_virtual) 466 + if (IS_ENABLED(CONFIG_ARM64) || arch_timer_use_virtual) 467 467 arch_timer_read_counter = arch_counter_get_cntvct; 468 468 else 469 469 arch_timer_read_counter = arch_counter_get_cntpct;
+44 -16
drivers/input/evdev.c
··· 28 28 #include <linux/cdev.h> 29 29 #include "input-compat.h" 30 30 31 + enum evdev_clock_type { 32 + EV_CLK_REAL = 0, 33 + EV_CLK_MONO, 34 + EV_CLK_BOOT, 35 + EV_CLK_MAX 36 + }; 37 + 31 38 struct evdev { 32 39 int open; 33 40 struct input_handle handle; ··· 56 49 struct fasync_struct *fasync; 57 50 struct evdev *evdev; 58 51 struct list_head node; 59 - int clkid; 52 + int clk_type; 60 53 bool revoked; 61 54 unsigned int bufsize; 62 55 struct input_event buffer[]; 63 56 }; 57 + 58 + static int evdev_set_clk_type(struct evdev_client *client, unsigned int clkid) 59 + { 60 + switch (clkid) { 61 + 62 + case CLOCK_REALTIME: 63 + client->clk_type = EV_CLK_REAL; 64 + break; 65 + case CLOCK_MONOTONIC: 66 + client->clk_type = EV_CLK_MONO; 67 + break; 68 + case CLOCK_BOOTTIME: 69 + client->clk_type = EV_CLK_BOOT; 70 + break; 71 + default: 72 + return -EINVAL; 73 + } 74 + 75 + return 0; 76 + } 64 77 65 78 /* flush queued events of type @type, caller must hold client->buffer_lock */ 66 79 static void __evdev_flush_queue(struct evdev_client *client, unsigned int type) ··· 135 108 struct input_event ev; 136 109 ktime_t time; 137 110 138 - time = (client->clkid == CLOCK_MONOTONIC) ? 139 - ktime_get() : ktime_get_real(); 111 + time = client->clk_type == EV_CLK_REAL ? 112 + ktime_get_real() : 113 + client->clk_type == EV_CLK_MONO ? 114 + ktime_get() : 115 + ktime_get_boottime(); 140 116 141 117 ev.time = ktime_to_timeval(time); 142 118 ev.type = EV_SYN; ··· 189 159 190 160 static void evdev_pass_values(struct evdev_client *client, 191 161 const struct input_value *vals, unsigned int count, 192 - ktime_t mono, ktime_t real) 162 + ktime_t *ev_time) 193 163 { 194 164 struct evdev *evdev = client->evdev; 195 165 const struct input_value *v; ··· 199 169 if (client->revoked) 200 170 return; 201 171 202 - event.time = ktime_to_timeval(client->clkid == CLOCK_MONOTONIC ? 203 - mono : real); 172 + event.time = ktime_to_timeval(ev_time[client->clk_type]); 204 173 205 174 /* Interrupts are disabled, just acquire the lock. */ 206 175 spin_lock(&client->buffer_lock); ··· 227 198 { 228 199 struct evdev *evdev = handle->private; 229 200 struct evdev_client *client; 230 - ktime_t time_mono, time_real; 201 + ktime_t ev_time[EV_CLK_MAX]; 231 202 232 - time_mono = ktime_get(); 233 - time_real = ktime_mono_to_real(time_mono); 203 + ev_time[EV_CLK_MONO] = ktime_get(); 204 + ev_time[EV_CLK_REAL] = ktime_mono_to_real(ev_time[EV_CLK_MONO]); 205 + ev_time[EV_CLK_BOOT] = ktime_mono_to_any(ev_time[EV_CLK_MONO], 206 + TK_OFFS_BOOT); 234 207 235 208 rcu_read_lock(); 236 209 237 210 client = rcu_dereference(evdev->grab); 238 211 239 212 if (client) 240 - evdev_pass_values(client, vals, count, time_mono, time_real); 213 + evdev_pass_values(client, vals, count, ev_time); 241 214 else 242 215 list_for_each_entry_rcu(client, &evdev->client_list, node) 243 - evdev_pass_values(client, vals, count, 244 - time_mono, time_real); 216 + evdev_pass_values(client, vals, count, ev_time); 245 217 246 218 rcu_read_unlock(); 247 219 } ··· 907 877 case EVIOCSCLOCKID: 908 878 if (copy_from_user(&i, p, sizeof(unsigned int))) 909 879 return -EFAULT; 910 - if (i != CLOCK_MONOTONIC && i != CLOCK_REALTIME) 911 - return -EINVAL; 912 - client->clkid = i; 913 - return 0; 880 + 881 + return evdev_set_clk_type(client, i); 914 882 915 883 case EVIOCGKEYCODE: 916 884 return evdev_handle_get_keycode(dev, p);
+13 -9
drivers/input/input.c
··· 1974 1974 1975 1975 events = mt_slots + 1; /* count SYN_MT_REPORT and SYN_REPORT */ 1976 1976 1977 - for (i = 0; i < ABS_CNT; i++) { 1978 - if (test_bit(i, dev->absbit)) { 1979 - if (input_is_mt_axis(i)) 1980 - events += mt_slots; 1981 - else 1982 - events++; 1977 + if (test_bit(EV_ABS, dev->evbit)) { 1978 + for (i = 0; i < ABS_CNT; i++) { 1979 + if (test_bit(i, dev->absbit)) { 1980 + if (input_is_mt_axis(i)) 1981 + events += mt_slots; 1982 + else 1983 + events++; 1984 + } 1983 1985 } 1984 1986 } 1985 1987 1986 - for (i = 0; i < REL_CNT; i++) 1987 - if (test_bit(i, dev->relbit)) 1988 - events++; 1988 + if (test_bit(EV_REL, dev->evbit)) { 1989 + for (i = 0; i < REL_CNT; i++) 1990 + if (test_bit(i, dev->relbit)) 1991 + events++; 1992 + } 1989 1993 1990 1994 /* Make room for KEY and MSC events */ 1991 1995 events += 7;
+1
drivers/input/keyboard/Kconfig
··· 559 559 config KEYBOARD_STMPE 560 560 tristate "STMPE keypad support" 561 561 depends on MFD_STMPE 562 + depends on OF 562 563 select INPUT_MATRIXKMAP 563 564 help 564 565 Say Y here if you want to use the keypad controller on STMPE I/O
+57 -57
drivers/input/keyboard/gpio_keys.c
··· 35 35 struct gpio_button_data { 36 36 const struct gpio_keys_button *button; 37 37 struct input_dev *input; 38 - struct timer_list timer; 39 - struct work_struct work; 40 - unsigned int timer_debounce; /* in msecs */ 38 + 39 + struct timer_list release_timer; 40 + unsigned int release_delay; /* in msecs, for IRQ-only buttons */ 41 + 42 + struct delayed_work work; 43 + unsigned int software_debounce; /* in msecs, for GPIO-driven buttons */ 44 + 41 45 unsigned int irq; 42 46 spinlock_t lock; 43 47 bool disabled; ··· 120 116 { 121 117 if (!bdata->disabled) { 122 118 /* 123 - * Disable IRQ and possible debouncing timer. 119 + * Disable IRQ and associated timer/work structure. 124 120 */ 125 121 disable_irq(bdata->irq); 126 - if (bdata->timer_debounce) 127 - del_timer_sync(&bdata->timer); 122 + 123 + if (gpio_is_valid(bdata->button->gpio)) 124 + cancel_delayed_work_sync(&bdata->work); 125 + else 126 + del_timer_sync(&bdata->release_timer); 128 127 129 128 bdata->disabled = true; 130 129 } ··· 350 343 static void gpio_keys_gpio_work_func(struct work_struct *work) 351 344 { 352 345 struct gpio_button_data *bdata = 353 - container_of(work, struct gpio_button_data, work); 346 + container_of(work, struct gpio_button_data, work.work); 354 347 355 348 gpio_keys_gpio_report_event(bdata); 356 349 357 350 if (bdata->button->wakeup) 358 351 pm_relax(bdata->input->dev.parent); 359 - } 360 - 361 - static void gpio_keys_gpio_timer(unsigned long _data) 362 - { 363 - struct gpio_button_data *bdata = (struct gpio_button_data *)_data; 364 - 365 - schedule_work(&bdata->work); 366 352 } 367 353 368 354 static irqreturn_t gpio_keys_gpio_isr(int irq, void *dev_id) ··· 366 366 367 367 if (bdata->button->wakeup) 368 368 pm_stay_awake(bdata->input->dev.parent); 369 - if (bdata->timer_debounce) 370 - mod_timer(&bdata->timer, 371 - jiffies + msecs_to_jiffies(bdata->timer_debounce)); 372 - else 373 - schedule_work(&bdata->work); 369 + 370 + mod_delayed_work(system_wq, 371 + &bdata->work, 372 + msecs_to_jiffies(bdata->software_debounce)); 374 373 375 374 return IRQ_HANDLED; 376 375 } ··· 407 408 input_event(input, EV_KEY, button->code, 1); 408 409 input_sync(input); 409 410 410 - if (!bdata->timer_debounce) { 411 + if (!bdata->release_delay) { 411 412 input_event(input, EV_KEY, button->code, 0); 412 413 input_sync(input); 413 414 goto out; ··· 416 417 bdata->key_pressed = true; 417 418 } 418 419 419 - if (bdata->timer_debounce) 420 - mod_timer(&bdata->timer, 421 - jiffies + msecs_to_jiffies(bdata->timer_debounce)); 420 + if (bdata->release_delay) 421 + mod_timer(&bdata->release_timer, 422 + jiffies + msecs_to_jiffies(bdata->release_delay)); 422 423 out: 423 424 spin_unlock_irqrestore(&bdata->lock, flags); 424 425 return IRQ_HANDLED; ··· 428 429 { 429 430 struct gpio_button_data *bdata = data; 430 431 431 - if (bdata->timer_debounce) 432 - del_timer_sync(&bdata->timer); 433 - 434 - cancel_work_sync(&bdata->work); 432 + if (gpio_is_valid(bdata->button->gpio)) 433 + cancel_delayed_work_sync(&bdata->work); 434 + else 435 + del_timer_sync(&bdata->release_timer); 435 436 } 436 437 437 438 static int gpio_keys_setup_key(struct platform_device *pdev, ··· 465 466 button->debounce_interval * 1000); 466 467 /* use timer if gpiolib doesn't provide debounce */ 467 468 if (error < 0) 468 - bdata->timer_debounce = 469 + bdata->software_debounce = 469 470 button->debounce_interval; 470 471 } 471 472 472 - irq = gpio_to_irq(button->gpio); 473 - if (irq < 0) { 474 - error = irq; 475 - dev_err(dev, 476 - "Unable to get irq number for GPIO %d, error %d\n", 477 - button->gpio, error); 478 - return error; 473 + if (button->irq) { 474 + bdata->irq = button->irq; 475 + } else { 476 + irq = gpio_to_irq(button->gpio); 477 + if (irq < 0) { 478 + error = irq; 479 + dev_err(dev, 480 + "Unable to get irq number for GPIO %d, error %d\n", 481 + button->gpio, error); 482 + return error; 483 + } 484 + bdata->irq = irq; 479 485 } 480 - bdata->irq = irq; 481 486 482 - INIT_WORK(&bdata->work, gpio_keys_gpio_work_func); 483 - setup_timer(&bdata->timer, 484 - gpio_keys_gpio_timer, (unsigned long)bdata); 487 + INIT_DELAYED_WORK(&bdata->work, gpio_keys_gpio_work_func); 485 488 486 489 isr = gpio_keys_gpio_isr; 487 490 irqflags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING; ··· 500 499 return -EINVAL; 501 500 } 502 501 503 - bdata->timer_debounce = button->debounce_interval; 504 - setup_timer(&bdata->timer, 502 + bdata->release_delay = button->debounce_interval; 503 + setup_timer(&bdata->release_timer, 505 504 gpio_keys_irq_timer, (unsigned long)bdata); 506 505 507 506 isr = gpio_keys_irq_isr; ··· 511 510 input_set_capability(input, button->type ?: EV_KEY, button->code); 512 511 513 512 /* 514 - * Install custom action to cancel debounce timer and 513 + * Install custom action to cancel release timer and 515 514 * workqueue item. 516 515 */ 517 516 error = devm_add_action(&pdev->dev, gpio_keys_quiesce_key, bdata); ··· 619 618 620 619 i = 0; 621 620 for_each_child_of_node(node, pp) { 622 - int gpio = -1; 623 621 enum of_gpio_flags flags; 624 622 625 623 button = &pdata->buttons[i++]; 626 624 627 - if (!of_find_property(pp, "gpios", NULL)) { 628 - button->irq = irq_of_parse_and_map(pp, 0); 629 - if (button->irq == 0) { 630 - i--; 631 - pdata->nbuttons--; 632 - dev_warn(dev, "Found button without gpios or irqs\n"); 633 - continue; 634 - } 635 - } else { 636 - gpio = of_get_gpio_flags(pp, 0, &flags); 637 - if (gpio < 0) { 638 - error = gpio; 625 + button->gpio = of_get_gpio_flags(pp, 0, &flags); 626 + if (button->gpio < 0) { 627 + error = button->gpio; 628 + if (error != -ENOENT) { 639 629 if (error != -EPROBE_DEFER) 640 630 dev_err(dev, 641 631 "Failed to get gpio flags, error: %d\n", 642 632 error); 643 633 return ERR_PTR(error); 644 634 } 635 + } else { 636 + button->active_low = flags & OF_GPIO_ACTIVE_LOW; 645 637 } 646 638 647 - button->gpio = gpio; 648 - button->active_low = flags & OF_GPIO_ACTIVE_LOW; 639 + button->irq = irq_of_parse_and_map(pp, 0); 640 + 641 + if (!gpio_is_valid(button->gpio) && !button->irq) { 642 + dev_err(dev, "Found button without gpios or irqs\n"); 643 + return ERR_PTR(-EINVAL); 644 + } 649 645 650 646 if (of_property_read_u32(pp, "linux,code", &button->code)) { 651 647 dev_err(dev, "Button without keycode: 0x%x\n", ··· 656 658 button->type = EV_KEY; 657 659 658 660 button->wakeup = !!of_get_property(pp, "gpio-key,wakeup", NULL); 661 + 662 + button->can_disable = !!of_get_property(pp, "linux,can-disable", NULL); 659 663 660 664 if (of_property_read_u32(pp, "debounce-interval", 661 665 &button->debounce_interval))
+3 -3
drivers/input/keyboard/hil_kbd.c
··· 473 473 if (error) 474 474 goto bail1; 475 475 476 - init_completion(&dev->cmd_done); 476 + reinit_completion(&dev->cmd_done); 477 477 serio_write(serio, 0); 478 478 serio_write(serio, 0); 479 479 serio_write(serio, HIL_PKT_CMD >> 8); ··· 482 482 if (error) 483 483 goto bail1; 484 484 485 - init_completion(&dev->cmd_done); 485 + reinit_completion(&dev->cmd_done); 486 486 serio_write(serio, 0); 487 487 serio_write(serio, 0); 488 488 serio_write(serio, HIL_PKT_CMD >> 8); ··· 491 491 if (error) 492 492 goto bail1; 493 493 494 - init_completion(&dev->cmd_done); 494 + reinit_completion(&dev->cmd_done); 495 495 serio_write(serio, 0); 496 496 serio_write(serio, 0); 497 497 serio_write(serio, HIL_PKT_CMD >> 8);
+80 -61
drivers/input/keyboard/stmpe-keypad.c
··· 45 45 #define STMPE_KEYPAD_MAX_ROWS 8 46 46 #define STMPE_KEYPAD_MAX_COLS 8 47 47 #define STMPE_KEYPAD_ROW_SHIFT 3 48 - #define STMPE_KEYPAD_KEYMAP_SIZE \ 48 + #define STMPE_KEYPAD_KEYMAP_MAX_SIZE \ 49 49 (STMPE_KEYPAD_MAX_ROWS * STMPE_KEYPAD_MAX_COLS) 50 50 51 51 /** 52 52 * struct stmpe_keypad_variant - model-specific attributes 53 53 * @auto_increment: whether the KPC_DATA_BYTE register address 54 54 * auto-increments on multiple read 55 + * @set_pullup: whether the pins need to have their pull-ups set 55 56 * @num_data: number of data bytes 56 57 * @num_normal_data: number of normal keys' data bytes 57 58 * @max_cols: maximum number of columns supported ··· 62 61 */ 63 62 struct stmpe_keypad_variant { 64 63 bool auto_increment; 64 + bool set_pullup; 65 65 int num_data; 66 66 int num_normal_data; 67 67 int max_cols; ··· 83 81 }, 84 82 [STMPE2401] = { 85 83 .auto_increment = false, 84 + .set_pullup = true, 86 85 .num_data = 3, 87 86 .num_normal_data = 2, 88 87 .max_cols = 8, ··· 93 90 }, 94 91 [STMPE2403] = { 95 92 .auto_increment = true, 93 + .set_pullup = true, 96 94 .num_data = 5, 97 95 .num_normal_data = 3, 98 96 .max_cols = 8, ··· 103 99 }, 104 100 }; 105 101 102 + /** 103 + * struct stmpe_keypad - STMPE keypad state container 104 + * @stmpe: pointer to parent STMPE device 105 + * @input: spawned input device 106 + * @variant: STMPE variant 107 + * @debounce_ms: debounce interval, in ms. Maximum is 108 + * %STMPE_KEYPAD_MAX_DEBOUNCE. 109 + * @scan_count: number of key scanning cycles to confirm key data. 110 + * Maximum is %STMPE_KEYPAD_MAX_SCAN_COUNT. 111 + * @no_autorepeat: disable key autorepeat 112 + * @rows: bitmask for the rows 113 + * @cols: bitmask for the columns 114 + * @keymap: the keymap 115 + */ 106 116 struct stmpe_keypad { 107 117 struct stmpe *stmpe; 108 118 struct input_dev *input; 109 119 const struct stmpe_keypad_variant *variant; 110 - const struct stmpe_keypad_platform_data *plat; 111 - 120 + unsigned int debounce_ms; 121 + unsigned int scan_count; 122 + bool no_autorepeat; 112 123 unsigned int rows; 113 124 unsigned int cols; 114 - 115 - unsigned short keymap[STMPE_KEYPAD_KEYMAP_SIZE]; 125 + unsigned short keymap[STMPE_KEYPAD_KEYMAP_MAX_SIZE]; 116 126 }; 117 127 118 128 static int stmpe_keypad_read_data(struct stmpe_keypad *keypad, u8 *data) ··· 189 171 unsigned int col_gpios = variant->col_gpios; 190 172 unsigned int row_gpios = variant->row_gpios; 191 173 struct stmpe *stmpe = keypad->stmpe; 174 + u8 pureg = stmpe->regs[STMPE_IDX_GPPUR_LSB]; 192 175 unsigned int pins = 0; 176 + unsigned int pu_pins = 0; 177 + int ret; 193 178 int i; 194 179 195 180 /* ··· 209 188 for (i = 0; i < variant->max_cols; i++) { 210 189 int num = __ffs(col_gpios); 211 190 212 - if (keypad->cols & (1 << i)) 191 + if (keypad->cols & (1 << i)) { 213 192 pins |= 1 << num; 193 + pu_pins |= 1 << num; 194 + } 214 195 215 196 col_gpios &= ~(1 << num); 216 197 } ··· 226 203 row_gpios &= ~(1 << num); 227 204 } 228 205 229 - return stmpe_set_altfunc(stmpe, pins, STMPE_BLOCK_KEYPAD); 206 + ret = stmpe_set_altfunc(stmpe, pins, STMPE_BLOCK_KEYPAD); 207 + if (ret) 208 + return ret; 209 + 210 + /* 211 + * On STMPE24xx, set pin bias to pull-up on all keypad input 212 + * pins (columns), this incidentally happen to be maximum 8 pins 213 + * and placed at GPIO0-7 so only the LSB of the pull up register 214 + * ever needs to be written. 215 + */ 216 + if (variant->set_pullup) { 217 + u8 val; 218 + 219 + ret = stmpe_reg_read(stmpe, pureg); 220 + if (ret) 221 + return ret; 222 + 223 + /* Do not touch unused pins, may be used for GPIO */ 224 + val = ret & ~pu_pins; 225 + val |= pu_pins; 226 + 227 + ret = stmpe_reg_write(stmpe, pureg, val); 228 + } 229 + 230 + return 0; 230 231 } 231 232 232 233 static int stmpe_keypad_chip_init(struct stmpe_keypad *keypad) 233 234 { 234 - const struct stmpe_keypad_platform_data *plat = keypad->plat; 235 235 const struct stmpe_keypad_variant *variant = keypad->variant; 236 236 struct stmpe *stmpe = keypad->stmpe; 237 237 int ret; 238 238 239 - if (plat->debounce_ms > STMPE_KEYPAD_MAX_DEBOUNCE) 239 + if (keypad->debounce_ms > STMPE_KEYPAD_MAX_DEBOUNCE) 240 240 return -EINVAL; 241 241 242 - if (plat->scan_count > STMPE_KEYPAD_MAX_SCAN_COUNT) 242 + if (keypad->scan_count > STMPE_KEYPAD_MAX_SCAN_COUNT) 243 243 return -EINVAL; 244 244 245 245 ret = stmpe_enable(stmpe, STMPE_BLOCK_KEYPAD); ··· 291 245 292 246 ret = stmpe_set_bits(stmpe, STMPE_KPC_CTRL_MSB, 293 247 STMPE_KPC_CTRL_MSB_SCAN_COUNT, 294 - plat->scan_count << 4); 248 + keypad->scan_count << 4); 295 249 if (ret < 0) 296 250 return ret; 297 251 ··· 299 253 STMPE_KPC_CTRL_LSB_SCAN | 300 254 STMPE_KPC_CTRL_LSB_DEBOUNCE, 301 255 STMPE_KPC_CTRL_LSB_SCAN | 302 - (plat->debounce_ms << 1)); 256 + (keypad->debounce_ms << 1)); 303 257 } 304 258 305 - static void stmpe_keypad_fill_used_pins(struct stmpe_keypad *keypad) 259 + static void stmpe_keypad_fill_used_pins(struct stmpe_keypad *keypad, 260 + u32 used_rows, u32 used_cols) 306 261 { 307 262 int row, col; 308 263 309 - for (row = 0; row < STMPE_KEYPAD_MAX_ROWS; row++) { 310 - for (col = 0; col < STMPE_KEYPAD_MAX_COLS; col++) { 264 + for (row = 0; row < used_rows; row++) { 265 + for (col = 0; col < used_cols; col++) { 311 266 int code = MATRIX_SCAN_CODE(row, col, 312 - STMPE_KEYPAD_ROW_SHIFT); 267 + STMPE_KEYPAD_ROW_SHIFT); 313 268 if (keypad->keymap[code] != KEY_RESERVED) { 314 269 keypad->rows |= 1 << row; 315 270 keypad->cols |= 1 << col; ··· 319 272 } 320 273 } 321 274 322 - #ifdef CONFIG_OF 323 - static const struct stmpe_keypad_platform_data * 324 - stmpe_keypad_of_probe(struct device *dev) 325 - { 326 - struct device_node *np = dev->of_node; 327 - struct stmpe_keypad_platform_data *plat; 328 - 329 - if (!np) 330 - return ERR_PTR(-ENODEV); 331 - 332 - plat = devm_kzalloc(dev, sizeof(*plat), GFP_KERNEL); 333 - if (!plat) 334 - return ERR_PTR(-ENOMEM); 335 - 336 - of_property_read_u32(np, "debounce-interval", &plat->debounce_ms); 337 - of_property_read_u32(np, "st,scan-count", &plat->scan_count); 338 - 339 - plat->no_autorepeat = of_property_read_bool(np, "st,no-autorepeat"); 340 - 341 - return plat; 342 - } 343 - #else 344 - static inline const struct stmpe_keypad_platform_data * 345 - stmpe_keypad_of_probe(struct device *dev) 346 - { 347 - return ERR_PTR(-EINVAL); 348 - } 349 - #endif 350 - 351 275 static int stmpe_keypad_probe(struct platform_device *pdev) 352 276 { 353 277 struct stmpe *stmpe = dev_get_drvdata(pdev->dev.parent); 354 - const struct stmpe_keypad_platform_data *plat; 278 + struct device_node *np = pdev->dev.of_node; 355 279 struct stmpe_keypad *keypad; 356 280 struct input_dev *input; 281 + u32 rows; 282 + u32 cols; 357 283 int error; 358 284 int irq; 359 - 360 - plat = stmpe->pdata->keypad; 361 - if (!plat) { 362 - plat = stmpe_keypad_of_probe(&pdev->dev); 363 - if (IS_ERR(plat)) 364 - return PTR_ERR(plat); 365 - } 366 285 367 286 irq = platform_get_irq(pdev, 0); 368 287 if (irq < 0) ··· 339 326 if (!keypad) 340 327 return -ENOMEM; 341 328 329 + keypad->stmpe = stmpe; 330 + keypad->variant = &stmpe_keypad_variants[stmpe->partnum]; 331 + 332 + of_property_read_u32(np, "debounce-interval", &keypad->debounce_ms); 333 + of_property_read_u32(np, "st,scan-count", &keypad->scan_count); 334 + keypad->no_autorepeat = of_property_read_bool(np, "st,no-autorepeat"); 335 + 342 336 input = devm_input_allocate_device(&pdev->dev); 343 337 if (!input) 344 338 return -ENOMEM; ··· 354 334 input->id.bustype = BUS_I2C; 355 335 input->dev.parent = &pdev->dev; 356 336 357 - error = matrix_keypad_build_keymap(plat->keymap_data, NULL, 358 - STMPE_KEYPAD_MAX_ROWS, 359 - STMPE_KEYPAD_MAX_COLS, 337 + error = matrix_keypad_parse_of_params(&pdev->dev, &rows, &cols); 338 + if (error) 339 + return error; 340 + 341 + error = matrix_keypad_build_keymap(NULL, NULL, rows, cols, 360 342 keypad->keymap, input); 361 343 if (error) 362 344 return error; 363 345 364 346 input_set_capability(input, EV_MSC, MSC_SCAN); 365 - if (!plat->no_autorepeat) 347 + if (!keypad->no_autorepeat) 366 348 __set_bit(EV_REP, input->evbit); 367 349 368 - stmpe_keypad_fill_used_pins(keypad); 350 + stmpe_keypad_fill_used_pins(keypad, rows, cols); 369 351 370 - keypad->stmpe = stmpe; 371 - keypad->plat = plat; 372 352 keypad->input = input; 373 - keypad->variant = &stmpe_keypad_variants[stmpe->partnum]; 374 353 375 354 error = stmpe_keypad_chip_init(keypad); 376 355 if (error < 0)
+74 -10
drivers/input/mouse/alps.c
··· 881 881 unsigned char *pkt, 882 882 unsigned char pkt_id) 883 883 { 884 + /* 885 + * packet-fmt b7 b6 b5 b4 b3 b2 b1 b0 886 + * Byte0 TWO & MULTI L 1 R M 1 Y0-2 Y0-1 Y0-0 887 + * Byte0 NEW L 1 X1-5 1 1 Y0-2 Y0-1 Y0-0 888 + * Byte1 Y0-10 Y0-9 Y0-8 Y0-7 Y0-6 Y0-5 Y0-4 Y0-3 889 + * Byte2 X0-11 1 X0-10 X0-9 X0-8 X0-7 X0-6 X0-5 890 + * Byte3 X1-11 1 X0-4 X0-3 1 X0-2 X0-1 X0-0 891 + * Byte4 TWO X1-10 TWO X1-9 X1-8 X1-7 X1-6 X1-5 X1-4 892 + * Byte4 MULTI X1-10 TWO X1-9 X1-8 X1-7 X1-6 Y1-5 1 893 + * Byte4 NEW X1-10 TWO X1-9 X1-8 X1-7 X1-6 0 0 894 + * Byte5 TWO & NEW Y1-10 0 Y1-9 Y1-8 Y1-7 Y1-6 Y1-5 Y1-4 895 + * Byte5 MULTI Y1-10 0 Y1-9 Y1-8 Y1-7 Y1-6 F-1 F-0 896 + * L: Left button 897 + * R / M: Non-clickpads: Right / Middle button 898 + * Clickpads: When > 2 fingers are down, and some fingers 899 + * are in the button area, then the 2 coordinates reported 900 + * are for fingers outside the button area and these report 901 + * extra fingers being present in the right / left button 902 + * area. Note these fingers are not added to the F field! 903 + * so if a TWO packet is received and R = 1 then there are 904 + * 3 fingers down, etc. 905 + * TWO: 1: Two touches present, byte 0/4/5 are in TWO fmt 906 + * 0: If byte 4 bit 0 is 1, then byte 0/4/5 are in MULTI fmt 907 + * otherwise byte 0 bit 4 must be set and byte 0/4/5 are 908 + * in NEW fmt 909 + * F: Number of fingers - 3, 0 means 3 fingers, 1 means 4 ... 910 + */ 911 + 884 912 mt[0].x = ((pkt[2] & 0x80) << 4); 885 913 mt[0].x |= ((pkt[2] & 0x3F) << 5); 886 914 mt[0].x |= ((pkt[3] & 0x30) >> 1); ··· 947 919 948 920 static int alps_get_mt_count(struct input_mt_pos *mt) 949 921 { 950 - int i; 922 + int i, fingers = 0; 951 923 952 - for (i = 0; i < MAX_TOUCHES && mt[i].x != 0 && mt[i].y != 0; i++) 953 - /* empty */; 924 + for (i = 0; i < MAX_TOUCHES; i++) { 925 + if (mt[i].x != 0 || mt[i].y != 0) 926 + fingers++; 927 + } 954 928 955 - return i; 929 + return fingers; 956 930 } 957 931 958 932 static int alps_decode_packet_v7(struct alps_fields *f, 959 933 unsigned char *p, 960 934 struct psmouse *psmouse) 961 935 { 936 + struct alps_data *priv = psmouse->private; 962 937 unsigned char pkt_id; 963 938 964 939 pkt_id = alps_get_packet_id_v7(p); ··· 969 938 return 0; 970 939 if (pkt_id == V7_PACKET_ID_UNKNOWN) 971 940 return -1; 941 + /* 942 + * NEW packets are send to indicate a discontinuity in the finger 943 + * coordinate reporting. Specifically a finger may have moved from 944 + * slot 0 to 1 or vice versa. INPUT_MT_TRACK takes care of this for 945 + * us. 946 + * 947 + * NEW packets have 3 problems: 948 + * 1) They do not contain middle / right button info (on non clickpads) 949 + * this can be worked around by preserving the old button state 950 + * 2) They do not contain an accurate fingercount, and they are 951 + * typically send when the number of fingers changes. We cannot use 952 + * the old finger count as that may mismatch with the amount of 953 + * touch coordinates we've available in the NEW packet 954 + * 3) Their x data for the second touch is inaccurate leading to 955 + * a possible jump of the x coordinate by 16 units when the first 956 + * non NEW packet comes in 957 + * Since problems 2 & 3 cannot be worked around, just ignore them. 958 + */ 959 + if (pkt_id == V7_PACKET_ID_NEW) 960 + return 1; 972 961 973 962 alps_get_finger_coordinate_v7(f->mt, p, pkt_id); 974 963 975 - if (pkt_id == V7_PACKET_ID_TWO || pkt_id == V7_PACKET_ID_MULTI) { 976 - f->left = (p[0] & 0x80) >> 7; 964 + if (pkt_id == V7_PACKET_ID_TWO) 965 + f->fingers = alps_get_mt_count(f->mt); 966 + else /* pkt_id == V7_PACKET_ID_MULTI */ 967 + f->fingers = 3 + (p[5] & 0x03); 968 + 969 + f->left = (p[0] & 0x80) >> 7; 970 + if (priv->flags & ALPS_BUTTONPAD) { 971 + if (p[0] & 0x20) 972 + f->fingers++; 973 + if (p[0] & 0x10) 974 + f->fingers++; 975 + } else { 977 976 f->right = (p[0] & 0x20) >> 5; 978 977 f->middle = (p[0] & 0x10) >> 4; 979 978 } 980 979 981 - if (pkt_id == V7_PACKET_ID_TWO) 982 - f->fingers = alps_get_mt_count(f->mt); 983 - else if (pkt_id == V7_PACKET_ID_MULTI) 984 - f->fingers = 3 + (p[5] & 0x03); 980 + /* Sometimes a single touch is reported in mt[1] rather then mt[0] */ 981 + if (f->fingers == 1 && f->mt[0].x == 0 && f->mt[0].y == 0) { 982 + f->mt[0].x = f->mt[1].x; 983 + f->mt[0].y = f->mt[1].y; 984 + f->mt[1].x = 0; 985 + f->mt[1].y = 0; 986 + } 985 987 986 988 return 0; 987 989 }
+4
drivers/input/mouse/trackpoint.c
··· 227 227 TRACKPOINT_INT_ATTR(upthresh, TP_UP_THRESH, TP_DEF_UP_THRESH); 228 228 TRACKPOINT_INT_ATTR(ztime, TP_Z_TIME, TP_DEF_Z_TIME); 229 229 TRACKPOINT_INT_ATTR(jenks, TP_JENKS_CURV, TP_DEF_JENKS_CURV); 230 + TRACKPOINT_INT_ATTR(drift_time, TP_DRIFT_TIME, TP_DEF_DRIFT_TIME); 230 231 231 232 TRACKPOINT_BIT_ATTR(press_to_select, TP_TOGGLE_PTSON, TP_MASK_PTSON, 0, 232 233 TP_DEF_PTSON); ··· 247 246 &psmouse_attr_upthresh.dattr.attr, 248 247 &psmouse_attr_ztime.dattr.attr, 249 248 &psmouse_attr_jenks.dattr.attr, 249 + &psmouse_attr_drift_time.dattr.attr, 250 250 &psmouse_attr_press_to_select.dattr.attr, 251 251 &psmouse_attr_skipback.dattr.attr, 252 252 &psmouse_attr_ext_dev.dattr.attr, ··· 314 312 TRACKPOINT_UPDATE(in_power_on_state, psmouse, tp, upthresh); 315 313 TRACKPOINT_UPDATE(in_power_on_state, psmouse, tp, ztime); 316 314 TRACKPOINT_UPDATE(in_power_on_state, psmouse, tp, jenks); 315 + TRACKPOINT_UPDATE(in_power_on_state, psmouse, tp, drift_time); 317 316 318 317 /* toggles */ 319 318 TRACKPOINT_UPDATE(in_power_on_state, psmouse, tp, press_to_select); ··· 335 332 TRACKPOINT_SET_POWER_ON_DEFAULT(tp, upthresh); 336 333 TRACKPOINT_SET_POWER_ON_DEFAULT(tp, ztime); 337 334 TRACKPOINT_SET_POWER_ON_DEFAULT(tp, jenks); 335 + TRACKPOINT_SET_POWER_ON_DEFAULT(tp, drift_time); 338 336 TRACKPOINT_SET_POWER_ON_DEFAULT(tp, inertia); 339 337 340 338 /* toggles */
+5
drivers/input/mouse/trackpoint.h
··· 70 70 #define TP_UP_THRESH 0x5A /* Used to generate a 'click' on Z-axis */ 71 71 #define TP_Z_TIME 0x5E /* How sharp of a press */ 72 72 #define TP_JENKS_CURV 0x5D /* Minimum curvature for double click */ 73 + #define TP_DRIFT_TIME 0x5F /* How long a 'hands off' condition */ 74 + /* must last (x*107ms) for drift */ 75 + /* correction to occur */ 73 76 74 77 /* 75 78 * Toggling Flag bits ··· 123 120 #define TP_DEF_UP_THRESH 0xFF 124 121 #define TP_DEF_Z_TIME 0x26 125 122 #define TP_DEF_JENKS_CURV 0x87 123 + #define TP_DEF_DRIFT_TIME 0x05 126 124 127 125 /* Toggles */ 128 126 #define TP_DEF_MB 0x00 ··· 141 137 unsigned char draghys, mindrag; 142 138 unsigned char thresh, upthresh; 143 139 unsigned char ztime, jenks; 140 + unsigned char drift_time; 144 141 145 142 /* toggles */ 146 143 unsigned char press_to_select;
+26 -73
drivers/input/touchscreen/atmel_mxt_ts.c
··· 99 99 #define MXT_T6_STATUS_COMSERR (1 << 2) 100 100 101 101 /* MXT_GEN_POWER_T7 field */ 102 - struct t7_config { 103 - u8 idle; 104 - u8 active; 105 - } __packed; 106 - 107 - #define MXT_POWER_CFG_RUN 0 108 - #define MXT_POWER_CFG_DEEPSLEEP 1 102 + #define MXT_POWER_IDLEACQINT 0 103 + #define MXT_POWER_ACTVACQINT 1 104 + #define MXT_POWER_ACTV2IDLETO 2 109 105 110 106 /* MXT_GEN_ACQUIRE_T8 field */ 111 107 #define MXT_ACQUIRE_CHRGTIME 0 ··· 113 117 #define MXT_ACQUIRE_ATCHCALSTHR 7 114 118 115 119 /* MXT_TOUCH_MULTI_T9 field */ 120 + #define MXT_TOUCH_CTRL 0 116 121 #define MXT_T9_ORIENT 9 117 122 #define MXT_T9_RANGE 18 118 123 ··· 253 256 bool update_input; 254 257 u8 last_message_count; 255 258 u8 num_touchids; 256 - struct t7_config t7_cfg; 257 259 258 260 /* Cached parameters from object table */ 259 261 u16 T5_address; ··· 666 670 667 671 /* Save current status */ 668 672 data->t6_status = status; 673 + } 674 + 675 + static int mxt_write_object(struct mxt_data *data, 676 + u8 type, u8 offset, u8 val) 677 + { 678 + struct mxt_object *object; 679 + u16 reg; 680 + 681 + object = mxt_get_object(data, type); 682 + if (!object || offset >= mxt_obj_size(object)) 683 + return -EINVAL; 684 + 685 + reg = object->start_address; 686 + return mxt_write_reg(data->client, reg + offset, val); 669 687 } 670 688 671 689 static void mxt_input_button(struct mxt_data *data, u8 *message) ··· 1752 1742 return error; 1753 1743 } 1754 1744 1755 - static int mxt_set_t7_power_cfg(struct mxt_data *data, u8 sleep) 1756 - { 1757 - struct device *dev = &data->client->dev; 1758 - int error; 1759 - struct t7_config *new_config; 1760 - struct t7_config deepsleep = { .active = 0, .idle = 0 }; 1761 - 1762 - if (sleep == MXT_POWER_CFG_DEEPSLEEP) 1763 - new_config = &deepsleep; 1764 - else 1765 - new_config = &data->t7_cfg; 1766 - 1767 - error = __mxt_write_reg(data->client, data->T7_address, 1768 - sizeof(data->t7_cfg), new_config); 1769 - if (error) 1770 - return error; 1771 - 1772 - dev_dbg(dev, "Set T7 ACTV:%d IDLE:%d\n", 1773 - new_config->active, new_config->idle); 1774 - 1775 - return 0; 1776 - } 1777 - 1778 - static int mxt_init_t7_power_cfg(struct mxt_data *data) 1779 - { 1780 - struct device *dev = &data->client->dev; 1781 - int error; 1782 - bool retry = false; 1783 - 1784 - recheck: 1785 - error = __mxt_read_reg(data->client, data->T7_address, 1786 - sizeof(data->t7_cfg), &data->t7_cfg); 1787 - if (error) 1788 - return error; 1789 - 1790 - if (data->t7_cfg.active == 0 || data->t7_cfg.idle == 0) { 1791 - if (!retry) { 1792 - dev_dbg(dev, "T7 cfg zero, resetting\n"); 1793 - mxt_soft_reset(data); 1794 - retry = true; 1795 - goto recheck; 1796 - } else { 1797 - dev_dbg(dev, "T7 cfg zero after reset, overriding\n"); 1798 - data->t7_cfg.active = 20; 1799 - data->t7_cfg.idle = 100; 1800 - return mxt_set_t7_power_cfg(data, MXT_POWER_CFG_RUN); 1801 - } 1802 - } 1803 - 1804 - dev_dbg(dev, "Initialized power cfg: ACTV %d, IDLE %d\n", 1805 - data->t7_cfg.active, data->t7_cfg.idle); 1806 - return 0; 1807 - } 1808 - 1809 1745 static int mxt_configure_objects(struct mxt_data *data, 1810 1746 const struct firmware *cfg) 1811 1747 { ··· 1763 1807 error = mxt_update_cfg(data, cfg); 1764 1808 if (error) 1765 1809 dev_warn(dev, "Error %d updating config\n", error); 1766 - } 1767 - 1768 - error = mxt_init_t7_power_cfg(data); 1769 - if (error) { 1770 - dev_err(dev, "Failed to initialize power cfg\n"); 1771 - return error; 1772 1810 } 1773 1811 1774 1812 error = mxt_initialize_t9_input_device(data); ··· 2043 2093 2044 2094 static void mxt_start(struct mxt_data *data) 2045 2095 { 2046 - mxt_set_t7_power_cfg(data, MXT_POWER_CFG_RUN); 2047 - 2048 - /* Recalibrate since chip has been in deep sleep */ 2049 - mxt_t6_command(data, MXT_COMMAND_CALIBRATE, 1, false); 2096 + /* Touch enable */ 2097 + mxt_write_object(data, 2098 + MXT_TOUCH_MULTI_T9, MXT_TOUCH_CTRL, 0x83); 2050 2099 } 2051 2100 2052 2101 static void mxt_stop(struct mxt_data *data) 2053 2102 { 2054 - mxt_set_t7_power_cfg(data, MXT_POWER_CFG_DEEPSLEEP); 2103 + /* Touch disable */ 2104 + mxt_write_object(data, 2105 + MXT_TOUCH_MULTI_T9, MXT_TOUCH_CTRL, 0); 2055 2106 } 2056 2107 2057 2108 static int mxt_input_open(struct input_dev *dev) ··· 2216 2265 struct i2c_client *client = to_i2c_client(dev); 2217 2266 struct mxt_data *data = i2c_get_clientdata(client); 2218 2267 struct input_dev *input_dev = data->input_dev; 2268 + 2269 + mxt_soft_reset(data); 2219 2270 2220 2271 mutex_lock(&input_dev->mutex); 2221 2272
+3 -1
drivers/input/touchscreen/edt-ft5x06.c
··· 850 850 } 851 851 852 852 #define EDT_ATTR_CHECKSET(name, reg) \ 853 + do { \ 853 854 if (pdata->name >= edt_ft5x06_attr_##name.limit_low && \ 854 855 pdata->name <= edt_ft5x06_attr_##name.limit_high) \ 855 - edt_ft5x06_register_write(tsdata, reg, pdata->name) 856 + edt_ft5x06_register_write(tsdata, reg, pdata->name); \ 857 + } while (0) 856 858 857 859 #define EDT_GET_PROP(name, reg) { \ 858 860 u32 val; \
+4
drivers/mfd/stmpe.c
··· 519 519 [STMPE_IDX_GPDR_LSB] = STMPE1601_REG_GPIO_SET_DIR_LSB, 520 520 [STMPE_IDX_GPRER_LSB] = STMPE1601_REG_GPIO_RE_LSB, 521 521 [STMPE_IDX_GPFER_LSB] = STMPE1601_REG_GPIO_FE_LSB, 522 + [STMPE_IDX_GPPUR_LSB] = STMPE1601_REG_GPIO_PU_LSB, 522 523 [STMPE_IDX_GPAFR_U_MSB] = STMPE1601_REG_GPIO_AF_U_MSB, 523 524 [STMPE_IDX_IEGPIOR_LSB] = STMPE1601_REG_INT_EN_GPIO_MASK_LSB, 524 525 [STMPE_IDX_ISGPIOR_MSB] = STMPE1601_REG_INT_STA_GPIO_MSB, ··· 668 667 [STMPE_IDX_GPDR_LSB] = STMPE1801_REG_GPIO_SET_DIR_LOW, 669 668 [STMPE_IDX_GPRER_LSB] = STMPE1801_REG_GPIO_RE_LOW, 670 669 [STMPE_IDX_GPFER_LSB] = STMPE1801_REG_GPIO_FE_LOW, 670 + [STMPE_IDX_GPPUR_LSB] = STMPE1801_REG_GPIO_PULL_UP_LOW, 671 671 [STMPE_IDX_IEGPIOR_LSB] = STMPE1801_REG_INT_EN_GPIO_MASK_LOW, 672 672 [STMPE_IDX_ISGPIOR_LSB] = STMPE1801_REG_INT_STA_GPIO_LOW, 673 673 }; ··· 752 750 [STMPE_IDX_GPDR_LSB] = STMPE24XX_REG_GPDR_LSB, 753 751 [STMPE_IDX_GPRER_LSB] = STMPE24XX_REG_GPRER_LSB, 754 752 [STMPE_IDX_GPFER_LSB] = STMPE24XX_REG_GPFER_LSB, 753 + [STMPE_IDX_GPPUR_LSB] = STMPE24XX_REG_GPPUR_LSB, 754 + [STMPE_IDX_GPPDR_LSB] = STMPE24XX_REG_GPPDR_LSB, 755 755 [STMPE_IDX_GPAFR_U_MSB] = STMPE24XX_REG_GPAFR_U_MSB, 756 756 [STMPE_IDX_IEGPIOR_LSB] = STMPE24XX_REG_IEGPIOR_LSB, 757 757 [STMPE_IDX_ISGPIOR_MSB] = STMPE24XX_REG_ISGPIOR_MSB,
+3
drivers/mfd/stmpe.h
··· 188 188 #define STMPE1601_REG_GPIO_ED_MSB 0x8A 189 189 #define STMPE1601_REG_GPIO_RE_LSB 0x8D 190 190 #define STMPE1601_REG_GPIO_FE_LSB 0x8F 191 + #define STMPE1601_REG_GPIO_PU_LSB 0x91 191 192 #define STMPE1601_REG_GPIO_AF_U_MSB 0x92 192 193 193 194 #define STMPE1601_SYS_CTRL_ENABLE_GPIO (1 << 3) ··· 277 276 #define STMPE24XX_REG_GPEDR_MSB 0x8C 278 277 #define STMPE24XX_REG_GPRER_LSB 0x91 279 278 #define STMPE24XX_REG_GPFER_LSB 0x94 279 + #define STMPE24XX_REG_GPPUR_LSB 0x97 280 + #define STMPE24XX_REG_GPPDR_LSB 0x9a 280 281 #define STMPE24XX_REG_GPAFR_U_MSB 0x9B 281 282 282 283 #define STMPE24XX_SYS_CTRL_ENABLE_GPIO (1 << 3)
+3 -1
drivers/net/ethernet/allwinner/sun4i-emac.c
··· 850 850 } 851 851 852 852 db->clk = devm_clk_get(&pdev->dev, NULL); 853 - if (IS_ERR(db->clk)) 853 + if (IS_ERR(db->clk)) { 854 + ret = PTR_ERR(db->clk); 854 855 goto out; 856 + } 855 857 856 858 clk_prepare_enable(db->clk); 857 859
+6 -9
drivers/net/ethernet/altera/altera_tse_main.c
··· 1170 1170 init_error: 1171 1171 free_skbufs(dev); 1172 1172 alloc_skbuf_error: 1173 - if (priv->phydev) { 1174 - phy_disconnect(priv->phydev); 1175 - priv->phydev = NULL; 1176 - } 1177 1173 phy_error: 1178 1174 return ret; 1179 1175 } ··· 1182 1186 int ret; 1183 1187 unsigned long int flags; 1184 1188 1185 - /* Stop and disconnect the PHY */ 1186 - if (priv->phydev) { 1189 + /* Stop the PHY */ 1190 + if (priv->phydev) 1187 1191 phy_stop(priv->phydev); 1188 - phy_disconnect(priv->phydev); 1189 - priv->phydev = NULL; 1190 - } 1191 1192 1192 1193 netif_stop_queue(dev); 1193 1194 napi_disable(&priv->napi); ··· 1518 1525 static int altera_tse_remove(struct platform_device *pdev) 1519 1526 { 1520 1527 struct net_device *ndev = platform_get_drvdata(pdev); 1528 + struct altera_tse_private *priv = netdev_priv(ndev); 1529 + 1530 + if (priv->phydev) 1531 + phy_disconnect(priv->phydev); 1521 1532 1522 1533 platform_set_drvdata(pdev, NULL); 1523 1534 altera_tse_mdio_destroy(ndev);
+4 -2
drivers/net/ethernet/cisco/enic/enic_main.c
··· 1653 1653 if (vnic_rq_desc_used(&enic->rq[i]) == 0) { 1654 1654 netdev_err(netdev, "Unable to alloc receive buffers\n"); 1655 1655 err = -ENOMEM; 1656 - goto err_out_notify_unset; 1656 + goto err_out_free_rq; 1657 1657 } 1658 1658 } 1659 1659 ··· 1686 1686 1687 1687 return 0; 1688 1688 1689 - err_out_notify_unset: 1689 + err_out_free_rq: 1690 + for (i = 0; i < enic->rq_count; i++) 1691 + vnic_rq_clean(&enic->rq[i], enic_free_rq_buf); 1690 1692 enic_dev_notify_unset(enic); 1691 1693 err_out_free_intr: 1692 1694 enic_free_intr(enic);
+1 -1
drivers/net/ethernet/intel/e100.c
··· 1543 1543 mdio_write(netdev, nic->mii.phy_id, MII_BMCR, bmcr); 1544 1544 } else if ((nic->mac >= mac_82550_D102) || ((nic->flags & ich) && 1545 1545 (mdio_read(netdev, nic->mii.phy_id, MII_TPISTATUS) & 0x8000) && 1546 - !(nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled))) { 1546 + (nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled))) { 1547 1547 /* enable/disable MDI/MDI-X auto-switching. */ 1548 1548 mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG, 1549 1549 nic->mii.force_media ? 0 : NCONFIG_AUTO_SWITCH);
+3 -1
drivers/net/ethernet/intel/i40e/i40e_debugfs.c
··· 829 829 if (desc_n >= ring->count || desc_n < 0) { 830 830 dev_info(&pf->pdev->dev, 831 831 "descriptor %d not found\n", desc_n); 832 - return; 832 + goto out; 833 833 } 834 834 if (!is_rx_ring) { 835 835 txd = I40E_TX_DESC(ring, desc_n); ··· 855 855 } else { 856 856 dev_info(&pf->pdev->dev, "dump desc rx/tx <vsi_seid> <ring_id> [<desc_n>]\n"); 857 857 } 858 + 859 + out: 858 860 kfree(ring); 859 861 } 860 862
+1 -1
drivers/net/ethernet/intel/igb/e1000_82575.c
··· 1125 1125 u32 swmask = mask; 1126 1126 u32 fwmask = mask << 16; 1127 1127 s32 ret_val = 0; 1128 - s32 i = 0, timeout = 200; /* FIXME: find real value to use here */ 1128 + s32 i = 0, timeout = 200; 1129 1129 1130 1130 while (i < timeout) { 1131 1131 if (igb_get_hw_semaphore(hw)) {
+4 -9
drivers/net/ethernet/mellanox/mlx4/main.c
··· 1829 1829 err = mlx4_dev_cap(dev, &dev_cap); 1830 1830 if (err) { 1831 1831 mlx4_err(dev, "QUERY_DEV_CAP command failed, aborting\n"); 1832 - goto err_stop_fw; 1832 + return err; 1833 1833 } 1834 1834 1835 1835 choose_steering_mode(dev, &dev_cap); ··· 1860 1860 &init_hca); 1861 1861 if ((long long) icm_size < 0) { 1862 1862 err = icm_size; 1863 - goto err_stop_fw; 1863 + return err; 1864 1864 } 1865 1865 1866 1866 dev->caps.max_fmr_maps = (1 << (32 - ilog2(dev->caps.num_mpts))) - 1; ··· 1874 1874 1875 1875 err = mlx4_init_icm(dev, &dev_cap, &init_hca, icm_size); 1876 1876 if (err) 1877 - goto err_stop_fw; 1877 + return err; 1878 1878 1879 1879 err = mlx4_INIT_HCA(dev, &init_hca); 1880 1880 if (err) { ··· 1886 1886 err = mlx4_query_func(dev, &dev_cap); 1887 1887 if (err < 0) { 1888 1888 mlx4_err(dev, "QUERY_FUNC command failed, aborting.\n"); 1889 - goto err_stop_fw; 1889 + goto err_close; 1890 1890 } else if (err & MLX4_QUERY_FUNC_NUM_SYS_EQS) { 1891 1891 dev->caps.num_eqs = dev_cap.max_eqs; 1892 1892 dev->caps.reserved_eqs = dev_cap.reserved_eqs; ··· 2006 2006 if (!mlx4_is_slave(dev)) 2007 2007 mlx4_free_icms(dev); 2008 2008 2009 - err_stop_fw: 2010 - if (!mlx4_is_slave(dev)) { 2011 - mlx4_UNMAP_FA(dev); 2012 - mlx4_free_icm(dev, priv->fw.fw_icm, 0); 2013 - } 2014 2009 return err; 2015 2010 } 2016 2011
+5 -4
drivers/net/ethernet/mellanox/mlx4/mr.c
··· 584 584 void mlx4_mr_rereg_mem_cleanup(struct mlx4_dev *dev, struct mlx4_mr *mr) 585 585 { 586 586 mlx4_mtt_cleanup(dev, &mr->mtt); 587 + mr->mtt.order = -1; 587 588 } 588 589 EXPORT_SYMBOL_GPL(mlx4_mr_rereg_mem_cleanup); 589 590 ··· 594 593 { 595 594 int err; 596 595 597 - mpt_entry->start = cpu_to_be64(iova); 598 - mpt_entry->length = cpu_to_be64(size); 599 - mpt_entry->entity_size = cpu_to_be32(page_shift); 600 - 601 596 err = mlx4_mtt_init(dev, npages, page_shift, &mr->mtt); 602 597 if (err) 603 598 return err; 599 + 600 + mpt_entry->start = cpu_to_be64(mr->iova); 601 + mpt_entry->length = cpu_to_be64(mr->size); 602 + mpt_entry->entity_size = cpu_to_be32(mr->mtt.page_shift); 604 603 605 604 mpt_entry->pd_flags &= cpu_to_be32(MLX4_MPT_PD_MASK | 606 605 MLX4_MPT_PD_FLAG_EN_INV);
+3 -1
drivers/net/ethernet/myricom/myri10ge/myri10ge.c
··· 4033 4033 (void)pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); 4034 4034 mgp->cmd = dma_alloc_coherent(&pdev->dev, sizeof(*mgp->cmd), 4035 4035 &mgp->cmd_bus, GFP_KERNEL); 4036 - if (mgp->cmd == NULL) 4036 + if (!mgp->cmd) { 4037 + status = -ENOMEM; 4037 4038 goto abort_with_enabled; 4039 + } 4038 4040 4039 4041 mgp->board_span = pci_resource_len(pdev, 0); 4040 4042 mgp->iomem_base = pci_resource_start(pdev, 0);
+3 -5
drivers/net/ethernet/qlogic/qla3xxx.c
··· 146 146 { 147 147 int i = 0; 148 148 149 - while (i < 10) { 150 - if (i) 151 - ssleep(1); 152 - 149 + do { 153 150 if (ql_sem_lock(qdev, 154 151 QL_DRVR_SEM_MASK, 155 152 (QL_RESOURCE_BITS_BASE_CODE | (qdev->mac_index) ··· 155 158 "driver lock acquired\n"); 156 159 return 1; 157 160 } 158 - } 161 + ssleep(1); 162 + } while (++i < 10); 159 163 160 164 netdev_err(qdev->ndev, "Timed out waiting for driver lock...\n"); 161 165 return 0;
+1
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
··· 2605 2605 } else { 2606 2606 dev_err(&pdev->dev, 2607 2607 "%s: failed. Please Reboot\n", __func__); 2608 + err = -ENODEV; 2608 2609 goto err_out_free_hw; 2609 2610 } 2610 2611
+8 -11
drivers/net/ethernet/ti/cpsw.c
··· 757 757 static irqreturn_t cpsw_interrupt(int irq, void *dev_id) 758 758 { 759 759 struct cpsw_priv *priv = dev_id; 760 + int value = irq - priv->irqs_table[0]; 761 + 762 + /* NOTICE: Ending IRQ here. The trick with the 'value' variable above 763 + * is to make sure we will always write the correct value to the EOI 764 + * register. Namely 0 for RX_THRESH Interrupt, 1 for RX Interrupt, 2 765 + * for TX Interrupt and 3 for MISC Interrupt. 766 + */ 767 + cpdma_ctlr_eoi(priv->dma, value); 760 768 761 769 cpsw_intr_disable(priv); 762 770 if (priv->irq_enabled == true) { ··· 794 786 int num_tx, num_rx; 795 787 796 788 num_tx = cpdma_chan_process(priv->txch, 128); 797 - if (num_tx) 798 - cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX); 799 789 800 790 num_rx = cpdma_chan_process(priv->rxch, budget); 801 791 if (num_rx < budget) { ··· 801 795 802 796 napi_complete(napi); 803 797 cpsw_intr_enable(priv); 804 - cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX); 805 798 prim_cpsw = cpsw_get_slave_priv(priv, 0); 806 799 if (prim_cpsw->irq_enabled == false) { 807 800 prim_cpsw->irq_enabled = true; ··· 1315 1310 napi_enable(&priv->napi); 1316 1311 cpdma_ctlr_start(priv->dma); 1317 1312 cpsw_intr_enable(priv); 1318 - cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX); 1319 - cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX); 1320 1313 1321 1314 prim_cpsw = cpsw_get_slave_priv(priv, 0); 1322 1315 if (prim_cpsw->irq_enabled == false) { ··· 1581 1578 cpdma_chan_start(priv->txch); 1582 1579 cpdma_ctlr_int_ctrl(priv->dma, true); 1583 1580 cpsw_intr_enable(priv); 1584 - cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX); 1585 - cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX); 1586 - 1587 1581 } 1588 1582 1589 1583 static int cpsw_ndo_set_mac_address(struct net_device *ndev, void *p) ··· 1620 1620 cpsw_interrupt(ndev->irq, priv); 1621 1621 cpdma_ctlr_int_ctrl(priv->dma, true); 1622 1622 cpsw_intr_enable(priv); 1623 - cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX); 1624 - cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX); 1625 - 1626 1623 } 1627 1624 #endif 1628 1625
+2
drivers/net/ethernet/xilinx/ll_temac_main.c
··· 1043 1043 lp->regs = of_iomap(op->dev.of_node, 0); 1044 1044 if (!lp->regs) { 1045 1045 dev_err(&op->dev, "could not map temac regs.\n"); 1046 + rc = -ENOMEM; 1046 1047 goto nodev; 1047 1048 } 1048 1049 ··· 1063 1062 np = of_parse_phandle(op->dev.of_node, "llink-connected", 0); 1064 1063 if (!np) { 1065 1064 dev_err(&op->dev, "could not find DMA node\n"); 1065 + rc = -ENODEV; 1066 1066 goto err_iounmap; 1067 1067 } 1068 1068
+2
drivers/net/ethernet/xilinx/xilinx_axienet_main.c
··· 1501 1501 lp->regs = of_iomap(op->dev.of_node, 0); 1502 1502 if (!lp->regs) { 1503 1503 dev_err(&op->dev, "could not map Axi Ethernet regs.\n"); 1504 + ret = -ENOMEM; 1504 1505 goto nodev; 1505 1506 } 1506 1507 /* Setup checksum offload, but default to off if not specified */ ··· 1564 1563 np = of_parse_phandle(op->dev.of_node, "axistream-connected", 0); 1565 1564 if (!np) { 1566 1565 dev_err(&op->dev, "could not find DMA node\n"); 1566 + ret = -ENODEV; 1567 1567 goto err_iounmap; 1568 1568 } 1569 1569 lp->dma_regs = of_iomap(np, 0);
+1
drivers/net/ethernet/xilinx/xilinx_emaclite.c
··· 1109 1109 res = platform_get_resource(ofdev, IORESOURCE_IRQ, 0); 1110 1110 if (!res) { 1111 1111 dev_err(dev, "no IRQ found\n"); 1112 + rc = -ENXIO; 1112 1113 goto error; 1113 1114 } 1114 1115
+7 -3
drivers/net/usb/qmi_wwan.c
··· 56 56 /* default ethernet address used by the modem */ 57 57 static const u8 default_modem_addr[ETH_ALEN] = {0x02, 0x50, 0xf3}; 58 58 59 + static const u8 buggy_fw_addr[ETH_ALEN] = {0x00, 0xa0, 0xc6, 0x00, 0x00, 0x00}; 60 + 59 61 /* Make up an ethernet header if the packet doesn't have one. 60 62 * 61 63 * A firmware bug common among several devices cause them to send raw ··· 334 332 usb_driver_release_interface(driver, info->data); 335 333 } 336 334 337 - /* Never use the same address on both ends of the link, even 338 - * if the buggy firmware told us to. 335 + /* Never use the same address on both ends of the link, even if the 336 + * buggy firmware told us to. Or, if device is assigned the well-known 337 + * buggy firmware MAC address, replace it with a random address, 339 338 */ 340 - if (ether_addr_equal(dev->net->dev_addr, default_modem_addr)) 339 + if (ether_addr_equal(dev->net->dev_addr, default_modem_addr) || 340 + ether_addr_equal(dev->net->dev_addr, buggy_fw_addr)) 341 341 eth_hw_addr_random(dev->net); 342 342 343 343 /* make MAC addr easily distinguishable from an IP header */
+17
drivers/net/usb/r8152.c
··· 1897 1897 netif_wake_queue(netdev); 1898 1898 } 1899 1899 1900 + static netdev_features_t 1901 + rtl8152_features_check(struct sk_buff *skb, struct net_device *dev, 1902 + netdev_features_t features) 1903 + { 1904 + u32 mss = skb_shinfo(skb)->gso_size; 1905 + int max_offset = mss ? GTTCPHO_MAX : TCPHO_MAX; 1906 + int offset = skb_transport_offset(skb); 1907 + 1908 + if ((mss || skb->ip_summed == CHECKSUM_PARTIAL) && offset > max_offset) 1909 + features &= ~(NETIF_F_ALL_CSUM | NETIF_F_GSO_MASK); 1910 + else if ((skb->len + sizeof(struct tx_desc)) > agg_buf_sz) 1911 + features &= ~NETIF_F_GSO_MASK; 1912 + 1913 + return features; 1914 + } 1915 + 1900 1916 static netdev_tx_t rtl8152_start_xmit(struct sk_buff *skb, 1901 1917 struct net_device *netdev) 1902 1918 { ··· 3722 3706 .ndo_set_mac_address = rtl8152_set_mac_address, 3723 3707 .ndo_change_mtu = rtl8152_change_mtu, 3724 3708 .ndo_validate_addr = eth_validate_addr, 3709 + .ndo_features_check = rtl8152_features_check, 3725 3710 }; 3726 3711 3727 3712 static void r8152b_get_version(struct r8152 *tp)
+1
drivers/net/xen-netback/xenbus.c
··· 737 737 } 738 738 739 739 queue->remaining_credit = credit_bytes; 740 + queue->credit_usec = credit_usec; 740 741 741 742 err = connect_rings(be, queue); 742 743 if (err) {
+1 -1
drivers/scsi/fnic/fnic.h
··· 39 39 40 40 #define DRV_NAME "fnic" 41 41 #define DRV_DESCRIPTION "Cisco FCoE HBA Driver" 42 - #define DRV_VERSION "1.6.0.16" 42 + #define DRV_VERSION "1.6.0.17" 43 43 #define PFX DRV_NAME ": " 44 44 #define DFX DRV_NAME "%d: " 45 45
+15
drivers/scsi/fnic/fnic_scsi.c
··· 1892 1892 goto fnic_abort_cmd_end; 1893 1893 } 1894 1894 1895 + /* IO out of order */ 1896 + 1897 + if (!(CMD_FLAGS(sc) & (FNIC_IO_ABORTED | FNIC_IO_DONE))) { 1898 + spin_unlock_irqrestore(io_lock, flags); 1899 + FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, 1900 + "Issuing Host reset due to out of order IO\n"); 1901 + 1902 + if (fnic_host_reset(sc) == FAILED) { 1903 + FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, 1904 + "fnic_host_reset failed.\n"); 1905 + } 1906 + ret = FAILED; 1907 + goto fnic_abort_cmd_end; 1908 + } 1909 + 1895 1910 CMD_STATE(sc) = FNIC_IOREQ_ABTS_COMPLETE; 1896 1911 1897 1912 /*
+2 -2
drivers/scsi/scsi_error.c
··· 1041 1041 } 1042 1042 /* signal not to enter either branch of the if () below */ 1043 1043 timeleft = 0; 1044 - rtn = NEEDS_RETRY; 1044 + rtn = FAILED; 1045 1045 } else { 1046 1046 timeleft = wait_for_completion_timeout(&done, timeout); 1047 1047 rtn = SUCCESS; ··· 1081 1081 rtn = FAILED; 1082 1082 break; 1083 1083 } 1084 - } else if (!rtn) { 1084 + } else if (rtn != FAILED) { 1085 1085 scsi_abort_eh_cmnd(scmd); 1086 1086 rtn = FAILED; 1087 1087 }
+3 -2
drivers/scsi/sd.c
··· 2623 2623 sd_config_discard(sdkp, SD_LBP_WS16); 2624 2624 2625 2625 } else { /* LBP VPD page tells us what to use */ 2626 - 2627 - if (sdkp->lbpws) 2626 + if (sdkp->lbpu && sdkp->max_unmap_blocks && !sdkp->lbprz) 2627 + sd_config_discard(sdkp, SD_LBP_UNMAP); 2628 + else if (sdkp->lbpws) 2628 2629 sd_config_discard(sdkp, SD_LBP_WS16); 2629 2630 else if (sdkp->lbpws10) 2630 2631 sd_config_discard(sdkp, SD_LBP_WS10);
+7 -3
drivers/vhost/vhost.c
··· 713 713 r = -EFAULT; 714 714 break; 715 715 } 716 - if ((a.avail_user_addr & (sizeof *vq->avail->ring - 1)) || 717 - (a.used_user_addr & (sizeof *vq->used->ring - 1)) || 718 - (a.log_guest_addr & (sizeof *vq->used->ring - 1))) { 716 + 717 + /* Make sure it's safe to cast pointers to vring types. */ 718 + BUILD_BUG_ON(__alignof__ *vq->avail > VRING_AVAIL_ALIGN_SIZE); 719 + BUILD_BUG_ON(__alignof__ *vq->used > VRING_USED_ALIGN_SIZE); 720 + if ((a.avail_user_addr & (VRING_AVAIL_ALIGN_SIZE - 1)) || 721 + (a.used_user_addr & (VRING_USED_ALIGN_SIZE - 1)) || 722 + (a.log_guest_addr & (sizeof(u64) - 1))) { 719 723 r = -EINVAL; 720 724 break; 721 725 }
+3 -2
drivers/video/fbdev/core/fb_defio.c
··· 83 83 cancel_delayed_work_sync(&info->deferred_work); 84 84 85 85 /* Run it immediately */ 86 - err = schedule_delayed_work(&info->deferred_work, 0); 86 + schedule_delayed_work(&info->deferred_work, 0); 87 87 mutex_unlock(&inode->i_mutex); 88 - return err; 88 + 89 + return 0; 89 90 } 90 91 EXPORT_SYMBOL_GPL(fb_deferred_io_fsync); 91 92
-2
drivers/video/fbdev/omap2/dss/hdmi_pll.c
··· 132 132 .mX_max = 127, 133 133 .fint_min = 500000, 134 134 .fint_max = 2500000, 135 - .clkdco_max = 1800000000, 136 135 137 136 .clkdco_min = 500000000, 138 137 .clkdco_low = 1000000000, ··· 155 156 .mX_max = 127, 156 157 .fint_min = 620000, 157 158 .fint_max = 2500000, 158 - .clkdco_max = 1800000000, 159 159 160 160 .clkdco_min = 750000000, 161 161 .clkdco_low = 1500000000,
+2 -1
drivers/video/fbdev/omap2/dss/pll.c
··· 97 97 return 0; 98 98 99 99 err_enable: 100 - regulator_disable(pll->regulator); 100 + if (pll->regulator) 101 + regulator_disable(pll->regulator); 101 102 err_reg: 102 103 clk_disable_unprepare(pll->clkin); 103 104 return r;
+2
drivers/video/fbdev/omap2/dss/sdi.c
··· 342 342 out->output_type = OMAP_DISPLAY_TYPE_SDI; 343 343 out->name = "sdi.0"; 344 344 out->dispc_channel = OMAP_DSS_CHANNEL_LCD; 345 + /* We have SDI only on OMAP3, where it's on port 1 */ 346 + out->port_num = 1; 345 347 out->ops.sdi = &sdi_ops; 346 348 out->owner = THIS_MODULE; 347 349
+16 -1
drivers/video/logo/logo.c
··· 21 21 module_param(nologo, bool, 0); 22 22 MODULE_PARM_DESC(nologo, "Disables startup logo"); 23 23 24 + /* 25 + * Logos are located in the initdata, and will be freed in kernel_init. 26 + * Use late_init to mark the logos as freed to prevent any further use. 27 + */ 28 + 29 + static bool logos_freed; 30 + 31 + static int __init fb_logo_late_init(void) 32 + { 33 + logos_freed = true; 34 + return 0; 35 + } 36 + 37 + late_initcall(fb_logo_late_init); 38 + 24 39 /* logo's are marked __initdata. Use __init_refok to tell 25 40 * modpost that it is intended that this function uses data 26 41 * marked __initdata. ··· 44 29 { 45 30 const struct linux_logo *logo = NULL; 46 31 47 - if (nologo) 32 + if (nologo || logos_freed) 48 33 return NULL; 49 34 50 35 if (depth >= 1) {
+2 -2
fs/ext4/extents.c
··· 5166 5166 5167 5167 /* fallback to generic here if not in extents fmt */ 5168 5168 if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) 5169 - return __generic_block_fiemap(inode, fieinfo, start, len, 5170 - ext4_get_block); 5169 + return generic_block_fiemap(inode, fieinfo, start, len, 5170 + ext4_get_block); 5171 5171 5172 5172 if (fiemap_check_flags(fieinfo, EXT4_FIEMAP_FLAGS)) 5173 5173 return -EBADR;
+116 -108
fs/ext4/file.c
··· 273 273 * we determine this extent as a data or a hole according to whether the 274 274 * page cache has data or not. 275 275 */ 276 - static int ext4_find_unwritten_pgoff(struct inode *inode, int whence, 277 - loff_t endoff, loff_t *offset) 276 + static int ext4_find_unwritten_pgoff(struct inode *inode, 277 + int whence, 278 + struct ext4_map_blocks *map, 279 + loff_t *offset) 278 280 { 279 281 struct pagevec pvec; 282 + unsigned int blkbits; 280 283 pgoff_t index; 281 284 pgoff_t end; 285 + loff_t endoff; 282 286 loff_t startoff; 283 287 loff_t lastoff; 284 288 int found = 0; 285 289 290 + blkbits = inode->i_sb->s_blocksize_bits; 286 291 startoff = *offset; 287 292 lastoff = startoff; 288 - 293 + endoff = (loff_t)(map->m_lblk + map->m_len) << blkbits; 289 294 290 295 index = startoff >> PAGE_CACHE_SHIFT; 291 296 end = endoff >> PAGE_CACHE_SHIFT; ··· 408 403 static loff_t ext4_seek_data(struct file *file, loff_t offset, loff_t maxsize) 409 404 { 410 405 struct inode *inode = file->f_mapping->host; 411 - struct fiemap_extent_info fie; 412 - struct fiemap_extent ext[2]; 413 - loff_t next; 414 - int i, ret = 0; 406 + struct ext4_map_blocks map; 407 + struct extent_status es; 408 + ext4_lblk_t start, last, end; 409 + loff_t dataoff, isize; 410 + int blkbits; 411 + int ret = 0; 415 412 416 413 mutex_lock(&inode->i_mutex); 417 - if (offset >= inode->i_size) { 414 + 415 + isize = i_size_read(inode); 416 + if (offset >= isize) { 418 417 mutex_unlock(&inode->i_mutex); 419 418 return -ENXIO; 420 419 } 421 - fie.fi_flags = 0; 422 - fie.fi_extents_max = 2; 423 - fie.fi_extents_start = (struct fiemap_extent __user *) &ext; 424 - while (1) { 425 - mm_segment_t old_fs = get_fs(); 426 420 427 - fie.fi_extents_mapped = 0; 428 - memset(ext, 0, sizeof(*ext) * fie.fi_extents_max); 421 + blkbits = inode->i_sb->s_blocksize_bits; 422 + start = offset >> blkbits; 423 + last = start; 424 + end = isize >> blkbits; 425 + dataoff = offset; 429 426 430 - set_fs(get_ds()); 431 - ret = ext4_fiemap(inode, &fie, offset, maxsize - offset); 432 - set_fs(old_fs); 433 - if (ret) 434 - break; 435 - 436 - /* No extents found, EOF */ 437 - if (!fie.fi_extents_mapped) { 438 - ret = -ENXIO; 427 + do { 428 + map.m_lblk = last; 429 + map.m_len = end - last + 1; 430 + ret = ext4_map_blocks(NULL, inode, &map, 0); 431 + if (ret > 0 && !(map.m_flags & EXT4_MAP_UNWRITTEN)) { 432 + if (last != start) 433 + dataoff = (loff_t)last << blkbits; 439 434 break; 440 435 } 441 - for (i = 0; i < fie.fi_extents_mapped; i++) { 442 - next = (loff_t)(ext[i].fe_length + ext[i].fe_logical); 443 436 444 - if (offset < (loff_t)ext[i].fe_logical) 445 - offset = (loff_t)ext[i].fe_logical; 446 - /* 447 - * If extent is not unwritten, then it contains valid 448 - * data, mapped or delayed. 449 - */ 450 - if (!(ext[i].fe_flags & FIEMAP_EXTENT_UNWRITTEN)) 451 - goto out; 452 - 453 - /* 454 - * If there is a unwritten extent at this offset, 455 - * it will be as a data or a hole according to page 456 - * cache that has data or not. 457 - */ 458 - if (ext4_find_unwritten_pgoff(inode, SEEK_DATA, 459 - next, &offset)) 460 - goto out; 461 - 462 - if (ext[i].fe_flags & FIEMAP_EXTENT_LAST) { 463 - ret = -ENXIO; 464 - goto out; 465 - } 466 - offset = next; 437 + /* 438 + * If there is a delay extent at this offset, 439 + * it will be as a data. 440 + */ 441 + ext4_es_find_delayed_extent_range(inode, last, last, &es); 442 + if (es.es_len != 0 && in_range(last, es.es_lblk, es.es_len)) { 443 + if (last != start) 444 + dataoff = (loff_t)last << blkbits; 445 + break; 467 446 } 468 - } 469 - if (offset > inode->i_size) 470 - offset = inode->i_size; 471 - out: 447 + 448 + /* 449 + * If there is a unwritten extent at this offset, 450 + * it will be as a data or a hole according to page 451 + * cache that has data or not. 452 + */ 453 + if (map.m_flags & EXT4_MAP_UNWRITTEN) { 454 + int unwritten; 455 + unwritten = ext4_find_unwritten_pgoff(inode, SEEK_DATA, 456 + &map, &dataoff); 457 + if (unwritten) 458 + break; 459 + } 460 + 461 + last++; 462 + dataoff = (loff_t)last << blkbits; 463 + } while (last <= end); 464 + 472 465 mutex_unlock(&inode->i_mutex); 473 - if (ret) 474 - return ret; 475 466 476 - return vfs_setpos(file, offset, maxsize); 467 + if (dataoff > isize) 468 + return -ENXIO; 469 + 470 + return vfs_setpos(file, dataoff, maxsize); 477 471 } 478 472 479 473 /* 480 - * ext4_seek_hole() retrieves the offset for SEEK_HOLE 474 + * ext4_seek_hole() retrieves the offset for SEEK_HOLE. 481 475 */ 482 476 static loff_t ext4_seek_hole(struct file *file, loff_t offset, loff_t maxsize) 483 477 { 484 478 struct inode *inode = file->f_mapping->host; 485 - struct fiemap_extent_info fie; 486 - struct fiemap_extent ext[2]; 487 - loff_t next; 488 - int i, ret = 0; 479 + struct ext4_map_blocks map; 480 + struct extent_status es; 481 + ext4_lblk_t start, last, end; 482 + loff_t holeoff, isize; 483 + int blkbits; 484 + int ret = 0; 489 485 490 486 mutex_lock(&inode->i_mutex); 491 - if (offset >= inode->i_size) { 487 + 488 + isize = i_size_read(inode); 489 + if (offset >= isize) { 492 490 mutex_unlock(&inode->i_mutex); 493 491 return -ENXIO; 494 492 } 495 493 496 - fie.fi_flags = 0; 497 - fie.fi_extents_max = 2; 498 - fie.fi_extents_start = (struct fiemap_extent __user *)&ext; 499 - while (1) { 500 - mm_segment_t old_fs = get_fs(); 494 + blkbits = inode->i_sb->s_blocksize_bits; 495 + start = offset >> blkbits; 496 + last = start; 497 + end = isize >> blkbits; 498 + holeoff = offset; 501 499 502 - fie.fi_extents_mapped = 0; 503 - memset(ext, 0, sizeof(*ext)); 500 + do { 501 + map.m_lblk = last; 502 + map.m_len = end - last + 1; 503 + ret = ext4_map_blocks(NULL, inode, &map, 0); 504 + if (ret > 0 && !(map.m_flags & EXT4_MAP_UNWRITTEN)) { 505 + last += ret; 506 + holeoff = (loff_t)last << blkbits; 507 + continue; 508 + } 504 509 505 - set_fs(get_ds()); 506 - ret = ext4_fiemap(inode, &fie, offset, maxsize - offset); 507 - set_fs(old_fs); 508 - if (ret) 509 - break; 510 + /* 511 + * If there is a delay extent at this offset, 512 + * we will skip this extent. 513 + */ 514 + ext4_es_find_delayed_extent_range(inode, last, last, &es); 515 + if (es.es_len != 0 && in_range(last, es.es_lblk, es.es_len)) { 516 + last = es.es_lblk + es.es_len; 517 + holeoff = (loff_t)last << blkbits; 518 + continue; 519 + } 510 520 511 - /* No extents found */ 512 - if (!fie.fi_extents_mapped) 513 - break; 514 - 515 - for (i = 0; i < fie.fi_extents_mapped; i++) { 516 - next = (loff_t)(ext[i].fe_logical + ext[i].fe_length); 517 - /* 518 - * If extent is not unwritten, then it contains valid 519 - * data, mapped or delayed. 520 - */ 521 - if (!(ext[i].fe_flags & FIEMAP_EXTENT_UNWRITTEN)) { 522 - if (offset < (loff_t)ext[i].fe_logical) 523 - goto out; 524 - offset = next; 521 + /* 522 + * If there is a unwritten extent at this offset, 523 + * it will be as a data or a hole according to page 524 + * cache that has data or not. 525 + */ 526 + if (map.m_flags & EXT4_MAP_UNWRITTEN) { 527 + int unwritten; 528 + unwritten = ext4_find_unwritten_pgoff(inode, SEEK_HOLE, 529 + &map, &holeoff); 530 + if (!unwritten) { 531 + last += ret; 532 + holeoff = (loff_t)last << blkbits; 525 533 continue; 526 534 } 527 - /* 528 - * If there is a unwritten extent at this offset, 529 - * it will be as a data or a hole according to page 530 - * cache that has data or not. 531 - */ 532 - if (ext4_find_unwritten_pgoff(inode, SEEK_HOLE, 533 - next, &offset)) 534 - goto out; 535 - 536 - offset = next; 537 - if (ext[i].fe_flags & FIEMAP_EXTENT_LAST) 538 - goto out; 539 535 } 540 - } 541 - if (offset > inode->i_size) 542 - offset = inode->i_size; 543 - out: 544 - mutex_unlock(&inode->i_mutex); 545 - if (ret) 546 - return ret; 547 536 548 - return vfs_setpos(file, offset, maxsize); 537 + /* find a hole */ 538 + break; 539 + } while (last <= end); 540 + 541 + mutex_unlock(&inode->i_mutex); 542 + 543 + if (holeoff > isize) 544 + holeoff = isize; 545 + 546 + return vfs_setpos(file, holeoff, maxsize); 549 547 } 550 548 551 549 /*
+12 -12
fs/ext4/resize.c
··· 24 24 return -EPERM; 25 25 26 26 /* 27 + * If we are not using the primary superblock/GDT copy don't resize, 28 + * because the user tools have no way of handling this. Probably a 29 + * bad time to do it anyways. 30 + */ 31 + if (EXT4_SB(sb)->s_sbh->b_blocknr != 32 + le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block)) { 33 + ext4_warning(sb, "won't resize using backup superblock at %llu", 34 + (unsigned long long)EXT4_SB(sb)->s_sbh->b_blocknr); 35 + return -EPERM; 36 + } 37 + 38 + /* 27 39 * We are not allowed to do online-resizing on a filesystem mounted 28 40 * with error, because it can destroy the filesystem easily. 29 41 */ ··· 769 757 printk(KERN_DEBUG 770 758 "EXT4-fs: ext4_add_new_gdb: adding group block %lu\n", 771 759 gdb_num); 772 - 773 - /* 774 - * If we are not using the primary superblock/GDT copy don't resize, 775 - * because the user tools have no way of handling this. Probably a 776 - * bad time to do it anyways. 777 - */ 778 - if (EXT4_SB(sb)->s_sbh->b_blocknr != 779 - le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block)) { 780 - ext4_warning(sb, "won't resize using backup superblock at %llu", 781 - (unsigned long long)EXT4_SB(sb)->s_sbh->b_blocknr); 782 - return -EPERM; 783 - } 784 760 785 761 gdb_bh = sb_bread(sb, gdblock); 786 762 if (!gdb_bh)
+1 -1
fs/ext4/super.c
··· 3482 3482 if (EXT4_HAS_RO_COMPAT_FEATURE(sb, 3483 3483 EXT4_FEATURE_RO_COMPAT_METADATA_CSUM) && 3484 3484 EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) 3485 - ext4_warning(sb, KERN_INFO "metadata_csum and uninit_bg are " 3485 + ext4_warning(sb, "metadata_csum and uninit_bg are " 3486 3486 "redundant flags; please run fsck."); 3487 3487 3488 3488 /* Check for a known checksum algorithm */
+2 -20
include/linux/mfd/stmpe.h
··· 50 50 STMPE_IDX_GPEDR_MSB, 51 51 STMPE_IDX_GPRER_LSB, 52 52 STMPE_IDX_GPFER_LSB, 53 + STMPE_IDX_GPPUR_LSB, 54 + STMPE_IDX_GPPDR_LSB, 53 55 STMPE_IDX_GPAFR_U_MSB, 54 56 STMPE_IDX_IEGPIOR_LSB, 55 57 STMPE_IDX_ISGPIOR_LSB, ··· 114 112 enum stmpe_block block); 115 113 extern int stmpe_enable(struct stmpe *stmpe, unsigned int blocks); 116 114 extern int stmpe_disable(struct stmpe *stmpe, unsigned int blocks); 117 - 118 - struct matrix_keymap_data; 119 - 120 - /** 121 - * struct stmpe_keypad_platform_data - STMPE keypad platform data 122 - * @keymap_data: key map table and size 123 - * @debounce_ms: debounce interval, in ms. Maximum is 124 - * %STMPE_KEYPAD_MAX_DEBOUNCE. 125 - * @scan_count: number of key scanning cycles to confirm key data. 126 - * Maximum is %STMPE_KEYPAD_MAX_SCAN_COUNT. 127 - * @no_autorepeat: disable key autorepeat 128 - */ 129 - struct stmpe_keypad_platform_data { 130 - const struct matrix_keymap_data *keymap_data; 131 - unsigned int debounce_ms; 132 - unsigned int scan_count; 133 - bool no_autorepeat; 134 - }; 135 115 136 116 #define STMPE_GPIO_NOREQ_811_TOUCH (0xf0) 137 117 ··· 183 199 * @irq_gpio: gpio number over which irq will be requested (significant only if 184 200 * irq_over_gpio is true) 185 201 * @gpio: GPIO-specific platform data 186 - * @keypad: keypad-specific platform data 187 202 * @ts: touchscreen-specific platform data 188 203 */ 189 204 struct stmpe_platform_data { ··· 195 212 int autosleep_timeout; 196 213 197 214 struct stmpe_gpio_platform_data *gpio; 198 - struct stmpe_keypad_platform_data *keypad; 199 215 struct stmpe_ts_platform_data *ts; 200 216 }; 201 217
+1 -1
include/linux/mm.h
··· 1952 1952 #if VM_GROWSUP 1953 1953 extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); 1954 1954 #else 1955 - #define expand_upwards(vma, address) do { } while (0) 1955 + #define expand_upwards(vma, address) (0) 1956 1956 #endif 1957 1957 1958 1958 /* Look up the first VMA which satisfies addr < vm_end, NULL if none. */
+2 -5
include/net/mac80211.h
··· 1270 1270 * 1271 1271 * @IEEE80211_KEY_FLAG_GENERATE_IV: This flag should be set by the 1272 1272 * driver to indicate that it requires IV generation for this 1273 - * particular key. Setting this flag does not necessarily mean that SKBs 1274 - * will have sufficient tailroom for ICV or MIC. 1273 + * particular key. 1275 1274 * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by 1276 1275 * the driver for a TKIP key if it requires Michael MIC 1277 1276 * generation in software. ··· 1282 1283 * @IEEE80211_KEY_FLAG_PUT_IV_SPACE: This flag should be set by the driver 1283 1284 * if space should be prepared for the IV, but the IV 1284 1285 * itself should not be generated. Do not set together with 1285 - * @IEEE80211_KEY_FLAG_GENERATE_IV on the same key. Setting this flag does 1286 - * not necessarily mean that SKBs will have sufficient tailroom for ICV or 1287 - * MIC. 1286 + * @IEEE80211_KEY_FLAG_GENERATE_IV on the same key. 1288 1287 * @IEEE80211_KEY_FLAG_RX_MGMT: This key will be used to decrypt received 1289 1288 * management frames. The flag can help drivers that have a hardware 1290 1289 * crypto implementation that doesn't deal with management frames
+5 -5
include/sound/pcm.h
··· 857 857 } 858 858 859 859 /** 860 - * params_channels - Get the sample rate from the hw params 860 + * params_rate - Get the sample rate from the hw params 861 861 * @p: hw params 862 862 */ 863 863 static inline unsigned int params_rate(const struct snd_pcm_hw_params *p) ··· 866 866 } 867 867 868 868 /** 869 - * params_channels - Get the period size (in frames) from the hw params 869 + * params_period_size - Get the period size (in frames) from the hw params 870 870 * @p: hw params 871 871 */ 872 872 static inline unsigned int params_period_size(const struct snd_pcm_hw_params *p) ··· 875 875 } 876 876 877 877 /** 878 - * params_channels - Get the number of periods from the hw params 878 + * params_periods - Get the number of periods from the hw params 879 879 * @p: hw params 880 880 */ 881 881 static inline unsigned int params_periods(const struct snd_pcm_hw_params *p) ··· 884 884 } 885 885 886 886 /** 887 - * params_channels - Get the buffer size (in frames) from the hw params 887 + * params_buffer_size - Get the buffer size (in frames) from the hw params 888 888 * @p: hw params 889 889 */ 890 890 static inline unsigned int params_buffer_size(const struct snd_pcm_hw_params *p) ··· 893 893 } 894 894 895 895 /** 896 - * params_channels - Get the buffer size (in bytes) from the hw params 896 + * params_buffer_bytes - Get the buffer size (in bytes) from the hw params 897 897 * @p: hw params 898 898 */ 899 899 static inline unsigned int params_buffer_bytes(const struct snd_pcm_hw_params *p)
+7
include/uapi/linux/virtio_ring.h
··· 101 101 struct vring_used *used; 102 102 }; 103 103 104 + /* Alignment requirements for vring elements. 105 + * When using pre-virtio 1.0 layout, these fall out naturally. 106 + */ 107 + #define VRING_AVAIL_ALIGN_SIZE 2 108 + #define VRING_USED_ALIGN_SIZE 4 109 + #define VRING_DESC_ALIGN_SIZE 16 110 + 104 111 /* The standard layout for the ring is a continuous chunk of memory which looks 105 112 * like this. We assume num is a power of 2. 106 113 *
+40 -9
kernel/auditsc.c
··· 72 72 #include <linux/fs_struct.h> 73 73 #include <linux/compat.h> 74 74 #include <linux/ctype.h> 75 + #include <linux/string.h> 76 + #include <uapi/linux/limits.h> 75 77 76 78 #include "audit.h" 77 79 ··· 1863 1861 } 1864 1862 1865 1863 list_for_each_entry_reverse(n, &context->names_list, list) { 1866 - /* does the name pointer match? */ 1867 - if (!n->name || n->name->name != name->name) 1864 + if (!n->name || strcmp(n->name->name, name->name)) 1868 1865 continue; 1869 1866 1870 1867 /* match the correct record type */ ··· 1882 1881 n = audit_alloc_name(context, AUDIT_TYPE_UNKNOWN); 1883 1882 if (!n) 1884 1883 return; 1885 - if (name) 1886 - /* since name is not NULL we know there is already a matching 1887 - * name record, see audit_getname(), so there must be a type 1888 - * mismatch; reuse the string path since the original name 1889 - * record will keep the string valid until we free it in 1890 - * audit_free_names() */ 1891 - n->name = name; 1884 + /* unfortunately, while we may have a path name to record with the 1885 + * inode, we can't always rely on the string lasting until the end of 1886 + * the syscall so we need to create our own copy, it may fail due to 1887 + * memory allocation issues, but we do our best */ 1888 + if (name) { 1889 + /* we can't use getname_kernel() due to size limits */ 1890 + size_t len = strlen(name->name) + 1; 1891 + struct filename *new = __getname(); 1892 1892 1893 + if (unlikely(!new)) 1894 + goto out; 1895 + 1896 + if (len <= (PATH_MAX - sizeof(*new))) { 1897 + new->name = (char *)(new) + sizeof(*new); 1898 + new->separate = false; 1899 + } else if (len <= PATH_MAX) { 1900 + /* this looks odd, but is due to final_putname() */ 1901 + struct filename *new2; 1902 + 1903 + new2 = kmalloc(sizeof(*new2), GFP_KERNEL); 1904 + if (unlikely(!new2)) { 1905 + __putname(new); 1906 + goto out; 1907 + } 1908 + new2->name = (char *)new; 1909 + new2->separate = true; 1910 + new = new2; 1911 + } else { 1912 + /* we should never get here, but let's be safe */ 1913 + __putname(new); 1914 + goto out; 1915 + } 1916 + strlcpy((char *)new->name, name->name, len); 1917 + new->uptr = NULL; 1918 + new->aname = n; 1919 + n->name = new; 1920 + n->name_put = true; 1921 + } 1893 1922 out: 1894 1923 if (parent) { 1895 1924 n->name_len = n->name ? parent_len(n->name->name) : AUDIT_NAME_FULL;
+2 -2
mm/memory.c
··· 2593 2593 if (prev && prev->vm_end == address) 2594 2594 return prev->vm_flags & VM_GROWSDOWN ? 0 : -ENOMEM; 2595 2595 2596 - expand_downwards(vma, address - PAGE_SIZE); 2596 + return expand_downwards(vma, address - PAGE_SIZE); 2597 2597 } 2598 2598 if ((vma->vm_flags & VM_GROWSUP) && address + PAGE_SIZE == vma->vm_end) { 2599 2599 struct vm_area_struct *next = vma->vm_next; ··· 2602 2602 if (next && next->vm_start == address + PAGE_SIZE) 2603 2603 return next->vm_flags & VM_GROWSUP ? 0 : -ENOMEM; 2604 2604 2605 - expand_upwards(vma, address + PAGE_SIZE); 2605 + return expand_upwards(vma, address + PAGE_SIZE); 2606 2606 } 2607 2607 return 0; 2608 2608 }
+7 -4
net/batman-adv/multicast.c
··· 685 685 if (orig_initialized) 686 686 atomic_dec(&bat_priv->mcast.num_disabled); 687 687 orig->capabilities |= BATADV_ORIG_CAPA_HAS_MCAST; 688 - /* If mcast support is being switched off increase the disabled 689 - * mcast node counter. 688 + /* If mcast support is being switched off or if this is an initial 689 + * OGM without mcast support then increase the disabled mcast 690 + * node counter. 690 691 */ 691 692 } else if (!orig_mcast_enabled && 692 - orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST) { 693 + (orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST || 694 + !orig_initialized)) { 693 695 atomic_inc(&bat_priv->mcast.num_disabled); 694 696 orig->capabilities &= ~BATADV_ORIG_CAPA_HAS_MCAST; 695 697 } ··· 740 738 { 741 739 struct batadv_priv *bat_priv = orig->bat_priv; 742 740 743 - if (!(orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST)) 741 + if (!(orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST) && 742 + orig->capa_initialized & BATADV_ORIG_CAPA_HAS_MCAST) 744 743 atomic_dec(&bat_priv->mcast.num_disabled); 745 744 746 745 batadv_mcast_want_unsnoop_update(bat_priv, orig, BATADV_NO_FLAGS);
+1 -1
net/batman-adv/network-coding.c
··· 133 133 if (!bat_priv->nc.decoding_hash) 134 134 goto err; 135 135 136 - batadv_hash_set_lock_class(bat_priv->nc.coding_hash, 136 + batadv_hash_set_lock_class(bat_priv->nc.decoding_hash, 137 137 &batadv_nc_decoding_hash_lock_class_key); 138 138 139 139 INIT_DELAYED_WORK(&bat_priv->nc.work, batadv_nc_worker);
+4 -3
net/batman-adv/originator.c
··· 570 570 571 571 batadv_frag_purge_orig(orig_node, NULL); 572 572 573 - batadv_tt_global_del_orig(orig_node->bat_priv, orig_node, -1, 574 - "originator timed out"); 575 - 576 573 if (orig_node->bat_priv->bat_algo_ops->bat_orig_free) 577 574 orig_node->bat_priv->bat_algo_ops->bat_orig_free(orig_node); 578 575 ··· 675 678 atomic_set(&orig_node->last_ttvn, 0); 676 679 orig_node->tt_buff = NULL; 677 680 orig_node->tt_buff_len = 0; 681 + orig_node->last_seen = jiffies; 678 682 reset_time = jiffies - 1 - msecs_to_jiffies(BATADV_RESET_PROTECTION_MS); 679 683 orig_node->bcast_seqno_reset = reset_time; 680 684 #ifdef CONFIG_BATMAN_ADV_MCAST ··· 975 977 if (batadv_purge_orig_node(bat_priv, orig_node)) { 976 978 batadv_gw_node_delete(bat_priv, orig_node); 977 979 hlist_del_rcu(&orig_node->hash_entry); 980 + batadv_tt_global_del_orig(orig_node->bat_priv, 981 + orig_node, -1, 982 + "originator timed out"); 978 983 batadv_orig_node_free_ref(orig_node); 979 984 continue; 980 985 }
+4 -2
net/batman-adv/routing.c
··· 443 443 444 444 router = batadv_orig_router_get(orig_node, recv_if); 445 445 446 + if (!router) 447 + return router; 448 + 446 449 /* only consider bonding for recv_if == BATADV_IF_DEFAULT (first hop) 447 450 * and if activated. 448 451 */ 449 - if (recv_if == BATADV_IF_DEFAULT || !atomic_read(&bat_priv->bonding) || 450 - !router) 452 + if (!(recv_if == BATADV_IF_DEFAULT && atomic_read(&bat_priv->bonding))) 451 453 return router; 452 454 453 455 /* bonding: loop through the list of possible routers found
+2 -2
net/ipv4/tcp_output.c
··· 2019 2019 if (unlikely(!tcp_snd_wnd_test(tp, skb, mss_now))) 2020 2020 break; 2021 2021 2022 - if (tso_segs == 1) { 2022 + if (tso_segs == 1 || !max_segs) { 2023 2023 if (unlikely(!tcp_nagle_test(tp, skb, mss_now, 2024 2024 (tcp_skb_is_last(sk, skb) ? 2025 2025 nonagle : TCP_NAGLE_PUSH)))) ··· 2032 2032 } 2033 2033 2034 2034 limit = mss_now; 2035 - if (tso_segs > 1 && !tcp_urg_mode(tp)) 2035 + if (tso_segs > 1 && max_segs && !tcp_urg_mode(tp)) 2036 2036 limit = tcp_mss_split_point(sk, skb, mss_now, 2037 2037 min_t(unsigned int, 2038 2038 cwnd_quota,
+9 -3
net/mac80211/key.c
··· 140 140 if (!ret) { 141 141 key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE; 142 142 143 - if (!(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC)) 143 + if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) || 144 + (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) || 145 + (key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE))) 144 146 sdata->crypto_tx_tailroom_needed_cnt--; 145 147 146 148 WARN_ON((key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE) && ··· 190 188 sta = key->sta; 191 189 sdata = key->sdata; 192 190 193 - if (!(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC)) 191 + if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) || 192 + (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) || 193 + (key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE))) 194 194 increment_tailroom_need_count(sdata); 195 195 196 196 ret = drv_set_key(key->local, DISABLE_KEY, sdata, ··· 888 884 if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) { 889 885 key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; 890 886 891 - if (!(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC)) 887 + if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) || 888 + (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) || 889 + (key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE))) 892 890 increment_tailroom_need_count(key->sdata); 893 891 } 894 892
+3 -2
net/openvswitch/flow.c
··· 70 70 { 71 71 struct flow_stats *stats; 72 72 int node = numa_node_id(); 73 + int len = skb->len + (vlan_tx_tag_present(skb) ? VLAN_HLEN : 0); 73 74 74 75 stats = rcu_dereference(flow->stats[node]); 75 76 ··· 106 105 if (likely(new_stats)) { 107 106 new_stats->used = jiffies; 108 107 new_stats->packet_count = 1; 109 - new_stats->byte_count = skb->len; 108 + new_stats->byte_count = len; 110 109 new_stats->tcp_flags = tcp_flags; 111 110 spin_lock_init(&new_stats->lock); 112 111 ··· 121 120 122 121 stats->used = jiffies; 123 122 stats->packet_count++; 124 - stats->byte_count += skb->len; 123 + stats->byte_count += len; 125 124 stats->tcp_flags |= tcp_flags; 126 125 unlock: 127 126 spin_unlock(&stats->lock);
+1 -1
net/openvswitch/vport.c
··· 480 480 stats = this_cpu_ptr(vport->percpu_stats); 481 481 u64_stats_update_begin(&stats->syncp); 482 482 stats->rx_packets++; 483 - stats->rx_bytes += skb->len; 483 + stats->rx_bytes += skb->len + (vlan_tx_tag_present(skb) ? VLAN_HLEN : 0); 484 484 u64_stats_update_end(&stats->syncp); 485 485 486 486 OVS_CB(skb)->input_vport = vport;
+1 -1
net/wireless/Kconfig
··· 175 175 Most distributions have a CRDA package. So if unsure, say N. 176 176 177 177 config CFG80211_WEXT 178 - bool 178 + bool "cfg80211 wireless extensions compatibility" 179 179 depends on CFG80211 180 180 select WEXT_CORE 181 181 help
+5 -4
sound/soc/codecs/rt5677.c
··· 784 784 static int rt5677_dsp_vad_get(struct snd_kcontrol *kcontrol, 785 785 struct snd_ctl_elem_value *ucontrol) 786 786 { 787 - struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 788 - struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec); 787 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 788 + struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component); 789 789 790 790 ucontrol->value.integer.value[0] = rt5677->dsp_vad_en; 791 791 ··· 795 795 static int rt5677_dsp_vad_put(struct snd_kcontrol *kcontrol, 796 796 struct snd_ctl_elem_value *ucontrol) 797 797 { 798 - struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 799 - struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec); 798 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 799 + struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component); 800 + struct snd_soc_codec *codec = snd_soc_component_to_codec(component); 800 801 801 802 rt5677->dsp_vad_en = !!ucontrol->value.integer.value[0]; 802 803
+30 -19
sound/soc/dwc/designware_i2s.c
··· 209 209 210 210 switch (config->chan_nr) { 211 211 case EIGHT_CHANNEL_SUPPORT: 212 - ch_reg = 3; 213 - break; 214 212 case SIX_CHANNEL_SUPPORT: 215 - ch_reg = 2; 216 - break; 217 213 case FOUR_CHANNEL_SUPPORT: 218 - ch_reg = 1; 219 - break; 220 214 case TWO_CHANNEL_SUPPORT: 221 - ch_reg = 0; 222 215 break; 223 216 default: 224 217 dev_err(dev->dev, "channel not supported\n"); ··· 220 227 221 228 i2s_disable_channels(dev, substream->stream); 222 229 223 - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 224 - i2s_write_reg(dev->i2s_base, TCR(ch_reg), xfer_resolution); 225 - i2s_write_reg(dev->i2s_base, TFCR(ch_reg), 0x02); 226 - irq = i2s_read_reg(dev->i2s_base, IMR(ch_reg)); 227 - i2s_write_reg(dev->i2s_base, IMR(ch_reg), irq & ~0x30); 228 - i2s_write_reg(dev->i2s_base, TER(ch_reg), 1); 229 - } else { 230 - i2s_write_reg(dev->i2s_base, RCR(ch_reg), xfer_resolution); 231 - i2s_write_reg(dev->i2s_base, RFCR(ch_reg), 0x07); 232 - irq = i2s_read_reg(dev->i2s_base, IMR(ch_reg)); 233 - i2s_write_reg(dev->i2s_base, IMR(ch_reg), irq & ~0x03); 234 - i2s_write_reg(dev->i2s_base, RER(ch_reg), 1); 230 + for (ch_reg = 0; ch_reg < (config->chan_nr / 2); ch_reg++) { 231 + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 232 + i2s_write_reg(dev->i2s_base, TCR(ch_reg), 233 + xfer_resolution); 234 + i2s_write_reg(dev->i2s_base, TFCR(ch_reg), 0x02); 235 + irq = i2s_read_reg(dev->i2s_base, IMR(ch_reg)); 236 + i2s_write_reg(dev->i2s_base, IMR(ch_reg), irq & ~0x30); 237 + i2s_write_reg(dev->i2s_base, TER(ch_reg), 1); 238 + } else { 239 + i2s_write_reg(dev->i2s_base, RCR(ch_reg), 240 + xfer_resolution); 241 + i2s_write_reg(dev->i2s_base, RFCR(ch_reg), 0x07); 242 + irq = i2s_read_reg(dev->i2s_base, IMR(ch_reg)); 243 + i2s_write_reg(dev->i2s_base, IMR(ch_reg), irq & ~0x03); 244 + i2s_write_reg(dev->i2s_base, RER(ch_reg), 1); 245 + } 235 246 } 236 247 237 248 i2s_write_reg(dev->i2s_base, CCR, ccr); ··· 258 261 struct snd_soc_dai *dai) 259 262 { 260 263 snd_soc_dai_set_dma_data(dai, substream, NULL); 264 + } 265 + 266 + static int dw_i2s_prepare(struct snd_pcm_substream *substream, 267 + struct snd_soc_dai *dai) 268 + { 269 + struct dw_i2s_dev *dev = snd_soc_dai_get_drvdata(dai); 270 + 271 + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 272 + i2s_write_reg(dev->i2s_base, TXFFR, 1); 273 + else 274 + i2s_write_reg(dev->i2s_base, RXFFR, 1); 275 + 276 + return 0; 261 277 } 262 278 263 279 static int dw_i2s_trigger(struct snd_pcm_substream *substream, ··· 304 294 .startup = dw_i2s_startup, 305 295 .shutdown = dw_i2s_shutdown, 306 296 .hw_params = dw_i2s_hw_params, 297 + .prepare = dw_i2s_prepare, 307 298 .trigger = dw_i2s_trigger, 308 299 }; 309 300
+2 -2
sound/soc/intel/Kconfig
··· 89 89 90 90 config SND_SOC_INTEL_BYTCR_RT5640_MACH 91 91 tristate "ASoC Audio DSP Support for MID BYT Platform" 92 - depends on X86 92 + depends on X86 && I2C 93 93 select SND_SOC_RT5640 94 94 select SND_SST_MFLD_PLATFORM 95 95 select SND_SST_IPC_ACPI ··· 101 101 102 102 config SND_SOC_INTEL_CHT_BSW_RT5672_MACH 103 103 tristate "ASoC Audio driver for Intel Cherrytrail & Braswell with RT5672 codec" 104 - depends on X86_INTEL_LPSS 104 + depends on X86_INTEL_LPSS && I2C 105 105 select SND_SOC_RT5670 106 106 select SND_SST_MFLD_PLATFORM 107 107 select SND_SST_IPC_ACPI
+1 -1
sound/soc/intel/bytcr_dpcm_rt5640.c
··· 227 227 MODULE_DESCRIPTION("ASoC Intel(R) Baytrail CR Machine driver"); 228 228 MODULE_AUTHOR("Subhransu S. Prusty <subhransu.s.prusty@intel.com>"); 229 229 MODULE_LICENSE("GPL v2"); 230 - MODULE_ALIAS("platform:bytrt5640-audio"); 230 + MODULE_ALIAS("platform:bytt100_rt5640");
+5 -1
sound/soc/intel/sst-firmware.c
··· 763 763 /* does block span more than 1 section */ 764 764 if (ba->offset >= block->offset && ba->offset < block_end) { 765 765 766 + /* add block */ 767 + list_move(&block->list, &dsp->used_block_list); 768 + list_add(&block->module_list, block_list); 766 769 /* align ba to block boundary */ 767 - ba->offset = block->offset; 770 + ba->size -= block_end - ba->offset; 771 + ba->offset = block_end; 768 772 769 773 err = block_alloc_contiguous(dsp, ba, block_list); 770 774 if (err < 0)
+1 -1
sound/soc/intel/sst/sst_acpi.c
··· 343 343 } 344 344 345 345 static struct sst_machines sst_acpi_bytcr[] = { 346 - {"10EC5640", "T100", "bytt100_rt5640", NULL, "fw_sst_0f28.bin", 346 + {"10EC5640", "T100", "bytt100_rt5640", NULL, "intel/fw_sst_0f28.bin", 347 347 &byt_rvp_platform_data }, 348 348 {}, 349 349 };
+2 -2
sound/soc/rockchip/rockchip_i2s.c
··· 454 454 455 455 i2s->playback_dma_data.addr = res->start + I2S_TXDR; 456 456 i2s->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 457 - i2s->playback_dma_data.maxburst = 16; 457 + i2s->playback_dma_data.maxburst = 4; 458 458 459 459 i2s->capture_dma_data.addr = res->start + I2S_RXDR; 460 460 i2s->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 461 - i2s->capture_dma_data.maxburst = 16; 461 + i2s->capture_dma_data.maxburst = 4; 462 462 463 463 i2s->dev = &pdev->dev; 464 464 dev_set_drvdata(&pdev->dev, i2s);
+1 -1
sound/soc/rockchip/rockchip_i2s.h
··· 127 127 #define I2S_DMACR_TDE_DISABLE (0 << I2S_DMACR_TDE_SHIFT) 128 128 #define I2S_DMACR_TDE_ENABLE (1 << I2S_DMACR_TDE_SHIFT) 129 129 #define I2S_DMACR_TDL_SHIFT 0 130 - #define I2S_DMACR_TDL(x) ((x - 1) << I2S_DMACR_TDL_SHIFT) 130 + #define I2S_DMACR_TDL(x) ((x) << I2S_DMACR_TDL_SHIFT) 131 131 #define I2S_DMACR_TDL_MASK (0x1f << I2S_DMACR_TDL_SHIFT) 132 132 133 133 /*
+5 -9
sound/soc/soc-core.c
··· 3230 3230 const char *propname) 3231 3231 { 3232 3232 struct device_node *np = card->dev->of_node; 3233 - int num_routes, old_routes; 3233 + int num_routes; 3234 3234 struct snd_soc_dapm_route *routes; 3235 3235 int i, ret; 3236 3236 ··· 3248 3248 return -EINVAL; 3249 3249 } 3250 3250 3251 - old_routes = card->num_dapm_routes; 3252 - routes = devm_kzalloc(card->dev, 3253 - (old_routes + num_routes) * sizeof(*routes), 3251 + routes = devm_kzalloc(card->dev, num_routes * sizeof(*routes), 3254 3252 GFP_KERNEL); 3255 3253 if (!routes) { 3256 3254 dev_err(card->dev, ··· 3256 3258 return -EINVAL; 3257 3259 } 3258 3260 3259 - memcpy(routes, card->dapm_routes, old_routes * sizeof(*routes)); 3260 - 3261 3261 for (i = 0; i < num_routes; i++) { 3262 3262 ret = of_property_read_string_index(np, propname, 3263 - 2 * i, &routes[old_routes + i].sink); 3263 + 2 * i, &routes[i].sink); 3264 3264 if (ret) { 3265 3265 dev_err(card->dev, 3266 3266 "ASoC: Property '%s' index %d could not be read: %d\n", ··· 3266 3270 return -EINVAL; 3267 3271 } 3268 3272 ret = of_property_read_string_index(np, propname, 3269 - (2 * i) + 1, &routes[old_routes + i].source); 3273 + (2 * i) + 1, &routes[i].source); 3270 3274 if (ret) { 3271 3275 dev_err(card->dev, 3272 3276 "ASoC: Property '%s' index %d could not be read: %d\n", ··· 3275 3279 } 3276 3280 } 3277 3281 3278 - card->num_dapm_routes += num_routes; 3282 + card->num_dapm_routes = num_routes; 3279 3283 card->dapm_routes = routes; 3280 3284 3281 3285 return 0;