Annotation of /trunk/kernel26-alx/patches-3.10/0139-3.10.40-all-fixes.patch
Parent Directory | Revision Log
Revision 2672 -
(hide annotations)
(download)
Tue Jul 21 16:46:35 2015 UTC (8 years, 11 months ago) by niro
File size: 73030 byte(s)
Tue Jul 21 16:46:35 2015 UTC (8 years, 11 months ago) by niro
File size: 73030 byte(s)
-3.10.84-alx-r1
1 | niro | 2672 | diff --git a/Makefile b/Makefile |
2 | index 1e07514be6f8..b2285cababb0 100644 | ||
3 | --- a/Makefile | ||
4 | +++ b/Makefile | ||
5 | @@ -1,6 +1,6 @@ | ||
6 | VERSION = 3 | ||
7 | PATCHLEVEL = 10 | ||
8 | -SUBLEVEL = 39 | ||
9 | +SUBLEVEL = 40 | ||
10 | EXTRAVERSION = | ||
11 | NAME = TOSSUG Baby Fish | ||
12 | |||
13 | diff --git a/arch/arc/include/asm/irqflags.h b/arch/arc/include/asm/irqflags.h | ||
14 | index eac071668201..c29d56587bf0 100644 | ||
15 | --- a/arch/arc/include/asm/irqflags.h | ||
16 | +++ b/arch/arc/include/asm/irqflags.h | ||
17 | @@ -137,13 +137,6 @@ static inline void arch_unmask_irq(unsigned int irq) | ||
18 | flag \scratch | ||
19 | .endm | ||
20 | |||
21 | -.macro IRQ_DISABLE_SAVE scratch, save | ||
22 | - lr \scratch, [status32] | ||
23 | - mov \save, \scratch /* Make a copy */ | ||
24 | - bic \scratch, \scratch, (STATUS_E1_MASK | STATUS_E2_MASK) | ||
25 | - flag \scratch | ||
26 | -.endm | ||
27 | - | ||
28 | .macro IRQ_ENABLE scratch | ||
29 | lr \scratch, [status32] | ||
30 | or \scratch, \scratch, (STATUS_E1_MASK | STATUS_E2_MASK) | ||
31 | diff --git a/arch/arc/kernel/entry.S b/arch/arc/kernel/entry.S | ||
32 | index 6dbe359c760d..6f3cd0fb4b54 100644 | ||
33 | --- a/arch/arc/kernel/entry.S | ||
34 | +++ b/arch/arc/kernel/entry.S | ||
35 | @@ -589,11 +589,7 @@ ARC_ENTRY ret_from_exception | ||
36 | ; Pre-{IRQ,Trap,Exception} K/U mode from pt_regs->status32 | ||
37 | ld r8, [sp, PT_status32] ; returning to User/Kernel Mode | ||
38 | |||
39 | -#ifdef CONFIG_PREEMPT | ||
40 | bbit0 r8, STATUS_U_BIT, resume_kernel_mode | ||
41 | -#else | ||
42 | - bbit0 r8, STATUS_U_BIT, restore_regs | ||
43 | -#endif | ||
44 | |||
45 | ; Before returning to User mode check-for-and-complete any pending work | ||
46 | ; such as rescheduling/signal-delivery etc. | ||
47 | @@ -653,10 +649,15 @@ resume_user_mode_begin: | ||
48 | b resume_user_mode_begin ; unconditionally back to U mode ret chks | ||
49 | ; for single exit point from this block | ||
50 | |||
51 | -#ifdef CONFIG_PREEMPT | ||
52 | - | ||
53 | resume_kernel_mode: | ||
54 | |||
55 | + ; Disable Interrupts from this point on | ||
56 | + ; CONFIG_PREEMPT: This is a must for preempt_schedule_irq() | ||
57 | + ; !CONFIG_PREEMPT: To ensure restore_regs is intr safe | ||
58 | + IRQ_DISABLE r9 | ||
59 | + | ||
60 | +#ifdef CONFIG_PREEMPT | ||
61 | + | ||
62 | ; Can't preempt if preemption disabled | ||
63 | GET_CURR_THR_INFO_FROM_SP r10 | ||
64 | ld r8, [r10, THREAD_INFO_PREEMPT_COUNT] | ||
65 | @@ -666,8 +667,6 @@ resume_kernel_mode: | ||
66 | ld r9, [r10, THREAD_INFO_FLAGS] | ||
67 | bbit0 r9, TIF_NEED_RESCHED, restore_regs | ||
68 | |||
69 | - IRQ_DISABLE r9 | ||
70 | - | ||
71 | ; Invoke PREEMPTION | ||
72 | bl preempt_schedule_irq | ||
73 | |||
74 | @@ -680,12 +679,11 @@ resume_kernel_mode: | ||
75 | ; | ||
76 | ; Restore the saved sys context (common exit-path for EXCPN/IRQ/Trap) | ||
77 | ; IRQ shd definitely not happen between now and rtie | ||
78 | +; All 2 entry points to here already disable interrupts | ||
79 | |||
80 | restore_regs : | ||
81 | |||
82 | - ; Disable Interrupts while restoring reg-file back | ||
83 | - ; XXX can this be optimised out | ||
84 | - IRQ_DISABLE_SAVE r9, r10 ;@r10 has prisitine (pre-disable) copy | ||
85 | + lr r10, [status32] | ||
86 | |||
87 | #ifdef CONFIG_ARC_CURR_IN_REG | ||
88 | ; Restore User R25 | ||
89 | diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c | ||
90 | index f0ef2f7d4ad7..5ef506c6f492 100644 | ||
91 | --- a/arch/arm/mm/mmap.c | ||
92 | +++ b/arch/arm/mm/mmap.c | ||
93 | @@ -204,13 +204,11 @@ int valid_phys_addr_range(phys_addr_t addr, size_t size) | ||
94 | } | ||
95 | |||
96 | /* | ||
97 | - * We don't use supersection mappings for mmap() on /dev/mem, which | ||
98 | - * means that we can't map the memory area above the 4G barrier into | ||
99 | - * userspace. | ||
100 | + * Do not allow /dev/mem mappings beyond the supported physical range. | ||
101 | */ | ||
102 | int valid_mmap_phys_addr_range(unsigned long pfn, size_t size) | ||
103 | { | ||
104 | - return !(pfn + (size >> PAGE_SHIFT) > 0x00100000); | ||
105 | + return (pfn + (size >> PAGE_SHIFT)) <= (1 + (PHYS_MASK >> PAGE_SHIFT)); | ||
106 | } | ||
107 | |||
108 | #ifdef CONFIG_STRICT_DEVMEM | ||
109 | diff --git a/arch/mips/kvm/kvm_mips_emul.c b/arch/mips/kvm/kvm_mips_emul.c | ||
110 | index 4b6274b47f33..e75ef8219caf 100644 | ||
111 | --- a/arch/mips/kvm/kvm_mips_emul.c | ||
112 | +++ b/arch/mips/kvm/kvm_mips_emul.c | ||
113 | @@ -1571,17 +1571,17 @@ kvm_mips_handle_ri(unsigned long cause, uint32_t *opc, | ||
114 | arch->gprs[rt] = kvm_read_c0_guest_userlocal(cop0); | ||
115 | #else | ||
116 | /* UserLocal not implemented */ | ||
117 | - er = kvm_mips_emulate_ri_exc(cause, opc, run, vcpu); | ||
118 | + er = EMULATE_FAIL; | ||
119 | #endif | ||
120 | break; | ||
121 | |||
122 | default: | ||
123 | - printk("RDHWR not supported\n"); | ||
124 | + kvm_debug("RDHWR %#x not supported @ %p\n", rd, opc); | ||
125 | er = EMULATE_FAIL; | ||
126 | break; | ||
127 | } | ||
128 | } else { | ||
129 | - printk("Emulate RI not supported @ %p: %#x\n", opc, inst); | ||
130 | + kvm_debug("Emulate RI not supported @ %p: %#x\n", opc, inst); | ||
131 | er = EMULATE_FAIL; | ||
132 | } | ||
133 | |||
134 | @@ -1590,6 +1590,7 @@ kvm_mips_handle_ri(unsigned long cause, uint32_t *opc, | ||
135 | */ | ||
136 | if (er == EMULATE_FAIL) { | ||
137 | vcpu->arch.pc = curr_pc; | ||
138 | + er = kvm_mips_emulate_ri_exc(cause, opc, run, vcpu); | ||
139 | } | ||
140 | return er; | ||
141 | } | ||
142 | diff --git a/arch/mips/power/hibernate.S b/arch/mips/power/hibernate.S | ||
143 | index 7e0277a1048f..32a7c828f073 100644 | ||
144 | --- a/arch/mips/power/hibernate.S | ||
145 | +++ b/arch/mips/power/hibernate.S | ||
146 | @@ -43,6 +43,7 @@ LEAF(swsusp_arch_resume) | ||
147 | bne t1, t3, 1b | ||
148 | PTR_L t0, PBE_NEXT(t0) | ||
149 | bnez t0, 0b | ||
150 | + jal local_flush_tlb_all /* Avoid TLB mismatch after kernel resume */ | ||
151 | PTR_LA t0, saved_regs | ||
152 | PTR_L ra, PT_R31(t0) | ||
153 | PTR_L sp, PT_R29(t0) | ||
154 | diff --git a/arch/powerpc/include/asm/compat.h b/arch/powerpc/include/asm/compat.h | ||
155 | index 84fdf6857c31..ef22898daa93 100644 | ||
156 | --- a/arch/powerpc/include/asm/compat.h | ||
157 | +++ b/arch/powerpc/include/asm/compat.h | ||
158 | @@ -8,7 +8,11 @@ | ||
159 | #include <linux/sched.h> | ||
160 | |||
161 | #define COMPAT_USER_HZ 100 | ||
162 | +#ifdef __BIG_ENDIAN__ | ||
163 | #define COMPAT_UTS_MACHINE "ppc\0\0" | ||
164 | +#else | ||
165 | +#define COMPAT_UTS_MACHINE "ppcle\0\0" | ||
166 | +#endif | ||
167 | |||
168 | typedef u32 compat_size_t; | ||
169 | typedef s32 compat_ssize_t; | ||
170 | diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h | ||
171 | index e1fb161252ef..795f67792ea9 100644 | ||
172 | --- a/arch/powerpc/include/asm/reg.h | ||
173 | +++ b/arch/powerpc/include/asm/reg.h | ||
174 | @@ -208,6 +208,7 @@ | ||
175 | #define SPRN_ACOP 0x1F /* Available Coprocessor Register */ | ||
176 | #define SPRN_TFIAR 0x81 /* Transaction Failure Inst Addr */ | ||
177 | #define SPRN_TEXASR 0x82 /* Transaction EXception & Summary */ | ||
178 | +#define TEXASR_FS __MASK(63-36) /* Transaction Failure Summary */ | ||
179 | #define SPRN_TEXASRU 0x83 /* '' '' '' Upper 32 */ | ||
180 | #define SPRN_TFHAR 0x80 /* Transaction Failure Handler Addr */ | ||
181 | #define SPRN_CTRLF 0x088 | ||
182 | diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c | ||
183 | index 7baa27b7abbe..1e1c995ddacc 100644 | ||
184 | --- a/arch/powerpc/kernel/process.c | ||
185 | +++ b/arch/powerpc/kernel/process.c | ||
186 | @@ -523,6 +523,31 @@ out_and_saveregs: | ||
187 | tm_save_sprs(thr); | ||
188 | } | ||
189 | |||
190 | +extern void __tm_recheckpoint(struct thread_struct *thread, | ||
191 | + unsigned long orig_msr); | ||
192 | + | ||
193 | +void tm_recheckpoint(struct thread_struct *thread, | ||
194 | + unsigned long orig_msr) | ||
195 | +{ | ||
196 | + unsigned long flags; | ||
197 | + | ||
198 | + /* We really can't be interrupted here as the TEXASR registers can't | ||
199 | + * change and later in the trecheckpoint code, we have a userspace R1. | ||
200 | + * So let's hard disable over this region. | ||
201 | + */ | ||
202 | + local_irq_save(flags); | ||
203 | + hard_irq_disable(); | ||
204 | + | ||
205 | + /* The TM SPRs are restored here, so that TEXASR.FS can be set | ||
206 | + * before the trecheckpoint and no explosion occurs. | ||
207 | + */ | ||
208 | + tm_restore_sprs(thread); | ||
209 | + | ||
210 | + __tm_recheckpoint(thread, orig_msr); | ||
211 | + | ||
212 | + local_irq_restore(flags); | ||
213 | +} | ||
214 | + | ||
215 | static inline void tm_recheckpoint_new_task(struct task_struct *new) | ||
216 | { | ||
217 | unsigned long msr; | ||
218 | @@ -541,13 +566,10 @@ static inline void tm_recheckpoint_new_task(struct task_struct *new) | ||
219 | if (!new->thread.regs) | ||
220 | return; | ||
221 | |||
222 | - /* The TM SPRs are restored here, so that TEXASR.FS can be set | ||
223 | - * before the trecheckpoint and no explosion occurs. | ||
224 | - */ | ||
225 | - tm_restore_sprs(&new->thread); | ||
226 | - | ||
227 | - if (!MSR_TM_ACTIVE(new->thread.regs->msr)) | ||
228 | + if (!MSR_TM_ACTIVE(new->thread.regs->msr)){ | ||
229 | + tm_restore_sprs(&new->thread); | ||
230 | return; | ||
231 | + } | ||
232 | msr = new->thread.tm_orig_msr; | ||
233 | /* Recheckpoint to restore original checkpointed register state. */ | ||
234 | TM_DEBUG("*** tm_recheckpoint of pid %d " | ||
235 | diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c | ||
236 | index 7e9dff80e1dc..81f929f026f2 100644 | ||
237 | --- a/arch/powerpc/kernel/signal_32.c | ||
238 | +++ b/arch/powerpc/kernel/signal_32.c | ||
239 | @@ -863,6 +863,8 @@ static long restore_tm_user_regs(struct pt_regs *regs, | ||
240 | * transactional versions should be loaded. | ||
241 | */ | ||
242 | tm_enable(); | ||
243 | + /* Make sure the transaction is marked as failed */ | ||
244 | + current->thread.tm_texasr |= TEXASR_FS; | ||
245 | /* This loads the checkpointed FP/VEC state, if used */ | ||
246 | tm_recheckpoint(¤t->thread, msr); | ||
247 | /* Get the top half of the MSR */ | ||
248 | diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c | ||
249 | index 35c20a1fb365..74d9615a6bb6 100644 | ||
250 | --- a/arch/powerpc/kernel/signal_64.c | ||
251 | +++ b/arch/powerpc/kernel/signal_64.c | ||
252 | @@ -513,6 +513,8 @@ static long restore_tm_sigcontexts(struct pt_regs *regs, | ||
253 | } | ||
254 | #endif | ||
255 | tm_enable(); | ||
256 | + /* Make sure the transaction is marked as failed */ | ||
257 | + current->thread.tm_texasr |= TEXASR_FS; | ||
258 | /* This loads the checkpointed FP/VEC state, if used */ | ||
259 | tm_recheckpoint(¤t->thread, msr); | ||
260 | |||
261 | diff --git a/arch/powerpc/kernel/tm.S b/arch/powerpc/kernel/tm.S | ||
262 | index f2abb219a17b..1e43ed404b95 100644 | ||
263 | --- a/arch/powerpc/kernel/tm.S | ||
264 | +++ b/arch/powerpc/kernel/tm.S | ||
265 | @@ -296,7 +296,7 @@ dont_backup_fp: | ||
266 | * Call with IRQs off, stacks get all out of sync for | ||
267 | * some periods in here! | ||
268 | */ | ||
269 | -_GLOBAL(tm_recheckpoint) | ||
270 | +_GLOBAL(__tm_recheckpoint) | ||
271 | mfcr r5 | ||
272 | mflr r0 | ||
273 | std r5, 8(r1) | ||
274 | diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c | ||
275 | index 1919db6c0607..3bc6b7e43b24 100644 | ||
276 | --- a/arch/s390/net/bpf_jit_comp.c | ||
277 | +++ b/arch/s390/net/bpf_jit_comp.c | ||
278 | @@ -243,7 +243,6 @@ static void bpf_jit_noleaks(struct bpf_jit *jit, struct sock_filter *filter) | ||
279 | case BPF_S_LD_W_IND: | ||
280 | case BPF_S_LD_H_IND: | ||
281 | case BPF_S_LD_B_IND: | ||
282 | - case BPF_S_LDX_B_MSH: | ||
283 | case BPF_S_LD_IMM: | ||
284 | case BPF_S_LD_MEM: | ||
285 | case BPF_S_MISC_TXA: | ||
286 | diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c | ||
287 | index 8b8cbe9bcb92..9cf616b5210b 100644 | ||
288 | --- a/drivers/ata/libata-core.c | ||
289 | +++ b/drivers/ata/libata-core.c | ||
290 | @@ -4765,21 +4765,26 @@ void swap_buf_le16(u16 *buf, unsigned int buf_words) | ||
291 | static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap) | ||
292 | { | ||
293 | struct ata_queued_cmd *qc = NULL; | ||
294 | - unsigned int i; | ||
295 | + unsigned int i, tag; | ||
296 | |||
297 | /* no command while frozen */ | ||
298 | if (unlikely(ap->pflags & ATA_PFLAG_FROZEN)) | ||
299 | return NULL; | ||
300 | |||
301 | - /* the last tag is reserved for internal command. */ | ||
302 | - for (i = 0; i < ATA_MAX_QUEUE - 1; i++) | ||
303 | - if (!test_and_set_bit(i, &ap->qc_allocated)) { | ||
304 | - qc = __ata_qc_from_tag(ap, i); | ||
305 | + for (i = 0; i < ATA_MAX_QUEUE; i++) { | ||
306 | + tag = (i + ap->last_tag + 1) % ATA_MAX_QUEUE; | ||
307 | + | ||
308 | + /* the last tag is reserved for internal command. */ | ||
309 | + if (tag == ATA_TAG_INTERNAL) | ||
310 | + continue; | ||
311 | + | ||
312 | + if (!test_and_set_bit(tag, &ap->qc_allocated)) { | ||
313 | + qc = __ata_qc_from_tag(ap, tag); | ||
314 | + qc->tag = tag; | ||
315 | + ap->last_tag = tag; | ||
316 | break; | ||
317 | } | ||
318 | - | ||
319 | - if (qc) | ||
320 | - qc->tag = i; | ||
321 | + } | ||
322 | |||
323 | return qc; | ||
324 | } | ||
325 | diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c | ||
326 | index 04ceb7e2fadd..eb3575b3fbf0 100644 | ||
327 | --- a/drivers/block/floppy.c | ||
328 | +++ b/drivers/block/floppy.c | ||
329 | @@ -3053,7 +3053,10 @@ static int raw_cmd_copyout(int cmd, void __user *param, | ||
330 | int ret; | ||
331 | |||
332 | while (ptr) { | ||
333 | - ret = copy_to_user(param, ptr, sizeof(*ptr)); | ||
334 | + struct floppy_raw_cmd cmd = *ptr; | ||
335 | + cmd.next = NULL; | ||
336 | + cmd.kernel_data = NULL; | ||
337 | + ret = copy_to_user(param, &cmd, sizeof(cmd)); | ||
338 | if (ret) | ||
339 | return -EFAULT; | ||
340 | param += sizeof(struct floppy_raw_cmd); | ||
341 | @@ -3107,10 +3110,11 @@ loop: | ||
342 | return -ENOMEM; | ||
343 | *rcmd = ptr; | ||
344 | ret = copy_from_user(ptr, param, sizeof(*ptr)); | ||
345 | - if (ret) | ||
346 | - return -EFAULT; | ||
347 | ptr->next = NULL; | ||
348 | ptr->buffer_length = 0; | ||
349 | + ptr->kernel_data = NULL; | ||
350 | + if (ret) | ||
351 | + return -EFAULT; | ||
352 | param += sizeof(struct floppy_raw_cmd); | ||
353 | if (ptr->cmd_count > 33) | ||
354 | /* the command may now also take up the space | ||
355 | @@ -3126,7 +3130,6 @@ loop: | ||
356 | for (i = 0; i < 16; i++) | ||
357 | ptr->reply[i] = 0; | ||
358 | ptr->resultcode = 0; | ||
359 | - ptr->kernel_data = NULL; | ||
360 | |||
361 | if (ptr->flags & (FD_RAW_READ | FD_RAW_WRITE)) { | ||
362 | if (ptr->length <= 0) | ||
363 | diff --git a/drivers/gpio/gpio-mxs.c b/drivers/gpio/gpio-mxs.c | ||
364 | index f8e6af20dfbf..d599fc42ae8b 100644 | ||
365 | --- a/drivers/gpio/gpio-mxs.c | ||
366 | +++ b/drivers/gpio/gpio-mxs.c | ||
367 | @@ -214,7 +214,8 @@ static void __init mxs_gpio_init_gc(struct mxs_gpio_port *port, int irq_base) | ||
368 | ct->regs.ack = PINCTRL_IRQSTAT(port) + MXS_CLR; | ||
369 | ct->regs.mask = PINCTRL_IRQEN(port); | ||
370 | |||
371 | - irq_setup_generic_chip(gc, IRQ_MSK(32), 0, IRQ_NOREQUEST, 0); | ||
372 | + irq_setup_generic_chip(gc, IRQ_MSK(32), IRQ_GC_INIT_NESTED_LOCK, | ||
373 | + IRQ_NOREQUEST, 0); | ||
374 | } | ||
375 | |||
376 | static int mxs_gpio_to_irq(struct gpio_chip *gc, unsigned offset) | ||
377 | diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.c b/drivers/gpu/drm/cirrus/cirrus_drv.c | ||
378 | index 8ecb601152ef..64bfc235021a 100644 | ||
379 | --- a/drivers/gpu/drm/cirrus/cirrus_drv.c | ||
380 | +++ b/drivers/gpu/drm/cirrus/cirrus_drv.c | ||
381 | @@ -11,6 +11,7 @@ | ||
382 | #include <linux/module.h> | ||
383 | #include <linux/console.h> | ||
384 | #include <drm/drmP.h> | ||
385 | +#include <drm/drm_crtc_helper.h> | ||
386 | |||
387 | #include "cirrus_drv.h" | ||
388 | |||
389 | @@ -75,6 +76,41 @@ static void cirrus_pci_remove(struct pci_dev *pdev) | ||
390 | drm_put_dev(dev); | ||
391 | } | ||
392 | |||
393 | +static int cirrus_pm_suspend(struct device *dev) | ||
394 | +{ | ||
395 | + struct pci_dev *pdev = to_pci_dev(dev); | ||
396 | + struct drm_device *drm_dev = pci_get_drvdata(pdev); | ||
397 | + struct cirrus_device *cdev = drm_dev->dev_private; | ||
398 | + | ||
399 | + drm_kms_helper_poll_disable(drm_dev); | ||
400 | + | ||
401 | + if (cdev->mode_info.gfbdev) { | ||
402 | + console_lock(); | ||
403 | + fb_set_suspend(cdev->mode_info.gfbdev->helper.fbdev, 1); | ||
404 | + console_unlock(); | ||
405 | + } | ||
406 | + | ||
407 | + return 0; | ||
408 | +} | ||
409 | + | ||
410 | +static int cirrus_pm_resume(struct device *dev) | ||
411 | +{ | ||
412 | + struct pci_dev *pdev = to_pci_dev(dev); | ||
413 | + struct drm_device *drm_dev = pci_get_drvdata(pdev); | ||
414 | + struct cirrus_device *cdev = drm_dev->dev_private; | ||
415 | + | ||
416 | + drm_helper_resume_force_mode(drm_dev); | ||
417 | + | ||
418 | + if (cdev->mode_info.gfbdev) { | ||
419 | + console_lock(); | ||
420 | + fb_set_suspend(cdev->mode_info.gfbdev->helper.fbdev, 0); | ||
421 | + console_unlock(); | ||
422 | + } | ||
423 | + | ||
424 | + drm_kms_helper_poll_enable(drm_dev); | ||
425 | + return 0; | ||
426 | +} | ||
427 | + | ||
428 | static const struct file_operations cirrus_driver_fops = { | ||
429 | .owner = THIS_MODULE, | ||
430 | .open = drm_open, | ||
431 | @@ -105,11 +141,17 @@ static struct drm_driver driver = { | ||
432 | .dumb_destroy = cirrus_dumb_destroy, | ||
433 | }; | ||
434 | |||
435 | +static const struct dev_pm_ops cirrus_pm_ops = { | ||
436 | + SET_SYSTEM_SLEEP_PM_OPS(cirrus_pm_suspend, | ||
437 | + cirrus_pm_resume) | ||
438 | +}; | ||
439 | + | ||
440 | static struct pci_driver cirrus_pci_driver = { | ||
441 | .name = DRIVER_NAME, | ||
442 | .id_table = pciidlist, | ||
443 | .probe = cirrus_pci_probe, | ||
444 | .remove = cirrus_pci_remove, | ||
445 | + .driver.pm = &cirrus_pm_ops, | ||
446 | }; | ||
447 | |||
448 | static int __init cirrus_init(void) | ||
449 | diff --git a/drivers/gpu/drm/cirrus/cirrus_mode.c b/drivers/gpu/drm/cirrus/cirrus_mode.c | ||
450 | index 379a47ea99f6..b86f68d8b726 100644 | ||
451 | --- a/drivers/gpu/drm/cirrus/cirrus_mode.c | ||
452 | +++ b/drivers/gpu/drm/cirrus/cirrus_mode.c | ||
453 | @@ -308,6 +308,9 @@ static int cirrus_crtc_mode_set(struct drm_crtc *crtc, | ||
454 | |||
455 | WREG_HDR(hdr); | ||
456 | cirrus_crtc_do_set_base(crtc, old_fb, x, y, 0); | ||
457 | + | ||
458 | + /* Unblank (needed on S3 resume, vgabios doesn't do it then) */ | ||
459 | + outb(0x20, 0x3c0); | ||
460 | return 0; | ||
461 | } | ||
462 | |||
463 | diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c | ||
464 | index 58b4a53715cd..4a809969c5ac 100644 | ||
465 | --- a/drivers/gpu/drm/i915/intel_crt.c | ||
466 | +++ b/drivers/gpu/drm/i915/intel_crt.c | ||
467 | @@ -717,6 +717,14 @@ static const struct dmi_system_id intel_no_crt[] = { | ||
468 | DMI_MATCH(DMI_PRODUCT_NAME, "ZGB"), | ||
469 | }, | ||
470 | }, | ||
471 | + { | ||
472 | + .callback = intel_no_crt_dmi_callback, | ||
473 | + .ident = "DELL XPS 8700", | ||
474 | + .matches = { | ||
475 | + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
476 | + DMI_MATCH(DMI_PRODUCT_NAME, "XPS 8700"), | ||
477 | + }, | ||
478 | + }, | ||
479 | { } | ||
480 | }; | ||
481 | |||
482 | diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c | ||
483 | index 588a5eca63d8..ce6c603a3cc9 100644 | ||
484 | --- a/drivers/infiniband/ulp/isert/ib_isert.c | ||
485 | +++ b/drivers/infiniband/ulp/isert/ib_isert.c | ||
486 | @@ -1201,7 +1201,7 @@ isert_unmap_cmd(struct isert_cmd *isert_cmd, struct isert_conn *isert_conn) | ||
487 | } | ||
488 | |||
489 | static void | ||
490 | -isert_put_cmd(struct isert_cmd *isert_cmd) | ||
491 | +isert_put_cmd(struct isert_cmd *isert_cmd, bool comp_err) | ||
492 | { | ||
493 | struct iscsi_cmd *cmd = &isert_cmd->iscsi_cmd; | ||
494 | struct isert_conn *isert_conn = isert_cmd->conn; | ||
495 | @@ -1216,8 +1216,21 @@ isert_put_cmd(struct isert_cmd *isert_cmd) | ||
496 | list_del_init(&cmd->i_conn_node); | ||
497 | spin_unlock_bh(&conn->cmd_lock); | ||
498 | |||
499 | - if (cmd->data_direction == DMA_TO_DEVICE) | ||
500 | + if (cmd->data_direction == DMA_TO_DEVICE) { | ||
501 | iscsit_stop_dataout_timer(cmd); | ||
502 | + /* | ||
503 | + * Check for special case during comp_err where | ||
504 | + * WRITE_PENDING has been handed off from core, | ||
505 | + * but requires an extra target_put_sess_cmd() | ||
506 | + * before transport_generic_free_cmd() below. | ||
507 | + */ | ||
508 | + if (comp_err && | ||
509 | + cmd->se_cmd.t_state == TRANSPORT_WRITE_PENDING) { | ||
510 | + struct se_cmd *se_cmd = &cmd->se_cmd; | ||
511 | + | ||
512 | + target_put_sess_cmd(se_cmd->se_sess, se_cmd); | ||
513 | + } | ||
514 | + } | ||
515 | |||
516 | isert_unmap_cmd(isert_cmd, isert_conn); | ||
517 | transport_generic_free_cmd(&cmd->se_cmd, 0); | ||
518 | @@ -1271,7 +1284,7 @@ isert_unmap_tx_desc(struct iser_tx_desc *tx_desc, struct ib_device *ib_dev) | ||
519 | |||
520 | static void | ||
521 | isert_completion_put(struct iser_tx_desc *tx_desc, struct isert_cmd *isert_cmd, | ||
522 | - struct ib_device *ib_dev) | ||
523 | + struct ib_device *ib_dev, bool comp_err) | ||
524 | { | ||
525 | if (isert_cmd->sense_buf_dma != 0) { | ||
526 | pr_debug("Calling ib_dma_unmap_single for isert_cmd->sense_buf_dma\n"); | ||
527 | @@ -1281,7 +1294,7 @@ isert_completion_put(struct iser_tx_desc *tx_desc, struct isert_cmd *isert_cmd, | ||
528 | } | ||
529 | |||
530 | isert_unmap_tx_desc(tx_desc, ib_dev); | ||
531 | - isert_put_cmd(isert_cmd); | ||
532 | + isert_put_cmd(isert_cmd, comp_err); | ||
533 | } | ||
534 | |||
535 | static void | ||
536 | @@ -1336,14 +1349,14 @@ isert_do_control_comp(struct work_struct *work) | ||
537 | iscsit_tmr_post_handler(cmd, cmd->conn); | ||
538 | |||
539 | cmd->i_state = ISTATE_SENT_STATUS; | ||
540 | - isert_completion_put(&isert_cmd->tx_desc, isert_cmd, ib_dev); | ||
541 | + isert_completion_put(&isert_cmd->tx_desc, isert_cmd, ib_dev, false); | ||
542 | break; | ||
543 | case ISTATE_SEND_REJECT: | ||
544 | pr_debug("Got isert_do_control_comp ISTATE_SEND_REJECT: >>>\n"); | ||
545 | atomic_dec(&isert_conn->post_send_buf_count); | ||
546 | |||
547 | cmd->i_state = ISTATE_SENT_STATUS; | ||
548 | - isert_completion_put(&isert_cmd->tx_desc, isert_cmd, ib_dev); | ||
549 | + isert_completion_put(&isert_cmd->tx_desc, isert_cmd, ib_dev, false); | ||
550 | break; | ||
551 | case ISTATE_SEND_LOGOUTRSP: | ||
552 | pr_debug("Calling iscsit_logout_post_handler >>>>>>>>>>>>>>\n"); | ||
553 | @@ -1382,7 +1395,7 @@ isert_response_completion(struct iser_tx_desc *tx_desc, | ||
554 | atomic_sub(wr->send_wr_num + 1, &isert_conn->post_send_buf_count); | ||
555 | |||
556 | cmd->i_state = ISTATE_SENT_STATUS; | ||
557 | - isert_completion_put(tx_desc, isert_cmd, ib_dev); | ||
558 | + isert_completion_put(tx_desc, isert_cmd, ib_dev, false); | ||
559 | } | ||
560 | |||
561 | static void | ||
562 | @@ -1436,7 +1449,7 @@ isert_cq_tx_comp_err(struct iser_tx_desc *tx_desc, struct isert_conn *isert_conn | ||
563 | if (!isert_cmd) | ||
564 | isert_unmap_tx_desc(tx_desc, ib_dev); | ||
565 | else | ||
566 | - isert_completion_put(tx_desc, isert_cmd, ib_dev); | ||
567 | + isert_completion_put(tx_desc, isert_cmd, ib_dev, true); | ||
568 | } | ||
569 | |||
570 | static void | ||
571 | diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c | ||
572 | index c69c81608f43..d60c9b7ad1b8 100644 | ||
573 | --- a/drivers/input/mouse/synaptics.c | ||
574 | +++ b/drivers/input/mouse/synaptics.c | ||
575 | @@ -1515,6 +1515,22 @@ static const struct dmi_system_id min_max_dmi_table[] __initconst = { | ||
576 | .driver_data = (int []){1232, 5710, 1156, 4696}, | ||
577 | }, | ||
578 | { | ||
579 | + /* Lenovo ThinkPad Edge E431 */ | ||
580 | + .matches = { | ||
581 | + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
582 | + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad Edge E431"), | ||
583 | + }, | ||
584 | + .driver_data = (int []){1024, 5022, 2508, 4832}, | ||
585 | + }, | ||
586 | + { | ||
587 | + /* Lenovo ThinkPad T431s */ | ||
588 | + .matches = { | ||
589 | + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
590 | + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T431"), | ||
591 | + }, | ||
592 | + .driver_data = (int []){1024, 5112, 2024, 4832}, | ||
593 | + }, | ||
594 | + { | ||
595 | /* Lenovo ThinkPad T440s */ | ||
596 | .matches = { | ||
597 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
598 | @@ -1523,6 +1539,14 @@ static const struct dmi_system_id min_max_dmi_table[] __initconst = { | ||
599 | .driver_data = (int []){1024, 5112, 2024, 4832}, | ||
600 | }, | ||
601 | { | ||
602 | + /* Lenovo ThinkPad L440 */ | ||
603 | + .matches = { | ||
604 | + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
605 | + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L440"), | ||
606 | + }, | ||
607 | + .driver_data = (int []){1024, 5112, 2024, 4832}, | ||
608 | + }, | ||
609 | + { | ||
610 | /* Lenovo ThinkPad T540p */ | ||
611 | .matches = { | ||
612 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
613 | @@ -1530,6 +1554,32 @@ static const struct dmi_system_id min_max_dmi_table[] __initconst = { | ||
614 | }, | ||
615 | .driver_data = (int []){1024, 5056, 2058, 4832}, | ||
616 | }, | ||
617 | + { | ||
618 | + /* Lenovo ThinkPad L540 */ | ||
619 | + .matches = { | ||
620 | + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
621 | + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L540"), | ||
622 | + }, | ||
623 | + .driver_data = (int []){1024, 5112, 2024, 4832}, | ||
624 | + }, | ||
625 | + { | ||
626 | + /* Lenovo Yoga S1 */ | ||
627 | + .matches = { | ||
628 | + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
629 | + DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, | ||
630 | + "ThinkPad S1 Yoga"), | ||
631 | + }, | ||
632 | + .driver_data = (int []){1232, 5710, 1156, 4696}, | ||
633 | + }, | ||
634 | + { | ||
635 | + /* Lenovo ThinkPad X1 Carbon Haswell (3rd generation) */ | ||
636 | + .matches = { | ||
637 | + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
638 | + DMI_MATCH(DMI_PRODUCT_VERSION, | ||
639 | + "ThinkPad X1 Carbon 2nd"), | ||
640 | + }, | ||
641 | + .driver_data = (int []){1024, 5112, 2024, 4832}, | ||
642 | + }, | ||
643 | #endif | ||
644 | { } | ||
645 | }; | ||
646 | diff --git a/drivers/md/dm-cache-metadata.c b/drivers/md/dm-cache-metadata.c | ||
647 | index 1af7255bbffb..a33e07f4222e 100644 | ||
648 | --- a/drivers/md/dm-cache-metadata.c | ||
649 | +++ b/drivers/md/dm-cache-metadata.c | ||
650 | @@ -511,8 +511,9 @@ static int __begin_transaction_flags(struct dm_cache_metadata *cmd, | ||
651 | disk_super = dm_block_data(sblock); | ||
652 | update_flags(disk_super, mutator); | ||
653 | read_superblock_fields(cmd, disk_super); | ||
654 | + dm_bm_unlock(sblock); | ||
655 | |||
656 | - return dm_bm_flush_and_unlock(cmd->bm, sblock); | ||
657 | + return dm_bm_flush(cmd->bm); | ||
658 | } | ||
659 | |||
660 | static int __begin_transaction(struct dm_cache_metadata *cmd) | ||
661 | diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c | ||
662 | index 901aac27e522..7d0ac0a6e724 100644 | ||
663 | --- a/drivers/md/dm-thin.c | ||
664 | +++ b/drivers/md/dm-thin.c | ||
665 | @@ -1322,9 +1322,9 @@ static void process_deferred_bios(struct pool *pool) | ||
666 | */ | ||
667 | if (ensure_next_mapping(pool)) { | ||
668 | spin_lock_irqsave(&pool->lock, flags); | ||
669 | + bio_list_add(&pool->deferred_bios, bio); | ||
670 | bio_list_merge(&pool->deferred_bios, &bios); | ||
671 | spin_unlock_irqrestore(&pool->lock, flags); | ||
672 | - | ||
673 | break; | ||
674 | } | ||
675 | |||
676 | diff --git a/drivers/md/persistent-data/dm-block-manager.c b/drivers/md/persistent-data/dm-block-manager.c | ||
677 | index 81b513890e2b..6372d0bea532 100644 | ||
678 | --- a/drivers/md/persistent-data/dm-block-manager.c | ||
679 | +++ b/drivers/md/persistent-data/dm-block-manager.c | ||
680 | @@ -595,25 +595,14 @@ int dm_bm_unlock(struct dm_block *b) | ||
681 | } | ||
682 | EXPORT_SYMBOL_GPL(dm_bm_unlock); | ||
683 | |||
684 | -int dm_bm_flush_and_unlock(struct dm_block_manager *bm, | ||
685 | - struct dm_block *superblock) | ||
686 | +int dm_bm_flush(struct dm_block_manager *bm) | ||
687 | { | ||
688 | - int r; | ||
689 | - | ||
690 | if (bm->read_only) | ||
691 | return -EPERM; | ||
692 | |||
693 | - r = dm_bufio_write_dirty_buffers(bm->bufio); | ||
694 | - if (unlikely(r)) { | ||
695 | - dm_bm_unlock(superblock); | ||
696 | - return r; | ||
697 | - } | ||
698 | - | ||
699 | - dm_bm_unlock(superblock); | ||
700 | - | ||
701 | return dm_bufio_write_dirty_buffers(bm->bufio); | ||
702 | } | ||
703 | -EXPORT_SYMBOL_GPL(dm_bm_flush_and_unlock); | ||
704 | +EXPORT_SYMBOL_GPL(dm_bm_flush); | ||
705 | |||
706 | void dm_bm_set_read_only(struct dm_block_manager *bm) | ||
707 | { | ||
708 | diff --git a/drivers/md/persistent-data/dm-block-manager.h b/drivers/md/persistent-data/dm-block-manager.h | ||
709 | index be5bff61be28..f74c0462e5e4 100644 | ||
710 | --- a/drivers/md/persistent-data/dm-block-manager.h | ||
711 | +++ b/drivers/md/persistent-data/dm-block-manager.h | ||
712 | @@ -105,8 +105,7 @@ int dm_bm_unlock(struct dm_block *b); | ||
713 | * | ||
714 | * This method always blocks. | ||
715 | */ | ||
716 | -int dm_bm_flush_and_unlock(struct dm_block_manager *bm, | ||
717 | - struct dm_block *superblock); | ||
718 | +int dm_bm_flush(struct dm_block_manager *bm); | ||
719 | |||
720 | /* | ||
721 | * Switches the bm to a read only mode. Once read-only mode | ||
722 | diff --git a/drivers/md/persistent-data/dm-transaction-manager.c b/drivers/md/persistent-data/dm-transaction-manager.c | ||
723 | index 81da1a26042e..3bc30a0ae3d6 100644 | ||
724 | --- a/drivers/md/persistent-data/dm-transaction-manager.c | ||
725 | +++ b/drivers/md/persistent-data/dm-transaction-manager.c | ||
726 | @@ -154,7 +154,7 @@ int dm_tm_pre_commit(struct dm_transaction_manager *tm) | ||
727 | if (r < 0) | ||
728 | return r; | ||
729 | |||
730 | - return 0; | ||
731 | + return dm_bm_flush(tm->bm); | ||
732 | } | ||
733 | EXPORT_SYMBOL_GPL(dm_tm_pre_commit); | ||
734 | |||
735 | @@ -164,8 +164,9 @@ int dm_tm_commit(struct dm_transaction_manager *tm, struct dm_block *root) | ||
736 | return -EWOULDBLOCK; | ||
737 | |||
738 | wipe_shadow_table(tm); | ||
739 | + dm_bm_unlock(root); | ||
740 | |||
741 | - return dm_bm_flush_and_unlock(tm->bm, root); | ||
742 | + return dm_bm_flush(tm->bm); | ||
743 | } | ||
744 | EXPORT_SYMBOL_GPL(dm_tm_commit); | ||
745 | |||
746 | diff --git a/drivers/md/persistent-data/dm-transaction-manager.h b/drivers/md/persistent-data/dm-transaction-manager.h | ||
747 | index b5b139076ca5..2772ed2a781a 100644 | ||
748 | --- a/drivers/md/persistent-data/dm-transaction-manager.h | ||
749 | +++ b/drivers/md/persistent-data/dm-transaction-manager.h | ||
750 | @@ -38,18 +38,17 @@ struct dm_transaction_manager *dm_tm_create_non_blocking_clone(struct dm_transac | ||
751 | /* | ||
752 | * We use a 2-phase commit here. | ||
753 | * | ||
754 | - * i) In the first phase the block manager is told to start flushing, and | ||
755 | - * the changes to the space map are written to disk. You should interrogate | ||
756 | - * your particular space map to get detail of its root node etc. to be | ||
757 | - * included in your superblock. | ||
758 | + * i) Make all changes for the transaction *except* for the superblock. | ||
759 | + * Then call dm_tm_pre_commit() to flush them to disk. | ||
760 | * | ||
761 | - * ii) @root will be committed last. You shouldn't use more than the | ||
762 | - * first 512 bytes of @root if you wish the transaction to survive a power | ||
763 | - * failure. You *must* have a write lock held on @root for both stage (i) | ||
764 | - * and (ii). The commit will drop the write lock. | ||
765 | + * ii) Lock your superblock. Update. Then call dm_tm_commit() which will | ||
766 | + * unlock the superblock and flush it. No other blocks should be updated | ||
767 | + * during this period. Care should be taken to never unlock a partially | ||
768 | + * updated superblock; perform any operations that could fail *before* you | ||
769 | + * take the superblock lock. | ||
770 | */ | ||
771 | int dm_tm_pre_commit(struct dm_transaction_manager *tm); | ||
772 | -int dm_tm_commit(struct dm_transaction_manager *tm, struct dm_block *root); | ||
773 | +int dm_tm_commit(struct dm_transaction_manager *tm, struct dm_block *superblock); | ||
774 | |||
775 | /* | ||
776 | * These methods are the only way to get hold of a writeable block. | ||
777 | diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c | ||
778 | index 2d23d2929438..cc69e415df35 100644 | ||
779 | --- a/drivers/mtd/nand/atmel_nand.c | ||
780 | +++ b/drivers/mtd/nand/atmel_nand.c | ||
781 | @@ -1096,6 +1096,7 @@ static int __init atmel_pmecc_nand_init_params(struct platform_device *pdev, | ||
782 | goto err_pmecc_data_alloc; | ||
783 | } | ||
784 | |||
785 | + nand_chip->options |= NAND_NO_SUBPAGE_WRITE; | ||
786 | nand_chip->ecc.read_page = atmel_nand_pmecc_read_page; | ||
787 | nand_chip->ecc.write_page = atmel_nand_pmecc_write_page; | ||
788 | |||
789 | diff --git a/drivers/mtd/nand/nuc900_nand.c b/drivers/mtd/nand/nuc900_nand.c | ||
790 | index cd6be2ed53a8..14203f3bb0cd 100644 | ||
791 | --- a/drivers/mtd/nand/nuc900_nand.c | ||
792 | +++ b/drivers/mtd/nand/nuc900_nand.c | ||
793 | @@ -225,7 +225,7 @@ static void nuc900_nand_enable(struct nuc900_nand *nand) | ||
794 | val = __raw_readl(nand->reg + REG_FMICSR); | ||
795 | |||
796 | if (!(val & NAND_EN)) | ||
797 | - __raw_writel(val | NAND_EN, REG_FMICSR); | ||
798 | + __raw_writel(val | NAND_EN, nand->reg + REG_FMICSR); | ||
799 | |||
800 | val = __raw_readl(nand->reg + REG_SMCSR); | ||
801 | |||
802 | diff --git a/drivers/mtd/sm_ftl.c b/drivers/mtd/sm_ftl.c | ||
803 | index f9d5615c5727..4b55cd45287b 100644 | ||
804 | --- a/drivers/mtd/sm_ftl.c | ||
805 | +++ b/drivers/mtd/sm_ftl.c | ||
806 | @@ -59,15 +59,12 @@ struct attribute_group *sm_create_sysfs_attributes(struct sm_ftl *ftl) | ||
807 | struct attribute_group *attr_group; | ||
808 | struct attribute **attributes; | ||
809 | struct sm_sysfs_attribute *vendor_attribute; | ||
810 | + char *vendor; | ||
811 | |||
812 | - int vendor_len = strnlen(ftl->cis_buffer + SM_CIS_VENDOR_OFFSET, | ||
813 | - SM_SMALL_PAGE - SM_CIS_VENDOR_OFFSET); | ||
814 | - | ||
815 | - char *vendor = kmalloc(vendor_len, GFP_KERNEL); | ||
816 | + vendor = kstrndup(ftl->cis_buffer + SM_CIS_VENDOR_OFFSET, | ||
817 | + SM_SMALL_PAGE - SM_CIS_VENDOR_OFFSET, GFP_KERNEL); | ||
818 | if (!vendor) | ||
819 | goto error1; | ||
820 | - memcpy(vendor, ftl->cis_buffer + SM_CIS_VENDOR_OFFSET, vendor_len); | ||
821 | - vendor[vendor_len] = 0; | ||
822 | |||
823 | /* Initialize sysfs attributes */ | ||
824 | vendor_attribute = | ||
825 | @@ -78,7 +75,7 @@ struct attribute_group *sm_create_sysfs_attributes(struct sm_ftl *ftl) | ||
826 | sysfs_attr_init(&vendor_attribute->dev_attr.attr); | ||
827 | |||
828 | vendor_attribute->data = vendor; | ||
829 | - vendor_attribute->len = vendor_len; | ||
830 | + vendor_attribute->len = strlen(vendor); | ||
831 | vendor_attribute->dev_attr.attr.name = "vendor"; | ||
832 | vendor_attribute->dev_attr.attr.mode = S_IRUGO; | ||
833 | vendor_attribute->dev_attr.show = sm_attr_show; | ||
834 | diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c | ||
835 | index 7c970d3ae358..80ecca3e1465 100644 | ||
836 | --- a/drivers/net/wireless/b43/phy_n.c | ||
837 | +++ b/drivers/net/wireless/b43/phy_n.c | ||
838 | @@ -5175,22 +5175,22 @@ static void b43_nphy_channel_setup(struct b43_wldev *dev, | ||
839 | int ch = new_channel->hw_value; | ||
840 | |||
841 | u16 old_band_5ghz; | ||
842 | - u32 tmp32; | ||
843 | + u16 tmp16; | ||
844 | |||
845 | old_band_5ghz = | ||
846 | b43_phy_read(dev, B43_NPHY_BANDCTL) & B43_NPHY_BANDCTL_5GHZ; | ||
847 | if (new_channel->band == IEEE80211_BAND_5GHZ && !old_band_5ghz) { | ||
848 | - tmp32 = b43_read32(dev, B43_MMIO_PSM_PHY_HDR); | ||
849 | - b43_write32(dev, B43_MMIO_PSM_PHY_HDR, tmp32 | 4); | ||
850 | + tmp16 = b43_read16(dev, B43_MMIO_PSM_PHY_HDR); | ||
851 | + b43_write16(dev, B43_MMIO_PSM_PHY_HDR, tmp16 | 4); | ||
852 | b43_phy_set(dev, B43_PHY_B_BBCFG, 0xC000); | ||
853 | - b43_write32(dev, B43_MMIO_PSM_PHY_HDR, tmp32); | ||
854 | + b43_write16(dev, B43_MMIO_PSM_PHY_HDR, tmp16); | ||
855 | b43_phy_set(dev, B43_NPHY_BANDCTL, B43_NPHY_BANDCTL_5GHZ); | ||
856 | } else if (new_channel->band == IEEE80211_BAND_2GHZ && old_band_5ghz) { | ||
857 | b43_phy_mask(dev, B43_NPHY_BANDCTL, ~B43_NPHY_BANDCTL_5GHZ); | ||
858 | - tmp32 = b43_read32(dev, B43_MMIO_PSM_PHY_HDR); | ||
859 | - b43_write32(dev, B43_MMIO_PSM_PHY_HDR, tmp32 | 4); | ||
860 | + tmp16 = b43_read16(dev, B43_MMIO_PSM_PHY_HDR); | ||
861 | + b43_write16(dev, B43_MMIO_PSM_PHY_HDR, tmp16 | 4); | ||
862 | b43_phy_mask(dev, B43_PHY_B_BBCFG, 0x3FFF); | ||
863 | - b43_write32(dev, B43_MMIO_PSM_PHY_HDR, tmp32); | ||
864 | + b43_write16(dev, B43_MMIO_PSM_PHY_HDR, tmp16); | ||
865 | } | ||
866 | |||
867 | b43_chantab_phy_upload(dev, e); | ||
868 | diff --git a/drivers/net/wireless/iwlwifi/dvm/main.c b/drivers/net/wireless/iwlwifi/dvm/main.c | ||
869 | index a8afc7bee545..c2b8e49d00d3 100644 | ||
870 | --- a/drivers/net/wireless/iwlwifi/dvm/main.c | ||
871 | +++ b/drivers/net/wireless/iwlwifi/dvm/main.c | ||
872 | @@ -252,13 +252,17 @@ static void iwl_bg_bt_runtime_config(struct work_struct *work) | ||
873 | struct iwl_priv *priv = | ||
874 | container_of(work, struct iwl_priv, bt_runtime_config); | ||
875 | |||
876 | + mutex_lock(&priv->mutex); | ||
877 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | ||
878 | - return; | ||
879 | + goto out; | ||
880 | |||
881 | /* dont send host command if rf-kill is on */ | ||
882 | if (!iwl_is_ready_rf(priv)) | ||
883 | - return; | ||
884 | + goto out; | ||
885 | + | ||
886 | iwlagn_send_advance_bt_config(priv); | ||
887 | +out: | ||
888 | + mutex_unlock(&priv->mutex); | ||
889 | } | ||
890 | |||
891 | static void iwl_bg_bt_full_concurrency(struct work_struct *work) | ||
892 | diff --git a/drivers/net/wireless/rtlwifi/rtl8188ee/hw.c b/drivers/net/wireless/rtlwifi/rtl8188ee/hw.c | ||
893 | index e06971be7df7..f923d8c9a296 100644 | ||
894 | --- a/drivers/net/wireless/rtlwifi/rtl8188ee/hw.c | ||
895 | +++ b/drivers/net/wireless/rtlwifi/rtl8188ee/hw.c | ||
896 | @@ -1025,9 +1025,20 @@ int rtl88ee_hw_init(struct ieee80211_hw *hw) | ||
897 | bool rtstatus = true; | ||
898 | int err = 0; | ||
899 | u8 tmp_u1b, u1byte; | ||
900 | + unsigned long flags; | ||
901 | |||
902 | RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "Rtl8188EE hw init\n"); | ||
903 | rtlpriv->rtlhal.being_init_adapter = true; | ||
904 | + /* As this function can take a very long time (up to 350 ms) | ||
905 | + * and can be called with irqs disabled, reenable the irqs | ||
906 | + * to let the other devices continue being serviced. | ||
907 | + * | ||
908 | + * It is safe doing so since our own interrupts will only be enabled | ||
909 | + * in a subsequent step. | ||
910 | + */ | ||
911 | + local_save_flags(flags); | ||
912 | + local_irq_enable(); | ||
913 | + | ||
914 | rtlpriv->intf_ops->disable_aspm(hw); | ||
915 | |||
916 | tmp_u1b = rtl_read_byte(rtlpriv, REG_SYS_CLKR+1); | ||
917 | @@ -1043,7 +1054,7 @@ int rtl88ee_hw_init(struct ieee80211_hw *hw) | ||
918 | if (rtstatus != true) { | ||
919 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n"); | ||
920 | err = 1; | ||
921 | - return err; | ||
922 | + goto exit; | ||
923 | } | ||
924 | |||
925 | err = rtl88e_download_fw(hw, false); | ||
926 | @@ -1051,8 +1062,7 @@ int rtl88ee_hw_init(struct ieee80211_hw *hw) | ||
927 | RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, | ||
928 | "Failed to download FW. Init HW without FW now..\n"); | ||
929 | err = 1; | ||
930 | - rtlhal->fw_ready = false; | ||
931 | - return err; | ||
932 | + goto exit; | ||
933 | } else { | ||
934 | rtlhal->fw_ready = true; | ||
935 | } | ||
936 | @@ -1135,10 +1145,12 @@ int rtl88ee_hw_init(struct ieee80211_hw *hw) | ||
937 | } | ||
938 | rtl_write_byte(rtlpriv, REG_NAV_CTRL+2, ((30000+127)/128)); | ||
939 | rtl88e_dm_init(hw); | ||
940 | +exit: | ||
941 | + local_irq_restore(flags); | ||
942 | rtlpriv->rtlhal.being_init_adapter = false; | ||
943 | RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "end of Rtl8188EE hw init %x\n", | ||
944 | err); | ||
945 | - return 0; | ||
946 | + return err; | ||
947 | } | ||
948 | |||
949 | static enum version_8188e _rtl88ee_read_chip_version(struct ieee80211_hw *hw) | ||
950 | diff --git a/drivers/net/wireless/rtlwifi/rtl8188ee/trx.c b/drivers/net/wireless/rtlwifi/rtl8188ee/trx.c | ||
951 | index a8871d66d56a..ea4d014a2884 100644 | ||
952 | --- a/drivers/net/wireless/rtlwifi/rtl8188ee/trx.c | ||
953 | +++ b/drivers/net/wireless/rtlwifi/rtl8188ee/trx.c | ||
954 | @@ -293,7 +293,7 @@ static void _rtl88ee_translate_rx_signal_stuff(struct ieee80211_hw *hw, | ||
955 | u8 *psaddr; | ||
956 | __le16 fc; | ||
957 | u16 type, ufc; | ||
958 | - bool match_bssid, packet_toself, packet_beacon, addr; | ||
959 | + bool match_bssid, packet_toself, packet_beacon = false, addr; | ||
960 | |||
961 | tmp_buf = skb->data + pstatus->rx_drvinfo_size + pstatus->rx_bufshift; | ||
962 | |||
963 | diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c | ||
964 | index 189ba124a8c6..324aa581938e 100644 | ||
965 | --- a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c | ||
966 | +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c | ||
967 | @@ -985,6 +985,17 @@ int rtl92cu_hw_init(struct ieee80211_hw *hw) | ||
968 | struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); | ||
969 | int err = 0; | ||
970 | static bool iqk_initialized; | ||
971 | + unsigned long flags; | ||
972 | + | ||
973 | + /* As this function can take a very long time (up to 350 ms) | ||
974 | + * and can be called with irqs disabled, reenable the irqs | ||
975 | + * to let the other devices continue being serviced. | ||
976 | + * | ||
977 | + * It is safe doing so since our own interrupts will only be enabled | ||
978 | + * in a subsequent step. | ||
979 | + */ | ||
980 | + local_save_flags(flags); | ||
981 | + local_irq_enable(); | ||
982 | |||
983 | rtlhal->hw_type = HARDWARE_TYPE_RTL8192CU; | ||
984 | err = _rtl92cu_init_mac(hw); | ||
985 | @@ -997,7 +1008,7 @@ int rtl92cu_hw_init(struct ieee80211_hw *hw) | ||
986 | RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, | ||
987 | "Failed to download FW. Init HW without FW now..\n"); | ||
988 | err = 1; | ||
989 | - return err; | ||
990 | + goto exit; | ||
991 | } | ||
992 | rtlhal->last_hmeboxnum = 0; /* h2c */ | ||
993 | _rtl92cu_phy_param_tab_init(hw); | ||
994 | @@ -1034,6 +1045,8 @@ int rtl92cu_hw_init(struct ieee80211_hw *hw) | ||
995 | _InitPABias(hw); | ||
996 | _update_mac_setting(hw); | ||
997 | rtl92c_dm_init(hw); | ||
998 | +exit: | ||
999 | + local_irq_restore(flags); | ||
1000 | return err; | ||
1001 | } | ||
1002 | |||
1003 | diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/hw.c b/drivers/net/wireless/rtlwifi/rtl8192se/hw.c | ||
1004 | index 4f461786a7eb..c471400fe8f0 100644 | ||
1005 | --- a/drivers/net/wireless/rtlwifi/rtl8192se/hw.c | ||
1006 | +++ b/drivers/net/wireless/rtlwifi/rtl8192se/hw.c | ||
1007 | @@ -955,7 +955,7 @@ int rtl92se_hw_init(struct ieee80211_hw *hw) | ||
1008 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); | ||
1009 | struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); | ||
1010 | u8 tmp_byte = 0; | ||
1011 | - | ||
1012 | + unsigned long flags; | ||
1013 | bool rtstatus = true; | ||
1014 | u8 tmp_u1b; | ||
1015 | int err = false; | ||
1016 | @@ -967,6 +967,16 @@ int rtl92se_hw_init(struct ieee80211_hw *hw) | ||
1017 | |||
1018 | rtlpci->being_init_adapter = true; | ||
1019 | |||
1020 | + /* As this function can take a very long time (up to 350 ms) | ||
1021 | + * and can be called with irqs disabled, reenable the irqs | ||
1022 | + * to let the other devices continue being serviced. | ||
1023 | + * | ||
1024 | + * It is safe doing so since our own interrupts will only be enabled | ||
1025 | + * in a subsequent step. | ||
1026 | + */ | ||
1027 | + local_save_flags(flags); | ||
1028 | + local_irq_enable(); | ||
1029 | + | ||
1030 | rtlpriv->intf_ops->disable_aspm(hw); | ||
1031 | |||
1032 | /* 1. MAC Initialize */ | ||
1033 | @@ -984,7 +994,8 @@ int rtl92se_hw_init(struct ieee80211_hw *hw) | ||
1034 | RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, | ||
1035 | "Failed to download FW. Init HW without FW now... " | ||
1036 | "Please copy FW into /lib/firmware/rtlwifi\n"); | ||
1037 | - return 1; | ||
1038 | + err = 1; | ||
1039 | + goto exit; | ||
1040 | } | ||
1041 | |||
1042 | /* After FW download, we have to reset MAC register */ | ||
1043 | @@ -997,7 +1008,8 @@ int rtl92se_hw_init(struct ieee80211_hw *hw) | ||
1044 | /* 3. Initialize MAC/PHY Config by MACPHY_reg.txt */ | ||
1045 | if (!rtl92s_phy_mac_config(hw)) { | ||
1046 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "MAC Config failed\n"); | ||
1047 | - return rtstatus; | ||
1048 | + err = rtstatus; | ||
1049 | + goto exit; | ||
1050 | } | ||
1051 | |||
1052 | /* because last function modify RCR, so we update | ||
1053 | @@ -1016,7 +1028,8 @@ int rtl92se_hw_init(struct ieee80211_hw *hw) | ||
1054 | /* 4. Initialize BB After MAC Config PHY_reg.txt, AGC_Tab.txt */ | ||
1055 | if (!rtl92s_phy_bb_config(hw)) { | ||
1056 | RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "BB Config failed\n"); | ||
1057 | - return rtstatus; | ||
1058 | + err = rtstatus; | ||
1059 | + goto exit; | ||
1060 | } | ||
1061 | |||
1062 | /* 5. Initiailze RF RAIO_A.txt RF RAIO_B.txt */ | ||
1063 | @@ -1033,7 +1046,8 @@ int rtl92se_hw_init(struct ieee80211_hw *hw) | ||
1064 | |||
1065 | if (!rtl92s_phy_rf_config(hw)) { | ||
1066 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "RF Config failed\n"); | ||
1067 | - return rtstatus; | ||
1068 | + err = rtstatus; | ||
1069 | + goto exit; | ||
1070 | } | ||
1071 | |||
1072 | /* After read predefined TXT, we must set BB/MAC/RF | ||
1073 | @@ -1122,8 +1136,9 @@ int rtl92se_hw_init(struct ieee80211_hw *hw) | ||
1074 | |||
1075 | rtlpriv->cfg->ops->led_control(hw, LED_CTL_POWER_ON); | ||
1076 | rtl92s_dm_init(hw); | ||
1077 | +exit: | ||
1078 | + local_irq_restore(flags); | ||
1079 | rtlpci->being_init_adapter = false; | ||
1080 | - | ||
1081 | return err; | ||
1082 | } | ||
1083 | |||
1084 | diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c | ||
1085 | index 7d0f2e20f1a2..c240b7591cf0 100644 | ||
1086 | --- a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c | ||
1087 | +++ b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c | ||
1088 | @@ -49,6 +49,12 @@ static u8 _rtl92se_map_hwqueue_to_fwqueue(struct sk_buff *skb, u8 skb_queue) | ||
1089 | if (ieee80211_is_nullfunc(fc)) | ||
1090 | return QSLT_HIGH; | ||
1091 | |||
1092 | + /* Kernel commit 1bf4bbb4024dcdab changed EAPOL packets to use | ||
1093 | + * queue V0 at priority 7; however, the RTL8192SE appears to have | ||
1094 | + * that queue at priority 6 | ||
1095 | + */ | ||
1096 | + if (skb->priority == 7) | ||
1097 | + return QSLT_VO; | ||
1098 | return skb->priority; | ||
1099 | } | ||
1100 | |||
1101 | diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/hw.c b/drivers/net/wireless/rtlwifi/rtl8723ae/hw.c | ||
1102 | index c333dfd116b8..99f6bc5fa986 100644 | ||
1103 | --- a/drivers/net/wireless/rtlwifi/rtl8723ae/hw.c | ||
1104 | +++ b/drivers/net/wireless/rtlwifi/rtl8723ae/hw.c | ||
1105 | @@ -880,14 +880,25 @@ int rtl8723ae_hw_init(struct ieee80211_hw *hw) | ||
1106 | bool rtstatus = true; | ||
1107 | int err; | ||
1108 | u8 tmp_u1b; | ||
1109 | + unsigned long flags; | ||
1110 | |||
1111 | rtlpriv->rtlhal.being_init_adapter = true; | ||
1112 | + /* As this function can take a very long time (up to 350 ms) | ||
1113 | + * and can be called with irqs disabled, reenable the irqs | ||
1114 | + * to let the other devices continue being serviced. | ||
1115 | + * | ||
1116 | + * It is safe doing so since our own interrupts will only be enabled | ||
1117 | + * in a subsequent step. | ||
1118 | + */ | ||
1119 | + local_save_flags(flags); | ||
1120 | + local_irq_enable(); | ||
1121 | + | ||
1122 | rtlpriv->intf_ops->disable_aspm(hw); | ||
1123 | rtstatus = _rtl8712e_init_mac(hw); | ||
1124 | if (rtstatus != true) { | ||
1125 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n"); | ||
1126 | err = 1; | ||
1127 | - return err; | ||
1128 | + goto exit; | ||
1129 | } | ||
1130 | |||
1131 | err = rtl8723ae_download_fw(hw); | ||
1132 | @@ -895,8 +906,7 @@ int rtl8723ae_hw_init(struct ieee80211_hw *hw) | ||
1133 | RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, | ||
1134 | "Failed to download FW. Init HW without FW now..\n"); | ||
1135 | err = 1; | ||
1136 | - rtlhal->fw_ready = false; | ||
1137 | - return err; | ||
1138 | + goto exit; | ||
1139 | } else { | ||
1140 | rtlhal->fw_ready = true; | ||
1141 | } | ||
1142 | @@ -971,6 +981,8 @@ int rtl8723ae_hw_init(struct ieee80211_hw *hw) | ||
1143 | RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "under 1.5V\n"); | ||
1144 | } | ||
1145 | rtl8723ae_dm_init(hw); | ||
1146 | +exit: | ||
1147 | + local_irq_restore(flags); | ||
1148 | rtlpriv->rtlhal.being_init_adapter = false; | ||
1149 | return err; | ||
1150 | } | ||
1151 | diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c | ||
1152 | index 8ea7d9b2c671..815e290a1afb 100644 | ||
1153 | --- a/drivers/s390/cio/chsc.c | ||
1154 | +++ b/drivers/s390/cio/chsc.c | ||
1155 | @@ -500,18 +500,27 @@ static void chsc_process_sei_nt0(struct chsc_sei_nt0_area *sei_area) | ||
1156 | |||
1157 | static void chsc_process_event_information(struct chsc_sei *sei, u64 ntsm) | ||
1158 | { | ||
1159 | - do { | ||
1160 | + static int ntsm_unsupported; | ||
1161 | + | ||
1162 | + while (true) { | ||
1163 | memset(sei, 0, sizeof(*sei)); | ||
1164 | sei->request.length = 0x0010; | ||
1165 | sei->request.code = 0x000e; | ||
1166 | - sei->ntsm = ntsm; | ||
1167 | + if (!ntsm_unsupported) | ||
1168 | + sei->ntsm = ntsm; | ||
1169 | |||
1170 | if (chsc(sei)) | ||
1171 | break; | ||
1172 | |||
1173 | if (sei->response.code != 0x0001) { | ||
1174 | - CIO_CRW_EVENT(2, "chsc: sei failed (rc=%04x)\n", | ||
1175 | - sei->response.code); | ||
1176 | + CIO_CRW_EVENT(2, "chsc: sei failed (rc=%04x, ntsm=%llx)\n", | ||
1177 | + sei->response.code, sei->ntsm); | ||
1178 | + | ||
1179 | + if (sei->response.code == 3 && sei->ntsm) { | ||
1180 | + /* Fallback for old firmware. */ | ||
1181 | + ntsm_unsupported = 1; | ||
1182 | + continue; | ||
1183 | + } | ||
1184 | break; | ||
1185 | } | ||
1186 | |||
1187 | @@ -527,7 +536,10 @@ static void chsc_process_event_information(struct chsc_sei *sei, u64 ntsm) | ||
1188 | CIO_CRW_EVENT(2, "chsc: unhandled nt: %d\n", sei->nt); | ||
1189 | break; | ||
1190 | } | ||
1191 | - } while (sei->u.nt0_area.flags & 0x80); | ||
1192 | + | ||
1193 | + if (!(sei->u.nt0_area.flags & 0x80)) | ||
1194 | + break; | ||
1195 | + } | ||
1196 | } | ||
1197 | |||
1198 | /* | ||
1199 | diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c | ||
1200 | index 8dbe500c935d..fe76185cd79a 100644 | ||
1201 | --- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c | ||
1202 | +++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c | ||
1203 | @@ -8174,7 +8174,6 @@ _scsih_suspend(struct pci_dev *pdev, pm_message_t state) | ||
1204 | |||
1205 | mpt2sas_base_free_resources(ioc); | ||
1206 | pci_save_state(pdev); | ||
1207 | - pci_disable_device(pdev); | ||
1208 | pci_set_power_state(pdev, device_state); | ||
1209 | return 0; | ||
1210 | } | ||
1211 | diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c | ||
1212 | index b26f1a5cc0ec..95a5d73e675c 100644 | ||
1213 | --- a/drivers/scsi/virtio_scsi.c | ||
1214 | +++ b/drivers/scsi/virtio_scsi.c | ||
1215 | @@ -751,8 +751,12 @@ static void __virtscsi_set_affinity(struct virtio_scsi *vscsi, bool affinity) | ||
1216 | |||
1217 | vscsi->affinity_hint_set = true; | ||
1218 | } else { | ||
1219 | - for (i = 0; i < vscsi->num_queues; i++) | ||
1220 | + for (i = 0; i < vscsi->num_queues; i++) { | ||
1221 | + if (!vscsi->req_vqs[i].vq) | ||
1222 | + continue; | ||
1223 | + | ||
1224 | virtqueue_set_affinity(vscsi->req_vqs[i].vq, -1); | ||
1225 | + } | ||
1226 | |||
1227 | vscsi->affinity_hint_set = false; | ||
1228 | } | ||
1229 | diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c | ||
1230 | index a2a2645b296c..f179033eaa3e 100644 | ||
1231 | --- a/drivers/tty/hvc/hvc_console.c | ||
1232 | +++ b/drivers/tty/hvc/hvc_console.c | ||
1233 | @@ -190,7 +190,7 @@ static struct tty_driver *hvc_console_device(struct console *c, int *index) | ||
1234 | return hvc_driver; | ||
1235 | } | ||
1236 | |||
1237 | -static int __init hvc_console_setup(struct console *co, char *options) | ||
1238 | +static int hvc_console_setup(struct console *co, char *options) | ||
1239 | { | ||
1240 | if (co->index < 0 || co->index >= MAX_NR_HVC_CONSOLES) | ||
1241 | return -ENODEV; | ||
1242 | diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c | ||
1243 | index 6c7fe90ad72d..6cfe4019abc6 100644 | ||
1244 | --- a/drivers/tty/n_tty.c | ||
1245 | +++ b/drivers/tty/n_tty.c | ||
1246 | @@ -2066,8 +2066,12 @@ static ssize_t n_tty_write(struct tty_struct *tty, struct file *file, | ||
1247 | if (tty->ops->flush_chars) | ||
1248 | tty->ops->flush_chars(tty); | ||
1249 | } else { | ||
1250 | + struct n_tty_data *ldata = tty->disc_data; | ||
1251 | + | ||
1252 | while (nr > 0) { | ||
1253 | + mutex_lock(&ldata->output_lock); | ||
1254 | c = tty->ops->write(tty, b, nr); | ||
1255 | + mutex_unlock(&ldata->output_lock); | ||
1256 | if (c < 0) { | ||
1257 | retval = c; | ||
1258 | goto break_out; | ||
1259 | diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c | ||
1260 | index d28d7afc128a..b167665b7de2 100644 | ||
1261 | --- a/drivers/tty/serial/8250/8250_core.c | ||
1262 | +++ b/drivers/tty/serial/8250/8250_core.c | ||
1263 | @@ -555,7 +555,7 @@ static void serial8250_set_sleep(struct uart_8250_port *p, int sleep) | ||
1264 | */ | ||
1265 | if ((p->port.type == PORT_XR17V35X) || | ||
1266 | (p->port.type == PORT_XR17D15X)) { | ||
1267 | - serial_out(p, UART_EXAR_SLEEP, 0xff); | ||
1268 | + serial_out(p, UART_EXAR_SLEEP, sleep ? 0xff : 0); | ||
1269 | return; | ||
1270 | } | ||
1271 | |||
1272 | diff --git a/drivers/video/aty/mach64_accel.c b/drivers/video/aty/mach64_accel.c | ||
1273 | index e45833ce975b..182bd680141f 100644 | ||
1274 | --- a/drivers/video/aty/mach64_accel.c | ||
1275 | +++ b/drivers/video/aty/mach64_accel.c | ||
1276 | @@ -4,6 +4,7 @@ | ||
1277 | */ | ||
1278 | |||
1279 | #include <linux/delay.h> | ||
1280 | +#include <asm/unaligned.h> | ||
1281 | #include <linux/fb.h> | ||
1282 | #include <video/mach64.h> | ||
1283 | #include "atyfb.h" | ||
1284 | @@ -419,7 +420,7 @@ void atyfb_imageblit(struct fb_info *info, const struct fb_image *image) | ||
1285 | u32 *pbitmap, dwords = (src_bytes + 3) / 4; | ||
1286 | for (pbitmap = (u32*)(image->data); dwords; dwords--, pbitmap++) { | ||
1287 | wait_for_fifo(1, par); | ||
1288 | - aty_st_le32(HOST_DATA0, le32_to_cpup(pbitmap), par); | ||
1289 | + aty_st_le32(HOST_DATA0, get_unaligned_le32(pbitmap), par); | ||
1290 | } | ||
1291 | } | ||
1292 | |||
1293 | diff --git a/drivers/video/aty/mach64_cursor.c b/drivers/video/aty/mach64_cursor.c | ||
1294 | index 95ec042ddbf8..0fe02e22d9a4 100644 | ||
1295 | --- a/drivers/video/aty/mach64_cursor.c | ||
1296 | +++ b/drivers/video/aty/mach64_cursor.c | ||
1297 | @@ -5,6 +5,7 @@ | ||
1298 | #include <linux/fb.h> | ||
1299 | #include <linux/init.h> | ||
1300 | #include <linux/string.h> | ||
1301 | +#include "../fb_draw.h" | ||
1302 | |||
1303 | #include <asm/io.h> | ||
1304 | |||
1305 | @@ -157,24 +158,33 @@ static int atyfb_cursor(struct fb_info *info, struct fb_cursor *cursor) | ||
1306 | |||
1307 | for (i = 0; i < height; i++) { | ||
1308 | for (j = 0; j < width; j++) { | ||
1309 | + u16 l = 0xaaaa; | ||
1310 | b = *src++; | ||
1311 | m = *msk++; | ||
1312 | switch (cursor->rop) { | ||
1313 | case ROP_XOR: | ||
1314 | // Upper 4 bits of mask data | ||
1315 | - fb_writeb(cursor_bits_lookup[(b ^ m) >> 4], dst++); | ||
1316 | + l = cursor_bits_lookup[(b ^ m) >> 4] | | ||
1317 | // Lower 4 bits of mask | ||
1318 | - fb_writeb(cursor_bits_lookup[(b ^ m) & 0x0f], | ||
1319 | - dst++); | ||
1320 | + (cursor_bits_lookup[(b ^ m) & 0x0f] << 8); | ||
1321 | break; | ||
1322 | case ROP_COPY: | ||
1323 | // Upper 4 bits of mask data | ||
1324 | - fb_writeb(cursor_bits_lookup[(b & m) >> 4], dst++); | ||
1325 | + l = cursor_bits_lookup[(b & m) >> 4] | | ||
1326 | // Lower 4 bits of mask | ||
1327 | - fb_writeb(cursor_bits_lookup[(b & m) & 0x0f], | ||
1328 | - dst++); | ||
1329 | + (cursor_bits_lookup[(b & m) & 0x0f] << 8); | ||
1330 | break; | ||
1331 | } | ||
1332 | + /* | ||
1333 | + * If cursor size is not a multiple of 8 characters | ||
1334 | + * we must pad it with transparent pattern (0xaaaa). | ||
1335 | + */ | ||
1336 | + if ((j + 1) * 8 > cursor->image.width) { | ||
1337 | + l = comp(l, 0xaaaa, | ||
1338 | + (1 << ((cursor->image.width & 7) * 2)) - 1); | ||
1339 | + } | ||
1340 | + fb_writeb(l & 0xff, dst++); | ||
1341 | + fb_writeb(l >> 8, dst++); | ||
1342 | } | ||
1343 | dst += offset; | ||
1344 | } | ||
1345 | diff --git a/drivers/video/cfbcopyarea.c b/drivers/video/cfbcopyarea.c | ||
1346 | index bb5a96b1645d..bcb57235fcc7 100644 | ||
1347 | --- a/drivers/video/cfbcopyarea.c | ||
1348 | +++ b/drivers/video/cfbcopyarea.c | ||
1349 | @@ -43,13 +43,22 @@ | ||
1350 | */ | ||
1351 | |||
1352 | static void | ||
1353 | -bitcpy(struct fb_info *p, unsigned long __iomem *dst, int dst_idx, | ||
1354 | - const unsigned long __iomem *src, int src_idx, int bits, | ||
1355 | +bitcpy(struct fb_info *p, unsigned long __iomem *dst, unsigned dst_idx, | ||
1356 | + const unsigned long __iomem *src, unsigned src_idx, int bits, | ||
1357 | unsigned n, u32 bswapmask) | ||
1358 | { | ||
1359 | unsigned long first, last; | ||
1360 | int const shift = dst_idx-src_idx; | ||
1361 | - int left, right; | ||
1362 | + | ||
1363 | +#if 0 | ||
1364 | + /* | ||
1365 | + * If you suspect bug in this function, compare it with this simple | ||
1366 | + * memmove implementation. | ||
1367 | + */ | ||
1368 | + fb_memmove((char *)dst + ((dst_idx & (bits - 1))) / 8, | ||
1369 | + (char *)src + ((src_idx & (bits - 1))) / 8, n / 8); | ||
1370 | + return; | ||
1371 | +#endif | ||
1372 | |||
1373 | first = fb_shifted_pixels_mask_long(p, dst_idx, bswapmask); | ||
1374 | last = ~fb_shifted_pixels_mask_long(p, (dst_idx+n) % bits, bswapmask); | ||
1375 | @@ -98,9 +107,8 @@ bitcpy(struct fb_info *p, unsigned long __iomem *dst, int dst_idx, | ||
1376 | unsigned long d0, d1; | ||
1377 | int m; | ||
1378 | |||
1379 | - right = shift & (bits - 1); | ||
1380 | - left = -shift & (bits - 1); | ||
1381 | - bswapmask &= shift; | ||
1382 | + int const left = shift & (bits - 1); | ||
1383 | + int const right = -shift & (bits - 1); | ||
1384 | |||
1385 | if (dst_idx+n <= bits) { | ||
1386 | // Single destination word | ||
1387 | @@ -110,15 +118,15 @@ bitcpy(struct fb_info *p, unsigned long __iomem *dst, int dst_idx, | ||
1388 | d0 = fb_rev_pixels_in_long(d0, bswapmask); | ||
1389 | if (shift > 0) { | ||
1390 | // Single source word | ||
1391 | - d0 >>= right; | ||
1392 | + d0 <<= left; | ||
1393 | } else if (src_idx+n <= bits) { | ||
1394 | // Single source word | ||
1395 | - d0 <<= left; | ||
1396 | + d0 >>= right; | ||
1397 | } else { | ||
1398 | // 2 source words | ||
1399 | d1 = FB_READL(src + 1); | ||
1400 | d1 = fb_rev_pixels_in_long(d1, bswapmask); | ||
1401 | - d0 = d0<<left | d1>>right; | ||
1402 | + d0 = d0 >> right | d1 << left; | ||
1403 | } | ||
1404 | d0 = fb_rev_pixels_in_long(d0, bswapmask); | ||
1405 | FB_WRITEL(comp(d0, FB_READL(dst), first), dst); | ||
1406 | @@ -135,60 +143,59 @@ bitcpy(struct fb_info *p, unsigned long __iomem *dst, int dst_idx, | ||
1407 | if (shift > 0) { | ||
1408 | // Single source word | ||
1409 | d1 = d0; | ||
1410 | - d0 >>= right; | ||
1411 | - dst++; | ||
1412 | + d0 <<= left; | ||
1413 | n -= bits - dst_idx; | ||
1414 | } else { | ||
1415 | // 2 source words | ||
1416 | d1 = FB_READL(src++); | ||
1417 | d1 = fb_rev_pixels_in_long(d1, bswapmask); | ||
1418 | |||
1419 | - d0 = d0<<left | d1>>right; | ||
1420 | - dst++; | ||
1421 | + d0 = d0 >> right | d1 << left; | ||
1422 | n -= bits - dst_idx; | ||
1423 | } | ||
1424 | d0 = fb_rev_pixels_in_long(d0, bswapmask); | ||
1425 | FB_WRITEL(comp(d0, FB_READL(dst), first), dst); | ||
1426 | d0 = d1; | ||
1427 | + dst++; | ||
1428 | |||
1429 | // Main chunk | ||
1430 | m = n % bits; | ||
1431 | n /= bits; | ||
1432 | while ((n >= 4) && !bswapmask) { | ||
1433 | d1 = FB_READL(src++); | ||
1434 | - FB_WRITEL(d0 << left | d1 >> right, dst++); | ||
1435 | + FB_WRITEL(d0 >> right | d1 << left, dst++); | ||
1436 | d0 = d1; | ||
1437 | d1 = FB_READL(src++); | ||
1438 | - FB_WRITEL(d0 << left | d1 >> right, dst++); | ||
1439 | + FB_WRITEL(d0 >> right | d1 << left, dst++); | ||
1440 | d0 = d1; | ||
1441 | d1 = FB_READL(src++); | ||
1442 | - FB_WRITEL(d0 << left | d1 >> right, dst++); | ||
1443 | + FB_WRITEL(d0 >> right | d1 << left, dst++); | ||
1444 | d0 = d1; | ||
1445 | d1 = FB_READL(src++); | ||
1446 | - FB_WRITEL(d0 << left | d1 >> right, dst++); | ||
1447 | + FB_WRITEL(d0 >> right | d1 << left, dst++); | ||
1448 | d0 = d1; | ||
1449 | n -= 4; | ||
1450 | } | ||
1451 | while (n--) { | ||
1452 | d1 = FB_READL(src++); | ||
1453 | d1 = fb_rev_pixels_in_long(d1, bswapmask); | ||
1454 | - d0 = d0 << left | d1 >> right; | ||
1455 | + d0 = d0 >> right | d1 << left; | ||
1456 | d0 = fb_rev_pixels_in_long(d0, bswapmask); | ||
1457 | FB_WRITEL(d0, dst++); | ||
1458 | d0 = d1; | ||
1459 | } | ||
1460 | |||
1461 | // Trailing bits | ||
1462 | - if (last) { | ||
1463 | - if (m <= right) { | ||
1464 | + if (m) { | ||
1465 | + if (m <= bits - right) { | ||
1466 | // Single source word | ||
1467 | - d0 <<= left; | ||
1468 | + d0 >>= right; | ||
1469 | } else { | ||
1470 | // 2 source words | ||
1471 | d1 = FB_READL(src); | ||
1472 | d1 = fb_rev_pixels_in_long(d1, | ||
1473 | bswapmask); | ||
1474 | - d0 = d0<<left | d1>>right; | ||
1475 | + d0 = d0 >> right | d1 << left; | ||
1476 | } | ||
1477 | d0 = fb_rev_pixels_in_long(d0, bswapmask); | ||
1478 | FB_WRITEL(comp(d0, FB_READL(dst), last), dst); | ||
1479 | @@ -202,43 +209,46 @@ bitcpy(struct fb_info *p, unsigned long __iomem *dst, int dst_idx, | ||
1480 | */ | ||
1481 | |||
1482 | static void | ||
1483 | -bitcpy_rev(struct fb_info *p, unsigned long __iomem *dst, int dst_idx, | ||
1484 | - const unsigned long __iomem *src, int src_idx, int bits, | ||
1485 | +bitcpy_rev(struct fb_info *p, unsigned long __iomem *dst, unsigned dst_idx, | ||
1486 | + const unsigned long __iomem *src, unsigned src_idx, int bits, | ||
1487 | unsigned n, u32 bswapmask) | ||
1488 | { | ||
1489 | unsigned long first, last; | ||
1490 | int shift; | ||
1491 | |||
1492 | - dst += (n-1)/bits; | ||
1493 | - src += (n-1)/bits; | ||
1494 | - if ((n-1) % bits) { | ||
1495 | - dst_idx += (n-1) % bits; | ||
1496 | - dst += dst_idx >> (ffs(bits) - 1); | ||
1497 | - dst_idx &= bits - 1; | ||
1498 | - src_idx += (n-1) % bits; | ||
1499 | - src += src_idx >> (ffs(bits) - 1); | ||
1500 | - src_idx &= bits - 1; | ||
1501 | - } | ||
1502 | +#if 0 | ||
1503 | + /* | ||
1504 | + * If you suspect bug in this function, compare it with this simple | ||
1505 | + * memmove implementation. | ||
1506 | + */ | ||
1507 | + fb_memmove((char *)dst + ((dst_idx & (bits - 1))) / 8, | ||
1508 | + (char *)src + ((src_idx & (bits - 1))) / 8, n / 8); | ||
1509 | + return; | ||
1510 | +#endif | ||
1511 | + | ||
1512 | + dst += (dst_idx + n - 1) / bits; | ||
1513 | + src += (src_idx + n - 1) / bits; | ||
1514 | + dst_idx = (dst_idx + n - 1) % bits; | ||
1515 | + src_idx = (src_idx + n - 1) % bits; | ||
1516 | |||
1517 | shift = dst_idx-src_idx; | ||
1518 | |||
1519 | - first = fb_shifted_pixels_mask_long(p, bits - 1 - dst_idx, bswapmask); | ||
1520 | - last = ~fb_shifted_pixels_mask_long(p, bits - 1 - ((dst_idx-n) % bits), | ||
1521 | - bswapmask); | ||
1522 | + first = ~fb_shifted_pixels_mask_long(p, (dst_idx + 1) % bits, bswapmask); | ||
1523 | + last = fb_shifted_pixels_mask_long(p, (bits + dst_idx + 1 - n) % bits, bswapmask); | ||
1524 | |||
1525 | if (!shift) { | ||
1526 | // Same alignment for source and dest | ||
1527 | |||
1528 | if ((unsigned long)dst_idx+1 >= n) { | ||
1529 | // Single word | ||
1530 | - if (last) | ||
1531 | - first &= last; | ||
1532 | - FB_WRITEL( comp( FB_READL(src), FB_READL(dst), first), dst); | ||
1533 | + if (first) | ||
1534 | + last &= first; | ||
1535 | + FB_WRITEL( comp( FB_READL(src), FB_READL(dst), last), dst); | ||
1536 | } else { | ||
1537 | // Multiple destination words | ||
1538 | |||
1539 | // Leading bits | ||
1540 | - if (first != ~0UL) { | ||
1541 | + if (first) { | ||
1542 | FB_WRITEL( comp( FB_READL(src), FB_READL(dst), first), dst); | ||
1543 | dst--; | ||
1544 | src--; | ||
1545 | @@ -262,7 +272,7 @@ bitcpy_rev(struct fb_info *p, unsigned long __iomem *dst, int dst_idx, | ||
1546 | FB_WRITEL(FB_READL(src--), dst--); | ||
1547 | |||
1548 | // Trailing bits | ||
1549 | - if (last) | ||
1550 | + if (last != -1UL) | ||
1551 | FB_WRITEL( comp( FB_READL(src), FB_READL(dst), last), dst); | ||
1552 | } | ||
1553 | } else { | ||
1554 | @@ -270,29 +280,28 @@ bitcpy_rev(struct fb_info *p, unsigned long __iomem *dst, int dst_idx, | ||
1555 | unsigned long d0, d1; | ||
1556 | int m; | ||
1557 | |||
1558 | - int const left = -shift & (bits-1); | ||
1559 | - int const right = shift & (bits-1); | ||
1560 | - bswapmask &= shift; | ||
1561 | + int const left = shift & (bits-1); | ||
1562 | + int const right = -shift & (bits-1); | ||
1563 | |||
1564 | if ((unsigned long)dst_idx+1 >= n) { | ||
1565 | // Single destination word | ||
1566 | - if (last) | ||
1567 | - first &= last; | ||
1568 | + if (first) | ||
1569 | + last &= first; | ||
1570 | d0 = FB_READL(src); | ||
1571 | if (shift < 0) { | ||
1572 | // Single source word | ||
1573 | - d0 <<= left; | ||
1574 | + d0 >>= right; | ||
1575 | } else if (1+(unsigned long)src_idx >= n) { | ||
1576 | // Single source word | ||
1577 | - d0 >>= right; | ||
1578 | + d0 <<= left; | ||
1579 | } else { | ||
1580 | // 2 source words | ||
1581 | d1 = FB_READL(src - 1); | ||
1582 | d1 = fb_rev_pixels_in_long(d1, bswapmask); | ||
1583 | - d0 = d0>>right | d1<<left; | ||
1584 | + d0 = d0 << left | d1 >> right; | ||
1585 | } | ||
1586 | d0 = fb_rev_pixels_in_long(d0, bswapmask); | ||
1587 | - FB_WRITEL(comp(d0, FB_READL(dst), first), dst); | ||
1588 | + FB_WRITEL(comp(d0, FB_READL(dst), last), dst); | ||
1589 | } else { | ||
1590 | // Multiple destination words | ||
1591 | /** We must always remember the last value read, because in case | ||
1592 | @@ -307,12 +316,12 @@ bitcpy_rev(struct fb_info *p, unsigned long __iomem *dst, int dst_idx, | ||
1593 | if (shift < 0) { | ||
1594 | // Single source word | ||
1595 | d1 = d0; | ||
1596 | - d0 <<= left; | ||
1597 | + d0 >>= right; | ||
1598 | } else { | ||
1599 | // 2 source words | ||
1600 | d1 = FB_READL(src--); | ||
1601 | d1 = fb_rev_pixels_in_long(d1, bswapmask); | ||
1602 | - d0 = d0>>right | d1<<left; | ||
1603 | + d0 = d0 << left | d1 >> right; | ||
1604 | } | ||
1605 | d0 = fb_rev_pixels_in_long(d0, bswapmask); | ||
1606 | FB_WRITEL(comp(d0, FB_READL(dst), first), dst); | ||
1607 | @@ -325,39 +334,39 @@ bitcpy_rev(struct fb_info *p, unsigned long __iomem *dst, int dst_idx, | ||
1608 | n /= bits; | ||
1609 | while ((n >= 4) && !bswapmask) { | ||
1610 | d1 = FB_READL(src--); | ||
1611 | - FB_WRITEL(d0 >> right | d1 << left, dst--); | ||
1612 | + FB_WRITEL(d0 << left | d1 >> right, dst--); | ||
1613 | d0 = d1; | ||
1614 | d1 = FB_READL(src--); | ||
1615 | - FB_WRITEL(d0 >> right | d1 << left, dst--); | ||
1616 | + FB_WRITEL(d0 << left | d1 >> right, dst--); | ||
1617 | d0 = d1; | ||
1618 | d1 = FB_READL(src--); | ||
1619 | - FB_WRITEL(d0 >> right | d1 << left, dst--); | ||
1620 | + FB_WRITEL(d0 << left | d1 >> right, dst--); | ||
1621 | d0 = d1; | ||
1622 | d1 = FB_READL(src--); | ||
1623 | - FB_WRITEL(d0 >> right | d1 << left, dst--); | ||
1624 | + FB_WRITEL(d0 << left | d1 >> right, dst--); | ||
1625 | d0 = d1; | ||
1626 | n -= 4; | ||
1627 | } | ||
1628 | while (n--) { | ||
1629 | d1 = FB_READL(src--); | ||
1630 | d1 = fb_rev_pixels_in_long(d1, bswapmask); | ||
1631 | - d0 = d0 >> right | d1 << left; | ||
1632 | + d0 = d0 << left | d1 >> right; | ||
1633 | d0 = fb_rev_pixels_in_long(d0, bswapmask); | ||
1634 | FB_WRITEL(d0, dst--); | ||
1635 | d0 = d1; | ||
1636 | } | ||
1637 | |||
1638 | // Trailing bits | ||
1639 | - if (last) { | ||
1640 | - if (m <= left) { | ||
1641 | + if (m) { | ||
1642 | + if (m <= bits - left) { | ||
1643 | // Single source word | ||
1644 | - d0 >>= right; | ||
1645 | + d0 <<= left; | ||
1646 | } else { | ||
1647 | // 2 source words | ||
1648 | d1 = FB_READL(src); | ||
1649 | d1 = fb_rev_pixels_in_long(d1, | ||
1650 | bswapmask); | ||
1651 | - d0 = d0>>right | d1<<left; | ||
1652 | + d0 = d0 << left | d1 >> right; | ||
1653 | } | ||
1654 | d0 = fb_rev_pixels_in_long(d0, bswapmask); | ||
1655 | FB_WRITEL(comp(d0, FB_READL(dst), last), dst); | ||
1656 | @@ -371,9 +380,9 @@ void cfb_copyarea(struct fb_info *p, const struct fb_copyarea *area) | ||
1657 | u32 dx = area->dx, dy = area->dy, sx = area->sx, sy = area->sy; | ||
1658 | u32 height = area->height, width = area->width; | ||
1659 | unsigned long const bits_per_line = p->fix.line_length*8u; | ||
1660 | - unsigned long __iomem *dst = NULL, *src = NULL; | ||
1661 | + unsigned long __iomem *base = NULL; | ||
1662 | int bits = BITS_PER_LONG, bytes = bits >> 3; | ||
1663 | - int dst_idx = 0, src_idx = 0, rev_copy = 0; | ||
1664 | + unsigned dst_idx = 0, src_idx = 0, rev_copy = 0; | ||
1665 | u32 bswapmask = fb_compute_bswapmask(p); | ||
1666 | |||
1667 | if (p->state != FBINFO_STATE_RUNNING) | ||
1668 | @@ -389,7 +398,7 @@ void cfb_copyarea(struct fb_info *p, const struct fb_copyarea *area) | ||
1669 | |||
1670 | // split the base of the framebuffer into a long-aligned address and the | ||
1671 | // index of the first bit | ||
1672 | - dst = src = (unsigned long __iomem *)((unsigned long)p->screen_base & ~(bytes-1)); | ||
1673 | + base = (unsigned long __iomem *)((unsigned long)p->screen_base & ~(bytes-1)); | ||
1674 | dst_idx = src_idx = 8*((unsigned long)p->screen_base & (bytes-1)); | ||
1675 | // add offset of source and target area | ||
1676 | dst_idx += dy*bits_per_line + dx*p->var.bits_per_pixel; | ||
1677 | @@ -402,20 +411,14 @@ void cfb_copyarea(struct fb_info *p, const struct fb_copyarea *area) | ||
1678 | while (height--) { | ||
1679 | dst_idx -= bits_per_line; | ||
1680 | src_idx -= bits_per_line; | ||
1681 | - dst += dst_idx >> (ffs(bits) - 1); | ||
1682 | - dst_idx &= (bytes - 1); | ||
1683 | - src += src_idx >> (ffs(bits) - 1); | ||
1684 | - src_idx &= (bytes - 1); | ||
1685 | - bitcpy_rev(p, dst, dst_idx, src, src_idx, bits, | ||
1686 | + bitcpy_rev(p, base + (dst_idx / bits), dst_idx % bits, | ||
1687 | + base + (src_idx / bits), src_idx % bits, bits, | ||
1688 | width*p->var.bits_per_pixel, bswapmask); | ||
1689 | } | ||
1690 | } else { | ||
1691 | while (height--) { | ||
1692 | - dst += dst_idx >> (ffs(bits) - 1); | ||
1693 | - dst_idx &= (bytes - 1); | ||
1694 | - src += src_idx >> (ffs(bits) - 1); | ||
1695 | - src_idx &= (bytes - 1); | ||
1696 | - bitcpy(p, dst, dst_idx, src, src_idx, bits, | ||
1697 | + bitcpy(p, base + (dst_idx / bits), dst_idx % bits, | ||
1698 | + base + (src_idx / bits), src_idx % bits, bits, | ||
1699 | width*p->var.bits_per_pixel, bswapmask); | ||
1700 | dst_idx += bits_per_line; | ||
1701 | src_idx += bits_per_line; | ||
1702 | diff --git a/drivers/video/matrox/matroxfb_accel.c b/drivers/video/matrox/matroxfb_accel.c | ||
1703 | index 8335a6fe303e..0d5cb85d071a 100644 | ||
1704 | --- a/drivers/video/matrox/matroxfb_accel.c | ||
1705 | +++ b/drivers/video/matrox/matroxfb_accel.c | ||
1706 | @@ -192,10 +192,18 @@ void matrox_cfbX_init(struct matrox_fb_info *minfo) | ||
1707 | minfo->accel.m_dwg_rect = M_DWG_TRAP | M_DWG_SOLID | M_DWG_ARZERO | M_DWG_SGNZERO | M_DWG_SHIFTZERO; | ||
1708 | if (isMilleniumII(minfo)) minfo->accel.m_dwg_rect |= M_DWG_TRANSC; | ||
1709 | minfo->accel.m_opmode = mopmode; | ||
1710 | + minfo->accel.m_access = maccess; | ||
1711 | + minfo->accel.m_pitch = mpitch; | ||
1712 | } | ||
1713 | |||
1714 | EXPORT_SYMBOL(matrox_cfbX_init); | ||
1715 | |||
1716 | +static void matrox_accel_restore_maccess(struct matrox_fb_info *minfo) | ||
1717 | +{ | ||
1718 | + mga_outl(M_MACCESS, minfo->accel.m_access); | ||
1719 | + mga_outl(M_PITCH, minfo->accel.m_pitch); | ||
1720 | +} | ||
1721 | + | ||
1722 | static void matrox_accel_bmove(struct matrox_fb_info *minfo, int vxres, int sy, | ||
1723 | int sx, int dy, int dx, int height, int width) | ||
1724 | { | ||
1725 | @@ -207,7 +215,8 @@ static void matrox_accel_bmove(struct matrox_fb_info *minfo, int vxres, int sy, | ||
1726 | CRITBEGIN | ||
1727 | |||
1728 | if ((dy < sy) || ((dy == sy) && (dx <= sx))) { | ||
1729 | - mga_fifo(2); | ||
1730 | + mga_fifo(4); | ||
1731 | + matrox_accel_restore_maccess(minfo); | ||
1732 | mga_outl(M_DWGCTL, M_DWG_BITBLT | M_DWG_SHIFTZERO | M_DWG_SGNZERO | | ||
1733 | M_DWG_BFCOL | M_DWG_REPLACE); | ||
1734 | mga_outl(M_AR5, vxres); | ||
1735 | @@ -215,7 +224,8 @@ static void matrox_accel_bmove(struct matrox_fb_info *minfo, int vxres, int sy, | ||
1736 | start = sy*vxres+sx+curr_ydstorg(minfo); | ||
1737 | end = start+width; | ||
1738 | } else { | ||
1739 | - mga_fifo(3); | ||
1740 | + mga_fifo(5); | ||
1741 | + matrox_accel_restore_maccess(minfo); | ||
1742 | mga_outl(M_DWGCTL, M_DWG_BITBLT | M_DWG_SHIFTZERO | M_DWG_BFCOL | M_DWG_REPLACE); | ||
1743 | mga_outl(M_SGN, 5); | ||
1744 | mga_outl(M_AR5, -vxres); | ||
1745 | @@ -224,7 +234,8 @@ static void matrox_accel_bmove(struct matrox_fb_info *minfo, int vxres, int sy, | ||
1746 | start = end+width; | ||
1747 | dy += height-1; | ||
1748 | } | ||
1749 | - mga_fifo(4); | ||
1750 | + mga_fifo(6); | ||
1751 | + matrox_accel_restore_maccess(minfo); | ||
1752 | mga_outl(M_AR0, end); | ||
1753 | mga_outl(M_AR3, start); | ||
1754 | mga_outl(M_FXBNDRY, ((dx+width)<<16) | dx); | ||
1755 | @@ -246,7 +257,8 @@ static void matrox_accel_bmove_lin(struct matrox_fb_info *minfo, int vxres, | ||
1756 | CRITBEGIN | ||
1757 | |||
1758 | if ((dy < sy) || ((dy == sy) && (dx <= sx))) { | ||
1759 | - mga_fifo(2); | ||
1760 | + mga_fifo(4); | ||
1761 | + matrox_accel_restore_maccess(minfo); | ||
1762 | mga_outl(M_DWGCTL, M_DWG_BITBLT | M_DWG_SHIFTZERO | M_DWG_SGNZERO | | ||
1763 | M_DWG_BFCOL | M_DWG_REPLACE); | ||
1764 | mga_outl(M_AR5, vxres); | ||
1765 | @@ -254,7 +266,8 @@ static void matrox_accel_bmove_lin(struct matrox_fb_info *minfo, int vxres, | ||
1766 | start = sy*vxres+sx+curr_ydstorg(minfo); | ||
1767 | end = start+width; | ||
1768 | } else { | ||
1769 | - mga_fifo(3); | ||
1770 | + mga_fifo(5); | ||
1771 | + matrox_accel_restore_maccess(minfo); | ||
1772 | mga_outl(M_DWGCTL, M_DWG_BITBLT | M_DWG_SHIFTZERO | M_DWG_BFCOL | M_DWG_REPLACE); | ||
1773 | mga_outl(M_SGN, 5); | ||
1774 | mga_outl(M_AR5, -vxres); | ||
1775 | @@ -263,7 +276,8 @@ static void matrox_accel_bmove_lin(struct matrox_fb_info *minfo, int vxres, | ||
1776 | start = end+width; | ||
1777 | dy += height-1; | ||
1778 | } | ||
1779 | - mga_fifo(5); | ||
1780 | + mga_fifo(7); | ||
1781 | + matrox_accel_restore_maccess(minfo); | ||
1782 | mga_outl(M_AR0, end); | ||
1783 | mga_outl(M_AR3, start); | ||
1784 | mga_outl(M_FXBNDRY, ((dx+width)<<16) | dx); | ||
1785 | @@ -298,7 +312,8 @@ static void matroxfb_accel_clear(struct matrox_fb_info *minfo, u_int32_t color, | ||
1786 | |||
1787 | CRITBEGIN | ||
1788 | |||
1789 | - mga_fifo(5); | ||
1790 | + mga_fifo(7); | ||
1791 | + matrox_accel_restore_maccess(minfo); | ||
1792 | mga_outl(M_DWGCTL, minfo->accel.m_dwg_rect | M_DWG_REPLACE); | ||
1793 | mga_outl(M_FCOL, color); | ||
1794 | mga_outl(M_FXBNDRY, ((sx + width) << 16) | sx); | ||
1795 | @@ -341,7 +356,8 @@ static void matroxfb_cfb4_clear(struct matrox_fb_info *minfo, u_int32_t bgx, | ||
1796 | width >>= 1; | ||
1797 | sx >>= 1; | ||
1798 | if (width) { | ||
1799 | - mga_fifo(5); | ||
1800 | + mga_fifo(7); | ||
1801 | + matrox_accel_restore_maccess(minfo); | ||
1802 | mga_outl(M_DWGCTL, minfo->accel.m_dwg_rect | M_DWG_REPLACE2); | ||
1803 | mga_outl(M_FCOL, bgx); | ||
1804 | mga_outl(M_FXBNDRY, ((sx + width) << 16) | sx); | ||
1805 | @@ -415,7 +431,8 @@ static void matroxfb_1bpp_imageblit(struct matrox_fb_info *minfo, u_int32_t fgx, | ||
1806 | |||
1807 | CRITBEGIN | ||
1808 | |||
1809 | - mga_fifo(3); | ||
1810 | + mga_fifo(5); | ||
1811 | + matrox_accel_restore_maccess(minfo); | ||
1812 | if (easy) | ||
1813 | mga_outl(M_DWGCTL, M_DWG_ILOAD | M_DWG_SGNZERO | M_DWG_SHIFTZERO | M_DWG_BMONOWF | M_DWG_LINEAR | M_DWG_REPLACE); | ||
1814 | else | ||
1815 | @@ -425,7 +442,8 @@ static void matroxfb_1bpp_imageblit(struct matrox_fb_info *minfo, u_int32_t fgx, | ||
1816 | fxbndry = ((xx + width - 1) << 16) | xx; | ||
1817 | mmio = minfo->mmio.vbase; | ||
1818 | |||
1819 | - mga_fifo(6); | ||
1820 | + mga_fifo(8); | ||
1821 | + matrox_accel_restore_maccess(minfo); | ||
1822 | mga_writel(mmio, M_FXBNDRY, fxbndry); | ||
1823 | mga_writel(mmio, M_AR0, ar0); | ||
1824 | mga_writel(mmio, M_AR3, 0); | ||
1825 | diff --git a/drivers/video/matrox/matroxfb_base.h b/drivers/video/matrox/matroxfb_base.h | ||
1826 | index 11ed57bb704e..556d96ce40bf 100644 | ||
1827 | --- a/drivers/video/matrox/matroxfb_base.h | ||
1828 | +++ b/drivers/video/matrox/matroxfb_base.h | ||
1829 | @@ -307,6 +307,8 @@ struct matrox_accel_data { | ||
1830 | #endif | ||
1831 | u_int32_t m_dwg_rect; | ||
1832 | u_int32_t m_opmode; | ||
1833 | + u_int32_t m_access; | ||
1834 | + u_int32_t m_pitch; | ||
1835 | }; | ||
1836 | |||
1837 | struct v4l2_queryctrl; | ||
1838 | diff --git a/drivers/video/tgafb.c b/drivers/video/tgafb.c | ||
1839 | index c9c8e5a1fdee..ba77f753649c 100644 | ||
1840 | --- a/drivers/video/tgafb.c | ||
1841 | +++ b/drivers/video/tgafb.c | ||
1842 | @@ -1142,222 +1142,57 @@ copyarea_line_32bpp(struct fb_info *info, u32 dy, u32 sy, | ||
1843 | __raw_writel(TGA_MODE_SBM_24BPP|TGA_MODE_SIMPLE, tga_regs+TGA_MODE_REG); | ||
1844 | } | ||
1845 | |||
1846 | -/* The general case of forward copy in 8bpp mode. */ | ||
1847 | +/* The (almost) general case of backward copy in 8bpp mode. */ | ||
1848 | static inline void | ||
1849 | -copyarea_foreward_8bpp(struct fb_info *info, u32 dx, u32 dy, u32 sx, u32 sy, | ||
1850 | - u32 height, u32 width, u32 line_length) | ||
1851 | +copyarea_8bpp(struct fb_info *info, u32 dx, u32 dy, u32 sx, u32 sy, | ||
1852 | + u32 height, u32 width, u32 line_length, | ||
1853 | + const struct fb_copyarea *area) | ||
1854 | { | ||
1855 | struct tga_par *par = (struct tga_par *) info->par; | ||
1856 | - unsigned long i, copied, left; | ||
1857 | - unsigned long dpos, spos, dalign, salign, yincr; | ||
1858 | - u32 smask_first, dmask_first, dmask_last; | ||
1859 | - int pixel_shift, need_prime, need_second; | ||
1860 | - unsigned long n64, n32, xincr_first; | ||
1861 | + unsigned i, yincr; | ||
1862 | + int depos, sepos, backward, last_step, step; | ||
1863 | + u32 mask_last; | ||
1864 | + unsigned n32; | ||
1865 | void __iomem *tga_regs; | ||
1866 | void __iomem *tga_fb; | ||
1867 | |||
1868 | - yincr = line_length; | ||
1869 | - if (dy > sy) { | ||
1870 | - dy += height - 1; | ||
1871 | - sy += height - 1; | ||
1872 | - yincr = -yincr; | ||
1873 | - } | ||
1874 | - | ||
1875 | - /* Compute the offsets and alignments in the frame buffer. | ||
1876 | - More than anything else, these control how we do copies. */ | ||
1877 | - dpos = dy * line_length + dx; | ||
1878 | - spos = sy * line_length + sx; | ||
1879 | - dalign = dpos & 7; | ||
1880 | - salign = spos & 7; | ||
1881 | - dpos &= -8; | ||
1882 | - spos &= -8; | ||
1883 | - | ||
1884 | - /* Compute the value for the PIXELSHIFT register. This controls | ||
1885 | - both non-co-aligned source and destination and copy direction. */ | ||
1886 | - if (dalign >= salign) | ||
1887 | - pixel_shift = dalign - salign; | ||
1888 | - else | ||
1889 | - pixel_shift = 8 - (salign - dalign); | ||
1890 | - | ||
1891 | - /* Figure out if we need an additional priming step for the | ||
1892 | - residue register. */ | ||
1893 | - need_prime = (salign > dalign); | ||
1894 | - if (need_prime) | ||
1895 | - dpos -= 8; | ||
1896 | - | ||
1897 | - /* Begin by copying the leading unaligned destination. Copy enough | ||
1898 | - to make the next destination address 32-byte aligned. */ | ||
1899 | - copied = 32 - (dalign + (dpos & 31)); | ||
1900 | - if (copied == 32) | ||
1901 | - copied = 0; | ||
1902 | - xincr_first = (copied + 7) & -8; | ||
1903 | - smask_first = dmask_first = (1ul << copied) - 1; | ||
1904 | - smask_first <<= salign; | ||
1905 | - dmask_first <<= dalign + need_prime*8; | ||
1906 | - if (need_prime && copied > 24) | ||
1907 | - copied -= 8; | ||
1908 | - left = width - copied; | ||
1909 | - | ||
1910 | - /* Care for small copies. */ | ||
1911 | - if (copied > width) { | ||
1912 | - u32 t; | ||
1913 | - t = (1ul << width) - 1; | ||
1914 | - t <<= dalign + need_prime*8; | ||
1915 | - dmask_first &= t; | ||
1916 | - left = 0; | ||
1917 | - } | ||
1918 | - | ||
1919 | - /* Attempt to use 64-byte copies. This is only possible if the | ||
1920 | - source and destination are co-aligned at 64 bytes. */ | ||
1921 | - n64 = need_second = 0; | ||
1922 | - if ((dpos & 63) == (spos & 63) | ||
1923 | - && (height == 1 || line_length % 64 == 0)) { | ||
1924 | - /* We may need a 32-byte copy to ensure 64 byte alignment. */ | ||
1925 | - need_second = (dpos + xincr_first) & 63; | ||
1926 | - if ((need_second & 32) != need_second) | ||
1927 | - printk(KERN_ERR "tgafb: need_second wrong\n"); | ||
1928 | - if (left >= need_second + 64) { | ||
1929 | - left -= need_second; | ||
1930 | - n64 = left / 64; | ||
1931 | - left %= 64; | ||
1932 | - } else | ||
1933 | - need_second = 0; | ||
1934 | - } | ||
1935 | - | ||
1936 | - /* Copy trailing full 32-byte sections. This will be the main | ||
1937 | - loop if the 64 byte loop can't be used. */ | ||
1938 | - n32 = left / 32; | ||
1939 | - left %= 32; | ||
1940 | - | ||
1941 | - /* Copy the trailing unaligned destination. */ | ||
1942 | - dmask_last = (1ul << left) - 1; | ||
1943 | - | ||
1944 | - tga_regs = par->tga_regs_base; | ||
1945 | - tga_fb = par->tga_fb_base; | ||
1946 | - | ||
1947 | - /* Set up the MODE and PIXELSHIFT registers. */ | ||
1948 | - __raw_writel(TGA_MODE_SBM_8BPP|TGA_MODE_COPY, tga_regs+TGA_MODE_REG); | ||
1949 | - __raw_writel(pixel_shift, tga_regs+TGA_PIXELSHIFT_REG); | ||
1950 | - wmb(); | ||
1951 | - | ||
1952 | - for (i = 0; i < height; ++i) { | ||
1953 | - unsigned long j; | ||
1954 | - void __iomem *sfb; | ||
1955 | - void __iomem *dfb; | ||
1956 | - | ||
1957 | - sfb = tga_fb + spos; | ||
1958 | - dfb = tga_fb + dpos; | ||
1959 | - if (dmask_first) { | ||
1960 | - __raw_writel(smask_first, sfb); | ||
1961 | - wmb(); | ||
1962 | - __raw_writel(dmask_first, dfb); | ||
1963 | - wmb(); | ||
1964 | - sfb += xincr_first; | ||
1965 | - dfb += xincr_first; | ||
1966 | - } | ||
1967 | - | ||
1968 | - if (need_second) { | ||
1969 | - __raw_writel(0xffffffff, sfb); | ||
1970 | - wmb(); | ||
1971 | - __raw_writel(0xffffffff, dfb); | ||
1972 | - wmb(); | ||
1973 | - sfb += 32; | ||
1974 | - dfb += 32; | ||
1975 | - } | ||
1976 | - | ||
1977 | - if (n64 && (((unsigned long)sfb | (unsigned long)dfb) & 63)) | ||
1978 | - printk(KERN_ERR | ||
1979 | - "tgafb: misaligned copy64 (s:%p, d:%p)\n", | ||
1980 | - sfb, dfb); | ||
1981 | - | ||
1982 | - for (j = 0; j < n64; ++j) { | ||
1983 | - __raw_writel(sfb - tga_fb, tga_regs+TGA_COPY64_SRC); | ||
1984 | - wmb(); | ||
1985 | - __raw_writel(dfb - tga_fb, tga_regs+TGA_COPY64_DST); | ||
1986 | - wmb(); | ||
1987 | - sfb += 64; | ||
1988 | - dfb += 64; | ||
1989 | - } | ||
1990 | - | ||
1991 | - for (j = 0; j < n32; ++j) { | ||
1992 | - __raw_writel(0xffffffff, sfb); | ||
1993 | - wmb(); | ||
1994 | - __raw_writel(0xffffffff, dfb); | ||
1995 | - wmb(); | ||
1996 | - sfb += 32; | ||
1997 | - dfb += 32; | ||
1998 | - } | ||
1999 | - | ||
2000 | - if (dmask_last) { | ||
2001 | - __raw_writel(0xffffffff, sfb); | ||
2002 | - wmb(); | ||
2003 | - __raw_writel(dmask_last, dfb); | ||
2004 | - wmb(); | ||
2005 | - } | ||
2006 | - | ||
2007 | - spos += yincr; | ||
2008 | - dpos += yincr; | ||
2009 | + /* Do acceleration only if we are aligned on 8 pixels */ | ||
2010 | + if ((dx | sx | width) & 7) { | ||
2011 | + cfb_copyarea(info, area); | ||
2012 | + return; | ||
2013 | } | ||
2014 | |||
2015 | - /* Reset the MODE register to normal. */ | ||
2016 | - __raw_writel(TGA_MODE_SBM_8BPP|TGA_MODE_SIMPLE, tga_regs+TGA_MODE_REG); | ||
2017 | -} | ||
2018 | - | ||
2019 | -/* The (almost) general case of backward copy in 8bpp mode. */ | ||
2020 | -static inline void | ||
2021 | -copyarea_backward_8bpp(struct fb_info *info, u32 dx, u32 dy, u32 sx, u32 sy, | ||
2022 | - u32 height, u32 width, u32 line_length, | ||
2023 | - const struct fb_copyarea *area) | ||
2024 | -{ | ||
2025 | - struct tga_par *par = (struct tga_par *) info->par; | ||
2026 | - unsigned long i, left, yincr; | ||
2027 | - unsigned long depos, sepos, dealign, sealign; | ||
2028 | - u32 mask_first, mask_last; | ||
2029 | - unsigned long n32; | ||
2030 | - void __iomem *tga_regs; | ||
2031 | - void __iomem *tga_fb; | ||
2032 | - | ||
2033 | yincr = line_length; | ||
2034 | if (dy > sy) { | ||
2035 | dy += height - 1; | ||
2036 | sy += height - 1; | ||
2037 | yincr = -yincr; | ||
2038 | } | ||
2039 | + backward = dy == sy && dx > sx && dx < sx + width; | ||
2040 | |||
2041 | /* Compute the offsets and alignments in the frame buffer. | ||
2042 | More than anything else, these control how we do copies. */ | ||
2043 | - depos = dy * line_length + dx + width; | ||
2044 | - sepos = sy * line_length + sx + width; | ||
2045 | - dealign = depos & 7; | ||
2046 | - sealign = sepos & 7; | ||
2047 | - | ||
2048 | - /* ??? The documentation appears to be incorrect (or very | ||
2049 | - misleading) wrt how pixel shifting works in backward copy | ||
2050 | - mode, i.e. when PIXELSHIFT is negative. I give up for now. | ||
2051 | - Do handle the common case of co-aligned backward copies, | ||
2052 | - but frob everything else back on generic code. */ | ||
2053 | - if (dealign != sealign) { | ||
2054 | - cfb_copyarea(info, area); | ||
2055 | - return; | ||
2056 | - } | ||
2057 | - | ||
2058 | - /* We begin the copy with the trailing pixels of the | ||
2059 | - unaligned destination. */ | ||
2060 | - mask_first = (1ul << dealign) - 1; | ||
2061 | - left = width - dealign; | ||
2062 | - | ||
2063 | - /* Care for small copies. */ | ||
2064 | - if (dealign > width) { | ||
2065 | - mask_first ^= (1ul << (dealign - width)) - 1; | ||
2066 | - left = 0; | ||
2067 | - } | ||
2068 | + depos = dy * line_length + dx; | ||
2069 | + sepos = sy * line_length + sx; | ||
2070 | + if (backward) | ||
2071 | + depos += width, sepos += width; | ||
2072 | |||
2073 | /* Next copy full words at a time. */ | ||
2074 | - n32 = left / 32; | ||
2075 | - left %= 32; | ||
2076 | + n32 = width / 32; | ||
2077 | + last_step = width % 32; | ||
2078 | |||
2079 | /* Finally copy the unaligned head of the span. */ | ||
2080 | - mask_last = -1 << (32 - left); | ||
2081 | + mask_last = (1ul << last_step) - 1; | ||
2082 | + | ||
2083 | + if (!backward) { | ||
2084 | + step = 32; | ||
2085 | + last_step = 32; | ||
2086 | + } else { | ||
2087 | + step = -32; | ||
2088 | + last_step = -last_step; | ||
2089 | + sepos -= 32; | ||
2090 | + depos -= 32; | ||
2091 | + } | ||
2092 | |||
2093 | tga_regs = par->tga_regs_base; | ||
2094 | tga_fb = par->tga_fb_base; | ||
2095 | @@ -1374,25 +1209,33 @@ copyarea_backward_8bpp(struct fb_info *info, u32 dx, u32 dy, u32 sx, u32 sy, | ||
2096 | |||
2097 | sfb = tga_fb + sepos; | ||
2098 | dfb = tga_fb + depos; | ||
2099 | - if (mask_first) { | ||
2100 | - __raw_writel(mask_first, sfb); | ||
2101 | - wmb(); | ||
2102 | - __raw_writel(mask_first, dfb); | ||
2103 | - wmb(); | ||
2104 | - } | ||
2105 | |||
2106 | - for (j = 0; j < n32; ++j) { | ||
2107 | - sfb -= 32; | ||
2108 | - dfb -= 32; | ||
2109 | + for (j = 0; j < n32; j++) { | ||
2110 | + if (j < 2 && j + 1 < n32 && !backward && | ||
2111 | + !(((unsigned long)sfb | (unsigned long)dfb) & 63)) { | ||
2112 | + do { | ||
2113 | + __raw_writel(sfb - tga_fb, tga_regs+TGA_COPY64_SRC); | ||
2114 | + wmb(); | ||
2115 | + __raw_writel(dfb - tga_fb, tga_regs+TGA_COPY64_DST); | ||
2116 | + wmb(); | ||
2117 | + sfb += 64; | ||
2118 | + dfb += 64; | ||
2119 | + j += 2; | ||
2120 | + } while (j + 1 < n32); | ||
2121 | + j--; | ||
2122 | + continue; | ||
2123 | + } | ||
2124 | __raw_writel(0xffffffff, sfb); | ||
2125 | wmb(); | ||
2126 | __raw_writel(0xffffffff, dfb); | ||
2127 | wmb(); | ||
2128 | + sfb += step; | ||
2129 | + dfb += step; | ||
2130 | } | ||
2131 | |||
2132 | if (mask_last) { | ||
2133 | - sfb -= 32; | ||
2134 | - dfb -= 32; | ||
2135 | + sfb += last_step - step; | ||
2136 | + dfb += last_step - step; | ||
2137 | __raw_writel(mask_last, sfb); | ||
2138 | wmb(); | ||
2139 | __raw_writel(mask_last, dfb); | ||
2140 | @@ -1453,14 +1296,9 @@ tgafb_copyarea(struct fb_info *info, const struct fb_copyarea *area) | ||
2141 | else if (bpp == 32) | ||
2142 | cfb_copyarea(info, area); | ||
2143 | |||
2144 | - /* Detect overlapping source and destination that requires | ||
2145 | - a backward copy. */ | ||
2146 | - else if (dy == sy && dx > sx && dx < sx + width) | ||
2147 | - copyarea_backward_8bpp(info, dx, dy, sx, sy, height, | ||
2148 | - width, line_length, area); | ||
2149 | else | ||
2150 | - copyarea_foreward_8bpp(info, dx, dy, sx, sy, height, | ||
2151 | - width, line_length); | ||
2152 | + copyarea_8bpp(info, dx, dy, sx, sy, height, | ||
2153 | + width, line_length, area); | ||
2154 | } | ||
2155 | |||
2156 | |||
2157 | diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c | ||
2158 | index 71af7b5abe01..7d7add5ceba4 100644 | ||
2159 | --- a/drivers/virtio/virtio_balloon.c | ||
2160 | +++ b/drivers/virtio/virtio_balloon.c | ||
2161 | @@ -311,6 +311,12 @@ static int balloon(void *_vballoon) | ||
2162 | else if (diff < 0) | ||
2163 | leak_balloon(vb, -diff); | ||
2164 | update_balloon_size(vb); | ||
2165 | + | ||
2166 | + /* | ||
2167 | + * For large balloon changes, we could spend a lot of time | ||
2168 | + * and always have work to do. Be nice if preempt disabled. | ||
2169 | + */ | ||
2170 | + cond_resched(); | ||
2171 | } | ||
2172 | return 0; | ||
2173 | } | ||
2174 | diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c | ||
2175 | index a2aa97d45670..d56a9904e52a 100644 | ||
2176 | --- a/fs/lockd/svc.c | ||
2177 | +++ b/fs/lockd/svc.c | ||
2178 | @@ -235,6 +235,7 @@ out_err: | ||
2179 | if (warned++ == 0) | ||
2180 | printk(KERN_WARNING | ||
2181 | "lockd_up: makesock failed, error=%d\n", err); | ||
2182 | + svc_shutdown_net(serv, net); | ||
2183 | return err; | ||
2184 | } | ||
2185 | |||
2186 | diff --git a/fs/locks.c b/fs/locks.c | ||
2187 | index cb424a4fed71..0274c953b07d 100644 | ||
2188 | --- a/fs/locks.c | ||
2189 | +++ b/fs/locks.c | ||
2190 | @@ -1243,11 +1243,10 @@ int __break_lease(struct inode *inode, unsigned int mode) | ||
2191 | |||
2192 | restart: | ||
2193 | break_time = flock->fl_break_time; | ||
2194 | - if (break_time != 0) { | ||
2195 | + if (break_time != 0) | ||
2196 | break_time -= jiffies; | ||
2197 | - if (break_time == 0) | ||
2198 | - break_time++; | ||
2199 | - } | ||
2200 | + if (break_time == 0) | ||
2201 | + break_time++; | ||
2202 | locks_insert_block(flock, new_fl); | ||
2203 | unlock_flocks(); | ||
2204 | error = wait_event_interruptible_timeout(new_fl->fl_wait, | ||
2205 | diff --git a/include/linux/libata.h b/include/linux/libata.h | ||
2206 | index f33619d8ac52..eec130af2dfa 100644 | ||
2207 | --- a/include/linux/libata.h | ||
2208 | +++ b/include/linux/libata.h | ||
2209 | @@ -772,6 +772,7 @@ struct ata_port { | ||
2210 | unsigned long qc_allocated; | ||
2211 | unsigned int qc_active; | ||
2212 | int nr_active_links; /* #links with active qcs */ | ||
2213 | + unsigned int last_tag; /* track next tag hw expects */ | ||
2214 | |||
2215 | struct ata_link link; /* host default link */ | ||
2216 | struct ata_link *slave_link; /* see ata_slave_link_init() */ | ||
2217 | diff --git a/net/mac80211/main.c b/net/mac80211/main.c | ||
2218 | index 8a7bfc47d577..6658c5809353 100644 | ||
2219 | --- a/net/mac80211/main.c | ||
2220 | +++ b/net/mac80211/main.c | ||
2221 | @@ -157,6 +157,8 @@ static u32 ieee80211_hw_conf_chan(struct ieee80211_local *local) | ||
2222 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { | ||
2223 | if (!rcu_access_pointer(sdata->vif.chanctx_conf)) | ||
2224 | continue; | ||
2225 | + if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) | ||
2226 | + continue; | ||
2227 | power = min(power, sdata->vif.bss_conf.txpower); | ||
2228 | } | ||
2229 | rcu_read_unlock(); | ||
2230 | diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c | ||
2231 | index acd1f71adc03..11d3f227e11e 100644 | ||
2232 | --- a/net/mac80211/offchannel.c | ||
2233 | +++ b/net/mac80211/offchannel.c | ||
2234 | @@ -355,6 +355,7 @@ void ieee80211_sw_roc_work(struct work_struct *work) | ||
2235 | struct ieee80211_roc_work *dep; | ||
2236 | |||
2237 | /* start this ROC */ | ||
2238 | + ieee80211_offchannel_stop_vifs(local); | ||
2239 | |||
2240 | /* switch channel etc */ | ||
2241 | ieee80211_recalc_idle(local); | ||
2242 | diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c | ||
2243 | index 6d5791d735f3..d566cdba24ec 100644 | ||
2244 | --- a/net/mac80211/tx.c | ||
2245 | +++ b/net/mac80211/tx.c | ||
2246 | @@ -2711,7 +2711,7 @@ ieee80211_get_buffered_bc(struct ieee80211_hw *hw, | ||
2247 | cpu_to_le16(IEEE80211_FCTL_MOREDATA); | ||
2248 | } | ||
2249 | |||
2250 | - if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) | ||
2251 | + if (sdata->vif.type == NL80211_IFTYPE_AP) | ||
2252 | sdata = IEEE80211_DEV_TO_SUB_IF(skb->dev); | ||
2253 | if (!ieee80211_tx_prepare(sdata, &tx, skb)) | ||
2254 | break; | ||
2255 | diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c | ||
2256 | index 2d682977ce82..39dc5bc742e0 100644 | ||
2257 | --- a/virt/kvm/ioapic.c | ||
2258 | +++ b/virt/kvm/ioapic.c | ||
2259 | @@ -306,7 +306,7 @@ static int ioapic_deliver(struct kvm_ioapic *ioapic, int irq, bool line_status) | ||
2260 | BUG_ON(ioapic->rtc_status.pending_eoi != 0); | ||
2261 | ret = kvm_irq_delivery_to_apic(ioapic->kvm, NULL, &irqe, | ||
2262 | ioapic->rtc_status.dest_map); | ||
2263 | - ioapic->rtc_status.pending_eoi = ret; | ||
2264 | + ioapic->rtc_status.pending_eoi = (ret < 0 ? 0 : ret); | ||
2265 | } else | ||
2266 | ret = kvm_irq_delivery_to_apic(ioapic->kvm, NULL, &irqe, NULL); | ||
2267 |