Merge ../linux-2.6

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