Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev:
pata_sis: fix MWDMA for <= UDMA66 chipsets and UDMA for UDMA33 chipsets
libata: blacklist SAMSUNG HD401LJ / ZZ100-15 for NCQ
ata_piix: add Tecra M3 to broken suspend blacklist
ata_piix: implement piix_borken_suspend()
pci: rename __pci_reenable_device() to pci_reenable_device()
libata-sff; Unbreak non DMA capable controllers again
pata_cmd64x: Correct the speed ranges

+64 -54
+41 -33
drivers/ata/ata_piix.c
··· 890 890 } 891 891 892 892 #ifdef CONFIG_PM 893 - static struct dmi_system_id piix_broken_suspend_dmi_table[] = { 894 - { 895 - .ident = "TECRA M5", 896 - .matches = { 897 - DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 898 - DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M5"), 893 + static int piix_broken_suspend(void) 894 + { 895 + static struct dmi_system_id sysids[] = { 896 + { 897 + .ident = "TECRA M5", 898 + .matches = { 899 + DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 900 + DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M5"), 901 + }, 899 902 }, 900 - }, 901 - { 902 - .ident = "Satellite U200", 903 - .matches = { 904 - DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 905 - DMI_MATCH(DMI_PRODUCT_NAME, "Satellite U200"), 903 + { 904 + .ident = "Satellite U205", 905 + .matches = { 906 + DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 907 + DMI_MATCH(DMI_PRODUCT_NAME, "Satellite U205"), 908 + }, 906 909 }, 907 - }, 908 - { 909 - .ident = "Satellite U205", 910 - .matches = { 911 - DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 912 - DMI_MATCH(DMI_PRODUCT_NAME, "Satellite U205"), 910 + { 911 + .ident = "Portege M500", 912 + .matches = { 913 + DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 914 + DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE M500"), 915 + }, 913 916 }, 914 - }, 915 - { 916 - .ident = "Portege M500", 917 - .matches = { 918 - DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 919 - DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE M500"), 920 - }, 921 - }, 922 - { } 923 - }; 917 + { } 918 + }; 919 + static const char *oemstrs[] = { 920 + "Tecra M3,", 921 + }; 922 + int i; 923 + 924 + if (dmi_check_system(sysids)) 925 + return 1; 926 + 927 + for (i = 0; i < ARRAY_SIZE(oemstrs); i++) 928 + if (dmi_find_device(DMI_DEV_TYPE_OEM_STRING, oemstrs[i], NULL)) 929 + return 1; 930 + 931 + return 0; 932 + } 924 933 925 934 static int piix_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg) 926 935 { ··· 946 937 * cycles and power trying to do something to the sleeping 947 938 * beauty. 948 939 */ 949 - if (dmi_check_system(piix_broken_suspend_dmi_table) && 950 - mesg.event == PM_EVENT_SUSPEND) { 940 + if (piix_broken_suspend() && mesg.event == PM_EVENT_SUSPEND) { 951 941 pci_save_state(pdev); 952 942 953 943 /* mark its power state as "unknown", since we don't ··· 981 973 pci_restore_state(pdev); 982 974 983 975 /* PCI device wasn't disabled during suspend. Use 984 - * __pci_reenable_device() to avoid affecting the 985 - * enable count. 976 + * pci_reenable_device() to avoid affecting the enable 977 + * count. 986 978 */ 987 - rc = __pci_reenable_device(pdev); 979 + rc = pci_reenable_device(pdev); 988 980 if (rc) 989 981 dev_printk(KERN_ERR, &pdev->dev, "failed to enable " 990 982 "device after resume (%d)\n", rc);
+1
drivers/ata/libata-core.c
··· 3788 3788 { "WDC WD740ADFD-00NLR1", NULL, ATA_HORKAGE_NONCQ, }, 3789 3789 { "FUJITSU MHV2080BH", "00840028", ATA_HORKAGE_NONCQ, }, 3790 3790 { "ST9160821AS", "3.CLF", ATA_HORKAGE_NONCQ, }, 3791 + { "SAMSUNG HD401LJ", "ZZ100-15", ATA_HORKAGE_NONCQ, }, 3791 3792 3792 3793 /* Devices with NCQ limits */ 3793 3794
+4
drivers/ata/libata-sff.c
··· 573 573 struct pci_dev *pdev = to_pci_dev(gdev); 574 574 int i, rc; 575 575 576 + /* No BAR4 allocation: No DMA */ 577 + if (pci_resource_start(pdev, 4) == 0) 578 + return 0; 579 + 576 580 /* TODO: If we get no DMA mask we should fall back to PIO */ 577 581 rc = pci_set_dma_mask(pdev, ATA_DMA_MASK); 578 582 if (rc)
+4 -4
drivers/ata/pata_cmd64x.c
··· 31 31 #include <linux/libata.h> 32 32 33 33 #define DRV_NAME "pata_cmd64x" 34 - #define DRV_VERSION "0.2.3" 34 + #define DRV_VERSION "0.2.4" 35 35 36 36 /* 37 37 * CMD64x specific registers definition. ··· 397 397 .flags = ATA_FLAG_SLAVE_POSS, 398 398 .pio_mask = 0x1f, 399 399 .mwdma_mask = 0x07, 400 - .udma_mask = ATA_UDMA1, 400 + .udma_mask = ATA_UDMA2, 401 401 .port_ops = &cmd64x_port_ops 402 402 }, 403 403 { /* CMD 646 rev 1 */ ··· 412 412 .flags = ATA_FLAG_SLAVE_POSS, 413 413 .pio_mask = 0x1f, 414 414 .mwdma_mask = 0x07, 415 - .udma_mask = ATA_UDMA2, 415 + .udma_mask = ATA_UDMA4, 416 416 .port_ops = &cmd648_port_ops 417 417 }, 418 418 { /* CMD 649 */ ··· 420 420 .flags = ATA_FLAG_SLAVE_POSS, 421 421 .pio_mask = 0x1f, 422 422 .mwdma_mask = 0x07, 423 - .udma_mask = ATA_UDMA3, 423 + .udma_mask = ATA_UDMA5, 424 424 .port_ops = &cmd648_port_ops 425 425 } 426 426 };
+9 -11
drivers/ata/pata_sis.c
··· 2 2 * pata_sis.c - SiS ATA driver 3 3 * 4 4 * (C) 2005 Red Hat <alan@redhat.com> 5 + * (C) 2007 Bartlomiej Zolnierkiewicz 5 6 * 6 7 * Based upon linux/drivers/ide/pci/sis5513.c 7 8 * Copyright (C) 1999-2000 Andre Hedrick <andre@linux-ide.org> ··· 36 35 #include "sis.h" 37 36 38 37 #define DRV_NAME "pata_sis" 39 - #define DRV_VERSION "0.5.1" 38 + #define DRV_VERSION "0.5.2" 40 39 41 40 struct sis_chipset { 42 41 u16 device; /* PCI host ID */ ··· 238 237 } 239 238 240 239 /** 241 - * sis_100_set_pioode - Initialize host controller PATA PIO timings 240 + * sis_100_set_piomode - Initialize host controller PATA PIO timings 242 241 * @ap: Port whose timings we are configuring 243 242 * @adev: Device we are configuring for. 244 243 * ··· 263 262 } 264 263 265 264 /** 266 - * sis_133_set_pioode - Initialize host controller PATA PIO timings 265 + * sis_133_set_piomode - Initialize host controller PATA PIO timings 267 266 * @ap: Port whose timings we are configuring 268 267 * @adev: Device we are configuring for. 269 268 * ··· 335 334 int drive_pci = sis_old_port_base(adev); 336 335 u16 timing; 337 336 338 - const u16 mwdma_bits[] = { 0x707, 0x202, 0x202 }; 337 + const u16 mwdma_bits[] = { 0x008, 0x302, 0x301 }; 339 338 const u16 udma_bits[] = { 0xE000, 0xC000, 0xA000 }; 340 339 341 340 pci_read_config_word(pdev, drive_pci, &timing); ··· 343 342 if (adev->dma_mode < XFER_UDMA_0) { 344 343 /* bits 3-0 hold recovery timing bits 8-10 active timing and 345 344 the higer bits are dependant on the device */ 346 - timing &= ~ 0x870F; 345 + timing &= ~0x870F; 347 346 timing |= mwdma_bits[speed]; 348 - pci_write_config_word(pdev, drive_pci, timing); 349 347 } else { 350 348 /* Bit 15 is UDMA on/off, bit 13-14 are cycle time */ 351 349 speed = adev->dma_mode - XFER_UDMA_0; 352 350 timing &= ~0x6000; 353 351 timing |= udma_bits[speed]; 354 352 } 353 + pci_write_config_word(pdev, drive_pci, timing); 355 354 } 356 355 357 356 /** ··· 374 373 int drive_pci = sis_old_port_base(adev); 375 374 u16 timing; 376 375 377 - const u16 mwdma_bits[] = { 0x707, 0x202, 0x202 }; 376 + const u16 mwdma_bits[] = { 0x008, 0x302, 0x301 }; 378 377 const u16 udma_bits[] = { 0xF000, 0xD000, 0xB000, 0xA000, 0x9000}; 379 378 380 379 pci_read_config_word(pdev, drive_pci, &timing); ··· 433 432 * @adev: Device to program 434 433 * 435 434 * Set UDMA/MWDMA mode for device, in host controller PCI config space. 436 - * Handles early SiS 961 bridges. Supports MWDMA as well unlike 437 - * the old ide/pci driver. 435 + * Handles early SiS 961 bridges. 438 436 * 439 437 * LOCKING: 440 438 * None (inherited from caller). ··· 467 467 * @adev: Device to program 468 468 * 469 469 * Set UDMA/MWDMA mode for device, in host controller PCI config space. 470 - * Handles early SiS 961 bridges. Supports MWDMA as well unlike 471 - * the old ide/pci driver. 472 470 * 473 471 * LOCKING: 474 472 * None (inherited from caller).
+1 -1
drivers/pci/pci-driver.c
··· 310 310 /* restore the PCI config space */ 311 311 pci_restore_state(pci_dev); 312 312 /* if the device was enabled before suspend, reenable */ 313 - retval = __pci_reenable_device(pci_dev); 313 + retval = pci_reenable_device(pci_dev); 314 314 /* if the device was busmaster before the suspend, make it busmaster again */ 315 315 if (pci_dev->is_busmaster) 316 316 pci_set_master(pci_dev);
+3 -4
drivers/pci/pci.c
··· 695 695 } 696 696 697 697 /** 698 - * __pci_reenable_device - Resume abandoned device 698 + * pci_reenable_device - Resume abandoned device 699 699 * @dev: PCI device to be resumed 700 700 * 701 701 * Note this function is a backend of pci_default_resume and is not supposed 702 702 * to be called by normal code, write proper resume handler and use it instead. 703 703 */ 704 - int 705 - __pci_reenable_device(struct pci_dev *dev) 704 + int pci_reenable_device(struct pci_dev *dev) 706 705 { 707 706 if (atomic_read(&dev->enable_cnt)) 708 707 return do_pci_enable_device(dev, (1 << PCI_NUM_RESOURCES) - 1); ··· 1603 1604 device_initcall(pci_init); 1604 1605 1605 1606 EXPORT_SYMBOL_GPL(pci_restore_bars); 1606 - EXPORT_SYMBOL(__pci_reenable_device); 1607 + EXPORT_SYMBOL(pci_reenable_device); 1607 1608 EXPORT_SYMBOL(pci_enable_device_bars); 1608 1609 EXPORT_SYMBOL(pci_enable_device); 1609 1610 EXPORT_SYMBOL(pcim_enable_device);
+1 -1
include/linux/pci.h
··· 534 534 535 535 int __must_check pci_enable_device(struct pci_dev *dev); 536 536 int __must_check pci_enable_device_bars(struct pci_dev *dev, int mask); 537 - int __must_check __pci_reenable_device(struct pci_dev *); 537 + int __must_check pci_reenable_device(struct pci_dev *); 538 538 int __must_check pcim_enable_device(struct pci_dev *pdev); 539 539 void pcim_pin_device(struct pci_dev *pdev); 540 540