aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/kernel/process.c7
-rw-r--r--drivers/acpi/sleep/Makefile2
-rw-r--r--drivers/acpi/sleep/main.c46
-rw-r--r--drivers/ata/pata_sis.c3
-rw-r--r--drivers/ata/sata_sil24.c16
-rw-r--r--drivers/char/hpet.c6
-rw-r--r--drivers/char/mspec.c26
-rw-r--r--drivers/input/mouse/appletouch.c6
-rw-r--r--drivers/lguest/lguest_asm.S6
-rw-r--r--drivers/net/pcmcia/3c589_cs.c2
-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/scsi/scsi_transport_spi.c28
-rw-r--r--drivers/w1/w1.c1
-rw-r--r--fs/compat_ioctl.c2
-rw-r--r--fs/ufs/super.c4
-rw-r--r--include/acpi/acpi_drivers.h4
-rw-r--r--lib/Kconfig.debug2
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_assoc.c2
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_wx.c54
21 files changed, 151 insertions, 119 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index e477c9d0498b..8a1b001d0b11 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -605,6 +605,13 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
605 regs->ccr = 0; 605 regs->ccr = 0;
606 regs->gpr[1] = sp; 606 regs->gpr[1] = sp;
607 607
608 /*
609 * We have just cleared all the nonvolatile GPRs, so make
610 * FULL_REGS(regs) return true. This is necessary to allow
611 * ptrace to examine the thread immediately after exec.
612 */
613 regs->trap &= ~1UL;
614
608#ifdef CONFIG_PPC32 615#ifdef CONFIG_PPC32
609 regs->mq = 0; 616 regs->mq = 0;
610 regs->nip = start; 617 regs->nip = start;
diff --git a/drivers/acpi/sleep/Makefile b/drivers/acpi/sleep/Makefile
index ba9bd403d443..f1fb888c2d29 100644
--- a/drivers/acpi/sleep/Makefile
+++ b/drivers/acpi/sleep/Makefile
@@ -1,5 +1,5 @@
1obj-y := 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 85633c585aab..2cbb9aabd00e 100644
--- a/drivers/acpi/sleep/main.c
+++ b/drivers/acpi/sleep/main.c
@@ -24,7 +24,30 @@
24 24
25u8 sleep_states[ACPI_S_STATE_COUNT]; 25u8 sleep_states[ACPI_S_STATE_COUNT];
26 26
27#ifdef CONFIG_PM_SLEEP
27static 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}
28 51
29#ifdef CONFIG_SUSPEND 52#ifdef CONFIG_SUSPEND
30static struct pm_ops acpi_pm_ops; 53static struct pm_ops acpi_pm_ops;
@@ -60,27 +83,6 @@ static int acpi_pm_set_target(suspend_state_t pm_state)
60 return error; 83 return error;
61} 84}
62 85
63int acpi_sleep_prepare(u32 acpi_state)
64{
65#ifdef CONFIG_ACPI_SLEEP
66 /* do we have a wakeup address for S2 and S3? */
67 if (acpi_state == ACPI_STATE_S3) {
68 if (!acpi_wakeup_address) {
69 return -EFAULT;
70 }
71 acpi_set_firmware_waking_vector((acpi_physical_address)
72 virt_to_phys((void *)
73 acpi_wakeup_address));
74
75 }
76 ACPI_FLUSH_CPU_CACHE();
77 acpi_enable_wakeup_device_prep(acpi_state);
78#endif
79 acpi_gpe_sleep_prepare(acpi_state);
80 acpi_enter_sleep_state_prep(acpi_state);
81 return 0;
82}
83
84/** 86/**
85 * acpi_pm_prepare - Do preliminary suspend work. 87 * acpi_pm_prepare - Do preliminary suspend work.
86 * @pm_state: ignored 88 * @pm_state: ignored
@@ -299,6 +301,7 @@ int acpi_suspend(u32 acpi_state)
299 return -EINVAL; 301 return -EINVAL;
300} 302}
301 303
304#ifdef CONFIG_PM_SLEEP
302/** 305/**
303 * 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
304 * in the system sleep state given by %acpi_target_sleep_state 307 * in the system sleep state given by %acpi_target_sleep_state
@@ -373,6 +376,7 @@ int acpi_pm_device_sleep_state(struct device *dev, int wake, int *d_min_p)
373 *d_min_p = d_min; 376 *d_min_p = d_min;
374 return d_max; 377 return d_max;
375} 378}
379#endif
376 380
377static void acpi_power_off_prepare(void) 381static void acpi_power_off_prepare(void)
378{ 382{
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/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/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/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/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/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/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c
index 6f56f8750635..4df21c92ff1e 100644
--- a/drivers/scsi/scsi_transport_spi.c
+++ b/drivers/scsi/scsi_transport_spi.c
@@ -787,10 +787,12 @@ spi_dv_device_internal(struct scsi_device *sdev, u8 *buffer)
787 struct scsi_target *starget = sdev->sdev_target; 787 struct scsi_target *starget = sdev->sdev_target;
788 struct Scsi_Host *shost = sdev->host; 788 struct Scsi_Host *shost = sdev->host;
789 int len = sdev->inquiry_len; 789 int len = sdev->inquiry_len;
790 int min_period = spi_min_period(starget);
791 int max_width = spi_max_width(starget);
790 /* first set us up for narrow async */ 792 /* first set us up for narrow async */
791 DV_SET(offset, 0); 793 DV_SET(offset, 0);
792 DV_SET(width, 0); 794 DV_SET(width, 0);
793 795
794 if (spi_dv_device_compare_inquiry(sdev, buffer, buffer, DV_LOOPS) 796 if (spi_dv_device_compare_inquiry(sdev, buffer, buffer, DV_LOOPS)
795 != SPI_COMPARE_SUCCESS) { 797 != SPI_COMPARE_SUCCESS) {
796 starget_printk(KERN_ERR, starget, "Domain Validation Initial Inquiry Failed\n"); 798 starget_printk(KERN_ERR, starget, "Domain Validation Initial Inquiry Failed\n");
@@ -798,9 +800,13 @@ spi_dv_device_internal(struct scsi_device *sdev, u8 *buffer)
798 return; 800 return;
799 } 801 }
800 802
803 if (!scsi_device_wide(sdev)) {
804 spi_max_width(starget) = 0;
805 max_width = 0;
806 }
807
801 /* test width */ 808 /* test width */
802 if (i->f->set_width && spi_max_width(starget) && 809 if (i->f->set_width && max_width) {
803 scsi_device_wide(sdev)) {
804 i->f->set_width(starget, 1); 810 i->f->set_width(starget, 1);
805 811
806 if (spi_dv_device_compare_inquiry(sdev, buffer, 812 if (spi_dv_device_compare_inquiry(sdev, buffer,
@@ -809,6 +815,11 @@ spi_dv_device_internal(struct scsi_device *sdev, u8 *buffer)
809 != SPI_COMPARE_SUCCESS) { 815 != SPI_COMPARE_SUCCESS) {
810 starget_printk(KERN_ERR, starget, "Wide Transfers Fail\n"); 816 starget_printk(KERN_ERR, starget, "Wide Transfers Fail\n");
811 i->f->set_width(starget, 0); 817 i->f->set_width(starget, 0);
818 /* Make sure we don't force wide back on by asking
819 * for a transfer period that requires it */
820 max_width = 0;
821 if (min_period < 10)
822 min_period = 10;
812 } 823 }
813 } 824 }
814 825
@@ -828,7 +839,8 @@ spi_dv_device_internal(struct scsi_device *sdev, u8 *buffer)
828 839
829 /* now set up to the maximum */ 840 /* now set up to the maximum */
830 DV_SET(offset, spi_max_offset(starget)); 841 DV_SET(offset, spi_max_offset(starget));
831 DV_SET(period, spi_min_period(starget)); 842 DV_SET(period, min_period);
843
832 /* try QAS requests; this should be harmless to set if the 844 /* try QAS requests; this should be harmless to set if the
833 * target supports it */ 845 * target supports it */
834 if (scsi_device_qas(sdev)) { 846 if (scsi_device_qas(sdev)) {
@@ -837,14 +849,14 @@ spi_dv_device_internal(struct scsi_device *sdev, u8 *buffer)
837 DV_SET(qas, 0); 849 DV_SET(qas, 0);
838 } 850 }
839 851
840 if (scsi_device_ius(sdev) && spi_min_period(starget) < 9) { 852 if (scsi_device_ius(sdev) && min_period < 9) {
841 /* This u320 (or u640). Set IU transfers */ 853 /* This u320 (or u640). Set IU transfers */
842 DV_SET(iu, 1); 854 DV_SET(iu, 1);
843 /* Then set the optional parameters */ 855 /* Then set the optional parameters */
844 DV_SET(rd_strm, 1); 856 DV_SET(rd_strm, 1);
845 DV_SET(wr_flow, 1); 857 DV_SET(wr_flow, 1);
846 DV_SET(rti, 1); 858 DV_SET(rti, 1);
847 if (spi_min_period(starget) == 8) 859 if (min_period == 8)
848 DV_SET(pcomp_en, 1); 860 DV_SET(pcomp_en, 1);
849 } else { 861 } else {
850 DV_SET(iu, 0); 862 DV_SET(iu, 0);
@@ -862,6 +874,10 @@ spi_dv_device_internal(struct scsi_device *sdev, u8 *buffer)
862 } else { 874 } else {
863 DV_SET(dt, 1); 875 DV_SET(dt, 1);
864 } 876 }
877 /* set width last because it will pull all the other
878 * parameters down to required values */
879 DV_SET(width, max_width);
880
865 /* Do the read only INQUIRY tests */ 881 /* Do the read only INQUIRY tests */
866 spi_dv_retrain(sdev, buffer, buffer + sdev->inquiry_len, 882 spi_dv_retrain(sdev, buffer, buffer + sdev->inquiry_len,
867 spi_dv_device_compare_inquiry); 883 spi_dv_device_compare_inquiry);
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
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 5a5b7116cefb..37310b0e8107 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -3190,6 +3190,8 @@ COMPATIBLE_IOCTL(SIOCSIWRETRY)
3190COMPATIBLE_IOCTL(SIOCGIWRETRY) 3190COMPATIBLE_IOCTL(SIOCGIWRETRY)
3191COMPATIBLE_IOCTL(SIOCSIWPOWER) 3191COMPATIBLE_IOCTL(SIOCSIWPOWER)
3192COMPATIBLE_IOCTL(SIOCGIWPOWER) 3192COMPATIBLE_IOCTL(SIOCGIWPOWER)
3193COMPATIBLE_IOCTL(SIOCSIWAUTH)
3194COMPATIBLE_IOCTL(SIOCGIWAUTH)
3193/* hiddev */ 3195/* hiddev */
3194COMPATIBLE_IOCTL(HIDIOCGVERSION) 3196COMPATIBLE_IOCTL(HIDIOCGVERSION)
3195COMPATIBLE_IOCTL(HIDIOCAPPLICATION) 3197COMPATIBLE_IOCTL(HIDIOCAPPLICATION)
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index 73402c5eeb8a..38eb0b7a1f3d 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -894,7 +894,7 @@ magic_found:
894 goto again; 894 goto again;
895 } 895 }
896 896
897 897 sbi->s_flags = flags;/*after that line some functions use s_flags*/
898 ufs_print_super_stuff(sb, usb1, usb2, usb3); 898 ufs_print_super_stuff(sb, usb1, usb2, usb3);
899 899
900 /* 900 /*
@@ -1025,8 +1025,6 @@ magic_found:
1025 UFS_MOUNT_UFSTYPE_44BSD) 1025 UFS_MOUNT_UFSTYPE_44BSD)
1026 uspi->s_maxsymlinklen = 1026 uspi->s_maxsymlinklen =
1027 fs32_to_cpu(sb, usb3->fs_un2.fs_44.fs_maxsymlinklen); 1027 fs32_to_cpu(sb, usb3->fs_un2.fs_44.fs_maxsymlinklen);
1028
1029 sbi->s_flags = flags;
1030 1028
1031 inode = iget(sb, UFS_ROOTINO); 1029 inode = iget(sb, UFS_ROOTINO);
1032 if (!inode || is_bad_inode(inode)) 1030 if (!inode || is_bad_inode(inode))
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index 202acb9ff4d0..f85f77a538aa 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -147,10 +147,6 @@ static inline void unregister_hotplug_dock_device(acpi_handle handle)
147/*-------------------------------------------------------------------------- 147/*--------------------------------------------------------------------------
148 Suspend/Resume 148 Suspend/Resume
149 -------------------------------------------------------------------------- */ 149 -------------------------------------------------------------------------- */
150#ifdef CONFIG_ACPI_SLEEP
151extern int acpi_sleep_init(void); 150extern int acpi_sleep_init(void);
152#else
153static inline int acpi_sleep_init(void) { return 0; }
154#endif
155 151
156#endif /*__ACPI_DRIVERS_H__*/ 152#endif /*__ACPI_DRIVERS_H__*/
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 50a94eee4d92..495863a500cd 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -284,7 +284,7 @@ config LOCKDEP
284 select KALLSYMS_ALL 284 select KALLSYMS_ALL
285 285
286config LOCK_STAT 286config LOCK_STAT
287 bool "Lock usage statisitics" 287 bool "Lock usage statistics"
288 depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT 288 depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
289 select LOCKDEP 289 select LOCKDEP
290 select DEBUG_SPINLOCK 290 select DEBUG_SPINLOCK
diff --git a/net/ieee80211/softmac/ieee80211softmac_assoc.c b/net/ieee80211/softmac/ieee80211softmac_assoc.c
index afb6c6698b27..e475f2e1be13 100644
--- a/net/ieee80211/softmac/ieee80211softmac_assoc.c
+++ b/net/ieee80211/softmac/ieee80211softmac_assoc.c
@@ -273,8 +273,6 @@ ieee80211softmac_assoc_work(struct work_struct *work)
273 ieee80211softmac_notify(mac->dev, IEEE80211SOFTMAC_EVENT_SCAN_FINISHED, ieee80211softmac_assoc_notify_scan, NULL); 273 ieee80211softmac_notify(mac->dev, IEEE80211SOFTMAC_EVENT_SCAN_FINISHED, ieee80211softmac_assoc_notify_scan, NULL);
274 if (ieee80211softmac_start_scan(mac)) { 274 if (ieee80211softmac_start_scan(mac)) {
275 dprintk(KERN_INFO PFX "Associate: failed to initiate scan. Is device up?\n"); 275 dprintk(KERN_INFO PFX "Associate: failed to initiate scan. Is device up?\n");
276 mac->associnfo.associating = 0;
277 mac->associnfo.associated = 0;
278 } 276 }
279 goto out; 277 goto out;
280 } else { 278 } else {
diff --git a/net/ieee80211/softmac/ieee80211softmac_wx.c b/net/ieee80211/softmac/ieee80211softmac_wx.c
index d054e9224b3e..442b9875f3fb 100644
--- a/net/ieee80211/softmac/ieee80211softmac_wx.c
+++ b/net/ieee80211/softmac/ieee80211softmac_wx.c
@@ -70,44 +70,30 @@ ieee80211softmac_wx_set_essid(struct net_device *net_dev,
70 char *extra) 70 char *extra)
71{ 71{
72 struct ieee80211softmac_device *sm = ieee80211_priv(net_dev); 72 struct ieee80211softmac_device *sm = ieee80211_priv(net_dev);
73 struct ieee80211softmac_network *n;
74 struct ieee80211softmac_auth_queue_item *authptr; 73 struct ieee80211softmac_auth_queue_item *authptr;
75 int length = 0; 74 int length = 0;
76 75
77check_assoc_again: 76check_assoc_again:
78 mutex_lock(&sm->associnfo.mutex); 77 mutex_lock(&sm->associnfo.mutex);
79 /* Check if we're already associating to this or another network
80 * If it's another network, cancel and start over with our new network
81 * If it's our network, ignore the change, we're already doing it!
82 */
83 if((sm->associnfo.associating || sm->associnfo.associated) && 78 if((sm->associnfo.associating || sm->associnfo.associated) &&
84 (data->essid.flags && data->essid.length)) { 79 (data->essid.flags && data->essid.length)) {
85 /* Get the associating network */ 80 dprintk(KERN_INFO PFX "Canceling existing associate request!\n");
86 n = ieee80211softmac_get_network_by_bssid(sm, sm->associnfo.bssid); 81 /* Cancel assoc work */
87 if(n && n->essid.len == data->essid.length && 82 cancel_delayed_work(&sm->associnfo.work);
88 !memcmp(n->essid.data, extra, n->essid.len)) { 83 /* We don't have to do this, but it's a little cleaner */
89 dprintk(KERN_INFO PFX "Already associating or associated to "MAC_FMT"\n", 84 list_for_each_entry(authptr, &sm->auth_queue, list)
90 MAC_ARG(sm->associnfo.bssid)); 85 cancel_delayed_work(&authptr->work);
91 goto out; 86 sm->associnfo.bssvalid = 0;
92 } else { 87 sm->associnfo.bssfixed = 0;
93 dprintk(KERN_INFO PFX "Canceling existing associate request!\n"); 88 sm->associnfo.associating = 0;
94 /* Cancel assoc work */ 89 sm->associnfo.associated = 0;
95 cancel_delayed_work(&sm->associnfo.work); 90 /* We must unlock to avoid deadlocks with the assoc workqueue
96 /* We don't have to do this, but it's a little cleaner */ 91 * on the associnfo.mutex */
97 list_for_each_entry(authptr, &sm->auth_queue, list) 92 mutex_unlock(&sm->associnfo.mutex);
98 cancel_delayed_work(&authptr->work); 93 flush_scheduled_work();
99 sm->associnfo.bssvalid = 0; 94 /* Avoid race! Check assoc status again. Maybe someone started an
100 sm->associnfo.bssfixed = 0; 95 * association while we flushed. */
101 sm->associnfo.associating = 0; 96 goto check_assoc_again;
102 sm->associnfo.associated = 0;
103 /* We must unlock to avoid deadlocks with the assoc workqueue
104 * on the associnfo.mutex */
105 mutex_unlock(&sm->associnfo.mutex);
106 flush_scheduled_work();
107 /* Avoid race! Check assoc status again. Maybe someone started an
108 * association while we flushed. */
109 goto check_assoc_again;
110 }
111 } 97 }
112 98
113 sm->associnfo.static_essid = 0; 99 sm->associnfo.static_essid = 0;
@@ -153,13 +139,13 @@ ieee80211softmac_wx_get_essid(struct net_device *net_dev,
153 data->essid.length = sm->associnfo.req_essid.len; 139 data->essid.length = sm->associnfo.req_essid.len;
154 data->essid.flags = 1; /* active */ 140 data->essid.flags = 1; /* active */
155 memcpy(extra, sm->associnfo.req_essid.data, sm->associnfo.req_essid.len); 141 memcpy(extra, sm->associnfo.req_essid.data, sm->associnfo.req_essid.len);
156 } 142 dprintk(KERN_INFO PFX "Getting essid from req_essid\n");
157 143 } else if (sm->associnfo.associated || sm->associnfo.associating) {
158 /* If we're associating/associated, return that */ 144 /* If we're associating/associated, return that */
159 if (sm->associnfo.associated || sm->associnfo.associating) {
160 data->essid.length = sm->associnfo.associate_essid.len; 145 data->essid.length = sm->associnfo.associate_essid.len;
161 data->essid.flags = 1; /* active */ 146 data->essid.flags = 1; /* active */
162 memcpy(extra, sm->associnfo.associate_essid.data, sm->associnfo.associate_essid.len); 147 memcpy(extra, sm->associnfo.associate_essid.data, sm->associnfo.associate_essid.len);
148 dprintk(KERN_INFO PFX "Getting essid from associate_essid\n");
163 } 149 }
164 mutex_unlock(&sm->associnfo.mutex); 150 mutex_unlock(&sm->associnfo.mutex);
165 151