aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/processor_core.c2
-rw-r--r--drivers/acpi/processor_idle.c19
-rw-r--r--drivers/acpi/sleep/Makefile4
-rw-r--r--drivers/acpi/sleep/main.c61
-rw-r--r--drivers/acpi/sleep/poweroff.c75
-rw-r--r--drivers/acpi/video.c3
-rw-r--r--drivers/ata/pata_sis.c3
-rw-r--r--drivers/ata/sata_sil24.c16
-rw-r--r--drivers/cdrom/cdrom.c4
-rw-r--r--drivers/char/hpet.c6
-rw-r--r--drivers/char/mspec.c26
-rw-r--r--drivers/infiniband/hw/mlx4/qp.c62
-rw-r--r--drivers/input/mouse/appletouch.c6
-rw-r--r--drivers/kvm/Kconfig3
-rw-r--r--drivers/lguest/lguest_asm.S6
-rw-r--r--drivers/md/raid5.c17
-rw-r--r--drivers/net/pcmcia/3c589_cs.c2
-rw-r--r--drivers/net/ppp_mppe.c14
-rw-r--r--drivers/net/r8169.c14
-rw-r--r--drivers/net/sky2.c37
-rw-r--r--drivers/net/sky2.h2
-rw-r--r--drivers/power/power_supply_sysfs.c1
-rw-r--r--drivers/serial/sunsab.c2
-rw-r--r--drivers/w1/w1.c1
24 files changed, 220 insertions, 166 deletions
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 2afb3d2086b3..9f11dc296cdd 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -102,6 +102,8 @@ static struct acpi_driver acpi_processor_driver = {
102 .add = acpi_processor_add, 102 .add = acpi_processor_add,
103 .remove = acpi_processor_remove, 103 .remove = acpi_processor_remove,
104 .start = acpi_processor_start, 104 .start = acpi_processor_start,
105 .suspend = acpi_processor_suspend,
106 .resume = acpi_processor_resume,
105 }, 107 },
106}; 108};
107 109
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index d9b8af763e1e..f18261368e76 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -325,6 +325,23 @@ static void acpi_state_timer_broadcast(struct acpi_processor *pr,
325 325
326#endif 326#endif
327 327
328/*
329 * Suspend / resume control
330 */
331static int acpi_idle_suspend;
332
333int acpi_processor_suspend(struct acpi_device * device, pm_message_t state)
334{
335 acpi_idle_suspend = 1;
336 return 0;
337}
338
339int acpi_processor_resume(struct acpi_device * device)
340{
341 acpi_idle_suspend = 0;
342 return 0;
343}
344
328static void acpi_processor_idle(void) 345static void acpi_processor_idle(void)
329{ 346{
330 struct acpi_processor *pr = NULL; 347 struct acpi_processor *pr = NULL;
@@ -355,7 +372,7 @@ static void acpi_processor_idle(void)
355 } 372 }
356 373
357 cx = pr->power.state; 374 cx = pr->power.state;
358 if (!cx) { 375 if (!cx || acpi_idle_suspend) {
359 if (pm_idle_save) 376 if (pm_idle_save)
360 pm_idle_save(); 377 pm_idle_save();
361 else 378 else
diff --git a/drivers/acpi/sleep/Makefile b/drivers/acpi/sleep/Makefile
index 195a4f69c0f7..f1fb888c2d29 100644
--- a/drivers/acpi/sleep/Makefile
+++ b/drivers/acpi/sleep/Makefile
@@ -1,5 +1,5 @@
1obj-y := poweroff.o wakeup.o 1obj-y := wakeup.o
2obj-$(CONFIG_ACPI_SLEEP) += main.o 2obj-y += main.o
3obj-$(CONFIG_ACPI_SLEEP) += proc.o 3obj-$(CONFIG_ACPI_SLEEP) += proc.o
4 4
5EXTRA_CFLAGS += $(ACPI_CFLAGS) 5EXTRA_CFLAGS += $(ACPI_CFLAGS)
diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c
index c52ade816fb4..2cbb9aabd00e 100644
--- a/drivers/acpi/sleep/main.c
+++ b/drivers/acpi/sleep/main.c
@@ -15,13 +15,39 @@
15#include <linux/dmi.h> 15#include <linux/dmi.h>
16#include <linux/device.h> 16#include <linux/device.h>
17#include <linux/suspend.h> 17#include <linux/suspend.h>
18
19#include <asm/io.h>
20
18#include <acpi/acpi_bus.h> 21#include <acpi/acpi_bus.h>
19#include <acpi/acpi_drivers.h> 22#include <acpi/acpi_drivers.h>
20#include "sleep.h" 23#include "sleep.h"
21 24
22u8 sleep_states[ACPI_S_STATE_COUNT]; 25u8 sleep_states[ACPI_S_STATE_COUNT];
23 26
27#ifdef CONFIG_PM_SLEEP
24static u32 acpi_target_sleep_state = ACPI_STATE_S0; 28static u32 acpi_target_sleep_state = ACPI_STATE_S0;
29#endif
30
31int acpi_sleep_prepare(u32 acpi_state)
32{
33#ifdef CONFIG_ACPI_SLEEP
34 /* do we have a wakeup address for S2 and S3? */
35 if (acpi_state == ACPI_STATE_S3) {
36 if (!acpi_wakeup_address) {
37 return -EFAULT;
38 }
39 acpi_set_firmware_waking_vector((acpi_physical_address)
40 virt_to_phys((void *)
41 acpi_wakeup_address));
42
43 }
44 ACPI_FLUSH_CPU_CACHE();
45 acpi_enable_wakeup_device_prep(acpi_state);
46#endif
47 acpi_gpe_sleep_prepare(acpi_state);
48 acpi_enter_sleep_state_prep(acpi_state);
49 return 0;
50}
25 51
26#ifdef CONFIG_SUSPEND 52#ifdef CONFIG_SUSPEND
27static struct pm_ops acpi_pm_ops; 53static struct pm_ops acpi_pm_ops;
@@ -275,6 +301,7 @@ int acpi_suspend(u32 acpi_state)
275 return -EINVAL; 301 return -EINVAL;
276} 302}
277 303
304#ifdef CONFIG_PM_SLEEP
278/** 305/**
279 * acpi_pm_device_sleep_state - return preferred power state of ACPI device 306 * acpi_pm_device_sleep_state - return preferred power state of ACPI device
280 * in the system sleep state given by %acpi_target_sleep_state 307 * in the system sleep state given by %acpi_target_sleep_state
@@ -349,6 +376,21 @@ int acpi_pm_device_sleep_state(struct device *dev, int wake, int *d_min_p)
349 *d_min_p = d_min; 376 *d_min_p = d_min;
350 return d_max; 377 return d_max;
351} 378}
379#endif
380
381static void acpi_power_off_prepare(void)
382{
383 /* Prepare to power off the system */
384 acpi_sleep_prepare(ACPI_STATE_S5);
385}
386
387static void acpi_power_off(void)
388{
389 /* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */
390 printk("%s called\n", __FUNCTION__);
391 local_irq_disable();
392 acpi_enter_sleep_state(ACPI_STATE_S5);
393}
352 394
353int __init acpi_sleep_init(void) 395int __init acpi_sleep_init(void)
354{ 396{
@@ -363,16 +405,17 @@ int __init acpi_sleep_init(void)
363 if (acpi_disabled) 405 if (acpi_disabled)
364 return 0; 406 return 0;
365 407
408 sleep_states[ACPI_STATE_S0] = 1;
409 printk(KERN_INFO PREFIX "(supports S0");
410
366#ifdef CONFIG_SUSPEND 411#ifdef CONFIG_SUSPEND
367 printk(KERN_INFO PREFIX "(supports"); 412 for (i = ACPI_STATE_S1; i < ACPI_STATE_S4; i++) {
368 for (i = ACPI_STATE_S0; i < ACPI_STATE_S4; i++) {
369 status = acpi_get_sleep_type_data(i, &type_a, &type_b); 413 status = acpi_get_sleep_type_data(i, &type_a, &type_b);
370 if (ACPI_SUCCESS(status)) { 414 if (ACPI_SUCCESS(status)) {
371 sleep_states[i] = 1; 415 sleep_states[i] = 1;
372 printk(" S%d", i); 416 printk(" S%d", i);
373 } 417 }
374 } 418 }
375 printk(")\n");
376 419
377 pm_set_ops(&acpi_pm_ops); 420 pm_set_ops(&acpi_pm_ops);
378#endif 421#endif
@@ -382,10 +425,16 @@ int __init acpi_sleep_init(void)
382 if (ACPI_SUCCESS(status)) { 425 if (ACPI_SUCCESS(status)) {
383 hibernation_set_ops(&acpi_hibernation_ops); 426 hibernation_set_ops(&acpi_hibernation_ops);
384 sleep_states[ACPI_STATE_S4] = 1; 427 sleep_states[ACPI_STATE_S4] = 1;
428 printk(" S4");
385 } 429 }
386#else
387 sleep_states[ACPI_STATE_S4] = 0;
388#endif 430#endif
389 431 status = acpi_get_sleep_type_data(ACPI_STATE_S5, &type_a, &type_b);
432 if (ACPI_SUCCESS(status)) {
433 sleep_states[ACPI_STATE_S5] = 1;
434 printk(" S5");
435 pm_power_off_prepare = acpi_power_off_prepare;
436 pm_power_off = acpi_power_off;
437 }
438 printk(")\n");
390 return 0; 439 return 0;
391} 440}
diff --git a/drivers/acpi/sleep/poweroff.c b/drivers/acpi/sleep/poweroff.c
deleted file mode 100644
index 39e40d56b034..000000000000
--- a/drivers/acpi/sleep/poweroff.c
+++ /dev/null
@@ -1,75 +0,0 @@
1/*
2 * poweroff.c - ACPI handler for powering off the system.
3 *
4 * AKA S5, but it is independent of whether or not the kernel supports
5 * any other sleep support in the system.
6 *
7 * Copyright (c) 2005 Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
8 *
9 * This file is released under the GPLv2.
10 */
11
12#include <linux/pm.h>
13#include <linux/init.h>
14#include <acpi/acpi_bus.h>
15#include <linux/sysdev.h>
16#include <asm/io.h>
17#include "sleep.h"
18
19int acpi_sleep_prepare(u32 acpi_state)
20{
21#ifdef CONFIG_ACPI_SLEEP
22 /* do we have a wakeup address for S2 and S3? */
23 if (acpi_state == ACPI_STATE_S3) {
24 if (!acpi_wakeup_address) {
25 return -EFAULT;
26 }
27 acpi_set_firmware_waking_vector((acpi_physical_address)
28 virt_to_phys((void *)
29 acpi_wakeup_address));
30
31 }
32 ACPI_FLUSH_CPU_CACHE();
33 acpi_enable_wakeup_device_prep(acpi_state);
34#endif
35 acpi_gpe_sleep_prepare(acpi_state);
36 acpi_enter_sleep_state_prep(acpi_state);
37 return 0;
38}
39
40#ifdef CONFIG_PM
41
42static void acpi_power_off_prepare(void)
43{
44 /* Prepare to power off the system */
45 acpi_sleep_prepare(ACPI_STATE_S5);
46}
47
48static void acpi_power_off(void)
49{
50 /* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */
51 printk("%s called\n", __FUNCTION__);
52 local_irq_disable();
53 /* Some SMP machines only can poweroff in boot CPU */
54 acpi_enter_sleep_state(ACPI_STATE_S5);
55}
56
57static int acpi_poweroff_init(void)
58{
59 if (!acpi_disabled) {
60 u8 type_a, type_b;
61 acpi_status status;
62
63 status =
64 acpi_get_sleep_type_data(ACPI_STATE_S5, &type_a, &type_b);
65 if (ACPI_SUCCESS(status)) {
66 pm_power_off_prepare = acpi_power_off_prepare;
67 pm_power_off = acpi_power_off;
68 }
69 }
70 return 0;
71}
72
73late_initcall(acpi_poweroff_init);
74
75#endif /* CONFIG_PM */
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 3c9bb85a6a93..d05891f16282 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -417,7 +417,6 @@ acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level)
417 arg0.integer.value = level; 417 arg0.integer.value = level;
418 status = acpi_evaluate_object(device->dev->handle, "_BCM", &args, NULL); 418 status = acpi_evaluate_object(device->dev->handle, "_BCM", &args, NULL);
419 419
420 printk(KERN_DEBUG "set_level status: %x\n", status);
421 return status; 420 return status;
422} 421}
423 422
@@ -1754,7 +1753,7 @@ static int acpi_video_bus_put_devices(struct acpi_video_bus *video)
1754 1753
1755static int acpi_video_bus_start_devices(struct acpi_video_bus *video) 1754static int acpi_video_bus_start_devices(struct acpi_video_bus *video)
1756{ 1755{
1757 return acpi_video_bus_DOS(video, 1, 0); 1756 return acpi_video_bus_DOS(video, 0, 0);
1758} 1757}
1759 1758
1760static int acpi_video_bus_stop_devices(struct acpi_video_bus *video) 1759static int acpi_video_bus_stop_devices(struct acpi_video_bus *video)
diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c
index 2bd7645f1a88..cce2834b2b60 100644
--- a/drivers/ata/pata_sis.c
+++ b/drivers/ata/pata_sis.c
@@ -375,8 +375,9 @@ static void sis_66_set_dmamode (struct ata_port *ap, struct ata_device *adev)
375 int drive_pci = sis_old_port_base(adev); 375 int drive_pci = sis_old_port_base(adev);
376 u16 timing; 376 u16 timing;
377 377
378 /* MWDMA 0-2 and UDMA 0-5 */
378 const u16 mwdma_bits[] = { 0x008, 0x302, 0x301 }; 379 const u16 mwdma_bits[] = { 0x008, 0x302, 0x301 };
379 const u16 udma_bits[] = { 0xF000, 0xD000, 0xB000, 0xA000, 0x9000}; 380 const u16 udma_bits[] = { 0xF000, 0xD000, 0xB000, 0xA000, 0x9000, 0x8000 };
380 381
381 pci_read_config_word(pdev, drive_pci, &timing); 382 pci_read_config_word(pdev, drive_pci, &timing);
382 383
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index ef83e6b1e314..233e88693395 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -888,6 +888,16 @@ static inline void sil24_host_intr(struct ata_port *ap)
888 u32 slot_stat, qc_active; 888 u32 slot_stat, qc_active;
889 int rc; 889 int rc;
890 890
891 /* If PCIX_IRQ_WOC, there's an inherent race window between
892 * clearing IRQ pending status and reading PORT_SLOT_STAT
893 * which may cause spurious interrupts afterwards. This is
894 * unavoidable and much better than losing interrupts which
895 * happens if IRQ pending is cleared after reading
896 * PORT_SLOT_STAT.
897 */
898 if (ap->flags & SIL24_FLAG_PCIX_IRQ_WOC)
899 writel(PORT_IRQ_COMPLETE, port + PORT_IRQ_STAT);
900
891 slot_stat = readl(port + PORT_SLOT_STAT); 901 slot_stat = readl(port + PORT_SLOT_STAT);
892 902
893 if (unlikely(slot_stat & HOST_SSTAT_ATTN)) { 903 if (unlikely(slot_stat & HOST_SSTAT_ATTN)) {
@@ -895,9 +905,6 @@ static inline void sil24_host_intr(struct ata_port *ap)
895 return; 905 return;
896 } 906 }
897 907
898 if (ap->flags & SIL24_FLAG_PCIX_IRQ_WOC)
899 writel(PORT_IRQ_COMPLETE, port + PORT_IRQ_STAT);
900
901 qc_active = slot_stat & ~HOST_SSTAT_ATTN; 908 qc_active = slot_stat & ~HOST_SSTAT_ATTN;
902 rc = ata_qc_complete_multiple(ap, qc_active, sil24_finish_qc); 909 rc = ata_qc_complete_multiple(ap, qc_active, sil24_finish_qc);
903 if (rc > 0) 910 if (rc > 0)
@@ -910,7 +917,8 @@ static inline void sil24_host_intr(struct ata_port *ap)
910 return; 917 return;
911 } 918 }
912 919
913 if (ata_ratelimit()) 920 /* spurious interrupts are expected if PCIX_IRQ_WOC */
921 if (!(ap->flags & SIL24_FLAG_PCIX_IRQ_WOC) && ata_ratelimit())
914 ata_port_printk(ap, KERN_INFO, "spurious interrupt " 922 ata_port_printk(ap, KERN_INFO, "spurious interrupt "
915 "(slot_stat 0x%x active_tag %d sactive 0x%x)\n", 923 "(slot_stat 0x%x active_tag %d sactive 0x%x)\n",
916 slot_stat, ap->active_tag, ap->sactive); 924 slot_stat, ap->active_tag, ap->sactive);
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index 67ee3d4b2878..79245714f0a7 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -1032,6 +1032,10 @@ int cdrom_open(struct cdrom_device_info *cdi, struct inode *ip, struct file *fp)
1032 check_disk_change(ip->i_bdev); 1032 check_disk_change(ip->i_bdev);
1033 return 0; 1033 return 0;
1034err_release: 1034err_release:
1035 if (CDROM_CAN(CDC_LOCK) && cdi->options & CDO_LOCK) {
1036 cdi->ops->lock_door(cdi, 0);
1037 cdinfo(CD_OPEN, "door unlocked.\n");
1038 }
1035 cdi->ops->release(cdi); 1039 cdi->ops->release(cdi);
1036err: 1040err:
1037 cdi->use_count--; 1041 cdi->use_count--;
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index 7ecffc9c738f..fd51554ab081 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -943,14 +943,14 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data)
943 printk(KERN_DEBUG "%s: 0x%lx is busy\n", 943 printk(KERN_DEBUG "%s: 0x%lx is busy\n",
944 __FUNCTION__, hdp->hd_phys_address); 944 __FUNCTION__, hdp->hd_phys_address);
945 iounmap(hdp->hd_address); 945 iounmap(hdp->hd_address);
946 return -EBUSY; 946 return AE_ALREADY_EXISTS;
947 } 947 }
948 } else if (res->type == ACPI_RESOURCE_TYPE_FIXED_MEMORY32) { 948 } else if (res->type == ACPI_RESOURCE_TYPE_FIXED_MEMORY32) {
949 struct acpi_resource_fixed_memory32 *fixmem32; 949 struct acpi_resource_fixed_memory32 *fixmem32;
950 950
951 fixmem32 = &res->data.fixed_memory32; 951 fixmem32 = &res->data.fixed_memory32;
952 if (!fixmem32) 952 if (!fixmem32)
953 return -EINVAL; 953 return AE_NO_MEMORY;
954 954
955 hdp->hd_phys_address = fixmem32->address; 955 hdp->hd_phys_address = fixmem32->address;
956 hdp->hd_address = ioremap(fixmem32->address, 956 hdp->hd_address = ioremap(fixmem32->address,
@@ -960,7 +960,7 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data)
960 printk(KERN_DEBUG "%s: 0x%lx is busy\n", 960 printk(KERN_DEBUG "%s: 0x%lx is busy\n",
961 __FUNCTION__, hdp->hd_phys_address); 961 __FUNCTION__, hdp->hd_phys_address);
962 iounmap(hdp->hd_address); 962 iounmap(hdp->hd_address);
963 return -EBUSY; 963 return AE_ALREADY_EXISTS;
964 } 964 }
965 } else if (res->type == ACPI_RESOURCE_TYPE_EXTENDED_IRQ) { 965 } else if (res->type == ACPI_RESOURCE_TYPE_EXTENDED_IRQ) {
966 struct acpi_resource_extended_irq *irqp; 966 struct acpi_resource_extended_irq *irqp;
diff --git a/drivers/char/mspec.c b/drivers/char/mspec.c
index 049a46cc9f87..04ac155d3a07 100644
--- a/drivers/char/mspec.c
+++ b/drivers/char/mspec.c
@@ -155,23 +155,22 @@ mspec_open(struct vm_area_struct *vma)
155 * mspec_close 155 * mspec_close
156 * 156 *
157 * Called when unmapping a device mapping. Frees all mspec pages 157 * Called when unmapping a device mapping. Frees all mspec pages
158 * belonging to the vma. 158 * belonging to all the vma's sharing this vma_data structure.
159 */ 159 */
160static void 160static void
161mspec_close(struct vm_area_struct *vma) 161mspec_close(struct vm_area_struct *vma)
162{ 162{
163 struct vma_data *vdata; 163 struct vma_data *vdata;
164 int index, last_index, result; 164 int index, last_index;
165 unsigned long my_page; 165 unsigned long my_page;
166 166
167 vdata = vma->vm_private_data; 167 vdata = vma->vm_private_data;
168 168
169 BUG_ON(vma->vm_start < vdata->vm_start || vma->vm_end > vdata->vm_end); 169 if (!atomic_dec_and_test(&vdata->refcnt))
170 return;
170 171
171 spin_lock(&vdata->lock); 172 last_index = (vdata->vm_end - vdata->vm_start) >> PAGE_SHIFT;
172 index = (vma->vm_start - vdata->vm_start) >> PAGE_SHIFT; 173 for (index = 0; index < last_index; index++) {
173 last_index = (vma->vm_end - vdata->vm_start) >> PAGE_SHIFT;
174 for (; index < last_index; index++) {
175 if (vdata->maddr[index] == 0) 174 if (vdata->maddr[index] == 0)
176 continue; 175 continue;
177 /* 176 /*
@@ -180,20 +179,12 @@ mspec_close(struct vm_area_struct *vma)
180 */ 179 */
181 my_page = vdata->maddr[index]; 180 my_page = vdata->maddr[index];
182 vdata->maddr[index] = 0; 181 vdata->maddr[index] = 0;
183 spin_unlock(&vdata->lock); 182 if (!mspec_zero_block(my_page, PAGE_SIZE))
184 result = mspec_zero_block(my_page, PAGE_SIZE);
185 if (!result)
186 uncached_free_page(my_page); 183 uncached_free_page(my_page);
187 else 184 else
188 printk(KERN_WARNING "mspec_close(): " 185 printk(KERN_WARNING "mspec_close(): "
189 "failed to zero page %i\n", 186 "failed to zero page %ld\n", my_page);
190 result);
191 spin_lock(&vdata->lock);
192 } 187 }
193 spin_unlock(&vdata->lock);
194
195 if (!atomic_dec_and_test(&vdata->refcnt))
196 return;
197 188
198 if (vdata->flags & VMD_VMALLOCED) 189 if (vdata->flags & VMD_VMALLOCED)
199 vfree(vdata); 190 vfree(vdata);
@@ -201,7 +192,6 @@ mspec_close(struct vm_area_struct *vma)
201 kfree(vdata); 192 kfree(vdata);
202} 193}
203 194
204
205/* 195/*
206 * mspec_nopfn 196 * mspec_nopfn
207 * 197 *
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index ba0428d872aa..85c51bdc36f1 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -1211,12 +1211,42 @@ static void set_datagram_seg(struct mlx4_wqe_datagram_seg *dseg,
1211 dseg->qkey = cpu_to_be32(wr->wr.ud.remote_qkey); 1211 dseg->qkey = cpu_to_be32(wr->wr.ud.remote_qkey);
1212} 1212}
1213 1213
1214static void set_data_seg(struct mlx4_wqe_data_seg *dseg, 1214static void set_mlx_icrc_seg(void *dseg)
1215 struct ib_sge *sg) 1215{
1216 u32 *t = dseg;
1217 struct mlx4_wqe_inline_seg *iseg = dseg;
1218
1219 t[1] = 0;
1220
1221 /*
1222 * Need a barrier here before writing the byte_count field to
1223 * make sure that all the data is visible before the
1224 * byte_count field is set. Otherwise, if the segment begins
1225 * a new cacheline, the HCA prefetcher could grab the 64-byte
1226 * chunk and get a valid (!= * 0xffffffff) byte count but
1227 * stale data, and end up sending the wrong data.
1228 */
1229 wmb();
1230
1231 iseg->byte_count = cpu_to_be32((1 << 31) | 4);
1232}
1233
1234static void set_data_seg(struct mlx4_wqe_data_seg *dseg, struct ib_sge *sg)
1216{ 1235{
1217 dseg->byte_count = cpu_to_be32(sg->length);
1218 dseg->lkey = cpu_to_be32(sg->lkey); 1236 dseg->lkey = cpu_to_be32(sg->lkey);
1219 dseg->addr = cpu_to_be64(sg->addr); 1237 dseg->addr = cpu_to_be64(sg->addr);
1238
1239 /*
1240 * Need a barrier here before writing the byte_count field to
1241 * make sure that all the data is visible before the
1242 * byte_count field is set. Otherwise, if the segment begins
1243 * a new cacheline, the HCA prefetcher could grab the 64-byte
1244 * chunk and get a valid (!= * 0xffffffff) byte count but
1245 * stale data, and end up sending the wrong data.
1246 */
1247 wmb();
1248
1249 dseg->byte_count = cpu_to_be32(sg->length);
1220} 1250}
1221 1251
1222int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, 1252int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
@@ -1225,6 +1255,7 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
1225 struct mlx4_ib_qp *qp = to_mqp(ibqp); 1255 struct mlx4_ib_qp *qp = to_mqp(ibqp);
1226 void *wqe; 1256 void *wqe;
1227 struct mlx4_wqe_ctrl_seg *ctrl; 1257 struct mlx4_wqe_ctrl_seg *ctrl;
1258 struct mlx4_wqe_data_seg *dseg;
1228 unsigned long flags; 1259 unsigned long flags;
1229 int nreq; 1260 int nreq;
1230 int err = 0; 1261 int err = 0;
@@ -1324,22 +1355,27 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
1324 break; 1355 break;
1325 } 1356 }
1326 1357
1327 for (i = 0; i < wr->num_sge; ++i) { 1358 /*
1328 set_data_seg(wqe, wr->sg_list + i); 1359 * Write data segments in reverse order, so as to
1360 * overwrite cacheline stamp last within each
1361 * cacheline. This avoids issues with WQE
1362 * prefetching.
1363 */
1329 1364
1330 wqe += sizeof (struct mlx4_wqe_data_seg); 1365 dseg = wqe;
1331 size += sizeof (struct mlx4_wqe_data_seg) / 16; 1366 dseg += wr->num_sge - 1;
1332 } 1367 size += wr->num_sge * (sizeof (struct mlx4_wqe_data_seg) / 16);
1333 1368
1334 /* Add one more inline data segment for ICRC for MLX sends */ 1369 /* Add one more inline data segment for ICRC for MLX sends */
1335 if (qp->ibqp.qp_type == IB_QPT_SMI || qp->ibqp.qp_type == IB_QPT_GSI) { 1370 if (unlikely(qp->ibqp.qp_type == IB_QPT_SMI ||
1336 ((struct mlx4_wqe_inline_seg *) wqe)->byte_count = 1371 qp->ibqp.qp_type == IB_QPT_GSI)) {
1337 cpu_to_be32((1 << 31) | 4); 1372 set_mlx_icrc_seg(dseg + 1);
1338 ((u32 *) wqe)[1] = 0;
1339 wqe += sizeof (struct mlx4_wqe_data_seg);
1340 size += sizeof (struct mlx4_wqe_data_seg) / 16; 1373 size += sizeof (struct mlx4_wqe_data_seg) / 16;
1341 } 1374 }
1342 1375
1376 for (i = wr->num_sge - 1; i >= 0; --i, --dseg)
1377 set_data_seg(dseg, wr->sg_list + i);
1378
1343 ctrl->fence_size = (wr->send_flags & IB_SEND_FENCE ? 1379 ctrl->fence_size = (wr->send_flags & IB_SEND_FENCE ?
1344 MLX4_WQE_CTRL_FENCE : 0) | size; 1380 MLX4_WQE_CTRL_FENCE : 0) | size;
1345 1381
diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c
index 2bea1b2c631c..a1804bfdbb8c 100644
--- a/drivers/input/mouse/appletouch.c
+++ b/drivers/input/mouse/appletouch.c
@@ -328,6 +328,7 @@ static void atp_complete(struct urb* urb)
328{ 328{
329 int x, y, x_z, y_z, x_f, y_f; 329 int x, y, x_z, y_z, x_f, y_f;
330 int retval, i, j; 330 int retval, i, j;
331 int key;
331 struct atp *dev = urb->context; 332 struct atp *dev = urb->context;
332 333
333 switch (urb->status) { 334 switch (urb->status) {
@@ -468,6 +469,7 @@ static void atp_complete(struct urb* urb)
468 ATP_XFACT, &x_z, &x_f); 469 ATP_XFACT, &x_z, &x_f);
469 y = atp_calculate_abs(dev->xy_acc + ATP_XSENSORS, ATP_YSENSORS, 470 y = atp_calculate_abs(dev->xy_acc + ATP_XSENSORS, ATP_YSENSORS,
470 ATP_YFACT, &y_z, &y_f); 471 ATP_YFACT, &y_z, &y_f);
472 key = dev->data[dev->datalen - 1] & 1;
471 473
472 if (x && y) { 474 if (x && y) {
473 if (dev->x_old != -1) { 475 if (dev->x_old != -1) {
@@ -505,7 +507,7 @@ static void atp_complete(struct urb* urb)
505 the first touch unless reinitialised. Do so if it's been 507 the first touch unless reinitialised. Do so if it's been
506 idle for a while in order to avoid waking the kernel up 508 idle for a while in order to avoid waking the kernel up
507 several hundred times a second */ 509 several hundred times a second */
508 if (atp_is_geyser_3(dev)) { 510 if (!key && atp_is_geyser_3(dev)) {
509 dev->idlecount++; 511 dev->idlecount++;
510 if (dev->idlecount == 10) { 512 if (dev->idlecount == 10) {
511 dev->valid = 0; 513 dev->valid = 0;
@@ -514,7 +516,7 @@ static void atp_complete(struct urb* urb)
514 } 516 }
515 } 517 }
516 518
517 input_report_key(dev->input, BTN_LEFT, dev->data[dev->datalen - 1] & 1); 519 input_report_key(dev->input, BTN_LEFT, key);
518 input_sync(dev->input); 520 input_sync(dev->input);
519 521
520exit: 522exit:
diff --git a/drivers/kvm/Kconfig b/drivers/kvm/Kconfig
index 7b64fd4aa2f3..0a419a0de603 100644
--- a/drivers/kvm/Kconfig
+++ b/drivers/kvm/Kconfig
@@ -6,7 +6,8 @@ menuconfig VIRTUALIZATION
6 depends on X86 6 depends on X86
7 default y 7 default y
8 ---help--- 8 ---help---
9 Say Y here to get to see options for virtualization guest drivers. 9 Say Y here to get to see options for using your Linux host to run other
10 operating systems inside virtual machines (guests).
10 This option alone does not add any kernel code. 11 This option alone does not add any kernel code.
11 12
12 If you say N, all options in this submenu will be skipped and disabled. 13 If you say N, all options in this submenu will be skipped and disabled.
diff --git a/drivers/lguest/lguest_asm.S b/drivers/lguest/lguest_asm.S
index f182c6a36209..1ddcd5cd20f6 100644
--- a/drivers/lguest/lguest_asm.S
+++ b/drivers/lguest/lguest_asm.S
@@ -22,8 +22,9 @@
22 jmp lguest_init 22 jmp lguest_init
23 23
24/*G:055 We create a macro which puts the assembler code between lgstart_ and 24/*G:055 We create a macro which puts the assembler code between lgstart_ and
25 * lgend_ markers. These templates end up in the .init.text section, so they 25 * lgend_ markers. These templates are put in the .text section: they can't be
26 * are discarded after boot. */ 26 * discarded after boot as we may need to patch modules, too. */
27.text
27#define LGUEST_PATCH(name, insns...) \ 28#define LGUEST_PATCH(name, insns...) \
28 lgstart_##name: insns; lgend_##name:; \ 29 lgstart_##name: insns; lgend_##name:; \
29 .globl lgstart_##name; .globl lgend_##name 30 .globl lgstart_##name; .globl lgend_##name
@@ -34,7 +35,6 @@ LGUEST_PATCH(popf, movl %eax, lguest_data+LGUEST_DATA_irq_enabled)
34LGUEST_PATCH(pushf, movl lguest_data+LGUEST_DATA_irq_enabled, %eax) 35LGUEST_PATCH(pushf, movl lguest_data+LGUEST_DATA_irq_enabled, %eax)
35/*:*/ 36/*:*/
36 37
37.text
38/* These demark the EIP range where host should never deliver interrupts. */ 38/* These demark the EIP range where host should never deliver interrupts. */
39.global lguest_noirq_start 39.global lguest_noirq_start
40.global lguest_noirq_end 40.global lguest_noirq_end
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 4d63773ee73a..f96dea975fa5 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -514,7 +514,7 @@ static void ops_complete_biofill(void *stripe_head_ref)
514 struct stripe_head *sh = stripe_head_ref; 514 struct stripe_head *sh = stripe_head_ref;
515 struct bio *return_bi = NULL; 515 struct bio *return_bi = NULL;
516 raid5_conf_t *conf = sh->raid_conf; 516 raid5_conf_t *conf = sh->raid_conf;
517 int i, more_to_read = 0; 517 int i;
518 518
519 pr_debug("%s: stripe %llu\n", __FUNCTION__, 519 pr_debug("%s: stripe %llu\n", __FUNCTION__,
520 (unsigned long long)sh->sector); 520 (unsigned long long)sh->sector);
@@ -522,16 +522,14 @@ static void ops_complete_biofill(void *stripe_head_ref)
522 /* clear completed biofills */ 522 /* clear completed biofills */
523 for (i = sh->disks; i--; ) { 523 for (i = sh->disks; i--; ) {
524 struct r5dev *dev = &sh->dev[i]; 524 struct r5dev *dev = &sh->dev[i];
525 /* check if this stripe has new incoming reads */
526 if (dev->toread)
527 more_to_read++;
528 525
529 /* acknowledge completion of a biofill operation */ 526 /* acknowledge completion of a biofill operation */
530 /* and check if we need to reply to a read request 527 /* and check if we need to reply to a read request,
531 */ 528 * new R5_Wantfill requests are held off until
532 if (test_bit(R5_Wantfill, &dev->flags) && !dev->toread) { 529 * !test_bit(STRIPE_OP_BIOFILL, &sh->ops.pending)
530 */
531 if (test_and_clear_bit(R5_Wantfill, &dev->flags)) {
533 struct bio *rbi, *rbi2; 532 struct bio *rbi, *rbi2;
534 clear_bit(R5_Wantfill, &dev->flags);
535 533
536 /* The access to dev->read is outside of the 534 /* The access to dev->read is outside of the
537 * spin_lock_irq(&conf->device_lock), but is protected 535 * spin_lock_irq(&conf->device_lock), but is protected
@@ -558,8 +556,7 @@ static void ops_complete_biofill(void *stripe_head_ref)
558 556
559 return_io(return_bi); 557 return_io(return_bi);
560 558
561 if (more_to_read) 559 set_bit(STRIPE_HANDLE, &sh->state);
562 set_bit(STRIPE_HANDLE, &sh->state);
563 release_stripe(sh); 560 release_stripe(sh);
564} 561}
565 562
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index c06cae3f0b56..503f2685fb73 100644
--- a/drivers/net/pcmcia/3c589_cs.c
+++ b/drivers/net/pcmcia/3c589_cs.c
@@ -116,7 +116,7 @@ struct el3_private {
116 spinlock_t lock; 116 spinlock_t lock;
117}; 117};
118 118
119static const char *if_names[] = { "auto", "10base2", "10baseT", "AUI" }; 119static const char *if_names[] = { "auto", "10baseT", "10base2", "AUI" };
120 120
121/*====================================================================*/ 121/*====================================================================*/
122 122
diff --git a/drivers/net/ppp_mppe.c b/drivers/net/ppp_mppe.c
index f79cf87a2bff..c0b6d19d1457 100644
--- a/drivers/net/ppp_mppe.c
+++ b/drivers/net/ppp_mppe.c
@@ -136,7 +136,7 @@ struct ppp_mppe_state {
136 * Key Derivation, from RFC 3078, RFC 3079. 136 * Key Derivation, from RFC 3078, RFC 3079.
137 * Equivalent to Get_Key() for MS-CHAP as described in RFC 3079. 137 * Equivalent to Get_Key() for MS-CHAP as described in RFC 3079.
138 */ 138 */
139static void get_new_key_from_sha(struct ppp_mppe_state * state, unsigned char *InterimKey) 139static void get_new_key_from_sha(struct ppp_mppe_state * state)
140{ 140{
141 struct hash_desc desc; 141 struct hash_desc desc;
142 struct scatterlist sg[4]; 142 struct scatterlist sg[4];
@@ -153,8 +153,6 @@ static void get_new_key_from_sha(struct ppp_mppe_state * state, unsigned char *I
153 desc.flags = 0; 153 desc.flags = 0;
154 154
155 crypto_hash_digest(&desc, sg, nbytes, state->sha1_digest); 155 crypto_hash_digest(&desc, sg, nbytes, state->sha1_digest);
156
157 memcpy(InterimKey, state->sha1_digest, state->keylen);
158} 156}
159 157
160/* 158/*
@@ -163,21 +161,21 @@ static void get_new_key_from_sha(struct ppp_mppe_state * state, unsigned char *I
163 */ 161 */
164static void mppe_rekey(struct ppp_mppe_state * state, int initial_key) 162static void mppe_rekey(struct ppp_mppe_state * state, int initial_key)
165{ 163{
166 unsigned char InterimKey[MPPE_MAX_KEY_LEN];
167 struct scatterlist sg_in[1], sg_out[1]; 164 struct scatterlist sg_in[1], sg_out[1];
168 struct blkcipher_desc desc = { .tfm = state->arc4 }; 165 struct blkcipher_desc desc = { .tfm = state->arc4 };
169 166
170 get_new_key_from_sha(state, InterimKey); 167 get_new_key_from_sha(state);
171 if (!initial_key) { 168 if (!initial_key) {
172 crypto_blkcipher_setkey(state->arc4, InterimKey, state->keylen); 169 crypto_blkcipher_setkey(state->arc4, state->sha1_digest,
173 setup_sg(sg_in, InterimKey, state->keylen); 170 state->keylen);
171 setup_sg(sg_in, state->sha1_digest, state->keylen);
174 setup_sg(sg_out, state->session_key, state->keylen); 172 setup_sg(sg_out, state->session_key, state->keylen);
175 if (crypto_blkcipher_encrypt(&desc, sg_out, sg_in, 173 if (crypto_blkcipher_encrypt(&desc, sg_out, sg_in,
176 state->keylen) != 0) { 174 state->keylen) != 0) {
177 printk(KERN_WARNING "mppe_rekey: cipher_encrypt failed\n"); 175 printk(KERN_WARNING "mppe_rekey: cipher_encrypt failed\n");
178 } 176 }
179 } else { 177 } else {
180 memcpy(state->session_key, InterimKey, state->keylen); 178 memcpy(state->session_key, state->sha1_digest, state->keylen);
181 } 179 }
182 if (state->keylen == 8) { 180 if (state->keylen == 8) {
183 /* See RFC 3078 */ 181 /* See RFC 3078 */
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index b85ab4a8f2a3..c921ec32c232 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1228,7 +1228,10 @@ static void rtl8169_hw_phy_config(struct net_device *dev)
1228 return; 1228 return;
1229 } 1229 }
1230 1230
1231 /* phy config for RTL8169s mac_version C chip */ 1231 if ((tp->mac_version != RTL_GIGA_MAC_VER_02) &&
1232 (tp->mac_version != RTL_GIGA_MAC_VER_03))
1233 return;
1234
1232 mdio_write(ioaddr, 31, 0x0001); //w 31 2 0 1 1235 mdio_write(ioaddr, 31, 0x0001); //w 31 2 0 1
1233 mdio_write(ioaddr, 21, 0x1000); //w 21 15 0 1000 1236 mdio_write(ioaddr, 21, 0x1000); //w 21 15 0 1000
1234 mdio_write(ioaddr, 24, 0x65c7); //w 24 15 0 65c7 1237 mdio_write(ioaddr, 24, 0x65c7); //w 24 15 0 65c7
@@ -2567,6 +2570,15 @@ static void rtl8169_tx_interrupt(struct net_device *dev,
2567 (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS)) { 2570 (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS)) {
2568 netif_wake_queue(dev); 2571 netif_wake_queue(dev);
2569 } 2572 }
2573 /*
2574 * 8168 hack: TxPoll requests are lost when the Tx packets are
2575 * too close. Let's kick an extra TxPoll request when a burst
2576 * of start_xmit activity is detected (if it is not detected,
2577 * it is slow enough). -- FR
2578 */
2579 smp_rmb();
2580 if (tp->cur_tx != dirty_tx)
2581 RTL_W8(TxPoll, NPQ);
2570 } 2582 }
2571} 2583}
2572 2584
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index eaffe551d1d8..0792031a5cf9 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -338,6 +338,16 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
338 if (!(hw->flags & SKY2_HW_GIGABIT)) { 338 if (!(hw->flags & SKY2_HW_GIGABIT)) {
339 /* enable automatic crossover */ 339 /* enable automatic crossover */
340 ctrl |= PHY_M_PC_MDI_XMODE(PHY_M_PC_ENA_AUTO) >> 1; 340 ctrl |= PHY_M_PC_MDI_XMODE(PHY_M_PC_ENA_AUTO) >> 1;
341
342 if (hw->chip_id == CHIP_ID_YUKON_FE_P &&
343 hw->chip_rev == CHIP_REV_YU_FE2_A0) {
344 u16 spec;
345
346 /* Enable Class A driver for FE+ A0 */
347 spec = gm_phy_read(hw, port, PHY_MARV_FE_SPEC_2);
348 spec |= PHY_M_FESC_SEL_CL_A;
349 gm_phy_write(hw, port, PHY_MARV_FE_SPEC_2, spec);
350 }
341 } else { 351 } else {
342 /* disable energy detect */ 352 /* disable energy detect */
343 ctrl &= ~PHY_M_PC_EN_DET_MSK; 353 ctrl &= ~PHY_M_PC_EN_DET_MSK;
@@ -816,7 +826,8 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port)
816 sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_CLR); 826 sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_CLR);
817 sky2_write16(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_OPER_ON); 827 sky2_write16(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_OPER_ON);
818 828
819 if (!(hw->flags & SKY2_HW_RAMBUFFER)) { 829 /* On chips without ram buffer, pause is controled by MAC level */
830 if (sky2_read8(hw, B2_E_0) == 0) {
820 sky2_write8(hw, SK_REG(port, RX_GMF_LP_THR), 768/8); 831 sky2_write8(hw, SK_REG(port, RX_GMF_LP_THR), 768/8);
821 sky2_write8(hw, SK_REG(port, RX_GMF_UP_THR), 1024/8); 832 sky2_write8(hw, SK_REG(port, RX_GMF_UP_THR), 1024/8);
822 833
@@ -1271,7 +1282,7 @@ static int sky2_up(struct net_device *dev)
1271 struct sky2_port *sky2 = netdev_priv(dev); 1282 struct sky2_port *sky2 = netdev_priv(dev);
1272 struct sky2_hw *hw = sky2->hw; 1283 struct sky2_hw *hw = sky2->hw;
1273 unsigned port = sky2->port; 1284 unsigned port = sky2->port;
1274 u32 imask; 1285 u32 imask, ramsize;
1275 int cap, err = -ENOMEM; 1286 int cap, err = -ENOMEM;
1276 struct net_device *otherdev = hw->dev[sky2->port^1]; 1287 struct net_device *otherdev = hw->dev[sky2->port^1];
1277 1288
@@ -1326,13 +1337,12 @@ static int sky2_up(struct net_device *dev)
1326 1337
1327 sky2_mac_init(hw, port); 1338 sky2_mac_init(hw, port);
1328 1339
1329 if (hw->flags & SKY2_HW_RAMBUFFER) { 1340 /* Register is number of 4K blocks on internal RAM buffer. */
1330 /* Register is number of 4K blocks on internal RAM buffer. */ 1341 ramsize = sky2_read8(hw, B2_E_0) * 4;
1331 u32 ramsize = sky2_read8(hw, B2_E_0) * 4; 1342 if (ramsize > 0) {
1332 u32 rxspace; 1343 u32 rxspace;
1333 1344
1334 printk(KERN_DEBUG PFX "%s: ram buffer %dK\n", dev->name, ramsize); 1345 pr_debug(PFX "%s: ram buffer %dK\n", dev->name, ramsize);
1335
1336 if (ramsize < 16) 1346 if (ramsize < 16)
1337 rxspace = ramsize / 2; 1347 rxspace = ramsize / 2;
1338 else 1348 else
@@ -1995,7 +2005,7 @@ static int sky2_change_mtu(struct net_device *dev, int new_mtu)
1995 2005
1996 synchronize_irq(hw->pdev->irq); 2006 synchronize_irq(hw->pdev->irq);
1997 2007
1998 if (!(hw->flags & SKY2_HW_RAMBUFFER)) 2008 if (sky2_read8(hw, B2_E_0) == 0)
1999 sky2_set_tx_stfwd(hw, port); 2009 sky2_set_tx_stfwd(hw, port);
2000 2010
2001 ctl = gma_read16(hw, port, GM_GP_CTRL); 2011 ctl = gma_read16(hw, port, GM_GP_CTRL);
@@ -2526,7 +2536,7 @@ static void sky2_watchdog(unsigned long arg)
2526 ++active; 2536 ++active;
2527 2537
2528 /* For chips with Rx FIFO, check if stuck */ 2538 /* For chips with Rx FIFO, check if stuck */
2529 if ((hw->flags & SKY2_HW_RAMBUFFER) && 2539 if ((hw->flags & SKY2_HW_FIFO_HANG_CHECK) &&
2530 sky2_rx_hung(dev)) { 2540 sky2_rx_hung(dev)) {
2531 pr_info(PFX "%s: receiver hang detected\n", 2541 pr_info(PFX "%s: receiver hang detected\n",
2532 dev->name); 2542 dev->name);
@@ -2684,8 +2694,10 @@ static int __devinit sky2_init(struct sky2_hw *hw)
2684 switch(hw->chip_id) { 2694 switch(hw->chip_id) {
2685 case CHIP_ID_YUKON_XL: 2695 case CHIP_ID_YUKON_XL:
2686 hw->flags = SKY2_HW_GIGABIT 2696 hw->flags = SKY2_HW_GIGABIT
2687 | SKY2_HW_NEWER_PHY 2697 | SKY2_HW_NEWER_PHY;
2688 | SKY2_HW_RAMBUFFER; 2698 if (hw->chip_rev < 3)
2699 hw->flags |= SKY2_HW_FIFO_HANG_CHECK;
2700
2689 break; 2701 break;
2690 2702
2691 case CHIP_ID_YUKON_EC_U: 2703 case CHIP_ID_YUKON_EC_U:
@@ -2711,11 +2723,10 @@ static int __devinit sky2_init(struct sky2_hw *hw)
2711 dev_err(&hw->pdev->dev, "unsupported revision Yukon-EC rev A1\n"); 2723 dev_err(&hw->pdev->dev, "unsupported revision Yukon-EC rev A1\n");
2712 return -EOPNOTSUPP; 2724 return -EOPNOTSUPP;
2713 } 2725 }
2714 hw->flags = SKY2_HW_GIGABIT | SKY2_HW_RAMBUFFER; 2726 hw->flags = SKY2_HW_GIGABIT | SKY2_HW_FIFO_HANG_CHECK;
2715 break; 2727 break;
2716 2728
2717 case CHIP_ID_YUKON_FE: 2729 case CHIP_ID_YUKON_FE:
2718 hw->flags = SKY2_HW_RAMBUFFER;
2719 break; 2730 break;
2720 2731
2721 case CHIP_ID_YUKON_FE_P: 2732 case CHIP_ID_YUKON_FE_P:
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
index 69cd98400fe6..8bc5c54e3efa 100644
--- a/drivers/net/sky2.h
+++ b/drivers/net/sky2.h
@@ -2063,7 +2063,7 @@ struct sky2_hw {
2063#define SKY2_HW_FIBRE_PHY 0x00000002 2063#define SKY2_HW_FIBRE_PHY 0x00000002
2064#define SKY2_HW_GIGABIT 0x00000004 2064#define SKY2_HW_GIGABIT 0x00000004
2065#define SKY2_HW_NEWER_PHY 0x00000008 2065#define SKY2_HW_NEWER_PHY 0x00000008
2066#define SKY2_HW_RAMBUFFER 0x00000010 /* chip has RAM FIFO */ 2066#define SKY2_HW_FIFO_HANG_CHECK 0x00000010
2067#define SKY2_HW_NEW_LE 0x00000020 /* new LSOv2 format */ 2067#define SKY2_HW_NEW_LE 0x00000020 /* new LSOv2 format */
2068#define SKY2_HW_AUTO_TX_SUM 0x00000040 /* new IP decode for Tx */ 2068#define SKY2_HW_AUTO_TX_SUM 0x00000040 /* new IP decode for Tx */
2069#define SKY2_HW_ADV_POWER_CTL 0x00000080 /* additional PHY power regs */ 2069#define SKY2_HW_ADV_POWER_CTL 0x00000080 /* additional PHY power regs */
diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c
index c7c4574729b1..de3155b21285 100644
--- a/drivers/power/power_supply_sysfs.c
+++ b/drivers/power/power_supply_sysfs.c
@@ -289,6 +289,7 @@ int power_supply_uevent(struct device *dev, char **envp, int num_envp,
289 if (ret) 289 if (ret)
290 goto out; 290 goto out;
291 } 291 }
292 envp[i] = NULL;
292 293
293out: 294out:
294 free_page((unsigned long)prop_buf); 295 free_page((unsigned long)prop_buf);
diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c
index e348ba684050..ff610c23314b 100644
--- a/drivers/serial/sunsab.c
+++ b/drivers/serial/sunsab.c
@@ -38,7 +38,7 @@
38#include <asm/prom.h> 38#include <asm/prom.h>
39#include <asm/of_device.h> 39#include <asm/of_device.h>
40 40
41#if defined(CONFIG_SERIAL_SUNZILOG_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 41#if defined(CONFIG_SERIAL_SUNSAB_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
42#define SUPPORT_SYSRQ 42#define SUPPORT_SYSRQ
43#endif 43#endif
44 44
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index 8d7ab74170d5..a593f900eff4 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -431,6 +431,7 @@ static int w1_uevent(struct device *dev, char **envp, int num_envp,
431 err = add_uevent_var(envp, num_envp, &cur_index, buffer, buffer_size, 431 err = add_uevent_var(envp, num_envp, &cur_index, buffer, buffer_size,
432 &cur_len, "W1_SLAVE_ID=%024LX", 432 &cur_len, "W1_SLAVE_ID=%024LX",
433 (unsigned long long)sl->reg_num.id); 433 (unsigned long long)sl->reg_num.id);
434 envp[cur_index] = NULL;
434 if (err) 435 if (err)
435 return err; 436 return err;
436 437