1
diff --git a/Makefile b/Makefile
2
index e712243..20ed7d1 100644
3
diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
4
index 02b7a03..8b3db1c 100644
5
--- a/arch/m68k/mm/motorola.c
6
+++ b/arch/m68k/mm/motorola.c
7
@@ -300,6 +300,8 @@ void __init paging_init(void)
8
zones_size[ZONE_DMA] = m68k_memory[i].size >> PAGE_SHIFT;
9
free_area_init_node(i, zones_size,
10
m68k_memory[i].addr >> PAGE_SHIFT, NULL);
11
+ if (node_present_pages(i))
12
+ node_set_state(i, N_NORMAL_MEMORY);
16
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
17
index f4f4d70..7fd8aad 100644
18
--- a/arch/parisc/mm/init.c
19
+++ b/arch/parisc/mm/init.c
20
@@ -266,8 +266,10 @@ static void __init setup_bootmem(void)
22
memset(pfnnid_map, 0xff, sizeof(pfnnid_map));
24
- for (i = 0; i < npmem_ranges; i++)
25
+ for (i = 0; i < npmem_ranges; i++) {
26
+ node_set_state(i, N_NORMAL_MEMORY);
32
diff --git a/arch/s390/kvm/sie64a.S b/arch/s390/kvm/sie64a.S
33
index 7e9d30d..ab0e041 100644
34
--- a/arch/s390/kvm/sie64a.S
35
+++ b/arch/s390/kvm/sie64a.S
36
@@ -48,10 +48,10 @@ sie_irq_handler:
37
tm __TI_flags+7(%r2),_TIF_EXIT_SIE
39
larl %r2,sie_exit # work pending, leave sie
40
- stg %r2,__LC_RETURN_PSW+8
41
+ stg %r2,SPI_PSW+8(0,%r15)
43
0: larl %r2,sie_reenter # re-enter with guest id
44
- stg %r2,__LC_RETURN_PSW+8
45
+ stg %r2,SPI_PSW+8(0,%r15)
49
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
50
index 2c57806..0f900c8 100644
51
--- a/arch/s390/mm/fault.c
52
+++ b/arch/s390/mm/fault.c
53
@@ -558,9 +558,9 @@ static void pfault_interrupt(unsigned int ext_int_code,
54
* Get the token (= address of the task structure of the affected task).
57
- tsk = *(struct task_struct **) param64;
58
+ tsk = (struct task_struct *) param64;
60
- tsk = *(struct task_struct **) param32;
61
+ tsk = (struct task_struct *) param32;
64
if (subcode & 0x0080) {
65
diff --git a/arch/um/sys-i386/Makefile b/arch/um/sys-i386/Makefile
66
index 804b28d..b1da91c 100644
67
--- a/arch/um/sys-i386/Makefile
68
+++ b/arch/um/sys-i386/Makefile
71
obj-y = bug.o bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \
72
ptrace_user.o setjmp.o signal.o stub.o stub_segv.o syscalls.o sysrq.o \
73
- sys_call_table.o tls.o
74
+ sys_call_table.o tls.o atomic64_cx8_32.o
76
obj-$(CONFIG_BINFMT_ELF) += elfcore.o
78
diff --git a/arch/um/sys-i386/atomic64_cx8_32.S b/arch/um/sys-i386/atomic64_cx8_32.S
80
index 0000000..1e901d3d
82
+++ b/arch/um/sys-i386/atomic64_cx8_32.S
85
+ * atomic64_t for 586+
87
+ * Copied from arch/x86/lib/atomic64_cx8_32.S
89
+ * Copyright © 2010 Luca Barbieri
91
+ * This program is free software; you can redistribute it and/or modify
92
+ * it under the terms of the GNU General Public License as published by
93
+ * the Free Software Foundation; either version 2 of the License, or
94
+ * (at your option) any later version.
98
+#include <linux/linkage.h>
99
+#include <asm/alternative-asm.h>
100
+#include <asm/dwarf2.h>
104
+ CFI_REL_OFFSET \reg, 0
115
+/* we need LOCK_PREFIX since otherwise cmpxchg8b always does the write */
120
+ENTRY(atomic64_read_cx8)
126
+ENDPROC(atomic64_read_cx8)
128
+ENTRY(atomic64_set_cx8)
132
+/* we don't need LOCK_PREFIX since aligned 64-bit writes
133
+ * are atomic on 586 and newer */
139
+ENDPROC(atomic64_set_cx8)
141
+ENTRY(atomic64_xchg_cx8)
153
+ENDPROC(atomic64_xchg_cx8)
155
+.macro addsub_return func ins insc
156
+ENTRY(atomic64_\func\()_return_cx8)
171
+ \ins\()l %esi, %ebx
172
+ \insc\()l %edi, %ecx
186
+ENDPROC(atomic64_\func\()_return_cx8)
189
+addsub_return add add adc
190
+addsub_return sub sub sbb
192
+.macro incdec_return func ins insc
193
+ENTRY(atomic64_\func\()_return_cx8)
213
+ENDPROC(atomic64_\func\()_return_cx8)
216
+incdec_return inc add adc
217
+incdec_return dec sub sbb
219
+ENTRY(atomic64_dec_if_positive_cx8)
240
+ENDPROC(atomic64_dec_if_positive_cx8)
242
+ENTRY(atomic64_add_unless_cx8)
246
+/* these just push these two parameters on the stack */
270
+ CFI_ADJUST_CFA_OFFSET -8
280
+ENDPROC(atomic64_add_unless_cx8)
282
+ENTRY(atomic64_inc_not_zero_cx8)
308
+ENDPROC(atomic64_inc_not_zero_cx8)
309
diff --git a/arch/x86/include/asm/gart.h b/arch/x86/include/asm/gart.h
310
index 43085bf..3e7349f 100644
311
--- a/arch/x86/include/asm/gart.h
312
+++ b/arch/x86/include/asm/gart.h
313
@@ -66,7 +66,7 @@ static inline void gart_set_size_and_enable(struct pci_dev *dev, u32 order)
314
* Don't enable translation but enable GART IO and CPU accesses.
315
* Also, set DISTLBWALKPRB since GART tables memory is UC.
317
- ctl = DISTLBWALKPRB | order << 1;
320
pci_write_config_dword(dev, AMD64_GARTAPERTURECTL, ctl);
322
@@ -83,7 +83,7 @@ static inline void enable_gart_translation(struct pci_dev *dev, u64 addr)
324
/* Enable GART translation for this hammer. */
325
pci_read_config_dword(dev, AMD64_GARTAPERTURECTL, &ctl);
327
+ ctl |= GARTEN | DISTLBWALKPRB;
328
ctl &= ~(DISGARTCPU | DISGARTIO);
329
pci_write_config_dword(dev, AMD64_GARTAPERTURECTL, ctl);
331
diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c
332
index 5955a78..f6a1c23 100644
333
--- a/arch/x86/kernel/aperture_64.c
334
+++ b/arch/x86/kernel/aperture_64.c
335
@@ -500,7 +500,7 @@ out:
336
* Don't enable translation yet but enable GART IO and CPU
337
* accesses and set DISTLBWALKPRB since GART table memory is UC.
339
- u32 ctl = DISTLBWALKPRB | aper_order << 1;
340
+ u32 ctl = aper_order << 1;
342
bus = amd_nb_bus_dev_ranges[i].bus;
343
dev_base = amd_nb_bus_dev_ranges[i].dev_base;
344
diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c
345
index c01ffa5..197a46f 100644
346
--- a/arch/x86/kernel/pci-gart_64.c
347
+++ b/arch/x86/kernel/pci-gart_64.c
348
@@ -81,6 +81,9 @@ static u32 gart_unmapped_entry;
352
+/* GART can only remap to physical addresses < 1TB */
353
+#define GART_MAX_PHYS_ADDR (1ULL << 40)
355
/* backdoor interface to AGP driver */
356
AGPEXTERN int agp_memory_reserved;
357
AGPEXTERN __u32 *agp_gatt_table;
358
@@ -212,9 +215,13 @@ static dma_addr_t dma_map_area(struct device *dev, dma_addr_t phys_mem,
359
size_t size, int dir, unsigned long align_mask)
361
unsigned long npages = iommu_num_pages(phys_mem, size, PAGE_SIZE);
362
- unsigned long iommu_page = alloc_iommu(dev, npages, align_mask);
363
+ unsigned long iommu_page;
366
+ if (unlikely(phys_mem + size > GART_MAX_PHYS_ADDR))
367
+ return bad_dma_addr;
369
+ iommu_page = alloc_iommu(dev, npages, align_mask);
370
if (iommu_page == -1) {
371
if (!nonforced_iommu(dev, phys_mem, size))
373
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
374
index 41fb691..3655e19 100644
375
--- a/block/blk-sysfs.c
376
+++ b/block/blk-sysfs.c
377
@@ -511,8 +511,10 @@ int blk_register_queue(struct gendisk *disk)
380
ret = kobject_add(&q->kobj, kobject_get(&dev->kobj), "%s", "queue");
383
+ blk_trace_remove_sysfs(dev);
387
kobject_uevent(&q->kobj, KOBJ_ADD);
389
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
390
index ac1a599..fcc13ac 100644
391
--- a/drivers/acpi/battery.c
392
+++ b/drivers/acpi/battery.c
394
#include <linux/async.h>
395
#include <linux/dmi.h>
396
#include <linux/slab.h>
397
+#include <linux/suspend.h>
399
#ifdef CONFIG_ACPI_PROCFS_POWER
400
#include <linux/proc_fs.h>
401
@@ -102,6 +103,7 @@ struct acpi_battery {
403
struct power_supply bat;
404
struct acpi_device *device;
405
+ struct notifier_block pm_nb;
406
unsigned long update_time;
409
@@ -940,6 +942,21 @@ static void acpi_battery_notify(struct acpi_device *device, u32 event)
410
power_supply_changed(&battery->bat);
413
+static int battery_notify(struct notifier_block *nb,
414
+ unsigned long mode, void *_unused)
416
+ struct acpi_battery *battery = container_of(nb, struct acpi_battery,
419
+ case PM_POST_SUSPEND:
420
+ sysfs_remove_battery(battery);
421
+ sysfs_add_battery(battery);
428
static int acpi_battery_add(struct acpi_device *device)
431
@@ -972,6 +989,10 @@ static int acpi_battery_add(struct acpi_device *device)
436
+ battery->pm_nb.notifier_call = battery_notify;
437
+ register_pm_notifier(&battery->pm_nb);
442
@@ -982,6 +1003,7 @@ static int acpi_battery_remove(struct acpi_device *device, int type)
443
if (!device || !acpi_driver_data(device))
445
battery = acpi_driver_data(device);
446
+ unregister_pm_notifier(&battery->pm_nb);
447
#ifdef CONFIG_ACPI_PROCFS_POWER
448
acpi_battery_remove_fs(device);
450
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
451
index b99e624..8eee69f 100644
452
--- a/drivers/acpi/scan.c
453
+++ b/drivers/acpi/scan.c
454
@@ -944,6 +944,10 @@ static int acpi_bus_get_flags(struct acpi_device *device)
455
if (ACPI_SUCCESS(status))
456
device->flags.lockable = 1;
458
+ /* Power resources cannot be power manageable. */
459
+ if (device->device_type == ACPI_BUS_TYPE_POWER)
462
/* Presence of _PS0|_PR0 indicates 'power manageable' */
463
status = acpi_get_handle(device->handle, "_PS0", &temp);
464
if (ACPI_FAILURE(status))
465
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
466
index 34e08f6..54c096b 100644
467
--- a/drivers/ata/ahci.c
468
+++ b/drivers/ata/ahci.c
469
@@ -150,7 +150,7 @@ static const struct ata_port_info ahci_port_info[] = {
471
AHCI_HFLAGS (AHCI_HFLAG_NO_FPDMA_AA | AHCI_HFLAG_NO_PMP |
473
- .flags = AHCI_FLAG_COMMON,
474
+ .flags = AHCI_FLAG_COMMON | ATA_FLAG_NO_DIPM,
475
.pio_mask = ATA_PIO4,
476
.udma_mask = ATA_UDMA6,
477
.port_ops = &ahci_ops,
478
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
479
index 26d4523..8498eb5 100644
480
--- a/drivers/ata/libahci.c
481
+++ b/drivers/ata/libahci.c
482
@@ -1897,7 +1897,17 @@ static void ahci_pmp_attach(struct ata_port *ap)
485
pp->intr_mask |= PORT_IRQ_BAD_PMP;
486
- writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK);
489
+ * We must not change the port interrupt mask register if the
490
+ * port is marked frozen, the value in pp->intr_mask will be
491
+ * restored later when the port is thawed.
493
+ * Note that during initialization, the port is marked as
494
+ * frozen since the irq handler is not yet registered.
496
+ if (!(ap->pflags & ATA_PFLAG_FROZEN))
497
+ writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK);
500
static void ahci_pmp_detach(struct ata_port *ap)
501
@@ -1913,7 +1923,10 @@ static void ahci_pmp_detach(struct ata_port *ap)
502
writel(cmd, port_mmio + PORT_CMD);
504
pp->intr_mask &= ~PORT_IRQ_BAD_PMP;
505
- writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK);
507
+ /* see comment above in ahci_pmp_attach() */
508
+ if (!(ap->pflags & ATA_PFLAG_FROZEN))
509
+ writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK);
512
int ahci_port_resume(struct ata_port *ap)
513
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
514
index d4e52e2..4ccce0f 100644
515
--- a/drivers/ata/libata-core.c
516
+++ b/drivers/ata/libata-core.c
517
@@ -5479,8 +5479,8 @@ struct ata_port *ata_port_alloc(struct ata_host *host)
518
ap = kzalloc(sizeof(*ap), GFP_KERNEL);
522
- ap->pflags |= ATA_PFLAG_INITIALIZING;
524
+ ap->pflags |= ATA_PFLAG_INITIALIZING | ATA_PFLAG_FROZEN;
525
ap->lock = &host->lock;
528
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
529
index e16850e..fe18c2d 100644
530
--- a/drivers/ata/libata-eh.c
531
+++ b/drivers/ata/libata-eh.c
532
@@ -3276,6 +3276,7 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
533
struct ata_eh_context *ehc = &link->eh_context;
534
struct ata_device *dev, *link_dev = NULL, *lpm_dev = NULL;
535
enum ata_lpm_policy old_policy = link->lpm_policy;
536
+ bool no_dipm = ap->flags & ATA_FLAG_NO_DIPM;
537
unsigned int hints = ATA_LPM_EMPTY | ATA_LPM_HIPM;
538
unsigned int err_mask;
540
@@ -3292,7 +3293,7 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
542
ata_for_each_dev(dev, link, ENABLED) {
543
bool hipm = ata_id_has_hipm(dev->id);
544
- bool dipm = ata_id_has_dipm(dev->id);
545
+ bool dipm = ata_id_has_dipm(dev->id) && !no_dipm;
547
/* find the first enabled and LPM enabled devices */
549
@@ -3349,7 +3350,8 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
551
/* host config updated, enable DIPM if transitioning to MIN_POWER */
552
ata_for_each_dev(dev, link, ENABLED) {
553
- if (policy == ATA_LPM_MIN_POWER && ata_id_has_dipm(dev->id)) {
554
+ if (policy == ATA_LPM_MIN_POWER && !no_dipm &&
555
+ ata_id_has_dipm(dev->id)) {
556
err_mask = ata_dev_set_feature(dev,
557
SETFEATURES_SATA_ENABLE, SATA_DIPM);
558
if (err_mask && err_mask != AC_ERR_DEV) {
559
diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c
560
index 012cba0..b072648 100644
561
--- a/drivers/char/agp/generic.c
562
+++ b/drivers/char/agp/generic.c
563
@@ -115,6 +115,9 @@ static struct agp_memory *agp_create_user_memory(unsigned long num_agp_pages)
564
struct agp_memory *new;
565
unsigned long alloc_size = num_agp_pages*sizeof(struct page *);
567
+ if (INT_MAX/sizeof(struct page *) < num_agp_pages)
570
new = kzalloc(sizeof(struct agp_memory), GFP_KERNEL);
573
@@ -234,11 +237,14 @@ struct agp_memory *agp_allocate_memory(struct agp_bridge_data *bridge,
575
struct agp_memory *new;
582
- if ((atomic_read(&bridge->current_memory_agp) + page_count) > bridge->max_memory_agp)
583
+ cur_memory = atomic_read(&bridge->current_memory_agp);
584
+ if ((cur_memory + page_count > bridge->max_memory_agp) ||
585
+ (cur_memory + page_count < page_count))
588
if (type >= AGP_USER_TYPES) {
589
@@ -1089,8 +1095,8 @@ int agp_generic_insert_memory(struct agp_memory * mem, off_t pg_start, int type)
593
- /* AK: could wrap */
594
- if ((pg_start + mem->page_count) > num_entries)
595
+ if (((pg_start + mem->page_count) > num_entries) ||
596
+ ((pg_start + mem->page_count) < pg_start))
600
@@ -1124,7 +1130,7 @@ int agp_generic_remove_memory(struct agp_memory *mem, off_t pg_start, int type)
603
struct agp_bridge_data *bridge;
605
+ int mask_type, num_entries;
607
bridge = mem->bridge;
609
@@ -1136,6 +1142,11 @@ int agp_generic_remove_memory(struct agp_memory *mem, off_t pg_start, int type)
610
if (type != mem->type)
613
+ num_entries = agp_num_entries();
614
+ if (((pg_start + mem->page_count) > num_entries) ||
615
+ ((pg_start + mem->page_count) < pg_start))
618
mask_type = bridge->driver->agp_type_to_mask_type(bridge, type);
619
if (mask_type != 0) {
620
/* The generic routines know nothing of memory types */
621
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
622
index 84b164d..838568a 100644
623
--- a/drivers/char/virtio_console.c
624
+++ b/drivers/char/virtio_console.c
625
@@ -1280,18 +1280,7 @@ static void unplug_port(struct port *port)
626
spin_lock_irq(&pdrvdata_lock);
627
list_del(&port->cons.list);
628
spin_unlock_irq(&pdrvdata_lock);
631
- * hvc_remove() not called as removing one hvc port
632
- * results in other hvc ports getting frozen.
634
- * Once this is resolved in hvc, this functionality
635
- * will be enabled. Till that is done, the -EPIPE
636
- * return from get_chars() above will help
637
- * hvc_console.c to clean up on ports we remove here.
639
hvc_remove(port->cons.hvc);
643
/* Remove unused data this port might have received. */
644
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
645
index 0902d44..4b4b545 100644
646
--- a/drivers/gpu/drm/Kconfig
647
+++ b/drivers/gpu/drm/Kconfig
648
@@ -24,6 +24,7 @@ config DRM_KMS_HELPER
651
select FRAMEBUFFER_CONSOLE if !EXPERT
652
+ select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
654
FB and CRTC helpers for KMS drivers.
656
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
657
index 49fb54f..ecf8f94 100644
658
--- a/drivers/gpu/drm/i915/intel_display.c
659
+++ b/drivers/gpu/drm/i915/intel_display.c
660
@@ -5630,36 +5630,6 @@ cleanup_work:
664
-static void intel_crtc_reset(struct drm_crtc *crtc)
666
- struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
668
- /* Reset flags back to the 'unknown' status so that they
669
- * will be correctly set on the initial modeset.
671
- intel_crtc->dpms_mode = -1;
674
-static struct drm_crtc_helper_funcs intel_helper_funcs = {
675
- .dpms = intel_crtc_dpms,
676
- .mode_fixup = intel_crtc_mode_fixup,
677
- .mode_set = intel_crtc_mode_set,
678
- .mode_set_base = intel_pipe_set_base,
679
- .mode_set_base_atomic = intel_pipe_set_base_atomic,
680
- .load_lut = intel_crtc_load_lut,
681
- .disable = intel_crtc_disable,
684
-static const struct drm_crtc_funcs intel_crtc_funcs = {
685
- .reset = intel_crtc_reset,
686
- .cursor_set = intel_crtc_cursor_set,
687
- .cursor_move = intel_crtc_cursor_move,
688
- .gamma_set = intel_crtc_gamma_set,
689
- .set_config = drm_crtc_helper_set_config,
690
- .destroy = intel_crtc_destroy,
691
- .page_flip = intel_crtc_page_flip,
694
static void intel_sanitize_modesetting(struct drm_device *dev,
697
@@ -5710,6 +5680,42 @@ static void intel_sanitize_modesetting(struct drm_device *dev,
701
+static void intel_crtc_reset(struct drm_crtc *crtc)
703
+ struct drm_device *dev = crtc->dev;
704
+ struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
706
+ /* Reset flags back to the 'unknown' status so that they
707
+ * will be correctly set on the initial modeset.
709
+ intel_crtc->dpms_mode = -1;
711
+ /* We need to fix up any BIOS configuration that conflicts with
712
+ * our expectations.
714
+ intel_sanitize_modesetting(dev, intel_crtc->pipe, intel_crtc->plane);
717
+static struct drm_crtc_helper_funcs intel_helper_funcs = {
718
+ .dpms = intel_crtc_dpms,
719
+ .mode_fixup = intel_crtc_mode_fixup,
720
+ .mode_set = intel_crtc_mode_set,
721
+ .mode_set_base = intel_pipe_set_base,
722
+ .mode_set_base_atomic = intel_pipe_set_base_atomic,
723
+ .load_lut = intel_crtc_load_lut,
724
+ .disable = intel_crtc_disable,
727
+static const struct drm_crtc_funcs intel_crtc_funcs = {
728
+ .reset = intel_crtc_reset,
729
+ .cursor_set = intel_crtc_cursor_set,
730
+ .cursor_move = intel_crtc_cursor_move,
731
+ .gamma_set = intel_crtc_gamma_set,
732
+ .set_config = drm_crtc_helper_set_config,
733
+ .destroy = intel_crtc_destroy,
734
+ .page_flip = intel_crtc_page_flip,
737
static void intel_crtc_init(struct drm_device *dev, int pipe)
739
drm_i915_private_t *dev_priv = dev->dev_private;
740
@@ -5759,8 +5765,6 @@ static void intel_crtc_init(struct drm_device *dev, int pipe)
742
setup_timer(&intel_crtc->idle_timer, intel_crtc_idle_timer,
743
(unsigned long)intel_crtc);
745
- intel_sanitize_modesetting(dev, intel_crtc->pipe, intel_crtc->plane);
748
int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data,
749
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
750
index fe4a53a..65edb22 100644
751
--- a/drivers/gpu/drm/i915/intel_tv.c
752
+++ b/drivers/gpu/drm/i915/intel_tv.c
753
@@ -1380,7 +1380,9 @@ intel_tv_detect(struct drm_connector *connector, bool force)
755
return connector_status_disconnected;
757
+ intel_tv->type = type;
758
intel_tv_find_better_format(connector);
760
return connector_status_connected;
763
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
764
index 60769d2..7826be0 100644
765
--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
766
+++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
767
@@ -181,13 +181,13 @@ nouveau_fbcon_sync(struct fb_info *info)
771
- nouveau_bo_wr32(chan->notifier_bo, chan->m2mf_ntfy + 3, 0xffffffff);
772
+ nouveau_bo_wr32(chan->notifier_bo, chan->m2mf_ntfy/4 + 3, 0xffffffff);
774
mutex_unlock(&chan->mutex);
777
for (i = 0; i < 100000; i++) {
778
- if (!nouveau_bo_rd32(chan->notifier_bo, chan->m2mf_ntfy + 3)) {
779
+ if (!nouveau_bo_rd32(chan->notifier_bo, chan->m2mf_ntfy/4 + 3)) {
783
diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
784
index d71d375..7bd7456 100644
785
--- a/drivers/gpu/drm/radeon/atom.c
786
+++ b/drivers/gpu/drm/radeon/atom.c
787
@@ -135,7 +135,7 @@ static uint32_t atom_iio_execute(struct atom_context *ctx, int base,
788
case ATOM_IIO_MOVE_INDEX:
790
~((0xFFFFFFFF >> (32 - CU8(base + 1))) <<
794
((index >> CU8(base + 2)) &
795
(0xFFFFFFFF >> (32 - CU8(base + 1)))) << CU8(base +
796
@@ -145,7 +145,7 @@ static uint32_t atom_iio_execute(struct atom_context *ctx, int base,
797
case ATOM_IIO_MOVE_DATA:
799
~((0xFFFFFFFF >> (32 - CU8(base + 1))) <<
803
((data >> CU8(base + 2)) &
804
(0xFFFFFFFF >> (32 - CU8(base + 1)))) << CU8(base +
805
@@ -155,7 +155,7 @@ static uint32_t atom_iio_execute(struct atom_context *ctx, int base,
806
case ATOM_IIO_MOVE_ATTR:
808
~((0xFFFFFFFF >> (32 - CU8(base + 1))) <<
813
io_attr >> CU8(base + 2)) & (0xFFFFFFFF >> (32 -
814
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
815
index 0861257..bede31c 100644
816
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
817
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
818
@@ -532,10 +532,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
820
pll->flags |= RADEON_PLL_PREFER_LOW_REF_DIV;
822
- if ((rdev->family == CHIP_R600) ||
823
- (rdev->family == CHIP_RV610) ||
824
- (rdev->family == CHIP_RV630) ||
825
- (rdev->family == CHIP_RV670))
826
+ if (rdev->family < CHIP_RV770)
827
pll->flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP;
829
pll->flags |= RADEON_PLL_LEGACY;
830
@@ -565,7 +562,6 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
831
if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) {
834
- pll->flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP;
835
pll->flags |= RADEON_PLL_USE_REF_DIV;
836
pll->reference_div = ss->refdiv;
837
if (ASIC_IS_AVIVO(rdev))
838
diff --git a/drivers/input/xen-kbdfront.c b/drivers/input/xen-kbdfront.c
839
index 53e6273..c35ab94 100644
840
--- a/drivers/input/xen-kbdfront.c
841
+++ b/drivers/input/xen-kbdfront.c
842
@@ -286,7 +286,7 @@ static void xenkbd_backend_changed(struct xenbus_device *dev,
843
enum xenbus_state backend_state)
845
struct xenkbd_info *info = dev_get_drvdata(&dev->dev);
849
switch (backend_state) {
850
case XenbusStateInitialising:
851
@@ -299,6 +299,16 @@ static void xenkbd_backend_changed(struct xenbus_device *dev,
853
case XenbusStateInitWait:
855
+ ret = xenbus_scanf(XBT_NIL, info->xbdev->otherend,
856
+ "feature-abs-pointer", "%d", &val);
860
+ ret = xenbus_printf(XBT_NIL, info->xbdev->nodename,
861
+ "request-abs-pointer", "1");
863
+ pr_warning("can't request abs-pointer\n");
865
xenbus_switch_state(dev, XenbusStateConnected);
868
diff --git a/drivers/media/dvb/b2c2/flexcop-pci.c b/drivers/media/dvb/b2c2/flexcop-pci.c
869
index 227c020..4f3e3ce 100644
870
--- a/drivers/media/dvb/b2c2/flexcop-pci.c
871
+++ b/drivers/media/dvb/b2c2/flexcop-pci.c
872
@@ -38,7 +38,7 @@ MODULE_PARM_DESC(debug,
875
#define DRIVER_VERSION "0.1"
876
-#define DRIVER_NAME "Technisat/B2C2 FlexCop II/IIb/III Digital TV PCI Driver"
877
+#define DRIVER_NAME "flexcop-pci"
878
#define DRIVER_AUTHOR "Patrick Boettcher <patrick.boettcher@desy.de>"
881
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
882
index a113805..10f86e0 100644
883
--- a/drivers/net/netxen/netxen_nic.h
884
+++ b/drivers/net/netxen/netxen_nic.h
887
#define MAX_NUM_CARDS 4
889
-#define MAX_BUFFERS_PER_CMD 32
890
+#define NETXEN_MAX_FRAGS_PER_TX 14
891
#define MAX_TSO_HEADER_DESC 2
892
#define MGMT_CMD_DESC_RESV 4
893
#define TX_STOP_THRESH ((MAX_SKB_FRAGS >> 2) + MAX_TSO_HEADER_DESC \
894
@@ -558,7 +558,7 @@ struct netxen_recv_crb {
896
struct netxen_cmd_buffer {
898
- struct netxen_skb_frag frag_array[MAX_BUFFERS_PER_CMD + 1];
899
+ struct netxen_skb_frag frag_array[MAX_SKB_FRAGS + 1];
903
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
904
index 33fac32..28139df 100644
905
--- a/drivers/net/netxen/netxen_nic_main.c
906
+++ b/drivers/net/netxen/netxen_nic_main.c
907
@@ -1841,6 +1841,8 @@ netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
908
struct cmd_desc_type0 *hwdesc, *first_desc;
909
struct pci_dev *pdev;
912
+ struct skb_frag_struct *frag;
915
int frag_count, no_of_desc;
916
@@ -1848,6 +1850,21 @@ netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
918
frag_count = skb_shinfo(skb)->nr_frags + 1;
920
+ /* 14 frags supported for normal packet and
921
+ * 32 frags supported for TSO packet
923
+ if (!skb_is_gso(skb) && frag_count > NETXEN_MAX_FRAGS_PER_TX) {
925
+ for (i = 0; i < (frag_count - NETXEN_MAX_FRAGS_PER_TX); i++) {
926
+ frag = &skb_shinfo(skb)->frags[i];
927
+ delta += frag->size;
930
+ if (!__pskb_pull_tail(skb, delta))
933
+ frag_count = 1 + skb_shinfo(skb)->nr_frags;
935
/* 4 fragments per cmd des */
936
no_of_desc = (frag_count + 3) >> 2;
938
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h
939
index 44e316f..0f136ff 100644
940
--- a/drivers/net/qlcnic/qlcnic.h
941
+++ b/drivers/net/qlcnic/qlcnic.h
943
#define TX_UDPV6_PKT 0x0c
946
+#define QLCNIC_MAX_FRAGS_PER_TX 14
947
#define MAX_TSO_HEADER_DESC 2
948
#define MGMT_CMD_DESC_RESV 4
949
#define TX_STOP_THRESH ((MAX_SKB_FRAGS >> 2) + MAX_TSO_HEADER_DESC \
950
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
951
index 37c04b4..92619d7 100644
952
--- a/drivers/net/qlcnic/qlcnic_main.c
953
+++ b/drivers/net/qlcnic/qlcnic_main.c
954
@@ -2099,6 +2099,7 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
955
struct cmd_desc_type0 *hwdesc, *first_desc;
956
struct pci_dev *pdev;
962
@@ -2118,6 +2119,19 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
965
frag_count = skb_shinfo(skb)->nr_frags + 1;
966
+ /* 14 frags supported for normal packet and
967
+ * 32 frags supported for TSO packet
969
+ if (!skb_is_gso(skb) && frag_count > QLCNIC_MAX_FRAGS_PER_TX) {
971
+ for (i = 0; i < (frag_count - QLCNIC_MAX_FRAGS_PER_TX); i++)
972
+ delta += skb_shinfo(skb)->frags[i].size;
974
+ if (!__pskb_pull_tail(skb, delta))
977
+ frag_count = 1 + skb_shinfo(skb)->nr_frags;
980
/* 4 fragments per cmd des */
981
no_of_desc = (frag_count + 3) >> 2;
982
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
983
index 4ceddbb..038a0cb 100644
984
--- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
985
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
986
@@ -615,7 +615,7 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs,
988
if (rxsp->status11 & AR_CRCErr)
989
rxs->rs_status |= ATH9K_RXERR_CRC;
990
- if (rxsp->status11 & AR_PHYErr) {
991
+ else if (rxsp->status11 & AR_PHYErr) {
992
phyerr = MS(rxsp->status11, AR_PHYErrCode);
994
* If we reach a point here where AR_PostDelimCRCErr is
995
@@ -638,11 +638,11 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs,
996
rxs->rs_phyerr = phyerr;
1000
- if (rxsp->status11 & AR_DecryptCRCErr)
1001
+ } else if (rxsp->status11 & AR_DecryptCRCErr)
1002
rxs->rs_status |= ATH9K_RXERR_DECRYPT;
1003
- if (rxsp->status11 & AR_MichaelErr)
1004
+ else if (rxsp->status11 & AR_MichaelErr)
1005
rxs->rs_status |= ATH9K_RXERR_MIC;
1007
if (rxsp->status11 & AR_KeyMiss)
1008
rxs->rs_status |= ATH9K_RXERR_DECRYPT;
1010
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
1011
index 7c0a7c4..a3b77ae 100644
1012
--- a/drivers/net/wireless/ath/ath9k/hw.c
1013
+++ b/drivers/net/wireless/ath/ath9k/hw.c
1014
@@ -1218,15 +1218,6 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
1015
ah->txchainmask = common->tx_chainmask;
1016
ah->rxchainmask = common->rx_chainmask;
1018
- if ((common->bus_ops->ath_bus_type != ATH_USB) && !ah->chip_fullsleep) {
1019
- ath9k_hw_abortpcurecv(ah);
1020
- if (!ath9k_hw_stopdmarecv(ah)) {
1021
- ath_dbg(common, ATH_DBG_XMIT,
1022
- "Failed to stop receive dma\n");
1023
- bChannelChange = false;
1027
if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE))
1030
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
1031
index 2915b11..e9fc97d 100644
1032
--- a/drivers/net/wireless/ath/ath9k/mac.c
1033
+++ b/drivers/net/wireless/ath/ath9k/mac.c
1034
@@ -690,17 +690,23 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
1035
rs->rs_flags |= ATH9K_RX_DECRYPT_BUSY;
1037
if ((ads.ds_rxstatus8 & AR_RxFrameOK) == 0) {
1039
+ * Treat these errors as mutually exclusive to avoid spurious
1040
+ * extra error reports from the hardware. If a CRC error is
1041
+ * reported, then decryption and MIC errors are irrelevant,
1042
+ * the frame is going to be dropped either way
1044
if (ads.ds_rxstatus8 & AR_CRCErr)
1045
rs->rs_status |= ATH9K_RXERR_CRC;
1046
- if (ads.ds_rxstatus8 & AR_PHYErr) {
1047
+ else if (ads.ds_rxstatus8 & AR_PHYErr) {
1048
rs->rs_status |= ATH9K_RXERR_PHY;
1049
phyerr = MS(ads.ds_rxstatus8, AR_PHYErrCode);
1050
rs->rs_phyerr = phyerr;
1052
- if (ads.ds_rxstatus8 & AR_DecryptCRCErr)
1053
+ } else if (ads.ds_rxstatus8 & AR_DecryptCRCErr)
1054
rs->rs_status |= ATH9K_RXERR_DECRYPT;
1055
- if (ads.ds_rxstatus8 & AR_MichaelErr)
1056
+ else if (ads.ds_rxstatus8 & AR_MichaelErr)
1057
rs->rs_status |= ATH9K_RXERR_MIC;
1059
if (ads.ds_rxstatus8 & AR_KeyMiss)
1060
rs->rs_status |= ATH9K_RXERR_DECRYPT;
1062
@@ -770,28 +776,47 @@ void ath9k_hw_abortpcurecv(struct ath_hw *ah)
1064
EXPORT_SYMBOL(ath9k_hw_abortpcurecv);
1066
-bool ath9k_hw_stopdmarecv(struct ath_hw *ah)
1067
+bool ath9k_hw_stopdmarecv(struct ath_hw *ah, bool *reset)
1069
#define AH_RX_STOP_DMA_TIMEOUT 10000 /* usec */
1070
#define AH_RX_TIME_QUANTUM 100 /* usec */
1071
struct ath_common *common = ath9k_hw_common(ah);
1072
+ u32 mac_status, last_mac_status = 0;
1075
+ /* Enable access to the DMA observation bus */
1076
+ REG_WRITE(ah, AR_MACMISC,
1077
+ ((AR_MACMISC_DMA_OBS_LINE_8 << AR_MACMISC_DMA_OBS_S) |
1078
+ (AR_MACMISC_MISC_OBS_BUS_1 <<
1079
+ AR_MACMISC_MISC_OBS_BUS_MSB_S)));
1081
REG_WRITE(ah, AR_CR, AR_CR_RXD);
1083
/* Wait for rx enable bit to go low */
1084
for (i = AH_RX_STOP_DMA_TIMEOUT / AH_TIME_QUANTUM; i != 0; i--) {
1085
if ((REG_READ(ah, AR_CR) & AR_CR_RXE) == 0)
1088
+ if (!AR_SREV_9300_20_OR_LATER(ah)) {
1089
+ mac_status = REG_READ(ah, AR_DMADBG_7) & 0x7f0;
1090
+ if (mac_status == 0x1c0 && mac_status == last_mac_status) {
1095
+ last_mac_status = mac_status;
1098
udelay(AH_TIME_QUANTUM);
1103
- "DMA failed to stop in %d ms AR_CR=0x%08x AR_DIAG_SW=0x%08x\n",
1104
+ "DMA failed to stop in %d ms AR_CR=0x%08x AR_DIAG_SW=0x%08x DMADBG_7=0x%08x\n",
1105
AH_RX_STOP_DMA_TIMEOUT / 1000,
1106
REG_READ(ah, AR_CR),
1107
- REG_READ(ah, AR_DIAG_SW));
1108
+ REG_READ(ah, AR_DIAG_SW),
1109
+ REG_READ(ah, AR_DMADBG_7));
1113
diff --git a/drivers/net/wireless/ath/ath9k/mac.h b/drivers/net/wireless/ath/ath9k/mac.h
1114
index 7512f97..d9cc299 100644
1115
--- a/drivers/net/wireless/ath/ath9k/mac.h
1116
+++ b/drivers/net/wireless/ath/ath9k/mac.h
1117
@@ -692,7 +692,7 @@ bool ath9k_hw_setrxabort(struct ath_hw *ah, bool set);
1118
void ath9k_hw_putrxbuf(struct ath_hw *ah, u32 rxdp);
1119
void ath9k_hw_startpcureceive(struct ath_hw *ah, bool is_scanning);
1120
void ath9k_hw_abortpcurecv(struct ath_hw *ah);
1121
-bool ath9k_hw_stopdmarecv(struct ath_hw *ah);
1122
+bool ath9k_hw_stopdmarecv(struct ath_hw *ah, bool *reset);
1123
int ath9k_hw_beaconq_setup(struct ath_hw *ah);
1125
/* Interrupt Handling */
1126
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
1127
index 3867a2e..89546bc 100644
1128
--- a/drivers/net/wireless/ath/ath9k/recv.c
1129
+++ b/drivers/net/wireless/ath/ath9k/recv.c
1130
@@ -513,12 +513,12 @@ start_recv:
1131
bool ath_stoprecv(struct ath_softc *sc)
1133
struct ath_hw *ah = sc->sc_ah;
1135
+ bool stopped, reset = false;
1137
spin_lock_bh(&sc->rx.rxbuflock);
1138
ath9k_hw_abortpcurecv(ah);
1139
ath9k_hw_setrxfilter(ah, 0);
1140
- stopped = ath9k_hw_stopdmarecv(ah);
1141
+ stopped = ath9k_hw_stopdmarecv(ah, &reset);
1143
if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)
1144
ath_edma_stop_recv(sc);
1145
@@ -533,7 +533,7 @@ bool ath_stoprecv(struct ath_softc *sc)
1146
"confusing the DMA engine when we start RX up\n");
1147
ATH_DBG_WARN_ON_ONCE(!stopped);
1150
+ return stopped || reset;
1153
void ath_flushrecv(struct ath_softc *sc)
1154
diff --git a/drivers/net/wireless/ath/regd_common.h b/drivers/net/wireless/ath/regd_common.h
1155
index 248c670..5c2cfe6 100644
1156
--- a/drivers/net/wireless/ath/regd_common.h
1157
+++ b/drivers/net/wireless/ath/regd_common.h
1158
@@ -195,6 +195,7 @@ static struct reg_dmn_pair_mapping regDomainPairs[] = {
1159
{APL9_WORLD, CTL_ETSI, CTL_ETSI},
1161
{APL3_FCCA, CTL_FCC, CTL_FCC},
1162
+ {APL7_FCCA, CTL_FCC, CTL_FCC},
1163
{APL1_ETSIC, CTL_FCC, CTL_ETSI},
1164
{APL2_ETSIC, CTL_FCC, CTL_ETSI},
1165
{APL2_APLD, CTL_FCC, NO_CTL},
1166
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-hw.h b/drivers/net/wireless/iwlwifi/iwl-3945-hw.h
1167
index 65b5834..c2dd4cd 100644
1168
--- a/drivers/net/wireless/iwlwifi/iwl-3945-hw.h
1169
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-hw.h
1172
#define IWL39_RSSI_OFFSET 95
1174
-#define IWL_DEFAULT_TX_POWER 0x0F
1177
* EEPROM related constants, enums, and structures.
1179
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
1180
index 39b6f16..4e7b58b 100644
1181
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
1182
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
1183
@@ -1823,7 +1823,7 @@ int iwl3945_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
1185
/* If we issue a new RXON command which required a tune then we must
1186
* send a new TXPOWER command or we won't be able to Tx any frames */
1187
- rc = priv->cfg->ops->lib->send_tx_power(priv);
1188
+ rc = iwl_set_tx_power(priv, priv->tx_power_next, true);
1190
IWL_ERR(priv, "Error setting Tx power (%d).\n", rc);
1192
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
1193
index 91a9f52..992caa0 100644
1194
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
1195
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
1196
@@ -1571,7 +1571,7 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *c
1198
/* If we issue a new RXON command which required a tune then we must
1199
* send a new TXPOWER command or we won't be able to Tx any frames */
1200
- ret = iwl_set_tx_power(priv, priv->tx_power_user_lmt, true);
1201
+ ret = iwl_set_tx_power(priv, priv->tx_power_next, true);
1203
IWL_ERR(priv, "Error sending TX power (%d)\n", ret);
1205
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
1206
index 6d140bd..ee802fe 100644
1207
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
1208
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
1209
@@ -288,10 +288,9 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
1210
* If we issue a new RXON command which required a tune then we must
1211
* send a new TXPOWER command or we won't be able to Tx any frames.
1213
- * FIXME: which RXON requires a tune? Can we optimise this out in
1215
+ * It's expected we set power here if channel is changing.
1217
- ret = iwl_set_tx_power(priv, priv->tx_power_user_lmt, true);
1218
+ ret = iwl_set_tx_power(priv, priv->tx_power_next, true);
1220
IWL_ERR(priv, "Error sending TX power (%d)\n", ret);
1222
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
1223
index c1cfd99..35239f0 100644
1224
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
1225
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
1226
@@ -3841,12 +3841,6 @@ static int iwl_init_drv(struct iwl_priv *priv)
1227
priv->dynamic_frag_thresh = BT_FRAG_THRESHOLD_DEF;
1230
- /* Set the tx_power_user_lmt to the lowest power level
1231
- * this value will get overwritten by channel max power avg
1233
- priv->tx_power_user_lmt = IWLAGN_TX_POWER_TARGET_POWER_MIN;
1234
- priv->tx_power_next = IWLAGN_TX_POWER_TARGET_POWER_MIN;
1236
ret = iwl_init_channel_map(priv);
1238
IWL_ERR(priv, "initializing regulatory failed: %d\n", ret);
1239
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
1240
index efbde1f..294e9fc 100644
1241
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
1242
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
1243
@@ -168,6 +168,7 @@ int iwlcore_init_geos(struct iwl_priv *priv)
1244
struct ieee80211_channel *geo_ch;
1245
struct ieee80211_rate *rates;
1247
+ s8 max_tx_power = 0;
1249
if (priv->bands[IEEE80211_BAND_2GHZ].n_bitrates ||
1250
priv->bands[IEEE80211_BAND_5GHZ].n_bitrates) {
1251
@@ -244,8 +245,8 @@ int iwlcore_init_geos(struct iwl_priv *priv)
1253
geo_ch->flags |= ch->ht40_extension_channel;
1255
- if (ch->max_power_avg > priv->tx_power_device_lmt)
1256
- priv->tx_power_device_lmt = ch->max_power_avg;
1257
+ if (ch->max_power_avg > max_tx_power)
1258
+ max_tx_power = ch->max_power_avg;
1260
geo_ch->flags |= IEEE80211_CHAN_DISABLED;
1262
@@ -258,6 +259,10 @@ int iwlcore_init_geos(struct iwl_priv *priv)
1266
+ priv->tx_power_device_lmt = max_tx_power;
1267
+ priv->tx_power_user_lmt = max_tx_power;
1268
+ priv->tx_power_next = max_tx_power;
1270
if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) &&
1271
priv->cfg->sku & IWL_SKU_A) {
1272
IWL_INFO(priv, "Incorrectly detected BG card as ABG. "
1273
@@ -1161,6 +1166,8 @@ int iwl_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force)
1278
+ struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
1280
lockdep_assert_held(&priv->mutex);
1282
@@ -1188,10 +1195,15 @@ int iwl_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force)
1283
if (!iwl_is_ready_rf(priv))
1286
- /* scan complete use tx_power_next, need to be updated */
1287
+ /* scan complete and commit_rxon use tx_power_next value,
1288
+ * it always need to be updated for newest request */
1289
priv->tx_power_next = tx_power;
1290
- if (test_bit(STATUS_SCANNING, &priv->status) && !force) {
1291
- IWL_DEBUG_INFO(priv, "Deferring tx power set while scanning\n");
1293
+ /* do not set tx power when scanning or channel changing */
1294
+ defer = test_bit(STATUS_SCANNING, &priv->status) ||
1295
+ memcmp(&ctx->active, &ctx->staging, sizeof(ctx->staging));
1296
+ if (defer && !force) {
1297
+ IWL_DEBUG_INFO(priv, "Deferring tx power set\n");
1301
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
1302
index 358cfd7..8b3c127 100644
1303
--- a/drivers/net/wireless/iwlwifi/iwl-eeprom.c
1304
+++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
1305
@@ -724,13 +724,6 @@ int iwl_init_channel_map(struct iwl_priv *priv)
1306
flags & EEPROM_CHANNEL_RADAR))
1309
- /* Set the tx_power_user_lmt to the highest power
1310
- * supported by any channel */
1311
- if (eeprom_ch_info[ch].max_power_avg >
1312
- priv->tx_power_user_lmt)
1313
- priv->tx_power_user_lmt =
1314
- eeprom_ch_info[ch].max_power_avg;
1319
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
1320
index 371abbf..64917ed 100644
1321
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
1322
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
1323
@@ -94,6 +94,7 @@ MODULE_LICENSE("GPL");
1324
struct iwl_mod_params iwl3945_mod_params = {
1327
+ .disable_hw_scan = 1,
1328
/* the rest are 0 by default */
1331
@@ -3858,10 +3859,6 @@ static int iwl3945_init_drv(struct iwl_priv *priv)
1332
priv->force_reset[IWL_FW_RESET].reset_duration =
1333
IWL_DELAY_NEXT_FORCE_FW_RELOAD;
1336
- priv->tx_power_user_lmt = IWL_DEFAULT_TX_POWER;
1337
- priv->tx_power_next = IWL_DEFAULT_TX_POWER;
1339
if (eeprom->version < EEPROM_3945_EEPROM_VERSION) {
1340
IWL_WARN(priv, "Unsupported EEPROM version: 0x%04X\n",
1342
@@ -3995,8 +3992,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
1343
* "the hard way", rather than using device's scan.
1345
if (iwl3945_mod_params.disable_hw_scan) {
1346
- dev_printk(KERN_DEBUG, &(pdev->dev),
1347
- "sw scan support is deprecated\n");
1348
+ IWL_DEBUG_INFO(priv, "Disabling hw_scan\n");
1349
iwl3945_hw_ops.hw_scan = NULL;
1352
@@ -4318,8 +4314,7 @@ MODULE_PARM_DESC(debug, "debug output mask");
1354
module_param_named(disable_hw_scan, iwl3945_mod_params.disable_hw_scan,
1356
-MODULE_PARM_DESC(disable_hw_scan,
1357
- "disable hardware scanning (default 0) (deprecated)");
1358
+MODULE_PARM_DESC(disable_hw_scan, "disable hardware scanning (default 1)");
1359
module_param_named(fw_restart3945, iwl3945_mod_params.restart_fw, int, S_IRUGO);
1360
MODULE_PARM_DESC(fw_restart3945, "restart firmware in case of error");
1362
diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c
1363
index f618b96..2cfdd38 100644
1364
--- a/drivers/net/wireless/p54/txrx.c
1365
+++ b/drivers/net/wireless/p54/txrx.c
1366
@@ -705,7 +705,7 @@ int p54_tx_80211(struct ieee80211_hw *dev, struct sk_buff *skb)
1367
struct p54_tx_info *p54info;
1368
struct p54_hdr *hdr;
1369
struct p54_tx_data *txhdr;
1370
- unsigned int padding, len, extra_len;
1371
+ unsigned int padding, len, extra_len = 0;
1373
u16 hdr_flags = 0, aid = 0;
1374
u8 rate, queue = 0, crypt_offset = 0;
1375
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
1376
index 4789f8e..5dc5d3e 100644
1377
--- a/drivers/pci/intel-iommu.c
1378
+++ b/drivers/pci/intel-iommu.c
1379
@@ -1835,7 +1835,7 @@ static struct dmar_domain *get_domain_for_dev(struct pci_dev *pdev, int gaw)
1381
ret = iommu_attach_domain(domain, iommu);
1383
- domain_exit(domain);
1384
+ free_domain_mem(domain);
1388
@@ -3260,9 +3260,15 @@ static int device_notifier(struct notifier_block *nb,
1392
- if (action == BUS_NOTIFY_UNBOUND_DRIVER && !iommu_pass_through)
1393
+ if (action == BUS_NOTIFY_UNBOUND_DRIVER && !iommu_pass_through) {
1394
domain_remove_one_dev_info(domain, pdev);
1396
+ if (!(domain->flags & DOMAIN_FLAG_VIRTUAL_MACHINE) &&
1397
+ !(domain->flags & DOMAIN_FLAG_STATIC_IDENTITY) &&
1398
+ list_empty(&domain->devices))
1399
+ domain_exit(domain);
1405
@@ -3411,6 +3417,11 @@ static void domain_remove_one_dev_info(struct dmar_domain *domain,
1406
domain->iommu_count--;
1407
domain_update_iommu_cap(domain);
1408
spin_unlock_irqrestore(&domain->iommu_lock, tmp_flags);
1410
+ spin_lock_irqsave(&iommu->lock, tmp_flags);
1411
+ clear_bit(domain->id, iommu->domain_ids);
1412
+ iommu->domains[domain->id] = NULL;
1413
+ spin_unlock_irqrestore(&iommu->lock, tmp_flags);
1416
spin_unlock_irqrestore(&device_domain_lock, flags);
1417
@@ -3627,9 +3638,9 @@ static int intel_iommu_attach_device(struct iommu_domain *domain,
1419
pte = dmar_domain->pgd;
1420
if (dma_pte_present(pte)) {
1421
- free_pgtable_page(dmar_domain->pgd);
1422
dmar_domain->pgd = (struct dma_pte *)
1423
phys_to_virt(dma_pte_addr(pte));
1424
+ free_pgtable_page(pte);
1426
dmar_domain->agaw--;
1428
diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
1429
index 114d952..21b1018 100644
1430
--- a/drivers/platform/x86/ideapad-laptop.c
1431
+++ b/drivers/platform/x86/ideapad-laptop.c
1432
@@ -459,6 +459,8 @@ static void ideapad_acpi_notify(struct acpi_device *adevice, u32 event)
1433
if (test_bit(vpc_bit, &vpc1)) {
1435
ideapad_sync_rfk_state(adevice);
1436
+ else if (vpc_bit == 4)
1437
+ read_ec_data(handle, 0x12, &vpc2);
1439
ideapad_input_report(priv, vpc_bit);
1441
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
1442
index aa2e5d3..c4b0ef1 100644
1443
--- a/drivers/tty/n_gsm.c
1444
+++ b/drivers/tty/n_gsm.c
1445
@@ -1659,8 +1659,12 @@ static void gsm_queue(struct gsm_mux *gsm)
1447
if ((gsm->control & ~PF) == UI)
1448
gsm->fcs = gsm_fcs_add_block(gsm->fcs, gsm->buf, gsm->len);
1449
- /* generate final CRC with received FCS */
1450
- gsm->fcs = gsm_fcs_add(gsm->fcs, gsm->received_fcs);
1451
+ if (gsm->encoding == 0){
1452
+ /* WARNING: gsm->received_fcs is used for gsm->encoding = 0 only.
1453
+ In this case it contain the last piece of data
1454
+ required to generate final CRC */
1455
+ gsm->fcs = gsm_fcs_add(gsm->fcs, gsm->received_fcs);
1457
if (gsm->fcs != GOOD_FCS) {
1460
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
1461
index dfcf4b1..0d66751 100644
1462
--- a/drivers/tty/serial/imx.c
1463
+++ b/drivers/tty/serial/imx.c
1464
@@ -382,12 +382,13 @@ static void imx_start_tx(struct uart_port *port)
1465
static irqreturn_t imx_rtsint(int irq, void *dev_id)
1467
struct imx_port *sport = dev_id;
1468
- unsigned int val = readl(sport->port.membase + USR1) & USR1_RTSS;
1470
unsigned long flags;
1472
spin_lock_irqsave(&sport->port.lock, flags);
1474
writel(USR1_RTSD, sport->port.membase + USR1);
1475
+ val = readl(sport->port.membase + USR1) & USR1_RTSS;
1476
uart_handle_cts_change(&sport->port, !!val);
1477
wake_up_interruptible(&sport->port.state->port.delta_msr_wait);
1479
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
1480
index cc2f73e..b0043fb 100644
1481
--- a/drivers/virtio/virtio_ring.c
1482
+++ b/drivers/virtio/virtio_ring.c
1483
@@ -371,6 +371,7 @@ void *virtqueue_detach_unused_buf(struct virtqueue *_vq)
1484
/* detach_buf clears data, so grab it now. */
1487
+ vq->vring.avail->idx--;
1491
diff --git a/fs/file.c b/fs/file.c
1492
index 0be3447..4c6992d 100644
1496
#include <linux/module.h>
1497
#include <linux/fs.h>
1498
#include <linux/mm.h>
1499
+#include <linux/mmzone.h>
1500
#include <linux/time.h>
1501
#include <linux/sched.h>
1502
#include <linux/slab.h>
1503
@@ -39,14 +40,17 @@ int sysctl_nr_open_max = 1024 * 1024; /* raised later */
1505
static DEFINE_PER_CPU(struct fdtable_defer, fdtable_defer_list);
1507
-static inline void *alloc_fdmem(unsigned int size)
1508
+static void *alloc_fdmem(unsigned int size)
1512
- data = kmalloc(size, GFP_KERNEL|__GFP_NOWARN);
1517
+ * Very large allocations can stress page reclaim, so fall back to
1518
+ * vmalloc() if the allocation size will be considered "large" by the VM.
1520
+ if (size <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER)) {
1521
+ void *data = kmalloc(size, GFP_KERNEL|__GFP_NOWARN);
1525
return vmalloc(size);
1528
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
1529
index 0592288..6221640 100644
1530
--- a/fs/nfs/nfs4state.c
1531
+++ b/fs/nfs/nfs4state.c
1532
@@ -1600,7 +1600,7 @@ static void nfs4_state_manager(struct nfs_client *clp)
1535
/* Ensure exclusive access to NFSv4 state */
1538
if (test_and_clear_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state)) {
1539
/* We're going to have to re-establish a clientid */
1540
status = nfs4_reclaim_lease(clp);
1541
@@ -1684,7 +1684,7 @@ static void nfs4_state_manager(struct nfs_client *clp)
1543
if (test_and_set_bit(NFS4CLNT_MANAGER_RUNNING, &clp->cl_state) != 0)
1546
+ } while (atomic_read(&clp->cl_count) > 1);
1549
printk(KERN_WARNING "Error: state manager failed on NFSv4 server %s"
1550
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
1551
index b68c860..6a2ec50 100644
1552
--- a/fs/nfs/super.c
1553
+++ b/fs/nfs/super.c
1554
@@ -2077,6 +2077,15 @@ nfs_remount(struct super_block *sb, int *flags, char *raw_data)
1559
+ * noac is a special case. It implies -o sync, but that's not
1560
+ * necessarily reflected in the mtab options. do_remount_sb
1561
+ * will clear MS_SYNCHRONOUS if -o sync wasn't specified in the
1562
+ * remount options, so we have to explicitly reset it.
1564
+ if (data->flags & NFS_MOUNT_NOAC)
1565
+ *flags |= MS_SYNCHRONOUS;
1567
/* compare new mount options with old ones */
1568
error = nfs_compare_remount_data(nfss, data);
1570
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
1571
index 96aaaa4..18c356c 100644
1572
--- a/fs/nfsd/nfs4state.c
1573
+++ b/fs/nfsd/nfs4state.c
1574
@@ -258,6 +258,7 @@ static void nfs4_put_deleg_lease(struct nfs4_file *fp)
1575
if (atomic_dec_and_test(&fp->fi_delegees)) {
1576
vfs_setlease(fp->fi_deleg_file, F_UNLCK, &fp->fi_lease);
1577
fp->fi_lease = NULL;
1578
+ fput(fp->fi_deleg_file);
1579
fp->fi_deleg_file = NULL;
1582
@@ -402,8 +403,8 @@ static void free_generic_stateid(struct nfs4_stateid *stp)
1583
if (stp->st_access_bmap) {
1584
oflag = nfs4_access_bmap_to_omode(stp);
1585
nfs4_file_put_access(stp->st_file, oflag);
1586
- put_nfs4_file(stp->st_file);
1588
+ put_nfs4_file(stp->st_file);
1589
kmem_cache_free(stateid_slab, stp);
1592
diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c
1593
index 77e9b87..c0c590f 100644
1594
--- a/fs/ubifs/recovery.c
1595
+++ b/fs/ubifs/recovery.c
1596
@@ -300,6 +300,32 @@ int ubifs_recover_master_node(struct ubifs_info *c)
1599
memcpy(c->rcvrd_mst_node, c->mst_node, UBIFS_MST_NODE_SZ);
1602
+ * We had to recover the master node, which means there was an
1603
+ * unclean reboot. However, it is possible that the master node
1604
+ * is clean at this point, i.e., %UBIFS_MST_DIRTY is not set.
1605
+ * E.g., consider the following chain of events:
1607
+ * 1. UBIFS was cleanly unmounted, so the master node is clean
1608
+ * 2. UBIFS is being mounted R/W and starts changing the master
1609
+ * node in the first (%UBIFS_MST_LNUM). A power cut happens,
1610
+ * so this LEB ends up with some amount of garbage at the
1612
+ * 3. UBIFS is being mounted R/O. We reach this place and
1613
+ * recover the master node from the second LEB
1614
+ * (%UBIFS_MST_LNUM + 1). But we cannot update the media
1615
+ * because we are being mounted R/O. We have to defer the
1617
+ * 4. However, this master node (@c->mst_node) is marked as
1618
+ * clean (since the step 1). And if we just return, the
1619
+ * mount code will be confused and won't recover the master
1620
+ * node when it is re-mounter R/W later.
1622
+ * Thus, to force the recovery by marking the master node as
1625
+ c->mst_node->flags |= cpu_to_le32(UBIFS_MST_DIRTY);
1627
/* Write the recovered master node */
1628
c->max_sqnum = le64_to_cpu(mst->ch.sqnum) - 1;
1629
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
1630
index 0f029e1..e94d962 100644
1631
--- a/fs/ubifs/super.c
1632
+++ b/fs/ubifs/super.c
1633
@@ -1643,15 +1643,27 @@ static int ubifs_remount_rw(struct ubifs_info *c)
1637
+ dbg_gen("re-mounted read-write");
1638
+ c->remounting_rw = 0;
1640
if (c->need_recovery) {
1641
c->need_recovery = 0;
1642
ubifs_msg("deferred recovery completed");
1645
+ * Do not run the debugging space check if the were doing
1646
+ * recovery, because when we saved the information we had the
1647
+ * file-system in a state where the TNC and lprops has been
1648
+ * modified in memory, but all the I/O operations (including a
1649
+ * commit) were deferred. So the file-system was in
1650
+ * "non-committed" state. Now the file-system is in committed
1651
+ * state, and of course the amount of free space will change
1652
+ * because, for example, the old index size was imprecise.
1654
+ err = dbg_check_space_info(c);
1657
- dbg_gen("re-mounted read-write");
1658
- c->remounting_rw = 0;
1659
c->always_chk_crc = 0;
1660
- err = dbg_check_space_info(c);
1661
mutex_unlock(&c->umount_mutex);
1664
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
1665
index df29c8f..8847c8c 100644
1666
--- a/include/linux/huge_mm.h
1667
+++ b/include/linux/huge_mm.h
1668
@@ -117,7 +117,7 @@ static inline void vma_adjust_trans_huge(struct vm_area_struct *vma,
1672
- if (!vma->anon_vma || vma->vm_ops || vma->vm_file)
1673
+ if (!vma->anon_vma || vma->vm_ops)
1675
__vma_adjust_trans_huge(vma, start, end, adjust_next);
1677
diff --git a/include/linux/libata.h b/include/linux/libata.h
1678
index c9c5d7a..1f00080 100644
1679
--- a/include/linux/libata.h
1680
+++ b/include/linux/libata.h
1681
@@ -203,6 +203,7 @@ enum {
1683
ATA_FLAG_SW_ACTIVITY = (1 << 22), /* driver supports sw activity
1685
+ ATA_FLAG_NO_DIPM = (1 << 23), /* host not happy with DIPM */
1687
/* bits 24:31 of ap->flags are reserved for LLD specific flags */
1689
diff --git a/include/linux/mm.h b/include/linux/mm.h
1690
index c67adb4..248c946 100644
1691
--- a/include/linux/mm.h
1692
+++ b/include/linux/mm.h
1693
@@ -137,7 +137,8 @@ extern unsigned int kobjsize(const void *objp);
1694
#define VM_RandomReadHint(v) ((v)->vm_flags & VM_RAND_READ)
1697
- * special vmas that are non-mergable, non-mlock()able
1698
+ * Special vmas that are non-mergable, non-mlock()able.
1699
+ * Note: mm/huge_memory.c VM_NO_THP depends on this definition.
1701
#define VM_SPECIAL (VM_IO | VM_DONTEXPAND | VM_RESERVED | VM_PFNMAP)
1703
diff --git a/init/Kconfig b/init/Kconfig
1704
index be788c0..47dd02f 100644
1707
@@ -1209,6 +1209,7 @@ config SLAB
1708
per cpu and per node queues.
1711
+ depends on BROKEN || NUMA || !DISCONTIGMEM
1712
bool "SLUB (Unqueued Allocator)"
1714
SLUB is a slab allocator that minimizes cache line usage
1715
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
1716
index 8f76561..56cac93 100644
1717
--- a/mm/huge_memory.c
1718
+++ b/mm/huge_memory.c
1719
@@ -1400,6 +1400,9 @@ out:
1723
+#define VM_NO_THP (VM_SPECIAL|VM_INSERTPAGE|VM_MIXEDMAP|VM_SAO| \
1724
+ VM_HUGETLB|VM_SHARED|VM_MAYSHARE)
1726
int hugepage_madvise(struct vm_area_struct *vma,
1727
unsigned long *vm_flags, int advice)
1729
@@ -1408,11 +1411,7 @@ int hugepage_madvise(struct vm_area_struct *vma,
1731
* Be somewhat over-protective like KSM for now!
1733
- if (*vm_flags & (VM_HUGEPAGE |
1734
- VM_SHARED | VM_MAYSHARE |
1735
- VM_PFNMAP | VM_IO | VM_DONTEXPAND |
1736
- VM_RESERVED | VM_HUGETLB | VM_INSERTPAGE |
1737
- VM_MIXEDMAP | VM_SAO))
1738
+ if (*vm_flags & (VM_HUGEPAGE | VM_NO_THP))
1740
*vm_flags &= ~VM_NOHUGEPAGE;
1741
*vm_flags |= VM_HUGEPAGE;
1742
@@ -1428,11 +1427,7 @@ int hugepage_madvise(struct vm_area_struct *vma,
1744
* Be somewhat over-protective like KSM for now!
1746
- if (*vm_flags & (VM_NOHUGEPAGE |
1747
- VM_SHARED | VM_MAYSHARE |
1748
- VM_PFNMAP | VM_IO | VM_DONTEXPAND |
1749
- VM_RESERVED | VM_HUGETLB | VM_INSERTPAGE |
1750
- VM_MIXEDMAP | VM_SAO))
1751
+ if (*vm_flags & (VM_NOHUGEPAGE | VM_NO_THP))
1753
*vm_flags &= ~VM_HUGEPAGE;
1754
*vm_flags |= VM_NOHUGEPAGE;
1755
@@ -1566,10 +1561,14 @@ int khugepaged_enter_vma_merge(struct vm_area_struct *vma)
1756
* page fault if needed.
1759
- if (vma->vm_file || vma->vm_ops)
1761
/* khugepaged not yet working on file or special mappings */
1763
- VM_BUG_ON(is_linear_pfn_mapping(vma) || is_pfn_mapping(vma));
1765
+ * If is_pfn_mapping() is true is_learn_pfn_mapping() must be
1766
+ * true too, verify it here.
1768
+ VM_BUG_ON(is_linear_pfn_mapping(vma) || vma->vm_flags & VM_NO_THP);
1769
hstart = (vma->vm_start + ~HPAGE_PMD_MASK) & HPAGE_PMD_MASK;
1770
hend = vma->vm_end & HPAGE_PMD_MASK;
1772
@@ -1818,12 +1817,15 @@ static void collapse_huge_page(struct mm_struct *mm,
1773
(vma->vm_flags & VM_NOHUGEPAGE))
1776
- /* VM_PFNMAP vmas may have vm_ops null but vm_file set */
1777
- if (!vma->anon_vma || vma->vm_ops || vma->vm_file)
1778
+ if (!vma->anon_vma || vma->vm_ops)
1780
if (is_vma_temporary_stack(vma))
1782
- VM_BUG_ON(is_linear_pfn_mapping(vma) || is_pfn_mapping(vma));
1784
+ * If is_pfn_mapping() is true is_learn_pfn_mapping() must be
1785
+ * true too, verify it here.
1787
+ VM_BUG_ON(is_linear_pfn_mapping(vma) || vma->vm_flags & VM_NO_THP);
1789
pgd = pgd_offset(mm, address);
1790
if (!pgd_present(*pgd))
1791
@@ -2056,13 +2058,16 @@ static unsigned int khugepaged_scan_mm_slot(unsigned int pages,
1795
- /* VM_PFNMAP vmas may have vm_ops null but vm_file set */
1796
- if (!vma->anon_vma || vma->vm_ops || vma->vm_file)
1797
+ if (!vma->anon_vma || vma->vm_ops)
1799
if (is_vma_temporary_stack(vma))
1802
- VM_BUG_ON(is_linear_pfn_mapping(vma) || is_pfn_mapping(vma));
1804
+ * If is_pfn_mapping() is true is_learn_pfn_mapping()
1805
+ * must be true too, verify it here.
1807
+ VM_BUG_ON(is_linear_pfn_mapping(vma) ||
1808
+ vma->vm_flags & VM_NO_THP);
1810
hstart = (vma->vm_start + ~HPAGE_PMD_MASK) & HPAGE_PMD_MASK;
1811
hend = vma->vm_end & HPAGE_PMD_MASK;
1812
diff --git a/mm/memory.c b/mm/memory.c
1813
index f17746a..ab88d09 100644
1816
@@ -3332,7 +3332,7 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
1817
* run pte_offset_map on the pmd, if an huge pmd could
1818
* materialize from under us from a different thread.
1820
- if (unlikely(__pte_alloc(mm, vma, pmd, address)))
1821
+ if (unlikely(pmd_none(*pmd)) && __pte_alloc(mm, vma, pmd, address))
1822
return VM_FAULT_OOM;
1823
/* if an huge pmd materialized from under us just retry later */
1824
if (unlikely(pmd_trans_huge(*pmd)))
1825
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
1826
index ea16f72..49ea0cc 100644
1829
@@ -172,10 +172,13 @@ unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *mem,
1832
* The baseline for the badness score is the proportion of RAM that each
1833
- * task's rss and swap space use.
1834
+ * task's rss, pagetable and swap space use.
1836
- points = (get_mm_rss(p->mm) + get_mm_counter(p->mm, MM_SWAPENTS)) * 1000 /
1838
+ points = get_mm_rss(p->mm) + p->mm->nr_ptes;
1839
+ points += get_mm_counter(p->mm, MM_SWAPENTS);
1842
+ points /= totalpages;
1846
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
1847
index 659326c..006ad81 100644
1848
--- a/scripts/kconfig/conf.c
1849
+++ b/scripts/kconfig/conf.c
1850
@@ -332,7 +332,7 @@ static int conf_choice(struct menu *menu)
1854
- if (line[strlen(line) - 1] == '?') {
1855
+ if (line[0] && line[strlen(line) - 1] == '?') {
1859
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
1860
index da7cdca..8ff0223 100644
1861
--- a/sound/pci/hda/patch_realtek.c
1862
+++ b/sound/pci/hda/patch_realtek.c
1863
@@ -14945,6 +14945,23 @@ static void alc269_fixup_hweq(struct hda_codec *codec,
1864
alc_write_coef_idx(codec, 0x1e, coef | 0x80);
1867
+static void alc271_fixup_dmic(struct hda_codec *codec,
1868
+ const struct alc_fixup *fix, int action)
1870
+ static struct hda_verb verbs[] = {
1871
+ {0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
1872
+ {0x20, AC_VERB_SET_PROC_COEF, 0x4000},
1877
+ if (strcmp(codec->chip_name, "ALC271X"))
1879
+ cfg = snd_hda_codec_get_pincfg(codec, 0x12);
1880
+ if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
1881
+ snd_hda_sequence_write(codec, verbs);
1885
ALC269_FIXUP_SONY_VAIO,
1886
ALC275_FIXUP_SONY_VAIO_GPIO2,
1887
@@ -14953,6 +14970,7 @@ enum {
1888
ALC269_FIXUP_ASUS_G73JW,
1889
ALC269_FIXUP_LENOVO_EAPD,
1890
ALC275_FIXUP_SONY_HWEQ,
1891
+ ALC271_FIXUP_DMIC,
1894
static const struct alc_fixup alc269_fixups[] = {
1895
@@ -15006,7 +15024,11 @@ static const struct alc_fixup alc269_fixups[] = {
1896
.v.func = alc269_fixup_hweq,
1898
.chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
1901
+ [ALC271_FIXUP_DMIC] = {
1902
+ .type = ALC_FIXUP_FUNC,
1903
+ .v.func = alc271_fixup_dmic,
1907
static struct snd_pci_quirk alc269_fixup_tbl[] = {
1908
@@ -15015,6 +15037,7 @@ static struct snd_pci_quirk alc269_fixup_tbl[] = {
1909
SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
1910
SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
1911
SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
1912
+ SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
1913
SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
1914
SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
1915
SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
1916
diff --git a/sound/soc/codecs/jz4740.c b/sound/soc/codecs/jz4740.c
1917
index f7cd346..f5ccdbf 100644
1918
--- a/sound/soc/codecs/jz4740.c
1919
+++ b/sound/soc/codecs/jz4740.c
1920
@@ -308,8 +308,6 @@ static int jz4740_codec_dev_probe(struct snd_soc_codec *codec)
1921
snd_soc_dapm_add_routes(dapm, jz4740_codec_dapm_routes,
1922
ARRAY_SIZE(jz4740_codec_dapm_routes));
1924
- snd_soc_dapm_new_widgets(codec);
1926
jz4740_codec_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
1929
diff --git a/sound/soc/codecs/wm_hubs.c b/sound/soc/codecs/wm_hubs.c
1930
index 5168927..d365f43 100644
1931
--- a/sound/soc/codecs/wm_hubs.c
1932
+++ b/sound/soc/codecs/wm_hubs.c
1933
@@ -739,12 +739,12 @@ static const struct snd_soc_dapm_route analogue_routes[] = {
1935
{ "SPKL", "Input Switch", "MIXINL" },
1936
{ "SPKL", "IN1LP Switch", "IN1LP" },
1937
- { "SPKL", "Output Switch", "Left Output Mixer" },
1938
+ { "SPKL", "Output Switch", "Left Output PGA" },
1939
{ "SPKL", NULL, "TOCLK" },
1941
{ "SPKR", "Input Switch", "MIXINR" },
1942
{ "SPKR", "IN1RP Switch", "IN1RP" },
1943
- { "SPKR", "Output Switch", "Right Output Mixer" },
1944
+ { "SPKR", "Output Switch", "Right Output PGA" },
1945
{ "SPKR", NULL, "TOCLK" },
1947
{ "SPKL Boost", "Direct Voice Switch", "Direct Voice" },
1948
@@ -766,8 +766,8 @@ static const struct snd_soc_dapm_route analogue_routes[] = {
1949
{ "SPKOUTRP", NULL, "SPKR Driver" },
1950
{ "SPKOUTRN", NULL, "SPKR Driver" },
1952
- { "Left Headphone Mux", "Mixer", "Left Output Mixer" },
1953
- { "Right Headphone Mux", "Mixer", "Right Output Mixer" },
1954
+ { "Left Headphone Mux", "Mixer", "Left Output PGA" },
1955
+ { "Right Headphone Mux", "Mixer", "Right Output PGA" },
1957
{ "Headphone PGA", NULL, "Left Headphone Mux" },
1958
{ "Headphone PGA", NULL, "Right Headphone Mux" },