* acpi-hotplug: ACPI / hotplug: Generate online uevents for ACPI containers * acpi-scan: ACPI / scan: Correct error return value of create_modalias() * acpi-lpss: ACPI / platform / LPSS: disable async suspend/resume of LPSS devices * acpi-gpio: gpio / ACPI: Use pin index and bit length ACPICA: Update to GPIO region handler interface. * acpi-video: ACPI / video: disable native backlight for ThinkPad X201s
Unified · Split
| @@ -11,10 +11,6 @@ Required properties: · 10 unmodified lines | ||
| 11 | 11 | |
| 12 | 12 | Optional properties for main touchpad device: |
| 13 | 13 | |
| 14 | −- linux,gpio-keymap: An array of up to 4 entries indicating the Linux | |
| 15 | − keycode generated by each GPIO. Linux keycodes are defined in | |
| 16 | − <dt-bindings/input/input.h>. | |
| 17 | − | |
| 18 | 14 | - linux,gpio-keymap: When enabled, the SPT_GPIOPWN_T19 object sends messages |
| 19 | 15 | on GPIO bit changes. An array of up to 8 entries can be provided |
| 20 | 16 | indicating the Linux keycode mapped to each bit of the status byte, |
| @@ -31,7 +31,7 @@ i2s@ff890000 { · 30 unmodified lines | ||
| 31 | 31 | #address-cells = <1>; |
| 32 | 32 | #size-cells = <0>; |
| 33 | 33 | dmas = <&pdma1 0>, <&pdma1 1>; |
| 34 | − dma-names = "rx", "tx"; | |
| 34 | + dma-names = "tx", "rx"; | |
| 35 | 35 | clock-names = "i2s_hclk", "i2s_clk"; |
| 36 | 36 | clocks = <&cru HCLK_I2S0>, <&cru SCLK_I2S0>; |
| 37 | 37 | }; |
| @@ -16,11 +16,15 @@ Required Properties: · 15 unmodified lines | ||
| 16 | 16 | - clocks: Must contain an entry for each entry in clock-names. |
| 17 | 17 | - clock-names: Shall be "spiclk" for the transfer-clock, and "apb_pclk" for |
| 18 | 18 | the peripheral clock. |
| 19 | +- #address-cells: should be 1. | |
| 20 | +- #size-cells: should be 0. | |
| 21 | + | |
| 22 | +Optional Properties: | |
| 23 | + | |
| 19 | 24 | - dmas: DMA specifiers for tx and rx dma. See the DMA client binding, |
| 20 | 25 | Documentation/devicetree/bindings/dma/dma.txt |
| 21 | 26 | - dma-names: DMA request names should include "tx" and "rx" if present. |
| 22 | −- #address-cells: should be 1. | |
| 23 | −- #size-cells: should be 0. | |
| 27 | + | |
| 24 | 28 | |
| 25 | 29 | Example: |
| 26 | 30 | |
| @@ -6876,7 +6876,7 @@ F: arch/x86/kernel/quirks.c · 6875 unmodified lines | ||
| 6876 | 6876 | |
| 6877 | 6877 | PCI DRIVER FOR IMX6 |
| 6878 | 6878 | M: Richard Zhu <r65037@freescale.com> |
| 6879 | −M: Shawn Guo <shawn.guo@freescale.com> | |
| 6879 | +M: Lucas Stach <l.stach@pengutronix.de> | |
| 6880 | 6880 | L: linux-pci@vger.kernel.org |
| 6881 | 6881 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
| 6882 | 6882 | S: Maintained |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | VERSION = 3 |
| 2 | 2 | PATCHLEVEL = 17 |
| 3 | 3 | SUBLEVEL = 0 |
| 4 | −EXTRAVERSION = -rc5 | |
| 4 | +EXTRAVERSION = -rc6 | |
| 5 | 5 | NAME = Shuffling Zombie Juror |
| 6 | 6 | |
| 7 | 7 | # *DOCUMENTATION* |
| @@ -1,6 +1,9 @@ | ||
| 1 | 1 | #ifndef __ASMARM_TLS_H |
| 2 | 2 | #define __ASMARM_TLS_H |
| 3 | 3 | |
| 4 | +#include <linux/compiler.h> | |
| 5 | +#include <asm/thread_info.h> | |
| 6 | + | |
| 4 | 7 | #ifdef __ASSEMBLY__ |
| 5 | 8 | #include <asm/asm-offsets.h> |
| 6 | 9 | .macro switch_tls_none, base, tp, tpuser, tmp1, tmp2 |
| @@ -50,6 +53,47 @@ · 43 unmodified lines | ||
| 50 | 53 | #endif |
| 51 | 54 | |
| 52 | 55 | #ifndef __ASSEMBLY__ |
| 56 | + | |
| 57 | +static inline void set_tls(unsigned long val) | |
| 58 | +{ | |
| 59 | + struct thread_info *thread; | |
| 60 | + | |
| 61 | + thread = current_thread_info(); | |
| 62 | + | |
| 63 | + thread->tp_value[0] = val; | |
| 64 | + | |
| 65 | + /* | |
| 66 | + * This code runs with preemption enabled and therefore must | |
| 67 | + * be reentrant with respect to switch_tls. | |
| 68 | + * | |
| 69 | + * We need to ensure ordering between the shadow state and the | |
| 70 | + * hardware state, so that we don't corrupt the hardware state | |
| 71 | + * with a stale shadow state during context switch. | |
| 72 | + * | |
| 73 | + * If we're preempted here, switch_tls will load TPIDRURO from | |
| 74 | + * thread_info upon resuming execution and the following mcr | |
| 75 | + * is merely redundant. | |
| 76 | + */ | |
| 77 | + barrier(); | |
| 78 | + | |
| 79 | + if (!tls_emu) { | |
| 80 | + if (has_tls_reg) { | |
| 81 | + asm("mcr p15, 0, %0, c13, c0, 3" | |
| 82 | + : : "r" (val)); | |
| 83 | + } else { | |
| 84 | + /* | |
| 85 | + * User space must never try to access this | |
| 86 | + * directly. Expect your app to break | |
| 87 | + * eventually if you do so. The user helper | |
| 88 | + * at 0xffff0fe0 must be used instead. (see | |
| 89 | + * entry-armv.S for details) | |
| 90 | + */ | |
| 91 | + *((unsigned int *)0xffff0ff0) = val; | |
| 92 | + } | |
| 93 | + | |
| 94 | + } | |
| 95 | +} | |
| 96 | + | |
| 53 | 97 | static inline unsigned long get_tpuser(void) |
| 54 | 98 | { |
| 55 | 99 | unsigned long reg = 0; |
| @@ -59,5 +103,23 @@ static inline unsigned long get_tpuser(void) · 3 unmodified lines | ||
| 59 | 103 | |
| 60 | 104 | return reg; |
| 61 | 105 | } |
| 106 | + | |
| 107 | +static inline void set_tpuser(unsigned long val) | |
| 108 | +{ | |
| 109 | + /* Since TPIDRURW is fully context-switched (unlike TPIDRURO), | |
| 110 | + * we need not update thread_info. | |
| 111 | + */ | |
| 112 | + if (has_tls_reg && !tls_emu) { | |
| 113 | + asm("mcr p15, 0, %0, c13, c0, 2" | |
| 114 | + : : "r" (val)); | |
| 115 | + } | |
| 116 | +} | |
| 117 | + | |
| 118 | +static inline void flush_tls(void) | |
| 119 | +{ | |
| 120 | + set_tls(0); | |
| 121 | + set_tpuser(0); | |
| 122 | +} | |
| 123 | + | |
| 62 | 124 | #endif |
| 63 | 125 | #endif /* __ASMARM_TLS_H */ |
| @@ -107,8 +107,11 @@ static inline void set_fs(mm_segment_t fs) · 106 unmodified lines | ||
| 107 | 107 | extern int __get_user_1(void *); |
| 108 | 108 | extern int __get_user_2(void *); |
| 109 | 109 | extern int __get_user_4(void *); |
| 110 | −extern int __get_user_lo8(void *); | |
| 110 | +extern int __get_user_32t_8(void *); | |
| 111 | 111 | extern int __get_user_8(void *); |
| 112 | +extern int __get_user_64t_1(void *); | |
| 113 | +extern int __get_user_64t_2(void *); | |
| 114 | +extern int __get_user_64t_4(void *); | |
| 112 | 115 | |
| 113 | 116 | #define __GUP_CLOBBER_1 "lr", "cc" |
| 114 | 117 | #ifdef CONFIG_CPU_USE_DOMAINS |
| @@ -117,7 +120,7 @@ extern int __get_user_8(void *); · 2 unmodified lines | ||
| 117 | 120 | #define __GUP_CLOBBER_2 "lr", "cc" |
| 118 | 121 | #endif |
| 119 | 122 | #define __GUP_CLOBBER_4 "lr", "cc" |
| 120 | −#define __GUP_CLOBBER_lo8 "lr", "cc" | |
| 123 | +#define __GUP_CLOBBER_32t_8 "lr", "cc" | |
| 121 | 124 | #define __GUP_CLOBBER_8 "lr", "cc" |
| 122 | 125 | |
| 123 | 126 | #define __get_user_x(__r2,__p,__e,__l,__s) \ |
| @@ -131,12 +134,30 @@ extern int __get_user_8(void *); · 7 unmodified lines | ||
| 131 | 134 | |
| 132 | 135 | /* narrowing a double-word get into a single 32bit word register: */ |
| 133 | 136 | #ifdef __ARMEB__ |
| 134 | −#define __get_user_xb(__r2, __p, __e, __l, __s) \ | |
| 135 | − __get_user_x(__r2, __p, __e, __l, lo8) | |
| 137 | +#define __get_user_x_32t(__r2, __p, __e, __l, __s) \ | |
| 138 | + __get_user_x(__r2, __p, __e, __l, 32t_8) | |
| 136 | 139 | #else |
| 137 | −#define __get_user_xb __get_user_x | |
| 140 | +#define __get_user_x_32t __get_user_x | |
| 138 | 141 | #endif |
| 139 | 142 | |
| 143 | +/* | |
| 144 | + * storing result into proper least significant word of 64bit target var, | |
| 145 | + * different only for big endian case where 64 bit __r2 lsw is r3: | |
| 146 | + */ | |
| 147 | +#ifdef __ARMEB__ | |
| 148 | +#define __get_user_x_64t(__r2, __p, __e, __l, __s) \ | |
| 149 | + __asm__ __volatile__ ( \ | |
| 150 | + __asmeq("%0", "r0") __asmeq("%1", "r2") \ | |
| 151 | + __asmeq("%3", "r1") \ | |
| 152 | + "bl __get_user_64t_" #__s \ | |
| 153 | + : "=&r" (__e), "=r" (__r2) \ | |
| 154 | + : "0" (__p), "r" (__l) \ | |
| 155 | + : __GUP_CLOBBER_##__s) | |
| 156 | +#else | |
| 157 | +#define __get_user_x_64t __get_user_x | |
| 158 | +#endif | |
| 159 | + | |
| 160 | + | |
| 140 | 161 | #define __get_user_check(x,p) \ |
| 141 | 162 | ({ \ |
| 142 | 163 | unsigned long __limit = current_thread_info()->addr_limit - 1; \ |
| @@ -146,17 +167,26 @@ extern int __get_user_8(void *); · 3 unmodified lines | ||
| 146 | 167 | register int __e asm("r0"); \ |
| 147 | 168 | switch (sizeof(*(__p))) { \ |
| 148 | 169 | case 1: \ |
| 149 | − __get_user_x(__r2, __p, __e, __l, 1); \ | |
| 170 | + if (sizeof((x)) >= 8) \ | |
| 171 | + __get_user_x_64t(__r2, __p, __e, __l, 1); \ | |
| 172 | + else \ | |
| 173 | + __get_user_x(__r2, __p, __e, __l, 1); \ | |
| 150 | 174 | break; \ |
| 151 | 175 | case 2: \ |
| 152 | − __get_user_x(__r2, __p, __e, __l, 2); \ | |
| 176 | + if (sizeof((x)) >= 8) \ | |
| 177 | + __get_user_x_64t(__r2, __p, __e, __l, 2); \ | |
| 178 | + else \ | |
| 179 | + __get_user_x(__r2, __p, __e, __l, 2); \ | |
| 153 | 180 | break; \ |
| 154 | 181 | case 4: \ |
| 155 | − __get_user_x(__r2, __p, __e, __l, 4); \ | |
| 182 | + if (sizeof((x)) >= 8) \ | |
| 183 | + __get_user_x_64t(__r2, __p, __e, __l, 4); \ | |
| 184 | + else \ | |
| 185 | + __get_user_x(__r2, __p, __e, __l, 4); \ | |
| 156 | 186 | break; \ |
| 157 | 187 | case 8: \ |
| 158 | 188 | if (sizeof((x)) < 8) \ |
| 159 | − __get_user_xb(__r2, __p, __e, __l, 4); \ | |
| 189 | + __get_user_x_32t(__r2, __p, __e, __l, 4); \ | |
| 160 | 190 | else \ |
| 161 | 191 | __get_user_x(__r2, __p, __e, __l, 8); \ |
| 162 | 192 | break; \ |
| @@ -98,6 +98,14 @@ EXPORT_SYMBOL(__clear_user); · 97 unmodified lines | ||
| 98 | 98 | EXPORT_SYMBOL(__get_user_1); |
| 99 | 99 | EXPORT_SYMBOL(__get_user_2); |
| 100 | 100 | EXPORT_SYMBOL(__get_user_4); |
| 101 | +EXPORT_SYMBOL(__get_user_8); | |
| 102 | + | |
| 103 | +#ifdef __ARMEB__ | |
| 104 | +EXPORT_SYMBOL(__get_user_64t_1); | |
| 105 | +EXPORT_SYMBOL(__get_user_64t_2); | |
| 106 | +EXPORT_SYMBOL(__get_user_64t_4); | |
| 107 | +EXPORT_SYMBOL(__get_user_32t_8); | |
| 108 | +#endif | |
| 101 | 109 | |
| 102 | 110 | EXPORT_SYMBOL(__put_user_1); |
| 103 | 111 | EXPORT_SYMBOL(__put_user_2); |
| @@ -175,7 +175,7 @@ static bool migrate_one_irq(struct irq_desc *desc) · 174 unmodified lines | ||
| 175 | 175 | c = irq_data_get_irq_chip(d); |
| 176 | 176 | if (!c->irq_set_affinity) |
| 177 | 177 | pr_debug("IRQ%u: unable to set affinity\n", d->irq); |
| 178 | − else if (c->irq_set_affinity(d, affinity, true) == IRQ_SET_MASK_OK && ret) | |
| 178 | + else if (c->irq_set_affinity(d, affinity, false) == IRQ_SET_MASK_OK && ret) | |
| 179 | 179 | cpumask_copy(d->affinity, affinity); |
| 180 | 180 | |
| 181 | 181 | return ret; |
| @@ -76,21 +76,15 @@ static struct pmu_hw_events *cpu_pmu_get_cpu_events(void) · 75 unmodified lines | ||
| 76 | 76 | |
| 77 | 77 | static void cpu_pmu_enable_percpu_irq(void *data) |
| 78 | 78 | { |
| 79 | − struct arm_pmu *cpu_pmu = data; | |
| 80 | − struct platform_device *pmu_device = cpu_pmu->plat_device; | |
| 81 | − int irq = platform_get_irq(pmu_device, 0); | |
| 79 | + int irq = *(int *)data; | |
| 82 | 80 | |
| 83 | 81 | enable_percpu_irq(irq, IRQ_TYPE_NONE); |
| 84 | − cpumask_set_cpu(smp_processor_id(), &cpu_pmu->active_irqs); | |
| 85 | 82 | } |
| 86 | 83 | |
| 87 | 84 | static void cpu_pmu_disable_percpu_irq(void *data) |
| 88 | 85 | { |
| 89 | − struct arm_pmu *cpu_pmu = data; | |
| 90 | − struct platform_device *pmu_device = cpu_pmu->plat_device; | |
| 91 | − int irq = platform_get_irq(pmu_device, 0); | |
| 86 | + int irq = *(int *)data; | |
| 92 | 87 | |
| 93 | − cpumask_clear_cpu(smp_processor_id(), &cpu_pmu->active_irqs); | |
| 94 | 88 | disable_percpu_irq(irq); |
| 95 | 89 | } |
| 96 | 90 | |
| @@ -103,7 +97,7 @@ static void cpu_pmu_free_irq(struct arm_pmu *cpu_pmu) · 6 unmodified lines | ||
| 103 | 97 | |
| 104 | 98 | irq = platform_get_irq(pmu_device, 0); |
| 105 | 99 | if (irq >= 0 && irq_is_percpu(irq)) { |
| 106 | − on_each_cpu(cpu_pmu_disable_percpu_irq, cpu_pmu, 1); | |
| 100 | + on_each_cpu(cpu_pmu_disable_percpu_irq, &irq, 1); | |
| 107 | 101 | free_percpu_irq(irq, &percpu_pmu); |
| 108 | 102 | } else { |
| 109 | 103 | for (i = 0; i < irqs; ++i) { |
| @@ -138,7 +132,7 @@ static int cpu_pmu_request_irq(struct arm_pmu *cpu_pmu, irq_handler_t handler) · 28 unmodified lines | ||
| 138 | 132 | irq); |
| 139 | 133 | return err; |
| 140 | 134 | } |
| 141 | − on_each_cpu(cpu_pmu_enable_percpu_irq, cpu_pmu, 1); | |
| 135 | + on_each_cpu(cpu_pmu_enable_percpu_irq, &irq, 1); | |
| 142 | 136 | } else { |
| 143 | 137 | for (i = 0; i < irqs; ++i) { |
| 144 | 138 | err = 0; |
| @@ -334,6 +334,8 @@ void flush_thread(void) · 333 unmodified lines | ||
| 334 | 334 | memset(&tsk->thread.debug, 0, sizeof(struct debug_info)); |
| 335 | 335 | memset(&thread->fpstate, 0, sizeof(union fp_state)); |
| 336 | 336 | |
| 337 | + flush_tls(); | |
| 338 | + | |
| 337 | 339 | thread_notify(THREAD_NOTIFY_FLUSH, thread); |
| 338 | 340 | } |
| 339 | 341 | |
| @@ -142,14 +142,6 @@ static int emulate_swpX(unsigned int address, unsigned int *data, · 141 unmodified lines | ||
| 142 | 142 | while (1) { |
| 143 | 143 | unsigned long temp; |
| 144 | 144 | |
| 145 | − /* | |
| 146 | − * Barrier required between accessing protected resource and | |
| 147 | − * releasing a lock for it. Legacy code might not have done | |
| 148 | − * this, and we cannot determine that this is not the case | |
| 149 | − * being emulated, so insert always. | |
| 150 | − */ | |
| 151 | − smp_mb(); | |
| 152 | − | |
| 153 | 145 | if (type == TYPE_SWPB) |
| 154 | 146 | __user_swpb_asm(*data, address, res, temp); |
| 155 | 147 | else |
| @@ -162,13 +154,6 @@ static int emulate_swpX(unsigned int address, unsigned int *data, · 6 unmodified lines | ||
| 162 | 154 | } |
| 163 | 155 | |
| 164 | 156 | if (res == 0) { |
| 165 | − /* | |
| 166 | − * Barrier also required between acquiring a lock for a | |
| 167 | − * protected resource and accessing the resource. Inserted for | |
| 168 | − * same reason as above. | |
| 169 | − */ | |
| 170 | − smp_mb(); | |
| 171 | − | |
| 172 | 157 | if (type == TYPE_SWPB) |
| 173 | 158 | swpbcounter++; |
| 174 | 159 | else |
| @@ -45,7 +45,7 @@ static int thumbee_notifier(struct notifier_block *self, unsigned long cmd, void · 44 unmodified lines | ||
| 45 | 45 | |
| 46 | 46 | switch (cmd) { |
| 47 | 47 | case THREAD_NOTIFY_FLUSH: |
| 48 | − thread->thumbee_state = 0; | |
| 48 | + teehbr_write(0); | |
| 49 | 49 | break; |
| 50 | 50 | case THREAD_NOTIFY_SWITCH: |
| 51 | 51 | current_thread_info()->thumbee_state = teehbr_read(); |
| @@ -581,7 +581,6 @@ do_cache_op(unsigned long start, unsigned long end, int flags) · 580 unmodified lines | ||
| 581 | 581 | #define NR(x) ((__ARM_NR_##x) - __ARM_NR_BASE) |
| 582 | 582 | asmlinkage int arm_syscall(int no, struct pt_regs *regs) |
| 583 | 583 | { |
| 584 | − struct thread_info *thread = current_thread_info(); | |
| 585 | 584 | siginfo_t info; |
| 586 | 585 | |
| 587 | 586 | if ((no >> 16) != (__ARM_NR_BASE>> 16)) |
| @@ -632,21 +631,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs) · 44 unmodified lines | ||
| 632 | 631 | return regs->ARM_r0; |
| 633 | 632 | |
| 634 | 633 | case NR(set_tls): |
| 635 | − thread->tp_value[0] = regs->ARM_r0; | |
| 636 | − if (tls_emu) | |
| 637 | − return 0; | |
| 638 | − if (has_tls_reg) { | |
| 639 | − asm ("mcr p15, 0, %0, c13, c0, 3" | |
| 640 | − : : "r" (regs->ARM_r0)); | |
| 641 | − } else { | |
| 642 | − /* | |
| 643 | − * User space must never try to access this directly. | |
| 644 | − * Expect your app to break eventually if you do so. | |
| 645 | − * The user helper at 0xffff0fe0 must be used instead. | |
| 646 | − * (see entry-armv.S for details) | |
| 647 | − */ | |
| 648 | − *((unsigned int *)0xffff0ff0) = regs->ARM_r0; | |
| 649 | − } | |
| 634 | + set_tls(regs->ARM_r0); | |
| 650 | 635 | return 0; |
| 651 | 636 | |
| 652 | 637 | #ifdef CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG |
| @@ -80,7 +80,7 @@ ENTRY(__get_user_8) · 79 unmodified lines | ||
| 80 | 80 | ENDPROC(__get_user_8) |
| 81 | 81 | |
| 82 | 82 | #ifdef __ARMEB__ |
| 83 | −ENTRY(__get_user_lo8) | |
| 83 | +ENTRY(__get_user_32t_8) | |
| 84 | 84 | check_uaccess r0, 8, r1, r2, __get_user_bad |
| 85 | 85 | #ifdef CONFIG_CPU_USE_DOMAINS |
| 86 | 86 | add r0, r0, #4 |
| @@ -90,7 +90,37 @@ ENTRY(__get_user_lo8) · 3 unmodified lines | ||
| 90 | 90 | #endif |
| 91 | 91 | mov r0, #0 |
| 92 | 92 | ret lr |
| 93 | −ENDPROC(__get_user_lo8) | |
| 93 | +ENDPROC(__get_user_32t_8) | |
| 94 | + | |
| 95 | +ENTRY(__get_user_64t_1) | |
| 96 | + check_uaccess r0, 1, r1, r2, __get_user_bad8 | |
| 97 | +8: TUSER(ldrb) r3, [r0] | |
| 98 | + mov r0, #0 | |
| 99 | + ret lr | |
| 100 | +ENDPROC(__get_user_64t_1) | |
| 101 | + | |
| 102 | +ENTRY(__get_user_64t_2) | |
| 103 | + check_uaccess r0, 2, r1, r2, __get_user_bad8 | |
| 104 | +#ifdef CONFIG_CPU_USE_DOMAINS | |
| 105 | +rb .req ip | |
| 106 | +9: ldrbt r3, [r0], #1 | |
| 107 | +10: ldrbt rb, [r0], #0 | |
| 108 | +#else | |
| 109 | +rb .req r0 | |
| 110 | +9: ldrb r3, [r0] | |
| 111 | +10: ldrb rb, [r0, #1] | |
| 112 | +#endif | |
| 113 | + orr r3, rb, r3, lsl #8 | |
| 114 | + mov r0, #0 | |
| 115 | + ret lr | |
| 116 | +ENDPROC(__get_user_64t_2) | |
| 117 | + | |
| 118 | +ENTRY(__get_user_64t_4) | |
| 119 | + check_uaccess r0, 4, r1, r2, __get_user_bad8 | |
| 120 | +11: TUSER(ldr) r3, [r0] | |
| 121 | + mov r0, #0 | |
| 122 | + ret lr | |
| 123 | +ENDPROC(__get_user_64t_4) | |
| 94 | 124 | #endif |
| 95 | 125 | |
| 96 | 126 | __get_user_bad8: |
| @@ -111,5 +141,9 @@ ENDPROC(__get_user_bad8) · 14 unmodified lines | ||
| 111 | 141 | .long 6b, __get_user_bad8 |
| 112 | 142 | #ifdef __ARMEB__ |
| 113 | 143 | .long 7b, __get_user_bad |
| 144 | + .long 8b, __get_user_bad8 | |
| 145 | + .long 9b, __get_user_bad8 | |
| 146 | + .long 10b, __get_user_bad8 | |
| 147 | + .long 11b, __get_user_bad8 | |
| 114 | 148 | #endif |
| 115 | 149 | .popsection |
| @@ -146,7 +146,6 @@ ENDPROC(cpu_v7_set_pte_ext) · 145 unmodified lines | ||
| 146 | 146 | mov \tmp, \ttbr1, lsr #(32 - ARCH_PGD_SHIFT) @ upper bits |
| 147 | 147 | mov \ttbr1, \ttbr1, lsl #ARCH_PGD_SHIFT @ lower bits |
| 148 | 148 | addls \ttbr1, \ttbr1, #TTBR1_OFFSET |
| 149 | − adcls \tmp, \tmp, #0 | |
| 150 | 149 | mcrr p15, 1, \ttbr1, \tmp, c2 @ load TTBR1 |
| 151 | 150 | mov \tmp, \ttbr0, lsr #(32 - ARCH_PGD_SHIFT) @ upper bits |
| 152 | 151 | mov \ttbr0, \ttbr0, lsl #ARCH_PGD_SHIFT @ lower bits |
| @@ -149,8 +149,7 @@ void __init arm64_memblock_init(void) · 148 unmodified lines | ||
| 149 | 149 | memblock_reserve(__virt_to_phys(initrd_start), initrd_end - initrd_start); |
| 150 | 150 | #endif |
| 151 | 151 | |
| 152 | − if (!efi_enabled(EFI_MEMMAP)) | |
| 153 | − early_init_fdt_scan_reserved_mem(); | |
| 152 | + early_init_fdt_scan_reserved_mem(); | |
| 154 | 153 | |
| 155 | 154 | /* 4GB maximum for 32-bit only capable devices */ |
| 156 | 155 | if (IS_ENABLED(CONFIG_ZONE_DMA)) |
| @@ -329,6 +329,6 @@ · 328 unmodified lines | ||
| 329 | 329 | #define __NR_sched_getattr 1337 |
| 330 | 330 | #define __NR_renameat2 1338 |
| 331 | 331 | #define __NR_getrandom 1339 |
| 332 | −#define __NR_memfd_create 1339 | |
| 332 | +#define __NR_memfd_create 1340 | |
| 333 | 333 | |
| 334 | 334 | #endif /* _UAPI_ASM_IA64_UNISTD_H */ |
| @@ -38,27 +38,6 @@ static void pci_fixup_video(struct pci_dev *pdev) · 37 unmodified lines | ||
| 38 | 38 | return; |
| 39 | 39 | /* Maybe, this machine supports legacy memory map. */ |
| 40 | 40 | |
| 41 | − if (!vga_default_device()) { | |
| 42 | − resource_size_t start, end; | |
| 43 | − int i; | |
| 44 | − | |
| 45 | − /* Does firmware framebuffer belong to us? */ | |
| 46 | − for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { | |
| 47 | − if (!(pci_resource_flags(pdev, i) & IORESOURCE_MEM)) | |
| 48 | − continue; | |
| 49 | − | |
| 50 | − start = pci_resource_start(pdev, i); | |
| 51 | − end = pci_resource_end(pdev, i); | |
| 52 | − | |
| 53 | − if (!start || !end) | |
| 54 | − continue; | |
| 55 | − | |
| 56 | − if (screen_info.lfb_base >= start && | |
| 57 | − (screen_info.lfb_base + screen_info.lfb_size) < end) | |
| 58 | − vga_set_default_device(pdev); | |
| 59 | − } | |
| 60 | − } | |
| 61 | − | |
| 62 | 41 | /* Is VGA routed to us? */ |
| 63 | 42 | bus = pdev->bus; |
| 64 | 43 | while (bus) { |
| @@ -83,8 +62,7 @@ static void pci_fixup_video(struct pci_dev *pdev) · 18 unmodified lines | ||
| 83 | 62 | pci_read_config_word(pdev, PCI_COMMAND, &config); |
| 84 | 63 | if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { |
| 85 | 64 | pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW; |
| 86 | − dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n"); | |
| 87 | − vga_set_default_device(pdev); | |
| 65 | + dev_printk(KERN_DEBUG, &pdev->dev, "Video device with shadowed ROM\n"); | |
| 88 | 66 | } |
| 89 | 67 | } |
| 90 | 68 | } |
| @@ -546,6 +546,7 @@ config SGI_IP28 · 545 unmodified lines | ||
| 546 | 546 | # select SYS_HAS_EARLY_PRINTK |
| 547 | 547 | select SYS_SUPPORTS_64BIT_KERNEL |
| 548 | 548 | select SYS_SUPPORTS_BIG_ENDIAN |
| 549 | + select MIPS_L1_CACHE_SHIFT_7 | |
| 549 | 550 | help |
| 550 | 551 | This is the SGI Indigo2 with R10000 processor. To compile a Linux |
| 551 | 552 | kernel that runs on these, say Y here. |
| @@ -2029,7 +2030,9 @@ config MIPS_CMP · 1477 unmodified lines | ||
| 2029 | 2030 | bool "MIPS CMP framework support (DEPRECATED)" |
| 2030 | 2031 | depends on SYS_SUPPORTS_MIPS_CMP |
| 2031 | 2032 | select MIPS_GIC_IPI |
| 2033 | + select SMP | |
| 2032 | 2034 | select SYNC_R4K |
| 2035 | + select SYS_SUPPORTS_SMP | |
| 2033 | 2036 | select WEAK_ORDERING |
| 2034 | 2037 | default n |
| 2035 | 2038 | help |
| @@ -113,7 +113,16 @@ predef-le += -DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__ · 112 unmodified lines | ||
| 113 | 113 | cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(undef-all) $(predef-be)) |
| 114 | 114 | cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL $(undef-all) $(predef-le)) |
| 115 | 115 | |
| 116 | −cflags-$(CONFIG_CPU_HAS_SMARTMIPS) += $(call cc-option,-msmartmips) | |
| 116 | +# For smartmips configurations, there are hundreds of warnings due to ISA overrides | |
| 117 | +# in assembly and header files. smartmips is only supported for MIPS32r1 onwards | |
| 118 | +# and there is no support for 64-bit. Various '.set mips2' or '.set mips3' or | |
| 119 | +# similar directives in the kernel will spam the build logs with the following warnings: | |
| 120 | +# Warning: the `smartmips' extension requires MIPS32 revision 1 or greater | |
| 121 | +# or | |
| 122 | +# Warning: the 64-bit MIPS architecture does not support the `smartmips' extension | |
| 123 | +# Pass -Wa,--no-warn to disable all assembler warnings until the kernel code has | |
| 124 | +# been fixed properly. | |
| 125 | +cflags-$(CONFIG_CPU_HAS_SMARTMIPS) += $(call cc-option,-msmartmips) -Wa,--no-warn | |
| 117 | 126 | cflags-$(CONFIG_CPU_MICROMIPS) += $(call cc-option,-mmicromips) |
| 118 | 127 | |
| 119 | 128 | cflags-$(CONFIG_SB1XXX_CORELIS) += $(call cc-option,-mno-sched-prolog) \ |
| @@ -434,7 +434,7 @@ static void bcm63xx_init_irq(void) · 433 unmodified lines | ||
| 434 | 434 | irq_stat_addr[0] += PERF_IRQSTAT_3368_REG; |
| 435 | 435 | irq_mask_addr[0] += PERF_IRQMASK_3368_REG; |
| 436 | 436 | irq_stat_addr[1] = 0; |
| 437 | − irq_stat_addr[1] = 0; | |
| 437 | + irq_mask_addr[1] = 0; | |
| 438 | 438 | irq_bits = 32; |
| 439 | 439 | ext_irq_count = 4; |
| 440 | 440 | ext_irq_cfg_reg1 = PERF_EXTIRQ_CFG_REG_3368; |
| @@ -443,7 +443,7 @@ static void bcm63xx_init_irq(void) · 2 unmodified lines | ||
| 443 | 443 | irq_stat_addr[0] += PERF_IRQSTAT_6328_REG(0); |
| 444 | 444 | irq_mask_addr[0] += PERF_IRQMASK_6328_REG(0); |
| 445 | 445 | irq_stat_addr[1] += PERF_IRQSTAT_6328_REG(1); |
| 446 | − irq_stat_addr[1] += PERF_IRQMASK_6328_REG(1); | |
| 446 | + irq_mask_addr[1] += PERF_IRQMASK_6328_REG(1); | |
| 447 | 447 | irq_bits = 64; |
| 448 | 448 | ext_irq_count = 4; |
| 449 | 449 | is_ext_irq_cascaded = 1; |
| @@ -13,6 +13,7 @@ · 12 unmodified lines | ||
| 13 | 13 | |
| 14 | 14 | #include <linux/types.h> |
| 15 | 15 | #include <linux/kernel.h> |
| 16 | +#include <linux/string.h> | |
| 16 | 17 | |
| 17 | 18 | #include <asm/addrspace.h> |
| 18 | 19 | |
| @@ -16,8 +16,8 @@ · 15 unmodified lines | ||
| 16 | 16 | extern void octeon_cop2_save(struct octeon_cop2_state *); |
| 17 | 17 | extern void octeon_cop2_restore(struct octeon_cop2_state *); |
| 18 | 18 | |
| 19 | −#define cop2_save(r) octeon_cop2_save(r) | |
| 20 | −#define cop2_restore(r) octeon_cop2_restore(r) | |
| 19 | +#define cop2_save(r) octeon_cop2_save(&(r)->thread.cp2) | |
| 20 | +#define cop2_restore(r) octeon_cop2_restore(&(r)->thread.cp2) | |
| 21 | 21 | |
| 22 | 22 | #define cop2_present 1 |
| 23 | 23 | #define cop2_lazy_restore 1 |
| @@ -26,26 +26,26 @@ extern void octeon_cop2_restore(struct octeon_cop2_state *); · 2 unmodified lines | ||
| 26 | 26 | |
| 27 | 27 | extern void nlm_cop2_save(struct nlm_cop2_state *); |
| 28 | 28 | extern void nlm_cop2_restore(struct nlm_cop2_state *); |
| 29 | −#define cop2_save(r) nlm_cop2_save(r) | |
| 30 | −#define cop2_restore(r) nlm_cop2_restore(r) | |
| 29 | + | |
| 30 | +#define cop2_save(r) nlm_cop2_save(&(r)->thread.cp2) | |
| 31 | +#define cop2_restore(r) nlm_cop2_restore(&(r)->thread.cp2) | |
| 31 | 32 | |
| 32 | 33 | #define cop2_present 1 |
| 33 | 34 | #define cop2_lazy_restore 0 |
| 34 | 35 | |
| 35 | 36 | #elif defined(CONFIG_CPU_LOONGSON3) |
| 36 | 37 | |
| 37 | −#define cop2_save(r) | |
| 38 | −#define cop2_restore(r) | |
| 39 | − | |
| 40 | 38 | #define cop2_present 1 |
| 41 | 39 | #define cop2_lazy_restore 1 |
| 40 | +#define cop2_save(r) do { (r); } while (0) | |
| 41 | +#define cop2_restore(r) do { (r); } while (0) | |
| 42 | 42 | |
| 43 | 43 | #else |
| 44 | 44 | |
| 45 | 45 | #define cop2_present 0 |
| 46 | 46 | #define cop2_lazy_restore 0 |
| 47 | −#define cop2_save(r) | |
| 48 | −#define cop2_restore(r) | |
| 47 | +#define cop2_save(r) do { (r); } while (0) | |
| 48 | +#define cop2_restore(r) do { (r); } while (0) | |
| 49 | 49 | #endif |
| 50 | 50 | |
| 51 | 51 | enum cu2_ops { |
| @@ -11,15 +11,8 @@ · 10 unmodified lines | ||
| 11 | 11 | #ifndef _ASM_MACH_IP28_SPACES_H |
| 12 | 12 | #define _ASM_MACH_IP28_SPACES_H |
| 13 | 13 | |
| 14 | −#define CAC_BASE _AC(0xa800000000000000, UL) | |
| 15 | − | |
| 16 | −#define HIGHMEM_START (~0UL) | |
| 17 | − | |
| 18 | 14 | #define PHYS_OFFSET _AC(0x20000000, UL) |
| 19 | 15 | |
| 20 | −#define UNCAC_BASE _AC(0xc0000000, UL) /* 0xa0000000 + PHYS_OFFSET */ | |
| 21 | −#define IO_BASE UNCAC_BASE | |
| 22 | − | |
| 23 | 16 | #include <asm/mach-generic/spaces.h> |
| 24 | 17 | |
| 25 | 18 | #endif /* _ASM_MACH_IP28_SPACES_H */ |
| @@ -37,7 +37,7 @@ · 36 unmodified lines | ||
| 37 | 37 | |
| 38 | 38 | /* |
| 39 | 39 | * This is used for calculating the real page sizes |
| 40 | − * for FTLB or VTLB + FTLB confugrations. | |
| 40 | + * for FTLB or VTLB + FTLB configurations. | |
| 41 | 41 | */ |
| 42 | 42 | static inline unsigned int page_size_ftlb(unsigned int mmuextdef) |
| 43 | 43 | { |
| @@ -223,7 +223,8 @@ static inline int pfn_valid(unsigned long pfn) · 179 unmodified lines | ||
| 223 | 223 | |
| 224 | 224 | #endif |
| 225 | 225 | |
| 226 | −#define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys(kaddr))) | |
| 226 | +#define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys((void *) \ | |
| 227 | + (kaddr)))) | |
| 227 | 228 | |
| 228 | 229 | extern int __virt_addr_valid(const volatile void *kaddr); |
| 229 | 230 | #define virt_addr_valid(kaddr) \ |
| @@ -37,11 +37,6 @@ extern int __cpu_logical_map[NR_CPUS]; · 36 unmodified lines | ||
| 37 | 37 | |
| 38 | 38 | #define NO_PROC_ID (-1) |
| 39 | 39 | |
| 40 | −#define topology_physical_package_id(cpu) (cpu_data[cpu].package) | |
| 41 | −#define topology_core_id(cpu) (cpu_data[cpu].core) | |
| 42 | −#define topology_core_cpumask(cpu) (&cpu_core_map[cpu]) | |
| 43 | −#define topology_thread_cpumask(cpu) (&cpu_sibling_map[cpu]) | |
| 44 | − | |
| 45 | 40 | #define SMP_RESCHEDULE_YOURSELF 0x1 /* XXX braindead */ |
| 46 | 41 | #define SMP_CALL_FUNCTION 0x2 |
| 47 | 42 | /* Octeon - Tell another core to flush its icache */ |
| @@ -92,7 +92,7 @@ do { \ · 91 unmodified lines | ||
| 92 | 92 | KSTK_STATUS(prev) &= ~ST0_CU2; \ |
| 93 | 93 | __c0_stat = read_c0_status(); \ |
| 94 | 94 | write_c0_status(__c0_stat | ST0_CU2); \ |
| 95 | − cop2_save(&prev->thread.cp2); \ | |
| 95 | + cop2_save(prev); \ | |
| 96 | 96 | write_c0_status(__c0_stat & ~ST0_CU2); \ |
| 97 | 97 | } \ |
| 98 | 98 | __clear_software_ll_bit(); \ |
| @@ -111,7 +111,7 @@ do { \ · 12 unmodified lines | ||
| 111 | 111 | (KSTK_STATUS(current) & ST0_CU2)) { \ |
| 112 | 112 | __c0_stat = read_c0_status(); \ |
| 113 | 113 | write_c0_status(__c0_stat | ST0_CU2); \ |
| 114 | − cop2_restore(¤t->thread.cp2); \ | |
| 114 | + cop2_restore(current); \ | |
| 115 | 115 | write_c0_status(__c0_stat & ~ST0_CU2); \ |
| 116 | 116 | } \ |
| 117 | 117 | if (cpu_has_dsp) \ |
| @@ -9,5 +9,13 @@ · 8 unmodified lines | ||
| 9 | 9 | #define __ASM_TOPOLOGY_H |
| 10 | 10 | |
| 11 | 11 | #include <topology.h> |
| 12 | +#include <linux/smp.h> | |
| 13 | + | |
| 14 | +#ifdef CONFIG_SMP | |
| 15 | +#define topology_physical_package_id(cpu) (cpu_data[cpu].package) | |
| 16 | +#define topology_core_id(cpu) (cpu_data[cpu].core) | |
| 17 | +#define topology_core_cpumask(cpu) (&cpu_core_map[cpu]) | |
| 18 | +#define topology_thread_cpumask(cpu) (&cpu_sibling_map[cpu]) | |
| 19 | +#endif | |
| 12 | 20 | |
| 13 | 21 | #endif /* __ASM_TOPOLOGY_H */ |
| @@ -373,16 +373,18 @@ · 372 unmodified lines | ||
| 373 | 373 | #define __NR_sched_getattr (__NR_Linux + 350) |
| 374 | 374 | #define __NR_renameat2 (__NR_Linux + 351) |
| 375 | 375 | #define __NR_seccomp (__NR_Linux + 352) |
| 376 | +#define __NR_getrandom (__NR_Linux + 353) | |
| 377 | +#define __NR_memfd_create (__NR_Linux + 354) | |
| 376 | 378 | |
| 377 | 379 | /* |
| 378 | 380 | * Offset of the last Linux o32 flavoured syscall |
| 379 | 381 | */ |
| 380 | −#define __NR_Linux_syscalls 352 | |
| 382 | +#define __NR_Linux_syscalls 354 | |
| 381 | 383 | |
| 382 | 384 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ |
| 383 | 385 | |
| 384 | 386 | #define __NR_O32_Linux 4000 |
| 385 | −#define __NR_O32_Linux_syscalls 352 | |
| 387 | +#define __NR_O32_Linux_syscalls 354 | |
| 386 | 388 | |
| 387 | 389 | #if _MIPS_SIM == _MIPS_SIM_ABI64 |
| 388 | 390 | |
| @@ -703,16 +705,18 @@ · 314 unmodified lines | ||
| 703 | 705 | #define __NR_sched_getattr (__NR_Linux + 310) |
| 704 | 706 | #define __NR_renameat2 (__NR_Linux + 311) |
| 705 | 707 | #define __NR_seccomp (__NR_Linux + 312) |
| 708 | +#define __NR_getrandom (__NR_Linux + 313) | |
| 709 | +#define __NR_memfd_create (__NR_Linux + 314) | |
| 706 | 710 | |
| 707 | 711 | /* |
| 708 | 712 | * Offset of the last Linux 64-bit flavoured syscall |
| 709 | 713 | */ |
| 710 | −#define __NR_Linux_syscalls 312 | |
| 714 | +#define __NR_Linux_syscalls 314 | |
| 711 | 715 | |
| 712 | 716 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ |
| 713 | 717 | |
| 714 | 718 | #define __NR_64_Linux 5000 |
| 715 | −#define __NR_64_Linux_syscalls 312 | |
| 719 | +#define __NR_64_Linux_syscalls 314 | |
| 716 | 720 | |
| 717 | 721 | #if _MIPS_SIM == _MIPS_SIM_NABI32 |
| 718 | 722 | |
| @@ -1037,15 +1041,17 @@ · 318 unmodified lines | ||
| 1037 | 1041 | #define __NR_sched_getattr (__NR_Linux + 314) |
| 1038 | 1042 | #define __NR_renameat2 (__NR_Linux + 315) |
| 1039 | 1043 | #define __NR_seccomp (__NR_Linux + 316) |
| 1044 | +#define __NR_getrandom (__NR_Linux + 317) | |
| 1045 | +#define __NR_memfd_create (__NR_Linux + 318) | |
| 1040 | 1046 | |
| 1041 | 1047 | /* |
| 1042 | 1048 | * Offset of the last N32 flavoured syscall |
| 1043 | 1049 | */ |
| 1044 | −#define __NR_Linux_syscalls 316 | |
| 1050 | +#define __NR_Linux_syscalls 318 | |
| 1045 | 1051 | |
| 1046 | 1052 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ |
| 1047 | 1053 | |
| 1048 | 1054 | #define __NR_N32_Linux 6000 |
| 1049 | −#define __NR_N32_Linux_syscalls 316 | |
| 1055 | +#define __NR_N32_Linux_syscalls 318 | |
| 1050 | 1056 | |
| 1051 | 1057 | #endif /* _UAPI_ASM_UNISTD_H */ |
| @@ -71,8 +71,12 @@ machine_kexec(struct kimage *image) · 70 unmodified lines | ||
| 71 | 71 | kexec_start_address = |
| 72 | 72 | (unsigned long) phys_to_virt(image->start); |
| 73 | 73 | |
| 74 | − kexec_indirection_page = | |
| 75 | − (unsigned long) phys_to_virt(image->head & PAGE_MASK); | |
| 74 | + if (image->type == KEXEC_TYPE_DEFAULT) { | |
| 75 | + kexec_indirection_page = | |
| 76 | + (unsigned long) phys_to_virt(image->head & PAGE_MASK); | |
| 77 | + } else { | |
| 78 | + kexec_indirection_page = (unsigned long)&image->head; | |
| 79 | + } | |
| 76 | 80 | |
| 77 | 81 | memcpy((void*)reboot_code_buffer, relocate_new_kernel, |
| 78 | 82 | relocate_new_kernel_size); |
| @@ -577,3 +577,5 @@ EXPORT(sys_call_table) · 576 unmodified lines | ||
| 577 | 577 | PTR sys_sched_getattr /* 4350 */ |
| 578 | 578 | PTR sys_renameat2 |
| 579 | 579 | PTR sys_seccomp |
| 580 | + PTR sys_getrandom | |
| 581 | + PTR sys_memfd_create | |
| @@ -432,4 +432,6 @@ EXPORT(sys_call_table) · 431 unmodified lines | ||
| 432 | 432 | PTR sys_sched_getattr /* 5310 */ |
| 433 | 433 | PTR sys_renameat2 |
| 434 | 434 | PTR sys_seccomp |
| 435 | + PTR sys_getrandom | |
| 436 | + PTR sys_memfd_create | |
| 435 | 437 | .size sys_call_table,.-sys_call_table |
| @@ -425,4 +425,6 @@ EXPORT(sysn32_call_table) · 424 unmodified lines | ||
| 425 | 425 | PTR sys_sched_getattr |
| 426 | 426 | PTR sys_renameat2 /* 6315 */ |
| 427 | 427 | PTR sys_seccomp |
| 428 | + PTR sys_getrandom | |
| 429 | + PTR sys_memfd_create | |
| 428 | 430 | .size sysn32_call_table,.-sysn32_call_table |
| @@ -562,4 +562,6 @@ EXPORT(sys32_call_table) · 561 unmodified lines | ||
| 562 | 562 | PTR sys_sched_getattr /* 4350 */ |
| 563 | 563 | PTR sys_renameat2 |
| 564 | 564 | PTR sys_seccomp |
| 565 | + PTR sys_getrandom | |
| 566 | + PTR sys_memfd_create | |
| 565 | 567 | .size sys32_call_table,.-sys32_call_table |
| @@ -793,6 +793,7 @@ static int build_body(struct jit_ctx *ctx) · 792 unmodified lines | ||
| 793 | 793 | const struct sock_filter *inst; |
| 794 | 794 | unsigned int i, off, load_order, condt; |
| 795 | 795 | u32 k, b_off __maybe_unused; |
| 796 | + int tmp; | |
| 796 | 797 | |
| 797 | 798 | for (i = 0; i < prog->len; i++) { |
| 798 | 799 | u16 code; |
| @@ -1332,9 +1333,9 @@ jmp_cmp: · 533 unmodified lines | ||
| 1332 | 1333 | case BPF_ANC | SKF_AD_PKTTYPE: |
| 1333 | 1334 | ctx->flags |= SEEN_SKB; |
| 1334 | 1335 | |
| 1335 | − off = pkt_type_offset(); | |
| 1336 | + tmp = off = pkt_type_offset(); | |
| 1336 | 1337 | |
| 1337 | − if (off < 0) | |
| 1338 | + if (tmp < 0) | |
| 1338 | 1339 | return -1; |
| 1339 | 1340 | emit_load_byte(r_tmp, r_skb, off, ctx); |
| 1340 | 1341 | /* Keep only the last 3 bits */ |
| @@ -1032,7 +1032,6 @@ struct boot_params *make_boot_params(struct efi_config *c) · 1031 unmodified lines | ||
| 1032 | 1032 | int i; |
| 1033 | 1033 | unsigned long ramdisk_addr; |
| 1034 | 1034 | unsigned long ramdisk_size; |
| 1035 | − unsigned long initrd_addr_max; | |
| 1036 | 1035 | |
| 1037 | 1036 | efi_early = c; |
| 1038 | 1037 | sys_table = (efi_system_table_t *)(unsigned long)efi_early->table; |
| @@ -1095,15 +1094,20 @@ struct boot_params *make_boot_params(struct efi_config *c) · 56 unmodified lines | ||
| 1095 | 1094 | |
| 1096 | 1095 | memset(sdt, 0, sizeof(*sdt)); |
| 1097 | 1096 | |
| 1098 | − if (hdr->xloadflags & XLF_CAN_BE_LOADED_ABOVE_4G) | |
| 1099 | − initrd_addr_max = -1UL; | |
| 1100 | − else | |
| 1101 | − initrd_addr_max = hdr->initrd_addr_max; | |
| 1102 | − | |
| 1103 | 1097 | status = handle_cmdline_files(sys_table, image, |
| 1104 | 1098 | (char *)(unsigned long)hdr->cmd_line_ptr, |
| 1105 | − "initrd=", initrd_addr_max, | |
| 1099 | + "initrd=", hdr->initrd_addr_max, | |
| 1106 | 1100 | &ramdisk_addr, &ramdisk_size); |
| 1101 | + | |
| 1102 | + if (status != EFI_SUCCESS && | |
| 1103 | + hdr->xloadflags & XLF_CAN_BE_LOADED_ABOVE_4G) { | |
| 1104 | + efi_printk(sys_table, "Trying to load files to higher address\n"); | |
| 1105 | + status = handle_cmdline_files(sys_table, image, | |
| 1106 | + (char *)(unsigned long)hdr->cmd_line_ptr, | |
| 1107 | + "initrd=", -1UL, | |
| 1108 | + &ramdisk_addr, &ramdisk_size); | |
| 1109 | + } | |
| 1110 | + | |
| 1107 | 1111 | if (status != EFI_SUCCESS) |
| 1108 | 1112 | goto fail2; |
| 1109 | 1113 | hdr->ramdisk_image = ramdisk_addr & 0xffffffff; |
| @@ -30,6 +30,33 @@ · 29 unmodified lines | ||
| 30 | 30 | #include <asm/boot.h> |
| 31 | 31 | #include <asm/asm-offsets.h> |
| 32 | 32 | |
| 33 | +/* | |
| 34 | + * Adjust our own GOT | |
| 35 | + * | |
| 36 | + * The relocation base must be in %ebx | |
| 37 | + * | |
| 38 | + * It is safe to call this macro more than once, because in some of the | |
| 39 | + * code paths multiple invocations are inevitable, e.g. via the efi* | |
| 40 | + * entry points. | |
| 41 | + * | |
| 42 | + * Relocation is only performed the first time. | |
| 43 | + */ | |
| 44 | +.macro FIXUP_GOT | |
| 45 | + cmpb $1, got_fixed(%ebx) | |
| 46 | + je 2f | |
| 47 | + | |
| 48 | + leal _got(%ebx), %edx | |
| 49 | + leal _egot(%ebx), %ecx | |
| 50 | +1: | |
| 51 | + cmpl %ecx, %edx | |
| 52 | + jae 2f | |
| 53 | + addl %ebx, (%edx) | |
| 54 | + addl $4, %edx | |
| 55 | + jmp 1b | |
| 56 | +2: | |
| 57 | + movb $1, got_fixed(%ebx) | |
| 58 | +.endm | |
| 59 | + | |
| 33 | 60 | __HEAD |
| 34 | 61 | ENTRY(startup_32) |
| 35 | 62 | #ifdef CONFIG_EFI_STUB |
| @@ -56,6 +83,9 @@ ENTRY(efi_pe_entry) · 20 unmodified lines | ||
| 56 | 83 | add %esi, 88(%eax) |
| 57 | 84 | pushl %eax |
| 58 | 85 | |
| 86 | + movl %esi, %ebx | |
| 87 | + FIXUP_GOT | |
| 88 | + | |
| 59 | 89 | call make_boot_params |
| 60 | 90 | cmpl $0, %eax |
| 61 | 91 | je fail |
| @@ -81,6 +111,10 @@ ENTRY(efi32_stub_entry) · 19 unmodified lines | ||
| 81 | 111 | leal efi32_config(%esi), %eax |
| 82 | 112 | add %esi, 88(%eax) |
| 83 | 113 | pushl %eax |
| 114 | + | |
| 115 | + movl %esi, %ebx | |
| 116 | + FIXUP_GOT | |
| 117 | + | |
| 84 | 118 | 2: |
| 85 | 119 | call efi_main |
| 86 | 120 | cmpl $0, %eax |
| @@ -190,19 +224,7 @@ relocated: · 103 unmodified lines | ||
| 190 | 224 | shrl $2, %ecx |
| 191 | 225 | rep stosl |
| 192 | 226 | |
| 193 | −/* | |
| 194 | − * Adjust our own GOT | |
| 195 | − */ | |
| 196 | − leal _got(%ebx), %edx | |
| 197 | − leal _egot(%ebx), %ecx | |
| 198 | −1: | |
| 199 | − cmpl %ecx, %edx | |
| 200 | − jae 2f | |
| 201 | − addl %ebx, (%edx) | |
| 202 | − addl $4, %edx | |
| 203 | − jmp 1b | |
| 204 | −2: | |
| 205 | − | |
| 227 | + FIXUP_GOT | |
| 206 | 228 | /* |
| 207 | 229 | * Do the decompression, and jump to the new kernel.. |
| 208 | 230 | */ |
| @@ -225,8 +247,12 @@ relocated: · 16 unmodified lines | ||
| 225 | 247 | xorl %ebx, %ebx |
| 226 | 248 | jmp *%eax |
| 227 | 249 | |
| 228 | −#ifdef CONFIG_EFI_STUB | |
| 229 | 250 | .data |
| 251 | +/* Have we relocated the GOT? */ | |
| 252 | +got_fixed: | |
| 253 | + .byte 0 | |
| 254 | + | |
| 255 | +#ifdef CONFIG_EFI_STUB | |
| 230 | 256 | efi32_config: |
| 231 | 257 | .fill 11,8,0 |
| 232 | 258 | .long efi_call_phys |
| @@ -32,6 +32,33 @@ · 31 unmodified lines | ||
| 32 | 32 | #include <asm/processor-flags.h> |
| 33 | 33 | #include <asm/asm-offsets.h> |
| 34 | 34 | |
| 35 | +/* | |
| 36 | + * Adjust our own GOT | |
| 37 | + * | |
| 38 | + * The relocation base must be in %rbx | |
| 39 | + * | |
| 40 | + * It is safe to call this macro more than once, because in some of the | |
| 41 | + * code paths multiple invocations are inevitable, e.g. via the efi* | |
| 42 | + * entry points. | |
| 43 | + * | |
| 44 | + * Relocation is only performed the first time. | |
| 45 | + */ | |
| 46 | +.macro FIXUP_GOT | |
| 47 | + cmpb $1, got_fixed(%rip) | |
| 48 | + je 2f | |
| 49 | + | |
| 50 | + leaq _got(%rip), %rdx | |
| 51 | + leaq _egot(%rip), %rcx | |
| 52 | +1: | |
| 53 | + cmpq %rcx, %rdx | |
| 54 | + jae 2f | |
| 55 | + addq %rbx, (%rdx) | |
| 56 | + addq $8, %rdx | |
| 57 | + jmp 1b | |
| 58 | +2: | |
| 59 | + movb $1, got_fixed(%rip) | |
| 60 | +.endm | |
| 61 | + | |
| 35 | 62 | __HEAD |
| 36 | 63 | .code32 |
| 37 | 64 | ENTRY(startup_32) |
| @@ -252,10 +279,13 @@ ENTRY(efi_pe_entry) · 214 unmodified lines | ||
| 252 | 279 | subq $1b, %rbp |
| 253 | 280 | |
| 254 | 281 | /* |
| 255 | − * Relocate efi_config->call(). | |
| 282 | + * Relocate efi_config->call() and the GOT entries. | |
| 256 | 283 | */ |
| 257 | 284 | addq %rbp, efi64_config+88(%rip) |
| 258 | 285 | |
| 286 | + movq %rbp, %rbx | |
| 287 | + FIXUP_GOT | |
| 288 | + | |
| 259 | 289 | movq %rax, %rdi |
| 260 | 290 | call make_boot_params |
| 261 | 291 | cmpq $0,%rax |
| @@ -271,10 +301,13 @@ handover_entry: · 9 unmodified lines | ||
| 271 | 301 | subq $1b, %rbp |
| 272 | 302 | |
| 273 | 303 | /* |
| 274 | − * Relocate efi_config->call(). | |
| 304 | + * Relocate efi_config->call() and the GOT entries. | |
| 275 | 305 | */ |
| 276 | 306 | movq efi_config(%rip), %rax |
| 277 | 307 | addq %rbp, 88(%rax) |
| 308 | + | |
| 309 | + movq %rbp, %rbx | |
| 310 | + FIXUP_GOT | |
| 278 | 311 | 2: |
| 279 | 312 | movq efi_config(%rip), %rdi |
| 280 | 313 | call efi_main |
| @@ -385,19 +418,8 @@ relocated: · 104 unmodified lines | ||
| 385 | 418 | shrq $3, %rcx |
| 386 | 419 | rep stosq |
| 387 | 420 | |
| 388 | −/* | |
| 389 | − * Adjust our own GOT | |
| 390 | − */ | |
| 391 | − leaq _got(%rip), %rdx | |
| 392 | − leaq _egot(%rip), %rcx | |
| 393 | −1: | |
| 394 | − cmpq %rcx, %rdx | |
| 395 | − jae 2f | |
| 396 | − addq %rbx, (%rdx) | |
| 397 | − addq $8, %rdx | |
| 398 | − jmp 1b | |
| 399 | −2: | |
| 400 | − | |
| 421 | + FIXUP_GOT | |
| 422 | + | |
| 401 | 423 | /* |
| 402 | 424 | * Do the decompression, and jump to the new kernel.. |
| 403 | 425 | */ |
| @@ -437,6 +459,10 @@ gdt: · 33 unmodified lines | ||
| 437 | 459 | .quad 0x0000000000000000 /* TS continued */ |
| 438 | 460 | gdt_end: |
| 439 | 461 | |
| 462 | +/* Have we relocated the GOT? */ | |
| 463 | +got_fixed: | |
| 464 | + .byte 0 | |
| 465 | + | |
| 440 | 466 | #ifdef CONFIG_EFI_STUB |
| 441 | 467 | efi_config: |
| 442 | 468 | .quad 0 |
| @@ -239,6 +239,7 @@ static inline int mp_find_ioapic(u32 gsi) { return 0; } · 238 unmodified lines | ||
| 239 | 239 | static inline u32 mp_pin_to_gsi(int ioapic, int pin) { return UINT_MAX; } |
| 240 | 240 | static inline int mp_map_gsi_to_irq(u32 gsi, unsigned int flags) { return gsi; } |
| 241 | 241 | static inline void mp_unmap_irq(int irq) { } |
| 242 | +static inline bool mp_should_keep_irq(struct device *dev) { return 1; } | |
| 242 | 243 | |
| 243 | 244 | static inline int save_ioapic_entries(void) |
| 244 | 245 | { |
| @@ -338,8 +338,10 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op) · 337 unmodified lines | ||
| 338 | 338 | * a relative jump. |
| 339 | 339 | */ |
| 340 | 340 | rel = (long)op->optinsn.insn - (long)op->kp.addr + RELATIVEJUMP_SIZE; |
| 341 | − if (abs(rel) > 0x7fffffff) | |
| 341 | + if (abs(rel) > 0x7fffffff) { | |
| 342 | + __arch_remove_optimized_kprobe(op, 0); | |
| 342 | 343 | return -ERANGE; |
| 344 | + } | |
| 343 | 345 | |
| 344 | 346 | buf = (u8 *)op->optinsn.insn; |
| 345 | 347 | |
| @@ -48,7 +48,9 @@ enum address_markers_idx { · 47 unmodified lines | ||
| 48 | 48 | LOW_KERNEL_NR, |
| 49 | 49 | VMALLOC_START_NR, |
| 50 | 50 | VMEMMAP_START_NR, |
| 51 | +# ifdef CONFIG_X86_ESPFIX64 | |
| 51 | 52 | ESPFIX_START_NR, |
| 53 | +# endif | |
| 52 | 54 | HIGH_KERNEL_NR, |
| 53 | 55 | MODULES_VADDR_NR, |
| 54 | 56 | MODULES_END_NR, |
| @@ -71,7 +73,9 @@ static struct addr_marker address_markers[] = { · 16 unmodified lines | ||
| 71 | 73 | { PAGE_OFFSET, "Low Kernel Mapping" }, |
| 72 | 74 | { VMALLOC_START, "vmalloc() Area" }, |
| 73 | 75 | { VMEMMAP_START, "Vmemmap" }, |
| 76 | +# ifdef CONFIG_X86_ESPFIX64 | |
| 74 | 77 | { ESPFIX_BASE_ADDR, "ESPfix Area", 16 }, |
| 78 | +# endif | |
| 75 | 79 | { __START_KERNEL_map, "High Kernel Mapping" }, |
| 76 | 80 | { MODULES_VADDR, "Modules" }, |
| 77 | 81 | { MODULES_END, "End Modules" }, |
| @@ -31,7 +31,7 @@ · 30 unmodified lines | ||
| 31 | 31 | #include <linux/sched.h> |
| 32 | 32 | #include <asm/elf.h> |
| 33 | 33 | |
| 34 | −struct __read_mostly va_alignment va_align = { | |
| 34 | +struct va_alignment __read_mostly va_align = { | |
| 35 | 35 | .flags = -1, |
| 36 | 36 | }; |
| 37 | 37 | |
| @@ -326,27 +326,6 @@ static void pci_fixup_video(struct pci_dev *pdev) · 325 unmodified lines | ||
| 326 | 326 | struct pci_bus *bus; |
| 327 | 327 | u16 config; |
| 328 | 328 | |
| 329 | − if (!vga_default_device()) { | |
| 330 | − resource_size_t start, end; | |
| 331 | − int i; | |
| 332 | − | |
| 333 | − /* Does firmware framebuffer belong to us? */ | |
| 334 | − for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { | |
| 335 | − if (!(pci_resource_flags(pdev, i) & IORESOURCE_MEM)) | |
| 336 | − continue; | |
| 337 | − | |
| 338 | − start = pci_resource_start(pdev, i); | |
| 339 | − end = pci_resource_end(pdev, i); | |
| 340 | − | |
| 341 | − if (!start || !end) | |
| 342 | − continue; | |
| 343 | − | |
| 344 | − if (screen_info.lfb_base >= start && | |
| 345 | − (screen_info.lfb_base + screen_info.lfb_size) < end) | |
| 346 | − vga_set_default_device(pdev); | |
| 347 | − } | |
| 348 | − } | |
| 349 | − | |
| 350 | 329 | /* Is VGA routed to us? */ |
| 351 | 330 | bus = pdev->bus; |
| 352 | 331 | while (bus) { |
| @@ -371,8 +350,7 @@ static void pci_fixup_video(struct pci_dev *pdev) · 18 unmodified lines | ||
| 371 | 350 | pci_read_config_word(pdev, PCI_COMMAND, &config); |
| 372 | 351 | if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { |
| 373 | 352 | pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW; |
| 374 | − dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n"); | |
| 375 | − vga_set_default_device(pdev); | |
| 353 | + dev_printk(KERN_DEBUG, &pdev->dev, "Video device with shadowed ROM\n"); | |
| 376 | 354 | } |
| 377 | 355 | } |
| 378 | 356 | } |
| @@ -1922,9 +1922,6 @@ static inline int __init drbg_healthcheck_sanity(void) · 1921 unmodified lines | ||
| 1922 | 1922 | /* overflow max addtllen with personalization string */ |
| 1923 | 1923 | ret = drbg_instantiate(drbg, &addtl, coreref, pr); |
| 1924 | 1924 | BUG_ON(0 == ret); |
| 1925 | − /* test uninstantated DRBG */ | |
| 1926 | − len = drbg_generate(drbg, buf, (max_request_bytes + 1), NULL); | |
| 1927 | − BUG_ON(0 < len); | |
| 1928 | 1925 | /* all tests passed */ |
| 1929 | 1926 | rc = 0; |
| 1930 | 1927 | |
| @@ -419,7 +419,6 @@ static int acpi_lpss_create_device(struct acpi_device *adev, · 418 unmodified lines | ||
| 419 | 419 | adev->driver_data = pdata; |
| 420 | 420 | pdev = acpi_create_platform_device(adev); |
| 421 | 421 | if (!IS_ERR_OR_NULL(pdev)) { |
| 422 | − device_enable_async_suspend(&pdev->dev); | |
| 423 | 422 | return 1; |
| 424 | 423 | } |
| 425 | 424 | |
| @@ -254,6 +254,7 @@ struct acpi_create_field_info { · 253 unmodified lines | ||
| 254 | 254 | u32 field_bit_position; |
| 255 | 255 | u32 field_bit_length; |
| 256 | 256 | u16 resource_length; |
| 257 | + u16 pin_number_index; | |
| 257 | 258 | u8 field_flags; |
| 258 | 259 | u8 attribute; |
| 259 | 260 | u8 field_type; |
| @@ -264,6 +264,7 @@ struct acpi_object_region_field { · 263 unmodified lines | ||
| 264 | 264 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO u16 resource_length; |
| 265 | 265 | union acpi_operand_object *region_obj; /* Containing op_region object */ |
| 266 | 266 | u8 *resource_buffer; /* resource_template for serial regions/fields */ |
| 267 | + u16 pin_number_index; /* Index relative to previous Connection/Template */ | |
| 267 | 268 | }; |
| 268 | 269 | |
| 269 | 270 | struct acpi_object_bank_field { |
| @@ -360,6 +360,7 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info, · 359 unmodified lines | ||
| 360 | 360 | */ |
| 361 | 361 | info->resource_buffer = NULL; |
| 362 | 362 | info->connection_node = NULL; |
| 363 | + info->pin_number_index = 0; | |
| 363 | 364 | |
| 364 | 365 | /* |
| 365 | 366 | * A Connection() is either an actual resource descriptor (buffer) |
| @@ -437,6 +438,7 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info, · 71 unmodified lines | ||
| 437 | 438 | } |
| 438 | 439 | |
| 439 | 440 | info->field_bit_position += info->field_bit_length; |
| 441 | + info->pin_number_index++; /* Index relative to previous Connection() */ | |
| 440 | 442 | break; |
| 441 | 443 | |
| 442 | 444 | default: |
| @@ -142,6 +142,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, · 141 unmodified lines | ||
| 142 | 142 | union acpi_operand_object *region_obj2; |
| 143 | 143 | void *region_context = NULL; |
| 144 | 144 | struct acpi_connection_info *context; |
| 145 | + acpi_physical_address address; | |
| 145 | 146 | |
| 146 | 147 | ACPI_FUNCTION_TRACE(ev_address_space_dispatch); |
| 147 | 148 | |
| @@ -231,25 +232,23 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, · 83 unmodified lines | ||
| 231 | 232 | /* We have everything we need, we can invoke the address space handler */ |
| 232 | 233 | |
| 233 | 234 | handler = handler_desc->address_space.handler; |
| 234 | − | |
| 235 | − ACPI_DEBUG_PRINT((ACPI_DB_OPREGION, | |
| 236 | − "Handler %p (@%p) Address %8.8X%8.8X [%s]\n", | |
| 237 | − ®ion_obj->region.handler->address_space, handler, | |
| 238 | − ACPI_FORMAT_NATIVE_UINT(region_obj->region.address + | |
| 239 | − region_offset), | |
| 240 | − acpi_ut_get_region_name(region_obj->region. | |
| 241 | − space_id))); | |
| 235 | + address = (region_obj->region.address + region_offset); | |
| 242 | 236 | |
| 243 | 237 | /* |
| 244 | 238 | * Special handling for generic_serial_bus and general_purpose_io: |
| 245 | 239 | * There are three extra parameters that must be passed to the |
| 246 | 240 | * handler via the context: |
| 247 | − * 1) Connection buffer, a resource template from Connection() op. | |
| 248 | − * 2) Length of the above buffer. | |
| 249 | − * 3) Actual access length from the access_as() op. | |
| 241 | + * 1) Connection buffer, a resource template from Connection() op | |
| 242 | + * 2) Length of the above buffer | |
| 243 | + * 3) Actual access length from the access_as() op | |
| 244 | + * | |
| 245 | + * In addition, for general_purpose_io, the Address and bit_width fields | |
| 246 | + * are defined as follows: | |
| 247 | + * 1) Address is the pin number index of the field (bit offset from | |
| 248 | + * the previous Connection) | |
| 249 | + * 2) bit_width is the actual bit length of the field (number of pins) | |
| 250 | 250 | */ |
| 251 | − if (((region_obj->region.space_id == ACPI_ADR_SPACE_GSBUS) || | |
| 252 | − (region_obj->region.space_id == ACPI_ADR_SPACE_GPIO)) && | |
| 251 | + if ((region_obj->region.space_id == ACPI_ADR_SPACE_GSBUS) && | |
| 253 | 252 | context && field_obj) { |
| 254 | 253 | |
| 255 | 254 | /* Get the Connection (resource_template) buffer */ |
| @@ -258,6 +257,24 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, · 2 unmodified lines | ||
| 258 | 257 | context->length = field_obj->field.resource_length; |
| 259 | 258 | context->access_length = field_obj->field.access_length; |
| 260 | 259 | } |
| 260 | + if ((region_obj->region.space_id == ACPI_ADR_SPACE_GPIO) && | |
| 261 | + context && field_obj) { | |
| 262 | + | |
| 263 | + /* Get the Connection (resource_template) buffer */ | |
| 264 | + | |
| 265 | + context->connection = field_obj->field.resource_buffer; | |
| 266 | + context->length = field_obj->field.resource_length; | |
| 267 | + context->access_length = field_obj->field.access_length; | |
| 268 | + address = field_obj->field.pin_number_index; | |
| 269 | + bit_width = field_obj->field.bit_length; | |
| 270 | + } | |
| 271 | + | |
| 272 | + ACPI_DEBUG_PRINT((ACPI_DB_OPREGION, | |
| 273 | + "Handler %p (@%p) Address %8.8X%8.8X [%s]\n", | |
| 274 | + ®ion_obj->region.handler->address_space, handler, | |
| 275 | + ACPI_FORMAT_NATIVE_UINT(address), | |
| 276 | + acpi_ut_get_region_name(region_obj->region. | |
| 277 | + space_id))); | |
| 261 | 278 | |
| 262 | 279 | if (!(handler_desc->address_space.handler_flags & |
| 263 | 280 | ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) { |
| @@ -271,9 +288,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, · 7 unmodified lines | ||
| 271 | 288 | |
| 272 | 289 | /* Call the handler */ |
| 273 | 290 | |
| 274 | − status = handler(function, | |
| 275 | − (region_obj->region.address + region_offset), | |
| 276 | − bit_width, value, context, | |
| 291 | + status = handler(function, address, bit_width, value, context, | |
| 277 | 292 | region_obj2->extra.region_context); |
| 278 | 293 | |
| 279 | 294 | if (ACPI_FAILURE(status)) { |
| @@ -253,6 +253,37 @@ acpi_ex_read_data_from_field(struct acpi_walk_state * walk_state, · 252 unmodified lines | ||
| 253 | 253 | buffer = &buffer_desc->integer.value; |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | + if ((obj_desc->common.type == ACPI_TYPE_LOCAL_REGION_FIELD) && | |
| 257 | + (obj_desc->field.region_obj->region.space_id == | |
| 258 | + ACPI_ADR_SPACE_GPIO)) { | |
| 259 | + /* | |
| 260 | + * For GPIO (general_purpose_io), the Address will be the bit offset | |
| 261 | + * from the previous Connection() operator, making it effectively a | |
| 262 | + * pin number index. The bit_length is the length of the field, which | |
| 263 | + * is thus the number of pins. | |
| 264 | + */ | |
| 265 | + ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, | |
| 266 | + "GPIO FieldRead [FROM]: Pin %u Bits %u\n", | |
| 267 | + obj_desc->field.pin_number_index, | |
| 268 | + obj_desc->field.bit_length)); | |
| 269 | + | |
| 270 | + /* Lock entire transaction if requested */ | |
| 271 | + | |
| 272 | + acpi_ex_acquire_global_lock(obj_desc->common_field.field_flags); | |
| 273 | + | |
| 274 | + /* Perform the write */ | |
| 275 | + | |
| 276 | + status = acpi_ex_access_region(obj_desc, 0, | |
| 277 | + (u64 *)buffer, ACPI_READ); | |
| 278 | + acpi_ex_release_global_lock(obj_desc->common_field.field_flags); | |
| 279 | + if (ACPI_FAILURE(status)) { | |
| 280 | + acpi_ut_remove_reference(buffer_desc); | |
| 281 | + } else { | |
| 282 | + *ret_buffer_desc = buffer_desc; | |
| 283 | + } | |
| 284 | + return_ACPI_STATUS(status); | |
| 285 | + } | |
| 286 | + | |
| 256 | 287 | ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, |
| 257 | 288 | "FieldRead [TO]: Obj %p, Type %X, Buf %p, ByteLen %X\n", |
| 258 | 289 | obj_desc, obj_desc->common.type, buffer, |
| @@ -413,6 +444,42 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, · 154 unmodified lines | ||
| 413 | 444 | |
| 414 | 445 | *result_desc = buffer_desc; |
| 415 | 446 | return_ACPI_STATUS(status); |
| 447 | + } else if ((obj_desc->common.type == ACPI_TYPE_LOCAL_REGION_FIELD) && | |
| 448 | + (obj_desc->field.region_obj->region.space_id == | |
| 449 | + ACPI_ADR_SPACE_GPIO)) { | |
| 450 | + /* | |
| 451 | + * For GPIO (general_purpose_io), we will bypass the entire field | |
| 452 | + * mechanism and handoff the bit address and bit width directly to | |
| 453 | + * the handler. The Address will be the bit offset | |
| 454 | + * from the previous Connection() operator, making it effectively a | |
| 455 | + * pin number index. The bit_length is the length of the field, which | |
| 456 | + * is thus the number of pins. | |
| 457 | + */ | |
| 458 | + if (source_desc->common.type != ACPI_TYPE_INTEGER) { | |
| 459 | + return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | |
| 460 | + } | |
| 461 | + | |
| 462 | + ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, | |
| 463 | + "GPIO FieldWrite [FROM]: (%s:%X), Val %.8X [TO]: Pin %u Bits %u\n", | |
| 464 | + acpi_ut_get_type_name(source_desc->common. | |
| 465 | + type), | |
| 466 | + source_desc->common.type, | |
| 467 | + (u32)source_desc->integer.value, | |
| 468 | + obj_desc->field.pin_number_index, | |
| 469 | + obj_desc->field.bit_length)); | |
| 470 | + | |
| 471 | + buffer = &source_desc->integer.value; | |
| 472 | + | |
| 473 | + /* Lock entire transaction if requested */ | |
| 474 | + | |
| 475 | + acpi_ex_acquire_global_lock(obj_desc->common_field.field_flags); | |
| 476 | + | |
| 477 | + /* Perform the write */ | |
| 478 | + | |
| 479 | + status = acpi_ex_access_region(obj_desc, 0, | |
| 480 | + (u64 *)buffer, ACPI_WRITE); | |
| 481 | + acpi_ex_release_global_lock(obj_desc->common_field.field_flags); | |
| 482 | + return_ACPI_STATUS(status); | |
| 416 | 483 | } |
| 417 | 484 | |
| 418 | 485 | /* Get a pointer to the data to be written */ |
| @@ -484,6 +484,8 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info) · 483 unmodified lines | ||
| 484 | 484 | obj_desc->field.resource_length = info->resource_length; |
| 485 | 485 | } |
| 486 | 486 | |
| 487 | + obj_desc->field.pin_number_index = info->pin_number_index; | |
| 488 | + | |
| 487 | 489 | /* Allow full data read from EC address space */ |
| 488 | 490 | |
| 489 | 491 | if ((obj_desc->field.region_obj->region.space_id == |
| @@ -177,16 +177,6 @@ void acpi_bus_detach_private_data(acpi_handle handle) · 176 unmodified lines | ||
| 177 | 177 | } |
| 178 | 178 | EXPORT_SYMBOL_GPL(acpi_bus_detach_private_data); |
| 179 | 179 | |
| 180 | −void acpi_bus_no_hotplug(acpi_handle handle) | |
| 181 | −{ | |
| 182 | − struct acpi_device *adev = NULL; | |
| 183 | − | |
| 184 | − acpi_bus_get_device(handle, &adev); | |
| 185 | − if (adev) | |
| 186 | − adev->flags.no_hotplug = true; | |
| 187 | −} | |
| 188 | −EXPORT_SYMBOL_GPL(acpi_bus_no_hotplug); | |
| 189 | − | |
| 190 | 180 | static void acpi_print_osc_error(acpi_handle handle, |
| 191 | 181 | struct acpi_osc_context *context, char *error) |
| 192 | 182 | { |
| @@ -130,7 +130,7 @@ static int create_modalias(struct acpi_device *acpi_dev, char *modalias, · 129 unmodified lines | ||
| 130 | 130 | list_for_each_entry(id, &acpi_dev->pnp.ids, list) { |
| 131 | 131 | count = snprintf(&modalias[len], size, "%s:", id->id); |
| 132 | 132 | if (count < 0) |
| 133 | − return EINVAL; | |
| 133 | + return -EINVAL; | |
| 134 | 134 | if (count >= size) |
| 135 | 135 | return -ENOMEM; |
| 136 | 136 | len += count; |
| @@ -750,6 +750,14 @@ static struct dmi_system_id video_dmi_table[] __initdata = { · 749 unmodified lines | ||
| 750 | 750 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T520"), |
| 751 | 751 | }, |
| 752 | 752 | }, |
| 753 | + { | |
| 754 | + .callback = video_disable_native_backlight, | |
| 755 | + .ident = "ThinkPad X201s", | |
| 756 | + .matches = { | |
| 757 | + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | |
| 758 | + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201s"), | |
| 759 | + }, | |
| 760 | + }, | |
| 753 | 761 | |
| 754 | 762 | /* The native backlight controls do not work on some older machines */ |
| 755 | 763 | { |
| @@ -512,7 +512,14 @@ void regmap_debugfs_init(struct regmap *map, const char *name) · 511 unmodified lines | ||
| 512 | 512 | map, ®map_reg_ranges_fops); |
| 513 | 513 | |
| 514 | 514 | if (map->max_register || regmap_readable(map, 0)) { |
| 515 | − debugfs_create_file("registers", 0400, map->debugfs, | |
| 515 | + umode_t registers_mode; | |
| 516 | + | |
| 517 | + if (IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS)) | |
| 518 | + registers_mode = 0600; | |
| 519 | + else | |
| 520 | + registers_mode = 0400; | |
| 521 | + | |
| 522 | + debugfs_create_file("registers", registers_mode, map->debugfs, | |
| 516 | 523 | map, ®map_map_fops); |
| 517 | 524 | debugfs_create_file("access", 0400, map->debugfs, |
| 518 | 525 | map, ®map_access_fops); |
| @@ -36,6 +36,7 @@ struct virtrng_info { · 35 unmodified lines | ||
| 36 | 36 | int index; |
| 37 | 37 | bool busy; |
| 38 | 38 | bool hwrng_register_done; |
| 39 | + bool hwrng_removed; | |
| 39 | 40 | }; |
| 40 | 41 | |
| 41 | 42 | |
| @@ -68,6 +69,9 @@ static int virtio_read(struct hwrng *rng, void *buf, size_t size, bool wait) · 26 unmodified lines | ||
| 68 | 69 | int ret; |
| 69 | 70 | struct virtrng_info *vi = (struct virtrng_info *)rng->priv; |
| 70 | 71 | |
| 72 | + if (vi->hwrng_removed) | |
| 73 | + return -ENODEV; | |
| 74 | + | |
| 71 | 75 | if (!vi->busy) { |
| 72 | 76 | vi->busy = true; |
| 73 | 77 | init_completion(&vi->have_data); |
| @@ -137,6 +141,9 @@ static void remove_common(struct virtio_device *vdev) · 63 unmodified lines | ||
| 137 | 141 | { |
| 138 | 142 | struct virtrng_info *vi = vdev->priv; |
| 139 | 143 | |
| 144 | + vi->hwrng_removed = true; | |
| 145 | + vi->data_avail = 0; | |
| 146 | + complete(&vi->have_data); | |
| 140 | 147 | vdev->config->reset(vdev); |
| 141 | 148 | vi->busy = false; |
| 142 | 149 | if (vi->hwrng_register_done) |
| @@ -22,7 +22,7 @@ efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, · 21 unmodified lines | ||
| 22 | 22 | unsigned long map_size, unsigned long desc_size, |
| 23 | 23 | u32 desc_ver) |
| 24 | 24 | { |
| 25 | − int node, prev; | |
| 25 | + int node, prev, num_rsv; | |
| 26 | 26 | int status; |
| 27 | 27 | u32 fdt_val32; |
| 28 | 28 | u64 fdt_val64; |
| @@ -73,6 +73,14 @@ efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, · 44 unmodified lines | ||
| 73 | 73 | prev = node; |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | + /* | |
| 77 | + * Delete all memory reserve map entries. When booting via UEFI, | |
| 78 | + * kernel will use the UEFI memory map to find reserved regions. | |
| 79 | + */ | |
| 80 | + num_rsv = fdt_num_mem_rsv(fdt); | |
| 81 | + while (num_rsv-- > 0) | |
| 82 | + fdt_del_mem_rsv(fdt, num_rsv); | |
| 83 | + | |
| 76 | 84 | node = fdt_subnode_offset(fdt, 0, "chosen"); |
| 77 | 85 | if (node < 0) { |
| 78 | 86 | node = fdt_add_subnode(fdt, 0, "chosen"); |
| @@ -377,8 +377,10 @@ acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address, · 376 unmodified lines | ||
| 377 | 377 | struct gpio_chip *chip = achip->chip; |
| 378 | 378 | struct acpi_resource_gpio *agpio; |
| 379 | 379 | struct acpi_resource *ares; |
| 380 | + int pin_index = (int)address; | |
| 380 | 381 | acpi_status status; |
| 381 | 382 | bool pull_up; |
| 383 | + int length; | |
| 382 | 384 | int i; |
| 383 | 385 | |
| 384 | 386 | status = acpi_buffer_to_resource(achip->conn_info.connection, |
| @@ -400,7 +402,8 @@ acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address, · 15 unmodified lines | ||
| 400 | 402 | return AE_BAD_PARAMETER; |
| 401 | 403 | } |
| 402 | 404 | |
| 403 | − for (i = 0; i < agpio->pin_table_length; i++) { | |
| 405 | + length = min(agpio->pin_table_length, (u16)(pin_index + bits)); | |
| 406 | + for (i = pin_index; i < length; ++i) { | |
| 404 | 407 | unsigned pin = agpio->pin_table[i]; |
| 405 | 408 | struct acpi_gpio_connection *conn; |
| 406 | 409 | struct gpio_desc *desc; |
| @@ -250,6 +250,7 @@ static void bochs_connector_init(struct drm_device *dev) · 249 unmodified lines | ||
| 250 | 250 | DRM_MODE_CONNECTOR_VIRTUAL); |
| 251 | 251 | drm_connector_helper_add(connector, |
| 252 | 252 | &bochs_connector_connector_helper_funcs); |
| 253 | + drm_connector_register(connector); | |
| 253 | 254 | } |
| 254 | 255 | |
| 255 | 256 | |
| @@ -555,6 +555,7 @@ static struct drm_connector *cirrus_vga_init(struct drm_device *dev) · 554 unmodified lines | ||
| 555 | 555 | |
| 556 | 556 | drm_connector_helper_add(connector, &cirrus_vga_connector_helper_funcs); |
| 557 | 557 | |
| 558 | + drm_connector_register(connector); | |
| 558 | 559 | return connector; |
| 559 | 560 | } |
| 560 | 561 | |
| @@ -1631,6 +1631,10 @@ static void intel_dp_get_config(struct intel_encoder *encoder, · 1630 unmodified lines | ||
| 1631 | 1631 | |
| 1632 | 1632 | pipe_config->adjusted_mode.flags |= flags; |
| 1633 | 1633 | |
| 1634 | + if (!HAS_PCH_SPLIT(dev) && !IS_VALLEYVIEW(dev) && | |
| 1635 | + tmp & DP_COLOR_RANGE_16_235) | |
| 1636 | + pipe_config->limited_color_range = true; | |
| 1637 | + | |
| 1634 | 1638 | pipe_config->has_dp_encoder = true; |
| 1635 | 1639 | |
| 1636 | 1640 | intel_dp_get_m_n(crtc, pipe_config); |
| @@ -712,7 +712,8 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder, · 711 unmodified lines | ||
| 712 | 712 | struct intel_crtc_config *pipe_config) |
| 713 | 713 | { |
| 714 | 714 | struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base); |
| 715 | − struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; | |
| 715 | + struct drm_device *dev = encoder->base.dev; | |
| 716 | + struct drm_i915_private *dev_priv = dev->dev_private; | |
| 716 | 717 | u32 tmp, flags = 0; |
| 717 | 718 | int dotclock; |
| 718 | 719 | |
| @@ -734,6 +735,10 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder, · 15 unmodified lines | ||
| 734 | 735 | if (tmp & HDMI_MODE_SELECT_HDMI) |
| 735 | 736 | pipe_config->has_audio = true; |
| 736 | 737 | |
| 738 | + if (!HAS_PCH_SPLIT(dev) && | |
| 739 | + tmp & HDMI_COLOR_RANGE_16_235) | |
| 740 | + pipe_config->limited_color_range = true; | |
| 741 | + | |
| 737 | 742 | pipe_config->adjusted_mode.flags |= flags; |
| 738 | 743 | |
| 739 | 744 | if ((tmp & SDVO_COLOR_FORMAT_MASK) == HDMI_COLOR_FORMAT_12bpc) |
| @@ -1400,7 +1400,7 @@ i830_dispatch_execbuffer(struct intel_engine_cs *ring, · 1399 unmodified lines | ||
| 1400 | 1400 | */ |
| 1401 | 1401 | intel_ring_emit(ring, SRC_COPY_BLT_CMD | BLT_WRITE_RGBA); |
| 1402 | 1402 | intel_ring_emit(ring, BLT_DEPTH_32 | BLT_ROP_SRC_COPY | 4096); |
| 1403 | − intel_ring_emit(ring, DIV_ROUND_UP(len, 4096) << 16 | 1024); | |
| 1403 | + intel_ring_emit(ring, DIV_ROUND_UP(len, 4096) << 16 | 4096); | |
| 1404 | 1404 | intel_ring_emit(ring, cs_offset); |
| 1405 | 1405 | intel_ring_emit(ring, 4096); |
| 1406 | 1406 | intel_ring_emit(ring, offset); |
| @@ -200,7 +200,6 @@ nvc0_bar_init(struct nouveau_object *object) · 199 unmodified lines | ||
| 200 | 200 | |
| 201 | 201 | nv_mask(priv, 0x000200, 0x00000100, 0x00000000); |
| 202 | 202 | nv_mask(priv, 0x000200, 0x00000100, 0x00000100); |
| 203 | − nv_mask(priv, 0x100c80, 0x00000001, 0x00000000); | |
| 204 | 203 | |
| 205 | 204 | nv_wr32(priv, 0x001704, 0x80000000 | priv->bar[1].mem->addr >> 12); |
| 206 | 205 | if (priv->bar[0].mem) |
| @@ -60,6 +60,7 @@ nvc0_fb_init(struct nouveau_object *object) · 59 unmodified lines | ||
| 60 | 60 | |
| 61 | 61 | if (priv->r100c10_page) |
| 62 | 62 | nv_wr32(priv, 0x100c10, priv->r100c10 >> 8); |
| 63 | + nv_mask(priv, 0x100c80, 0x00000001, 0x00000000); /* 128KiB lpg */ | |
| 63 | 64 | return 0; |
| 64 | 65 | } |
| 65 | 66 | |
| @@ -98,6 +98,7 @@ static int · 97 unmodified lines | ||
| 98 | 98 | gf100_ltc_init(struct nouveau_object *object) |
| 99 | 99 | { |
| 100 | 100 | struct nvkm_ltc_priv *priv = (void *)object; |
| 101 | + u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001); | |
| 101 | 102 | int ret; |
| 102 | 103 | |
| 103 | 104 | ret = nvkm_ltc_init(priv); |
| @@ -107,6 +108,7 @@ gf100_ltc_init(struct nouveau_object *object) · 3 unmodified lines | ||
| 107 | 108 | nv_mask(priv, 0x17e820, 0x00100000, 0x00000000); /* INTR_EN &= ~0x10 */ |
| 108 | 109 | nv_wr32(priv, 0x17e8d8, priv->ltc_nr); |
| 109 | 110 | nv_wr32(priv, 0x17e8d4, priv->tag_base); |
| 111 | + nv_mask(priv, 0x17e8c0, 0x00000002, lpg128 ? 0x00000002 : 0x00000000); | |
| 110 | 112 | return 0; |
| 111 | 113 | } |
| 112 | 114 | |
| @@ -28,6 +28,7 @@ static int · 27 unmodified lines | ||
| 28 | 28 | gk104_ltc_init(struct nouveau_object *object) |
| 29 | 29 | { |
| 30 | 30 | struct nvkm_ltc_priv *priv = (void *)object; |
| 31 | + u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001); | |
| 31 | 32 | int ret; |
| 32 | 33 | |
| 33 | 34 | ret = nvkm_ltc_init(priv); |
| @@ -37,6 +38,7 @@ gk104_ltc_init(struct nouveau_object *object) · 3 unmodified lines | ||
| 37 | 38 | nv_wr32(priv, 0x17e8d8, priv->ltc_nr); |
| 38 | 39 | nv_wr32(priv, 0x17e000, priv->ltc_nr); |
| 39 | 40 | nv_wr32(priv, 0x17e8d4, priv->tag_base); |
| 41 | + nv_mask(priv, 0x17e8c0, 0x00000002, lpg128 ? 0x00000002 : 0x00000000); | |
| 40 | 42 | return 0; |
| 41 | 43 | } |
| 42 | 44 | |
| @@ -98,6 +98,7 @@ static int · 97 unmodified lines | ||
| 98 | 98 | gm107_ltc_init(struct nouveau_object *object) |
| 99 | 99 | { |
| 100 | 100 | struct nvkm_ltc_priv *priv = (void *)object; |
| 101 | + u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001); | |
| 101 | 102 | int ret; |
| 102 | 103 | |
| 103 | 104 | ret = nvkm_ltc_init(priv); |
| @@ -106,6 +107,7 @@ gm107_ltc_init(struct nouveau_object *object) · 2 unmodified lines | ||
| 106 | 107 | |
| 107 | 108 | nv_wr32(priv, 0x17e27c, priv->ltc_nr); |
| 108 | 109 | nv_wr32(priv, 0x17e278, priv->tag_base); |
| 110 | + nv_mask(priv, 0x17e264, 0x00000002, lpg128 ? 0x00000002 : 0x00000000); | |
| 109 | 111 | return 0; |
| 110 | 112 | } |
| 111 | 113 | |
| @@ -46,7 +46,6 @@ static struct nouveau_dsm_priv { · 45 unmodified lines | ||
| 46 | 46 | bool dsm_detected; |
| 47 | 47 | bool optimus_detected; |
| 48 | 48 | acpi_handle dhandle; |
| 49 | − acpi_handle other_handle; | |
| 50 | 49 | acpi_handle rom_handle; |
| 51 | 50 | } nouveau_dsm_priv; |
| 52 | 51 | |
| @@ -222,10 +221,9 @@ static int nouveau_dsm_pci_probe(struct pci_dev *pdev) · 169 unmodified lines | ||
| 222 | 221 | if (!dhandle) |
| 223 | 222 | return false; |
| 224 | 223 | |
| 225 | − if (!acpi_has_method(dhandle, "_DSM")) { | |
| 226 | − nouveau_dsm_priv.other_handle = dhandle; | |
| 224 | + if (!acpi_has_method(dhandle, "_DSM")) | |
| 227 | 225 | return false; |
| 228 | − } | |
| 226 | + | |
| 229 | 227 | if (acpi_check_dsm(dhandle, nouveau_dsm_muid, 0x00000102, |
| 230 | 228 | 1 << NOUVEAU_DSM_POWER)) |
| 231 | 229 | retval |= NOUVEAU_DSM_HAS_MUX; |
| @@ -301,16 +299,6 @@ static bool nouveau_dsm_detect(void) · 69 unmodified lines | ||
| 301 | 299 | printk(KERN_INFO "VGA switcheroo: detected DSM switching method %s handle\n", |
| 302 | 300 | acpi_method_name); |
| 303 | 301 | nouveau_dsm_priv.dsm_detected = true; |
| 304 | − /* | |
| 305 | − * On some systems hotplug events are generated for the device | |
| 306 | − * being switched off when _DSM is executed. They cause ACPI | |
| 307 | − * hotplug to trigger and attempt to remove the device from | |
| 308 | − * the system, which causes it to break down. Prevent that from | |
| 309 | − * happening by setting the no_hotplug flag for the involved | |
| 310 | − * ACPI device objects. | |
| 311 | − */ | |
| 312 | − acpi_bus_no_hotplug(nouveau_dsm_priv.dhandle); | |
| 313 | − acpi_bus_no_hotplug(nouveau_dsm_priv.other_handle); | |
| 314 | 302 | ret = true; |
| 315 | 303 | } |
| 316 | 304 | |
| @@ -627,6 +627,7 @@ int nouveau_pmops_suspend(struct device *dev) · 626 unmodified lines | ||
| 627 | 627 | |
| 628 | 628 | pci_save_state(pdev); |
| 629 | 629 | pci_disable_device(pdev); |
| 630 | + pci_ignore_hotplug(pdev); | |
| 630 | 631 | pci_set_power_state(pdev, PCI_D3hot); |
| 631 | 632 | return 0; |
| 632 | 633 | } |
| @@ -108,7 +108,16 @@ void · 107 unmodified lines | ||
| 108 | 108 | nouveau_vga_fini(struct nouveau_drm *drm) |
| 109 | 109 | { |
| 110 | 110 | struct drm_device *dev = drm->dev; |
| 111 | + bool runtime = false; | |
| 112 | + | |
| 113 | + if (nouveau_runtime_pm == 1) | |
| 114 | + runtime = true; | |
| 115 | + if ((nouveau_runtime_pm == -1) && (nouveau_is_optimus() || nouveau_is_v1_dsm())) | |
| 116 | + runtime = true; | |
| 117 | + | |
| 111 | 118 | vga_switcheroo_unregister_client(dev->pdev); |
| 119 | + if (runtime && nouveau_is_v1_dsm() && !nouveau_is_optimus()) | |
| 120 | + vga_switcheroo_fini_domain_pm_ops(drm->dev->dev); | |
| 112 | 121 | vga_client_register(dev->pdev, NULL, NULL, NULL); |
| 113 | 122 | } |
| 114 | 123 | |
| @@ -489,13 +489,6 @@ int cik_sdma_resume(struct radeon_device *rdev) · 488 unmodified lines | ||
| 489 | 489 | { |
| 490 | 490 | int r; |
| 491 | 491 | |
| 492 | − /* Reset dma */ | |
| 493 | − WREG32(SRBM_SOFT_RESET, SOFT_RESET_SDMA | SOFT_RESET_SDMA1); | |
| 494 | − RREG32(SRBM_SOFT_RESET); | |
| 495 | − udelay(50); | |
| 496 | − WREG32(SRBM_SOFT_RESET, 0); | |
| 497 | − RREG32(SRBM_SOFT_RESET); | |
| 498 | − | |
| 499 | 492 | r = cik_sdma_load_microcode(rdev); |
| 500 | 493 | if (r) |
| 501 | 494 | return r; |
| @@ -33,6 +33,8 @@ · 32 unmodified lines | ||
| 33 | 33 | #define KV_MINIMUM_ENGINE_CLOCK 800 |
| 34 | 34 | #define SMC_RAM_END 0x40000 |
| 35 | 35 | |
| 36 | +static int kv_enable_nb_dpm(struct radeon_device *rdev, | |
| 37 | + bool enable); | |
| 36 | 38 | static void kv_init_graphics_levels(struct radeon_device *rdev); |
| 37 | 39 | static int kv_calculate_ds_divider(struct radeon_device *rdev); |
| 38 | 40 | static int kv_calculate_nbps_level_settings(struct radeon_device *rdev); |
| @@ -1295,6 +1297,9 @@ void kv_dpm_disable(struct radeon_device *rdev) · 1256 unmodified lines | ||
| 1295 | 1297 | { |
| 1296 | 1298 | kv_smc_bapm_enable(rdev, false); |
| 1297 | 1299 | |
| 1300 | + if (rdev->family == CHIP_MULLINS) | |
| 1301 | + kv_enable_nb_dpm(rdev, false); | |
| 1302 | + | |
| 1298 | 1303 | /* powerup blocks */ |
| 1299 | 1304 | kv_dpm_powergate_acp(rdev, false); |
| 1300 | 1305 | kv_dpm_powergate_samu(rdev, false); |
| @@ -1769,15 +1774,24 @@ static int kv_update_dfs_bypass_settings(struct radeon_device *rdev, · 468 unmodified lines | ||
| 1769 | 1774 | return ret; |
| 1770 | 1775 | } |
| 1771 | 1776 | |
| 1772 | −static int kv_enable_nb_dpm(struct radeon_device *rdev) | |
| 1777 | +static int kv_enable_nb_dpm(struct radeon_device *rdev, | |
| 1778 | + bool enable) | |
| 1773 | 1779 | { |
| 1774 | 1780 | struct kv_power_info *pi = kv_get_pi(rdev); |
| 1775 | 1781 | int ret = 0; |
| 1776 | 1782 | |
| 1777 | − if (pi->enable_nb_dpm && !pi->nb_dpm_enabled) { | |
| 1778 | − ret = kv_notify_message_to_smu(rdev, PPSMC_MSG_NBDPM_Enable); | |
| 1779 | − if (ret == 0) | |
| 1780 | − pi->nb_dpm_enabled = true; | |
| 1783 | + if (enable) { | |
| 1784 | + if (pi->enable_nb_dpm && !pi->nb_dpm_enabled) { | |
| 1785 | + ret = kv_notify_message_to_smu(rdev, PPSMC_MSG_NBDPM_Enable); | |
| 1786 | + if (ret == 0) | |
| 1787 | + pi->nb_dpm_enabled = true; | |
| 1788 | + } | |
| 1789 | + } else { | |
| 1790 | + if (pi->enable_nb_dpm && pi->nb_dpm_enabled) { | |
| 1791 | + ret = kv_notify_message_to_smu(rdev, PPSMC_MSG_NBDPM_Disable); | |
| 1792 | + if (ret == 0) | |
| 1793 | + pi->nb_dpm_enabled = false; | |
| 1794 | + } | |
| 1781 | 1795 | } |
| 1782 | 1796 | |
| 1783 | 1797 | return ret; |
| @@ -1864,7 +1878,7 @@ int kv_dpm_set_power_state(struct radeon_device *rdev) · 80 unmodified lines | ||
| 1864 | 1878 | } |
| 1865 | 1879 | kv_update_sclk_t(rdev); |
| 1866 | 1880 | if (rdev->family == CHIP_MULLINS) |
| 1867 | − kv_enable_nb_dpm(rdev); | |
| 1881 | + kv_enable_nb_dpm(rdev, true); | |
| 1868 | 1882 | } |
| 1869 | 1883 | } else { |
| 1870 | 1884 | if (pi->enable_dpm) { |
| @@ -1889,7 +1903,7 @@ int kv_dpm_set_power_state(struct radeon_device *rdev) · 18 unmodified lines | ||
| 1889 | 1903 | } |
| 1890 | 1904 | kv_update_acp_boot_level(rdev); |
| 1891 | 1905 | kv_update_sclk_t(rdev); |
| 1892 | − kv_enable_nb_dpm(rdev); | |
| 1906 | + kv_enable_nb_dpm(rdev, true); | |
| 1893 | 1907 | } |
| 1894 | 1908 | } |
| 1895 | 1909 | |
| @@ -191,12 +191,6 @@ int cayman_dma_resume(struct radeon_device *rdev) · 190 unmodified lines | ||
| 191 | 191 | u32 reg_offset, wb_offset; |
| 192 | 192 | int i, r; |
| 193 | 193 | |
| 194 | − /* Reset dma */ | |
| 195 | − WREG32(SRBM_SOFT_RESET, SOFT_RESET_DMA | SOFT_RESET_DMA1); | |
| 196 | − RREG32(SRBM_SOFT_RESET); | |
| 197 | − udelay(50); | |
| 198 | − WREG32(SRBM_SOFT_RESET, 0); | |
| 199 | − | |
| 200 | 194 | for (i = 0; i < 2; i++) { |
| 201 | 195 | if (i == 0) { |
| 202 | 196 | ring = &rdev->ring[R600_RING_TYPE_DMA_INDEX]; |
| @@ -821,6 +821,20 @@ u32 r100_get_vblank_counter(struct radeon_device *rdev, int crtc) · 820 unmodified lines | ||
| 821 | 821 | return RREG32(RADEON_CRTC2_CRNT_FRAME); |
| 822 | 822 | } |
| 823 | 823 | |
| 824 | +/** | |
| 825 | + * r100_ring_hdp_flush - flush Host Data Path via the ring buffer | |
| 826 | + * rdev: radeon device structure | |
| 827 | + * ring: ring buffer struct for emitting packets | |
| 828 | + */ | |
| 829 | +static void r100_ring_hdp_flush(struct radeon_device *rdev, struct radeon_ring *ring) | |
| 830 | +{ | |
| 831 | + radeon_ring_write(ring, PACKET0(RADEON_HOST_PATH_CNTL, 0)); | |
| 832 | + radeon_ring_write(ring, rdev->config.r100.hdp_cntl | | |
| 833 | + RADEON_HDP_READ_BUFFER_INVALIDATE); | |
| 834 | + radeon_ring_write(ring, PACKET0(RADEON_HOST_PATH_CNTL, 0)); | |
| 835 | + radeon_ring_write(ring, rdev->config.r100.hdp_cntl); | |
| 836 | +} | |
| 837 | + | |
| 824 | 838 | /* Who ever call radeon_fence_emit should call ring_lock and ask |
| 825 | 839 | * for enough space (today caller are ib schedule and buffer move) */ |
| 826 | 840 | void r100_fence_ring_emit(struct radeon_device *rdev, |
| @@ -1056,20 +1070,6 @@ void r100_gfx_set_wptr(struct radeon_device *rdev, · 229 unmodified lines | ||
| 1056 | 1070 | (void)RREG32(RADEON_CP_RB_WPTR); |
| 1057 | 1071 | } |
| 1058 | 1072 | |
| 1059 | −/** | |
| 1060 | − * r100_ring_hdp_flush - flush Host Data Path via the ring buffer | |
| 1061 | − * rdev: radeon device structure | |
| 1062 | − * ring: ring buffer struct for emitting packets | |
| 1063 | − */ | |
| 1064 | −void r100_ring_hdp_flush(struct radeon_device *rdev, struct radeon_ring *ring) | |
| 1065 | −{ | |
| 1066 | − radeon_ring_write(ring, PACKET0(RADEON_HOST_PATH_CNTL, 0)); | |
| 1067 | − radeon_ring_write(ring, rdev->config.r100.hdp_cntl | | |
| 1068 | − RADEON_HDP_READ_BUFFER_INVALIDATE); | |
| 1069 | − radeon_ring_write(ring, PACKET0(RADEON_HOST_PATH_CNTL, 0)); | |
| 1070 | − radeon_ring_write(ring, rdev->config.r100.hdp_cntl); | |
| 1071 | −} | |
| 1072 | − | |
| 1073 | 1073 | static void r100_cp_load_microcode(struct radeon_device *rdev) |
| 1074 | 1074 | { |
| 1075 | 1075 | const __be32 *fw_data; |
| @@ -124,15 +124,6 @@ int r600_dma_resume(struct radeon_device *rdev) · 123 unmodified lines | ||
| 124 | 124 | u32 rb_bufsz; |
| 125 | 125 | int r; |
| 126 | 126 | |
| 127 | − /* Reset dma */ | |
| 128 | − if (rdev->family >= CHIP_RV770) | |
| 129 | − WREG32(SRBM_SOFT_RESET, RV770_SOFT_RESET_DMA); | |
| 130 | − else | |
| 131 | − WREG32(SRBM_SOFT_RESET, SOFT_RESET_DMA); | |
| 132 | − RREG32(SRBM_SOFT_RESET); | |
| 133 | − udelay(50); | |
| 134 | − WREG32(SRBM_SOFT_RESET, 0); | |
| 135 | − | |
| 136 | 127 | WREG32(DMA_SEM_INCOMPLETE_TIMER_CNTL, 0); |
| 137 | 128 | WREG32(DMA_SEM_WAIT_FAIL_TIMER_CNTL, 0); |
| 138 | 129 | |
| @@ -44,13 +44,6 @@ · 43 unmodified lines | ||
| 44 | 44 | #define R6XX_MAX_PIPES 8 |
| 45 | 45 | #define R6XX_MAX_PIPES_MASK 0xff |
| 46 | 46 | |
| 47 | −/* PTE flags */ | |
| 48 | −#define PTE_VALID (1 << 0) | |
| 49 | −#define PTE_SYSTEM (1 << 1) | |
| 50 | −#define PTE_SNOOPED (1 << 2) | |
| 51 | −#define PTE_READABLE (1 << 5) | |
| 52 | −#define PTE_WRITEABLE (1 << 6) | |
| 53 | − | |
| 54 | 47 | /* tiling bits */ |
| 55 | 48 | #define ARRAY_LINEAR_GENERAL 0x00000000 |
| 56 | 49 | #define ARRAY_LINEAR_ALIGNED 0x00000001 |
| @@ -185,7 +185,6 @@ static struct radeon_asic_ring r100_gfx_ring = { · 184 unmodified lines | ||
| 185 | 185 | .get_rptr = &r100_gfx_get_rptr, |
| 186 | 186 | .get_wptr = &r100_gfx_get_wptr, |
| 187 | 187 | .set_wptr = &r100_gfx_set_wptr, |
| 188 | − .hdp_flush = &r100_ring_hdp_flush, | |
| 189 | 188 | }; |
| 190 | 189 | |
| 191 | 190 | static struct radeon_asic r100_asic = { |
| @@ -332,7 +331,6 @@ static struct radeon_asic_ring r300_gfx_ring = { · 140 unmodified lines | ||
| 332 | 331 | .get_rptr = &r100_gfx_get_rptr, |
| 333 | 332 | .get_wptr = &r100_gfx_get_wptr, |
| 334 | 333 | .set_wptr = &r100_gfx_set_wptr, |
| 335 | − .hdp_flush = &r100_ring_hdp_flush, | |
| 336 | 334 | }; |
| 337 | 335 | |
| 338 | 336 | static struct radeon_asic r300_asic = { |
| @@ -148,8 +148,7 @@ u32 r100_gfx_get_wptr(struct radeon_device *rdev, · 147 unmodified lines | ||
| 148 | 148 | struct radeon_ring *ring); |
| 149 | 149 | void r100_gfx_set_wptr(struct radeon_device *rdev, |
| 150 | 150 | struct radeon_ring *ring); |
| 151 | −void r100_ring_hdp_flush(struct radeon_device *rdev, | |
| 152 | − struct radeon_ring *ring); | |
| 151 | + | |
| 153 | 152 | /* |
| 154 | 153 | * r200,rv250,rs300,rv280 |
| 155 | 154 | */ |
| @@ -33,7 +33,6 @@ static struct radeon_atpx_priv { · 32 unmodified lines | ||
| 33 | 33 | bool atpx_detected; |
| 34 | 34 | /* handle for device - and atpx */ |
| 35 | 35 | acpi_handle dhandle; |
| 36 | − acpi_handle other_handle; | |
| 37 | 36 | struct radeon_atpx atpx; |
| 38 | 37 | } radeon_atpx_priv; |
| 39 | 38 | |
| @@ -453,10 +452,9 @@ static bool radeon_atpx_pci_probe_handle(struct pci_dev *pdev) · 413 unmodified lines | ||
| 453 | 452 | return false; |
| 454 | 453 | |
| 455 | 454 | status = acpi_get_handle(dhandle, "ATPX", &atpx_handle); |
| 456 | − if (ACPI_FAILURE(status)) { | |
| 457 | − radeon_atpx_priv.other_handle = dhandle; | |
| 455 | + if (ACPI_FAILURE(status)) | |
| 458 | 456 | return false; |
| 459 | − } | |
| 457 | + | |
| 460 | 458 | radeon_atpx_priv.dhandle = dhandle; |
| 461 | 459 | radeon_atpx_priv.atpx.handle = atpx_handle; |
| 462 | 460 | return true; |
| @@ -540,16 +538,6 @@ static bool radeon_atpx_detect(void) · 77 unmodified lines | ||
| 540 | 538 | printk(KERN_INFO "VGA switcheroo: detected switching method %s handle\n", |
| 541 | 539 | acpi_method_name); |
| 542 | 540 | radeon_atpx_priv.atpx_detected = true; |
| 543 | − /* | |
| 544 | − * On some systems hotplug events are generated for the device | |
| 545 | − * being switched off when ATPX is executed. They cause ACPI | |
| 546 | − * hotplug to trigger and attempt to remove the device from | |
| 547 | − * the system, which causes it to break down. Prevent that from | |
| 548 | − * happening by setting the no_hotplug flag for the involved | |
| 549 | − * ACPI device objects. | |
| 550 | − */ | |
| 551 | − acpi_bus_no_hotplug(radeon_atpx_priv.dhandle); | |
| 552 | − acpi_bus_no_hotplug(radeon_atpx_priv.other_handle); | |
| 553 | 541 | return true; |
| 554 | 542 | } |
| 555 | 543 | return false; |
| @@ -1393,7 +1393,7 @@ int radeon_device_init(struct radeon_device *rdev, · 1392 unmodified lines | ||
| 1393 | 1393 | |
| 1394 | 1394 | r = radeon_init(rdev); |
| 1395 | 1395 | if (r) |
| 1396 | − return r; | |
| 1396 | + goto failed; | |
| 1397 | 1397 | |
| 1398 | 1398 | r = radeon_ib_ring_tests(rdev); |
| 1399 | 1399 | if (r) |
| @@ -1413,7 +1413,7 @@ int radeon_device_init(struct radeon_device *rdev, · 13 unmodified lines | ||
| 1413 | 1413 | radeon_agp_disable(rdev); |
| 1414 | 1414 | r = radeon_init(rdev); |
| 1415 | 1415 | if (r) |
| 1416 | − return r; | |
| 1416 | + goto failed; | |
| 1417 | 1417 | } |
| 1418 | 1418 | |
| 1419 | 1419 | if ((radeon_testing & 1)) { |
| @@ -1435,6 +1435,11 @@ int radeon_device_init(struct radeon_device *rdev, · 15 unmodified lines | ||
| 1435 | 1435 | DRM_INFO("radeon: acceleration disabled, skipping benchmarks\n"); |
| 1436 | 1436 | } |
| 1437 | 1437 | return 0; |
| 1438 | + | |
| 1439 | +failed: | |
| 1440 | + if (runtime) | |
| 1441 | + vga_switcheroo_fini_domain_pm_ops(rdev->dev); | |
| 1442 | + return r; | |
| 1438 | 1443 | } |
| 1439 | 1444 | |
| 1440 | 1445 | static void radeon_debugfs_remove_files(struct radeon_device *rdev); |
| @@ -1455,6 +1460,8 @@ void radeon_device_fini(struct radeon_device *rdev) · 14 unmodified lines | ||
| 1455 | 1460 | radeon_bo_evict_vram(rdev); |
| 1456 | 1461 | radeon_fini(rdev); |
| 1457 | 1462 | vga_switcheroo_unregister_client(rdev->pdev); |
| 1463 | + if (rdev->flags & RADEON_IS_PX) | |
| 1464 | + vga_switcheroo_fini_domain_pm_ops(rdev->dev); | |
| 1458 | 1465 | vga_client_register(rdev->pdev, NULL, NULL, NULL); |
| 1459 | 1466 | if (rdev->rio_mem) |
| 1460 | 1467 | pci_iounmap(rdev->pdev, rdev->rio_mem); |
| @@ -83,7 +83,7 @@ · 82 unmodified lines | ||
| 83 | 83 | * CIK: 1D and linear tiling modes contain valid PIPE_CONFIG |
| 84 | 84 | * 2.39.0 - Add INFO query for number of active CUs |
| 85 | 85 | * 2.40.0 - Add RADEON_GEM_GTT_WC/UC, flush HDP cache before submitting |
| 86 | − * CS to GPU | |
| 86 | + * CS to GPU on >= r600 | |
| 87 | 87 | */ |
| 88 | 88 | #define KMS_DRIVER_MAJOR 2 |
| 89 | 89 | #define KMS_DRIVER_MINOR 40 |
| @@ -440,6 +440,7 @@ static int radeon_pmops_runtime_suspend(struct device *dev) · 350 unmodified lines | ||
| 440 | 440 | ret = radeon_suspend_kms(drm_dev, false, false); |
| 441 | 441 | pci_save_state(pdev); |
| 442 | 442 | pci_disable_device(pdev); |
| 443 | + pci_ignore_hotplug(pdev); | |
| 443 | 444 | pci_set_power_state(pdev, PCI_D3cold); |
| 444 | 445 | drm_dev->switch_power_state = DRM_SWITCH_POWER_DYNAMIC_OFF; |
| 445 | 446 | |
| @@ -221,9 +221,9 @@ void rs400_gart_set_page(struct radeon_device *rdev, unsigned i, · 220 unmodified lines | ||
| 221 | 221 | entry = (lower_32_bits(addr) & PAGE_MASK) | |
| 222 | 222 | ((upper_32_bits(addr) & 0xff) << 4); |
| 223 | 223 | if (flags & RADEON_GART_PAGE_READ) |
| 224 | − addr |= RS400_PTE_READABLE; | |
| 224 | + entry |= RS400_PTE_READABLE; | |
| 225 | 225 | if (flags & RADEON_GART_PAGE_WRITE) |
| 226 | − addr |= RS400_PTE_WRITEABLE; | |
| 226 | + entry |= RS400_PTE_WRITEABLE; | |
| 227 | 227 | if (!(flags & RADEON_GART_PAGE_SNOOP)) |
| 228 | 228 | entry |= RS400_PTE_UNSNOOPED; |
| 229 | 229 | entry = cpu_to_le32(entry); |
| @@ -298,7 +298,6 @@ static int hdmi_avi_infoframe_config(struct sti_hdmi *hdmi) · 297 unmodified lines | ||
| 298 | 298 | hdmi_write(hdmi, val, HDMI_SW_DI_N_PKT_WORD2(HDMI_IFRAME_SLOT_AVI)); |
| 299 | 299 | |
| 300 | 300 | val = frame[0xC]; |
| 301 | − val |= frame[0xD] << 8; | |
| 302 | 301 | hdmi_write(hdmi, val, HDMI_SW_DI_N_PKT_WORD3(HDMI_IFRAME_SLOT_AVI)); |
| 303 | 302 | |
| 304 | 303 | /* Enable transmission slot for AVI infoframe |
| @@ -660,6 +660,12 @@ int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain * · 659 unmodified lines | ||
| 660 | 660 | } |
| 661 | 661 | EXPORT_SYMBOL(vga_switcheroo_init_domain_pm_ops); |
| 662 | 662 | |
| 663 | +void vga_switcheroo_fini_domain_pm_ops(struct device *dev) | |
| 664 | +{ | |
| 665 | + dev->pm_domain = NULL; | |
| 666 | +} | |
| 667 | +EXPORT_SYMBOL(vga_switcheroo_fini_domain_pm_ops); | |
| 668 | + | |
| 663 | 669 | static int vga_switcheroo_runtime_resume_hdmi_audio(struct device *dev) |
| 664 | 670 | { |
| 665 | 671 | struct pci_dev *pdev = to_pci_dev(dev); |
| @@ -41,6 +41,7 @@ · 40 unmodified lines | ||
| 41 | 41 | #include <linux/poll.h> |
| 42 | 42 | #include <linux/miscdevice.h> |
| 43 | 43 | #include <linux/slab.h> |
| 44 | +#include <linux/screen_info.h> | |
| 44 | 45 | |
| 45 | 46 | #include <linux/uaccess.h> |
| 46 | 47 | |
| @@ -112,10 +113,8 @@ both: · 65 unmodified lines | ||
| 112 | 113 | return 1; |
| 113 | 114 | } |
| 114 | 115 | |
| 115 | −#ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE | |
| 116 | 116 | /* this is only used a cookie - it should not be dereferenced */ |
| 117 | 117 | static struct pci_dev *vga_default; |
| 118 | −#endif | |
| 119 | 118 | |
| 120 | 119 | static void vga_arb_device_card_gone(struct pci_dev *pdev); |
| 121 | 120 | |
| @@ -131,7 +130,6 @@ static struct vga_device *vgadev_find(struct pci_dev *pdev) · 9 unmodified lines | ||
| 131 | 130 | } |
| 132 | 131 | |
| 133 | 132 | /* Returns the default VGA device (vgacon's babe) */ |
| 134 | −#ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE | |
| 135 | 133 | struct pci_dev *vga_default_device(void) |
| 136 | 134 | { |
| 137 | 135 | return vga_default; |
| @@ -147,7 +145,6 @@ void vga_set_default_device(struct pci_dev *pdev) · 9 unmodified lines | ||
| 147 | 145 | pci_dev_put(vga_default); |
| 148 | 146 | vga_default = pci_dev_get(pdev); |
| 149 | 147 | } |
| 150 | −#endif | |
| 151 | 148 | |
| 152 | 149 | static inline void vga_irq_set_state(struct vga_device *vgadev, bool state) |
| 153 | 150 | { |
| @@ -583,11 +580,12 @@ static bool vga_arbiter_add_pci_device(struct pci_dev *pdev) · 429 unmodified lines | ||
| 583 | 580 | /* Deal with VGA default device. Use first enabled one |
| 584 | 581 | * by default if arch doesn't have it's own hook |
| 585 | 582 | */ |
| 586 | −#ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE | |
| 587 | 583 | if (vga_default == NULL && |
| 588 | − ((vgadev->owns & VGA_RSRC_LEGACY_MASK) == VGA_RSRC_LEGACY_MASK)) | |
| 584 | + ((vgadev->owns & VGA_RSRC_LEGACY_MASK) == VGA_RSRC_LEGACY_MASK)) { | |
| 585 | + pr_info("vgaarb: setting as boot device: PCI:%s\n", | |
| 586 | + pci_name(pdev)); | |
| 589 | 587 | vga_set_default_device(pdev); |
| 590 | −#endif | |
| 588 | + } | |
| 591 | 589 | |
| 592 | 590 | vga_arbiter_check_bridge_sharing(vgadev); |
| 593 | 591 | |
| @@ -621,10 +619,8 @@ static bool vga_arbiter_del_pci_device(struct pci_dev *pdev) · 27 unmodified lines | ||
| 621 | 619 | goto bail; |
| 622 | 620 | } |
| 623 | 621 | |
| 624 | −#ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE | |
| 625 | 622 | if (vga_default == pdev) |
| 626 | 623 | vga_set_default_device(NULL); |
| 627 | −#endif | |
| 628 | 624 | |
| 629 | 625 | if (vgadev->decodes & (VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM)) |
| 630 | 626 | vga_decode_count--; |
| @@ -1320,6 +1316,38 @@ static int __init vga_arb_device_init(void) · 689 unmodified lines | ||
| 1320 | 1316 | pr_info("vgaarb: loaded\n"); |
| 1321 | 1317 | |
| 1322 | 1318 | list_for_each_entry(vgadev, &vga_list, list) { |
| 1319 | +#if defined(CONFIG_X86) || defined(CONFIG_IA64) | |
| 1320 | + /* Override I/O based detection done by vga_arbiter_add_pci_device() | |
| 1321 | + * as it may take the wrong device (e.g. on Apple system under EFI). | |
| 1322 | + * | |
| 1323 | + * Select the device owning the boot framebuffer if there is one. | |
| 1324 | + */ | |
| 1325 | + resource_size_t start, end; | |
| 1326 | + int i; | |
| 1327 | + | |
| 1328 | + /* Does firmware framebuffer belong to us? */ | |
| 1329 | + for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { | |
| 1330 | + if (!(pci_resource_flags(vgadev->pdev, i) & IORESOURCE_MEM)) | |
| 1331 | + continue; | |
| 1332 | + | |
| 1333 | + start = pci_resource_start(vgadev->pdev, i); | |
| 1334 | + end = pci_resource_end(vgadev->pdev, i); | |
| 1335 | + | |
| 1336 | + if (!start || !end) | |
| 1337 | + continue; | |
| 1338 | + | |
| 1339 | + if (screen_info.lfb_base < start || | |
| 1340 | + (screen_info.lfb_base + screen_info.lfb_size) >= end) | |
| 1341 | + continue; | |
| 1342 | + if (!vga_default_device()) | |
| 1343 | + pr_info("vgaarb: setting as boot device: PCI:%s\n", | |
| 1344 | + pci_name(vgadev->pdev)); | |
| 1345 | + else if (vgadev->pdev != vga_default_device()) | |
| 1346 | + pr_info("vgaarb: overriding boot device: PCI:%s\n", | |
| 1347 | + pci_name(vgadev->pdev)); | |
| 1348 | + vga_set_default_device(vgadev->pdev); | |
| 1349 | + } | |
| 1350 | +#endif | |
| 1323 | 1351 | if (vgadev->bridge_has_one_vga) |
| 1324 | 1352 | pr_info("vgaarb: bridge control possible %s\n", pci_name(vgadev->pdev)); |
| 1325 | 1353 | else |
| @@ -571,7 +571,7 @@ static int bma180_probe(struct i2c_client *client, · 570 unmodified lines | ||
| 571 | 571 | trig->ops = &bma180_trigger_ops; |
| 572 | 572 | iio_trigger_set_drvdata(trig, indio_dev); |
| 573 | 573 | data->trig = trig; |
| 574 | − indio_dev->trig = trig; | |
| 574 | + indio_dev->trig = iio_trigger_get(trig); | |
| 575 | 575 | |
| 576 | 576 | ret = iio_trigger_register(trig); |
| 577 | 577 | if (ret) |
| @@ -472,7 +472,7 @@ static int ad_sd_probe_trigger(struct iio_dev *indio_dev) · 471 unmodified lines | ||
| 472 | 472 | goto error_free_irq; |
| 473 | 473 | |
| 474 | 474 | /* select default trigger */ |
| 475 | − indio_dev->trig = sigma_delta->trig; | |
| 475 | + indio_dev->trig = iio_trigger_get(sigma_delta->trig); | |
| 476 | 476 | |
| 477 | 477 | return 0; |
| 478 | 478 | |
| @@ -196,6 +196,7 @@ struct at91_adc_state { · 195 unmodified lines | ||
| 196 | 196 | bool done; |
| 197 | 197 | int irq; |
| 198 | 198 | u16 last_value; |
| 199 | + int chnb; | |
| 199 | 200 | struct mutex lock; |
| 200 | 201 | u8 num_channels; |
| 201 | 202 | void __iomem *reg_base; |
| @@ -274,7 +275,7 @@ void handle_adc_eoc_trigger(int irq, struct iio_dev *idev) · 72 unmodified lines | ||
| 274 | 275 | disable_irq_nosync(irq); |
| 275 | 276 | iio_trigger_poll(idev->trig); |
| 276 | 277 | } else { |
| 277 | − st->last_value = at91_adc_readl(st, AT91_ADC_LCDR); | |
| 278 | + st->last_value = at91_adc_readl(st, AT91_ADC_CHAN(st, st->chnb)); | |
| 278 | 279 | st->done = true; |
| 279 | 280 | wake_up_interruptible(&st->wq_data_avail); |
| 280 | 281 | } |
| @@ -351,7 +352,7 @@ static irqreturn_t at91_adc_rl_interrupt(int irq, void *private) · 70 unmodified lines | ||
| 351 | 352 | unsigned int reg; |
| 352 | 353 | |
| 353 | 354 | status &= at91_adc_readl(st, AT91_ADC_IMR); |
| 354 | − if (status & st->registers->drdy_mask) | |
| 355 | + if (status & GENMASK(st->num_channels - 1, 0)) | |
| 355 | 356 | handle_adc_eoc_trigger(irq, idev); |
| 356 | 357 | |
| 357 | 358 | if (status & AT91RL_ADC_IER_PEN) { |
| @@ -418,7 +419,7 @@ static irqreturn_t at91_adc_9x5_interrupt(int irq, void *private) · 60 unmodified lines | ||
| 418 | 419 | AT91_ADC_IER_YRDY | |
| 419 | 420 | AT91_ADC_IER_PRDY; |
| 420 | 421 | |
| 421 | − if (status & st->registers->drdy_mask) | |
| 422 | + if (status & GENMASK(st->num_channels - 1, 0)) | |
| 422 | 423 | handle_adc_eoc_trigger(irq, idev); |
| 423 | 424 | |
| 424 | 425 | if (status & AT91_ADC_IER_PEN) { |
| @@ -689,9 +690,10 @@ static int at91_adc_read_raw(struct iio_dev *idev, · 264 unmodified lines | ||
| 689 | 690 | case IIO_CHAN_INFO_RAW: |
| 690 | 691 | mutex_lock(&st->lock); |
| 691 | 692 | |
| 693 | + st->chnb = chan->channel; | |
| 692 | 694 | at91_adc_writel(st, AT91_ADC_CHER, |
| 693 | 695 | AT91_ADC_CH(chan->channel)); |
| 694 | − at91_adc_writel(st, AT91_ADC_IER, st->registers->drdy_mask); | |
| 696 | + at91_adc_writel(st, AT91_ADC_IER, BIT(chan->channel)); | |
| 695 | 697 | at91_adc_writel(st, AT91_ADC_CR, AT91_ADC_START); |
| 696 | 698 | |
| 697 | 699 | ret = wait_event_interruptible_timeout(st->wq_data_avail, |
| @@ -708,7 +710,7 @@ static int at91_adc_read_raw(struct iio_dev *idev, · 10 unmodified lines | ||
| 708 | 710 | |
| 709 | 711 | at91_adc_writel(st, AT91_ADC_CHDR, |
| 710 | 712 | AT91_ADC_CH(chan->channel)); |
| 711 | − at91_adc_writel(st, AT91_ADC_IDR, st->registers->drdy_mask); | |
| 713 | + at91_adc_writel(st, AT91_ADC_IDR, BIT(chan->channel)); | |
| 712 | 714 | |
| 713 | 715 | st->last_value = 0; |
| 714 | 716 | st->done = false; |
| @@ -1126,7 +1126,7 @@ static int xadc_parse_dt(struct iio_dev *indio_dev, struct device_node *np, · 1125 unmodified lines | ||
| 1126 | 1126 | chan->address = XADC_REG_VPVN; |
| 1127 | 1127 | } else { |
| 1128 | 1128 | chan->scan_index = 15 + reg; |
| 1129 | − chan->scan_index = XADC_REG_VAUX(reg - 1); | |
| 1129 | + chan->address = XADC_REG_VAUX(reg - 1); | |
| 1130 | 1130 | } |
| 1131 | 1131 | num_channels++; |
| 1132 | 1132 | chan++; |
| @@ -122,7 +122,8 @@ int hid_sensor_setup_trigger(struct iio_dev *indio_dev, const char *name, · 121 unmodified lines | ||
| 122 | 122 | dev_err(&indio_dev->dev, "Trigger Register Failed\n"); |
| 123 | 123 | goto error_free_trig; |
| 124 | 124 | } |
| 125 | − indio_dev->trig = attrb->trigger = trig; | |
| 125 | + attrb->trigger = trig; | |
| 126 | + indio_dev->trig = iio_trigger_get(trig); | |
| 126 | 127 | |
| 127 | 128 | return ret; |
| 128 | 129 | |
| @@ -49,7 +49,7 @@ int st_sensors_allocate_trigger(struct iio_dev *indio_dev, · 48 unmodified lines | ||
| 49 | 49 | dev_err(&indio_dev->dev, "failed to register iio trigger.\n"); |
| 50 | 50 | goto iio_trigger_register_error; |
| 51 | 51 | } |
| 52 | − indio_dev->trig = sdata->trig; | |
| 52 | + indio_dev->trig = iio_trigger_get(sdata->trig); | |
| 53 | 53 | |
| 54 | 54 | return 0; |
| 55 | 55 | |
| @@ -132,7 +132,7 @@ int itg3200_probe_trigger(struct iio_dev *indio_dev) · 131 unmodified lines | ||
| 132 | 132 | goto error_free_irq; |
| 133 | 133 | |
| 134 | 134 | /* select default trigger */ |
| 135 | − indio_dev->trig = st->trig; | |
| 135 | + indio_dev->trig = iio_trigger_get(st->trig); | |
| 136 | 136 | |
| 137 | 137 | return 0; |
| 138 | 138 | |
| @@ -135,7 +135,7 @@ int inv_mpu6050_probe_trigger(struct iio_dev *indio_dev) · 134 unmodified lines | ||
| 135 | 135 | ret = iio_trigger_register(st->trig); |
| 136 | 136 | if (ret) |
| 137 | 137 | goto error_free_irq; |
| 138 | − indio_dev->trig = st->trig; | |
| 138 | + indio_dev->trig = iio_trigger_get(st->trig); | |
| 139 | 139 | |
| 140 | 140 | return 0; |
| 141 | 141 | |
| @@ -178,7 +178,7 @@ static struct iio_channel *of_iio_channel_get_by_name(struct device_node *np, · 177 unmodified lines | ||
| 178 | 178 | index = of_property_match_string(np, "io-channel-names", |
| 179 | 179 | name); |
| 180 | 180 | chan = of_iio_channel_get(np, index); |
| 181 | − if (!IS_ERR(chan)) | |
| 181 | + if (!IS_ERR(chan) || PTR_ERR(chan) == -EPROBE_DEFER) | |
| 182 | 182 | break; |
| 183 | 183 | else if (name && index >= 0) { |
| 184 | 184 | pr_err("ERROR: could not get IIO channel %s:%s(%i)\n", |
| @@ -42,7 +42,8 @@ · 41 unmodified lines | ||
| 42 | 42 | #define ST_MAGN_FS_AVL_5600MG 5600 |
| 43 | 43 | #define ST_MAGN_FS_AVL_8000MG 8000 |
| 44 | 44 | #define ST_MAGN_FS_AVL_8100MG 8100 |
| 45 | −#define ST_MAGN_FS_AVL_10000MG 10000 | |
| 45 | +#define ST_MAGN_FS_AVL_12000MG 12000 | |
| 46 | +#define ST_MAGN_FS_AVL_16000MG 16000 | |
| 46 | 47 | |
| 47 | 48 | /* CUSTOM VALUES FOR SENSOR 1 */ |
| 48 | 49 | #define ST_MAGN_1_WAI_EXP 0x3c |
| @@ -69,20 +70,20 @@ · 20 unmodified lines | ||
| 69 | 70 | #define ST_MAGN_1_FS_AVL_4700_VAL 0x05 |
| 70 | 71 | #define ST_MAGN_1_FS_AVL_5600_VAL 0x06 |
| 71 | 72 | #define ST_MAGN_1_FS_AVL_8100_VAL 0x07 |
| 72 | −#define ST_MAGN_1_FS_AVL_1300_GAIN_XY 1100 | |
| 73 | −#define ST_MAGN_1_FS_AVL_1900_GAIN_XY 855 | |
| 74 | −#define ST_MAGN_1_FS_AVL_2500_GAIN_XY 670 | |
| 75 | −#define ST_MAGN_1_FS_AVL_4000_GAIN_XY 450 | |
| 76 | −#define ST_MAGN_1_FS_AVL_4700_GAIN_XY 400 | |
| 77 | −#define ST_MAGN_1_FS_AVL_5600_GAIN_XY 330 | |
| 78 | −#define ST_MAGN_1_FS_AVL_8100_GAIN_XY 230 | |
| 79 | −#define ST_MAGN_1_FS_AVL_1300_GAIN_Z 980 | |
| 80 | −#define ST_MAGN_1_FS_AVL_1900_GAIN_Z 760 | |
| 81 | −#define ST_MAGN_1_FS_AVL_2500_GAIN_Z 600 | |
| 82 | −#define ST_MAGN_1_FS_AVL_4000_GAIN_Z 400 | |
| 83 | −#define ST_MAGN_1_FS_AVL_4700_GAIN_Z 355 | |
| 84 | −#define ST_MAGN_1_FS_AVL_5600_GAIN_Z 295 | |
| 85 | −#define ST_MAGN_1_FS_AVL_8100_GAIN_Z 205 | |
| 73 | +#define ST_MAGN_1_FS_AVL_1300_GAIN_XY 909 | |
| 74 | +#define ST_MAGN_1_FS_AVL_1900_GAIN_XY 1169 | |
| 75 | +#define ST_MAGN_1_FS_AVL_2500_GAIN_XY 1492 | |
| 76 | +#define ST_MAGN_1_FS_AVL_4000_GAIN_XY 2222 | |
| 77 | +#define ST_MAGN_1_FS_AVL_4700_GAIN_XY 2500 | |
| 78 | +#define ST_MAGN_1_FS_AVL_5600_GAIN_XY 3030 | |
| 79 | +#define ST_MAGN_1_FS_AVL_8100_GAIN_XY 4347 | |
| 80 | +#define ST_MAGN_1_FS_AVL_1300_GAIN_Z 1020 | |
| 81 | +#define ST_MAGN_1_FS_AVL_1900_GAIN_Z 1315 | |
| 82 | +#define ST_MAGN_1_FS_AVL_2500_GAIN_Z 1666 | |
| 83 | +#define ST_MAGN_1_FS_AVL_4000_GAIN_Z 2500 | |
| 84 | +#define ST_MAGN_1_FS_AVL_4700_GAIN_Z 2816 | |
| 85 | +#define ST_MAGN_1_FS_AVL_5600_GAIN_Z 3389 | |
| 86 | +#define ST_MAGN_1_FS_AVL_8100_GAIN_Z 4878 | |
| 86 | 87 | #define ST_MAGN_1_MULTIREAD_BIT false |
| 87 | 88 | |
| 88 | 89 | /* CUSTOM VALUES FOR SENSOR 2 */ |
| @@ -105,10 +106,12 @@ · 16 unmodified lines | ||
| 105 | 106 | #define ST_MAGN_2_FS_MASK 0x60 |
| 106 | 107 | #define ST_MAGN_2_FS_AVL_4000_VAL 0x00 |
| 107 | 108 | #define ST_MAGN_2_FS_AVL_8000_VAL 0x01 |
| 108 | −#define ST_MAGN_2_FS_AVL_10000_VAL 0x02 | |
| 109 | −#define ST_MAGN_2_FS_AVL_4000_GAIN 430 | |
| 110 | −#define ST_MAGN_2_FS_AVL_8000_GAIN 230 | |
| 111 | −#define ST_MAGN_2_FS_AVL_10000_GAIN 230 | |
| 109 | +#define ST_MAGN_2_FS_AVL_12000_VAL 0x02 | |
| 110 | +#define ST_MAGN_2_FS_AVL_16000_VAL 0x03 | |
| 111 | +#define ST_MAGN_2_FS_AVL_4000_GAIN 146 | |
| 112 | +#define ST_MAGN_2_FS_AVL_8000_GAIN 292 | |
| 113 | +#define ST_MAGN_2_FS_AVL_12000_GAIN 438 | |
| 114 | +#define ST_MAGN_2_FS_AVL_16000_GAIN 584 | |
| 112 | 115 | #define ST_MAGN_2_MULTIREAD_BIT false |
| 113 | 116 | #define ST_MAGN_2_OUT_X_L_ADDR 0x28 |
| 114 | 117 | #define ST_MAGN_2_OUT_Y_L_ADDR 0x2a |
| @@ -266,9 +269,14 @@ static const struct st_sensors st_magn_sensors[] = { · 151 unmodified lines | ||
| 266 | 269 | .gain = ST_MAGN_2_FS_AVL_8000_GAIN, |
| 267 | 270 | }, |
| 268 | 271 | [2] = { |
| 269 | − .num = ST_MAGN_FS_AVL_10000MG, | |
| 270 | − .value = ST_MAGN_2_FS_AVL_10000_VAL, | |
| 271 | − .gain = ST_MAGN_2_FS_AVL_10000_GAIN, | |
| 272 | + .num = ST_MAGN_FS_AVL_12000MG, | |
| 273 | + .value = ST_MAGN_2_FS_AVL_12000_VAL, | |
| 274 | + .gain = ST_MAGN_2_FS_AVL_12000_GAIN, | |
| 275 | + }, | |
| 276 | + [3] = { | |
| 277 | + .num = ST_MAGN_FS_AVL_16000MG, | |
| 278 | + .value = ST_MAGN_2_FS_AVL_16000_VAL, | |
| 279 | + .gain = ST_MAGN_2_FS_AVL_16000_GAIN, | |
| 272 | 280 | }, |
| 273 | 281 | }, |
| 274 | 282 | }, |
| @@ -586,17 +586,12 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) · 585 unmodified lines | ||
| 586 | 586 | init_completion(&isert_conn->conn_wait); |
| 587 | 587 | init_completion(&isert_conn->conn_wait_comp_err); |
| 588 | 588 | kref_init(&isert_conn->conn_kref); |
| 589 | − kref_get(&isert_conn->conn_kref); | |
| 590 | 589 | mutex_init(&isert_conn->conn_mutex); |
| 591 | 590 | spin_lock_init(&isert_conn->conn_lock); |
| 592 | 591 | INIT_LIST_HEAD(&isert_conn->conn_fr_pool); |
| 593 | 592 | |
| 594 | 593 | cma_id->context = isert_conn; |
| 595 | 594 | isert_conn->conn_cm_id = cma_id; |
| 596 | − isert_conn->responder_resources = event->param.conn.responder_resources; | |
| 597 | − isert_conn->initiator_depth = event->param.conn.initiator_depth; | |
| 598 | − pr_debug("Using responder_resources: %u initiator_depth: %u\n", | |
| 599 | − isert_conn->responder_resources, isert_conn->initiator_depth); | |
| 600 | 595 | |
| 601 | 596 | isert_conn->login_buf = kzalloc(ISCSI_DEF_MAX_RECV_SEG_LEN + |
| 602 | 597 | ISER_RX_LOGIN_SIZE, GFP_KERNEL); |
| @@ -643,6 +638,12 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) · 40 unmodified lines | ||
| 643 | 638 | goto out_rsp_dma_map; |
| 644 | 639 | } |
| 645 | 640 | |
| 641 | + /* Set max inflight RDMA READ requests */ | |
| 642 | + isert_conn->initiator_depth = min_t(u8, | |
| 643 | + event->param.conn.initiator_depth, | |
| 644 | + device->dev_attr.max_qp_init_rd_atom); | |
| 645 | + pr_debug("Using initiator_depth: %u\n", isert_conn->initiator_depth); | |
| 646 | + | |
| 646 | 647 | isert_conn->conn_device = device; |
| 647 | 648 | isert_conn->conn_pd = ib_alloc_pd(isert_conn->conn_device->ib_device); |
| 648 | 649 | if (IS_ERR(isert_conn->conn_pd)) { |
| @@ -746,7 +747,9 @@ isert_connect_release(struct isert_conn *isert_conn) · 97 unmodified lines | ||
| 746 | 747 | static void |
| 747 | 748 | isert_connected_handler(struct rdma_cm_id *cma_id) |
| 748 | 749 | { |
| 749 | − return; | |
| 750 | + struct isert_conn *isert_conn = cma_id->context; | |
| 751 | + | |
| 752 | + kref_get(&isert_conn->conn_kref); | |
| 750 | 753 | } |
| 751 | 754 | |
| 752 | 755 | static void |
| @@ -798,7 +801,6 @@ isert_disconnect_work(struct work_struct *work) · 45 unmodified lines | ||
| 798 | 801 | |
| 799 | 802 | wake_up: |
| 800 | 803 | complete(&isert_conn->conn_wait); |
| 801 | − isert_put_conn(isert_conn); | |
| 802 | 804 | } |
| 803 | 805 | |
| 804 | 806 | static void |
| @@ -3067,7 +3069,6 @@ isert_rdma_accept(struct isert_conn *isert_conn) · 2262 unmodified lines | ||
| 3067 | 3069 | int ret; |
| 3068 | 3070 | |
| 3069 | 3071 | memset(&cp, 0, sizeof(struct rdma_conn_param)); |
| 3070 | − cp.responder_resources = isert_conn->responder_resources; | |
| 3071 | 3072 | cp.initiator_depth = isert_conn->initiator_depth; |
| 3072 | 3073 | cp.retry_count = 7; |
| 3073 | 3074 | cp.rnr_retry_count = 7; |
| @@ -3215,7 +3216,7 @@ static void isert_wait_conn(struct iscsi_conn *conn) · 141 unmodified lines | ||
| 3215 | 3216 | pr_debug("isert_wait_conn: Starting \n"); |
| 3216 | 3217 | |
| 3217 | 3218 | mutex_lock(&isert_conn->conn_mutex); |
| 3218 | − if (isert_conn->conn_cm_id) { | |
| 3219 | + if (isert_conn->conn_cm_id && !isert_conn->disconnect) { | |
| 3219 | 3220 | pr_debug("Calling rdma_disconnect from isert_wait_conn\n"); |
| 3220 | 3221 | rdma_disconnect(isert_conn->conn_cm_id); |
| 3221 | 3222 | } |
| @@ -3234,6 +3235,7 @@ static void isert_wait_conn(struct iscsi_conn *conn) · 12 unmodified lines | ||
| 3234 | 3235 | wait_for_completion(&isert_conn->conn_wait_comp_err); |
| 3235 | 3236 | |
| 3236 | 3237 | wait_for_completion(&isert_conn->conn_wait); |
| 3238 | + isert_put_conn(isert_conn); | |
| 3237 | 3239 | } |
| 3238 | 3240 | |
| 3239 | 3241 | static void isert_free_conn(struct iscsi_conn *conn) |
| @@ -1791,14 +1791,6 @@ static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = { · 1790 unmodified lines | ||
| 1791 | 1791 | { |
| 1792 | 1792 | .matches = { |
| 1793 | 1793 | DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"), |
| 1794 | − DMI_MATCH(DMI_PRODUCT_NAME, "LW25-B7HV"), | |
| 1795 | − }, | |
| 1796 | − .callback = atkbd_deactivate_fixup, | |
| 1797 | − }, | |
| 1798 | − { | |
| 1799 | − .matches = { | |
| 1800 | − DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"), | |
| 1801 | − DMI_MATCH(DMI_PRODUCT_NAME, "P1-J273B"), | |
| 1802 | 1794 | }, |
| 1803 | 1795 | .callback = atkbd_deactivate_fixup, |
| 1804 | 1796 | }, |
| @@ -465,6 +465,13 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = { · 464 unmodified lines | ||
| 465 | 465 | DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"), |
| 466 | 466 | }, |
| 467 | 467 | }, |
| 468 | + { | |
| 469 | + /* Avatar AVIU-145A6 */ | |
| 470 | + .matches = { | |
| 471 | + DMI_MATCH(DMI_SYS_VENDOR, "Intel"), | |
| 472 | + DMI_MATCH(DMI_PRODUCT_NAME, "IC4I"), | |
| 473 | + }, | |
| 474 | + }, | |
| 468 | 475 | { } |
| 469 | 476 | }; |
| 470 | 477 | |
| @@ -608,6 +615,14 @@ static const struct dmi_system_id __initconst i8042_dmi_notimeout_table[] = { · 137 unmodified lines | ||
| 608 | 615 | DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"), |
| 609 | 616 | }, |
| 610 | 617 | }, |
| 618 | + { | |
| 619 | + /* Fujitsu U574 laptop */ | |
| 620 | + /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */ | |
| 621 | + .matches = { | |
| 622 | + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), | |
| 623 | + DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U574"), | |
| 624 | + }, | |
| 625 | + }, | |
| 611 | 626 | { } |
| 612 | 627 | }; |
| 613 | 628 | |
| @@ -1254,6 +1254,8 @@ static int __init i8042_create_aux_port(int idx) · 1253 unmodified lines | ||
| 1254 | 1254 | } else { |
| 1255 | 1255 | snprintf(serio->name, sizeof(serio->name), "i8042 AUX%d port", idx); |
| 1256 | 1256 | snprintf(serio->phys, sizeof(serio->phys), I8042_MUX_PHYS_DESC, idx + 1); |
| 1257 | + strlcpy(serio->firmware_id, i8042_aux_firmware_id, | |
| 1258 | + sizeof(serio->firmware_id)); | |
| 1257 | 1259 | } |
| 1258 | 1260 | |
| 1259 | 1261 | port->serio = serio; |
| @@ -182,7 +182,6 @@ config MEDIA_SUBDRV_AUTOSELECT · 181 unmodified lines | ||
| 182 | 182 | depends on HAS_IOMEM |
| 183 | 183 | select I2C |
| 184 | 184 | select I2C_MUX |
| 185 | − select SPI | |
| 186 | 185 | default y |
| 187 | 186 | help |
| 188 | 187 | By default, a media driver auto-selects all possible ancillary |
| @@ -280,6 +280,8 @@ · 279 unmodified lines | ||
| 280 | 280 | #define USB_PID_PCTV_400E 0x020f |
| 281 | 281 | #define USB_PID_PCTV_450E 0x0222 |
| 282 | 282 | #define USB_PID_PCTV_452E 0x021f |
| 283 | +#define USB_PID_PCTV_78E 0x025a | |
| 284 | +#define USB_PID_PCTV_79E 0x0262 | |
| 283 | 285 | #define USB_PID_REALTEK_RTL2831U 0x2831 |
| 284 | 286 | #define USB_PID_REALTEK_RTL2832U 0x2832 |
| 285 | 287 | #define USB_PID_TECHNOTREND_CONNECT_S2_3600 0x3007 |
| @@ -314,6 +314,19 @@ static int af9033_init(struct dvb_frontend *fe) · 313 unmodified lines | ||
| 314 | 314 | goto err; |
| 315 | 315 | } |
| 316 | 316 | |
| 317 | + /* feed clock to RF tuner */ | |
| 318 | + switch (state->cfg.tuner) { | |
| 319 | + case AF9033_TUNER_IT9135_38: | |
| 320 | + case AF9033_TUNER_IT9135_51: | |
| 321 | + case AF9033_TUNER_IT9135_52: | |
| 322 | + case AF9033_TUNER_IT9135_60: | |
| 323 | + case AF9033_TUNER_IT9135_61: | |
| 324 | + case AF9033_TUNER_IT9135_62: | |
| 325 | + ret = af9033_wr_reg(state, 0x80fba8, 0x00); | |
| 326 | + if (ret < 0) | |
| 327 | + goto err; | |
| 328 | + } | |
| 329 | + | |
| 317 | 330 | /* settings for TS interface */ |
| 318 | 331 | if (state->cfg.ts_mode == AF9033_TS_MODE_USB) { |
| 319 | 332 | ret = af9033_wr_reg_mask(state, 0x80f9a5, 0x00, 0x01); |
| @@ -1418,7 +1418,7 @@ static const struct reg_val tuner_init_it9135_60[] = { · 1417 unmodified lines | ||
| 1418 | 1418 | { 0x800068, 0x0a }, |
| 1419 | 1419 | { 0x80006a, 0x03 }, |
| 1420 | 1420 | { 0x800070, 0x0a }, |
| 1421 | − { 0x800071, 0x05 }, | |
| 1421 | + { 0x800071, 0x0a }, | |
| 1422 | 1422 | { 0x800072, 0x02 }, |
| 1423 | 1423 | { 0x800075, 0x8c }, |
| 1424 | 1424 | { 0x800076, 0x8c }, |
| @@ -1484,7 +1484,6 @@ static const struct reg_val tuner_init_it9135_60[] = { · 59 unmodified lines | ||
| 1484 | 1484 | { 0x800104, 0x02 }, |
| 1485 | 1485 | { 0x800105, 0xbe }, |
| 1486 | 1486 | { 0x800106, 0x00 }, |
| 1487 | − { 0x800109, 0x02 }, | |
| 1488 | 1487 | { 0x800115, 0x0a }, |
| 1489 | 1488 | { 0x800116, 0x03 }, |
| 1490 | 1489 | { 0x80011a, 0xbe }, |
| @@ -1510,7 +1509,6 @@ static const struct reg_val tuner_init_it9135_60[] = { · 19 unmodified lines | ||
| 1510 | 1509 | { 0x80014b, 0x8c }, |
| 1511 | 1510 | { 0x80014d, 0xac }, |
| 1512 | 1511 | { 0x80014e, 0xc6 }, |
| 1513 | − { 0x80014f, 0x03 }, | |
| 1514 | 1512 | { 0x800151, 0x1e }, |
| 1515 | 1513 | { 0x800153, 0xbc }, |
| 1516 | 1514 | { 0x800178, 0x09 }, |
| @@ -1522,9 +1520,10 @@ static const struct reg_val tuner_init_it9135_60[] = { · 5 unmodified lines | ||
| 1522 | 1520 | { 0x80018d, 0x5f }, |
| 1523 | 1521 | { 0x80018f, 0xa0 }, |
| 1524 | 1522 | { 0x800190, 0x5a }, |
| 1525 | − { 0x80ed02, 0xff }, | |
| 1526 | − { 0x80ee42, 0xff }, | |
| 1527 | − { 0x80ee82, 0xff }, | |
| 1523 | + { 0x800191, 0x00 }, | |
| 1524 | + { 0x80ed02, 0x40 }, | |
| 1525 | + { 0x80ee42, 0x40 }, | |
| 1526 | + { 0x80ee82, 0x40 }, | |
| 1528 | 1527 | { 0x80f000, 0x0f }, |
| 1529 | 1528 | { 0x80f01f, 0x8c }, |
| 1530 | 1529 | { 0x80f020, 0x00 }, |
| @@ -1699,7 +1698,6 @@ static const struct reg_val tuner_init_it9135_61[] = { · 168 unmodified lines | ||
| 1699 | 1698 | { 0x800104, 0x02 }, |
| 1700 | 1699 | { 0x800105, 0xc8 }, |
| 1701 | 1700 | { 0x800106, 0x00 }, |
| 1702 | − { 0x800109, 0x02 }, | |
| 1703 | 1701 | { 0x800115, 0x0a }, |
| 1704 | 1702 | { 0x800116, 0x03 }, |
| 1705 | 1703 | { 0x80011a, 0xc6 }, |
| @@ -1725,7 +1723,6 @@ static const struct reg_val tuner_init_it9135_61[] = { · 19 unmodified lines | ||
| 1725 | 1723 | { 0x80014b, 0x8c }, |
| 1726 | 1724 | { 0x80014d, 0xa8 }, |
| 1727 | 1725 | { 0x80014e, 0xc6 }, |
| 1728 | − { 0x80014f, 0x03 }, | |
| 1729 | 1726 | { 0x800151, 0x28 }, |
| 1730 | 1727 | { 0x800153, 0xcc }, |
| 1731 | 1728 | { 0x800178, 0x09 }, |
| @@ -1737,9 +1734,10 @@ static const struct reg_val tuner_init_it9135_61[] = { · 5 unmodified lines | ||
| 1737 | 1734 | { 0x80018d, 0x5f }, |
| 1738 | 1735 | { 0x80018f, 0xfb }, |
| 1739 | 1736 | { 0x800190, 0x5c }, |
| 1740 | − { 0x80ed02, 0xff }, | |
| 1741 | − { 0x80ee42, 0xff }, | |
| 1742 | − { 0x80ee82, 0xff }, | |
| 1737 | + { 0x800191, 0x00 }, | |
| 1738 | + { 0x80ed02, 0x40 }, | |
| 1739 | + { 0x80ee42, 0x40 }, | |
| 1740 | + { 0x80ee82, 0x40 }, | |
| 1743 | 1741 | { 0x80f000, 0x0f }, |
| 1744 | 1742 | { 0x80f01f, 0x8c }, |
| 1745 | 1743 | { 0x80f020, 0x00 }, |
| @@ -1282,19 +1282,12 @@ static int smiapp_set_power(struct v4l2_subdev *subdev, int on) · 1281 unmodified lines | ||
| 1282 | 1282 | |
| 1283 | 1283 | mutex_lock(&sensor->power_mutex); |
| 1284 | 1284 | |
| 1285 | − /* | |
| 1286 | − * If the power count is modified from 0 to != 0 or from != 0 | |
| 1287 | − * to 0, update the power state. | |
| 1288 | − */ | |
| 1289 | − if (!sensor->power_count == !on) | |
| 1290 | − goto out; | |
| 1291 | − | |
| 1292 | − if (on) { | |
| 1285 | + if (on && !sensor->power_count) { | |
| 1293 | 1286 | /* Power on and perform initialisation. */ |
| 1294 | 1287 | ret = smiapp_power_on(sensor); |
| 1295 | 1288 | if (ret < 0) |
| 1296 | 1289 | goto out; |
| 1297 | − } else { | |
| 1290 | + } else if (!on && sensor->power_count == 1) { | |
| 1298 | 1291 | smiapp_power_off(sensor); |
| 1299 | 1292 | } |
| 1300 | 1293 | |
| @@ -2572,7 +2565,7 @@ static int smiapp_registered(struct v4l2_subdev *subdev) · 1271 unmodified lines | ||
| 2572 | 2565 | |
| 2573 | 2566 | this->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; |
| 2574 | 2567 | this->sd.internal_ops = &smiapp_internal_ops; |
| 2575 | − this->sd.owner = NULL; | |
| 2568 | + this->sd.owner = THIS_MODULE; | |
| 2576 | 2569 | v4l2_set_subdevdata(&this->sd, client); |
| 2577 | 2570 | |
| 2578 | 2571 | rval = media_entity_init(&this->sd.entity, |
| @@ -1091,6 +1091,7 @@ static int cx18_probe(struct pci_dev *pci_dev, · 1090 unmodified lines | ||
| 1091 | 1091 | setup.addr = ADDR_UNSET; |
| 1092 | 1092 | setup.type = cx->options.tuner; |
| 1093 | 1093 | setup.mode_mask = T_ANALOG_TV; /* matches TV tuners */ |
| 1094 | + setup.config = NULL; | |
| 1094 | 1095 | if (cx->options.radio > 0) |
| 1095 | 1096 | setup.mode_mask |= T_RADIO; |
| 1096 | 1097 | setup.tuner_callback = (setup.type == TUNER_XC2028) ? |
| @@ -396,6 +396,7 @@ struct dvb_frontend *it913x_attach(struct dvb_frontend *fe, · 395 unmodified lines | ||
| 396 | 396 | struct i2c_adapter *i2c_adap, u8 i2c_addr, u8 config) |
| 397 | 397 | { |
| 398 | 398 | struct it913x_state *state = NULL; |
| 399 | + int ret; | |
| 399 | 400 | |
| 400 | 401 | /* allocate memory for the internal state */ |
| 401 | 402 | state = kzalloc(sizeof(struct it913x_state), GFP_KERNEL); |
| @@ -425,6 +426,11 @@ struct dvb_frontend *it913x_attach(struct dvb_frontend *fe, · 23 unmodified lines | ||
| 425 | 426 | state->tuner_type = config; |
| 426 | 427 | state->firmware_ver = 1; |
| 427 | 428 | |
| 429 | + /* tuner RF initial */ | |
| 430 | + ret = it913x_wr_reg(state, PRO_DMOD, 0xec4c, 0x68); | |
| 431 | + if (ret < 0) | |
| 432 | + goto error; | |
| 433 | + | |
| 428 | 434 | fe->tuner_priv = state; |
| 429 | 435 | memcpy(&fe->ops.tuner_ops, &it913x_tuner_ops, |
| 430 | 436 | sizeof(struct dvb_tuner_ops)); |
| @@ -1575,6 +1575,10 @@ static const struct usb_device_id af9035_id_table[] = { · 1574 unmodified lines | ||
| 1575 | 1575 | &af9035_props, "Leadtek WinFast DTV Dongle Dual", NULL) }, |
| 1576 | 1576 | { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xf900, |
| 1577 | 1577 | &af9035_props, "Hauppauge WinTV-MiniStick 2", NULL) }, |
| 1578 | + { DVB_USB_DEVICE(USB_VID_PCTV, USB_PID_PCTV_78E, | |
| 1579 | + &af9035_props, "PCTV 78e", RC_MAP_IT913X_V1) }, | |
| 1580 | + { DVB_USB_DEVICE(USB_VID_PCTV, USB_PID_PCTV_79E, | |
| 1581 | + &af9035_props, "PCTV 79e", RC_MAP_IT913X_V2) }, | |
| 1578 | 1582 | { } |
| 1579 | 1583 | }; |
| 1580 | 1584 | MODULE_DEVICE_TABLE(usb, af9035_id_table); |
| @@ -49,6 +49,9 @@ struct imx6_pcie { · 48 unmodified lines | ||
| 49 | 49 | |
| 50 | 50 | /* PCIe Port Logic registers (memory-mapped) */ |
| 51 | 51 | #define PL_OFFSET 0x700 |
| 52 | +#define PCIE_PL_PFLR (PL_OFFSET + 0x08) | |
| 53 | +#define PCIE_PL_PFLR_LINK_STATE_MASK (0x3f << 16) | |
| 54 | +#define PCIE_PL_PFLR_FORCE_LINK (1 << 15) | |
| 52 | 55 | #define PCIE_PHY_DEBUG_R0 (PL_OFFSET + 0x28) |
| 53 | 56 | #define PCIE_PHY_DEBUG_R1 (PL_OFFSET + 0x2c) |
| 54 | 57 | #define PCIE_PHY_DEBUG_R1_XMLH_LINK_IN_TRAINING (1 << 29) |
| @@ -214,6 +217,32 @@ static int imx6q_pcie_abort_handler(unsigned long addr, · 159 unmodified lines | ||
| 214 | 217 | static int imx6_pcie_assert_core_reset(struct pcie_port *pp) |
| 215 | 218 | { |
| 216 | 219 | struct imx6_pcie *imx6_pcie = to_imx6_pcie(pp); |
| 220 | + u32 val, gpr1, gpr12; | |
| 221 | + | |
| 222 | + /* | |
| 223 | + * If the bootloader already enabled the link we need some special | |
| 224 | + * handling to get the core back into a state where it is safe to | |
| 225 | + * touch it for configuration. As there is no dedicated reset signal | |
| 226 | + * wired up for MX6QDL, we need to manually force LTSSM into "detect" | |
| 227 | + * state before completely disabling LTSSM, which is a prerequisite | |
| 228 | + * for core configuration. | |
| 229 | + * | |
| 230 | + * If both LTSSM_ENABLE and REF_SSP_ENABLE are active we have a strong | |
| 231 | + * indication that the bootloader activated the link. | |
| 232 | + */ | |
| 233 | + regmap_read(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1, &gpr1); | |
| 234 | + regmap_read(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, &gpr12); | |
| 235 | + | |
| 236 | + if ((gpr1 & IMX6Q_GPR1_PCIE_REF_CLK_EN) && | |
| 237 | + (gpr12 & IMX6Q_GPR12_PCIE_CTL_2)) { | |
| 238 | + val = readl(pp->dbi_base + PCIE_PL_PFLR); | |
| 239 | + val &= ~PCIE_PL_PFLR_LINK_STATE_MASK; | |
| 240 | + val |= PCIE_PL_PFLR_FORCE_LINK; | |
| 241 | + writel(val, pp->dbi_base + PCIE_PL_PFLR); | |
| 242 | + | |
| 243 | + regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, | |
| 244 | + IMX6Q_GPR12_PCIE_CTL_2, 0 << 10); | |
| 245 | + } | |
| 217 | 246 | |
| 218 | 247 | regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1, |
| 219 | 248 | IMX6Q_GPR1_PCIE_TEST_PD, 1 << 18); |
| @@ -589,6 +618,14 @@ static int __init imx6_pcie_probe(struct platform_device *pdev) · 369 unmodified lines | ||
| 589 | 618 | return 0; |
| 590 | 619 | } |
| 591 | 620 | |
| 621 | +static void imx6_pcie_shutdown(struct platform_device *pdev) | |
| 622 | +{ | |
| 623 | + struct imx6_pcie *imx6_pcie = platform_get_drvdata(pdev); | |
| 624 | + | |
| 625 | + /* bring down link, so bootloader gets clean state in case of reboot */ | |
| 626 | + imx6_pcie_assert_core_reset(&imx6_pcie->pp); | |
| 627 | +} | |
| 628 | + | |
| 592 | 629 | static const struct of_device_id imx6_pcie_of_match[] = { |
| 593 | 630 | { .compatible = "fsl,imx6q-pcie", }, |
| 594 | 631 | {}, |
| @@ -601,6 +638,7 @@ static struct platform_driver imx6_pcie_driver = { · 6 unmodified lines | ||
| 601 | 638 | .owner = THIS_MODULE, |
| 602 | 639 | .of_match_table = imx6_pcie_of_match, |
| 603 | 640 | }, |
| 641 | + .shutdown = imx6_pcie_shutdown, | |
| 604 | 642 | }; |
| 605 | 643 | |
| 606 | 644 | /* Freescale PCIe driver does not allow module unload */ |
| @@ -560,19 +560,15 @@ static void disable_slot(struct acpiphp_slot *slot) · 559 unmodified lines | ||
| 560 | 560 | slot->flags &= (~SLOT_ENABLED); |
| 561 | 561 | } |
| 562 | 562 | |
| 563 | −static bool acpiphp_no_hotplug(struct acpi_device *adev) | |
| 564 | −{ | |
| 565 | − return adev && adev->flags.no_hotplug; | |
| 566 | −} | |
| 567 | − | |
| 568 | 563 | static bool slot_no_hotplug(struct acpiphp_slot *slot) |
| 569 | 564 | { |
| 570 | − struct acpiphp_func *func; | |
| 565 | + struct pci_bus *bus = slot->bus; | |
| 566 | + struct pci_dev *dev; | |
| 571 | 567 | |
| 572 | − list_for_each_entry(func, &slot->funcs, sibling) | |
| 573 | − if (acpiphp_no_hotplug(func_to_acpi_device(func))) | |
| 568 | + list_for_each_entry(dev, &bus->devices, bus_list) { | |
| 569 | + if (PCI_SLOT(dev->devfn) == slot->device && dev->ignore_hotplug) | |
| 574 | 570 | return true; |
| 575 | − | |
| 571 | + } | |
| 576 | 572 | return false; |
| 577 | 573 | } |
| 578 | 574 | |
| @@ -645,7 +641,7 @@ static void trim_stale_devices(struct pci_dev *dev) · 66 unmodified lines | ||
| 645 | 641 | |
| 646 | 642 | status = acpi_evaluate_integer(adev->handle, "_STA", NULL, &sta); |
| 647 | 643 | alive = (ACPI_SUCCESS(status) && device_status_valid(sta)) |
| 648 | − || acpiphp_no_hotplug(adev); | |
| 644 | + || dev->ignore_hotplug; | |
| 649 | 645 | } |
| 650 | 646 | if (!alive) |
| 651 | 647 | alive = pci_device_is_present(dev); |
| @@ -506,6 +506,8 @@ static irqreturn_t pcie_isr(int irq, void *dev_id) · 505 unmodified lines | ||
| 506 | 506 | { |
| 507 | 507 | struct controller *ctrl = (struct controller *)dev_id; |
| 508 | 508 | struct pci_dev *pdev = ctrl_dev(ctrl); |
| 509 | + struct pci_bus *subordinate = pdev->subordinate; | |
| 510 | + struct pci_dev *dev; | |
| 509 | 511 | struct slot *slot = ctrl->slot; |
| 510 | 512 | u16 detected, intr_loc; |
| 511 | 513 | |
| @@ -539,6 +541,16 @@ static irqreturn_t pcie_isr(int irq, void *dev_id) · 27 unmodified lines | ||
| 539 | 541 | wake_up(&ctrl->queue); |
| 540 | 542 | } |
| 541 | 543 | |
| 544 | + if (subordinate) { | |
| 545 | + list_for_each_entry(dev, &subordinate->devices, bus_list) { | |
| 546 | + if (dev->ignore_hotplug) { | |
| 547 | + ctrl_dbg(ctrl, "ignoring hotplug event %#06x (%s requested no hotplug)\n", | |
| 548 | + intr_loc, pci_name(dev)); | |
| 549 | + return IRQ_HANDLED; | |
| 550 | + } | |
| 551 | + } | |
| 552 | + } | |
| 553 | + | |
| 542 | 554 | if (!(intr_loc & ~PCI_EXP_SLTSTA_CC)) |
| 543 | 555 | return IRQ_HANDLED; |
| 544 | 556 | |
| @@ -46,7 +46,6 @@ static void program_hpp_type0(struct pci_dev *dev, struct hpp_type0 *hpp) · 45 unmodified lines | ||
| 46 | 46 | */ |
| 47 | 47 | if (pci_is_pcie(dev)) |
| 48 | 48 | return; |
| 49 | − dev_info(&dev->dev, "using default PCI settings\n"); | |
| 50 | 49 | hpp = &pci_default_type0; |
| 51 | 50 | } |
| 52 | 51 | |
| @@ -153,7 +152,6 @@ void pci_configure_slot(struct pci_dev *dev) · 100 unmodified lines | ||
| 153 | 152 | { |
| 154 | 153 | struct pci_dev *cdev; |
| 155 | 154 | struct hotplug_params hpp; |
| 156 | − int ret; | |
| 157 | 155 | |
| 158 | 156 | if (!(dev->hdr_type == PCI_HEADER_TYPE_NORMAL || |
| 159 | 157 | (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE && |
| @@ -163,9 +161,7 @@ void pci_configure_slot(struct pci_dev *dev) · 3 unmodified lines | ||
| 163 | 161 | pcie_bus_configure_settings(dev->bus); |
| 164 | 162 | |
| 165 | 163 | memset(&hpp, 0, sizeof(hpp)); |
| 166 | − ret = pci_get_hp_params(dev, &hpp); | |
| 167 | − if (ret) | |
| 168 | − dev_warn(&dev->dev, "no hotplug settings from platform\n"); | |
| 164 | + pci_get_hp_params(dev, &hpp); | |
| 169 | 165 | |
| 170 | 166 | program_hpp_type2(dev, hpp.t2); |
| 171 | 167 | program_hpp_type1(dev, hpp.t1); |
| @@ -214,12 +214,14 @@ config PHY_QCOM_IPQ806X_SATA · 213 unmodified lines | ||
| 214 | 214 | config PHY_ST_SPEAR1310_MIPHY |
| 215 | 215 | tristate "ST SPEAR1310-MIPHY driver" |
| 216 | 216 | select GENERIC_PHY |
| 217 | + depends on MACH_SPEAR1310 || COMPILE_TEST | |
| 217 | 218 | help |
| 218 | 219 | Support for ST SPEAr1310 MIPHY which can be used for PCIe and SATA. |
| 219 | 220 | |
| 220 | 221 | config PHY_ST_SPEAR1340_MIPHY |
| 221 | 222 | tristate "ST SPEAR1340-MIPHY driver" |
| 222 | 223 | select GENERIC_PHY |
| 224 | + depends on MACH_SPEAR1340 || COMPILE_TEST | |
| 223 | 225 | help |
| 224 | 226 | Support for ST SPEAr1340 MIPHY which can be used for PCIe and SATA. |
| 225 | 227 | |
| @@ -163,6 +163,7 @@ enum miphy_sata_gen { · 162 unmodified lines | ||
| 163 | 163 | }; |
| 164 | 164 | |
| 165 | 165 | static u8 rx_tx_spd[] = { |
| 166 | + 0, /* GEN0 doesn't exist. */ | |
| 166 | 167 | TX_SPDSEL_GEN1_VAL | RX_SPDSEL_GEN1_VAL, |
| 167 | 168 | TX_SPDSEL_GEN2_VAL | RX_SPDSEL_GEN2_VAL, |
| 168 | 169 | TX_SPDSEL_GEN3_VAL | RX_SPDSEL_GEN3_VAL |
| @@ -319,7 +319,7 @@ static int pm8607_regulator_dt_init(struct platform_device *pdev, · 318 unmodified lines | ||
| 319 | 319 | struct regulator_config *config) |
| 320 | 320 | { |
| 321 | 321 | struct device_node *nproot, *np; |
| 322 | − nproot = of_node_get(pdev->dev.parent->of_node); | |
| 322 | + nproot = pdev->dev.parent->of_node; | |
| 323 | 323 | if (!nproot) |
| 324 | 324 | return -ENODEV; |
| 325 | 325 | nproot = of_get_child_by_name(nproot, "regulators"); |
| @@ -422,9 +422,9 @@ static int da9052_regulator_probe(struct platform_device *pdev) · 421 unmodified lines | ||
| 422 | 422 | config.init_data = pdata->regulators[pdev->id]; |
| 423 | 423 | } else { |
| 424 | 424 | #ifdef CONFIG_OF |
| 425 | − struct device_node *nproot, *np; | |
| 425 | + struct device_node *nproot = da9052->dev->of_node; | |
| 426 | + struct device_node *np; | |
| 426 | 427 | |
| 427 | − nproot = of_node_get(da9052->dev->of_node); | |
| 428 | 428 | if (!nproot) |
| 429 | 429 | return -ENODEV; |
| 430 | 430 | |
| @@ -226,7 +226,7 @@ static int max8907_regulator_parse_dt(struct platform_device *pdev) · 225 unmodified lines | ||
| 226 | 226 | struct device_node *np, *regulators; |
| 227 | 227 | int ret; |
| 228 | 228 | |
| 229 | − np = of_node_get(pdev->dev.parent->of_node); | |
| 229 | + np = pdev->dev.parent->of_node; | |
| 230 | 230 | if (!np) |
| 231 | 231 | return 0; |
| 232 | 232 | |
| @@ -250,7 +250,7 @@ static int max8925_regulator_dt_init(struct platform_device *pdev, · 249 unmodified lines | ||
| 250 | 250 | struct device_node *nproot, *np; |
| 251 | 251 | int rcount; |
| 252 | 252 | |
| 253 | − nproot = of_node_get(pdev->dev.parent->of_node); | |
| 253 | + nproot = pdev->dev.parent->of_node; | |
| 254 | 254 | if (!nproot) |
| 255 | 255 | return -ENODEV; |
| 256 | 256 | np = of_get_child_by_name(nproot, "regulators"); |
| @@ -917,7 +917,7 @@ static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev, · 916 unmodified lines | ||
| 917 | 917 | struct max8997_regulator_data *rdata; |
| 918 | 918 | unsigned int i, dvs_voltage_nr = 1, ret; |
| 919 | 919 | |
| 920 | − pmic_np = of_node_get(iodev->dev->of_node); | |
| 920 | + pmic_np = iodev->dev->of_node; | |
| 921 | 921 | if (!pmic_np) { |
| 922 | 922 | dev_err(&pdev->dev, "could not find pmic sub-node\n"); |
| 923 | 923 | return -ENODEV; |
| @@ -1427,7 +1427,6 @@ static void palmas_dt_to_pdata(struct device *dev, · 1426 unmodified lines | ||
| 1427 | 1427 | u32 prop; |
| 1428 | 1428 | int idx, ret; |
| 1429 | 1429 | |
| 1430 | − node = of_node_get(node); | |
| 1431 | 1430 | regulators = of_get_child_by_name(node, "regulators"); |
| 1432 | 1431 | if (!regulators) { |
| 1433 | 1432 | dev_info(dev, "regulator node not found\n"); |
| @@ -1014,7 +1014,7 @@ static struct tps65910_board *tps65910_parse_dt_reg_data( · 1013 unmodified lines | ||
| 1014 | 1014 | if (!pmic_plat_data) |
| 1015 | 1015 | return NULL; |
| 1016 | 1016 | |
| 1017 | − np = of_node_get(pdev->dev.parent->of_node); | |
| 1017 | + np = pdev->dev.parent->of_node; | |
| 1018 | 1018 | regulators = of_get_child_by_name(np, "regulators"); |
| 1019 | 1019 | if (!regulators) { |
| 1020 | 1020 | dev_err(&pdev->dev, "regulator node not found\n"); |
| @@ -717,11 +717,21 @@ __iscsi_conn_send_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr, · 716 unmodified lines | ||
| 717 | 717 | return NULL; |
| 718 | 718 | } |
| 719 | 719 | |
| 720 | + if (data_size > ISCSI_DEF_MAX_RECV_SEG_LEN) { | |
| 721 | + iscsi_conn_printk(KERN_ERR, conn, "Invalid buffer len of %u for login task. Max len is %u\n", data_size, ISCSI_DEF_MAX_RECV_SEG_LEN); | |
| 722 | + return NULL; | |
| 723 | + } | |
| 724 | + | |
| 720 | 725 | task = conn->login_task; |
| 721 | 726 | } else { |
| 722 | 727 | if (session->state != ISCSI_STATE_LOGGED_IN) |
| 723 | 728 | return NULL; |
| 724 | 729 | |
| 730 | + if (data_size != 0) { | |
| 731 | + iscsi_conn_printk(KERN_ERR, conn, "Can not send data buffer of len %u for op 0x%x\n", data_size, opcode); | |
| 732 | + return NULL; | |
| 733 | + } | |
| 734 | + | |
| 725 | 735 | BUG_ON(conn->c_stage == ISCSI_CONN_INITIAL_STAGE); |
| 726 | 736 | BUG_ON(conn->c_stage == ISCSI_CONN_STOPPED); |
| 727 | 737 | |
| @@ -733,12 +733,13 @@ static bool scsi_end_request(struct request *req, int error, · 732 unmodified lines | ||
| 733 | 733 | } else { |
| 734 | 734 | unsigned long flags; |
| 735 | 735 | |
| 736 | + if (bidi_bytes) | |
| 737 | + scsi_release_bidi_buffers(cmd); | |
| 738 | + | |
| 736 | 739 | spin_lock_irqsave(q->queue_lock, flags); |
| 737 | 740 | blk_finish_request(req, error); |
| 738 | 741 | spin_unlock_irqrestore(q->queue_lock, flags); |
| 739 | 742 | |
| 740 | − if (bidi_bytes) | |
| 741 | − scsi_release_bidi_buffers(cmd); | |
| 742 | 743 | scsi_release_buffers(cmd); |
| 743 | 744 | scsi_next_command(cmd); |
| 744 | 745 | } |
| @@ -397,24 +397,21 @@ static int davinci_spi_setup(struct spi_device *spi) · 396 unmodified lines | ||
| 397 | 397 | struct spi_master *master = spi->master; |
| 398 | 398 | struct device_node *np = spi->dev.of_node; |
| 399 | 399 | bool internal_cs = true; |
| 400 | − unsigned long flags = GPIOF_DIR_OUT; | |
| 401 | 400 | |
| 402 | 401 | dspi = spi_master_get_devdata(spi->master); |
| 403 | 402 | pdata = &dspi->pdata; |
| 404 | 403 | |
| 405 | − flags |= (spi->mode & SPI_CS_HIGH) ? GPIOF_INIT_LOW : GPIOF_INIT_HIGH; | |
| 406 | − | |
| 407 | 404 | if (!(spi->mode & SPI_NO_CS)) { |
| 408 | 405 | if (np && (master->cs_gpios != NULL) && (spi->cs_gpio >= 0)) { |
| 409 | − retval = gpio_request_one(spi->cs_gpio, | |
| 410 | − flags, dev_name(&spi->dev)); | |
| 406 | + retval = gpio_direction_output( | |
| 407 | + spi->cs_gpio, !(spi->mode & SPI_CS_HIGH)); | |
| 411 | 408 | internal_cs = false; |
| 412 | 409 | } else if (pdata->chip_sel && |
| 413 | 410 | spi->chip_select < pdata->num_chipselect && |
| 414 | 411 | pdata->chip_sel[spi->chip_select] != SPI_INTERN_CS) { |
| 415 | 412 | spi->cs_gpio = pdata->chip_sel[spi->chip_select]; |
| 416 | − retval = gpio_request_one(spi->cs_gpio, | |
| 417 | − flags, dev_name(&spi->dev)); | |
| 413 | + retval = gpio_direction_output( | |
| 414 | + spi->cs_gpio, !(spi->mode & SPI_CS_HIGH)); | |
| 418 | 415 | internal_cs = false; |
| 419 | 416 | } |
| 420 | 417 | |
| @@ -439,12 +436,6 @@ static int davinci_spi_setup(struct spi_device *spi) · 18 unmodified lines | ||
| 439 | 436 | return retval; |
| 440 | 437 | } |
| 441 | 438 | |
| 442 | −static void davinci_spi_cleanup(struct spi_device *spi) | |
| 443 | −{ | |
| 444 | − if (spi->cs_gpio >= 0) | |
| 445 | − gpio_free(spi->cs_gpio); | |
| 446 | −} | |
| 447 | − | |
| 448 | 439 | static int davinci_spi_check_error(struct davinci_spi *dspi, int int_status) |
| 449 | 440 | { |
| 450 | 441 | struct device *sdev = dspi->bitbang.master->dev.parent; |
| @@ -956,7 +947,6 @@ static int davinci_spi_probe(struct platform_device *pdev) · 505 unmodified lines | ||
| 956 | 947 | master->num_chipselect = pdata->num_chipselect; |
| 957 | 948 | master->bits_per_word_mask = SPI_BPW_RANGE_MASK(2, 16); |
| 958 | 949 | master->setup = davinci_spi_setup; |
| 959 | − master->cleanup = davinci_spi_cleanup; | |
| 960 | 950 | |
| 961 | 951 | dspi->bitbang.chipselect = davinci_spi_chipselect; |
| 962 | 952 | dspi->bitbang.setup_transfer = davinci_spi_setup_transfer; |
| @@ -967,6 +957,27 @@ static int davinci_spi_probe(struct platform_device *pdev) · 4 unmodified lines | ||
| 967 | 957 | if (dspi->version == SPI_VERSION_2) |
| 968 | 958 | dspi->bitbang.flags |= SPI_READY; |
| 969 | 959 | |
| 960 | + if (pdev->dev.of_node) { | |
| 961 | + int i; | |
| 962 | + | |
| 963 | + for (i = 0; i < pdata->num_chipselect; i++) { | |
| 964 | + int cs_gpio = of_get_named_gpio(pdev->dev.of_node, | |
| 965 | + "cs-gpios", i); | |
| 966 | + | |
| 967 | + if (cs_gpio == -EPROBE_DEFER) { | |
| 968 | + ret = cs_gpio; | |
| 969 | + goto free_clk; | |
| 970 | + } | |
| 971 | + | |
| 972 | + if (gpio_is_valid(cs_gpio)) { | |
| 973 | + ret = devm_gpio_request(&pdev->dev, cs_gpio, | |
| 974 | + dev_name(&pdev->dev)); | |
| 975 | + if (ret) | |
| 976 | + goto free_clk; | |
| 977 | + } | |
| 978 | + } | |
| 979 | + } | |
| 980 | + | |
| 970 | 981 | r = platform_get_resource(pdev, IORESOURCE_DMA, 0); |
| 971 | 982 | if (r) |
| 972 | 983 | dma_rx_chan = r->start; |
| @@ -547,8 +547,7 @@ static int dw_spi_setup(struct spi_device *spi) · 546 unmodified lines | ||
| 547 | 547 | /* Only alloc on first setup */ |
| 548 | 548 | chip = spi_get_ctldata(spi); |
| 549 | 549 | if (!chip) { |
| 550 | − chip = devm_kzalloc(&spi->dev, sizeof(struct chip_data), | |
| 551 | − GFP_KERNEL); | |
| 550 | + chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL); | |
| 552 | 551 | if (!chip) |
| 553 | 552 | return -ENOMEM; |
| 554 | 553 | spi_set_ctldata(spi, chip); |
| @@ -606,6 +605,14 @@ static int dw_spi_setup(struct spi_device *spi) · 51 unmodified lines | ||
| 606 | 605 | return 0; |
| 607 | 606 | } |
| 608 | 607 | |
| 608 | +static void dw_spi_cleanup(struct spi_device *spi) | |
| 609 | +{ | |
| 610 | + struct chip_data *chip = spi_get_ctldata(spi); | |
| 611 | + | |
| 612 | + kfree(chip); | |
| 613 | + spi_set_ctldata(spi, NULL); | |
| 614 | +} | |
| 615 | + | |
| 609 | 616 | /* Restart the controller, disable all interrupts, clean rx fifo */ |
| 610 | 617 | static void spi_hw_init(struct dw_spi *dws) |
| 611 | 618 | { |
| @@ -661,6 +668,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws) · 49 unmodified lines | ||
| 661 | 668 | master->bus_num = dws->bus_num; |
| 662 | 669 | master->num_chipselect = dws->num_cs; |
| 663 | 670 | master->setup = dw_spi_setup; |
| 671 | + master->cleanup = dw_spi_cleanup; | |
| 664 | 672 | master->transfer_one_message = dw_spi_transfer_one_message; |
| 665 | 673 | master->max_speed_hz = dws->max_freq; |
| 666 | 674 | |
| @@ -452,16 +452,16 @@ static int fsl_espi_setup(struct spi_device *spi) · 451 unmodified lines | ||
| 452 | 452 | int retval; |
| 453 | 453 | u32 hw_mode; |
| 454 | 454 | u32 loop_mode; |
| 455 | − struct spi_mpc8xxx_cs *cs = spi->controller_state; | |
| 455 | + struct spi_mpc8xxx_cs *cs = spi_get_ctldata(spi); | |
| 456 | 456 | |
| 457 | 457 | if (!spi->max_speed_hz) |
| 458 | 458 | return -EINVAL; |
| 459 | 459 | |
| 460 | 460 | if (!cs) { |
| 461 | − cs = devm_kzalloc(&spi->dev, sizeof(*cs), GFP_KERNEL); | |
| 461 | + cs = kzalloc(sizeof(*cs), GFP_KERNEL); | |
| 462 | 462 | if (!cs) |
| 463 | 463 | return -ENOMEM; |
| 464 | − spi->controller_state = cs; | |
| 464 | + spi_set_ctldata(spi, cs); | |
| 465 | 465 | } |
| 466 | 466 | |
| 467 | 467 | mpc8xxx_spi = spi_master_get_devdata(spi->master); |
| @@ -496,6 +496,14 @@ static int fsl_espi_setup(struct spi_device *spi) · 28 unmodified lines | ||
| 496 | 496 | return 0; |
| 497 | 497 | } |
| 498 | 498 | |
| 499 | +static void fsl_espi_cleanup(struct spi_device *spi) | |
| 500 | +{ | |
| 501 | + struct spi_mpc8xxx_cs *cs = spi_get_ctldata(spi); | |
| 502 | + | |
| 503 | + kfree(cs); | |
| 504 | + spi_set_ctldata(spi, NULL); | |
| 505 | +} | |
| 506 | + | |
| 499 | 507 | void fsl_espi_cpu_irq(struct mpc8xxx_spi *mspi, u32 events) |
| 500 | 508 | { |
| 501 | 509 | struct fsl_espi_reg *reg_base = mspi->reg_base; |
| @@ -605,6 +613,7 @@ static struct spi_master * fsl_espi_probe(struct device *dev, · 103 unmodified lines | ||
| 605 | 613 | |
| 606 | 614 | master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 16); |
| 607 | 615 | master->setup = fsl_espi_setup; |
| 616 | + master->cleanup = fsl_espi_cleanup; | |
| 608 | 617 | |
| 609 | 618 | mpc8xxx_spi = spi_master_get_devdata(master); |
| 610 | 619 | mpc8xxx_spi->spi_do_one_msg = fsl_espi_do_one_msg; |
| @@ -425,16 +425,16 @@ static int fsl_spi_setup(struct spi_device *spi) · 424 unmodified lines | ||
| 425 | 425 | struct fsl_spi_reg *reg_base; |
| 426 | 426 | int retval; |
| 427 | 427 | u32 hw_mode; |
| 428 | − struct spi_mpc8xxx_cs *cs = spi->controller_state; | |
| 428 | + struct spi_mpc8xxx_cs *cs = spi_get_ctldata(spi); | |
| 429 | 429 | |
| 430 | 430 | if (!spi->max_speed_hz) |
| 431 | 431 | return -EINVAL; |
| 432 | 432 | |
| 433 | 433 | if (!cs) { |
| 434 | − cs = devm_kzalloc(&spi->dev, sizeof(*cs), GFP_KERNEL); | |
| 434 | + cs = kzalloc(sizeof(*cs), GFP_KERNEL); | |
| 435 | 435 | if (!cs) |
| 436 | 436 | return -ENOMEM; |
| 437 | − spi->controller_state = cs; | |
| 437 | + spi_set_ctldata(spi, cs); | |
| 438 | 438 | } |
| 439 | 439 | mpc8xxx_spi = spi_master_get_devdata(spi->master); |
| 440 | 440 | |
| @@ -496,9 +496,13 @@ static int fsl_spi_setup(struct spi_device *spi) · 55 unmodified lines | ||
| 496 | 496 | static void fsl_spi_cleanup(struct spi_device *spi) |
| 497 | 497 | { |
| 498 | 498 | struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master); |
| 499 | + struct spi_mpc8xxx_cs *cs = spi_get_ctldata(spi); | |
| 499 | 500 | |
| 500 | 501 | if (mpc8xxx_spi->type == TYPE_GRLIB && gpio_is_valid(spi->cs_gpio)) |
| 501 | 502 | gpio_free(spi->cs_gpio); |
| 503 | + | |
| 504 | + kfree(cs); | |
| 505 | + spi_set_ctldata(spi, NULL); | |
| 502 | 506 | } |
| 503 | 507 | |
| 504 | 508 | static void fsl_spi_cpu_irq(struct mpc8xxx_spi *mspi, u32 events) |
| @@ -2136,7 +2136,7 @@ static int pl022_probe(struct amba_device *adev, const struct amba_id *id) · 2135 unmodified lines | ||
| 2136 | 2136 | cs_gpio); |
| 2137 | 2137 | else if (gpio_direction_output(cs_gpio, 1)) |
| 2138 | 2138 | dev_err(&adev->dev, |
| 2139 | − "could set gpio %d as output\n", | |
| 2139 | + "could not set gpio %d as output\n", | |
| 2140 | 2140 | cs_gpio); |
| 2141 | 2141 | } |
| 2142 | 2142 | } |
| @@ -220,7 +220,7 @@ static inline void wait_for_idle(struct rockchip_spi *rs) · 219 unmodified lines | ||
| 220 | 220 | do { |
| 221 | 221 | if (!(readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY)) |
| 222 | 222 | return; |
| 223 | − } while (time_before(jiffies, timeout)); | |
| 223 | + } while (!time_after(jiffies, timeout)); | |
| 224 | 224 | |
| 225 | 225 | dev_warn(rs->dev, "spi controller is in busy state!\n"); |
| 226 | 226 | } |
| @@ -529,7 +529,8 @@ static int rockchip_spi_transfer_one( · 302 unmodified lines | ||
| 529 | 529 | int ret = 0; |
| 530 | 530 | struct rockchip_spi *rs = spi_master_get_devdata(master); |
| 531 | 531 | |
| 532 | − WARN_ON((readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY)); | |
| 532 | + WARN_ON(readl_relaxed(rs->regs + ROCKCHIP_SPI_SSIENR) && | |
| 533 | + (readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY)); | |
| 533 | 534 | |
| 534 | 535 | if (!xfer->tx_buf && !xfer->rx_buf) { |
| 535 | 536 | dev_err(rs->dev, "No buffer for transfer\n"); |
| @@ -312,6 +312,8 @@ static int spi_sirfsoc_cmd_transfer(struct spi_device *spi, · 311 unmodified lines | ||
| 312 | 312 | u32 cmd; |
| 313 | 313 | |
| 314 | 314 | sspi = spi_master_get_devdata(spi->master); |
| 315 | + writel(SIRFSOC_SPI_FIFO_RESET, sspi->base + SIRFSOC_SPI_TXFIFO_OP); | |
| 316 | + writel(SIRFSOC_SPI_FIFO_START, sspi->base + SIRFSOC_SPI_TXFIFO_OP); | |
| 315 | 317 | memcpy(&cmd, sspi->tx, t->len); |
| 316 | 318 | if (sspi->word_width == 1 && !(spi->mode & SPI_LSB_FIRST)) |
| 317 | 319 | cmd = cpu_to_be32(cmd) >> |
| @@ -438,7 +440,8 @@ static void spi_sirfsoc_pio_transfer(struct spi_device *spi, · 120 unmodified lines | ||
| 438 | 440 | sspi->tx_word(sspi); |
| 439 | 441 | writel(SIRFSOC_SPI_TXFIFO_EMPTY_INT_EN | |
| 440 | 442 | SIRFSOC_SPI_TX_UFLOW_INT_EN | |
| 441 | − SIRFSOC_SPI_RX_OFLOW_INT_EN, | |
| 443 | + SIRFSOC_SPI_RX_OFLOW_INT_EN | | |
| 444 | + SIRFSOC_SPI_RX_IO_DMA_INT_EN, | |
| 442 | 445 | sspi->base + SIRFSOC_SPI_INT_EN); |
| 443 | 446 | writel(SIRFSOC_SPI_RX_EN | SIRFSOC_SPI_TX_EN, |
| 444 | 447 | sspi->base + SIRFSOC_SPI_TX_RX_EN); |
| @@ -85,7 +85,7 @@ int ade7758_probe_trigger(struct iio_dev *indio_dev) · 84 unmodified lines | ||
| 85 | 85 | ret = iio_trigger_register(st->trig); |
| 86 | 86 | |
| 87 | 87 | /* select default trigger */ |
| 88 | − indio_dev->trig = st->trig; | |
| 88 | + indio_dev->trig = iio_trigger_get(st->trig); | |
| 89 | 89 | if (ret) |
| 90 | 90 | goto error_free_irq; |
| 91 | 91 | |
| @@ -350,6 +350,9 @@ static int hostap_set_generic_element(PSDevice pDevice, · 349 unmodified lines | ||
| 350 | 350 | { |
| 351 | 351 | PSMgmtObject pMgmt = pDevice->pMgmt; |
| 352 | 352 | |
| 353 | + if (param->u.generic_elem.len > sizeof(pMgmt->abyWPAIE)) | |
| 354 | + return -EINVAL; | |
| 355 | + | |
| 353 | 356 | memcpy(pMgmt->abyWPAIE, |
| 354 | 357 | param->u.generic_elem.data, |
| 355 | 358 | param->u.generic_elem.len |
| @@ -4540,6 +4540,7 @@ static void iscsit_logout_post_handler_diffcid( · 4539 unmodified lines | ||
| 4540 | 4540 | { |
| 4541 | 4541 | struct iscsi_conn *l_conn; |
| 4542 | 4542 | struct iscsi_session *sess = conn->sess; |
| 4543 | + bool conn_found = false; | |
| 4543 | 4544 | |
| 4544 | 4545 | if (!sess) |
| 4545 | 4546 | return; |
| @@ -4548,12 +4549,13 @@ static void iscsit_logout_post_handler_diffcid( · 2 unmodified lines | ||
| 4548 | 4549 | list_for_each_entry(l_conn, &sess->sess_conn_list, conn_list) { |
| 4549 | 4550 | if (l_conn->cid == cid) { |
| 4550 | 4551 | iscsit_inc_conn_usage_count(l_conn); |
| 4552 | + conn_found = true; | |
| 4551 | 4553 | break; |
| 4552 | 4554 | } |
| 4553 | 4555 | } |
| 4554 | 4556 | spin_unlock_bh(&sess->conn_lock); |
| 4555 | 4557 | |
| 4556 | − if (!l_conn) | |
| 4558 | + if (!conn_found) | |
| 4557 | 4559 | return; |
| 4558 | 4560 | |
| 4559 | 4561 | if (l_conn->sock) |
| @@ -601,7 +601,7 @@ int iscsi_copy_param_list( · 600 unmodified lines | ||
| 601 | 601 | param_list = kzalloc(sizeof(struct iscsi_param_list), GFP_KERNEL); |
| 602 | 602 | if (!param_list) { |
| 603 | 603 | pr_err("Unable to allocate memory for struct iscsi_param_list.\n"); |
| 604 | − goto err_out; | |
| 604 | + return -1; | |
| 605 | 605 | } |
| 606 | 606 | INIT_LIST_HEAD(¶m_list->param_list); |
| 607 | 607 | INIT_LIST_HEAD(¶m_list->extra_response_list); |
| @@ -400,6 +400,8 @@ struct iscsi_cmd *iscsit_find_cmd_from_itt_or_dump( · 399 unmodified lines | ||
| 400 | 400 | |
| 401 | 401 | spin_lock_bh(&conn->cmd_lock); |
| 402 | 402 | list_for_each_entry(cmd, &conn->conn_cmd_list, i_conn_node) { |
| 403 | + if (cmd->cmd_flags & ICF_GOT_LAST_DATAOUT) | |
| 404 | + continue; | |
| 403 | 405 | if (cmd->init_task_tag == init_task_tag) { |
| 404 | 406 | spin_unlock_bh(&conn->cmd_lock); |
| 405 | 407 | return cmd; |
| @@ -2363,7 +2363,7 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_alua_support_##_name(\ · 2362 unmodified lines | ||
| 2363 | 2363 | pr_err("Invalid value '%ld', must be '0' or '1'\n", tmp); \ |
| 2364 | 2364 | return -EINVAL; \ |
| 2365 | 2365 | } \ |
| 2366 | − if (!tmp) \ | |
| 2366 | + if (tmp) \ | |
| 2367 | 2367 | t->_var |= _bit; \ |
| 2368 | 2368 | else \ |
| 2369 | 2369 | t->_var &= ~_bit; \ |
| @@ -664,7 +664,7 @@ spc_emulate_evpd_b3(struct se_cmd *cmd, unsigned char *buf) · 663 unmodified lines | ||
| 664 | 664 | buf[0] = dev->transport->get_device_type(dev); |
| 665 | 665 | buf[3] = 0x0c; |
| 666 | 666 | put_unaligned_be32(dev->t10_alua.lba_map_segment_size, &buf[8]); |
| 667 | − put_unaligned_be32(dev->t10_alua.lba_map_segment_size, &buf[12]); | |
| 667 | + put_unaligned_be32(dev->t10_alua.lba_map_segment_multiplier, &buf[12]); | |
| 668 | 668 | |
| 669 | 669 | return 0; |
| 670 | 670 | } |
| @@ -965,8 +965,6 @@ rescan: · 964 unmodified lines | ||
| 965 | 965 | } |
| 966 | 966 | |
| 967 | 967 | qh->exception = 1; |
| 968 | − if (ehci->rh_state < EHCI_RH_RUNNING) | |
| 969 | − qh->qh_state = QH_STATE_IDLE; | |
| 970 | 968 | switch (qh->qh_state) { |
| 971 | 969 | case QH_STATE_LINKED: |
| 972 | 970 | WARN_ON(!list_empty(&qh->qtd_list)); |
| @@ -101,6 +101,12 @@ UNUSUAL_DEV( 0x03f0, 0x4002, 0x0001, 0x0001, · 100 unmodified lines | ||
| 101 | 101 | "PhotoSmart R707", |
| 102 | 102 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_FIX_CAPACITY), |
| 103 | 103 | |
| 104 | +UNUSUAL_DEV( 0x03f3, 0x0001, 0x0000, 0x9999, | |
| 105 | + "Adaptec", | |
| 106 | + "USBConnect 2000", | |
| 107 | + USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init, | |
| 108 | + US_FL_SCM_MULT_TARG ), | |
| 109 | + | |
| 104 | 110 | /* Reported by Sebastian Kapfer <sebastian_kapfer@gmx.net> |
| 105 | 111 | * and Olaf Hering <olh@suse.de> (different bcd's, same vendor/product) |
| 106 | 112 | * for USB floppies that need the SINGLE_LUN enforcement. |
| @@ -1125,6 +1131,18 @@ UNUSUAL_DEV( 0x0851, 0x1543, 0x0200, 0x0200, · 1018 unmodified lines | ||
| 1125 | 1131 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, |
| 1126 | 1132 | US_FL_NOT_LOCKABLE), |
| 1127 | 1133 | |
| 1134 | +UNUSUAL_DEV( 0x085a, 0x0026, 0x0100, 0x0133, | |
| 1135 | + "Xircom", | |
| 1136 | + "PortGear USB-SCSI (Mac USB Dock)", | |
| 1137 | + USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init, | |
| 1138 | + US_FL_SCM_MULT_TARG ), | |
| 1139 | + | |
| 1140 | +UNUSUAL_DEV( 0x085a, 0x0028, 0x0100, 0x0133, | |
| 1141 | + "Xircom", | |
| 1142 | + "PortGear USB to SCSI Converter", | |
| 1143 | + USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init, | |
| 1144 | + US_FL_SCM_MULT_TARG ), | |
| 1145 | + | |
| 1128 | 1146 | /* Submitted by Jan De Luyck <lkml@kcore.org> */ |
| 1129 | 1147 | UNUSUAL_DEV( 0x08bd, 0x1100, 0x0000, 0x0000, |
| 1130 | 1148 | "CITIZEN", |
| @@ -1964,6 +1982,14 @@ UNUSUAL_DEV( 0x152d, 0x2329, 0x0100, 0x0100, · 833 unmodified lines | ||
| 1964 | 1982 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, |
| 1965 | 1983 | US_FL_IGNORE_RESIDUE | US_FL_SANE_SENSE ), |
| 1966 | 1984 | |
| 1985 | +/* Entrega Technologies U1-SC25 (later Xircom PortGear PGSCSI) | |
| 1986 | + * and Mac USB Dock USB-SCSI */ | |
| 1987 | +UNUSUAL_DEV( 0x1645, 0x0007, 0x0100, 0x0133, | |
| 1988 | + "Entrega Technologies", | |
| 1989 | + "USB to SCSI Converter", | |
| 1990 | + USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init, | |
| 1991 | + US_FL_SCM_MULT_TARG ), | |
| 1992 | + | |
| 1967 | 1993 | /* Reported by Robert Schedel <r.schedel@yahoo.de> |
| 1968 | 1994 | * Note: this is a 'super top' device like the above 14cd/6600 device */ |
| 1969 | 1995 | UNUSUAL_DEV( 0x1652, 0x6600, 0x0201, 0x0201, |
| @@ -1986,6 +2012,12 @@ UNUSUAL_DEV( 0x177f, 0x0400, 0x0000, 0x0000, · 16 unmodified lines | ||
| 1986 | 2012 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, |
| 1987 | 2013 | US_FL_BULK_IGNORE_TAG | US_FL_MAX_SECTORS_64 ), |
| 1988 | 2014 | |
| 2015 | +UNUSUAL_DEV( 0x1822, 0x0001, 0x0000, 0x9999, | |
| 2016 | + "Ariston Technologies", | |
| 2017 | + "iConnect USB to SCSI adapter", | |
| 2018 | + USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init, | |
| 2019 | + US_FL_SCM_MULT_TARG ), | |
| 2020 | + | |
| 1989 | 2021 | /* Reported by Hans de Goede <hdegoede@redhat.com> |
| 1990 | 2022 | * These Appotech controllers are found in Picture Frames, they provide a |
| 1991 | 2023 | * (buggy) emulation of a cdrom drive which contains the windows software |
| @@ -234,8 +234,17 @@ static inline int btrfs_inode_in_log(struct inode *inode, u64 generation) · 233 unmodified lines | ||
| 234 | 234 | BTRFS_I(inode)->last_sub_trans <= |
| 235 | 235 | BTRFS_I(inode)->last_log_commit && |
| 236 | 236 | BTRFS_I(inode)->last_sub_trans <= |
| 237 | − BTRFS_I(inode)->root->last_log_commit) | |
| 238 | − return 1; | |
| 237 | + BTRFS_I(inode)->root->last_log_commit) { | |
| 238 | + /* | |
| 239 | + * After a ranged fsync we might have left some extent maps | |
| 240 | + * (that fall outside the fsync's range). So return false | |
| 241 | + * here if the list isn't empty, to make sure btrfs_log_inode() | |
| 242 | + * will be called and process those extent maps. | |
| 243 | + */ | |
| 244 | + smp_mb(); | |
| 245 | + if (list_empty(&BTRFS_I(inode)->extent_tree.modified_extents)) | |
| 246 | + return 1; | |
| 247 | + } | |
| 239 | 248 | return 0; |
| 240 | 249 | } |
| 241 | 250 | |
| @@ -4093,18 +4093,8 @@ log_extents: · 4092 unmodified lines | ||
| 4093 | 4093 | } |
| 4094 | 4094 | } |
| 4095 | 4095 | |
| 4096 | − write_lock(&em_tree->lock); | |
| 4097 | − /* | |
| 4098 | − * If we're doing a ranged fsync and there are still modified extents | |
| 4099 | − * in the list, we must run on the next fsync call as it might cover | |
| 4100 | − * those extents (a full fsync or an fsync for other range). | |
| 4101 | − */ | |
| 4102 | − if (list_empty(&em_tree->modified_extents)) { | |
| 4103 | − BTRFS_I(inode)->logged_trans = trans->transid; | |
| 4104 | − BTRFS_I(inode)->last_log_commit = | |
| 4105 | − BTRFS_I(inode)->last_sub_trans; | |
| 4106 | − } | |
| 4107 | − write_unlock(&em_tree->lock); | |
| 4096 | + BTRFS_I(inode)->logged_trans = trans->transid; | |
| 4097 | + BTRFS_I(inode)->last_log_commit = BTRFS_I(inode)->last_sub_trans; | |
| 4108 | 4098 | out_unlock: |
| 4109 | 4099 | if (unlikely(err)) |
| 4110 | 4100 | btrfs_put_logged_extents(&logged_list); |
| @@ -529,12 +529,12 @@ static noinline int device_list_add(const char *path, · 528 unmodified lines | ||
| 529 | 529 | */ |
| 530 | 530 | |
| 531 | 531 | /* |
| 532 | − * As of now don't allow update to btrfs_fs_device through | |
| 533 | − * the btrfs dev scan cli, after FS has been mounted. | |
| 532 | + * For now, we do allow update to btrfs_fs_device through the | |
| 533 | + * btrfs dev scan cli after FS has been mounted. We're still | |
| 534 | + * tracking a problem where systems fail mount by subvolume id | |
| 535 | + * when we reject replacement on a mounted FS. | |
| 534 | 536 | */ |
| 535 | − if (fs_devices->opened) { | |
| 536 | − return -EBUSY; | |
| 537 | − } else { | |
| 537 | + if (!fs_devices->opened && found_transid < device->generation) { | |
| 538 | 538 | /* |
| 539 | 539 | * That is if the FS is _not_ mounted and if you |
| 540 | 540 | * are here, that means there is more than one |
| @@ -542,8 +542,7 @@ static noinline int device_list_add(const char *path, · 1 unmodified line | ||
| 542 | 542 | * with larger generation number or the last-in if |
| 543 | 543 | * generation are equal. |
| 544 | 544 | */ |
| 545 | − if (found_transid < device->generation) | |
| 546 | − return -EEXIST; | |
| 545 | + return -EEXIST; | |
| 547 | 546 | } |
| 548 | 547 | |
| 549 | 548 | name = rcu_string_strdup(path, GFP_NOFS); |
| @@ -136,5 +136,5 @@ extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg); · 135 unmodified lines | ||
| 136 | 136 | extern const struct export_operations cifs_export_ops; |
| 137 | 137 | #endif /* CONFIG_CIFS_NFSD_EXPORT */ |
| 138 | 138 | |
| 139 | −#define CIFS_VERSION "2.04" | |
| 139 | +#define CIFS_VERSION "2.05" | |
| 140 | 140 | #endif /* _CIFSFS_H */ |
| @@ -837,6 +837,7 @@ cifs_demultiplex_thread(void *p) · 836 unmodified lines | ||
| 837 | 837 | struct TCP_Server_Info *server = p; |
| 838 | 838 | unsigned int pdu_length; |
| 839 | 839 | char *buf = NULL; |
| 840 | + struct task_struct *task_to_wake = NULL; | |
| 840 | 841 | struct mid_q_entry *mid_entry; |
| 841 | 842 | |
| 842 | 843 | current->flags |= PF_MEMALLOC; |
| @@ -927,7 +928,19 @@ cifs_demultiplex_thread(void *p) · 84 unmodified lines | ||
| 927 | 928 | if (server->smallbuf) /* no sense logging a debug message if NULL */ |
| 928 | 929 | cifs_small_buf_release(server->smallbuf); |
| 929 | 930 | |
| 931 | + task_to_wake = xchg(&server->tsk, NULL); | |
| 930 | 932 | clean_demultiplex_info(server); |
| 933 | + | |
| 934 | + /* if server->tsk was NULL then wait for a signal before exiting */ | |
| 935 | + if (!task_to_wake) { | |
| 936 | + set_current_state(TASK_INTERRUPTIBLE); | |
| 937 | + while (!signal_pending(current)) { | |
| 938 | + schedule(); | |
| 939 | + set_current_state(TASK_INTERRUPTIBLE); | |
| 940 | + } | |
| 941 | + set_current_state(TASK_RUNNING); | |
| 942 | + } | |
| 943 | + | |
| 931 | 944 | module_put_and_exit(0); |
| 932 | 945 | } |
| 933 | 946 | |
| @@ -2050,6 +2063,8 @@ cifs_find_tcp_session(struct smb_vol *vol) · 1116 unmodified lines | ||
| 2050 | 2063 | static void |
| 2051 | 2064 | cifs_put_tcp_session(struct TCP_Server_Info *server) |
| 2052 | 2065 | { |
| 2066 | + struct task_struct *task; | |
| 2067 | + | |
| 2053 | 2068 | spin_lock(&cifs_tcp_ses_lock); |
| 2054 | 2069 | if (--server->srv_count > 0) { |
| 2055 | 2070 | spin_unlock(&cifs_tcp_ses_lock); |
| @@ -2073,6 +2088,10 @@ cifs_put_tcp_session(struct TCP_Server_Info *server) · 17 unmodified lines | ||
| 2073 | 2088 | kfree(server->session_key.response); |
| 2074 | 2089 | server->session_key.response = NULL; |
| 2075 | 2090 | server->session_key.len = 0; |
| 2091 | + | |
| 2092 | + task = xchg(&server->tsk, NULL); | |
| 2093 | + if (task) | |
| 2094 | + force_sig(SIGKILL, task); | |
| 2076 | 2095 | } |
| 2077 | 2096 | |
| 2078 | 2097 | static struct TCP_Server_Info * |
| @@ -213,8 +213,12 @@ create_mf_symlink(const unsigned int xid, struct cifs_tcon *tcon, · 212 unmodified lines | ||
| 213 | 213 | if (rc) |
| 214 | 214 | goto out; |
| 215 | 215 | |
| 216 | − rc = tcon->ses->server->ops->create_mf_symlink(xid, tcon, cifs_sb, | |
| 217 | − fromName, buf, &bytes_written); | |
| 216 | + if (tcon->ses->server->ops->create_mf_symlink) | |
| 217 | + rc = tcon->ses->server->ops->create_mf_symlink(xid, tcon, | |
| 218 | + cifs_sb, fromName, buf, &bytes_written); | |
| 219 | + else | |
| 220 | + rc = -EOPNOTSUPP; | |
| 221 | + | |
| 218 | 222 | if (rc) |
| 219 | 223 | goto out; |
| 220 | 224 | |
| @@ -339,9 +343,11 @@ cifs_query_mf_symlink(unsigned int xid, struct cifs_tcon *tcon, · 118 unmodified lines | ||
| 339 | 343 | if (rc) |
| 340 | 344 | return rc; |
| 341 | 345 | |
| 342 | − if (file_info.EndOfFile != cpu_to_le64(CIFS_MF_SYMLINK_FILE_SIZE)) | |
| 346 | + if (file_info.EndOfFile != cpu_to_le64(CIFS_MF_SYMLINK_FILE_SIZE)) { | |
| 347 | + rc = -ENOENT; | |
| 343 | 348 | /* it's not a symlink */ |
| 344 | 349 | goto out; |
| 350 | + } | |
| 345 | 351 | |
| 346 | 352 | io_parms.netfid = fid.netfid; |
| 347 | 353 | io_parms.pid = current->tgid; |
| @@ -925,11 +925,23 @@ cifs_NTtimeToUnix(__le64 ntutc) · 924 unmodified lines | ||
| 925 | 925 | /* BB what about the timezone? BB */ |
| 926 | 926 | |
| 927 | 927 | /* Subtract the NTFS time offset, then convert to 1s intervals. */ |
| 928 | − u64 t; | |
| 928 | + s64 t = le64_to_cpu(ntutc) - NTFS_TIME_OFFSET; | |
| 929 | + | |
| 930 | + /* | |
| 931 | + * Unfortunately can not use normal 64 bit division on 32 bit arch, but | |
| 932 | + * the alternative, do_div, does not work with negative numbers so have | |
| 933 | + * to special case them | |
| 934 | + */ | |
| 935 | + if (t < 0) { | |
| 936 | + t = -t; | |
| 937 | + ts.tv_nsec = (long)(do_div(t, 10000000) * 100); | |
| 938 | + ts.tv_nsec = -ts.tv_nsec; | |
| 939 | + ts.tv_sec = -t; | |
| 940 | + } else { | |
| 941 | + ts.tv_nsec = (long)do_div(t, 10000000) * 100; | |
| 942 | + ts.tv_sec = t; | |
| 943 | + } | |
| 929 | 944 | |
| 930 | − t = le64_to_cpu(ntutc) - NTFS_TIME_OFFSET; | |
| 931 | − ts.tv_nsec = do_div(t, 10000000) * 100; | |
| 932 | − ts.tv_sec = t; | |
| 933 | 945 | return ts; |
| 934 | 946 | } |
| 935 | 947 | |
| @@ -745,14 +745,6 @@ out: · 744 unmodified lines | ||
| 745 | 745 | sess_free_buffer(sess_data); |
| 746 | 746 | } |
| 747 | 747 | |
| 748 | −#else | |
| 749 | − | |
| 750 | −static void | |
| 751 | −sess_auth_lanman(struct sess_data *sess_data) | |
| 752 | −{ | |
| 753 | − sess_data->result = -EOPNOTSUPP; | |
| 754 | − sess_data->func = NULL; | |
| 755 | −} | |
| 756 | 748 | #endif |
| 757 | 749 | |
| 758 | 750 | static void |
| @@ -1103,15 +1095,6 @@ out: · 344 unmodified lines | ||
| 1103 | 1095 | ses->auth_key.response = NULL; |
| 1104 | 1096 | } |
| 1105 | 1097 | |
| 1106 | −#else | |
| 1107 | − | |
| 1108 | −static void | |
| 1109 | −sess_auth_kerberos(struct sess_data *sess_data) | |
| 1110 | −{ | |
| 1111 | − cifs_dbg(VFS, "Kerberos negotiated but upcall support disabled!\n"); | |
| 1112 | − sess_data->result = -ENOSYS; | |
| 1113 | − sess_data->func = NULL; | |
| 1114 | −} | |
| 1115 | 1098 | #endif /* ! CONFIG_CIFS_UPCALL */ |
| 1116 | 1099 | |
| 1117 | 1100 | /* |
| @@ -359,7 +359,7 @@ static inline void release_metapath(struct metapath *mp) · 358 unmodified lines | ||
| 359 | 359 | * Returns: The length of the extent (minimum of one block) |
| 360 | 360 | */ |
| 361 | 361 | |
| 362 | −static inline unsigned int gfs2_extent_length(void *start, unsigned int len, __be64 *ptr, unsigned limit, int *eob) | |
| 362 | +static inline unsigned int gfs2_extent_length(void *start, unsigned int len, __be64 *ptr, size_t limit, int *eob) | |
| 363 | 363 | { |
| 364 | 364 | const __be64 *end = (start + len); |
| 365 | 365 | const __be64 *first = ptr; |
| @@ -449,7 +449,7 @@ static int gfs2_bmap_alloc(struct inode *inode, const sector_t lblock, · 83 unmodified lines | ||
| 449 | 449 | struct buffer_head *bh_map, struct metapath *mp, |
| 450 | 450 | const unsigned int sheight, |
| 451 | 451 | const unsigned int height, |
| 452 | − const unsigned int maxlen) | |
| 452 | + const size_t maxlen) | |
| 453 | 453 | { |
| 454 | 454 | struct gfs2_inode *ip = GFS2_I(inode); |
| 455 | 455 | struct gfs2_sbd *sdp = GFS2_SB(inode); |
| @@ -483,7 +483,8 @@ static int gfs2_bmap_alloc(struct inode *inode, const sector_t lblock, · 27 unmodified lines | ||
| 483 | 483 | } else { |
| 484 | 484 | /* Need to allocate indirect blocks */ |
| 485 | 485 | ptrs_per_blk = height > 1 ? sdp->sd_inptrs : sdp->sd_diptrs; |
| 486 | − dblks = min(maxlen, ptrs_per_blk - mp->mp_list[end_of_metadata]); | |
| 486 | + dblks = min(maxlen, (size_t)(ptrs_per_blk - | |
| 487 | + mp->mp_list[end_of_metadata])); | |
| 487 | 488 | if (height == ip->i_height) { |
| 488 | 489 | /* Writing into existing tree, extend tree down */ |
| 489 | 490 | iblks = height - sheight; |
| @@ -605,7 +606,7 @@ int gfs2_block_map(struct inode *inode, sector_t lblock, · 115 unmodified lines | ||
| 605 | 606 | struct gfs2_inode *ip = GFS2_I(inode); |
| 606 | 607 | struct gfs2_sbd *sdp = GFS2_SB(inode); |
| 607 | 608 | unsigned int bsize = sdp->sd_sb.sb_bsize; |
| 608 | − const unsigned int maxlen = bh_map->b_size >> inode->i_blkbits; | |
| 609 | + const size_t maxlen = bh_map->b_size >> inode->i_blkbits; | |
| 609 | 610 | const u64 *arr = sdp->sd_heightsize; |
| 610 | 611 | __be64 *ptr; |
| 611 | 612 | u64 size; |
| @@ -26,6 +26,7 @@ · 25 unmodified lines | ||
| 26 | 26 | #include <linux/dlm.h> |
| 27 | 27 | #include <linux/dlm_plock.h> |
| 28 | 28 | #include <linux/aio.h> |
| 29 | +#include <linux/delay.h> | |
| 29 | 30 | |
| 30 | 31 | #include "gfs2.h" |
| 31 | 32 | #include "incore.h" |
| @@ -979,9 +980,10 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl) · 947 unmodified lines | ||
| 979 | 980 | unsigned int state; |
| 980 | 981 | int flags; |
| 981 | 982 | int error = 0; |
| 983 | + int sleeptime; | |
| 982 | 984 | |
| 983 | 985 | state = (fl->fl_type == F_WRLCK) ? LM_ST_EXCLUSIVE : LM_ST_SHARED; |
| 984 | − flags = (IS_SETLKW(cmd) ? 0 : LM_FLAG_TRY) | GL_EXACT; | |
| 986 | + flags = (IS_SETLKW(cmd) ? 0 : LM_FLAG_TRY_1CB) | GL_EXACT; | |
| 985 | 987 | |
| 986 | 988 | mutex_lock(&fp->f_fl_mutex); |
| 987 | 989 | |
| @@ -1001,7 +1003,14 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl) · 13 unmodified lines | ||
| 1001 | 1003 | gfs2_holder_init(gl, state, flags, fl_gh); |
| 1002 | 1004 | gfs2_glock_put(gl); |
| 1003 | 1005 | } |
| 1004 | − error = gfs2_glock_nq(fl_gh); | |
| 1006 | + for (sleeptime = 1; sleeptime <= 4; sleeptime <<= 1) { | |
| 1007 | + error = gfs2_glock_nq(fl_gh); | |
| 1008 | + if (error != GLR_TRYFAILED) | |
| 1009 | + break; | |
| 1010 | + fl_gh->gh_flags = LM_FLAG_TRY | GL_EXACT; | |
| 1011 | + fl_gh->gh_error = 0; | |
| 1012 | + msleep(sleeptime); | |
| 1013 | + } | |
| 1005 | 1014 | if (error) { |
| 1006 | 1015 | gfs2_holder_uninit(fl_gh); |
| 1007 | 1016 | if (error == GLR_TRYFAILED) |
| @@ -1024,7 +1033,7 @@ static void do_unflock(struct file *file, struct file_lock *fl) · 16 unmodified lines | ||
| 1024 | 1033 | mutex_lock(&fp->f_fl_mutex); |
| 1025 | 1034 | flock_lock_file_wait(file, fl); |
| 1026 | 1035 | if (fl_gh->gh_gl) { |
| 1027 | − gfs2_glock_dq_wait(fl_gh); | |
| 1036 | + gfs2_glock_dq(fl_gh); | |
| 1028 | 1037 | gfs2_holder_uninit(fl_gh); |
| 1029 | 1038 | } |
| 1030 | 1039 | mutex_unlock(&fp->f_fl_mutex); |
| @@ -262,6 +262,9 @@ struct gfs2_holder { · 261 unmodified lines | ||
| 262 | 262 | unsigned long gh_ip; |
| 263 | 263 | }; |
| 264 | 264 | |
| 265 | +/* Number of quota types we support */ | |
| 266 | +#define GFS2_MAXQUOTAS 2 | |
| 267 | + | |
| 265 | 268 | /* Resource group multi-block reservation, in order of appearance: |
| 266 | 269 | |
| 267 | 270 | Step 1. Function prepares to write, allocates a mb, sets the size hint. |
| @@ -282,8 +285,8 @@ struct gfs2_blkreserv { · 14 unmodified lines | ||
| 282 | 285 | u64 rs_inum; /* Inode number for reservation */ |
| 283 | 286 | |
| 284 | 287 | /* ancillary quota stuff */ |
| 285 | − struct gfs2_quota_data *rs_qa_qd[2 * MAXQUOTAS]; | |
| 286 | − struct gfs2_holder rs_qa_qd_ghs[2 * MAXQUOTAS]; | |
| 288 | + struct gfs2_quota_data *rs_qa_qd[2 * GFS2_MAXQUOTAS]; | |
| 289 | + struct gfs2_holder rs_qa_qd_ghs[2 * GFS2_MAXQUOTAS]; | |
| 287 | 290 | unsigned int rs_qa_qd_num; |
| 288 | 291 | }; |
| 289 | 292 | |
| @@ -626,8 +626,10 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry, · 625 unmodified lines | ||
| 626 | 626 | if (!IS_ERR(inode)) { |
| 627 | 627 | d = d_splice_alias(inode, dentry); |
| 628 | 628 | error = PTR_ERR(d); |
| 629 | − if (IS_ERR(d)) | |
| 629 | + if (IS_ERR(d)) { | |
| 630 | + inode = ERR_CAST(d); | |
| 630 | 631 | goto fail_gunlock; |
| 632 | + } | |
| 631 | 633 | error = 0; |
| 632 | 634 | if (file) { |
| 633 | 635 | if (S_ISREG(inode->i_mode)) { |
| @@ -840,8 +842,10 @@ static struct dentry *__gfs2_lookup(struct inode *dir, struct dentry *dentry, · 206 unmodified lines | ||
| 840 | 842 | int error; |
| 841 | 843 | |
| 842 | 844 | inode = gfs2_lookupi(dir, &dentry->d_name, 0); |
| 843 | − if (!inode) | |
| 845 | + if (inode == NULL) { | |
| 846 | + d_add(dentry, NULL); | |
| 844 | 847 | return NULL; |
| 848 | + } | |
| 845 | 849 | if (IS_ERR(inode)) |
| 846 | 850 | return ERR_CAST(inode); |
| 847 | 851 | |
| @@ -854,7 +858,6 @@ static struct dentry *__gfs2_lookup(struct inode *dir, struct dentry *dentry, · 6 unmodified lines | ||
| 854 | 858 | |
| 855 | 859 | d = d_splice_alias(inode, dentry); |
| 856 | 860 | if (IS_ERR(d)) { |
| 857 | − iput(inode); | |
| 858 | 861 | gfs2_glock_dq_uninit(&gh); |
| 859 | 862 | return d; |
| 860 | 863 | } |
| @@ -1294,7 +1294,7 @@ static int gfs2_show_options(struct seq_file *s, struct dentry *root) · 1293 unmodified lines | ||
| 1294 | 1294 | int val; |
| 1295 | 1295 | |
| 1296 | 1296 | if (is_ancestor(root, sdp->sd_master_dir)) |
| 1297 | − seq_printf(s, ",meta"); | |
| 1297 | + seq_puts(s, ",meta"); | |
| 1298 | 1298 | if (args->ar_lockproto[0]) |
| 1299 | 1299 | seq_printf(s, ",lockproto=%s", args->ar_lockproto); |
| 1300 | 1300 | if (args->ar_locktable[0]) |
| @@ -1302,13 +1302,13 @@ static int gfs2_show_options(struct seq_file *s, struct dentry *root) · 1 unmodified line | ||
| 1302 | 1302 | if (args->ar_hostdata[0]) |
| 1303 | 1303 | seq_printf(s, ",hostdata=%s", args->ar_hostdata); |
| 1304 | 1304 | if (args->ar_spectator) |
| 1305 | − seq_printf(s, ",spectator"); | |
| 1305 | + seq_puts(s, ",spectator"); | |
| 1306 | 1306 | if (args->ar_localflocks) |
| 1307 | − seq_printf(s, ",localflocks"); | |
| 1307 | + seq_puts(s, ",localflocks"); | |
| 1308 | 1308 | if (args->ar_debug) |
| 1309 | − seq_printf(s, ",debug"); | |
| 1309 | + seq_puts(s, ",debug"); | |
| 1310 | 1310 | if (args->ar_posix_acl) |
| 1311 | − seq_printf(s, ",acl"); | |
| 1311 | + seq_puts(s, ",acl"); | |
| 1312 | 1312 | if (args->ar_quota != GFS2_QUOTA_DEFAULT) { |
| 1313 | 1313 | char *state; |
| 1314 | 1314 | switch (args->ar_quota) { |
| @@ -1328,7 +1328,7 @@ static int gfs2_show_options(struct seq_file *s, struct dentry *root) · 13 unmodified lines | ||
| 1328 | 1328 | seq_printf(s, ",quota=%s", state); |
| 1329 | 1329 | } |
| 1330 | 1330 | if (args->ar_suiddir) |
| 1331 | − seq_printf(s, ",suiddir"); | |
| 1331 | + seq_puts(s, ",suiddir"); | |
| 1332 | 1332 | if (args->ar_data != GFS2_DATA_DEFAULT) { |
| 1333 | 1333 | char *state; |
| 1334 | 1334 | switch (args->ar_data) { |
| @@ -1345,7 +1345,7 @@ static int gfs2_show_options(struct seq_file *s, struct dentry *root) · 10 unmodified lines | ||
| 1345 | 1345 | seq_printf(s, ",data=%s", state); |
| 1346 | 1346 | } |
| 1347 | 1347 | if (args->ar_discard) |
| 1348 | − seq_printf(s, ",discard"); | |
| 1348 | + seq_puts(s, ",discard"); | |
| 1349 | 1349 | val = sdp->sd_tune.gt_logd_secs; |
| 1350 | 1350 | if (val != 30) |
| 1351 | 1351 | seq_printf(s, ",commit=%d", val); |
| @@ -1376,11 +1376,11 @@ static int gfs2_show_options(struct seq_file *s, struct dentry *root) · 24 unmodified lines | ||
| 1376 | 1376 | seq_printf(s, ",errors=%s", state); |
| 1377 | 1377 | } |
| 1378 | 1378 | if (test_bit(SDF_NOBARRIERS, &sdp->sd_flags)) |
| 1379 | − seq_printf(s, ",nobarrier"); | |
| 1379 | + seq_puts(s, ",nobarrier"); | |
| 1380 | 1380 | if (test_bit(SDF_DEMOTE, &sdp->sd_flags)) |
| 1381 | − seq_printf(s, ",demote_interface_used"); | |
| 1381 | + seq_puts(s, ",demote_interface_used"); | |
| 1382 | 1382 | if (args->ar_rgrplvb) |
| 1383 | − seq_printf(s, ",rgrplvb"); | |
| 1383 | + seq_puts(s, ",rgrplvb"); | |
| 1384 | 1384 | return 0; |
| 1385 | 1385 | } |
| 1386 | 1386 | |
| @@ -1674,14 +1674,13 @@ EXPORT_SYMBOL(full_name_hash); · 1673 unmodified lines | ||
| 1674 | 1674 | |
| 1675 | 1675 | /* |
| 1676 | 1676 | * Calculate the length and hash of the path component, and |
| 1677 | − * fill in the qstr. return the "len" as the result. | |
| 1677 | + * return the "hash_len" as the result. | |
| 1678 | 1678 | */ |
| 1679 | −static inline unsigned long hash_name(const char *name, struct qstr *res) | |
| 1679 | +static inline u64 hash_name(const char *name) | |
| 1680 | 1680 | { |
| 1681 | 1681 | unsigned long a, b, adata, bdata, mask, hash, len; |
| 1682 | 1682 | const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS; |
| 1683 | 1683 | |
| 1684 | − res->name = name; | |
| 1685 | 1684 | hash = a = 0; |
| 1686 | 1685 | len = -sizeof(unsigned long); |
| 1687 | 1686 | do { |
| @@ -1698,9 +1697,7 @@ static inline unsigned long hash_name(const char *name, struct qstr *res) · 10 unmodified lines | ||
| 1698 | 1697 | |
| 1699 | 1698 | hash += a & zero_bytemask(mask); |
| 1700 | 1699 | len += find_zero(mask); |
| 1701 | − res->hash_len = hashlen_create(fold_hash(hash), len); | |
| 1702 | − | |
| 1703 | − return len; | |
| 1700 | + return hashlen_create(fold_hash(hash), len); | |
| 1704 | 1701 | } |
| 1705 | 1702 | |
| 1706 | 1703 | #else |
| @@ -1718,20 +1715,18 @@ EXPORT_SYMBOL(full_name_hash); · 11 unmodified lines | ||
| 1718 | 1715 | * We know there's a real path component here of at least |
| 1719 | 1716 | * one character. |
| 1720 | 1717 | */ |
| 1721 | −static inline long hash_name(const char *name, struct qstr *res) | |
| 1718 | +static inline u64 hash_name(const char *name) | |
| 1722 | 1719 | { |
| 1723 | 1720 | unsigned long hash = init_name_hash(); |
| 1724 | 1721 | unsigned long len = 0, c; |
| 1725 | 1722 | |
| 1726 | − res->name = name; | |
| 1727 | 1723 | c = (unsigned char)*name; |
| 1728 | 1724 | do { |
| 1729 | 1725 | len++; |
| 1730 | 1726 | hash = partial_name_hash(c, hash); |
| 1731 | 1727 | c = (unsigned char)name[len]; |
| 1732 | 1728 | } while (c && c != '/'); |
| 1733 | − res->hash_len = hashlen_create(end_name_hash(hash), len); | |
| 1734 | − return len; | |
| 1729 | + return hashlen_create(end_name_hash(hash), len); | |
| 1735 | 1730 | } |
| 1736 | 1731 | |
| 1737 | 1732 | #endif |
| @@ -1756,18 +1751,17 @@ static int link_path_walk(const char *name, struct nameidata *nd) · 18 unmodified lines | ||
| 1756 | 1751 | |
| 1757 | 1752 | /* At this point we know we have a real path component. */ |
| 1758 | 1753 | for(;;) { |
| 1759 | − struct qstr this; | |
| 1760 | − long len; | |
| 1754 | + u64 hash_len; | |
| 1761 | 1755 | int type; |
| 1762 | 1756 | |
| 1763 | 1757 | err = may_lookup(nd); |
| 1764 | 1758 | if (err) |
| 1765 | 1759 | break; |
| 1766 | 1760 | |
| 1767 | − len = hash_name(name, &this); | |
| 1761 | + hash_len = hash_name(name); | |
| 1768 | 1762 | |
| 1769 | 1763 | type = LAST_NORM; |
| 1770 | − if (name[0] == '.') switch (len) { | |
| 1764 | + if (name[0] == '.') switch (hashlen_len(hash_len)) { | |
| 1771 | 1765 | case 2: |
| 1772 | 1766 | if (name[1] == '.') { |
| 1773 | 1767 | type = LAST_DOTDOT; |
| @@ -1781,29 +1775,32 @@ static int link_path_walk(const char *name, struct nameidata *nd) · 7 unmodified lines | ||
| 1781 | 1775 | struct dentry *parent = nd->path.dentry; |
| 1782 | 1776 | nd->flags &= ~LOOKUP_JUMPED; |
| 1783 | 1777 | if (unlikely(parent->d_flags & DCACHE_OP_HASH)) { |
| 1778 | + struct qstr this = { { .hash_len = hash_len }, .name = name }; | |
| 1784 | 1779 | err = parent->d_op->d_hash(parent, &this); |
| 1785 | 1780 | if (err < 0) |
| 1786 | 1781 | break; |
| 1782 | + hash_len = this.hash_len; | |
| 1783 | + name = this.name; | |
| 1787 | 1784 | } |
| 1788 | 1785 | } |
| 1789 | 1786 | |
| 1790 | − nd->last = this; | |
| 1787 | + nd->last.hash_len = hash_len; | |
| 1788 | + nd->last.name = name; | |
| 1791 | 1789 | nd->last_type = type; |
| 1792 | 1790 | |
| 1793 | − if (!name[len]) | |
| 1791 | + name += hashlen_len(hash_len); | |
| 1792 | + if (!*name) | |
| 1794 | 1793 | return 0; |
| 1795 | 1794 | /* |
| 1796 | 1795 | * If it wasn't NUL, we know it was '/'. Skip that |
| 1797 | 1796 | * slash, and continue until no more slashes. |
| 1798 | 1797 | */ |
| 1799 | 1798 | do { |
| 1800 | − len++; | |
| 1801 | − } while (unlikely(name[len] == '/')); | |
| 1802 | − if (!name[len]) | |
| 1799 | + name++; | |
| 1800 | + } while (unlikely(*name == '/')); | |
| 1801 | + if (!*name) | |
| 1803 | 1802 | return 0; |
| 1804 | 1803 | |
| 1805 | − name += len; | |
| 1806 | − | |
| 1807 | 1804 | err = walk_component(nd, &next, LOOKUP_FOLLOW); |
| 1808 | 1805 | if (err < 0) |
| 1809 | 1806 | return err; |
| @@ -482,6 +482,16 @@ int nfs40_walk_client_list(struct nfs_client *new, · 481 unmodified lines | ||
| 482 | 482 | |
| 483 | 483 | spin_lock(&nn->nfs_client_lock); |
| 484 | 484 | list_for_each_entry(pos, &nn->nfs_client_list, cl_share_link) { |
| 485 | + | |
| 486 | + if (pos->rpc_ops != new->rpc_ops) | |
| 487 | + continue; | |
| 488 | + | |
| 489 | + if (pos->cl_proto != new->cl_proto) | |
| 490 | + continue; | |
| 491 | + | |
| 492 | + if (pos->cl_minorversion != new->cl_minorversion) | |
| 493 | + continue; | |
| 494 | + | |
| 485 | 495 | /* If "pos" isn't marked ready, we can't trust the |
| 486 | 496 | * remaining fields in "pos" */ |
| 487 | 497 | if (pos->cl_cons_state > NFS_CS_READY) { |
| @@ -501,15 +511,6 @@ int nfs40_walk_client_list(struct nfs_client *new, · 13 unmodified lines | ||
| 501 | 511 | if (pos->cl_cons_state != NFS_CS_READY) |
| 502 | 512 | continue; |
| 503 | 513 | |
| 504 | − if (pos->rpc_ops != new->rpc_ops) | |
| 505 | − continue; | |
| 506 | − | |
| 507 | − if (pos->cl_proto != new->cl_proto) | |
| 508 | − continue; | |
| 509 | − | |
| 510 | − if (pos->cl_minorversion != new->cl_minorversion) | |
| 511 | − continue; | |
| 512 | − | |
| 513 | 514 | if (pos->cl_clientid != new->cl_clientid) |
| 514 | 515 | continue; |
| 515 | 516 | |
| @@ -622,6 +623,16 @@ int nfs41_walk_client_list(struct nfs_client *new, · 106 unmodified lines | ||
| 622 | 623 | |
| 623 | 624 | spin_lock(&nn->nfs_client_lock); |
| 624 | 625 | list_for_each_entry(pos, &nn->nfs_client_list, cl_share_link) { |
| 626 | + | |
| 627 | + if (pos->rpc_ops != new->rpc_ops) | |
| 628 | + continue; | |
| 629 | + | |
| 630 | + if (pos->cl_proto != new->cl_proto) | |
| 631 | + continue; | |
| 632 | + | |
| 633 | + if (pos->cl_minorversion != new->cl_minorversion) | |
| 634 | + continue; | |
| 635 | + | |
| 625 | 636 | /* If "pos" isn't marked ready, we can't trust the |
| 626 | 637 | * remaining fields in "pos", especially the client |
| 627 | 638 | * ID and serverowner fields. Wait for CREATE_SESSION |
| @@ -647,15 +658,6 @@ int nfs41_walk_client_list(struct nfs_client *new, · 19 unmodified lines | ||
| 647 | 658 | if (pos->cl_cons_state != NFS_CS_READY) |
| 648 | 659 | continue; |
| 649 | 660 | |
| 650 | − if (pos->rpc_ops != new->rpc_ops) | |
| 651 | − continue; | |
| 652 | − | |
| 653 | − if (pos->cl_proto != new->cl_proto) | |
| 654 | − continue; | |
| 655 | − | |
| 656 | − if (pos->cl_minorversion != new->cl_minorversion) | |
| 657 | − continue; | |
| 658 | − | |
| 659 | 661 | if (!nfs4_match_clientids(pos, new)) |
| 660 | 662 | continue; |
| 661 | 663 | |
| @@ -2226,9 +2226,13 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata, · 2225 unmodified lines | ||
| 2226 | 2226 | ret = _nfs4_proc_open(opendata); |
| 2227 | 2227 | if (ret != 0) { |
| 2228 | 2228 | if (ret == -ENOENT) { |
| 2229 | − d_drop(opendata->dentry); | |
| 2230 | − d_add(opendata->dentry, NULL); | |
| 2231 | − nfs_set_verifier(opendata->dentry, | |
| 2229 | + dentry = opendata->dentry; | |
| 2230 | + if (dentry->d_inode) | |
| 2231 | + d_delete(dentry); | |
| 2232 | + else if (d_unhashed(dentry)) | |
| 2233 | + d_add(dentry, NULL); | |
| 2234 | + | |
| 2235 | + nfs_set_verifier(dentry, | |
| 2232 | 2236 | nfs_save_change_attribute(opendata->dir->d_inode)); |
| 2233 | 2237 | } |
| 2234 | 2238 | goto out; |
| @@ -2614,23 +2618,23 @@ static void nfs4_close_prepare(struct rpc_task *task, void *data) · 379 unmodified lines | ||
| 2614 | 2618 | is_rdwr = test_bit(NFS_O_RDWR_STATE, &state->flags); |
| 2615 | 2619 | is_rdonly = test_bit(NFS_O_RDONLY_STATE, &state->flags); |
| 2616 | 2620 | is_wronly = test_bit(NFS_O_WRONLY_STATE, &state->flags); |
| 2617 | − /* Calculate the current open share mode */ | |
| 2618 | − calldata->arg.fmode = 0; | |
| 2619 | − if (is_rdonly || is_rdwr) | |
| 2620 | − calldata->arg.fmode |= FMODE_READ; | |
| 2621 | − if (is_wronly || is_rdwr) | |
| 2622 | − calldata->arg.fmode |= FMODE_WRITE; | |
| 2623 | 2621 | /* Calculate the change in open mode */ |
| 2622 | + calldata->arg.fmode = 0; | |
| 2624 | 2623 | if (state->n_rdwr == 0) { |
| 2625 | − if (state->n_rdonly == 0) { | |
| 2626 | − call_close |= is_rdonly || is_rdwr; | |
| 2627 | − calldata->arg.fmode &= ~FMODE_READ; | |
| 2628 | − } | |
| 2629 | − if (state->n_wronly == 0) { | |
| 2630 | − call_close |= is_wronly || is_rdwr; | |
| 2631 | − calldata->arg.fmode &= ~FMODE_WRITE; | |
| 2632 | − } | |
| 2633 | − } | |
| 2624 | + if (state->n_rdonly == 0) | |
| 2625 | + call_close |= is_rdonly; | |
| 2626 | + else if (is_rdonly) | |
| 2627 | + calldata->arg.fmode |= FMODE_READ; | |
| 2628 | + if (state->n_wronly == 0) | |
| 2629 | + call_close |= is_wronly; | |
| 2630 | + else if (is_wronly) | |
| 2631 | + calldata->arg.fmode |= FMODE_WRITE; | |
| 2632 | + } else if (is_rdwr) | |
| 2633 | + calldata->arg.fmode |= FMODE_READ|FMODE_WRITE; | |
| 2634 | + | |
| 2635 | + if (calldata->arg.fmode == 0) | |
| 2636 | + call_close |= is_rdwr; | |
| 2637 | + | |
| 2634 | 2638 | if (!nfs4_valid_open_stateid(state)) |
| 2635 | 2639 | call_close = 0; |
| 2636 | 2640 | spin_unlock(&state->owner->so_lock); |
| @@ -205,10 +205,9 @@ struct acpi_device_flags { · 204 unmodified lines | ||
| 205 | 205 | u32 match_driver:1; |
| 206 | 206 | u32 initialized:1; |
| 207 | 207 | u32 visited:1; |
| 208 | − u32 no_hotplug:1; | |
| 209 | 208 | u32 hotplug_notify:1; |
| 210 | 209 | u32 is_dock_station:1; |
| 211 | − u32 reserved:22; | |
| 210 | + u32 reserved:23; | |
| 212 | 211 | }; |
| 213 | 212 | |
| 214 | 213 | /* File System */ |
| @@ -412,7 +411,6 @@ void acpi_bus_private_data_handler(acpi_handle, void *); · 197 unmodified lines | ||
| 412 | 411 | int acpi_bus_get_private_data(acpi_handle, void **); |
| 413 | 412 | int acpi_bus_attach_private_data(acpi_handle, void *); |
| 414 | 413 | void acpi_bus_detach_private_data(acpi_handle); |
| 415 | −void acpi_bus_no_hotplug(acpi_handle handle); | |
| 416 | 414 | extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32); |
| 417 | 415 | extern int register_acpi_notifier(struct notifier_block *); |
| 418 | 416 | extern int unregister_acpi_notifier(struct notifier_block *); |
| @@ -162,12 +162,25 @@ static inline size_t drbg_max_request_bytes(struct drbg_state *drbg) · 161 unmodified lines | ||
| 162 | 162 | |
| 163 | 163 | static inline size_t drbg_max_addtl(struct drbg_state *drbg) |
| 164 | 164 | { |
| 165 | +#if (__BITS_PER_LONG == 32) | |
| 166 | + /* | |
| 167 | + * SP800-90A allows smaller maximum numbers to be returned -- we | |
| 168 | + * return SIZE_MAX - 1 to allow the verification of the enforcement | |
| 169 | + * of this value in drbg_healthcheck_sanity. | |
| 170 | + */ | |
| 171 | + return (SIZE_MAX - 1); | |
| 172 | +#else | |
| 165 | 173 | return (1UL<<(drbg->core->max_addtllen)); |
| 174 | +#endif | |
| 166 | 175 | } |
| 167 | 176 | |
| 168 | 177 | static inline size_t drbg_max_requests(struct drbg_state *drbg) |
| 169 | 178 | { |
| 179 | +#if (__BITS_PER_LONG == 32) | |
| 180 | + return SIZE_MAX; | |
| 181 | +#else | |
| 170 | 182 | return (1UL<<(drbg->core->max_req)); |
| 183 | +#endif | |
| 171 | 184 | } |
| 172 | 185 | |
| 173 | 186 | /* |
| @@ -84,10 +84,12 @@ static inline void iio_trigger_put(struct iio_trigger *trig) · 83 unmodified lines | ||
| 84 | 84 | put_device(&trig->dev); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | −static inline void iio_trigger_get(struct iio_trigger *trig) | |
| 87 | +static inline struct iio_trigger *iio_trigger_get(struct iio_trigger *trig) | |
| 88 | 88 | { |
| 89 | 89 | get_device(&trig->dev); |
| 90 | 90 | __module_get(trig->ops->owner); |
| 91 | + | |
| 92 | + return trig; | |
| 91 | 93 | } |
| 92 | 94 | |
| 93 | 95 | /** |
| @@ -303,6 +303,7 @@ struct pci_dev { · 302 unmodified lines | ||
| 303 | 303 | D3cold, not set for devices |
| 304 | 304 | powered on/off by the |
| 305 | 305 | corresponding bridge */ |
| 306 | + unsigned int ignore_hotplug:1; /* Ignore hotplug events */ | |
| 306 | 307 | unsigned int d3_delay; /* D3->D0 transition time in ms */ |
| 307 | 308 | unsigned int d3cold_delay; /* D3cold->D0 transition time in ms */ |
| 308 | 309 | |
| @@ -1021,6 +1022,11 @@ bool pci_dev_run_wake(struct pci_dev *dev); · 712 unmodified lines | ||
| 1021 | 1022 | bool pci_check_pme_status(struct pci_dev *dev); |
| 1022 | 1023 | void pci_pme_wakeup_bus(struct pci_bus *bus); |
| 1023 | 1024 | |
| 1025 | +static inline void pci_ignore_hotplug(struct pci_dev *dev) | |
| 1026 | +{ | |
| 1027 | + dev->ignore_hotplug = 1; | |
| 1028 | +} | |
| 1029 | + | |
| 1024 | 1030 | static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, |
| 1025 | 1031 | bool enable) |
| 1026 | 1032 | { |
| @@ -64,6 +64,7 @@ int vga_switcheroo_get_client_state(struct pci_dev *dev); · 63 unmodified lines | ||
| 64 | 64 | void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic); |
| 65 | 65 | |
| 66 | 66 | int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *domain); |
| 67 | +void vga_switcheroo_fini_domain_pm_ops(struct device *dev); | |
| 67 | 68 | int vga_switcheroo_init_domain_pm_optimus_hdmi_audio(struct device *dev, struct dev_pm_domain *domain); |
| 68 | 69 | #else |
| 69 | 70 | |
| @@ -82,6 +83,7 @@ static inline int vga_switcheroo_get_client_state(struct pci_dev *dev) { return · 12 unmodified lines | ||
| 82 | 83 | static inline void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic) {} |
| 83 | 84 | |
| 84 | 85 | static inline int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *domain) { return -EINVAL; } |
| 86 | +static inline void vga_switcheroo_fini_domain_pm_ops(struct device *dev) {} | |
| 85 | 87 | static inline int vga_switcheroo_init_domain_pm_optimus_hdmi_audio(struct device *dev, struct dev_pm_domain *domain) { return -EINVAL; } |
| 86 | 88 | |
| 87 | 89 | #endif |
| @@ -182,7 +182,6 @@ extern void vga_put(struct pci_dev *pdev, unsigned int rsrc); · 181 unmodified lines | ||
| 182 | 182 | * vga_get()... |
| 183 | 183 | */ |
| 184 | 184 | |
| 185 | −#ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE | |
| 186 | 185 | #ifdef CONFIG_VGA_ARB |
| 187 | 186 | extern struct pci_dev *vga_default_device(void); |
| 188 | 187 | extern void vga_set_default_device(struct pci_dev *pdev); |
| @@ -190,7 +189,6 @@ extern void vga_set_default_device(struct pci_dev *pdev); · 1 unmodified line | ||
| 190 | 189 | static inline struct pci_dev *vga_default_device(void) { return NULL; }; |
| 191 | 190 | static inline void vga_set_default_device(struct pci_dev *pdev) { }; |
| 192 | 191 | #endif |
| 193 | −#endif | |
| 194 | 192 | |
| 195 | 193 | /** |
| 196 | 194 | * vga_conflicts |
| @@ -68,7 +68,7 @@ static inline void scsi_activate_tcq(struct scsi_device *sdev, int depth) · 67 unmodified lines | ||
| 68 | 68 | return; |
| 69 | 69 | |
| 70 | 70 | if (!shost_use_blk_mq(sdev->host) && |
| 71 | − blk_queue_tagged(sdev->request_queue)) | |
| 71 | + !blk_queue_tagged(sdev->request_queue)) | |
| 72 | 72 | blk_queue_init_tags(sdev->request_queue, depth, |
| 73 | 73 | sdev->host->bqt); |
| 74 | 74 | |
| @@ -539,6 +539,12 @@ void __init prepare_namespace(void) · 538 unmodified lines | ||
| 539 | 539 | { |
| 540 | 540 | int is_floppy; |
| 541 | 541 | |
| 542 | + if (root_delay) { | |
| 543 | + printk(KERN_INFO "Waiting %d sec before mounting root device...\n", | |
| 544 | + root_delay); | |
| 545 | + ssleep(root_delay); | |
| 546 | + } | |
| 547 | + | |
| 542 | 548 | /* |
| 543 | 549 | * wait for the known devices to complete their probing |
| 544 | 550 | * |
| @@ -565,12 +571,6 @@ void __init prepare_namespace(void) · 20 unmodified lines | ||
| 565 | 571 | if (initrd_load()) |
| 566 | 572 | goto out; |
| 567 | 573 | |
| 568 | − if (root_delay) { | |
| 569 | − pr_info("Waiting %d sec before mounting root device...\n", | |
| 570 | − root_delay); | |
| 571 | − ssleep(root_delay); | |
| 572 | − } | |
| 573 | − | |
| 574 | 574 | /* wait for any asynchronous scanning to complete */ |
| 575 | 575 | if ((ROOT_DEV == 0) && root_wait) { |
| 576 | 576 | printk(KERN_INFO "Waiting for root device %s...\n", |
| @@ -1524,6 +1524,11 @@ retry: · 1523 unmodified lines | ||
| 1524 | 1524 | */ |
| 1525 | 1525 | if (ctx->is_active) { |
| 1526 | 1526 | raw_spin_unlock_irq(&ctx->lock); |
| 1527 | + /* | |
| 1528 | + * Reload the task pointer, it might have been changed by | |
| 1529 | + * a concurrent perf_event_context_sched_out(). | |
| 1530 | + */ | |
| 1531 | + task = ctx->task; | |
| 1527 | 1532 | goto retry; |
| 1528 | 1533 | } |
| 1529 | 1534 | |
| @@ -1967,6 +1972,11 @@ retry: · 437 unmodified lines | ||
| 1967 | 1972 | */ |
| 1968 | 1973 | if (ctx->is_active) { |
| 1969 | 1974 | raw_spin_unlock_irq(&ctx->lock); |
| 1975 | + /* | |
| 1976 | + * Reload the task pointer, it might have been changed by | |
| 1977 | + * a concurrent perf_event_context_sched_out(). | |
| 1978 | + */ | |
| 1979 | + task = ctx->task; | |
| 1970 | 1980 | goto retry; |
| 1971 | 1981 | } |
| 1972 | 1982 | |
| @@ -176,7 +176,7 @@ struct dma_pool *dma_pool_create(const char *name, struct device *dev, · 175 unmodified lines | ||
| 176 | 176 | if (list_empty(&dev->dma_pools) && |
| 177 | 177 | device_create_file(dev, &dev_attr_pools)) { |
| 178 | 178 | kfree(retval); |
| 179 | − return NULL; | |
| 179 | + retval = NULL; | |
| 180 | 180 | } else |
| 181 | 181 | list_add(&retval->pools, &dev->dma_pools); |
| 182 | 182 | mutex_unlock(&pools_lock); |
| @@ -566,8 +566,8 @@ static void stac_init_power_map(struct hda_codec *codec) · 565 unmodified lines | ||
| 566 | 566 | if (snd_hda_jack_tbl_get(codec, nid)) |
| 567 | 567 | continue; |
| 568 | 568 | if (def_conf == AC_JACK_PORT_COMPLEX && |
| 569 | − !(spec->vref_mute_led_nid == nid || | |
| 570 | − is_jack_detectable(codec, nid))) { | |
| 569 | + spec->vref_mute_led_nid != nid && | |
| 570 | + is_jack_detectable(codec, nid)) { | |
| 571 | 571 | snd_hda_jack_detect_enable_callback(codec, nid, |
| 572 | 572 | STAC_PWR_EVENT, |
| 573 | 573 | jack_update_power); |
| @@ -4276,11 +4276,18 @@ static int stac_parse_auto_config(struct hda_codec *codec) · 3702 unmodified lines | ||
| 4276 | 4276 | return err; |
| 4277 | 4277 | } |
| 4278 | 4278 | |
| 4279 | − stac_init_power_map(codec); | |
| 4280 | − | |
| 4281 | 4279 | return 0; |
| 4282 | 4280 | } |
| 4283 | 4281 | |
| 4282 | +static int stac_build_controls(struct hda_codec *codec) | |
| 4283 | +{ | |
| 4284 | + int err = snd_hda_gen_build_controls(codec); | |
| 4285 | + | |
| 4286 | + if (err < 0) | |
| 4287 | + return err; | |
| 4288 | + stac_init_power_map(codec); | |
| 4289 | + return 0; | |
| 4290 | +} | |
| 4284 | 4291 | |
| 4285 | 4292 | static int stac_init(struct hda_codec *codec) |
| 4286 | 4293 | { |
| @@ -4392,7 +4399,7 @@ static int stac_suspend(struct hda_codec *codec) · 105 unmodified lines | ||
| 4392 | 4399 | #endif /* CONFIG_PM */ |
| 4393 | 4400 | |
| 4394 | 4401 | static const struct hda_codec_ops stac_patch_ops = { |
| 4395 | − .build_controls = snd_hda_gen_build_controls, | |
| 4402 | + .build_controls = stac_build_controls, | |
| 4396 | 4403 | .build_pcms = snd_hda_gen_build_pcms, |
| 4397 | 4404 | .init = stac_init, |
| 4398 | 4405 | .free = stac_free, |
| @@ -458,12 +458,12 @@ static int cs4265_pcm_hw_params(struct snd_pcm_substream *substream, · 457 unmodified lines | ||
| 458 | 458 | if (params_width(params) == 16) { |
| 459 | 459 | snd_soc_update_bits(codec, CS4265_DAC_CTL, |
| 460 | 460 | CS4265_DAC_CTL_DIF, (1 << 5)); |
| 461 | − snd_soc_update_bits(codec, CS4265_ADC_CTL, | |
| 461 | + snd_soc_update_bits(codec, CS4265_SPDIF_CTL2, | |
| 462 | 462 | CS4265_SPDIF_CTL2_DIF, (1 << 7)); |
| 463 | 463 | } else { |
| 464 | 464 | snd_soc_update_bits(codec, CS4265_DAC_CTL, |
| 465 | 465 | CS4265_DAC_CTL_DIF, (3 << 5)); |
| 466 | − snd_soc_update_bits(codec, CS4265_ADC_CTL, | |
| 466 | + snd_soc_update_bits(codec, CS4265_SPDIF_CTL2, | |
| 467 | 467 | CS4265_SPDIF_CTL2_DIF, (1 << 7)); |
| 468 | 468 | } |
| 469 | 469 | break; |
| @@ -472,7 +472,7 @@ static int cs4265_pcm_hw_params(struct snd_pcm_substream *substream, · 2 unmodified lines | ||
| 472 | 472 | CS4265_DAC_CTL_DIF, 0); |
| 473 | 473 | snd_soc_update_bits(codec, CS4265_ADC_CTL, |
| 474 | 474 | CS4265_ADC_DIF, 0); |
| 475 | − snd_soc_update_bits(codec, CS4265_ADC_CTL, | |
| 475 | + snd_soc_update_bits(codec, CS4265_SPDIF_CTL2, | |
| 476 | 476 | CS4265_SPDIF_CTL2_DIF, (1 << 6)); |
| 477 | 477 | |
| 478 | 478 | break; |
| @@ -4,7 +4,7 @@ · 3 unmodified lines | ||
| 4 | 4 | * sound/soc/codecs/sta529.c -- spear ALSA Soc codec driver |
| 5 | 5 | * |
| 6 | 6 | * Copyright (C) 2012 ST Microelectronics |
| 7 | − * Rajeev Kumar <rajeev-dlh.kumar@st.com> | |
| 7 | + * Rajeev Kumar <rajeevkumar.linux@gmail.com> | |
| 8 | 8 | * |
| 9 | 9 | * This file is licensed under the terms of the GNU General Public |
| 10 | 10 | * License version 2. This program is licensed "as is" without any |
| @@ -426,5 +426,5 @@ static struct i2c_driver sta529_i2c_driver = { · 415 unmodified lines | ||
| 426 | 426 | module_i2c_driver(sta529_i2c_driver); |
| 427 | 427 | |
| 428 | 428 | MODULE_DESCRIPTION("ASoC STA529 codec driver"); |
| 429 | −MODULE_AUTHOR("Rajeev Kumar <rajeev-dlh.kumar@st.com>"); | |
| 429 | +MODULE_AUTHOR("Rajeev Kumar <rajeevkumar.linux@gmail.com>"); | |
| 430 | 430 | MODULE_LICENSE("GPL"); |
| @@ -189,46 +189,57 @@ static const struct aic31xx_rate_divs aic31xx_divs[] = { · 188 unmodified lines | ||
| 189 | 189 | /* mclk rate pll: p j d dosr ndac mdac aors nadc madc */ |
| 190 | 190 | /* 8k rate */ |
| 191 | 191 | {12000000, 8000, 1, 8, 1920, 128, 48, 2, 128, 48, 2}, |
| 192 | + {12000000, 8000, 1, 8, 1920, 128, 32, 3, 128, 32, 3}, | |
| 192 | 193 | {24000000, 8000, 2, 8, 1920, 128, 48, 2, 128, 48, 2}, |
| 193 | 194 | {25000000, 8000, 2, 7, 8643, 128, 48, 2, 128, 48, 2}, |
| 194 | 195 | /* 11.025k rate */ |
| 195 | 196 | {12000000, 11025, 1, 7, 5264, 128, 32, 2, 128, 32, 2}, |
| 197 | + {12000000, 11025, 1, 8, 4672, 128, 24, 3, 128, 24, 3}, | |
| 196 | 198 | {24000000, 11025, 2, 7, 5264, 128, 32, 2, 128, 32, 2}, |
| 197 | 199 | {25000000, 11025, 2, 7, 2253, 128, 32, 2, 128, 32, 2}, |
| 198 | 200 | /* 16k rate */ |
| 199 | 201 | {12000000, 16000, 1, 8, 1920, 128, 24, 2, 128, 24, 2}, |
| 202 | + {12000000, 16000, 1, 8, 1920, 128, 16, 3, 128, 16, 3}, | |
| 200 | 203 | {24000000, 16000, 2, 8, 1920, 128, 24, 2, 128, 24, 2}, |
| 201 | 204 | {25000000, 16000, 2, 7, 8643, 128, 24, 2, 128, 24, 2}, |
| 202 | 205 | /* 22.05k rate */ |
| 203 | 206 | {12000000, 22050, 1, 7, 5264, 128, 16, 2, 128, 16, 2}, |
| 207 | + {12000000, 22050, 1, 8, 4672, 128, 12, 3, 128, 12, 3}, | |
| 204 | 208 | {24000000, 22050, 2, 7, 5264, 128, 16, 2, 128, 16, 2}, |
| 205 | 209 | {25000000, 22050, 2, 7, 2253, 128, 16, 2, 128, 16, 2}, |
| 206 | 210 | /* 32k rate */ |
| 207 | 211 | {12000000, 32000, 1, 8, 1920, 128, 12, 2, 128, 12, 2}, |
| 212 | + {12000000, 32000, 1, 8, 1920, 128, 8, 3, 128, 8, 3}, | |
| 208 | 213 | {24000000, 32000, 2, 8, 1920, 128, 12, 2, 128, 12, 2}, |
| 209 | 214 | {25000000, 32000, 2, 7, 8643, 128, 12, 2, 128, 12, 2}, |
| 210 | 215 | /* 44.1k rate */ |
| 211 | 216 | {12000000, 44100, 1, 7, 5264, 128, 8, 2, 128, 8, 2}, |
| 217 | + {12000000, 44100, 1, 8, 4672, 128, 6, 3, 128, 6, 3}, | |
| 212 | 218 | {24000000, 44100, 2, 7, 5264, 128, 8, 2, 128, 8, 2}, |
| 213 | 219 | {25000000, 44100, 2, 7, 2253, 128, 8, 2, 128, 8, 2}, |
| 214 | 220 | /* 48k rate */ |
| 215 | 221 | {12000000, 48000, 1, 8, 1920, 128, 8, 2, 128, 8, 2}, |
| 222 | + {12000000, 48000, 1, 7, 6800, 96, 5, 4, 96, 5, 4}, | |
| 216 | 223 | {24000000, 48000, 2, 8, 1920, 128, 8, 2, 128, 8, 2}, |
| 217 | 224 | {25000000, 48000, 2, 7, 8643, 128, 8, 2, 128, 8, 2}, |
| 218 | 225 | /* 88.2k rate */ |
| 219 | 226 | {12000000, 88200, 1, 7, 5264, 64, 8, 2, 64, 8, 2}, |
| 227 | + {12000000, 88200, 1, 8, 4672, 64, 6, 3, 64, 6, 3}, | |
| 220 | 228 | {24000000, 88200, 2, 7, 5264, 64, 8, 2, 64, 8, 2}, |
| 221 | 229 | {25000000, 88200, 2, 7, 2253, 64, 8, 2, 64, 8, 2}, |
| 222 | 230 | /* 96k rate */ |
| 223 | 231 | {12000000, 96000, 1, 8, 1920, 64, 8, 2, 64, 8, 2}, |
| 232 | + {12000000, 96000, 1, 7, 6800, 48, 5, 4, 48, 5, 4}, | |
| 224 | 233 | {24000000, 96000, 2, 8, 1920, 64, 8, 2, 64, 8, 2}, |
| 225 | 234 | {25000000, 96000, 2, 7, 8643, 64, 8, 2, 64, 8, 2}, |
| 226 | 235 | /* 176.4k rate */ |
| 227 | 236 | {12000000, 176400, 1, 7, 5264, 32, 8, 2, 32, 8, 2}, |
| 237 | + {12000000, 176400, 1, 8, 4672, 32, 6, 3, 32, 6, 3}, | |
| 228 | 238 | {24000000, 176400, 2, 7, 5264, 32, 8, 2, 32, 8, 2}, |
| 229 | 239 | {25000000, 176400, 2, 7, 2253, 32, 8, 2, 32, 8, 2}, |
| 230 | 240 | /* 192k rate */ |
| 231 | 241 | {12000000, 192000, 1, 8, 1920, 32, 8, 2, 32, 8, 2}, |
| 242 | + {12000000, 192000, 1, 7, 6800, 24, 5, 4, 24, 5, 4}, | |
| 232 | 243 | {24000000, 192000, 2, 8, 1920, 32, 8, 2, 32, 8, 2}, |
| 233 | 244 | {25000000, 192000, 2, 7, 8643, 32, 8, 2, 32, 8, 2}, |
| 234 | 245 | }; |
| @@ -680,7 +691,9 @@ static int aic31xx_setup_pll(struct snd_soc_codec *codec, · 445 unmodified lines | ||
| 680 | 691 | struct snd_pcm_hw_params *params) |
| 681 | 692 | { |
| 682 | 693 | struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec); |
| 694 | + int bclk_score = snd_soc_params_to_frame_size(params); | |
| 683 | 695 | int bclk_n = 0; |
| 696 | + int match = -1; | |
| 684 | 697 | int i; |
| 685 | 698 | |
| 686 | 699 | /* Use PLL as CODEC_CLKIN and DAC_CLK as BDIV_CLKIN */ |
| @@ -691,15 +704,37 @@ static int aic31xx_setup_pll(struct snd_soc_codec *codec, · 4 unmodified lines | ||
| 691 | 704 | |
| 692 | 705 | for (i = 0; i < ARRAY_SIZE(aic31xx_divs); i++) { |
| 693 | 706 | if (aic31xx_divs[i].rate == params_rate(params) && |
| 694 | − aic31xx_divs[i].mclk == aic31xx->sysclk) | |
| 695 | − break; | |
| 707 | + aic31xx_divs[i].mclk == aic31xx->sysclk) { | |
| 708 | + int s = (aic31xx_divs[i].dosr * aic31xx_divs[i].mdac) % | |
| 709 | + snd_soc_params_to_frame_size(params); | |
| 710 | + int bn = (aic31xx_divs[i].dosr * aic31xx_divs[i].mdac) / | |
| 711 | + snd_soc_params_to_frame_size(params); | |
| 712 | + if (s < bclk_score && bn > 0) { | |
| 713 | + match = i; | |
| 714 | + bclk_n = bn; | |
| 715 | + bclk_score = s; | |
| 716 | + } | |
| 717 | + } | |
| 696 | 718 | } |
| 697 | 719 | |
| 698 | − if (i == ARRAY_SIZE(aic31xx_divs)) { | |
| 699 | − dev_err(codec->dev, "%s: Sampling rate %u not supported\n", | |
| 720 | + if (match == -1) { | |
| 721 | + dev_err(codec->dev, | |
| 722 | + "%s: Sample rate (%u) and format not supported\n", | |
| 700 | 723 | __func__, params_rate(params)); |
| 724 | + /* See bellow for details how fix this. */ | |
| 701 | 725 | return -EINVAL; |
| 702 | 726 | } |
| 727 | + if (bclk_score != 0) { | |
| 728 | + dev_warn(codec->dev, "Can not produce exact bitclock"); | |
| 729 | + /* This is fine if using dsp format, but if using i2s | |
| 730 | + there may be trouble. To fix the issue edit the | |
| 731 | + aic31xx_divs table for your mclk and sample | |
| 732 | + rate. Details can be found from: | |
| 733 | + http://www.ti.com/lit/ds/symlink/tlv320aic3100.pdf | |
| 734 | + Section: 5.6 CLOCK Generation and PLL | |
| 735 | + */ | |
| 736 | + } | |
| 737 | + i = match; | |
| 703 | 738 | |
| 704 | 739 | /* PLL configuration */ |
| 705 | 740 | snd_soc_update_bits(codec, AIC31XX_PLLPR, AIC31XX_PLL_MASK, |
| @@ -729,14 +764,6 @@ static int aic31xx_setup_pll(struct snd_soc_codec *codec, · 23 unmodified lines | ||
| 729 | 764 | snd_soc_write(codec, AIC31XX_AOSR, aic31xx_divs[i].aosr); |
| 730 | 765 | |
| 731 | 766 | /* Bit clock divider configuration. */ |
| 732 | − bclk_n = (aic31xx_divs[i].dosr * aic31xx_divs[i].mdac) | |
| 733 | − / snd_soc_params_to_frame_size(params); | |
| 734 | − if (bclk_n == 0) { | |
| 735 | − dev_err(codec->dev, "%s: Not enough BLCK bandwidth\n", | |
| 736 | − __func__); | |
| 737 | − return -EINVAL; | |
| 738 | − } | |
| 739 | − | |
| 740 | 767 | snd_soc_update_bits(codec, AIC31XX_BCLKN, |
| 741 | 768 | AIC31XX_PLL_MASK, bclk_n); |
| 742 | 769 | |
| @@ -467,8 +467,17 @@ static int davinci_config_channel_size(struct davinci_mcasp *mcasp, · 466 unmodified lines | ||
| 467 | 467 | { |
| 468 | 468 | u32 fmt; |
| 469 | 469 | u32 tx_rotate = (word_length / 4) & 0x7; |
| 470 | − u32 rx_rotate = (32 - word_length) / 4; | |
| 471 | 470 | u32 mask = (1ULL << word_length) - 1; |
| 471 | + /* | |
| 472 | + * For captured data we should not rotate, inversion and masking is | |
| 473 | + * enoguh to get the data to the right position: | |
| 474 | + * Format data from bus after reverse (XRBUF) | |
| 475 | + * S16_LE: |LSB|MSB|xxx|xxx| |xxx|xxx|MSB|LSB| | |
| 476 | + * S24_3LE: |LSB|DAT|MSB|xxx| |xxx|MSB|DAT|LSB| | |
| 477 | + * S24_LE: |LSB|DAT|MSB|xxx| |xxx|MSB|DAT|LSB| | |
| 478 | + * S32_LE: |LSB|DAT|DAT|MSB| |MSB|DAT|DAT|LSB| | |
| 479 | + */ | |
| 480 | + u32 rx_rotate = 0; | |
| 472 | 481 | |
| 473 | 482 | /* |
| 474 | 483 | * if s BCLK-to-LRCLK ratio has been configured via the set_clkdiv() |
| @@ -4,7 +4,7 @@ · 3 unmodified lines | ||
| 4 | 4 | * sound/soc/dwc/designware_i2s.c |
| 5 | 5 | * |
| 6 | 6 | * Copyright (C) 2010 ST Microelectronics |
| 7 | − * Rajeev Kumar <rajeev-dlh.kumar@st.com> | |
| 7 | + * Rajeev Kumar <rajeevkumar.linux@gmail.com> | |
| 8 | 8 | * |
| 9 | 9 | * This file is licensed under the terms of the GNU General Public |
| 10 | 10 | * License version 2. This program is licensed "as is" without any |
| @@ -455,7 +455,7 @@ static struct platform_driver dw_i2s_driver = { · 444 unmodified lines | ||
| 455 | 455 | |
| 456 | 456 | module_platform_driver(dw_i2s_driver); |
| 457 | 457 | |
| 458 | −MODULE_AUTHOR("Rajeev Kumar <rajeev-dlh.kumar@st.com>"); | |
| 458 | +MODULE_AUTHOR("Rajeev Kumar <rajeevkumar.linux@gmail.com>"); | |
| 459 | 459 | MODULE_DESCRIPTION("DESIGNWARE I2S SoC Interface"); |
| 460 | 460 | MODULE_LICENSE("GPL"); |
| 461 | 461 | MODULE_ALIAS("platform:designware_i2s"); |
| @@ -165,13 +165,14 @@ static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai, · 164 unmodified lines | ||
| 165 | 165 | struct rk_i2s_dev *i2s = to_info(cpu_dai); |
| 166 | 166 | unsigned int mask = 0, val = 0; |
| 167 | 167 | |
| 168 | − mask = I2S_CKR_MSS_SLAVE; | |
| 168 | + mask = I2S_CKR_MSS_MASK; | |
| 169 | 169 | switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { |
| 170 | 170 | case SND_SOC_DAIFMT_CBS_CFS: |
| 171 | − val = I2S_CKR_MSS_SLAVE; | |
| 171 | + /* Set source clock in Master mode */ | |
| 172 | + val = I2S_CKR_MSS_MASTER; | |
| 172 | 173 | break; |
| 173 | 174 | case SND_SOC_DAIFMT_CBM_CFM: |
| 174 | − val = I2S_CKR_MSS_MASTER; | |
| 175 | + val = I2S_CKR_MSS_SLAVE; | |
| 175 | 176 | break; |
| 176 | 177 | default: |
| 177 | 178 | return -EINVAL; |
| @@ -361,6 +362,8 @@ static bool rockchip_i2s_rd_reg(struct device *dev, unsigned int reg) · 183 unmodified lines | ||
| 361 | 362 | case I2S_XFER: |
| 362 | 363 | case I2S_CLR: |
| 363 | 364 | case I2S_RXDR: |
| 365 | + case I2S_FIFOLR: | |
| 366 | + case I2S_INTSR: | |
| 364 | 367 | return true; |
| 365 | 368 | default: |
| 366 | 369 | return false; |
| @@ -370,8 +373,8 @@ static bool rockchip_i2s_rd_reg(struct device *dev, unsigned int reg) · 3 unmodified lines | ||
| 370 | 373 | static bool rockchip_i2s_volatile_reg(struct device *dev, unsigned int reg) |
| 371 | 374 | { |
| 372 | 375 | switch (reg) { |
| 373 | − case I2S_FIFOLR: | |
| 374 | 376 | case I2S_INTSR: |
| 377 | + case I2S_CLR: | |
| 375 | 378 | return true; |
| 376 | 379 | default: |
| 377 | 380 | return false; |
| @@ -381,8 +384,6 @@ static bool rockchip_i2s_volatile_reg(struct device *dev, unsigned int reg) · 3 unmodified lines | ||
| 381 | 384 | static bool rockchip_i2s_precious_reg(struct device *dev, unsigned int reg) |
| 382 | 385 | { |
| 383 | 386 | switch (reg) { |
| 384 | − case I2S_FIFOLR: | |
| 385 | − return true; | |
| 386 | 387 | default: |
| 387 | 388 | return false; |
| 388 | 389 | } |
| @@ -462,7 +462,7 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai, · 461 unmodified lines | ||
| 462 | 462 | if (dir == SND_SOC_CLOCK_IN) |
| 463 | 463 | rfs = 0; |
| 464 | 464 | |
| 465 | − if ((rfs && other->rfs && (other->rfs != rfs)) || | |
| 465 | + if ((rfs && other && other->rfs && (other->rfs != rfs)) || | |
| 466 | 466 | (any_active(i2s) && |
| 467 | 467 | (((dir == SND_SOC_CLOCK_IN) |
| 468 | 468 | && !(mod & MOD_CDCLKCON)) || |
| @@ -762,7 +762,8 @@ static void i2s_shutdown(struct snd_pcm_substream *substream, · 293 unmodified lines | ||
| 762 | 762 | } else { |
| 763 | 763 | u32 mod = readl(i2s->addr + I2SMOD); |
| 764 | 764 | i2s->cdclk_out = !(mod & MOD_CDCLKCON); |
| 765 | − other->cdclk_out = i2s->cdclk_out; | |
| 765 | + if (other) | |
| 766 | + other->cdclk_out = i2s->cdclk_out; | |
| 766 | 767 | } |
| 767 | 768 | /* Reset any constraint on RFS and BFS */ |
| 768 | 769 | i2s->rfs = 0; |
| @@ -101,7 +101,11 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream) · 100 unmodified lines | ||
| 101 | 101 | |
| 102 | 102 | fe->dpcm[stream].runtime = fe_substream->runtime; |
| 103 | 103 | |
| 104 | − if (dpcm_path_get(fe, stream, &list) <= 0) { | |
| 104 | + ret = dpcm_path_get(fe, stream, &list); | |
| 105 | + if (ret < 0) { | |
| 106 | + mutex_unlock(&fe->card->mutex); | |
| 107 | + goto fe_err; | |
| 108 | + } else if (ret == 0) { | |
| 105 | 109 | dev_dbg(fe->dev, "ASoC: %s no valid %s route\n", |
| 106 | 110 | fe->dai_link->name, stream ? "capture" : "playback"); |
| 107 | 111 | } |
| @@ -2352,7 +2352,11 @@ static int dpcm_fe_dai_open(struct snd_pcm_substream *fe_substream) · 2351 unmodified lines | ||
| 2352 | 2352 | mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME); |
| 2353 | 2353 | fe->dpcm[stream].runtime = fe_substream->runtime; |
| 2354 | 2354 | |
| 2355 | − if (dpcm_path_get(fe, stream, &list) <= 0) { | |
| 2355 | + ret = dpcm_path_get(fe, stream, &list); | |
| 2356 | + if (ret < 0) { | |
| 2357 | + mutex_unlock(&fe->card->mutex); | |
| 2358 | + return ret; | |
| 2359 | + } else if (ret == 0) { | |
| 2356 | 2360 | dev_dbg(fe->dev, "ASoC: %s no valid %s route\n", |
| 2357 | 2361 | fe->dai_link->name, stream ? "capture" : "playback"); |
| 2358 | 2362 | } |
| @@ -4,7 +4,7 @@ · 3 unmodified lines | ||
| 4 | 4 | * sound/soc/spear/spear_pcm.c |
| 5 | 5 | * |
| 6 | 6 | * Copyright (C) 2012 ST Microelectronics |
| 7 | − * Rajeev Kumar<rajeev-dlh.kumar@st.com> | |
| 7 | + * Rajeev Kumar<rajeevkumar.linux@gmail.com> | |
| 8 | 8 | * |
| 9 | 9 | * This file is licensed under the terms of the GNU General Public |
| 10 | 10 | * License version 2. This program is licensed "as is" without any |
| @@ -50,6 +50,6 @@ int devm_spear_pcm_platform_register(struct device *dev, · 39 unmodified lines | ||
| 50 | 50 | } |
| 51 | 51 | EXPORT_SYMBOL_GPL(devm_spear_pcm_platform_register); |
| 52 | 52 | |
| 53 | −MODULE_AUTHOR("Rajeev Kumar <rajeev-dlh.kumar@st.com>"); | |
| 53 | +MODULE_AUTHOR("Rajeev Kumar <rajeevkumar.linux@gmail.com>"); | |
| 54 | 54 | MODULE_DESCRIPTION("SPEAr PCM DMA module"); |
| 55 | 55 | MODULE_LICENSE("GPL"); |