Merge ../linux-2.6

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