aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MAINTAINERS20
-rw-r--r--arch/i386/kernel/process.c7
-rw-r--r--arch/i386/pci/common.c4
-rw-r--r--arch/i386/pci/direct.c2
-rw-r--r--arch/i386/pci/i386.c7
-rw-r--r--arch/ia64/kernel/process.c7
-rw-r--r--arch/powerpc/kernel/process.c1
-rw-r--r--arch/powerpc/mm/4xx_mmu.c4
-rw-r--r--arch/powerpc/mm/hugetlbpage.c10
-rw-r--r--arch/powerpc/mm/mem.c2
-rw-r--r--arch/powerpc/mm/tlb_32.c6
-rw-r--r--arch/powerpc/mm/tlb_64.c4
-rw-r--r--arch/x86_64/kernel/process.c7
-rw-r--r--drivers/base/bus.c21
-rw-r--r--drivers/base/dd.c8
-rw-r--r--drivers/block/floppy.c6
-rw-r--r--drivers/char/drm/drm_memory.c2
-rw-r--r--drivers/char/drm/drm_memory_debug.h2
-rw-r--r--drivers/char/drm/mga_drv.c2
-rw-r--r--drivers/char/drm/radeon_drv.h3
-rw-r--r--drivers/hwmon/hdaps.c2
-rw-r--r--drivers/hwmon/it87.c7
-rw-r--r--drivers/hwmon/lm78.c2
-rw-r--r--drivers/hwmon/w83627hf.c8
-rw-r--r--drivers/pci/hotplug/pciehp.h1
-rw-r--r--drivers/pci/hotplug/pciehp_ctrl.c15
-rw-r--r--drivers/pci/hotplug/pciehp_hpc.c10
-rw-r--r--drivers/pci/pci-acpi.c1
-rw-r--r--drivers/usb/core/hcd-pci.c38
-rw-r--r--drivers/usb/core/hub.c1
-rw-r--r--drivers/usb/host/ehci-hcd.c160
-rw-r--r--drivers/usb/host/ehci-hub.c7
-rw-r--r--drivers/usb/host/ehci-pci.c359
-rw-r--r--drivers/usb/host/ohci-pci.c36
-rw-r--r--drivers/usb/media/sn9c102_core.c2
-rw-r--r--drivers/usb/serial/ftdi_sio.c2
-rw-r--r--drivers/usb/serial/ftdi_sio.h7
-rw-r--r--drivers/usb/serial/ipw.c1
-rw-r--r--drivers/usb/storage/unusual_devs.h9
-rw-r--r--drivers/video/fbmem.c6
-rw-r--r--fs/exec.c8
-rw-r--r--fs/jffs2/debug.h8
-rw-r--r--include/asm-alpha/atomic.h7
-rw-r--r--include/asm-arm/arch-iop3xx/timex.h2
-rw-r--r--include/asm-powerpc/page_64.h6
-rw-r--r--include/asm-sparc64/atomic.h1
-rw-r--r--include/asm-x86_64/atomic.h51
-rw-r--r--include/linux/smp.h8
-rw-r--r--include/linux/usb.h1
-rw-r--r--kernel/futex.c15
-rw-r--r--kernel/irq/manage.c15
-rw-r--r--kernel/printk.c2
-rw-r--r--mm/Kconfig6
-rw-r--r--mm/truncate.c6
-rw-r--r--net/bridge/br_if.c1
-rw-r--r--net/ipv4/netfilter/ip_conntrack_netlink.c1
56 files changed, 485 insertions, 452 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index c5cf7d7e58b2..a74a0c726134 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -58,7 +58,7 @@ P: Person
58M: Mail patches to 58M: Mail patches to
59L: Mailing list that is relevant to this area 59L: Mailing list that is relevant to this area
60W: Web-page with status/info 60W: Web-page with status/info
61T: SCM tree type and URL. Type is one of: git, hg, quilt. 61T: SCM tree type and location. Type is one of: git, hg, quilt.
62S: Status, one of the following: 62S: Status, one of the following:
63 63
64 Supported: Someone is actually paid to look after this. 64 Supported: Someone is actually paid to look after this.
@@ -227,6 +227,7 @@ AGPGART DRIVER
227P: Dave Jones 227P: Dave Jones
228M: davej@codemonkey.org.uk 228M: davej@codemonkey.org.uk
229W: http://www.codemonkey.org.uk/projects/agp/ 229W: http://www.codemonkey.org.uk/projects/agp/
230T: git kernel.org:/pub/scm/linux/kernel/git/davej/agpgart.git
230S: Maintained 231S: Maintained
231 232
232AHA152X SCSI DRIVER 233AHA152X SCSI DRIVER
@@ -384,6 +385,7 @@ P: David Woodhouse
384M: dwmw2@infradead.org 385M: dwmw2@infradead.org
385L: linux-audit@redhat.com 386L: linux-audit@redhat.com
386W: http://people.redhat.com/sgrubb/audit/ 387W: http://people.redhat.com/sgrubb/audit/
388T: git kernel.org:/pub/scm/linux/kernel/git/dwmw2/audit-2.6.git
387S: Maintained 389S: Maintained
388 390
389AX.25 NETWORK LAYER 391AX.25 NETWORK LAYER
@@ -432,6 +434,7 @@ L: bluez-devel@lists.sf.net
432W: http://bluez.sf.net 434W: http://bluez.sf.net
433W: http://www.bluez.org 435W: http://www.bluez.org
434W: http://www.holtmann.org/linux/bluetooth/ 436W: http://www.holtmann.org/linux/bluetooth/
437T: git kernel.org:/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6.git
435S: Maintained 438S: Maintained
436 439
437BLUETOOTH RFCOMM LAYER 440BLUETOOTH RFCOMM LAYER
@@ -547,6 +550,7 @@ P: Steve French
547M: sfrench@samba.org 550M: sfrench@samba.org
548L: samba-technical@lists.samba.org 551L: samba-technical@lists.samba.org
549W: http://us1.samba.org/samba/Linux_CIFS_client.html 552W: http://us1.samba.org/samba/Linux_CIFS_client.html
553T: git kernel.org:/pub/scm/linux/kernel/git/sfrench/cifs-2.6.git
550S: Supported 554S: Supported
551 555
552CIRRUS LOGIC GENERIC FBDEV DRIVER 556CIRRUS LOGIC GENERIC FBDEV DRIVER
@@ -608,6 +612,7 @@ P: Dave Jones
608M: davej@codemonkey.org.uk 612M: davej@codemonkey.org.uk
609L: cpufreq@lists.linux.org.uk 613L: cpufreq@lists.linux.org.uk
610W: http://www.codemonkey.org.uk/projects/cpufreq/ 614W: http://www.codemonkey.org.uk/projects/cpufreq/
615T: git kernel.org/pub/scm/linux/kernel/davej/cpufreq.git
611S: Maintained 616S: Maintained
612 617
613CPUID/MSR DRIVER 618CPUID/MSR DRIVER
@@ -641,6 +646,7 @@ M: herbert@gondor.apana.org.au
641P: David S. Miller 646P: David S. Miller
642M: davem@davemloft.net 647M: davem@davemloft.net
643L: linux-crypto@vger.kernel.org 648L: linux-crypto@vger.kernel.org
649T: git kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6.git
644S: Maintained 650S: Maintained
645 651
646CYBERPRO FB DRIVER 652CYBERPRO FB DRIVER
@@ -1185,6 +1191,7 @@ P: Bartlomiej Zolnierkiewicz
1185M: B.Zolnierkiewicz@elka.pw.edu.pl 1191M: B.Zolnierkiewicz@elka.pw.edu.pl
1186L: linux-kernel@vger.kernel.org 1192L: linux-kernel@vger.kernel.org
1187L: linux-ide@vger.kernel.org 1193L: linux-ide@vger.kernel.org
1194T: git kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6.git
1188S: Maintained 1195S: Maintained
1189 1196
1190IDE/ATAPI CDROM DRIVER 1197IDE/ATAPI CDROM DRIVER
@@ -1279,6 +1286,7 @@ P: Vojtech Pavlik
1279M: vojtech@suse.cz 1286M: vojtech@suse.cz
1280L: linux-input@atrey.karlin.mff.cuni.cz 1287L: linux-input@atrey.karlin.mff.cuni.cz
1281L: linux-joystick@atrey.karlin.mff.cuni.cz 1288L: linux-joystick@atrey.karlin.mff.cuni.cz
1289T: git kernel.org:/pub/scm/linux/kernel/git/dtor/input.git
1282S: Maintained 1290S: Maintained
1283 1291
1284INOTIFY 1292INOTIFY
@@ -1392,6 +1400,7 @@ P: Kai Germaschewski
1392M: kai.germaschewski@gmx.de 1400M: kai.germaschewski@gmx.de
1393L: isdn4linux@listserv.isdn4linux.de 1401L: isdn4linux@listserv.isdn4linux.de
1394W: http://www.isdn4linux.de 1402W: http://www.isdn4linux.de
1403T: git kernel.org:/pub/scm/linux/kernel/kkeil/isdn-2.6.git
1395S: Maintained 1404S: Maintained
1396 1405
1397ISDN SUBSYSTEM (Eicon active card driver) 1406ISDN SUBSYSTEM (Eicon active card driver)
@@ -1420,6 +1429,7 @@ P: Dave Kleikamp
1420M: shaggy@austin.ibm.com 1429M: shaggy@austin.ibm.com
1421L: jfs-discussion@lists.sourceforge.net 1430L: jfs-discussion@lists.sourceforge.net
1422W: http://jfs.sourceforge.net/ 1431W: http://jfs.sourceforge.net/
1432T: git kernel.org:/pub/scm/linux/kernel/git/shaggy/jfs-2.6.git
1423S: Supported 1433S: Supported
1424 1434
1425KCONFIG 1435KCONFIG
@@ -1534,6 +1544,7 @@ P: Paul Mackerras
1534M: paulus@samba.org 1544M: paulus@samba.org
1535W: http://www.penguinppc.org/ 1545W: http://www.penguinppc.org/
1536L: linuxppc-dev@ozlabs.org 1546L: linuxppc-dev@ozlabs.org
1547T: git kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc.git
1537S: Supported 1548S: Supported
1538 1549
1539LINUX FOR POWER MACINTOSH 1550LINUX FOR POWER MACINTOSH
@@ -1601,6 +1612,7 @@ P: Chris Wright
1601M: chrisw@osdl.org 1612M: chrisw@osdl.org
1602L: linux-security-module@wirex.com 1613L: linux-security-module@wirex.com
1603W: http://lsm.immunix.org 1614W: http://lsm.immunix.org
1615T: git kernel.org:/pub/scm/linux/kernel/git/chrisw/lsm-2.6.git
1604S: Supported 1616S: Supported
1605 1617
1606LM83 HARDWARE MONITOR DRIVER 1618LM83 HARDWARE MONITOR DRIVER
@@ -1695,6 +1707,7 @@ P: David Woodhouse
1695M: dwmw2@infradead.org 1707M: dwmw2@infradead.org
1696W: http://www.linux-mtd.infradead.org/ 1708W: http://www.linux-mtd.infradead.org/
1697L: linux-mtd@lists.infradead.org 1709L: linux-mtd@lists.infradead.org
1710T: git kernel.org:/pub/scm/linux/kernel/git/tglx/mtd-2.6.git
1698S: Maintained 1711S: Maintained
1699 1712
1700MICROTEK X6 SCANNER 1713MICROTEK X6 SCANNER
@@ -1815,6 +1828,7 @@ M: yoshfuji@linux-ipv6.org
1815P: Patrick McHardy 1828P: Patrick McHardy
1816M: kaber@coreworks.de 1829M: kaber@coreworks.de
1817L: netdev@vger.kernel.org 1830L: netdev@vger.kernel.org
1831T: git kernel.org:/pub/scm/linux/kernel/davem/net-2.6.git
1818S: Maintained 1832S: Maintained
1819 1833
1820IPVS 1834IPVS
@@ -1866,6 +1880,7 @@ M: aia21@cantab.net
1866L: linux-ntfs-dev@lists.sourceforge.net 1880L: linux-ntfs-dev@lists.sourceforge.net
1867L: linux-kernel@vger.kernel.org 1881L: linux-kernel@vger.kernel.org
1868W: http://linux-ntfs.sf.net/ 1882W: http://linux-ntfs.sf.net/
1883T: git kernel.org:/pub/scm/linux/kernel/git/aia21/ntfs-2.6.git
1869S: Maintained 1884S: Maintained
1870 1885
1871NVIDIA (RIVA) FRAMEBUFFER DRIVER 1886NVIDIA (RIVA) FRAMEBUFFER DRIVER
@@ -2389,6 +2404,7 @@ P: Anton Blanchard
2389M: anton@samba.org 2404M: anton@samba.org
2390L: sparclinux@vger.kernel.org 2405L: sparclinux@vger.kernel.org
2391L: ultralinux@vger.kernel.org 2406L: ultralinux@vger.kernel.org
2407T: git kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6.git
2392S: Maintained 2408S: Maintained
2393 2409
2394SHARP LH SUPPORT (LH7952X & LH7A40X) 2410SHARP LH SUPPORT (LH7952X & LH7A40X)
@@ -2527,6 +2543,7 @@ P: Adrian Bunk
2527M: trivial@kernel.org 2543M: trivial@kernel.org
2528L: linux-kernel@vger.kernel.org 2544L: linux-kernel@vger.kernel.org
2529W: http://www.kernel.org/pub/linux/kernel/people/bunk/trivial/ 2545W: http://www.kernel.org/pub/linux/kernel/people/bunk/trivial/
2546T: git kernel.org:/pub/scm/linux/kernel/git/bunk/trivial.git
2530S: Maintained 2547S: Maintained
2531 2548
2532TMS380 TOKEN-RING NETWORK DRIVER 2549TMS380 TOKEN-RING NETWORK DRIVER
@@ -2860,6 +2877,7 @@ P: Latchesar Ionkov
2860M: lucho@ionkov.net 2877M: lucho@ionkov.net
2861L: v9fs-developer@lists.sourceforge.net 2878L: v9fs-developer@lists.sourceforge.net
2862W: http://v9fs.sf.net 2879W: http://v9fs.sf.net
2880T: git kernel.org:/pub/scm/linux/kernel/ericvh/v9fs-devel.git
2863S: Maintained 2881S: Maintained
2864 2882
2865VIDEO FOR LINUX 2883VIDEO FOR LINUX
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
index 1cb261f225d5..df6c2bcde067 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -393,13 +393,6 @@ void flush_thread(void)
393{ 393{
394 struct task_struct *tsk = current; 394 struct task_struct *tsk = current;
395 395
396 /*
397 * Remove function-return probe instances associated with this task
398 * and put them back on the free list. Do not insert an exit probe for
399 * this function, it will be disabled by kprobe_flush_task if you do.
400 */
401 kprobe_flush_task(tsk);
402
403 memset(tsk->thread.debugreg, 0, sizeof(unsigned long)*8); 396 memset(tsk->thread.debugreg, 0, sizeof(unsigned long)*8);
404 memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array)); 397 memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array));
405 /* 398 /*
diff --git a/arch/i386/pci/common.c b/arch/i386/pci/common.c
index c96bea14b98f..f6bc48da4d2a 100644
--- a/arch/i386/pci/common.c
+++ b/arch/i386/pci/common.c
@@ -132,7 +132,7 @@ struct pci_bus * __devinit pcibios_scan_root(int busnum)
132 } 132 }
133 } 133 }
134 134
135 printk("PCI: Probing PCI hardware (bus %02x)\n", busnum); 135 printk(KERN_DEBUG "PCI: Probing PCI hardware (bus %02x)\n", busnum);
136 136
137 return pci_scan_bus_parented(NULL, busnum, &pci_root_ops, NULL); 137 return pci_scan_bus_parented(NULL, busnum, &pci_root_ops, NULL);
138} 138}
@@ -144,7 +144,7 @@ static int __init pcibios_init(void)
144 struct cpuinfo_x86 *c = &boot_cpu_data; 144 struct cpuinfo_x86 *c = &boot_cpu_data;
145 145
146 if (!raw_pci_ops) { 146 if (!raw_pci_ops) {
147 printk("PCI: System does not support PCI\n"); 147 printk(KERN_WARNING "PCI: System does not support PCI\n");
148 return 0; 148 return 0;
149 } 149 }
150 150
diff --git a/arch/i386/pci/direct.c b/arch/i386/pci/direct.c
index 30b7e9b4f6a2..94331d6be7a3 100644
--- a/arch/i386/pci/direct.c
+++ b/arch/i386/pci/direct.c
@@ -201,7 +201,7 @@ static int __init pci_sanity_check(struct pci_raw_ops *o)
201 return 1; 201 return 1;
202 } 202 }
203 203
204 DBG("PCI: Sanity check failed\n"); 204 DBG(KERN_WARNING "PCI: Sanity check failed\n");
205 return 0; 205 return 0;
206} 206}
207 207
diff --git a/arch/i386/pci/i386.c b/arch/i386/pci/i386.c
index 6d6338500c3c..ed2c8c899bd3 100644
--- a/arch/i386/pci/i386.c
+++ b/arch/i386/pci/i386.c
@@ -221,6 +221,11 @@ int pcibios_enable_resources(struct pci_dev *dev, int mask)
221 continue; 221 continue;
222 222
223 r = &dev->resource[idx]; 223 r = &dev->resource[idx];
224 if (!(r->flags & (IORESOURCE_IO | IORESOURCE_MEM)))
225 continue;
226 if ((idx == PCI_ROM_RESOURCE) &&
227 (!(r->flags & IORESOURCE_ROM_ENABLE)))
228 continue;
224 if (!r->start && r->end) { 229 if (!r->start && r->end) {
225 printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", pci_name(dev)); 230 printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", pci_name(dev));
226 return -EINVAL; 231 return -EINVAL;
@@ -230,8 +235,6 @@ int pcibios_enable_resources(struct pci_dev *dev, int mask)
230 if (r->flags & IORESOURCE_MEM) 235 if (r->flags & IORESOURCE_MEM)
231 cmd |= PCI_COMMAND_MEMORY; 236 cmd |= PCI_COMMAND_MEMORY;
232 } 237 }
233 if (dev->resource[PCI_ROM_RESOURCE].start)
234 cmd |= PCI_COMMAND_MEMORY;
235 if (cmd != old_cmd) { 238 if (cmd != old_cmd) {
236 printk("PCI: Enabling device %s (%04x -> %04x)\n", pci_name(dev), old_cmd, cmd); 239 printk("PCI: Enabling device %s (%04x -> %04x)\n", pci_name(dev), old_cmd, cmd);
237 pci_write_config_word(dev, PCI_COMMAND, cmd); 240 pci_write_config_word(dev, PCI_COMMAND, cmd);
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
index 4305d2ba76f6..2e33665d9c18 100644
--- a/arch/ia64/kernel/process.c
+++ b/arch/ia64/kernel/process.c
@@ -718,13 +718,6 @@ kernel_thread_helper (int (*fn)(void *), void *arg)
718void 718void
719flush_thread (void) 719flush_thread (void)
720{ 720{
721 /*
722 * Remove function-return probe instances associated with this task
723 * and put them back on the free list. Do not insert an exit probe for
724 * this function, it will be disabled by kprobe_flush_task if you do.
725 */
726 kprobe_flush_task(current);
727
728 /* drop floating-point and debug-register state if it exists: */ 721 /* drop floating-point and debug-register state if it exists: */
729 current->thread.flags &= ~(IA64_THREAD_FPH_VALID | IA64_THREAD_DBG_VALID); 722 current->thread.flags &= ~(IA64_THREAD_FPH_VALID | IA64_THREAD_DBG_VALID);
730 ia64_drop_fpu(current); 723 ia64_drop_fpu(current);
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index de69fb37c731..a5a7542a8ff3 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -457,7 +457,6 @@ void flush_thread(void)
457 if (t->flags & _TIF_ABI_PENDING) 457 if (t->flags & _TIF_ABI_PENDING)
458 t->flags ^= (_TIF_ABI_PENDING | _TIF_32BIT); 458 t->flags ^= (_TIF_ABI_PENDING | _TIF_32BIT);
459#endif 459#endif
460 kprobe_flush_task(current);
461 460
462#ifndef CONFIG_SMP 461#ifndef CONFIG_SMP
463 if (last_task_used_math == current) 462 if (last_task_used_math == current)
diff --git a/arch/powerpc/mm/4xx_mmu.c b/arch/powerpc/mm/4xx_mmu.c
index b7bcbc232f39..4d006aa1a0d1 100644
--- a/arch/powerpc/mm/4xx_mmu.c
+++ b/arch/powerpc/mm/4xx_mmu.c
@@ -110,13 +110,11 @@ unsigned long __init mmu_mapin_ram(void)
110 pmd_t *pmdp; 110 pmd_t *pmdp;
111 unsigned long val = p | _PMD_SIZE_16M | _PAGE_HWEXEC | _PAGE_HWWRITE; 111 unsigned long val = p | _PMD_SIZE_16M | _PAGE_HWEXEC | _PAGE_HWWRITE;
112 112
113 spin_lock(&init_mm.page_table_lock);
114 pmdp = pmd_offset(pgd_offset_k(v), v); 113 pmdp = pmd_offset(pgd_offset_k(v), v);
115 pmd_val(*pmdp++) = val; 114 pmd_val(*pmdp++) = val;
116 pmd_val(*pmdp++) = val; 115 pmd_val(*pmdp++) = val;
117 pmd_val(*pmdp++) = val; 116 pmd_val(*pmdp++) = val;
118 pmd_val(*pmdp++) = val; 117 pmd_val(*pmdp++) = val;
119 spin_unlock(&init_mm.page_table_lock);
120 118
121 v += LARGE_PAGE_SIZE_16M; 119 v += LARGE_PAGE_SIZE_16M;
122 p += LARGE_PAGE_SIZE_16M; 120 p += LARGE_PAGE_SIZE_16M;
@@ -127,10 +125,8 @@ unsigned long __init mmu_mapin_ram(void)
127 pmd_t *pmdp; 125 pmd_t *pmdp;
128 unsigned long val = p | _PMD_SIZE_4M | _PAGE_HWEXEC | _PAGE_HWWRITE; 126 unsigned long val = p | _PMD_SIZE_4M | _PAGE_HWEXEC | _PAGE_HWWRITE;
129 127
130 spin_lock(&init_mm.page_table_lock);
131 pmdp = pmd_offset(pgd_offset_k(v), v); 128 pmdp = pmd_offset(pgd_offset_k(v), v);
132 pmd_val(*pmdp) = val; 129 pmd_val(*pmdp) = val;
133 spin_unlock(&init_mm.page_table_lock);
134 130
135 v += LARGE_PAGE_SIZE_4M; 131 v += LARGE_PAGE_SIZE_4M;
136 p += LARGE_PAGE_SIZE_4M; 132 p += LARGE_PAGE_SIZE_4M;
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 426c269e552e..f867bba893ca 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -287,15 +287,15 @@ static int open_high_hpage_areas(struct mm_struct *mm, u16 newareas)
287 287
288int prepare_hugepage_range(unsigned long addr, unsigned long len) 288int prepare_hugepage_range(unsigned long addr, unsigned long len)
289{ 289{
290 int err; 290 int err = 0;
291 291
292 if ( (addr+len) < addr ) 292 if ( (addr+len) < addr )
293 return -EINVAL; 293 return -EINVAL;
294 294
295 if ((addr + len) < 0x100000000UL) 295 if (addr < 0x100000000UL)
296 err = open_low_hpage_areas(current->mm, 296 err = open_low_hpage_areas(current->mm,
297 LOW_ESID_MASK(addr, len)); 297 LOW_ESID_MASK(addr, len));
298 else 298 if ((addr + len) >= 0x100000000UL)
299 err = open_high_hpage_areas(current->mm, 299 err = open_high_hpage_areas(current->mm,
300 HTLB_AREA_MASK(addr, len)); 300 HTLB_AREA_MASK(addr, len));
301 if (err) { 301 if (err) {
@@ -754,9 +754,7 @@ repeat:
754 } 754 }
755 755
756 /* 756 /*
757 * No need to use ldarx/stdcx here because all who 757 * No need to use ldarx/stdcx here
758 * might be updating the pte will hold the
759 * page_table_lock
760 */ 758 */
761 *ptep = __pte(new_pte & ~_PAGE_BUSY); 759 *ptep = __pte(new_pte & ~_PAGE_BUSY);
762 760
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 4bd7b0a70996..ed6ed2e30dac 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -495,7 +495,7 @@ EXPORT_SYMBOL(flush_icache_user_range);
495 * We use it to preload an HPTE into the hash table corresponding to 495 * We use it to preload an HPTE into the hash table corresponding to
496 * the updated linux PTE. 496 * the updated linux PTE.
497 * 497 *
498 * This must always be called with the mm->page_table_lock held 498 * This must always be called with the pte lock held.
499 */ 499 */
500void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, 500void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
501 pte_t pte) 501 pte_t pte)
diff --git a/arch/powerpc/mm/tlb_32.c b/arch/powerpc/mm/tlb_32.c
index 6c3dc3c44c86..ad580f3742e5 100644
--- a/arch/powerpc/mm/tlb_32.c
+++ b/arch/powerpc/mm/tlb_32.c
@@ -149,6 +149,12 @@ void flush_tlb_mm(struct mm_struct *mm)
149 return; 149 return;
150 } 150 }
151 151
152 /*
153 * It is safe to go down the mm's list of vmas when called
154 * from dup_mmap, holding mmap_sem. It would also be safe from
155 * unmap_region or exit_mmap, but not from vmtruncate on SMP -
156 * but it seems dup_mmap is the only SMP case which gets here.
157 */
152 for (mp = mm->mmap; mp != NULL; mp = mp->vm_next) 158 for (mp = mm->mmap; mp != NULL; mp = mp->vm_next)
153 flush_range(mp->vm_mm, mp->vm_start, mp->vm_end); 159 flush_range(mp->vm_mm, mp->vm_start, mp->vm_end);
154 FINISH_FLUSH; 160 FINISH_FLUSH;
diff --git a/arch/powerpc/mm/tlb_64.c b/arch/powerpc/mm/tlb_64.c
index 53e31b834ace..859d29a0cac5 100644
--- a/arch/powerpc/mm/tlb_64.c
+++ b/arch/powerpc/mm/tlb_64.c
@@ -95,7 +95,7 @@ static void pte_free_submit(struct pte_freelist_batch *batch)
95 95
96void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf) 96void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf)
97{ 97{
98 /* This is safe as we are holding page_table_lock */ 98 /* This is safe since tlb_gather_mmu has disabled preemption */
99 cpumask_t local_cpumask = cpumask_of_cpu(smp_processor_id()); 99 cpumask_t local_cpumask = cpumask_of_cpu(smp_processor_id());
100 struct pte_freelist_batch **batchp = &__get_cpu_var(pte_freelist_cur); 100 struct pte_freelist_batch **batchp = &__get_cpu_var(pte_freelist_cur);
101 101
@@ -206,7 +206,7 @@ void __flush_tlb_pending(struct ppc64_tlb_batch *batch)
206 206
207void pte_free_finish(void) 207void pte_free_finish(void)
208{ 208{
209 /* This is safe as we are holding page_table_lock */ 209 /* This is safe since tlb_gather_mmu has disabled preemption */
210 struct pte_freelist_batch **batchp = &__get_cpu_var(pte_freelist_cur); 210 struct pte_freelist_batch **batchp = &__get_cpu_var(pte_freelist_cur);
211 211
212 if (*batchp == NULL) 212 if (*batchp == NULL)
diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c
index 5afd63e8cef7..7519fc520eb3 100644
--- a/arch/x86_64/kernel/process.c
+++ b/arch/x86_64/kernel/process.c
@@ -351,13 +351,6 @@ void flush_thread(void)
351 struct task_struct *tsk = current; 351 struct task_struct *tsk = current;
352 struct thread_info *t = current_thread_info(); 352 struct thread_info *t = current_thread_info();
353 353
354 /*
355 * Remove function-return probe instances associated with this task
356 * and put them back on the free list. Do not insert an exit probe for
357 * this function, it will be disabled by kprobe_flush_task if you do.
358 */
359 kprobe_flush_task(tsk);
360
361 if (t->flags & _TIF_ABI_PENDING) 354 if (t->flags & _TIF_ABI_PENDING)
362 t->flags ^= (_TIF_ABI_PENDING | _TIF_IA32); 355 t->flags ^= (_TIF_ABI_PENDING | _TIF_IA32);
363 356
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 03204bfd17af..fa601b085eba 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -133,7 +133,7 @@ static struct kobj_type ktype_bus = {
133decl_subsys(bus, &ktype_bus, NULL); 133decl_subsys(bus, &ktype_bus, NULL);
134 134
135 135
136/* Manually detach a device from it's associated driver. */ 136/* Manually detach a device from its associated driver. */
137static int driver_helper(struct device *dev, void *data) 137static int driver_helper(struct device *dev, void *data)
138{ 138{
139 const char *name = data; 139 const char *name = data;
@@ -151,14 +151,13 @@ static ssize_t driver_unbind(struct device_driver *drv,
151 int err = -ENODEV; 151 int err = -ENODEV;
152 152
153 dev = bus_find_device(bus, NULL, (void *)buf, driver_helper); 153 dev = bus_find_device(bus, NULL, (void *)buf, driver_helper);
154 if ((dev) && 154 if (dev && dev->driver == drv) {
155 (dev->driver == drv)) {
156 device_release_driver(dev); 155 device_release_driver(dev);
157 err = count; 156 err = count;
158 } 157 }
159 if (err) 158 put_device(dev);
160 return err; 159 put_bus(bus);
161 return count; 160 return err;
162} 161}
163static DRIVER_ATTR(unbind, S_IWUSR, NULL, driver_unbind); 162static DRIVER_ATTR(unbind, S_IWUSR, NULL, driver_unbind);
164 163
@@ -175,16 +174,14 @@ static ssize_t driver_bind(struct device_driver *drv,
175 int err = -ENODEV; 174 int err = -ENODEV;
176 175
177 dev = bus_find_device(bus, NULL, (void *)buf, driver_helper); 176 dev = bus_find_device(bus, NULL, (void *)buf, driver_helper);
178 if ((dev) && 177 if (dev && dev->driver == NULL) {
179 (dev->driver == NULL)) {
180 down(&dev->sem); 178 down(&dev->sem);
181 err = driver_probe_device(drv, dev); 179 err = driver_probe_device(drv, dev);
182 up(&dev->sem); 180 up(&dev->sem);
183 put_device(dev);
184 } 181 }
185 if (err) 182 put_device(dev);
186 return err; 183 put_bus(bus);
187 return count; 184 return err;
188} 185}
189static DRIVER_ATTR(bind, S_IWUSR, NULL, driver_bind); 186static DRIVER_ATTR(bind, S_IWUSR, NULL, driver_bind);
190 187
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 3565e9795301..3b419c9a1e7e 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -62,7 +62,6 @@ void device_bind_driver(struct device * dev)
62 * because we don't know the format of the ID structures, nor what 62 * because we don't know the format of the ID structures, nor what
63 * is to be considered a match and what is not. 63 * is to be considered a match and what is not.
64 * 64 *
65 *
66 * This function returns 1 if a match is found, an error if one 65 * This function returns 1 if a match is found, an error if one
67 * occurs (that is not -ENODEV or -ENXIO), and 0 otherwise. 66 * occurs (that is not -ENODEV or -ENXIO), and 0 otherwise.
68 * 67 *
@@ -158,7 +157,6 @@ static int __driver_attach(struct device * dev, void * data)
158 driver_probe_device(drv, dev); 157 driver_probe_device(drv, dev);
159 up(&dev->sem); 158 up(&dev->sem);
160 159
161
162 return 0; 160 return 0;
163} 161}
164 162
@@ -225,15 +223,15 @@ void driver_detach(struct device_driver * drv)
225 struct device * dev; 223 struct device * dev;
226 224
227 for (;;) { 225 for (;;) {
228 spin_lock_irq(&drv->klist_devices.k_lock); 226 spin_lock(&drv->klist_devices.k_lock);
229 if (list_empty(&drv->klist_devices.k_list)) { 227 if (list_empty(&drv->klist_devices.k_list)) {
230 spin_unlock_irq(&drv->klist_devices.k_lock); 228 spin_unlock(&drv->klist_devices.k_lock);
231 break; 229 break;
232 } 230 }
233 dev = list_entry(drv->klist_devices.k_list.prev, 231 dev = list_entry(drv->klist_devices.k_list.prev,
234 struct device, knode_driver.n_node); 232 struct device, knode_driver.n_node);
235 get_device(dev); 233 get_device(dev);
236 spin_unlock_irq(&drv->klist_devices.k_lock); 234 spin_unlock(&drv->klist_devices.k_lock);
237 235
238 down(&dev->sem); 236 down(&dev->sem);
239 if (dev->driver == drv) 237 if (dev->driver == drv)
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 13b8a9bed66e..f7e765a1d313 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -3714,12 +3714,6 @@ static int floppy_open(struct inode *inode, struct file *filp)
3714 USETF(FD_VERIFY); 3714 USETF(FD_VERIFY);
3715 } 3715 }
3716 3716
3717 /* set underlying gendisk policy to reflect real ro/rw status */
3718 if (UTESTF(FD_DISK_WRITABLE))
3719 inode->i_bdev->bd_disk->policy = 0;
3720 else
3721 inode->i_bdev->bd_disk->policy = 1;
3722
3723 if (UDRS->fd_ref == -1 || (UDRS->fd_ref && (filp->f_flags & O_EXCL))) 3717 if (UDRS->fd_ref == -1 || (UDRS->fd_ref && (filp->f_flags & O_EXCL)))
3724 goto out2; 3718 goto out2;
3725 3719
diff --git a/drivers/char/drm/drm_memory.c b/drivers/char/drm/drm_memory.c
index 2c74155aa84f..abef2acf99f5 100644
--- a/drivers/char/drm/drm_memory.c
+++ b/drivers/char/drm/drm_memory.c
@@ -95,7 +95,7 @@ unsigned long drm_alloc_pages(int order, int area)
95 unsigned long addr; 95 unsigned long addr;
96 unsigned int sz; 96 unsigned int sz;
97 97
98 address = __get_free_pages(GFP_KERNEL, order); 98 address = __get_free_pages(GFP_KERNEL|__GFP_COMP, order);
99 if (!address) 99 if (!address)
100 return 0; 100 return 0;
101 101
diff --git a/drivers/char/drm/drm_memory_debug.h b/drivers/char/drm/drm_memory_debug.h
index 4542353195bd..b370aca718d2 100644
--- a/drivers/char/drm/drm_memory_debug.h
+++ b/drivers/char/drm/drm_memory_debug.h
@@ -221,7 +221,7 @@ unsigned long DRM(alloc_pages) (int order, int area) {
221 } 221 }
222 spin_unlock(&DRM(mem_lock)); 222 spin_unlock(&DRM(mem_lock));
223 223
224 address = __get_free_pages(GFP_KERNEL, order); 224 address = __get_free_pages(GFP_KERNEL|__GFP_COMP, order);
225 if (!address) { 225 if (!address) {
226 spin_lock(&DRM(mem_lock)); 226 spin_lock(&DRM(mem_lock));
227 ++DRM(mem_stats)[area].fail_count; 227 ++DRM(mem_stats)[area].fail_count;
diff --git a/drivers/char/drm/mga_drv.c b/drivers/char/drm/mga_drv.c
index 0cc7c305a7f6..1713451a5cc6 100644
--- a/drivers/char/drm/mga_drv.c
+++ b/drivers/char/drm/mga_drv.c
@@ -161,7 +161,7 @@ static int mga_driver_device_is_agp(drm_device_t * dev)
161 * device. 161 * device.
162 */ 162 */
163 163
164 if ((pdev->device == 0x0525) 164 if ((pdev->device == 0x0525) && pdev->bus->self
165 && (pdev->bus->self->vendor == 0x3388) 165 && (pdev->bus->self->vendor == 0x3388)
166 && (pdev->bus->self->device == 0x0021)) { 166 && (pdev->bus->self->device == 0x0021)) {
167 return 0; 167 return 0;
diff --git a/drivers/char/drm/radeon_drv.h b/drivers/char/drm/radeon_drv.h
index 120ee5a8ebcc..7bda7e33d2bd 100644
--- a/drivers/char/drm/radeon_drv.h
+++ b/drivers/char/drm/radeon_drv.h
@@ -214,8 +214,6 @@ typedef struct drm_radeon_private {
214 214
215 int microcode_version; 215 int microcode_version;
216 216
217 int is_pci;
218
219 struct { 217 struct {
220 u32 boxes; 218 u32 boxes;
221 int freelist_timeouts; 219 int freelist_timeouts;
@@ -275,6 +273,7 @@ typedef struct drm_radeon_private {
275 273
276 /* starting from here on, data is preserved accross an open */ 274 /* starting from here on, data is preserved accross an open */
277 uint32_t flags; /* see radeon_chip_flags */ 275 uint32_t flags; /* see radeon_chip_flags */
276 int is_pci;
278} drm_radeon_private_t; 277} drm_radeon_private_t;
279 278
280typedef struct drm_radeon_buf_priv { 279typedef struct drm_radeon_buf_priv {
diff --git a/drivers/hwmon/hdaps.c b/drivers/hwmon/hdaps.c
index c81bd4bce1b8..23a9e1ea8e32 100644
--- a/drivers/hwmon/hdaps.c
+++ b/drivers/hwmon/hdaps.c
@@ -570,7 +570,7 @@ static int __init hdaps_init(void)
570 hdaps_idev->evbit[0] = BIT(EV_ABS); 570 hdaps_idev->evbit[0] = BIT(EV_ABS);
571 input_set_abs_params(hdaps_idev, ABS_X, 571 input_set_abs_params(hdaps_idev, ABS_X,
572 -256, 256, HDAPS_INPUT_FUZZ, HDAPS_INPUT_FLAT); 572 -256, 256, HDAPS_INPUT_FUZZ, HDAPS_INPUT_FLAT);
573 input_set_abs_params(hdaps_idev, ABS_X, 573 input_set_abs_params(hdaps_idev, ABS_Y,
574 -256, 256, HDAPS_INPUT_FUZZ, HDAPS_INPUT_FLAT); 574 -256, 256, HDAPS_INPUT_FUZZ, HDAPS_INPUT_FLAT);
575 575
576 input_register_device(hdaps_idev); 576 input_register_device(hdaps_idev);
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index 6c41e25e670b..a61f5d00f10a 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -522,8 +522,15 @@ static ssize_t set_fan_min(struct device *dev, struct device_attribute *attr,
522 struct i2c_client *client = to_i2c_client(dev); 522 struct i2c_client *client = to_i2c_client(dev);
523 struct it87_data *data = i2c_get_clientdata(client); 523 struct it87_data *data = i2c_get_clientdata(client);
524 int val = simple_strtol(buf, NULL, 10); 524 int val = simple_strtol(buf, NULL, 10);
525 u8 reg = it87_read_value(client, IT87_REG_FAN_DIV);
525 526
526 down(&data->update_lock); 527 down(&data->update_lock);
528 switch (nr) {
529 case 0: data->fan_div[nr] = reg & 0x07; break;
530 case 1: data->fan_div[nr] = (reg >> 3) & 0x07; break;
531 case 2: data->fan_div[nr] = (reg & 0x40) ? 3 : 1; break;
532 }
533
527 data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr])); 534 data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr]));
528 it87_write_value(client, IT87_REG_FAN_MIN(nr), data->fan_min[nr]); 535 it87_write_value(client, IT87_REG_FAN_MIN(nr), data->fan_min[nr]);
529 up(&data->update_lock); 536 up(&data->update_lock);
diff --git a/drivers/hwmon/lm78.c b/drivers/hwmon/lm78.c
index bde0cda9477e..78cdd506439f 100644
--- a/drivers/hwmon/lm78.c
+++ b/drivers/hwmon/lm78.c
@@ -451,7 +451,7 @@ static DEVICE_ATTR(fan3_div, S_IRUGO, show_fan_3_div, NULL);
451static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf) 451static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf)
452{ 452{
453 struct lm78_data *data = lm78_update_device(dev); 453 struct lm78_data *data = lm78_update_device(dev);
454 return sprintf(buf, "%d\n", vid_from_reg(82, data->vid)); 454 return sprintf(buf, "%d\n", vid_from_reg(data->vid, 82));
455} 455}
456static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL); 456static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL);
457 457
diff --git a/drivers/hwmon/w83627hf.c b/drivers/hwmon/w83627hf.c
index 4e9a04e1f08e..bbb3dcde146b 100644
--- a/drivers/hwmon/w83627hf.c
+++ b/drivers/hwmon/w83627hf.c
@@ -456,7 +456,9 @@ static ssize_t store_regs_in_min0(struct device *dev, struct device_attribute *a
456 (w83627thf == data->type || w83637hf == data->type)) 456 (w83627thf == data->type || w83637hf == data->type))
457 457
458 /* use VRM9 calculation */ 458 /* use VRM9 calculation */
459 data->in_min[0] = (u8)(((val * 100) - 70000 + 244) / 488); 459 data->in_min[0] =
460 SENSORS_LIMIT(((val * 100) - 70000 + 244) / 488, 0,
461 255);
460 else 462 else
461 /* use VRM8 (standard) calculation */ 463 /* use VRM8 (standard) calculation */
462 data->in_min[0] = IN_TO_REG(val); 464 data->in_min[0] = IN_TO_REG(val);
@@ -481,7 +483,9 @@ static ssize_t store_regs_in_max0(struct device *dev, struct device_attribute *a
481 (w83627thf == data->type || w83637hf == data->type)) 483 (w83627thf == data->type || w83637hf == data->type))
482 484
483 /* use VRM9 calculation */ 485 /* use VRM9 calculation */
484 data->in_max[0] = (u8)(((val * 100) - 70000 + 244) / 488); 486 data->in_max[0] =
487 SENSORS_LIMIT(((val * 100) - 70000 + 244) / 488, 0,
488 255);
485 else 489 else
486 /* use VRM8 (standard) calculation */ 490 /* use VRM8 (standard) calculation */
487 data->in_max[0] = IN_TO_REG(val); 491 data->in_max[0] = IN_TO_REG(val);
diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h
index c42b68d3aa24..6a61b9f286e1 100644
--- a/drivers/pci/hotplug/pciehp.h
+++ b/drivers/pci/hotplug/pciehp.h
@@ -59,7 +59,6 @@ struct slot {
59 struct slot *next; 59 struct slot *next;
60 u8 bus; 60 u8 bus;
61 u8 device; 61 u8 device;
62 u16 status;
63 u32 number; 62 u32 number;
64 u8 state; 63 u8 state;
65 struct timer_list task_event; 64 struct timer_list task_event;
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c
index 5e582eca21d8..83c4b865718a 100644
--- a/drivers/pci/hotplug/pciehp_ctrl.c
+++ b/drivers/pci/hotplug/pciehp_ctrl.c
@@ -207,7 +207,6 @@ u8 pciehp_handle_power_fault(u8 hp_slot, void *inst_id)
207 * power fault Cleared 207 * power fault Cleared
208 */ 208 */
209 info("Power fault cleared on Slot(%d)\n", ctrl->first_slot + hp_slot); 209 info("Power fault cleared on Slot(%d)\n", ctrl->first_slot + hp_slot);
210 p_slot->status = 0x00;
211 taskInfo->event_type = INT_POWER_FAULT_CLEAR; 210 taskInfo->event_type = INT_POWER_FAULT_CLEAR;
212 } else { 211 } else {
213 /* 212 /*
@@ -215,8 +214,6 @@ u8 pciehp_handle_power_fault(u8 hp_slot, void *inst_id)
215 */ 214 */
216 info("Power fault on Slot(%d)\n", ctrl->first_slot + hp_slot); 215 info("Power fault on Slot(%d)\n", ctrl->first_slot + hp_slot);
217 taskInfo->event_type = INT_POWER_FAULT; 216 taskInfo->event_type = INT_POWER_FAULT;
218 /* set power fault status for this board */
219 p_slot->status = 0xFF;
220 info("power fault bit %x set\n", hp_slot); 217 info("power fault bit %x set\n", hp_slot);
221 } 218 }
222 if (rc) 219 if (rc)
@@ -317,13 +314,10 @@ static int board_added(struct slot *p_slot)
317 return rc; 314 return rc;
318 } 315 }
319 316
320 dbg("%s: slot status = %x\n", __FUNCTION__, p_slot->status);
321
322 /* Check for a power fault */ 317 /* Check for a power fault */
323 if (p_slot->status == 0xFF) { 318 if (p_slot->hpc_ops->query_power_fault(p_slot)) {
324 /* power fault occurred, but it was benign */ 319 dbg("%s: power fault detected\n", __FUNCTION__);
325 rc = POWER_FAILURE; 320 rc = POWER_FAILURE;
326 p_slot->status = 0;
327 goto err_exit; 321 goto err_exit;
328 } 322 }
329 323
@@ -334,8 +328,6 @@ static int board_added(struct slot *p_slot)
334 goto err_exit; 328 goto err_exit;
335 } 329 }
336 330
337 p_slot->status = 0;
338
339 /* 331 /*
340 * Some PCI Express root ports require fixup after hot-plug operation. 332 * Some PCI Express root ports require fixup after hot-plug operation.
341 */ 333 */
@@ -382,9 +374,6 @@ static int remove_board(struct slot *p_slot)
382 374
383 dbg("In %s, hp_slot = %d\n", __FUNCTION__, hp_slot); 375 dbg("In %s, hp_slot = %d\n", __FUNCTION__, hp_slot);
384 376
385 /* Change status to shutdown */
386 p_slot->status = 0x01;
387
388 /* Wait for exclusive access to hardware */ 377 /* Wait for exclusive access to hardware */
389 down(&ctrl->crit_sect); 378 down(&ctrl->crit_sect);
390 379
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index 2387e75da0fe..0b8b26beb163 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -750,7 +750,7 @@ static int hpc_power_on_slot(struct slot * slot)
750{ 750{
751 struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle; 751 struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle;
752 u16 slot_cmd; 752 u16 slot_cmd;
753 u16 slot_ctrl; 753 u16 slot_ctrl, slot_status;
754 754
755 int retval = 0; 755 int retval = 0;
756 756
@@ -767,6 +767,14 @@ static int hpc_power_on_slot(struct slot * slot)
767 return -1; 767 return -1;
768 } 768 }
769 769
770 /* Clear sticky power-fault bit from previous power failures */
771 hp_register_read_word(php_ctlr->pci_dev,
772 SLOT_STATUS(slot->ctrl->cap_base), slot_status);
773 slot_status &= PWR_FAULT_DETECTED;
774 if (slot_status)
775 hp_register_write_word(php_ctlr->pci_dev,
776 SLOT_STATUS(slot->ctrl->cap_base), slot_status);
777
770 retval = hp_register_read_word(php_ctlr->pci_dev, SLOT_CTRL(slot->ctrl->cap_base), slot_ctrl); 778 retval = hp_register_read_word(php_ctlr->pci_dev, SLOT_CTRL(slot->ctrl->cap_base), slot_ctrl);
771 779
772 if (retval) { 780 if (retval) {
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index a9b00cc2d885..6917c6cb0912 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -178,6 +178,7 @@ EXPORT_SYMBOL(pci_osc_support_set);
178 178
179/** 179/**
180 * pci_osc_control_set - commit requested control to Firmware 180 * pci_osc_control_set - commit requested control to Firmware
181 * @handle: acpi_handle for the target ACPI object
181 * @flags: driver's requested control bits 182 * @flags: driver's requested control bits
182 * 183 *
183 * Attempt to take control from Firmware on requested control bits. 184 * Attempt to take control from Firmware on requested control bits.
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
index 7feb829362d6..5131d88e8c5b 100644
--- a/drivers/usb/core/hcd-pci.c
+++ b/drivers/usb/core/hcd-pci.c
@@ -20,9 +20,17 @@
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/pci.h> 22#include <linux/pci.h>
23#include <linux/usb.h>
24
23#include <asm/io.h> 25#include <asm/io.h>
24#include <asm/irq.h> 26#include <asm/irq.h>
25#include <linux/usb.h> 27
28#ifdef CONFIG_PPC_PMAC
29#include <asm/machdep.h>
30#include <asm/pmac_feature.h>
31#include <asm/pci-bridge.h>
32#include <asm/prom.h>
33#endif
26 34
27#include "usb.h" 35#include "usb.h"
28#include "hcd.h" 36#include "hcd.h"
@@ -277,8 +285,22 @@ int usb_hcd_pci_suspend (struct pci_dev *dev, pm_message_t message)
277 } 285 }
278 286
279done: 287done:
280 if (retval == 0) 288 if (retval == 0) {
281 dev->dev.power.power_state = PMSG_SUSPEND; 289 dev->dev.power.power_state = PMSG_SUSPEND;
290
291#ifdef CONFIG_PPC_PMAC
292 /* Disable ASIC clocks for USB */
293 if (_machine == _MACH_Pmac) {
294 struct device_node *of_node;
295
296 of_node = pci_device_to_OF_node (dev);
297 if (of_node)
298 pmac_call_feature(PMAC_FTR_USB_ENABLE,
299 of_node, 0, 0);
300 }
301#endif
302 }
303
282 return retval; 304 return retval;
283} 305}
284EXPORT_SYMBOL (usb_hcd_pci_suspend); 306EXPORT_SYMBOL (usb_hcd_pci_suspend);
@@ -301,6 +323,18 @@ int usb_hcd_pci_resume (struct pci_dev *dev)
301 return 0; 323 return 0;
302 } 324 }
303 325
326#ifdef CONFIG_PPC_PMAC
327 /* Reenable ASIC clocks for USB */
328 if (_machine == _MACH_Pmac) {
329 struct device_node *of_node;
330
331 of_node = pci_device_to_OF_node (dev);
332 if (of_node)
333 pmac_call_feature (PMAC_FTR_USB_ENABLE,
334 of_node, 0, 1);
335 }
336#endif
337
304 /* NOTE: chip docs cover clean "real suspend" cases (what Linux 338 /* NOTE: chip docs cover clean "real suspend" cases (what Linux
305 * calls "standby", "suspend to RAM", and so on). There are also 339 * calls "standby", "suspend to RAM", and so on). There are also
306 * dirty cases when swsusp fakes a suspend in "shutdown" mode. 340 * dirty cases when swsusp fakes a suspend in "shutdown" mode.
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 840727948d84..f78bd124d290 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1669,7 +1669,6 @@ int usb_suspend_device(struct usb_device *udev)
1669 return 0; 1669 return 0;
1670#endif 1670#endif
1671} 1671}
1672EXPORT_SYMBOL_GPL(usb_suspend_device);
1673 1672
1674/* 1673/*
1675 * If the USB "suspend" state is in use (rather than "global suspend"), 1674 * If the USB "suspend" state is in use (rather than "global suspend"),
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index af3c05eb86fc..29f52a44b928 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -411,50 +411,39 @@ static void ehci_stop (struct usb_hcd *hcd)
411 dbg_status (ehci, "ehci_stop completed", readl (&ehci->regs->status)); 411 dbg_status (ehci, "ehci_stop completed", readl (&ehci->regs->status));
412} 412}
413 413
414static int ehci_run (struct usb_hcd *hcd) 414/* one-time init, only for memory state */
415static int ehci_init(struct usb_hcd *hcd)
415{ 416{
416 struct ehci_hcd *ehci = hcd_to_ehci (hcd); 417 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
417 u32 temp; 418 u32 temp;
418 int retval; 419 int retval;
419 u32 hcc_params; 420 u32 hcc_params;
420 int first; 421
421 422 spin_lock_init(&ehci->lock);
422 /* skip some things on restart paths */ 423
423 first = (ehci->watchdog.data == 0); 424 init_timer(&ehci->watchdog);
424 if (first) { 425 ehci->watchdog.function = ehci_watchdog;
425 init_timer (&ehci->watchdog); 426 ehci->watchdog.data = (unsigned long) ehci;
426 ehci->watchdog.function = ehci_watchdog;
427 ehci->watchdog.data = (unsigned long) ehci;
428 }
429 427
430 /* 428 /*
431 * hw default: 1K periodic list heads, one per frame. 429 * hw default: 1K periodic list heads, one per frame.
432 * periodic_size can shrink by USBCMD update if hcc_params allows. 430 * periodic_size can shrink by USBCMD update if hcc_params allows.
433 */ 431 */
434 ehci->periodic_size = DEFAULT_I_TDPS; 432 ehci->periodic_size = DEFAULT_I_TDPS;
435 if (first && (retval = ehci_mem_init (ehci, GFP_KERNEL)) < 0) 433 if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0)
436 return retval; 434 return retval;
437 435
438 /* controllers may cache some of the periodic schedule ... */ 436 /* controllers may cache some of the periodic schedule ... */
439 hcc_params = readl (&ehci->caps->hcc_params); 437 hcc_params = readl(&ehci->caps->hcc_params);
440 if (HCC_ISOC_CACHE (hcc_params)) // full frame cache 438 if (HCC_ISOC_CACHE(hcc_params)) // full frame cache
441 ehci->i_thresh = 8; 439 ehci->i_thresh = 8;
442 else // N microframes cached 440 else // N microframes cached
443 ehci->i_thresh = 2 + HCC_ISOC_THRES (hcc_params); 441 ehci->i_thresh = 2 + HCC_ISOC_THRES(hcc_params);
444 442
445 ehci->reclaim = NULL; 443 ehci->reclaim = NULL;
446 ehci->reclaim_ready = 0; 444 ehci->reclaim_ready = 0;
447 ehci->next_uframe = -1; 445 ehci->next_uframe = -1;
448 446
449 /* controller state: unknown --> reset */
450
451 /* EHCI spec section 4.1 */
452 if ((retval = ehci_reset (ehci)) != 0) {
453 ehci_mem_cleanup (ehci);
454 return retval;
455 }
456 writel (ehci->periodic_dma, &ehci->regs->frame_list);
457
458 /* 447 /*
459 * dedicate a qh for the async ring head, since we couldn't unlink 448 * dedicate a qh for the async ring head, since we couldn't unlink
460 * a 'real' qh without stopping the async schedule [4.8]. use it 449 * a 'real' qh without stopping the async schedule [4.8]. use it
@@ -462,37 +451,13 @@ static int ehci_run (struct usb_hcd *hcd)
462 * its dummy is used in hw_alt_next of many tds, to prevent the qh 451 * its dummy is used in hw_alt_next of many tds, to prevent the qh
463 * from automatically advancing to the next td after short reads. 452 * from automatically advancing to the next td after short reads.
464 */ 453 */
465 if (first) { 454 ehci->async->qh_next.qh = NULL;
466 ehci->async->qh_next.qh = NULL; 455 ehci->async->hw_next = QH_NEXT(ehci->async->qh_dma);
467 ehci->async->hw_next = QH_NEXT (ehci->async->qh_dma); 456 ehci->async->hw_info1 = cpu_to_le32(QH_HEAD);
468 ehci->async->hw_info1 = cpu_to_le32 (QH_HEAD); 457 ehci->async->hw_token = cpu_to_le32(QTD_STS_HALT);
469 ehci->async->hw_token = cpu_to_le32 (QTD_STS_HALT); 458 ehci->async->hw_qtd_next = EHCI_LIST_END;
470 ehci->async->hw_qtd_next = EHCI_LIST_END; 459 ehci->async->qh_state = QH_STATE_LINKED;
471 ehci->async->qh_state = QH_STATE_LINKED; 460 ehci->async->hw_alt_next = QTD_NEXT(ehci->async->dummy->qtd_dma);
472 ehci->async->hw_alt_next = QTD_NEXT (ehci->async->dummy->qtd_dma);
473 }
474 writel ((u32)ehci->async->qh_dma, &ehci->regs->async_next);
475
476 /*
477 * hcc_params controls whether ehci->regs->segment must (!!!)
478 * be used; it constrains QH/ITD/SITD and QTD locations.
479 * pci_pool consistent memory always uses segment zero.
480 * streaming mappings for I/O buffers, like pci_map_single(),
481 * can return segments above 4GB, if the device allows.
482 *
483 * NOTE: the dma mask is visible through dma_supported(), so
484 * drivers can pass this info along ... like NETIF_F_HIGHDMA,
485 * Scsi_Host.highmem_io, and so forth. It's readonly to all
486 * host side drivers though.
487 */
488 if (HCC_64BIT_ADDR (hcc_params)) {
489 writel (0, &ehci->regs->segment);
490#if 0
491// this is deeply broken on almost all architectures
492 if (!dma_set_mask (hcd->self.controller, DMA_64BIT_MASK))
493 ehci_info (ehci, "enabled 64bit DMA\n");
494#endif
495 }
496 461
497 /* clear interrupt enables, set irq latency */ 462 /* clear interrupt enables, set irq latency */
498 if (log2_irq_thresh < 0 || log2_irq_thresh > 6) 463 if (log2_irq_thresh < 0 || log2_irq_thresh > 6)
@@ -507,13 +472,13 @@ static int ehci_run (struct usb_hcd *hcd)
507 * make problems: throughput reduction (!), data errors... 472 * make problems: throughput reduction (!), data errors...
508 */ 473 */
509 if (park) { 474 if (park) {
510 park = min (park, (unsigned) 3); 475 park = min(park, (unsigned) 3);
511 temp |= CMD_PARK; 476 temp |= CMD_PARK;
512 temp |= park << 8; 477 temp |= park << 8;
513 } 478 }
514 ehci_info (ehci, "park %d\n", park); 479 ehci_dbg(ehci, "park %d\n", park);
515 } 480 }
516 if (HCC_PGM_FRAMELISTLEN (hcc_params)) { 481 if (HCC_PGM_FRAMELISTLEN(hcc_params)) {
517 /* periodic schedule size can be smaller than default */ 482 /* periodic schedule size can be smaller than default */
518 temp &= ~(3 << 2); 483 temp &= ~(3 << 2);
519 temp |= (EHCI_TUNE_FLS << 2); 484 temp |= (EHCI_TUNE_FLS << 2);
@@ -521,16 +486,63 @@ static int ehci_run (struct usb_hcd *hcd)
521 case 0: ehci->periodic_size = 1024; break; 486 case 0: ehci->periodic_size = 1024; break;
522 case 1: ehci->periodic_size = 512; break; 487 case 1: ehci->periodic_size = 512; break;
523 case 2: ehci->periodic_size = 256; break; 488 case 2: ehci->periodic_size = 256; break;
524 default: BUG (); 489 default: BUG();
525 } 490 }
526 } 491 }
492 ehci->command = temp;
493
494 ehci->reboot_notifier.notifier_call = ehci_reboot;
495 register_reboot_notifier(&ehci->reboot_notifier);
496
497 return 0;
498}
499
500/* start HC running; it's halted, ehci_init() has been run (once) */
501static int ehci_run (struct usb_hcd *hcd)
502{
503 struct ehci_hcd *ehci = hcd_to_ehci (hcd);
504 int retval;
505 u32 temp;
506 u32 hcc_params;
507
508 /* EHCI spec section 4.1 */
509 if ((retval = ehci_reset(ehci)) != 0) {
510 unregister_reboot_notifier(&ehci->reboot_notifier);
511 ehci_mem_cleanup(ehci);
512 return retval;
513 }
514 writel(ehci->periodic_dma, &ehci->regs->frame_list);
515 writel((u32)ehci->async->qh_dma, &ehci->regs->async_next);
516
517 /*
518 * hcc_params controls whether ehci->regs->segment must (!!!)
519 * be used; it constrains QH/ITD/SITD and QTD locations.
520 * pci_pool consistent memory always uses segment zero.
521 * streaming mappings for I/O buffers, like pci_map_single(),
522 * can return segments above 4GB, if the device allows.
523 *
524 * NOTE: the dma mask is visible through dma_supported(), so
525 * drivers can pass this info along ... like NETIF_F_HIGHDMA,
526 * Scsi_Host.highmem_io, and so forth. It's readonly to all
527 * host side drivers though.
528 */
529 hcc_params = readl(&ehci->caps->hcc_params);
530 if (HCC_64BIT_ADDR(hcc_params)) {
531 writel(0, &ehci->regs->segment);
532#if 0
533// this is deeply broken on almost all architectures
534 if (!dma_set_mask(hcd->self.controller, DMA_64BIT_MASK))
535 ehci_info(ehci, "enabled 64bit DMA\n");
536#endif
537 }
538
539
527 // Philips, Intel, and maybe others need CMD_RUN before the 540 // Philips, Intel, and maybe others need CMD_RUN before the
528 // root hub will detect new devices (why?); NEC doesn't 541 // root hub will detect new devices (why?); NEC doesn't
529 temp |= CMD_RUN; 542 ehci->command &= ~(CMD_LRESET|CMD_IAAD|CMD_PSE|CMD_ASE|CMD_RESET);
530 writel (temp, &ehci->regs->command); 543 ehci->command |= CMD_RUN;
531 dbg_cmd (ehci, "init", temp); 544 writel (ehci->command, &ehci->regs->command);
532 545 dbg_cmd (ehci, "init", ehci->command);
533 /* set async sleep time = 10 us ... ? */
534 546
535 /* 547 /*
536 * Start, enabling full USB 2.0 functionality ... usb 1.1 devices 548 * Start, enabling full USB 2.0 functionality ... usb 1.1 devices
@@ -538,26 +550,23 @@ static int ehci_run (struct usb_hcd *hcd)
538 * involved with the root hub. (Except where one is integrated, 550 * involved with the root hub. (Except where one is integrated,
539 * and there's no companion controller unless maybe for USB OTG.) 551 * and there's no companion controller unless maybe for USB OTG.)
540 */ 552 */
541 if (first) {
542 ehci->reboot_notifier.notifier_call = ehci_reboot;
543 register_reboot_notifier (&ehci->reboot_notifier);
544 }
545
546 hcd->state = HC_STATE_RUNNING; 553 hcd->state = HC_STATE_RUNNING;
547 writel (FLAG_CF, &ehci->regs->configured_flag); 554 writel (FLAG_CF, &ehci->regs->configured_flag);
548 readl (&ehci->regs->command); /* unblock posted write */ 555 readl (&ehci->regs->command); /* unblock posted writes */
549 556
550 temp = HC_VERSION(readl (&ehci->caps->hc_capbase)); 557 temp = HC_VERSION(readl (&ehci->caps->hc_capbase));
551 ehci_info (ehci, 558 ehci_info (ehci,
552 "USB %x.%x %s, EHCI %x.%02x, driver %s\n", 559 "USB %x.%x started, EHCI %x.%02x, driver %s\n",
553 ((ehci->sbrn & 0xf0)>>4), (ehci->sbrn & 0x0f), 560 ((ehci->sbrn & 0xf0)>>4), (ehci->sbrn & 0x0f),
554 first ? "initialized" : "restarted",
555 temp >> 8, temp & 0xff, DRIVER_VERSION); 561 temp >> 8, temp & 0xff, DRIVER_VERSION);
556 562
557 writel (INTR_MASK, &ehci->regs->intr_enable); /* Turn On Interrupts */ 563 writel (INTR_MASK, &ehci->regs->intr_enable); /* Turn On Interrupts */
558 564
559 if (first) 565 /* GRR this is run-once init(), being done every time the HC starts.
560 create_debug_files (ehci); 566 * So long as they're part of class devices, we can't do it init()
567 * since the class device isn't created that early.
568 */
569 create_debug_files(ehci);
561 570
562 return 0; 571 return 0;
563} 572}
@@ -636,9 +645,8 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd, struct pt_regs *regs)
636 * stop that signaling. 645 * stop that signaling.
637 */ 646 */
638 ehci->reset_done [i] = jiffies + msecs_to_jiffies (20); 647 ehci->reset_done [i] = jiffies + msecs_to_jiffies (20);
639 mod_timer (&hcd->rh_timer,
640 ehci->reset_done [i] + 1);
641 ehci_dbg (ehci, "port %d remote wakeup\n", i + 1); 648 ehci_dbg (ehci, "port %d remote wakeup\n", i + 1);
649 usb_hcd_resume_root_hub(hcd);
642 } 650 }
643 } 651 }
644 652
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index 88cb4ada686e..82caf336e9b6 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -94,6 +94,13 @@ static int ehci_bus_resume (struct usb_hcd *hcd)
94 msleep(5); 94 msleep(5);
95 spin_lock_irq (&ehci->lock); 95 spin_lock_irq (&ehci->lock);
96 96
97 /* Ideally and we've got a real resume here, and no port's power
98 * was lost. (For PCI, that means Vaux was maintained.) But we
99 * could instead be restoring a swsusp snapshot -- so that BIOS was
100 * the last user of the controller, not reset/pm hardware keeping
101 * state we gave to it.
102 */
103
97 /* re-init operational registers in case we lost power */ 104 /* re-init operational registers in case we lost power */
98 if (readl (&ehci->regs->intr_enable) == 0) { 105 if (readl (&ehci->regs->intr_enable) == 0) {
99 /* at least some APM implementations will try to deliver 106 /* at least some APM implementations will try to deliver
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index dfd9bd0b1828..441c26064b44 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -27,7 +27,7 @@
27/* EHCI 0.96 (and later) section 5.1 says how to kick BIOS/SMM/... 27/* EHCI 0.96 (and later) section 5.1 says how to kick BIOS/SMM/...
28 * off the controller (maybe it can boot from highspeed USB disks). 28 * off the controller (maybe it can boot from highspeed USB disks).
29 */ 29 */
30static int bios_handoff (struct ehci_hcd *ehci, int where, u32 cap) 30static int bios_handoff(struct ehci_hcd *ehci, int where, u32 cap)
31{ 31{
32 struct pci_dev *pdev = to_pci_dev(ehci_to_hcd(ehci)->self.controller); 32 struct pci_dev *pdev = to_pci_dev(ehci_to_hcd(ehci)->self.controller);
33 33
@@ -48,7 +48,7 @@ static int bios_handoff (struct ehci_hcd *ehci, int where, u32 cap)
48 where, cap); 48 where, cap);
49 // some BIOS versions seem buggy... 49 // some BIOS versions seem buggy...
50 // return 1; 50 // return 1;
51 ehci_warn (ehci, "continuing after BIOS bug...\n"); 51 ehci_warn(ehci, "continuing after BIOS bug...\n");
52 /* disable all SMIs, and clear "BIOS owns" flag */ 52 /* disable all SMIs, and clear "BIOS owns" flag */
53 pci_write_config_dword(pdev, where + 4, 0); 53 pci_write_config_dword(pdev, where + 4, 0);
54 pci_write_config_byte(pdev, where + 2, 0); 54 pci_write_config_byte(pdev, where + 2, 0);
@@ -58,96 +58,47 @@ static int bios_handoff (struct ehci_hcd *ehci, int where, u32 cap)
58 return 0; 58 return 0;
59} 59}
60 60
61/* called by khubd or root hub init threads */ 61/* called after powerup, by probe or system-pm "wakeup" */
62static int ehci_pci_reset (struct usb_hcd *hcd) 62static int ehci_pci_reinit(struct ehci_hcd *ehci, struct pci_dev *pdev)
63{ 63{
64 struct ehci_hcd *ehci = hcd_to_ehci (hcd);
65 u32 temp; 64 u32 temp;
65 int retval;
66 unsigned count = 256/4; 66 unsigned count = 256/4;
67 67
68 spin_lock_init (&ehci->lock); 68 /* optional debug port, normally in the first BAR */
69 69 temp = pci_find_capability(pdev, 0x0a);
70 ehci->caps = hcd->regs; 70 if (temp) {
71 ehci->regs = hcd->regs + HC_LENGTH (readl (&ehci->caps->hc_capbase)); 71 pci_read_config_dword(pdev, temp, &temp);
72 dbg_hcs_params (ehci, "reset"); 72 temp >>= 16;
73 dbg_hcc_params (ehci, "reset"); 73 if ((temp & (3 << 13)) == (1 << 13)) {
74 74 temp &= 0x1fff;
75 /* cache this readonly data; minimize chip reads */ 75 ehci->debug = ehci_to_hcd(ehci)->regs + temp;
76 ehci->hcs_params = readl (&ehci->caps->hcs_params); 76 temp = readl(&ehci->debug->control);
77 77 ehci_info(ehci, "debug port %d%s\n",
78 if (hcd->self.controller->bus == &pci_bus_type) { 78 HCS_DEBUG_PORT(ehci->hcs_params),
79 struct pci_dev *pdev = to_pci_dev(hcd->self.controller); 79 (temp & DBGP_ENABLED)
80 80 ? " IN USE"
81 switch (pdev->vendor) { 81 : "");
82 case PCI_VENDOR_ID_TDI: 82 if (!(temp & DBGP_ENABLED))
83 if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) { 83 ehci->debug = NULL;
84 ehci->is_tdi_rh_tt = 1;
85 tdi_reset (ehci);
86 }
87 break;
88 case PCI_VENDOR_ID_AMD:
89 /* AMD8111 EHCI doesn't work, according to AMD errata */
90 if (pdev->device == 0x7463) {
91 ehci_info (ehci, "ignoring AMD8111 (errata)\n");
92 return -EIO;
93 }
94 break;
95 case PCI_VENDOR_ID_NVIDIA:
96 /* NVidia reports that certain chips don't handle
97 * QH, ITD, or SITD addresses above 2GB. (But TD,
98 * data buffer, and periodic schedule are normal.)
99 */
100 switch (pdev->device) {
101 case 0x003c: /* MCP04 */
102 case 0x005b: /* CK804 */
103 case 0x00d8: /* CK8 */
104 case 0x00e8: /* CK8S */
105 if (pci_set_consistent_dma_mask(pdev,
106 DMA_31BIT_MASK) < 0)
107 ehci_warn (ehci, "can't enable NVidia "
108 "workaround for >2GB RAM\n");
109 break;
110 }
111 break;
112 }
113
114 /* optional debug port, normally in the first BAR */
115 temp = pci_find_capability (pdev, 0x0a);
116 if (temp) {
117 pci_read_config_dword(pdev, temp, &temp);
118 temp >>= 16;
119 if ((temp & (3 << 13)) == (1 << 13)) {
120 temp &= 0x1fff;
121 ehci->debug = hcd->regs + temp;
122 temp = readl (&ehci->debug->control);
123 ehci_info (ehci, "debug port %d%s\n",
124 HCS_DEBUG_PORT(ehci->hcs_params),
125 (temp & DBGP_ENABLED)
126 ? " IN USE"
127 : "");
128 if (!(temp & DBGP_ENABLED))
129 ehci->debug = NULL;
130 }
131 } 84 }
85 }
132 86
133 temp = HCC_EXT_CAPS (readl (&ehci->caps->hcc_params)); 87 temp = HCC_EXT_CAPS(readl(&ehci->caps->hcc_params));
134 } else
135 temp = 0;
136 88
137 /* EHCI 0.96 and later may have "extended capabilities" */ 89 /* EHCI 0.96 and later may have "extended capabilities" */
138 while (temp && count--) { 90 while (temp && count--) {
139 u32 cap; 91 u32 cap;
140 92
141 pci_read_config_dword (to_pci_dev(hcd->self.controller), 93 pci_read_config_dword(pdev, temp, &cap);
142 temp, &cap); 94 ehci_dbg(ehci, "capability %04x at %02x\n", cap, temp);
143 ehci_dbg (ehci, "capability %04x at %02x\n", cap, temp);
144 switch (cap & 0xff) { 95 switch (cap & 0xff) {
145 case 1: /* BIOS/SMM/... handoff */ 96 case 1: /* BIOS/SMM/... handoff */
146 if (bios_handoff (ehci, temp, cap) != 0) 97 if (bios_handoff(ehci, temp, cap) != 0)
147 return -EOPNOTSUPP; 98 return -EOPNOTSUPP;
148 break; 99 break;
149 case 0: /* illegal reserved capability */ 100 case 0: /* illegal reserved capability */
150 ehci_warn (ehci, "illegal capability!\n"); 101 ehci_dbg(ehci, "illegal capability!\n");
151 cap = 0; 102 cap = 0;
152 /* FALLTHROUGH */ 103 /* FALLTHROUGH */
153 default: /* unknown */ 104 default: /* unknown */
@@ -156,77 +107,109 @@ static int ehci_pci_reset (struct usb_hcd *hcd)
156 temp = (cap >> 8) & 0xff; 107 temp = (cap >> 8) & 0xff;
157 } 108 }
158 if (!count) { 109 if (!count) {
159 ehci_err (ehci, "bogus capabilities ... PCI problems!\n"); 110 ehci_err(ehci, "bogus capabilities ... PCI problems!\n");
160 return -EIO; 111 return -EIO;
161 } 112 }
162 if (ehci_is_TDI(ehci))
163 ehci_reset (ehci);
164 113
165 ehci_port_power (ehci, 0); 114 /* PCI Memory-Write-Invalidate cycle support is optional (uncommon) */
115 retval = pci_set_mwi(pdev);
116 if (!retval)
117 ehci_dbg(ehci, "MWI active\n");
118
119 ehci_port_power(ehci, 0);
120
121 return 0;
122}
123
124/* called by khubd or root hub (re)init threads; leaves HC in halt state */
125static int ehci_pci_reset(struct usb_hcd *hcd)
126{
127 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
128 struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
129 u32 temp;
130 int retval;
131
132 ehci->caps = hcd->regs;
133 ehci->regs = hcd->regs + HC_LENGTH(readl(&ehci->caps->hc_capbase));
134 dbg_hcs_params(ehci, "reset");
135 dbg_hcc_params(ehci, "reset");
136
137 /* cache this readonly data; minimize chip reads */
138 ehci->hcs_params = readl(&ehci->caps->hcs_params);
139
140 retval = ehci_halt(ehci);
141 if (retval)
142 return retval;
143
144 /* NOTE: only the parts below this line are PCI-specific */
145
146 switch (pdev->vendor) {
147 case PCI_VENDOR_ID_TDI:
148 if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) {
149 ehci->is_tdi_rh_tt = 1;
150 tdi_reset(ehci);
151 }
152 break;
153 case PCI_VENDOR_ID_AMD:
154 /* AMD8111 EHCI doesn't work, according to AMD errata */
155 if (pdev->device == 0x7463) {
156 ehci_info(ehci, "ignoring AMD8111 (errata)\n");
157 return -EIO;
158 }
159 break;
160 case PCI_VENDOR_ID_NVIDIA:
161 /* NVidia reports that certain chips don't handle
162 * QH, ITD, or SITD addresses above 2GB. (But TD,
163 * data buffer, and periodic schedule are normal.)
164 */
165 switch (pdev->device) {
166 case 0x003c: /* MCP04 */
167 case 0x005b: /* CK804 */
168 case 0x00d8: /* CK8 */
169 case 0x00e8: /* CK8S */
170 if (pci_set_consistent_dma_mask(pdev,
171 DMA_31BIT_MASK) < 0)
172 ehci_warn(ehci, "can't enable NVidia "
173 "workaround for >2GB RAM\n");
174 break;
175 }
176 break;
177 }
178
179 if (ehci_is_TDI(ehci))
180 ehci_reset(ehci);
166 181
167 /* at least the Genesys GL880S needs fixup here */ 182 /* at least the Genesys GL880S needs fixup here */
168 temp = HCS_N_CC(ehci->hcs_params) * HCS_N_PCC(ehci->hcs_params); 183 temp = HCS_N_CC(ehci->hcs_params) * HCS_N_PCC(ehci->hcs_params);
169 temp &= 0x0f; 184 temp &= 0x0f;
170 if (temp && HCS_N_PORTS(ehci->hcs_params) > temp) { 185 if (temp && HCS_N_PORTS(ehci->hcs_params) > temp) {
171 ehci_dbg (ehci, "bogus port configuration: " 186 ehci_dbg(ehci, "bogus port configuration: "
172 "cc=%d x pcc=%d < ports=%d\n", 187 "cc=%d x pcc=%d < ports=%d\n",
173 HCS_N_CC(ehci->hcs_params), 188 HCS_N_CC(ehci->hcs_params),
174 HCS_N_PCC(ehci->hcs_params), 189 HCS_N_PCC(ehci->hcs_params),
175 HCS_N_PORTS(ehci->hcs_params)); 190 HCS_N_PORTS(ehci->hcs_params));
176 191
177 if (hcd->self.controller->bus == &pci_bus_type) { 192 switch (pdev->vendor) {
178 struct pci_dev *pdev; 193 case 0x17a0: /* GENESYS */
179 194 /* GL880S: should be PORTS=2 */
180 pdev = to_pci_dev(hcd->self.controller); 195 temp |= (ehci->hcs_params & ~0xf);
181 switch (pdev->vendor) { 196 ehci->hcs_params = temp;
182 case 0x17a0: /* GENESYS */ 197 break;
183 /* GL880S: should be PORTS=2 */ 198 case PCI_VENDOR_ID_NVIDIA:
184 temp |= (ehci->hcs_params & ~0xf); 199 /* NF4: should be PCC=10 */
185 ehci->hcs_params = temp; 200 break;
186 break;
187 case PCI_VENDOR_ID_NVIDIA:
188 /* NF4: should be PCC=10 */
189 break;
190 }
191 } 201 }
192 } 202 }
193 203
194 /* force HC to halt state */ 204 /* Serial Bus Release Number is at PCI 0x60 offset */
195 return ehci_halt (ehci); 205 pci_read_config_byte(pdev, 0x60, &ehci->sbrn);
196}
197
198static int ehci_pci_start (struct usb_hcd *hcd)
199{
200 struct ehci_hcd *ehci = hcd_to_ehci (hcd);
201 int result = 0;
202
203 if (hcd->self.controller->bus == &pci_bus_type) {
204 struct pci_dev *pdev;
205 u16 port_wake;
206
207 pdev = to_pci_dev(hcd->self.controller);
208
209 /* Serial Bus Release Number is at PCI 0x60 offset */
210 pci_read_config_byte(pdev, 0x60, &ehci->sbrn);
211
212 /* port wake capability, reported by boot firmware */
213 pci_read_config_word(pdev, 0x62, &port_wake);
214 hcd->can_wakeup = (port_wake & 1) != 0;
215 206
216 /* help hc dma work well with cachelines */ 207 /* REVISIT: per-port wake capability (PCI 0x62) currently unused */
217 result = pci_set_mwi(pdev);
218 if (result)
219 ehci_dbg(ehci, "unable to enable MWI - not fatal.\n");
220 }
221
222 return ehci_run (hcd);
223}
224 208
225/* always called by thread; normally rmmod */ 209 retval = ehci_pci_reinit(ehci, pdev);
226 210
227static void ehci_pci_stop (struct usb_hcd *hcd) 211 /* finish init */
228{ 212 return ehci_init(hcd);
229 ehci_stop (hcd);
230} 213}
231 214
232/*-------------------------------------------------------------------------*/ 215/*-------------------------------------------------------------------------*/
@@ -235,90 +218,88 @@ static void ehci_pci_stop (struct usb_hcd *hcd)
235 218
236/* suspend/resume, section 4.3 */ 219/* suspend/resume, section 4.3 */
237 220
238/* These routines rely on the bus (pci, platform, etc) 221/* These routines rely on the PCI bus glue
239 * to handle powerdown and wakeup, and currently also on 222 * to handle powerdown and wakeup, and currently also on
240 * transceivers that don't need any software attention to set up 223 * transceivers that don't need any software attention to set up
241 * the right sort of wakeup. 224 * the right sort of wakeup.
225 * Also they depend on separate root hub suspend/resume.
242 */ 226 */
243 227
244static int ehci_pci_suspend (struct usb_hcd *hcd, pm_message_t message) 228static int ehci_pci_suspend(struct usb_hcd *hcd, pm_message_t message)
245{ 229{
246 struct ehci_hcd *ehci = hcd_to_ehci (hcd); 230 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
247 231
248 if (time_before (jiffies, ehci->next_statechange)) 232 if (time_before(jiffies, ehci->next_statechange))
249 msleep (100); 233 msleep(10);
250 234
251#ifdef CONFIG_USB_SUSPEND 235 // could save FLADJ in case of Vaux power loss
252 (void) usb_suspend_device (hcd->self.root_hub);
253#else
254 usb_lock_device (hcd->self.root_hub);
255 (void) ehci_bus_suspend (hcd);
256 usb_unlock_device (hcd->self.root_hub);
257#endif
258
259 // save (PCI) FLADJ in case of Vaux power loss
260 // ... we'd only use it to handle clock skew 236 // ... we'd only use it to handle clock skew
261 237
262 return 0; 238 return 0;
263} 239}
264 240
265static int ehci_pci_resume (struct usb_hcd *hcd) 241static int ehci_pci_resume(struct usb_hcd *hcd)
266{ 242{
267 struct ehci_hcd *ehci = hcd_to_ehci (hcd); 243 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
268 unsigned port; 244 unsigned port;
269 struct usb_device *root = hcd->self.root_hub; 245 struct usb_device *root = hcd->self.root_hub;
246 struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
270 int retval = -EINVAL; 247 int retval = -EINVAL;
271 248
272 // maybe restore (PCI) FLADJ 249 // maybe restore FLADJ
273 250
274 if (time_before (jiffies, ehci->next_statechange)) 251 if (time_before(jiffies, ehci->next_statechange))
275 msleep (100); 252 msleep(100);
253
254 /* If CF is clear, we lost PCI Vaux power and need to restart. */
255 if (readl(&ehci->regs->configured_flag) != FLAG_CF)
256 goto restart;
276 257
277 /* If any port is suspended (or owned by the companion), 258 /* If any port is suspended (or owned by the companion),
278 * we know we can/must resume the HC (and mustn't reset it). 259 * we know we can/must resume the HC (and mustn't reset it).
260 * We just defer that to the root hub code.
279 */ 261 */
280 for (port = HCS_N_PORTS (ehci->hcs_params); port > 0; ) { 262 for (port = HCS_N_PORTS(ehci->hcs_params); port > 0; ) {
281 u32 status; 263 u32 status;
282 port--; 264 port--;
283 status = readl (&ehci->regs->port_status [port]); 265 status = readl(&ehci->regs->port_status [port]);
284 if (!(status & PORT_POWER)) 266 if (!(status & PORT_POWER))
285 continue; 267 continue;
286 if (status & (PORT_SUSPEND | PORT_OWNER)) { 268 if (status & (PORT_SUSPEND | PORT_RESUME | PORT_OWNER)) {
287 down (&hcd->self.root_hub->serialize); 269 usb_hcd_resume_root_hub(hcd);
288 retval = ehci_bus_resume (hcd); 270 return 0;
289 up (&hcd->self.root_hub->serialize);
290 break;
291 } 271 }
272 }
273
274restart:
275 ehci_dbg(ehci, "lost power, restarting\n");
276 for (port = HCS_N_PORTS(ehci->hcs_params); port > 0; ) {
277 port--;
292 if (!root->children [port]) 278 if (!root->children [port])
293 continue; 279 continue;
294 dbg_port (ehci, __FUNCTION__, port + 1, status); 280 usb_set_device_state(root->children[port],
295 usb_set_device_state (root->children[port],
296 USB_STATE_NOTATTACHED); 281 USB_STATE_NOTATTACHED);
297 } 282 }
298 283
299 /* Else reset, to cope with power loss or flush-to-storage 284 /* Else reset, to cope with power loss or flush-to-storage
300 * style "resume" having activated BIOS during reboot. 285 * style "resume" having let BIOS kick in during reboot.
301 */ 286 */
302 if (port == 0) { 287 (void) ehci_halt(ehci);
303 (void) ehci_halt (ehci); 288 (void) ehci_reset(ehci);
304 (void) ehci_reset (ehci); 289 (void) ehci_pci_reinit(ehci, pdev);
305 (void) ehci_pci_reset (hcd); 290
306 291 /* emptying the schedule aborts any urbs */
307 /* emptying the schedule aborts any urbs */ 292 spin_lock_irq(&ehci->lock);
308 spin_lock_irq (&ehci->lock); 293 if (ehci->reclaim)
309 if (ehci->reclaim) 294 ehci->reclaim_ready = 1;
310 ehci->reclaim_ready = 1; 295 ehci_work(ehci, NULL);
311 ehci_work (ehci, NULL); 296 spin_unlock_irq(&ehci->lock);
312 spin_unlock_irq (&ehci->lock); 297
313 298 /* restart; khubd will disconnect devices */
314 /* restart; khubd will disconnect devices */ 299 retval = ehci_run(hcd);
315 retval = ehci_run (hcd); 300
316 301 /* here we "know" root ports should always stay powered */
317 /* here we "know" root ports should always stay powered; 302 ehci_port_power(ehci, 1);
318 * but some controllers may lose all power.
319 */
320 ehci_port_power (ehci, 1);
321 }
322 303
323 return retval; 304 return retval;
324} 305}
@@ -339,12 +320,12 @@ static const struct hc_driver ehci_pci_hc_driver = {
339 * basic lifecycle operations 320 * basic lifecycle operations
340 */ 321 */
341 .reset = ehci_pci_reset, 322 .reset = ehci_pci_reset,
342 .start = ehci_pci_start, 323 .start = ehci_run,
343#ifdef CONFIG_PM 324#ifdef CONFIG_PM
344 .suspend = ehci_pci_suspend, 325 .suspend = ehci_pci_suspend,
345 .resume = ehci_pci_resume, 326 .resume = ehci_pci_resume,
346#endif 327#endif
347 .stop = ehci_pci_stop, 328 .stop = ehci_stop,
348 329
349 /* 330 /*
350 * managing i/o requests and associated device resources 331 * managing i/o requests and associated device resources
@@ -377,7 +358,7 @@ static const struct pci_device_id pci_ids [] = { {
377 }, 358 },
378 { /* end: all zeroes */ } 359 { /* end: all zeroes */ }
379}; 360};
380MODULE_DEVICE_TABLE (pci, pci_ids); 361MODULE_DEVICE_TABLE(pci, pci_ids);
381 362
382/* pci driver glue; this is a "new style" PCI driver module */ 363/* pci driver glue; this is a "new style" PCI driver module */
383static struct pci_driver ehci_pci_driver = { 364static struct pci_driver ehci_pci_driver = {
@@ -393,22 +374,22 @@ static struct pci_driver ehci_pci_driver = {
393#endif 374#endif
394}; 375};
395 376
396static int __init ehci_hcd_pci_init (void) 377static int __init ehci_hcd_pci_init(void)
397{ 378{
398 if (usb_disabled()) 379 if (usb_disabled())
399 return -ENODEV; 380 return -ENODEV;
400 381
401 pr_debug ("%s: block sizes: qh %Zd qtd %Zd itd %Zd sitd %Zd\n", 382 pr_debug("%s: block sizes: qh %Zd qtd %Zd itd %Zd sitd %Zd\n",
402 hcd_name, 383 hcd_name,
403 sizeof (struct ehci_qh), sizeof (struct ehci_qtd), 384 sizeof(struct ehci_qh), sizeof(struct ehci_qtd),
404 sizeof (struct ehci_itd), sizeof (struct ehci_sitd)); 385 sizeof(struct ehci_itd), sizeof(struct ehci_sitd));
405 386
406 return pci_register_driver (&ehci_pci_driver); 387 return pci_register_driver(&ehci_pci_driver);
407} 388}
408module_init (ehci_hcd_pci_init); 389module_init(ehci_hcd_pci_init);
409 390
410static void __exit ehci_hcd_pci_cleanup (void) 391static void __exit ehci_hcd_pci_cleanup(void)
411{ 392{
412 pci_unregister_driver (&ehci_pci_driver); 393 pci_unregister_driver(&ehci_pci_driver);
413} 394}
414module_exit (ehci_hcd_pci_cleanup); 395module_exit(ehci_hcd_pci_cleanup);
diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c
index a59e536441e1..5f22e6590cd1 100644
--- a/drivers/usb/host/ohci-pci.c
+++ b/drivers/usb/host/ohci-pci.c
@@ -14,15 +14,6 @@
14 * This file is licenced under the GPL. 14 * This file is licenced under the GPL.
15 */ 15 */
16 16
17#include <linux/jiffies.h>
18
19#ifdef CONFIG_PPC_PMAC
20#include <asm/machdep.h>
21#include <asm/pmac_feature.h>
22#include <asm/pci-bridge.h>
23#include <asm/prom.h>
24#endif
25
26#ifndef CONFIG_PCI 17#ifndef CONFIG_PCI
27#error "This file is PCI bus glue. CONFIG_PCI must be defined." 18#error "This file is PCI bus glue. CONFIG_PCI must be defined."
28#endif 19#endif
@@ -115,39 +106,12 @@ ohci_pci_start (struct usb_hcd *hcd)
115static int ohci_pci_suspend (struct usb_hcd *hcd, pm_message_t message) 106static int ohci_pci_suspend (struct usb_hcd *hcd, pm_message_t message)
116{ 107{
117 /* root hub was already suspended */ 108 /* root hub was already suspended */
118
119 /* FIXME these PMAC things get called in the wrong places. ASIC
120 * clocks should be turned off AFTER entering D3, and on BEFORE
121 * trying to enter D0. Evidently the PCI layer doesn't currently
122 * provide the right sort of platform hooks for this ...
123 */
124#ifdef CONFIG_PPC_PMAC
125 if (_machine == _MACH_Pmac) {
126 struct device_node *of_node;
127
128 /* Disable USB PAD & cell clock */
129 of_node = pci_device_to_OF_node (to_pci_dev(hcd->self.controller));
130 if (of_node)
131 pmac_call_feature(PMAC_FTR_USB_ENABLE, of_node, 0, 0);
132 }
133#endif /* CONFIG_PPC_PMAC */
134 return 0; 109 return 0;
135} 110}
136 111
137 112
138static int ohci_pci_resume (struct usb_hcd *hcd) 113static int ohci_pci_resume (struct usb_hcd *hcd)
139{ 114{
140#ifdef CONFIG_PPC_PMAC
141 if (_machine == _MACH_Pmac) {
142 struct device_node *of_node;
143
144 /* Re-enable USB PAD & cell clock */
145 of_node = pci_device_to_OF_node (to_pci_dev(hcd->self.controller));
146 if (of_node)
147 pmac_call_feature (PMAC_FTR_USB_ENABLE, of_node, 0, 1);
148 }
149#endif /* CONFIG_PPC_PMAC */
150
151 usb_hcd_resume_root_hub(hcd); 115 usb_hcd_resume_root_hub(hcd);
152 return 0; 116 return 0;
153} 117}
diff --git a/drivers/usb/media/sn9c102_core.c b/drivers/usb/media/sn9c102_core.c
index cf8cfbabefde..b2e66e3b90aa 100644
--- a/drivers/usb/media/sn9c102_core.c
+++ b/drivers/usb/media/sn9c102_core.c
@@ -199,7 +199,7 @@ static void sn9c102_release_buffers(struct sn9c102_device* cam)
199{ 199{
200 if (cam->nbuffers) { 200 if (cam->nbuffers) {
201 rvfree(cam->frame[0].bufmem, 201 rvfree(cam->frame[0].bufmem,
202 cam->nbuffers * cam->frame[0].buf.length); 202 cam->nbuffers * PAGE_ALIGN(cam->frame[0].buf.length));
203 cam->nbuffers = 0; 203 cam->nbuffers = 0;
204 } 204 }
205} 205}
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 61204bf7cd78..06e04b442ff1 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -475,6 +475,8 @@ static struct usb_device_id id_table_combined [] = {
475 { USB_DEVICE(FTDI_VID, FTDI_ARTEMIS_PID) }, 475 { USB_DEVICE(FTDI_VID, FTDI_ARTEMIS_PID) },
476 { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16_PID) }, 476 { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16_PID) },
477 { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16HR_PID) }, 477 { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16HR_PID) },
478 { USB_DEVICE(KOBIL_VID, KOBIL_CONV_B1_PID) },
479 { USB_DEVICE(KOBIL_VID, KOBIL_CONV_KAAN_PID) },
478 { }, /* Optional parameter entry */ 480 { }, /* Optional parameter entry */
479 { } /* Terminating entry */ 481 { } /* Terminating entry */
480}; 482};
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
index ddb63df31ce6..773ea3eca086 100644
--- a/drivers/usb/serial/ftdi_sio.h
+++ b/drivers/usb/serial/ftdi_sio.h
@@ -128,6 +128,13 @@
128#define SEALEVEL_2803_8_PID 0X2883 /* SeaLINK+8 (2803) Port 8 */ 128#define SEALEVEL_2803_8_PID 0X2883 /* SeaLINK+8 (2803) Port 8 */
129 129
130/* 130/*
131 * The following are the values for two KOBIL chipcard terminals.
132 */
133#define KOBIL_VID 0x0d46 /* KOBIL Vendor ID */
134#define KOBIL_CONV_B1_PID 0x2020 /* KOBIL Konverter for B1 */
135#define KOBIL_CONV_KAAN_PID 0x2021 /* KOBIL_Konverter for KAAN */
136
137/*
131 * DSS-20 Sync Station for Sony Ericsson P800 138 * DSS-20 Sync Station for Sony Ericsson P800
132 */ 139 */
133 140
diff --git a/drivers/usb/serial/ipw.c b/drivers/usb/serial/ipw.c
index a02fada85362..7744b8148bc5 100644
--- a/drivers/usb/serial/ipw.c
+++ b/drivers/usb/serial/ipw.c
@@ -46,7 +46,6 @@
46#include <linux/module.h> 46#include <linux/module.h>
47#include <linux/spinlock.h> 47#include <linux/spinlock.h>
48#include <linux/usb.h> 48#include <linux/usb.h>
49#include <linux/usb.h>
50#include <asm/uaccess.h> 49#include <asm/uaccess.h>
51#include "usb-serial.h" 50#include "usb-serial.h"
52 51
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 0a9858f69a9b..f5f47a34b168 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -1118,6 +1118,15 @@ UNUSUAL_DEV( 0x2735, 0x100b, 0x0000, 0x9999,
1118 US_SC_DEVICE, US_PR_DEVICE, NULL, 1118 US_SC_DEVICE, US_PR_DEVICE, NULL,
1119 US_FL_GO_SLOW ), 1119 US_FL_GO_SLOW ),
1120 1120
1121/*
1122 * David Härdeman <david@2gen.com>
1123 * The key makes the SCSI stack print confusing (but harmless) messages
1124 */
1125UNUSUAL_DEV( 0x4146, 0xba01, 0x0100, 0x0100,
1126 "Iomega",
1127 "Micro Mini 1GB",
1128 US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_NOT_LOCKABLE ),
1129
1121#ifdef CONFIG_USB_STORAGE_SDDR55 1130#ifdef CONFIG_USB_STORAGE_SDDR55
1122UNUSUAL_DEV( 0x55aa, 0xa103, 0x0000, 0x9999, 1131UNUSUAL_DEV( 0x55aa, 0xa103, 0x0000, 0x9999,
1123 "Sandisk", 1132 "Sandisk",
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 9f180096c896..6240aedb4154 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -452,13 +452,17 @@ int fb_prepare_logo(struct fb_info *info, int rotate)
452 452
453 /* Return if no suitable logo was found */ 453 /* Return if no suitable logo was found */
454 fb_logo.logo = fb_find_logo(depth); 454 fb_logo.logo = fb_find_logo(depth);
455
456 if (!fb_logo.logo) {
457 return 0;
458 }
455 459
456 if (rotate == FB_ROTATE_UR || rotate == FB_ROTATE_UD) 460 if (rotate == FB_ROTATE_UR || rotate == FB_ROTATE_UD)
457 yres = info->var.yres; 461 yres = info->var.yres;
458 else 462 else
459 yres = info->var.xres; 463 yres = info->var.xres;
460 464
461 if (fb_logo.logo && fb_logo.logo->height > yres) { 465 if (fb_logo.logo->height > yres) {
462 fb_logo.logo = NULL; 466 fb_logo.logo = NULL;
463 return 0; 467 return 0;
464 } 468 }
diff --git a/fs/exec.c b/fs/exec.c
index c466fec5de20..1f8a9fd2c9ed 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -668,7 +668,7 @@ static inline int de_thread(struct task_struct *tsk)
668 if (!thread_group_leader(current)) { 668 if (!thread_group_leader(current)) {
669 struct task_struct *parent; 669 struct task_struct *parent;
670 struct dentry *proc_dentry1, *proc_dentry2; 670 struct dentry *proc_dentry1, *proc_dentry2;
671 unsigned long exit_state, ptrace; 671 unsigned long ptrace;
672 672
673 /* 673 /*
674 * Wait for the thread group leader to be a zombie. 674 * Wait for the thread group leader to be a zombie.
@@ -726,15 +726,15 @@ static inline int de_thread(struct task_struct *tsk)
726 list_del(&current->tasks); 726 list_del(&current->tasks);
727 list_add_tail(&current->tasks, &init_task.tasks); 727 list_add_tail(&current->tasks, &init_task.tasks);
728 current->exit_signal = SIGCHLD; 728 current->exit_signal = SIGCHLD;
729 exit_state = leader->exit_state; 729
730 BUG_ON(leader->exit_state != EXIT_ZOMBIE);
731 leader->exit_state = EXIT_DEAD;
730 732
731 write_unlock_irq(&tasklist_lock); 733 write_unlock_irq(&tasklist_lock);
732 spin_unlock(&leader->proc_lock); 734 spin_unlock(&leader->proc_lock);
733 spin_unlock(&current->proc_lock); 735 spin_unlock(&current->proc_lock);
734 proc_pid_flush(proc_dentry1); 736 proc_pid_flush(proc_dentry1);
735 proc_pid_flush(proc_dentry2); 737 proc_pid_flush(proc_dentry2);
736
737 BUG_ON(exit_state != EXIT_ZOMBIE);
738 } 738 }
739 739
740 /* 740 /*
diff --git a/fs/jffs2/debug.h b/fs/jffs2/debug.h
index f193d43a8a59..162af6dfe292 100644
--- a/fs/jffs2/debug.h
+++ b/fs/jffs2/debug.h
@@ -82,28 +82,28 @@
82 do { \ 82 do { \
83 printk(JFFS2_ERR_MSG_PREFIX \ 83 printk(JFFS2_ERR_MSG_PREFIX \
84 " (%d) %s: " fmt, current->pid, \ 84 " (%d) %s: " fmt, current->pid, \
85 __FUNCTION__, ##__VA_ARGS__); \ 85 __FUNCTION__ , ##__VA_ARGS__); \
86 } while(0) 86 } while(0)
87 87
88#define JFFS2_WARNING(fmt, ...) \ 88#define JFFS2_WARNING(fmt, ...) \
89 do { \ 89 do { \
90 printk(JFFS2_WARN_MSG_PREFIX \ 90 printk(JFFS2_WARN_MSG_PREFIX \
91 " (%d) %s: " fmt, current->pid, \ 91 " (%d) %s: " fmt, current->pid, \
92 __FUNCTION__, ##__VA_ARGS__); \ 92 __FUNCTION__ , ##__VA_ARGS__); \
93 } while(0) 93 } while(0)
94 94
95#define JFFS2_NOTICE(fmt, ...) \ 95#define JFFS2_NOTICE(fmt, ...) \
96 do { \ 96 do { \
97 printk(JFFS2_NOTICE_MSG_PREFIX \ 97 printk(JFFS2_NOTICE_MSG_PREFIX \
98 " (%d) %s: " fmt, current->pid, \ 98 " (%d) %s: " fmt, current->pid, \
99 __FUNCTION__, ##__VA_ARGS__); \ 99 __FUNCTION__ , ##__VA_ARGS__); \
100 } while(0) 100 } while(0)
101 101
102#define JFFS2_DEBUG(fmt, ...) \ 102#define JFFS2_DEBUG(fmt, ...) \
103 do { \ 103 do { \
104 printk(JFFS2_DBG_MSG_PREFIX \ 104 printk(JFFS2_DBG_MSG_PREFIX \
105 " (%d) %s: " fmt, current->pid, \ 105 " (%d) %s: " fmt, current->pid, \
106 __FUNCTION__, ##__VA_ARGS__); \ 106 __FUNCTION__ , ##__VA_ARGS__); \
107 } while(0) 107 } while(0)
108 108
109/* 109/*
diff --git a/include/asm-alpha/atomic.h b/include/asm-alpha/atomic.h
index 36505bb4e8cb..6183eab006d4 100644
--- a/include/asm-alpha/atomic.h
+++ b/include/asm-alpha/atomic.h
@@ -118,8 +118,6 @@ static __inline__ long atomic_add_return(int i, atomic_t * v)
118 return result; 118 return result;
119} 119}
120 120
121#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0)
122
123static __inline__ long atomic64_add_return(long i, atomic64_t * v) 121static __inline__ long atomic64_add_return(long i, atomic64_t * v)
124{ 122{
125 long temp, result; 123 long temp, result;
@@ -189,6 +187,9 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
189}) 187})
190#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 188#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
191 189
190#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0)
191#define atomic64_add_negative(a, v) (atomic64_add_return((a), (v)) < 0)
192
192#define atomic_dec_return(v) atomic_sub_return(1,(v)) 193#define atomic_dec_return(v) atomic_sub_return(1,(v))
193#define atomic64_dec_return(v) atomic64_sub_return(1,(v)) 194#define atomic64_dec_return(v) atomic64_sub_return(1,(v))
194 195
@@ -199,6 +200,8 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
199#define atomic64_sub_and_test(i,v) (atomic64_sub_return((i), (v)) == 0) 200#define atomic64_sub_and_test(i,v) (atomic64_sub_return((i), (v)) == 0)
200 201
201#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0) 202#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0)
203#define atomic64_inc_and_test(v) (atomic64_add_return(1, (v)) == 0)
204
202#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0) 205#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
203#define atomic64_dec_and_test(v) (atomic64_sub_return(1, (v)) == 0) 206#define atomic64_dec_and_test(v) (atomic64_sub_return(1, (v)) == 0)
204 207
diff --git a/include/asm-arm/arch-iop3xx/timex.h b/include/asm-arm/arch-iop3xx/timex.h
index d4187fe9a85a..472badb451c4 100644
--- a/include/asm-arm/arch-iop3xx/timex.h
+++ b/include/asm-arm/arch-iop3xx/timex.h
@@ -4,7 +4,7 @@
4 * IOP3xx architecture timex specifications 4 * IOP3xx architecture timex specifications
5 */ 5 */
6#include <linux/config.h> 6#include <linux/config.h>
7 7#include <asm/hardware.h>
8 8
9#if defined(CONFIG_ARCH_IQ80321) || defined(CONFIG_ARCH_IQ31244) 9#if defined(CONFIG_ARCH_IQ80321) || defined(CONFIG_ARCH_IQ31244)
10 10
diff --git a/include/asm-powerpc/page_64.h b/include/asm-powerpc/page_64.h
index 1e6e7846824f..58a3dd9a79ec 100644
--- a/include/asm-powerpc/page_64.h
+++ b/include/asm-powerpc/page_64.h
@@ -135,9 +135,9 @@ extern unsigned int HPAGE_SHIFT;
135 135
136#define in_hugepage_area(context, addr) \ 136#define in_hugepage_area(context, addr) \
137 (cpu_has_feature(CPU_FTR_16M_PAGE) && \ 137 (cpu_has_feature(CPU_FTR_16M_PAGE) && \
138 ( ((1 << GET_HTLB_AREA(addr)) & (context).high_htlb_areas) || \ 138 ( ( (addr) >= 0x100000000UL) \
139 ( ((addr) < 0x100000000L) && \ 139 ? ((1 << GET_HTLB_AREA(addr)) & (context).high_htlb_areas) \
140 ((1 << GET_ESID(addr)) & (context).low_htlb_areas) ) ) ) 140 : ((1 << GET_ESID(addr)) & (context).low_htlb_areas) ) )
141 141
142#else /* !CONFIG_HUGETLB_PAGE */ 142#else /* !CONFIG_HUGETLB_PAGE */
143 143
diff --git a/include/asm-sparc64/atomic.h b/include/asm-sparc64/atomic.h
index 8198c3d0d007..3789fe315992 100644
--- a/include/asm-sparc64/atomic.h
+++ b/include/asm-sparc64/atomic.h
@@ -54,6 +54,7 @@ extern int atomic64_sub_ret(int, atomic64_t *);
54 * other cases. 54 * other cases.
55 */ 55 */
56#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0) 56#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
57#define atomic64_inc_and_test(v) (atomic64_inc_return(v) == 0)
57 58
58#define atomic_sub_and_test(i, v) (atomic_sub_ret(i, v) == 0) 59#define atomic_sub_and_test(i, v) (atomic_sub_ret(i, v) == 0)
59#define atomic64_sub_and_test(i, v) (atomic64_sub_ret(i, v) == 0) 60#define atomic64_sub_and_test(i, v) (atomic64_sub_ret(i, v) == 0)
diff --git a/include/asm-x86_64/atomic.h b/include/asm-x86_64/atomic.h
index 0866ef67f198..50db9f39274f 100644
--- a/include/asm-x86_64/atomic.h
+++ b/include/asm-x86_64/atomic.h
@@ -160,8 +160,8 @@ static __inline__ int atomic_inc_and_test(atomic_t *v)
160 160
161/** 161/**
162 * atomic_add_negative - add and test if negative 162 * atomic_add_negative - add and test if negative
163 * @v: pointer of type atomic_t
164 * @i: integer value to add 163 * @i: integer value to add
164 * @v: pointer of type atomic_t
165 * 165 *
166 * Atomically adds @i to @v and returns true 166 * Atomically adds @i to @v and returns true
167 * if the result is negative, or false when 167 * if the result is negative, or false when
@@ -178,6 +178,31 @@ static __inline__ int atomic_add_negative(int i, atomic_t *v)
178 return c; 178 return c;
179} 179}
180 180
181/**
182 * atomic_add_return - add and return
183 * @i: integer value to add
184 * @v: pointer of type atomic_t
185 *
186 * Atomically adds @i to @v and returns @i + @v
187 */
188static __inline__ int atomic_add_return(int i, atomic_t *v)
189{
190 int __i = i;
191 __asm__ __volatile__(
192 LOCK "xaddl %0, %1;"
193 :"=r"(i)
194 :"m"(v->counter), "0"(i));
195 return i + __i;
196}
197
198static __inline__ int atomic_sub_return(int i, atomic_t *v)
199{
200 return atomic_add_return(-i,v);
201}
202
203#define atomic_inc_return(v) (atomic_add_return(1,v))
204#define atomic_dec_return(v) (atomic_sub_return(1,v))
205
181/* An 64bit atomic type */ 206/* An 64bit atomic type */
182 207
183typedef struct { volatile long counter; } atomic64_t; 208typedef struct { volatile long counter; } atomic64_t;
@@ -320,14 +345,14 @@ static __inline__ int atomic64_inc_and_test(atomic64_t *v)
320 345
321/** 346/**
322 * atomic64_add_negative - add and test if negative 347 * atomic64_add_negative - add and test if negative
323 * @v: pointer to atomic64_t
324 * @i: integer value to add 348 * @i: integer value to add
349 * @v: pointer to type atomic64_t
325 * 350 *
326 * Atomically adds @i to @v and returns true 351 * Atomically adds @i to @v and returns true
327 * if the result is negative, or false when 352 * if the result is negative, or false when
328 * result is greater than or equal to zero. 353 * result is greater than or equal to zero.
329 */ 354 */
330static __inline__ long atomic64_add_negative(long i, atomic64_t *v) 355static __inline__ int atomic64_add_negative(long i, atomic64_t *v)
331{ 356{
332 unsigned char c; 357 unsigned char c;
333 358
@@ -339,27 +364,30 @@ static __inline__ long atomic64_add_negative(long i, atomic64_t *v)
339} 364}
340 365
341/** 366/**
342 * atomic_add_return - add and return 367 * atomic64_add_return - add and return
343 * @v: pointer of type atomic_t
344 * @i: integer value to add 368 * @i: integer value to add
369 * @v: pointer to type atomic64_t
345 * 370 *
346 * Atomically adds @i to @v and returns @i + @v 371 * Atomically adds @i to @v and returns @i + @v
347 */ 372 */
348static __inline__ int atomic_add_return(int i, atomic_t *v) 373static __inline__ long atomic64_add_return(long i, atomic64_t *v)
349{ 374{
350 int __i = i; 375 long __i = i;
351 __asm__ __volatile__( 376 __asm__ __volatile__(
352 LOCK "xaddl %0, %1;" 377 LOCK "xaddq %0, %1;"
353 :"=r"(i) 378 :"=r"(i)
354 :"m"(v->counter), "0"(i)); 379 :"m"(v->counter), "0"(i));
355 return i + __i; 380 return i + __i;
356} 381}
357 382
358static __inline__ int atomic_sub_return(int i, atomic_t *v) 383static __inline__ long atomic64_sub_return(long i, atomic64_t *v)
359{ 384{
360 return atomic_add_return(-i,v); 385 return atomic64_add_return(-i,v);
361} 386}
362 387
388#define atomic64_inc_return(v) (atomic64_add_return(1,v))
389#define atomic64_dec_return(v) (atomic64_sub_return(1,v))
390
363#define atomic_cmpxchg(v, old, new) ((int)cmpxchg(&((v)->counter), old, new)) 391#define atomic_cmpxchg(v, old, new) ((int)cmpxchg(&((v)->counter), old, new))
364 392
365/** 393/**
@@ -381,9 +409,6 @@ static __inline__ int atomic_sub_return(int i, atomic_t *v)
381}) 409})
382#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 410#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
383 411
384#define atomic_inc_return(v) (atomic_add_return(1,v))
385#define atomic_dec_return(v) (atomic_sub_return(1,v))
386
387/* These are x86-specific, used by some header files */ 412/* These are x86-specific, used by some header files */
388#define atomic_clear_mask(mask, addr) \ 413#define atomic_clear_mask(mask, addr) \
389__asm__ __volatile__(LOCK "andl %0,%1" \ 414__asm__ __volatile__(LOCK "andl %0,%1" \
diff --git a/include/linux/smp.h b/include/linux/smp.h
index b6069c8e1f04..9dfa3ee769ae 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -94,13 +94,7 @@ void smp_prepare_boot_cpu(void);
94 */ 94 */
95#define raw_smp_processor_id() 0 95#define raw_smp_processor_id() 0
96#define hard_smp_processor_id() 0 96#define hard_smp_processor_id() 0
97 97#define smp_call_function(func,info,retry,wait) ({ 0; })
98static inline int smp_call_function(void (*func) (void *info), void *info,
99 int retry, int wait)
100{
101 return 0;
102}
103
104#define on_each_cpu(func,info,retry,wait) ({ func(info); 0; }) 98#define on_each_cpu(func,info,retry,wait) ({ func(info); 0; })
105static inline void smp_send_reschedule(int cpu) { } 99static inline void smp_send_reschedule(int cpu) { }
106#define num_booting_cpus() 1 100#define num_booting_cpus() 1
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 856d232c7562..d81b050e5955 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -47,6 +47,7 @@ struct usb_driver;
47 * @urb_list: urbs queued to this endpoint; maintained by usbcore 47 * @urb_list: urbs queued to this endpoint; maintained by usbcore
48 * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH) 48 * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH)
49 * with one or more transfer descriptors (TDs) per urb 49 * with one or more transfer descriptors (TDs) per urb
50 * @kobj: kobject for sysfs info
50 * @extra: descriptors following this endpoint in the configuration 51 * @extra: descriptors following this endpoint in the configuration
51 * @extralen: how many bytes of "extra" are valid 52 * @extralen: how many bytes of "extra" are valid
52 * 53 *
diff --git a/kernel/futex.c b/kernel/futex.c
index aca8d10704f6..5872e3507f35 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -201,21 +201,6 @@ static int get_futex_key(unsigned long uaddr, union futex_key *key)
201 * from swap. But that's a lot of code to duplicate here 201 * from swap. But that's a lot of code to duplicate here
202 * for a rare case, so we simply fetch the page. 202 * for a rare case, so we simply fetch the page.
203 */ 203 */
204
205 /*
206 * Do a quick atomic lookup first - this is the fastpath.
207 */
208 page = follow_page(mm, uaddr, FOLL_TOUCH|FOLL_GET);
209 if (likely(page != NULL)) {
210 key->shared.pgoff =
211 page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT);
212 put_page(page);
213 return 0;
214 }
215
216 /*
217 * Do it the general way.
218 */
219 err = get_user_pages(current, mm, uaddr, 1, 0, 0, &page, NULL); 204 err = get_user_pages(current, mm, uaddr, 1, 0, 0, &page, NULL);
220 if (err >= 0) { 205 if (err >= 0) {
221 key->shared.pgoff = 206 key->shared.pgoff =
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 3bd7226d15fa..81c49a4d679e 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -36,6 +36,9 @@ void synchronize_irq(unsigned int irq)
36{ 36{
37 struct irq_desc *desc = irq_desc + irq; 37 struct irq_desc *desc = irq_desc + irq;
38 38
39 if (irq >= NR_IRQS)
40 return;
41
39 while (desc->status & IRQ_INPROGRESS) 42 while (desc->status & IRQ_INPROGRESS)
40 cpu_relax(); 43 cpu_relax();
41} 44}
@@ -60,6 +63,9 @@ void disable_irq_nosync(unsigned int irq)
60 irq_desc_t *desc = irq_desc + irq; 63 irq_desc_t *desc = irq_desc + irq;
61 unsigned long flags; 64 unsigned long flags;
62 65
66 if (irq >= NR_IRQS)
67 return;
68
63 spin_lock_irqsave(&desc->lock, flags); 69 spin_lock_irqsave(&desc->lock, flags);
64 if (!desc->depth++) { 70 if (!desc->depth++) {
65 desc->status |= IRQ_DISABLED; 71 desc->status |= IRQ_DISABLED;
@@ -86,6 +92,9 @@ void disable_irq(unsigned int irq)
86{ 92{
87 irq_desc_t *desc = irq_desc + irq; 93 irq_desc_t *desc = irq_desc + irq;
88 94
95 if (irq >= NR_IRQS)
96 return;
97
89 disable_irq_nosync(irq); 98 disable_irq_nosync(irq);
90 if (desc->action) 99 if (desc->action)
91 synchronize_irq(irq); 100 synchronize_irq(irq);
@@ -108,6 +117,9 @@ void enable_irq(unsigned int irq)
108 irq_desc_t *desc = irq_desc + irq; 117 irq_desc_t *desc = irq_desc + irq;
109 unsigned long flags; 118 unsigned long flags;
110 119
120 if (irq >= NR_IRQS)
121 return;
122
111 spin_lock_irqsave(&desc->lock, flags); 123 spin_lock_irqsave(&desc->lock, flags);
112 switch (desc->depth) { 124 switch (desc->depth) {
113 case 0: 125 case 0:
@@ -163,6 +175,9 @@ int setup_irq(unsigned int irq, struct irqaction * new)
163 unsigned long flags; 175 unsigned long flags;
164 int shared = 0; 176 int shared = 0;
165 177
178 if (irq >= NR_IRQS)
179 return -EINVAL;
180
166 if (desc->handler == &no_irq_type) 181 if (desc->handler == &no_irq_type)
167 return -ENOSYS; 182 return -ENOSYS;
168 /* 183 /*
diff --git a/kernel/printk.c b/kernel/printk.c
index ac8a08f36207..5287be83e3e7 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -956,7 +956,7 @@ int unregister_console(struct console *console)
956 if (console_drivers == console) { 956 if (console_drivers == console) {
957 console_drivers=console->next; 957 console_drivers=console->next;
958 res = 0; 958 res = 0;
959 } else { 959 } else if (console_drivers) {
960 for (a=console_drivers->next, b=console_drivers ; 960 for (a=console_drivers->next, b=console_drivers ;
961 a; b=a, a=b->next) { 961 a; b=a, a=b->next) {
962 if (a == console) { 962 if (a == console) {
diff --git a/mm/Kconfig b/mm/Kconfig
index ae9ce6b73e8a..21eb51d4da8f 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -125,12 +125,10 @@ comment "Memory hotplug is currently incompatible with Software Suspend"
125# space can be handled with less contention: split it at this NR_CPUS. 125# space can be handled with less contention: split it at this NR_CPUS.
126# Default to 4 for wider testing, though 8 might be more appropriate. 126# Default to 4 for wider testing, though 8 might be more appropriate.
127# ARM's adjust_pte (unused if VIPT) depends on mm-wide page_table_lock. 127# ARM's adjust_pte (unused if VIPT) depends on mm-wide page_table_lock.
128# PA-RISC's debug spinlock_t is too large for the 32-bit struct page. 128# PA-RISC 7xxx's spinlock_t would enlarge struct page from 32 to 44 bytes.
129# ARM26 and SPARC32 and PPC64 may use one page for multiple page tables.
130# 129#
131config SPLIT_PTLOCK_CPUS 130config SPLIT_PTLOCK_CPUS
132 int 131 int
133 default "4096" if ARM && !CPU_CACHE_VIPT 132 default "4096" if ARM && !CPU_CACHE_VIPT
134 default "4096" if PARISC && DEBUG_SPINLOCK && !64BIT 133 default "4096" if PARISC && !PA20
135 default "4096" if ARM26 || SPARC32 || PPC64
136 default "4" 134 default "4"
diff --git a/mm/truncate.c b/mm/truncate.c
index 29c18f68dc35..9173ab500604 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -282,8 +282,8 @@ int invalidate_inode_pages2_range(struct address_space *mapping,
282 * Zap the rest of the file in one hit. 282 * Zap the rest of the file in one hit.
283 */ 283 */
284 unmap_mapping_range(mapping, 284 unmap_mapping_range(mapping,
285 page_index << PAGE_CACHE_SHIFT, 285 (loff_t)page_index<<PAGE_CACHE_SHIFT,
286 (end - page_index + 1) 286 (loff_t)(end - page_index + 1)
287 << PAGE_CACHE_SHIFT, 287 << PAGE_CACHE_SHIFT,
288 0); 288 0);
289 did_range_unmap = 1; 289 did_range_unmap = 1;
@@ -292,7 +292,7 @@ int invalidate_inode_pages2_range(struct address_space *mapping,
292 * Just zap this page 292 * Just zap this page
293 */ 293 */
294 unmap_mapping_range(mapping, 294 unmap_mapping_range(mapping,
295 page_index << PAGE_CACHE_SHIFT, 295 (loff_t)page_index<<PAGE_CACHE_SHIFT,
296 PAGE_CACHE_SIZE, 0); 296 PAGE_CACHE_SIZE, 0);
297 } 297 }
298 } 298 }
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index defcf6a8607c..975abe254b7a 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -366,6 +366,7 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
366 366
367 spin_lock_bh(&br->lock); 367 spin_lock_bh(&br->lock);
368 br_stp_recalculate_bridge_id(br); 368 br_stp_recalculate_bridge_id(br);
369 br_features_recompute(br);
369 if ((br->dev->flags & IFF_UP) 370 if ((br->dev->flags & IFF_UP)
370 && (dev->flags & IFF_UP) && netif_carrier_ok(dev)) 371 && (dev->flags & IFF_UP) && netif_carrier_ok(dev))
371 br_stp_enable_port(p); 372 br_stp_enable_port(p);
diff --git a/net/ipv4/netfilter/ip_conntrack_netlink.c b/net/ipv4/netfilter/ip_conntrack_netlink.c
index 6c18a2b6d5ce..3fce91bcc0ba 100644
--- a/net/ipv4/netfilter/ip_conntrack_netlink.c
+++ b/net/ipv4/netfilter/ip_conntrack_netlink.c
@@ -27,6 +27,7 @@
27#include <linux/errno.h> 27#include <linux/errno.h>
28#include <linux/netlink.h> 28#include <linux/netlink.h>
29#include <linux/spinlock.h> 29#include <linux/spinlock.h>
30#include <linux/interrupt.h>
30#include <linux/notifier.h> 31#include <linux/notifier.h>
31 32
32#include <linux/netfilter.h> 33#include <linux/netfilter.h>