diff options
author | Tony Luck <tony.luck@intel.com> | 2005-07-06 18:35:18 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2005-07-06 18:35:18 -0400 |
commit | 67d340f440f389e9d56201fb7c7aaa92f262feb1 (patch) | |
tree | a96c26a370beb23282a561ddd936e5d0aa93adde /drivers | |
parent | 2ba3e3e65cf182436757ba13ea8d564e2950fb56 (diff) | |
parent | 159f597a8bd0f1d7650d5e580c93a2666c9c26d1 (diff) |
Auto merge with /home/aegl/GIT/linus
Diffstat (limited to 'drivers')
43 files changed, 425 insertions, 296 deletions
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index 8dbf802ee7f8..d1f42b972821 100644 --- a/drivers/acpi/pci_irq.c +++ b/drivers/acpi/pci_irq.c | |||
@@ -433,7 +433,7 @@ acpi_pci_irq_enable ( | |||
433 | printk(KERN_WARNING PREFIX "PCI Interrupt %s[%c]: no GSI", | 433 | printk(KERN_WARNING PREFIX "PCI Interrupt %s[%c]: no GSI", |
434 | pci_name(dev), ('A' + pin)); | 434 | pci_name(dev), ('A' + pin)); |
435 | /* Interrupt Line values above 0xF are forbidden */ | 435 | /* Interrupt Line values above 0xF are forbidden */ |
436 | if (dev->irq >= 0 && (dev->irq <= 0xF)) { | 436 | if (dev->irq > 0 && (dev->irq <= 0xF)) { |
437 | printk(" - using IRQ %d\n", dev->irq); | 437 | printk(" - using IRQ %d\n", dev->irq); |
438 | acpi_register_gsi(dev->irq, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW); | 438 | acpi_register_gsi(dev->irq, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW); |
439 | return_VALUE(0); | 439 | return_VALUE(0); |
diff --git a/drivers/char/hw_random.c b/drivers/char/hw_random.c index 7e6ac14c2450..3480535a09c5 100644 --- a/drivers/char/hw_random.c +++ b/drivers/char/hw_random.c | |||
@@ -579,7 +579,7 @@ static int __init rng_init (void) | |||
579 | 579 | ||
580 | /* Probe for Intel, AMD RNGs */ | 580 | /* Probe for Intel, AMD RNGs */ |
581 | for_each_pci_dev(pdev) { | 581 | for_each_pci_dev(pdev) { |
582 | ent = pci_match_device (rng_pci_tbl, pdev); | 582 | ent = pci_match_id(rng_pci_tbl, pdev); |
583 | if (ent) { | 583 | if (ent) { |
584 | rng_ops = &rng_vendor_ops[ent->driver_data]; | 584 | rng_ops = &rng_vendor_ops[ent->driver_data]; |
585 | goto match; | 585 | goto match; |
diff --git a/drivers/char/watchdog/i8xx_tco.c b/drivers/char/watchdog/i8xx_tco.c index b14d642439ed..5d07ee59679d 100644 --- a/drivers/char/watchdog/i8xx_tco.c +++ b/drivers/char/watchdog/i8xx_tco.c | |||
@@ -401,7 +401,7 @@ static unsigned char __init i8xx_tco_getdevice (void) | |||
401 | */ | 401 | */ |
402 | 402 | ||
403 | while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { | 403 | while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { |
404 | if (pci_match_device(i8xx_tco_pci_tbl, dev)) { | 404 | if (pci_match_id(i8xx_tco_pci_tbl, dev)) { |
405 | i8xx_tco_pci = dev; | 405 | i8xx_tco_pci = dev; |
406 | break; | 406 | break; |
407 | } | 407 | } |
diff --git a/drivers/ide/Makefile b/drivers/ide/Makefile index 5be8ad6dc9ed..cca9c075966d 100644 --- a/drivers/ide/Makefile +++ b/drivers/ide/Makefile | |||
@@ -20,7 +20,6 @@ ide-core-$(CONFIG_BLK_DEV_CMD640) += pci/cmd640.o | |||
20 | # Core IDE code - must come before legacy | 20 | # Core IDE code - must come before legacy |
21 | ide-core-$(CONFIG_BLK_DEV_IDEPCI) += setup-pci.o | 21 | ide-core-$(CONFIG_BLK_DEV_IDEPCI) += setup-pci.o |
22 | ide-core-$(CONFIG_BLK_DEV_IDEDMA) += ide-dma.o | 22 | ide-core-$(CONFIG_BLK_DEV_IDEDMA) += ide-dma.o |
23 | ide-core-$(CONFIG_BLK_DEV_IDE_TCQ) += ide-tcq.o | ||
24 | ide-core-$(CONFIG_PROC_FS) += ide-proc.o | 23 | ide-core-$(CONFIG_PROC_FS) += ide-proc.o |
25 | ide-core-$(CONFIG_BLK_DEV_IDEPNP) += ide-pnp.o | 24 | ide-core-$(CONFIG_BLK_DEV_IDEPNP) += ide-pnp.o |
26 | 25 | ||
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c index 6806d407e9c1..b09a6537c7a8 100644 --- a/drivers/ide/ide-lib.c +++ b/drivers/ide/ide-lib.c | |||
@@ -487,8 +487,7 @@ static u8 ide_dump_ata_status(ide_drive_t *drive, const char *msg, u8 stat) | |||
487 | u8 err = 0; | 487 | u8 err = 0; |
488 | 488 | ||
489 | local_irq_set(flags); | 489 | local_irq_set(flags); |
490 | printk("%s: %s: status=0x%02x", drive->name, msg, stat); | 490 | printk("%s: %s: status=0x%02x { ", drive->name, msg, stat); |
491 | printk(" { "); | ||
492 | if (stat & BUSY_STAT) | 491 | if (stat & BUSY_STAT) |
493 | printk("Busy "); | 492 | printk("Busy "); |
494 | else { | 493 | else { |
@@ -500,15 +499,13 @@ static u8 ide_dump_ata_status(ide_drive_t *drive, const char *msg, u8 stat) | |||
500 | if (stat & INDEX_STAT) printk("Index "); | 499 | if (stat & INDEX_STAT) printk("Index "); |
501 | if (stat & ERR_STAT) printk("Error "); | 500 | if (stat & ERR_STAT) printk("Error "); |
502 | } | 501 | } |
503 | printk("}"); | 502 | printk("}\n"); |
504 | printk("\n"); | ||
505 | if ((stat & (BUSY_STAT|ERR_STAT)) == ERR_STAT) { | 503 | if ((stat & (BUSY_STAT|ERR_STAT)) == ERR_STAT) { |
506 | err = hwif->INB(IDE_ERROR_REG); | 504 | err = hwif->INB(IDE_ERROR_REG); |
507 | printk("%s: %s: error=0x%02x", drive->name, msg, err); | 505 | printk("%s: %s: error=0x%02x { ", drive->name, msg, err); |
508 | printk(" { "); | ||
509 | if (err & ABRT_ERR) printk("DriveStatusError "); | 506 | if (err & ABRT_ERR) printk("DriveStatusError "); |
510 | if (err & ICRC_ERR) | 507 | if (err & ICRC_ERR) |
511 | printk("Bad%s ", (err & ABRT_ERR) ? "CRC" : "Sector"); | 508 | printk((err & ABRT_ERR) ? "BadCRC " : "BadSector "); |
512 | if (err & ECC_ERR) printk("UncorrectableError "); | 509 | if (err & ECC_ERR) printk("UncorrectableError "); |
513 | if (err & ID_ERR) printk("SectorIdNotFound "); | 510 | if (err & ID_ERR) printk("SectorIdNotFound "); |
514 | if (err & TRK0_ERR) printk("TrackZeroNotFound "); | 511 | if (err & TRK0_ERR) printk("TrackZeroNotFound "); |
@@ -546,8 +543,8 @@ static u8 ide_dump_ata_status(ide_drive_t *drive, const char *msg, u8 stat) | |||
546 | printk(", sector=%llu", | 543 | printk(", sector=%llu", |
547 | (unsigned long long)HWGROUP(drive)->rq->sector); | 544 | (unsigned long long)HWGROUP(drive)->rq->sector); |
548 | } | 545 | } |
546 | printk("\n"); | ||
549 | } | 547 | } |
550 | printk("\n"); | ||
551 | ide_dump_opcode(drive); | 548 | ide_dump_opcode(drive); |
552 | local_irq_restore(flags); | 549 | local_irq_restore(flags); |
553 | return err; | 550 | return err; |
diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c index 67efb38a9f6c..6cf49394a80f 100644 --- a/drivers/ide/pci/alim15x3.c +++ b/drivers/ide/pci/alim15x3.c | |||
@@ -583,7 +583,7 @@ static int ali15x3_dma_setup(ide_drive_t *drive) | |||
583 | * appropriate also sets up the 1533 southbridge. | 583 | * appropriate also sets up the 1533 southbridge. |
584 | */ | 584 | */ |
585 | 585 | ||
586 | static unsigned int __init init_chipset_ali15x3 (struct pci_dev *dev, const char *name) | 586 | static unsigned int __devinit init_chipset_ali15x3 (struct pci_dev *dev, const char *name) |
587 | { | 587 | { |
588 | unsigned long flags; | 588 | unsigned long flags; |
589 | u8 tmpbyte; | 589 | u8 tmpbyte; |
@@ -677,7 +677,7 @@ static unsigned int __init init_chipset_ali15x3 (struct pci_dev *dev, const char | |||
677 | * FIXME: frobs bits that are not defined on newer ALi devicea | 677 | * FIXME: frobs bits that are not defined on newer ALi devicea |
678 | */ | 678 | */ |
679 | 679 | ||
680 | static unsigned int __init ata66_ali15x3 (ide_hwif_t *hwif) | 680 | static unsigned int __devinit ata66_ali15x3 (ide_hwif_t *hwif) |
681 | { | 681 | { |
682 | struct pci_dev *dev = hwif->pci_dev; | 682 | struct pci_dev *dev = hwif->pci_dev; |
683 | unsigned int ata66 = 0; | 683 | unsigned int ata66 = 0; |
@@ -748,7 +748,7 @@ static unsigned int __init ata66_ali15x3 (ide_hwif_t *hwif) | |||
748 | * Initialize the IDE structure side of the ALi 15x3 driver. | 748 | * Initialize the IDE structure side of the ALi 15x3 driver. |
749 | */ | 749 | */ |
750 | 750 | ||
751 | static void __init init_hwif_common_ali15x3 (ide_hwif_t *hwif) | 751 | static void __devinit init_hwif_common_ali15x3 (ide_hwif_t *hwif) |
752 | { | 752 | { |
753 | hwif->autodma = 0; | 753 | hwif->autodma = 0; |
754 | hwif->tuneproc = &ali15x3_tune_drive; | 754 | hwif->tuneproc = &ali15x3_tune_drive; |
@@ -794,7 +794,7 @@ static void __init init_hwif_common_ali15x3 (ide_hwif_t *hwif) | |||
794 | * Sparc systems | 794 | * Sparc systems |
795 | */ | 795 | */ |
796 | 796 | ||
797 | static void __init init_hwif_ali15x3 (ide_hwif_t *hwif) | 797 | static void __devinit init_hwif_ali15x3 (ide_hwif_t *hwif) |
798 | { | 798 | { |
799 | u8 ideic, inmir; | 799 | u8 ideic, inmir; |
800 | s8 irq_routing_table[] = { -1, 9, 3, 10, 4, 5, 7, 6, | 800 | s8 irq_routing_table[] = { -1, 9, 3, 10, 4, 5, 7, 6, |
@@ -847,7 +847,7 @@ static void __init init_hwif_ali15x3 (ide_hwif_t *hwif) | |||
847 | * the actual work. | 847 | * the actual work. |
848 | */ | 848 | */ |
849 | 849 | ||
850 | static void __init init_dma_ali15x3 (ide_hwif_t *hwif, unsigned long dmabase) | 850 | static void __devinit init_dma_ali15x3 (ide_hwif_t *hwif, unsigned long dmabase) |
851 | { | 851 | { |
852 | if (m5229_revision < 0x20) | 852 | if (m5229_revision < 0x20) |
853 | return; | 853 | return; |
diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c index 4e0f13d1d060..844a6c9fb949 100644 --- a/drivers/ide/pci/amd74xx.c +++ b/drivers/ide/pci/amd74xx.c | |||
@@ -73,6 +73,7 @@ static struct amd_ide_chip { | |||
73 | { PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE, 0x50, AMD_UDMA_133 }, | 73 | { PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE, 0x50, AMD_UDMA_133 }, |
74 | { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE, 0x50, AMD_UDMA_133 }, | 74 | { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE, 0x50, AMD_UDMA_133 }, |
75 | { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE, 0x50, AMD_UDMA_133 }, | 75 | { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE, 0x50, AMD_UDMA_133 }, |
76 | { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE, 0x50, AMD_UDMA_133 }, | ||
76 | { 0 } | 77 | { 0 } |
77 | }; | 78 | }; |
78 | 79 | ||
@@ -309,7 +310,7 @@ static int amd74xx_ide_dma_check(ide_drive_t *drive) | |||
309 | * and initialize its drive independent registers. | 310 | * and initialize its drive independent registers. |
310 | */ | 311 | */ |
311 | 312 | ||
312 | static unsigned int __init init_chipset_amd74xx(struct pci_dev *dev, const char *name) | 313 | static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev, const char *name) |
313 | { | 314 | { |
314 | unsigned char t; | 315 | unsigned char t; |
315 | unsigned int u; | 316 | unsigned int u; |
@@ -413,7 +414,7 @@ static unsigned int __init init_chipset_amd74xx(struct pci_dev *dev, const char | |||
413 | return dev->irq; | 414 | return dev->irq; |
414 | } | 415 | } |
415 | 416 | ||
416 | static void __init init_hwif_amd74xx(ide_hwif_t *hwif) | 417 | static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif) |
417 | { | 418 | { |
418 | int i; | 419 | int i; |
419 | 420 | ||
@@ -489,6 +490,7 @@ static ide_pci_device_t amd74xx_chipsets[] __devinitdata = { | |||
489 | /* 13 */ DECLARE_NV_DEV("NFORCE-CK804"), | 490 | /* 13 */ DECLARE_NV_DEV("NFORCE-CK804"), |
490 | /* 14 */ DECLARE_NV_DEV("NFORCE-MCP04"), | 491 | /* 14 */ DECLARE_NV_DEV("NFORCE-MCP04"), |
491 | /* 15 */ DECLARE_NV_DEV("NFORCE-MCP51"), | 492 | /* 15 */ DECLARE_NV_DEV("NFORCE-MCP51"), |
493 | /* 16 */ DECLARE_NV_DEV("NFORCE-MCP55"), | ||
492 | }; | 494 | }; |
493 | 495 | ||
494 | static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_id *id) | 496 | static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_id *id) |
@@ -524,6 +526,7 @@ static struct pci_device_id amd74xx_pci_tbl[] = { | |||
524 | { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13 }, | 526 | { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13 }, |
525 | { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14 }, | 527 | { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14 }, |
526 | { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15 }, | 528 | { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15 }, |
529 | { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 16 }, | ||
527 | { 0, }, | 530 | { 0, }, |
528 | }; | 531 | }; |
529 | MODULE_DEVICE_TABLE(pci, amd74xx_pci_tbl); | 532 | MODULE_DEVICE_TABLE(pci, amd74xx_pci_tbl); |
diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c index 0381961db263..09269e574b3e 100644 --- a/drivers/ide/pci/cs5530.c +++ b/drivers/ide/pci/cs5530.c | |||
@@ -217,7 +217,7 @@ static int cs5530_config_dma (ide_drive_t *drive) | |||
217 | * Initialize the cs5530 bridge for reliable IDE DMA operation. | 217 | * Initialize the cs5530 bridge for reliable IDE DMA operation. |
218 | */ | 218 | */ |
219 | 219 | ||
220 | static unsigned int __init init_chipset_cs5530 (struct pci_dev *dev, const char *name) | 220 | static unsigned int __devinit init_chipset_cs5530 (struct pci_dev *dev, const char *name) |
221 | { | 221 | { |
222 | struct pci_dev *master_0 = NULL, *cs5530_0 = NULL; | 222 | struct pci_dev *master_0 = NULL, *cs5530_0 = NULL; |
223 | unsigned long flags; | 223 | unsigned long flags; |
@@ -308,7 +308,7 @@ static unsigned int __init init_chipset_cs5530 (struct pci_dev *dev, const char | |||
308 | * performs channel-specific pre-initialization before drive probing. | 308 | * performs channel-specific pre-initialization before drive probing. |
309 | */ | 309 | */ |
310 | 310 | ||
311 | static void __init init_hwif_cs5530 (ide_hwif_t *hwif) | 311 | static void __devinit init_hwif_cs5530 (ide_hwif_t *hwif) |
312 | { | 312 | { |
313 | unsigned long basereg; | 313 | unsigned long basereg; |
314 | u32 d0_timings; | 314 | u32 d0_timings; |
diff --git a/drivers/ide/pci/cy82c693.c b/drivers/ide/pci/cy82c693.c index 80d67e99ccb5..5a33513f3dd1 100644 --- a/drivers/ide/pci/cy82c693.c +++ b/drivers/ide/pci/cy82c693.c | |||
@@ -391,7 +391,7 @@ static void cy82c693_tune_drive (ide_drive_t *drive, u8 pio) | |||
391 | /* | 391 | /* |
392 | * this function is called during init and is used to setup the cy82c693 chip | 392 | * this function is called during init and is used to setup the cy82c693 chip |
393 | */ | 393 | */ |
394 | static unsigned int __init init_chipset_cy82c693(struct pci_dev *dev, const char *name) | 394 | static unsigned int __devinit init_chipset_cy82c693(struct pci_dev *dev, const char *name) |
395 | { | 395 | { |
396 | if (PCI_FUNC(dev->devfn) != 1) | 396 | if (PCI_FUNC(dev->devfn) != 1) |
397 | return 0; | 397 | return 0; |
@@ -443,7 +443,7 @@ static unsigned int __init init_chipset_cy82c693(struct pci_dev *dev, const char | |||
443 | /* | 443 | /* |
444 | * the init function - called for each ide channel once | 444 | * the init function - called for each ide channel once |
445 | */ | 445 | */ |
446 | static void __init init_hwif_cy82c693(ide_hwif_t *hwif) | 446 | static void __devinit init_hwif_cy82c693(ide_hwif_t *hwif) |
447 | { | 447 | { |
448 | hwif->autodma = 0; | 448 | hwif->autodma = 0; |
449 | 449 | ||
@@ -467,9 +467,9 @@ static void __init init_hwif_cy82c693(ide_hwif_t *hwif) | |||
467 | hwif->drives[1].autodma = hwif->autodma; | 467 | hwif->drives[1].autodma = hwif->autodma; |
468 | } | 468 | } |
469 | 469 | ||
470 | static __initdata ide_hwif_t *primary; | 470 | static __devinitdata ide_hwif_t *primary; |
471 | 471 | ||
472 | void __init init_iops_cy82c693(ide_hwif_t *hwif) | 472 | void __devinit init_iops_cy82c693(ide_hwif_t *hwif) |
473 | { | 473 | { |
474 | if (PCI_FUNC(hwif->pci_dev->devfn) == 1) | 474 | if (PCI_FUNC(hwif->pci_dev->devfn) == 1) |
475 | primary = hwif; | 475 | primary = hwif; |
diff --git a/drivers/ide/pci/it8172.c b/drivers/ide/pci/it8172.c index 631927cf17d4..93462926b9d5 100644 --- a/drivers/ide/pci/it8172.c +++ b/drivers/ide/pci/it8172.c | |||
@@ -216,7 +216,7 @@ fast_ata_pio: | |||
216 | return 0; | 216 | return 0; |
217 | } | 217 | } |
218 | 218 | ||
219 | static unsigned int __init init_chipset_it8172 (struct pci_dev *dev, const char *name) | 219 | static unsigned int __devinit init_chipset_it8172 (struct pci_dev *dev, const char *name) |
220 | { | 220 | { |
221 | unsigned char progif; | 221 | unsigned char progif; |
222 | 222 | ||
@@ -230,7 +230,7 @@ static unsigned int __init init_chipset_it8172 (struct pci_dev *dev, const char | |||
230 | } | 230 | } |
231 | 231 | ||
232 | 232 | ||
233 | static void __init init_hwif_it8172 (ide_hwif_t *hwif) | 233 | static void __devinit init_hwif_it8172 (ide_hwif_t *hwif) |
234 | { | 234 | { |
235 | struct pci_dev* dev = hwif->pci_dev; | 235 | struct pci_dev* dev = hwif->pci_dev; |
236 | unsigned long cmdBase, ctrlBase; | 236 | unsigned long cmdBase, ctrlBase; |
diff --git a/drivers/ide/pci/ns87415.c b/drivers/ide/pci/ns87415.c index 205a32fbc2f0..fcd5142f5cfe 100644 --- a/drivers/ide/pci/ns87415.c +++ b/drivers/ide/pci/ns87415.c | |||
@@ -195,7 +195,7 @@ static int ns87415_ide_dma_check (ide_drive_t *drive) | |||
195 | return __ide_dma_check(drive); | 195 | return __ide_dma_check(drive); |
196 | } | 196 | } |
197 | 197 | ||
198 | static void __init init_hwif_ns87415 (ide_hwif_t *hwif) | 198 | static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif) |
199 | { | 199 | { |
200 | struct pci_dev *dev = hwif->pci_dev; | 200 | struct pci_dev *dev = hwif->pci_dev; |
201 | unsigned int ctrl, using_inta; | 201 | unsigned int ctrl, using_inta; |
diff --git a/drivers/ide/pci/opti621.c b/drivers/ide/pci/opti621.c index cf4fd91d396a..7a7c2ef78ac2 100644 --- a/drivers/ide/pci/opti621.c +++ b/drivers/ide/pci/opti621.c | |||
@@ -326,7 +326,7 @@ static void opti621_tune_drive (ide_drive_t *drive, u8 pio) | |||
326 | /* | 326 | /* |
327 | * init_hwif_opti621() is called once for each hwif found at boot. | 327 | * init_hwif_opti621() is called once for each hwif found at boot. |
328 | */ | 328 | */ |
329 | static void __init init_hwif_opti621 (ide_hwif_t *hwif) | 329 | static void __devinit init_hwif_opti621 (ide_hwif_t *hwif) |
330 | { | 330 | { |
331 | hwif->autodma = 0; | 331 | hwif->autodma = 0; |
332 | hwif->drives[0].drive_data = PIO_DONT_KNOW; | 332 | hwif->drives[0].drive_data = PIO_DONT_KNOW; |
diff --git a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c index 3bc3bf1be49b..10592cec6c43 100644 --- a/drivers/ide/pci/sc1200.c +++ b/drivers/ide/pci/sc1200.c | |||
@@ -459,7 +459,7 @@ printk("%s: SC1200: resume\n", hwif->name); | |||
459 | * This gets invoked by the IDE driver once for each channel, | 459 | * This gets invoked by the IDE driver once for each channel, |
460 | * and performs channel-specific pre-initialization before drive probing. | 460 | * and performs channel-specific pre-initialization before drive probing. |
461 | */ | 461 | */ |
462 | static void __init init_hwif_sc1200 (ide_hwif_t *hwif) | 462 | static void __devinit init_hwif_sc1200 (ide_hwif_t *hwif) |
463 | { | 463 | { |
464 | if (hwif->mate) | 464 | if (hwif->mate) |
465 | hwif->serialized = hwif->mate->serialized = 1; | 465 | hwif->serialized = hwif->mate->serialized = 1; |
diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c index 1d970a0de21a..ea0806c82be0 100644 --- a/drivers/ide/pci/sl82c105.c +++ b/drivers/ide/pci/sl82c105.c | |||
@@ -386,7 +386,7 @@ static unsigned int sl82c105_bridge_revision(struct pci_dev *dev) | |||
386 | * channel 0 here at least, but channel 1 has to be enabled by | 386 | * channel 0 here at least, but channel 1 has to be enabled by |
387 | * firmware or arch code. We still set both to 16 bits mode. | 387 | * firmware or arch code. We still set both to 16 bits mode. |
388 | */ | 388 | */ |
389 | static unsigned int __init init_chipset_sl82c105(struct pci_dev *dev, const char *msg) | 389 | static unsigned int __devinit init_chipset_sl82c105(struct pci_dev *dev, const char *msg) |
390 | { | 390 | { |
391 | u32 val; | 391 | u32 val; |
392 | 392 | ||
@@ -399,7 +399,7 @@ static unsigned int __init init_chipset_sl82c105(struct pci_dev *dev, const char | |||
399 | return dev->irq; | 399 | return dev->irq; |
400 | } | 400 | } |
401 | 401 | ||
402 | static void __init init_dma_sl82c105(ide_hwif_t *hwif, unsigned long dma_base) | 402 | static void __devinit init_dma_sl82c105(ide_hwif_t *hwif, unsigned long dma_base) |
403 | { | 403 | { |
404 | unsigned int rev; | 404 | unsigned int rev; |
405 | u8 dma_state; | 405 | u8 dma_state; |
@@ -431,7 +431,7 @@ static void __init init_dma_sl82c105(ide_hwif_t *hwif, unsigned long dma_base) | |||
431 | * Initialise the chip | 431 | * Initialise the chip |
432 | */ | 432 | */ |
433 | 433 | ||
434 | static void __init init_hwif_sl82c105(ide_hwif_t *hwif) | 434 | static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif) |
435 | { | 435 | { |
436 | struct pci_dev *dev = hwif->pci_dev; | 436 | struct pci_dev *dev = hwif->pci_dev; |
437 | u32 val; | 437 | u32 val; |
diff --git a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c index 7fbf36342f73..5112c726633b 100644 --- a/drivers/ide/pci/slc90e66.c +++ b/drivers/ide/pci/slc90e66.c | |||
@@ -196,7 +196,7 @@ fast_ata_pio: | |||
196 | } | 196 | } |
197 | #endif /* CONFIG_BLK_DEV_IDEDMA */ | 197 | #endif /* CONFIG_BLK_DEV_IDEDMA */ |
198 | 198 | ||
199 | static void __init init_hwif_slc90e66 (ide_hwif_t *hwif) | 199 | static void __devinit init_hwif_slc90e66 (ide_hwif_t *hwif) |
200 | { | 200 | { |
201 | u8 reg47 = 0; | 201 | u8 reg47 = 0; |
202 | u8 mask = hwif->channel ? 0x01 : 0x02; /* bit0:Primary */ | 202 | u8 mask = hwif->channel ? 0x01 : 0x02; /* bit0:Primary */ |
diff --git a/drivers/ide/pci/triflex.c b/drivers/ide/pci/triflex.c index a1df2bfe3631..f96b56838f33 100644 --- a/drivers/ide/pci/triflex.c +++ b/drivers/ide/pci/triflex.c | |||
@@ -130,7 +130,7 @@ static int triflex_config_drive_xfer_rate(ide_drive_t *drive) | |||
130 | return hwif->ide_dma_off_quietly(drive); | 130 | return hwif->ide_dma_off_quietly(drive); |
131 | } | 131 | } |
132 | 132 | ||
133 | static void __init init_hwif_triflex(ide_hwif_t *hwif) | 133 | static void __devinit init_hwif_triflex(ide_hwif_t *hwif) |
134 | { | 134 | { |
135 | hwif->tuneproc = &triflex_tune_drive; | 135 | hwif->tuneproc = &triflex_tune_drive; |
136 | hwif->speedproc = &triflex_tune_chipset; | 136 | hwif->speedproc = &triflex_tune_chipset; |
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c index 069dbffe2116..a4d099c937ff 100644 --- a/drivers/ide/pci/via82cxxx.c +++ b/drivers/ide/pci/via82cxxx.c | |||
@@ -415,7 +415,7 @@ static int via82cxxx_ide_dma_check (ide_drive_t *drive) | |||
415 | * and initialize its drive independent registers. | 415 | * and initialize its drive independent registers. |
416 | */ | 416 | */ |
417 | 417 | ||
418 | static unsigned int __init init_chipset_via82cxxx(struct pci_dev *dev, const char *name) | 418 | static unsigned int __devinit init_chipset_via82cxxx(struct pci_dev *dev, const char *name) |
419 | { | 419 | { |
420 | struct pci_dev *isa = NULL; | 420 | struct pci_dev *isa = NULL; |
421 | u8 t, v; | 421 | u8 t, v; |
@@ -576,7 +576,7 @@ static unsigned int __init init_chipset_via82cxxx(struct pci_dev *dev, const cha | |||
576 | return 0; | 576 | return 0; |
577 | } | 577 | } |
578 | 578 | ||
579 | static void __init init_hwif_via82cxxx(ide_hwif_t *hwif) | 579 | static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif) |
580 | { | 580 | { |
581 | int i; | 581 | int i; |
582 | 582 | ||
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c index e501675ad72e..77da827b2898 100644 --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c | |||
@@ -847,7 +847,7 @@ static int __init ide_scan_pcidev(struct pci_dev *dev) | |||
847 | d = list_entry(l, struct pci_driver, node); | 847 | d = list_entry(l, struct pci_driver, node); |
848 | if(d->id_table) | 848 | if(d->id_table) |
849 | { | 849 | { |
850 | const struct pci_device_id *id = pci_match_device(d->id_table, dev); | 850 | const struct pci_device_id *id = pci_match_id(d->id_table, dev); |
851 | if(id != NULL) | 851 | if(id != NULL) |
852 | { | 852 | { |
853 | if(d->probe(dev, id) >= 0) | 853 | if(d->probe(dev, id) >= 0) |
diff --git a/drivers/mmc/mmci.c b/drivers/mmc/mmci.c index 3a5f6ac5b364..7a42966d755b 100644 --- a/drivers/mmc/mmci.c +++ b/drivers/mmc/mmci.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/mmc/host.h> | 20 | #include <linux/mmc/host.h> |
21 | #include <linux/mmc/protocol.h> | 21 | #include <linux/mmc/protocol.h> |
22 | 22 | ||
23 | #include <asm/div64.h> | ||
23 | #include <asm/io.h> | 24 | #include <asm/io.h> |
24 | #include <asm/irq.h> | 25 | #include <asm/irq.h> |
25 | #include <asm/scatterlist.h> | 26 | #include <asm/scatterlist.h> |
@@ -70,6 +71,7 @@ static void mmci_stop_data(struct mmci_host *host) | |||
70 | static void mmci_start_data(struct mmci_host *host, struct mmc_data *data) | 71 | static void mmci_start_data(struct mmci_host *host, struct mmc_data *data) |
71 | { | 72 | { |
72 | unsigned int datactrl, timeout, irqmask; | 73 | unsigned int datactrl, timeout, irqmask; |
74 | unsigned long long clks; | ||
73 | void __iomem *base; | 75 | void __iomem *base; |
74 | 76 | ||
75 | DBG(host, "blksz %04x blks %04x flags %08x\n", | 77 | DBG(host, "blksz %04x blks %04x flags %08x\n", |
@@ -81,9 +83,10 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data) | |||
81 | 83 | ||
82 | mmci_init_sg(host, data); | 84 | mmci_init_sg(host, data); |
83 | 85 | ||
84 | timeout = data->timeout_clks + | 86 | clks = (unsigned long long)data->timeout_ns * host->cclk; |
85 | ((unsigned long long)data->timeout_ns * host->cclk) / | 87 | do_div(clks, 1000000000UL); |
86 | 1000000000ULL; | 88 | |
89 | timeout = data->timeout_clks + (unsigned int)clks; | ||
87 | 90 | ||
88 | base = host->base; | 91 | base = host->base; |
89 | writel(timeout, base + MMCIDATATIMER); | 92 | writel(timeout, base + MMCIDATATIMER); |
diff --git a/drivers/mmc/wbsd.c b/drivers/mmc/wbsd.c index b7fbd30b49a0..0c41d4b41a65 100644 --- a/drivers/mmc/wbsd.c +++ b/drivers/mmc/wbsd.c | |||
@@ -54,28 +54,6 @@ | |||
54 | #define DBGF(x...) do { } while (0) | 54 | #define DBGF(x...) do { } while (0) |
55 | #endif | 55 | #endif |
56 | 56 | ||
57 | #ifdef CONFIG_MMC_DEBUG | ||
58 | void DBG_REG(int reg, u8 value) | ||
59 | { | ||
60 | int i; | ||
61 | |||
62 | printk(KERN_DEBUG "wbsd: Register %d: 0x%02X %3d '%c' ", | ||
63 | reg, (int)value, (int)value, (value < 0x20)?'.':value); | ||
64 | |||
65 | for (i = 7;i >= 0;i--) | ||
66 | { | ||
67 | if (value & (1 << i)) | ||
68 | printk("x"); | ||
69 | else | ||
70 | printk("."); | ||
71 | } | ||
72 | |||
73 | printk("\n"); | ||
74 | } | ||
75 | #else | ||
76 | #define DBG_REG(r, v) do {} while (0) | ||
77 | #endif | ||
78 | |||
79 | /* | 57 | /* |
80 | * Device resources | 58 | * Device resources |
81 | */ | 59 | */ |
@@ -92,6 +70,13 @@ MODULE_DEVICE_TABLE(pnp, pnp_dev_table); | |||
92 | 70 | ||
93 | #endif /* CONFIG_PNP */ | 71 | #endif /* CONFIG_PNP */ |
94 | 72 | ||
73 | static const int config_ports[] = { 0x2E, 0x4E }; | ||
74 | static const int unlock_codes[] = { 0x83, 0x87 }; | ||
75 | |||
76 | static const int valid_ids[] = { | ||
77 | 0x7112, | ||
78 | }; | ||
79 | |||
95 | #ifdef CONFIG_PNP | 80 | #ifdef CONFIG_PNP |
96 | static unsigned int nopnp = 0; | 81 | static unsigned int nopnp = 0; |
97 | #else | 82 | #else |
@@ -1051,6 +1036,20 @@ static struct mmc_host_ops wbsd_ops = { | |||
1051 | \*****************************************************************************/ | 1036 | \*****************************************************************************/ |
1052 | 1037 | ||
1053 | /* | 1038 | /* |
1039 | * Helper function for card detection | ||
1040 | */ | ||
1041 | static void wbsd_detect_card(unsigned long data) | ||
1042 | { | ||
1043 | struct wbsd_host *host = (struct wbsd_host*)data; | ||
1044 | |||
1045 | BUG_ON(host == NULL); | ||
1046 | |||
1047 | DBG("Executing card detection\n"); | ||
1048 | |||
1049 | mmc_detect_change(host->mmc); | ||
1050 | } | ||
1051 | |||
1052 | /* | ||
1054 | * Tasklets | 1053 | * Tasklets |
1055 | */ | 1054 | */ |
1056 | 1055 | ||
@@ -1075,7 +1074,6 @@ static void wbsd_tasklet_card(unsigned long param) | |||
1075 | { | 1074 | { |
1076 | struct wbsd_host* host = (struct wbsd_host*)param; | 1075 | struct wbsd_host* host = (struct wbsd_host*)param; |
1077 | u8 csr; | 1076 | u8 csr; |
1078 | int change = 0; | ||
1079 | 1077 | ||
1080 | spin_lock(&host->lock); | 1078 | spin_lock(&host->lock); |
1081 | 1079 | ||
@@ -1094,14 +1092,20 @@ static void wbsd_tasklet_card(unsigned long param) | |||
1094 | { | 1092 | { |
1095 | DBG("Card inserted\n"); | 1093 | DBG("Card inserted\n"); |
1096 | host->flags |= WBSD_FCARD_PRESENT; | 1094 | host->flags |= WBSD_FCARD_PRESENT; |
1097 | change = 1; | 1095 | |
1096 | /* | ||
1097 | * Delay card detection to allow electrical connections | ||
1098 | * to stabilise. | ||
1099 | */ | ||
1100 | mod_timer(&host->timer, jiffies + HZ/2); | ||
1098 | } | 1101 | } |
1102 | |||
1103 | spin_unlock(&host->lock); | ||
1099 | } | 1104 | } |
1100 | else if (host->flags & WBSD_FCARD_PRESENT) | 1105 | else if (host->flags & WBSD_FCARD_PRESENT) |
1101 | { | 1106 | { |
1102 | DBG("Card removed\n"); | 1107 | DBG("Card removed\n"); |
1103 | host->flags &= ~WBSD_FCARD_PRESENT; | 1108 | host->flags &= ~WBSD_FCARD_PRESENT; |
1104 | change = 1; | ||
1105 | 1109 | ||
1106 | if (host->mrq) | 1110 | if (host->mrq) |
1107 | { | 1111 | { |
@@ -1112,15 +1116,14 @@ static void wbsd_tasklet_card(unsigned long param) | |||
1112 | host->mrq->cmd->error = MMC_ERR_FAILED; | 1116 | host->mrq->cmd->error = MMC_ERR_FAILED; |
1113 | tasklet_schedule(&host->finish_tasklet); | 1117 | tasklet_schedule(&host->finish_tasklet); |
1114 | } | 1118 | } |
1115 | } | 1119 | |
1116 | 1120 | /* | |
1117 | /* | 1121 | * Unlock first since we might get a call back. |
1118 | * Unlock first since we might get a call back. | 1122 | */ |
1119 | */ | 1123 | spin_unlock(&host->lock); |
1120 | spin_unlock(&host->lock); | ||
1121 | 1124 | ||
1122 | if (change) | ||
1123 | mmc_detect_change(host->mmc); | 1125 | mmc_detect_change(host->mmc); |
1126 | } | ||
1124 | } | 1127 | } |
1125 | 1128 | ||
1126 | static void wbsd_tasklet_fifo(unsigned long param) | 1129 | static void wbsd_tasklet_fifo(unsigned long param) |
@@ -1325,6 +1328,13 @@ static int __devinit wbsd_alloc_mmc(struct device* dev) | |||
1325 | spin_lock_init(&host->lock); | 1328 | spin_lock_init(&host->lock); |
1326 | 1329 | ||
1327 | /* | 1330 | /* |
1331 | * Set up detection timer | ||
1332 | */ | ||
1333 | init_timer(&host->timer); | ||
1334 | host->timer.data = (unsigned long)host; | ||
1335 | host->timer.function = wbsd_detect_card; | ||
1336 | |||
1337 | /* | ||
1328 | * Maximum number of segments. Worst case is one sector per segment | 1338 | * Maximum number of segments. Worst case is one sector per segment |
1329 | * so this will be 64kB/512. | 1339 | * so this will be 64kB/512. |
1330 | */ | 1340 | */ |
@@ -1351,11 +1361,17 @@ static int __devinit wbsd_alloc_mmc(struct device* dev) | |||
1351 | static void __devexit wbsd_free_mmc(struct device* dev) | 1361 | static void __devexit wbsd_free_mmc(struct device* dev) |
1352 | { | 1362 | { |
1353 | struct mmc_host* mmc; | 1363 | struct mmc_host* mmc; |
1364 | struct wbsd_host* host; | ||
1354 | 1365 | ||
1355 | mmc = dev_get_drvdata(dev); | 1366 | mmc = dev_get_drvdata(dev); |
1356 | if (!mmc) | 1367 | if (!mmc) |
1357 | return; | 1368 | return; |
1358 | 1369 | ||
1370 | host = mmc_priv(mmc); | ||
1371 | BUG_ON(host == NULL); | ||
1372 | |||
1373 | del_timer_sync(&host->timer); | ||
1374 | |||
1359 | mmc_free_host(mmc); | 1375 | mmc_free_host(mmc); |
1360 | 1376 | ||
1361 | dev_set_drvdata(dev, NULL); | 1377 | dev_set_drvdata(dev, NULL); |
diff --git a/drivers/mmc/wbsd.h b/drivers/mmc/wbsd.h index 864f30828d01..661a9f6a6e6f 100644 --- a/drivers/mmc/wbsd.h +++ b/drivers/mmc/wbsd.h | |||
@@ -8,13 +8,6 @@ | |||
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | const int config_ports[] = { 0x2E, 0x4E }; | ||
12 | const int unlock_codes[] = { 0x83, 0x87 }; | ||
13 | |||
14 | const int valid_ids[] = { | ||
15 | 0x7112, | ||
16 | }; | ||
17 | |||
18 | #define LOCK_CODE 0xAA | 11 | #define LOCK_CODE 0xAA |
19 | 12 | ||
20 | #define WBSD_CONF_SWRST 0x02 | 13 | #define WBSD_CONF_SWRST 0x02 |
@@ -187,4 +180,6 @@ struct wbsd_host | |||
187 | struct tasklet_struct timeout_tasklet; | 180 | struct tasklet_struct timeout_tasklet; |
188 | struct tasklet_struct finish_tasklet; | 181 | struct tasklet_struct finish_tasklet; |
189 | struct tasklet_struct block_tasklet; | 182 | struct tasklet_struct block_tasklet; |
183 | |||
184 | struct timer_list timer; /* Card detection timer */ | ||
190 | }; | 185 | }; |
diff --git a/drivers/mtd/afs.c b/drivers/mtd/afs.c index 801e6c7d0892..7363e101eb0f 100644 --- a/drivers/mtd/afs.c +++ b/drivers/mtd/afs.c | |||
@@ -219,7 +219,7 @@ static int parse_afs_partitions(struct mtd_info *mtd, | |||
219 | */ | 219 | */ |
220 | for (idx = off = 0; off < mtd->size; off += mtd->erasesize) { | 220 | for (idx = off = 0; off < mtd->size; off += mtd->erasesize) { |
221 | struct image_info_struct iis; | 221 | struct image_info_struct iis; |
222 | u_int iis_ptr, img_ptr, size; | 222 | u_int iis_ptr, img_ptr; |
223 | 223 | ||
224 | /* Read the footer. */ | 224 | /* Read the footer. */ |
225 | ret = afs_read_footer(mtd, &img_ptr, &iis_ptr, off, mask); | 225 | ret = afs_read_footer(mtd, &img_ptr, &iis_ptr, off, mask); |
@@ -236,21 +236,9 @@ static int parse_afs_partitions(struct mtd_info *mtd, | |||
236 | continue; | 236 | continue; |
237 | 237 | ||
238 | strcpy(str, iis.name); | 238 | strcpy(str, iis.name); |
239 | size = mtd->erasesize + off - img_ptr; | ||
240 | |||
241 | /* | ||
242 | * In order to support JFFS2 partitions on this layout, | ||
243 | * we must lie to MTD about the real size of JFFS2 | ||
244 | * partitions; this ensures that the AFS flash footer | ||
245 | * won't be erased by JFFS2. Please ensure that your | ||
246 | * JFFS2 partitions are given image numbers between | ||
247 | * 1000 and 2000 inclusive. | ||
248 | */ | ||
249 | if (iis.imageNumber >= 1000 && iis.imageNumber < 2000) | ||
250 | size -= mtd->erasesize; | ||
251 | 239 | ||
252 | parts[idx].name = str; | 240 | parts[idx].name = str; |
253 | parts[idx].size = size; | 241 | parts[idx].size = (iis.length + mtd->erasesize - 1) & ~(mtd->erasesize - 1); |
254 | parts[idx].offset = img_ptr; | 242 | parts[idx].offset = img_ptr; |
255 | parts[idx].mask_flags = 0; | 243 | parts[idx].mask_flags = 0; |
256 | 244 | ||
diff --git a/drivers/net/shaper.c b/drivers/net/shaper.c index 20edeb345792..3ad0b6751f6f 100644 --- a/drivers/net/shaper.c +++ b/drivers/net/shaper.c | |||
@@ -135,10 +135,8 @@ static int shaper_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
135 | { | 135 | { |
136 | struct shaper *shaper = dev->priv; | 136 | struct shaper *shaper = dev->priv; |
137 | struct sk_buff *ptr; | 137 | struct sk_buff *ptr; |
138 | 138 | ||
139 | if (down_trylock(&shaper->sem)) | 139 | spin_lock(&shaper->lock); |
140 | return -1; | ||
141 | |||
142 | ptr=shaper->sendq.prev; | 140 | ptr=shaper->sendq.prev; |
143 | 141 | ||
144 | /* | 142 | /* |
@@ -232,7 +230,7 @@ static int shaper_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
232 | shaper->stats.collisions++; | 230 | shaper->stats.collisions++; |
233 | } | 231 | } |
234 | shaper_kick(shaper); | 232 | shaper_kick(shaper); |
235 | up(&shaper->sem); | 233 | spin_unlock(&shaper->lock); |
236 | return 0; | 234 | return 0; |
237 | } | 235 | } |
238 | 236 | ||
@@ -271,11 +269,9 @@ static void shaper_timer(unsigned long data) | |||
271 | { | 269 | { |
272 | struct shaper *shaper = (struct shaper *)data; | 270 | struct shaper *shaper = (struct shaper *)data; |
273 | 271 | ||
274 | if (!down_trylock(&shaper->sem)) { | 272 | spin_lock(&shaper->lock); |
275 | shaper_kick(shaper); | 273 | shaper_kick(shaper); |
276 | up(&shaper->sem); | 274 | spin_unlock(&shaper->lock); |
277 | } else | ||
278 | mod_timer(&shaper->timer, jiffies); | ||
279 | } | 275 | } |
280 | 276 | ||
281 | /* | 277 | /* |
@@ -332,21 +328,6 @@ static void shaper_kick(struct shaper *shaper) | |||
332 | 328 | ||
333 | 329 | ||
334 | /* | 330 | /* |
335 | * Flush the shaper queues on a closedown | ||
336 | */ | ||
337 | |||
338 | static void shaper_flush(struct shaper *shaper) | ||
339 | { | ||
340 | struct sk_buff *skb; | ||
341 | |||
342 | down(&shaper->sem); | ||
343 | while((skb=skb_dequeue(&shaper->sendq))!=NULL) | ||
344 | dev_kfree_skb(skb); | ||
345 | shaper_kick(shaper); | ||
346 | up(&shaper->sem); | ||
347 | } | ||
348 | |||
349 | /* | ||
350 | * Bring the interface up. We just disallow this until a | 331 | * Bring the interface up. We just disallow this until a |
351 | * bind. | 332 | * bind. |
352 | */ | 333 | */ |
@@ -375,7 +356,15 @@ static int shaper_open(struct net_device *dev) | |||
375 | static int shaper_close(struct net_device *dev) | 356 | static int shaper_close(struct net_device *dev) |
376 | { | 357 | { |
377 | struct shaper *shaper=dev->priv; | 358 | struct shaper *shaper=dev->priv; |
378 | shaper_flush(shaper); | 359 | struct sk_buff *skb; |
360 | |||
361 | while ((skb = skb_dequeue(&shaper->sendq)) != NULL) | ||
362 | dev_kfree_skb(skb); | ||
363 | |||
364 | spin_lock_bh(&shaper->lock); | ||
365 | shaper_kick(shaper); | ||
366 | spin_unlock_bh(&shaper->lock); | ||
367 | |||
379 | del_timer_sync(&shaper->timer); | 368 | del_timer_sync(&shaper->timer); |
380 | return 0; | 369 | return 0; |
381 | } | 370 | } |
@@ -576,6 +565,7 @@ static void shaper_init_priv(struct net_device *dev) | |||
576 | init_timer(&sh->timer); | 565 | init_timer(&sh->timer); |
577 | sh->timer.function=shaper_timer; | 566 | sh->timer.function=shaper_timer; |
578 | sh->timer.data=(unsigned long)sh; | 567 | sh->timer.data=(unsigned long)sh; |
568 | spin_lock_init(&sh->lock); | ||
579 | } | 569 | } |
580 | 570 | ||
581 | /* | 571 | /* |
diff --git a/drivers/net/skge.h b/drivers/net/skge.h index 14d0cc01fb9a..fced3d2bc072 100644 --- a/drivers/net/skge.h +++ b/drivers/net/skge.h | |||
@@ -7,6 +7,7 @@ | |||
7 | /* PCI config registers */ | 7 | /* PCI config registers */ |
8 | #define PCI_DEV_REG1 0x40 | 8 | #define PCI_DEV_REG1 0x40 |
9 | #define PCI_DEV_REG2 0x44 | 9 | #define PCI_DEV_REG2 0x44 |
10 | #define PCI_REV_DESC 0x4 | ||
10 | 11 | ||
11 | #define PCI_STATUS_ERROR_BITS (PCI_STATUS_DETECTED_PARITY | \ | 12 | #define PCI_STATUS_ERROR_BITS (PCI_STATUS_DETECTED_PARITY | \ |
12 | PCI_STATUS_SIG_SYSTEM_ERROR | \ | 13 | PCI_STATUS_SIG_SYSTEM_ERROR | \ |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 7e371b1209a1..54640686e983 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -66,8 +66,8 @@ | |||
66 | 66 | ||
67 | #define DRV_MODULE_NAME "tg3" | 67 | #define DRV_MODULE_NAME "tg3" |
68 | #define PFX DRV_MODULE_NAME ": " | 68 | #define PFX DRV_MODULE_NAME ": " |
69 | #define DRV_MODULE_VERSION "3.32" | 69 | #define DRV_MODULE_VERSION "3.33" |
70 | #define DRV_MODULE_RELDATE "June 24, 2005" | 70 | #define DRV_MODULE_RELDATE "July 5, 2005" |
71 | 71 | ||
72 | #define TG3_DEF_MAC_MODE 0 | 72 | #define TG3_DEF_MAC_MODE 0 |
73 | #define TG3_DEF_RX_MODE 0 | 73 | #define TG3_DEF_RX_MODE 0 |
@@ -5117,7 +5117,7 @@ static void tg3_set_bdinfo(struct tg3 *tp, u32 bdinfo_addr, | |||
5117 | } | 5117 | } |
5118 | 5118 | ||
5119 | static void __tg3_set_rx_mode(struct net_device *); | 5119 | static void __tg3_set_rx_mode(struct net_device *); |
5120 | static void tg3_set_coalesce(struct tg3 *tp, struct ethtool_coalesce *ec) | 5120 | static void __tg3_set_coalesce(struct tg3 *tp, struct ethtool_coalesce *ec) |
5121 | { | 5121 | { |
5122 | tw32(HOSTCC_RXCOL_TICKS, ec->rx_coalesce_usecs); | 5122 | tw32(HOSTCC_RXCOL_TICKS, ec->rx_coalesce_usecs); |
5123 | tw32(HOSTCC_TXCOL_TICKS, ec->tx_coalesce_usecs); | 5123 | tw32(HOSTCC_TXCOL_TICKS, ec->tx_coalesce_usecs); |
@@ -5460,7 +5460,7 @@ static int tg3_reset_hw(struct tg3 *tp) | |||
5460 | udelay(10); | 5460 | udelay(10); |
5461 | } | 5461 | } |
5462 | 5462 | ||
5463 | tg3_set_coalesce(tp, &tp->coal); | 5463 | __tg3_set_coalesce(tp, &tp->coal); |
5464 | 5464 | ||
5465 | /* set status block DMA address */ | 5465 | /* set status block DMA address */ |
5466 | tw32(HOSTCC_STATUS_BLK_HOST_ADDR + TG3_64BIT_REG_HIGH, | 5466 | tw32(HOSTCC_STATUS_BLK_HOST_ADDR + TG3_64BIT_REG_HIGH, |
@@ -7821,6 +7821,60 @@ static int tg3_get_coalesce(struct net_device *dev, struct ethtool_coalesce *ec) | |||
7821 | return 0; | 7821 | return 0; |
7822 | } | 7822 | } |
7823 | 7823 | ||
7824 | static int tg3_set_coalesce(struct net_device *dev, struct ethtool_coalesce *ec) | ||
7825 | { | ||
7826 | struct tg3 *tp = netdev_priv(dev); | ||
7827 | u32 max_rxcoal_tick_int = 0, max_txcoal_tick_int = 0; | ||
7828 | u32 max_stat_coal_ticks = 0, min_stat_coal_ticks = 0; | ||
7829 | |||
7830 | if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) { | ||
7831 | max_rxcoal_tick_int = MAX_RXCOAL_TICK_INT; | ||
7832 | max_txcoal_tick_int = MAX_TXCOAL_TICK_INT; | ||
7833 | max_stat_coal_ticks = MAX_STAT_COAL_TICKS; | ||
7834 | min_stat_coal_ticks = MIN_STAT_COAL_TICKS; | ||
7835 | } | ||
7836 | |||
7837 | if ((ec->rx_coalesce_usecs > MAX_RXCOL_TICKS) || | ||
7838 | (ec->tx_coalesce_usecs > MAX_TXCOL_TICKS) || | ||
7839 | (ec->rx_max_coalesced_frames > MAX_RXMAX_FRAMES) || | ||
7840 | (ec->tx_max_coalesced_frames > MAX_TXMAX_FRAMES) || | ||
7841 | (ec->rx_coalesce_usecs_irq > max_rxcoal_tick_int) || | ||
7842 | (ec->tx_coalesce_usecs_irq > max_txcoal_tick_int) || | ||
7843 | (ec->rx_max_coalesced_frames_irq > MAX_RXCOAL_MAXF_INT) || | ||
7844 | (ec->tx_max_coalesced_frames_irq > MAX_TXCOAL_MAXF_INT) || | ||
7845 | (ec->stats_block_coalesce_usecs > max_stat_coal_ticks) || | ||
7846 | (ec->stats_block_coalesce_usecs < min_stat_coal_ticks)) | ||
7847 | return -EINVAL; | ||
7848 | |||
7849 | /* No rx interrupts will be generated if both are zero */ | ||
7850 | if ((ec->rx_coalesce_usecs == 0) && | ||
7851 | (ec->rx_max_coalesced_frames == 0)) | ||
7852 | return -EINVAL; | ||
7853 | |||
7854 | /* No tx interrupts will be generated if both are zero */ | ||
7855 | if ((ec->tx_coalesce_usecs == 0) && | ||
7856 | (ec->tx_max_coalesced_frames == 0)) | ||
7857 | return -EINVAL; | ||
7858 | |||
7859 | /* Only copy relevant parameters, ignore all others. */ | ||
7860 | tp->coal.rx_coalesce_usecs = ec->rx_coalesce_usecs; | ||
7861 | tp->coal.tx_coalesce_usecs = ec->tx_coalesce_usecs; | ||
7862 | tp->coal.rx_max_coalesced_frames = ec->rx_max_coalesced_frames; | ||
7863 | tp->coal.tx_max_coalesced_frames = ec->tx_max_coalesced_frames; | ||
7864 | tp->coal.rx_coalesce_usecs_irq = ec->rx_coalesce_usecs_irq; | ||
7865 | tp->coal.tx_coalesce_usecs_irq = ec->tx_coalesce_usecs_irq; | ||
7866 | tp->coal.rx_max_coalesced_frames_irq = ec->rx_max_coalesced_frames_irq; | ||
7867 | tp->coal.tx_max_coalesced_frames_irq = ec->tx_max_coalesced_frames_irq; | ||
7868 | tp->coal.stats_block_coalesce_usecs = ec->stats_block_coalesce_usecs; | ||
7869 | |||
7870 | if (netif_running(dev)) { | ||
7871 | tg3_full_lock(tp, 0); | ||
7872 | __tg3_set_coalesce(tp, &tp->coal); | ||
7873 | tg3_full_unlock(tp); | ||
7874 | } | ||
7875 | return 0; | ||
7876 | } | ||
7877 | |||
7824 | static struct ethtool_ops tg3_ethtool_ops = { | 7878 | static struct ethtool_ops tg3_ethtool_ops = { |
7825 | .get_settings = tg3_get_settings, | 7879 | .get_settings = tg3_get_settings, |
7826 | .set_settings = tg3_set_settings, | 7880 | .set_settings = tg3_set_settings, |
@@ -7856,6 +7910,7 @@ static struct ethtool_ops tg3_ethtool_ops = { | |||
7856 | .get_stats_count = tg3_get_stats_count, | 7910 | .get_stats_count = tg3_get_stats_count, |
7857 | .get_ethtool_stats = tg3_get_ethtool_stats, | 7911 | .get_ethtool_stats = tg3_get_ethtool_stats, |
7858 | .get_coalesce = tg3_get_coalesce, | 7912 | .get_coalesce = tg3_get_coalesce, |
7913 | .set_coalesce = tg3_set_coalesce, | ||
7859 | }; | 7914 | }; |
7860 | 7915 | ||
7861 | static void __devinit tg3_get_eeprom_size(struct tg3 *tp) | 7916 | static void __devinit tg3_get_eeprom_size(struct tg3 *tp) |
@@ -9800,6 +9855,12 @@ static void __devinit tg3_init_coal(struct tg3 *tp) | |||
9800 | ec->tx_coalesce_usecs = LOW_TXCOL_TICKS_CLRTCKS; | 9855 | ec->tx_coalesce_usecs = LOW_TXCOL_TICKS_CLRTCKS; |
9801 | ec->tx_coalesce_usecs_irq = DEFAULT_TXCOAL_TICK_INT_CLRTCKS; | 9856 | ec->tx_coalesce_usecs_irq = DEFAULT_TXCOAL_TICK_INT_CLRTCKS; |
9802 | } | 9857 | } |
9858 | |||
9859 | if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS) { | ||
9860 | ec->rx_coalesce_usecs_irq = 0; | ||
9861 | ec->tx_coalesce_usecs_irq = 0; | ||
9862 | ec->stats_block_coalesce_usecs = 0; | ||
9863 | } | ||
9803 | } | 9864 | } |
9804 | 9865 | ||
9805 | static int __devinit tg3_init_one(struct pci_dev *pdev, | 9866 | static int __devinit tg3_init_one(struct pci_dev *pdev, |
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h index 99c5f9675a56..70ad450733e6 100644 --- a/drivers/net/tg3.h +++ b/drivers/net/tg3.h | |||
@@ -879,31 +879,41 @@ | |||
879 | #define LOW_RXCOL_TICKS_CLRTCKS 0x00000014 | 879 | #define LOW_RXCOL_TICKS_CLRTCKS 0x00000014 |
880 | #define DEFAULT_RXCOL_TICKS 0x00000048 | 880 | #define DEFAULT_RXCOL_TICKS 0x00000048 |
881 | #define HIGH_RXCOL_TICKS 0x00000096 | 881 | #define HIGH_RXCOL_TICKS 0x00000096 |
882 | #define MAX_RXCOL_TICKS 0x000003ff | ||
882 | #define HOSTCC_TXCOL_TICKS 0x00003c0c | 883 | #define HOSTCC_TXCOL_TICKS 0x00003c0c |
883 | #define LOW_TXCOL_TICKS 0x00000096 | 884 | #define LOW_TXCOL_TICKS 0x00000096 |
884 | #define LOW_TXCOL_TICKS_CLRTCKS 0x00000048 | 885 | #define LOW_TXCOL_TICKS_CLRTCKS 0x00000048 |
885 | #define DEFAULT_TXCOL_TICKS 0x0000012c | 886 | #define DEFAULT_TXCOL_TICKS 0x0000012c |
886 | #define HIGH_TXCOL_TICKS 0x00000145 | 887 | #define HIGH_TXCOL_TICKS 0x00000145 |
888 | #define MAX_TXCOL_TICKS 0x000003ff | ||
887 | #define HOSTCC_RXMAX_FRAMES 0x00003c10 | 889 | #define HOSTCC_RXMAX_FRAMES 0x00003c10 |
888 | #define LOW_RXMAX_FRAMES 0x00000005 | 890 | #define LOW_RXMAX_FRAMES 0x00000005 |
889 | #define DEFAULT_RXMAX_FRAMES 0x00000008 | 891 | #define DEFAULT_RXMAX_FRAMES 0x00000008 |
890 | #define HIGH_RXMAX_FRAMES 0x00000012 | 892 | #define HIGH_RXMAX_FRAMES 0x00000012 |
893 | #define MAX_RXMAX_FRAMES 0x000000ff | ||
891 | #define HOSTCC_TXMAX_FRAMES 0x00003c14 | 894 | #define HOSTCC_TXMAX_FRAMES 0x00003c14 |
892 | #define LOW_TXMAX_FRAMES 0x00000035 | 895 | #define LOW_TXMAX_FRAMES 0x00000035 |
893 | #define DEFAULT_TXMAX_FRAMES 0x0000004b | 896 | #define DEFAULT_TXMAX_FRAMES 0x0000004b |
894 | #define HIGH_TXMAX_FRAMES 0x00000052 | 897 | #define HIGH_TXMAX_FRAMES 0x00000052 |
898 | #define MAX_TXMAX_FRAMES 0x000000ff | ||
895 | #define HOSTCC_RXCOAL_TICK_INT 0x00003c18 | 899 | #define HOSTCC_RXCOAL_TICK_INT 0x00003c18 |
896 | #define DEFAULT_RXCOAL_TICK_INT 0x00000019 | 900 | #define DEFAULT_RXCOAL_TICK_INT 0x00000019 |
897 | #define DEFAULT_RXCOAL_TICK_INT_CLRTCKS 0x00000014 | 901 | #define DEFAULT_RXCOAL_TICK_INT_CLRTCKS 0x00000014 |
902 | #define MAX_RXCOAL_TICK_INT 0x000003ff | ||
898 | #define HOSTCC_TXCOAL_TICK_INT 0x00003c1c | 903 | #define HOSTCC_TXCOAL_TICK_INT 0x00003c1c |
899 | #define DEFAULT_TXCOAL_TICK_INT 0x00000019 | 904 | #define DEFAULT_TXCOAL_TICK_INT 0x00000019 |
900 | #define DEFAULT_TXCOAL_TICK_INT_CLRTCKS 0x00000014 | 905 | #define DEFAULT_TXCOAL_TICK_INT_CLRTCKS 0x00000014 |
906 | #define MAX_TXCOAL_TICK_INT 0x000003ff | ||
901 | #define HOSTCC_RXCOAL_MAXF_INT 0x00003c20 | 907 | #define HOSTCC_RXCOAL_MAXF_INT 0x00003c20 |
902 | #define DEFAULT_RXCOAL_MAXF_INT 0x00000005 | 908 | #define DEFAULT_RXCOAL_MAXF_INT 0x00000005 |
909 | #define MAX_RXCOAL_MAXF_INT 0x000000ff | ||
903 | #define HOSTCC_TXCOAL_MAXF_INT 0x00003c24 | 910 | #define HOSTCC_TXCOAL_MAXF_INT 0x00003c24 |
904 | #define DEFAULT_TXCOAL_MAXF_INT 0x00000005 | 911 | #define DEFAULT_TXCOAL_MAXF_INT 0x00000005 |
912 | #define MAX_TXCOAL_MAXF_INT 0x000000ff | ||
905 | #define HOSTCC_STAT_COAL_TICKS 0x00003c28 | 913 | #define HOSTCC_STAT_COAL_TICKS 0x00003c28 |
906 | #define DEFAULT_STAT_COAL_TICKS 0x000f4240 | 914 | #define DEFAULT_STAT_COAL_TICKS 0x000f4240 |
915 | #define MAX_STAT_COAL_TICKS 0xd693d400 | ||
916 | #define MIN_STAT_COAL_TICKS 0x00000064 | ||
907 | /* 0x3c2c --> 0x3c30 unused */ | 917 | /* 0x3c2c --> 0x3c30 unused */ |
908 | #define HOSTCC_STATS_BLK_HOST_ADDR 0x00003c30 /* 64-bit */ | 918 | #define HOSTCC_STATS_BLK_HOST_ADDR 0x00003c30 /* 64-bit */ |
909 | #define HOSTCC_STATUS_BLK_HOST_ADDR 0x00003c38 /* 64-bit */ | 919 | #define HOSTCC_STATUS_BLK_HOST_ADDR 0x00003c38 /* 64-bit */ |
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c index 80edfa3abd29..4598c6a9212d 100644 --- a/drivers/parport/parport_pc.c +++ b/drivers/parport/parport_pc.c | |||
@@ -3008,7 +3008,7 @@ static int __init parport_pc_init_superio (int autoirq, int autodma) | |||
3008 | int ret = 0; | 3008 | int ret = 0; |
3009 | 3009 | ||
3010 | while ((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) { | 3010 | while ((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) { |
3011 | id = pci_match_device (parport_pc_pci_tbl, pdev); | 3011 | id = pci_match_id(parport_pc_pci_tbl, pdev); |
3012 | if (id == NULL || id->driver_data >= last_sio) | 3012 | if (id == NULL || id->driver_data >= last_sio) |
3013 | continue; | 3013 | continue; |
3014 | 3014 | ||
diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile index 7dea494c0d7b..3657f6199c48 100644 --- a/drivers/pci/Makefile +++ b/drivers/pci/Makefile | |||
@@ -19,6 +19,7 @@ obj-$(CONFIG_HOTPLUG_PCI) += hotplug/ | |||
19 | # | 19 | # |
20 | # Some architectures use the generic PCI setup functions | 20 | # Some architectures use the generic PCI setup functions |
21 | # | 21 | # |
22 | obj-$(CONFIG_X86) += setup-bus.o | ||
22 | obj-$(CONFIG_ALPHA) += setup-bus.o setup-irq.o | 23 | obj-$(CONFIG_ALPHA) += setup-bus.o setup-irq.o |
23 | obj-$(CONFIG_ARM) += setup-bus.o setup-irq.o | 24 | obj-$(CONFIG_ARM) += setup-bus.o setup-irq.o |
24 | obj-$(CONFIG_PARISC) += setup-bus.o | 25 | obj-$(CONFIG_PARISC) += setup-bus.o |
diff --git a/drivers/pci/hotplug.c b/drivers/pci/hotplug.c index 3903f8c559b6..b844bc972324 100644 --- a/drivers/pci/hotplug.c +++ b/drivers/pci/hotplug.c | |||
@@ -54,7 +54,7 @@ int pci_hotplug (struct device *dev, char **envp, int num_envp, | |||
54 | 54 | ||
55 | envp[i++] = scratch; | 55 | envp[i++] = scratch; |
56 | length += scnprintf (scratch, buffer_size - length, | 56 | length += scnprintf (scratch, buffer_size - length, |
57 | "MODALIAS=pci:v%08Xd%08Xsv%08Xsd%08Xbc%02Xsc%02Xi%02x\n", | 57 | "MODALIAS=pci:v%08Xd%08Xsv%08Xsd%08Xbc%02Xsc%02Xi%02x", |
58 | pdev->vendor, pdev->device, | 58 | pdev->vendor, pdev->device, |
59 | pdev->subsystem_vendor, pdev->subsystem_device, | 59 | pdev->subsystem_vendor, pdev->subsystem_device, |
60 | (u8)(pdev->class >> 16), (u8)(pdev->class >> 8), | 60 | (u8)(pdev->class >> 16), (u8)(pdev->class >> 8), |
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index e65bf2b395aa..e4115a0d5ba6 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
@@ -7,7 +7,6 @@ | |||
7 | #include <linux/module.h> | 7 | #include <linux/module.h> |
8 | #include <linux/init.h> | 8 | #include <linux/init.h> |
9 | #include <linux/device.h> | 9 | #include <linux/device.h> |
10 | #include <linux/pci-dynids.h> | ||
11 | #include "pci.h" | 10 | #include "pci.h" |
12 | 11 | ||
13 | /* | 12 | /* |
@@ -18,36 +17,12 @@ | |||
18 | * Dynamic device IDs are disabled for !CONFIG_HOTPLUG | 17 | * Dynamic device IDs are disabled for !CONFIG_HOTPLUG |
19 | */ | 18 | */ |
20 | 19 | ||
21 | #ifdef CONFIG_HOTPLUG | 20 | struct pci_dynid { |
22 | /** | 21 | struct list_head node; |
23 | * pci_device_probe_dynamic() | 22 | struct pci_device_id id; |
24 | * | 23 | }; |
25 | * Walk the dynamic ID list looking for a match. | ||
26 | * returns 0 and sets pci_dev->driver when drv claims pci_dev, else error. | ||
27 | */ | ||
28 | static int | ||
29 | pci_device_probe_dynamic(struct pci_driver *drv, struct pci_dev *pci_dev) | ||
30 | { | ||
31 | int error = -ENODEV; | ||
32 | struct list_head *pos; | ||
33 | struct dynid *dynid; | ||
34 | 24 | ||
35 | spin_lock(&drv->dynids.lock); | 25 | #ifdef CONFIG_HOTPLUG |
36 | list_for_each(pos, &drv->dynids.list) { | ||
37 | dynid = list_entry(pos, struct dynid, node); | ||
38 | if (pci_match_one_device(&dynid->id, pci_dev)) { | ||
39 | spin_unlock(&drv->dynids.lock); | ||
40 | error = drv->probe(pci_dev, &dynid->id); | ||
41 | if (error >= 0) { | ||
42 | pci_dev->driver = drv; | ||
43 | return 0; | ||
44 | } | ||
45 | return error; | ||
46 | } | ||
47 | } | ||
48 | spin_unlock(&drv->dynids.lock); | ||
49 | return error; | ||
50 | } | ||
51 | 26 | ||
52 | /** | 27 | /** |
53 | * store_new_id | 28 | * store_new_id |
@@ -58,8 +33,7 @@ pci_device_probe_dynamic(struct pci_driver *drv, struct pci_dev *pci_dev) | |||
58 | static inline ssize_t | 33 | static inline ssize_t |
59 | store_new_id(struct device_driver *driver, const char *buf, size_t count) | 34 | store_new_id(struct device_driver *driver, const char *buf, size_t count) |
60 | { | 35 | { |
61 | struct dynid *dynid; | 36 | struct pci_dynid *dynid; |
62 | struct bus_type * bus; | ||
63 | struct pci_driver *pdrv = to_pci_driver(driver); | 37 | struct pci_driver *pdrv = to_pci_driver(driver); |
64 | __u32 vendor=PCI_ANY_ID, device=PCI_ANY_ID, subvendor=PCI_ANY_ID, | 38 | __u32 vendor=PCI_ANY_ID, device=PCI_ANY_ID, subvendor=PCI_ANY_ID, |
65 | subdevice=PCI_ANY_ID, class=0, class_mask=0; | 39 | subdevice=PCI_ANY_ID, class=0, class_mask=0; |
@@ -91,37 +65,22 @@ store_new_id(struct device_driver *driver, const char *buf, size_t count) | |||
91 | list_add_tail(&pdrv->dynids.list, &dynid->node); | 65 | list_add_tail(&pdrv->dynids.list, &dynid->node); |
92 | spin_unlock(&pdrv->dynids.lock); | 66 | spin_unlock(&pdrv->dynids.lock); |
93 | 67 | ||
94 | bus = get_bus(pdrv->driver.bus); | 68 | if (get_driver(&pdrv->driver)) { |
95 | if (bus) { | 69 | driver_attach(&pdrv->driver); |
96 | if (get_driver(&pdrv->driver)) { | 70 | put_driver(&pdrv->driver); |
97 | down_write(&bus->subsys.rwsem); | ||
98 | driver_attach(&pdrv->driver); | ||
99 | up_write(&bus->subsys.rwsem); | ||
100 | put_driver(&pdrv->driver); | ||
101 | } | ||
102 | put_bus(bus); | ||
103 | } | 71 | } |
104 | 72 | ||
105 | return count; | 73 | return count; |
106 | } | 74 | } |
107 | |||
108 | static DRIVER_ATTR(new_id, S_IWUSR, NULL, store_new_id); | 75 | static DRIVER_ATTR(new_id, S_IWUSR, NULL, store_new_id); |
109 | static inline void | ||
110 | pci_init_dynids(struct pci_dynids *dynids) | ||
111 | { | ||
112 | spin_lock_init(&dynids->lock); | ||
113 | INIT_LIST_HEAD(&dynids->list); | ||
114 | } | ||
115 | 76 | ||
116 | static void | 77 | static void |
117 | pci_free_dynids(struct pci_driver *drv) | 78 | pci_free_dynids(struct pci_driver *drv) |
118 | { | 79 | { |
119 | struct list_head *pos, *n; | 80 | struct pci_dynid *dynid, *n; |
120 | struct dynid *dynid; | ||
121 | 81 | ||
122 | spin_lock(&drv->dynids.lock); | 82 | spin_lock(&drv->dynids.lock); |
123 | list_for_each_safe(pos, n, &drv->dynids.list) { | 83 | list_for_each_entry_safe(dynid, n, &drv->dynids.list, node) { |
124 | dynid = list_entry(pos, struct dynid, node); | ||
125 | list_del(&dynid->node); | 84 | list_del(&dynid->node); |
126 | kfree(dynid); | 85 | kfree(dynid); |
127 | } | 86 | } |
@@ -138,83 +97,70 @@ pci_create_newid_file(struct pci_driver *drv) | |||
138 | return error; | 97 | return error; |
139 | } | 98 | } |
140 | 99 | ||
141 | static int | ||
142 | pci_bus_match_dynids(const struct pci_dev *pci_dev, struct pci_driver *pci_drv) | ||
143 | { | ||
144 | struct list_head *pos; | ||
145 | struct dynid *dynid; | ||
146 | |||
147 | spin_lock(&pci_drv->dynids.lock); | ||
148 | list_for_each(pos, &pci_drv->dynids.list) { | ||
149 | dynid = list_entry(pos, struct dynid, node); | ||
150 | if (pci_match_one_device(&dynid->id, pci_dev)) { | ||
151 | spin_unlock(&pci_drv->dynids.lock); | ||
152 | return 1; | ||
153 | } | ||
154 | } | ||
155 | spin_unlock(&pci_drv->dynids.lock); | ||
156 | return 0; | ||
157 | } | ||
158 | |||
159 | #else /* !CONFIG_HOTPLUG */ | 100 | #else /* !CONFIG_HOTPLUG */ |
160 | static inline int pci_device_probe_dynamic(struct pci_driver *drv, struct pci_dev *pci_dev) | ||
161 | { | ||
162 | return -ENODEV; | ||
163 | } | ||
164 | static inline void pci_init_dynids(struct pci_dynids *dynids) {} | ||
165 | static inline void pci_free_dynids(struct pci_driver *drv) {} | 101 | static inline void pci_free_dynids(struct pci_driver *drv) {} |
166 | static inline int pci_create_newid_file(struct pci_driver *drv) | 102 | static inline int pci_create_newid_file(struct pci_driver *drv) |
167 | { | 103 | { |
168 | return 0; | 104 | return 0; |
169 | } | 105 | } |
170 | static inline int pci_bus_match_dynids(const struct pci_dev *pci_dev, struct pci_driver *pci_drv) | ||
171 | { | ||
172 | return 0; | ||
173 | } | ||
174 | #endif | 106 | #endif |
175 | 107 | ||
176 | /** | 108 | /** |
177 | * pci_match_device - Tell if a PCI device structure has a matching | 109 | * pci_match_id - See if a pci device matches a given pci_id table |
178 | * PCI device id structure | ||
179 | * @ids: array of PCI device id structures to search in | 110 | * @ids: array of PCI device id structures to search in |
180 | * @dev: the PCI device structure to match against | 111 | * @dev: the PCI device structure to match against. |
181 | * | 112 | * |
182 | * Used by a driver to check whether a PCI device present in the | 113 | * Used by a driver to check whether a PCI device present in the |
183 | * system is in its list of supported devices.Returns the matching | 114 | * system is in its list of supported devices. Returns the matching |
184 | * pci_device_id structure or %NULL if there is no match. | 115 | * pci_device_id structure or %NULL if there is no match. |
116 | * | ||
117 | * Depreciated, don't use this as it will not catch any dynamic ids | ||
118 | * that a driver might want to check for. | ||
185 | */ | 119 | */ |
186 | const struct pci_device_id * | 120 | const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, |
187 | pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev) | 121 | struct pci_dev *dev) |
188 | { | 122 | { |
189 | while (ids->vendor || ids->subvendor || ids->class_mask) { | 123 | if (ids) { |
190 | if (pci_match_one_device(ids, dev)) | 124 | while (ids->vendor || ids->subvendor || ids->class_mask) { |
191 | return ids; | 125 | if (pci_match_one_device(ids, dev)) |
192 | ids++; | 126 | return ids; |
127 | ids++; | ||
128 | } | ||
193 | } | 129 | } |
194 | return NULL; | 130 | return NULL; |
195 | } | 131 | } |
196 | 132 | ||
197 | /** | 133 | /** |
198 | * pci_device_probe_static() | 134 | * pci_match_device - Tell if a PCI device structure has a matching |
199 | * | 135 | * PCI device id structure |
200 | * returns 0 and sets pci_dev->driver when drv claims pci_dev, else error. | 136 | * @ids: array of PCI device id structures to search in |
137 | * @dev: the PCI device structure to match against | ||
138 | * @drv: the PCI driver to match against | ||
139 | * | ||
140 | * Used by a driver to check whether a PCI device present in the | ||
141 | * system is in its list of supported devices. Returns the matching | ||
142 | * pci_device_id structure or %NULL if there is no match. | ||
201 | */ | 143 | */ |
202 | static int | 144 | const struct pci_device_id *pci_match_device(struct pci_driver *drv, |
203 | pci_device_probe_static(struct pci_driver *drv, struct pci_dev *pci_dev) | 145 | struct pci_dev *dev) |
204 | { | 146 | { |
205 | int error = -ENODEV; | ||
206 | const struct pci_device_id *id; | 147 | const struct pci_device_id *id; |
148 | struct pci_dynid *dynid; | ||
207 | 149 | ||
208 | if (!drv->id_table) | 150 | id = pci_match_id(drv->id_table, dev); |
209 | return error; | ||
210 | id = pci_match_device(drv->id_table, pci_dev); | ||
211 | if (id) | 151 | if (id) |
212 | error = drv->probe(pci_dev, id); | 152 | return id; |
213 | if (error >= 0) { | 153 | |
214 | pci_dev->driver = drv; | 154 | /* static ids didn't match, lets look at the dynamic ones */ |
215 | error = 0; | 155 | spin_lock(&drv->dynids.lock); |
156 | list_for_each_entry(dynid, &drv->dynids.list, node) { | ||
157 | if (pci_match_one_device(&dynid->id, dev)) { | ||
158 | spin_unlock(&drv->dynids.lock); | ||
159 | return &dynid->id; | ||
160 | } | ||
216 | } | 161 | } |
217 | return error; | 162 | spin_unlock(&drv->dynids.lock); |
163 | return NULL; | ||
218 | } | 164 | } |
219 | 165 | ||
220 | /** | 166 | /** |
@@ -225,13 +171,20 @@ pci_device_probe_static(struct pci_driver *drv, struct pci_dev *pci_dev) | |||
225 | */ | 171 | */ |
226 | static int | 172 | static int |
227 | __pci_device_probe(struct pci_driver *drv, struct pci_dev *pci_dev) | 173 | __pci_device_probe(struct pci_driver *drv, struct pci_dev *pci_dev) |
228 | { | 174 | { |
175 | const struct pci_device_id *id; | ||
229 | int error = 0; | 176 | int error = 0; |
230 | 177 | ||
231 | if (!pci_dev->driver && drv->probe) { | 178 | if (!pci_dev->driver && drv->probe) { |
232 | error = pci_device_probe_static(drv, pci_dev); | 179 | error = -ENODEV; |
233 | if (error == -ENODEV) | 180 | |
234 | error = pci_device_probe_dynamic(drv, pci_dev); | 181 | id = pci_match_device(drv, pci_dev); |
182 | if (id) | ||
183 | error = drv->probe(pci_dev, id); | ||
184 | if (error >= 0) { | ||
185 | pci_dev->driver = drv; | ||
186 | error = 0; | ||
187 | } | ||
235 | } | 188 | } |
236 | return error; | 189 | return error; |
237 | } | 190 | } |
@@ -371,12 +324,6 @@ static struct kobj_type pci_driver_kobj_type = { | |||
371 | .sysfs_ops = &pci_driver_sysfs_ops, | 324 | .sysfs_ops = &pci_driver_sysfs_ops, |
372 | }; | 325 | }; |
373 | 326 | ||
374 | static int | ||
375 | pci_populate_driver_dir(struct pci_driver *drv) | ||
376 | { | ||
377 | return pci_create_newid_file(drv); | ||
378 | } | ||
379 | |||
380 | /** | 327 | /** |
381 | * pci_register_driver - register a new pci driver | 328 | * pci_register_driver - register a new pci driver |
382 | * @drv: the driver structure to register | 329 | * @drv: the driver structure to register |
@@ -401,13 +348,15 @@ int pci_register_driver(struct pci_driver *drv) | |||
401 | drv->driver.shutdown = pci_device_shutdown; | 348 | drv->driver.shutdown = pci_device_shutdown; |
402 | drv->driver.owner = drv->owner; | 349 | drv->driver.owner = drv->owner; |
403 | drv->driver.kobj.ktype = &pci_driver_kobj_type; | 350 | drv->driver.kobj.ktype = &pci_driver_kobj_type; |
404 | pci_init_dynids(&drv->dynids); | 351 | |
352 | spin_lock_init(&drv->dynids.lock); | ||
353 | INIT_LIST_HEAD(&drv->dynids.list); | ||
405 | 354 | ||
406 | /* register with core */ | 355 | /* register with core */ |
407 | error = driver_register(&drv->driver); | 356 | error = driver_register(&drv->driver); |
408 | 357 | ||
409 | if (!error) | 358 | if (!error) |
410 | pci_populate_driver_dir(drv); | 359 | error = pci_create_newid_file(drv); |
411 | 360 | ||
412 | return error; | 361 | return error; |
413 | } | 362 | } |
@@ -463,21 +412,17 @@ pci_dev_driver(const struct pci_dev *dev) | |||
463 | * system is in its list of supported devices.Returns the matching | 412 | * system is in its list of supported devices.Returns the matching |
464 | * pci_device_id structure or %NULL if there is no match. | 413 | * pci_device_id structure or %NULL if there is no match. |
465 | */ | 414 | */ |
466 | static int pci_bus_match(struct device * dev, struct device_driver * drv) | 415 | static int pci_bus_match(struct device *dev, struct device_driver *drv) |
467 | { | 416 | { |
468 | const struct pci_dev * pci_dev = to_pci_dev(dev); | 417 | struct pci_dev *pci_dev = to_pci_dev(dev); |
469 | struct pci_driver * pci_drv = to_pci_driver(drv); | 418 | struct pci_driver *pci_drv = to_pci_driver(drv); |
470 | const struct pci_device_id * ids = pci_drv->id_table; | ||
471 | const struct pci_device_id *found_id; | 419 | const struct pci_device_id *found_id; |
472 | 420 | ||
473 | if (!ids) | 421 | found_id = pci_match_device(pci_drv, pci_dev); |
474 | return 0; | ||
475 | |||
476 | found_id = pci_match_device(ids, pci_dev); | ||
477 | if (found_id) | 422 | if (found_id) |
478 | return 1; | 423 | return 1; |
479 | 424 | ||
480 | return pci_bus_match_dynids(pci_dev, pci_drv); | 425 | return 0; |
481 | } | 426 | } |
482 | 427 | ||
483 | /** | 428 | /** |
@@ -536,6 +481,7 @@ static int __init pci_driver_init(void) | |||
536 | 481 | ||
537 | postcore_initcall(pci_driver_init); | 482 | postcore_initcall(pci_driver_init); |
538 | 483 | ||
484 | EXPORT_SYMBOL(pci_match_id); | ||
539 | EXPORT_SYMBOL(pci_match_device); | 485 | EXPORT_SYMBOL(pci_match_device); |
540 | EXPORT_SYMBOL(pci_register_driver); | 486 | EXPORT_SYMBOL(pci_register_driver); |
541 | EXPORT_SYMBOL(pci_unregister_driver); | 487 | EXPORT_SYMBOL(pci_unregister_driver); |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index f04b9ffe4153..d382bdb7b560 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -334,10 +334,6 @@ EXPORT_SYMBOL(pci_choose_state); | |||
334 | /** | 334 | /** |
335 | * pci_save_state - save the PCI configuration space of a device before suspending | 335 | * pci_save_state - save the PCI configuration space of a device before suspending |
336 | * @dev: - PCI device that we're dealing with | 336 | * @dev: - PCI device that we're dealing with |
337 | * @buffer: - buffer to hold config space context | ||
338 | * | ||
339 | * @buffer must be large enough to hold the entire PCI 2.2 config space | ||
340 | * (>= 64 bytes). | ||
341 | */ | 337 | */ |
342 | int | 338 | int |
343 | pci_save_state(struct pci_dev *dev) | 339 | pci_save_state(struct pci_dev *dev) |
@@ -352,8 +348,6 @@ pci_save_state(struct pci_dev *dev) | |||
352 | /** | 348 | /** |
353 | * pci_restore_state - Restore the saved state of a PCI device | 349 | * pci_restore_state - Restore the saved state of a PCI device |
354 | * @dev: - PCI device that we're dealing with | 350 | * @dev: - PCI device that we're dealing with |
355 | * @buffer: - saved PCI config space | ||
356 | * | ||
357 | */ | 351 | */ |
358 | int | 352 | int |
359 | pci_restore_state(struct pci_dev *dev) | 353 | pci_restore_state(struct pci_dev *dev) |
diff --git a/drivers/pci/pcie/portdrv.h b/drivers/pci/pcie/portdrv.h index 537b372dc340..a63bd8f72601 100644 --- a/drivers/pci/pcie/portdrv.h +++ b/drivers/pci/pcie/portdrv.h | |||
@@ -27,6 +27,11 @@ | |||
27 | 27 | ||
28 | #define get_descriptor_id(type, service) (((type - 4) << 4) | service) | 28 | #define get_descriptor_id(type, service) (((type - 4) << 4) | service) |
29 | 29 | ||
30 | struct pcie_port_device_ext { | ||
31 | int interrupt_mode; /* [0:INTx | 1:MSI | 2:MSI-X] */ | ||
32 | unsigned int saved_msi_config_space[5]; | ||
33 | }; | ||
34 | |||
30 | extern struct bus_type pcie_port_bus_type; | 35 | extern struct bus_type pcie_port_bus_type; |
31 | extern int pcie_port_device_probe(struct pci_dev *dev); | 36 | extern int pcie_port_device_probe(struct pci_dev *dev); |
32 | extern int pcie_port_device_register(struct pci_dev *dev); | 37 | extern int pcie_port_device_register(struct pci_dev *dev); |
diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index f5c5f10a3d2f..4db69982876e 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c | |||
@@ -275,10 +275,17 @@ int pcie_port_device_probe(struct pci_dev *dev) | |||
275 | 275 | ||
276 | int pcie_port_device_register(struct pci_dev *dev) | 276 | int pcie_port_device_register(struct pci_dev *dev) |
277 | { | 277 | { |
278 | struct pcie_port_device_ext *p_ext; | ||
278 | int status, type, capabilities, irq_mode, i; | 279 | int status, type, capabilities, irq_mode, i; |
279 | int vectors[PCIE_PORT_DEVICE_MAXSERVICES]; | 280 | int vectors[PCIE_PORT_DEVICE_MAXSERVICES]; |
280 | u16 reg16; | 281 | u16 reg16; |
281 | 282 | ||
283 | /* Allocate port device extension */ | ||
284 | if (!(p_ext = kmalloc(sizeof(struct pcie_port_device_ext), GFP_KERNEL))) | ||
285 | return -ENOMEM; | ||
286 | |||
287 | pci_set_drvdata(dev, p_ext); | ||
288 | |||
282 | /* Get port type */ | 289 | /* Get port type */ |
283 | pci_read_config_word(dev, | 290 | pci_read_config_word(dev, |
284 | pci_find_capability(dev, PCI_CAP_ID_EXP) + | 291 | pci_find_capability(dev, PCI_CAP_ID_EXP) + |
@@ -288,6 +295,7 @@ int pcie_port_device_register(struct pci_dev *dev) | |||
288 | /* Now get port services */ | 295 | /* Now get port services */ |
289 | capabilities = get_port_device_capability(dev); | 296 | capabilities = get_port_device_capability(dev); |
290 | irq_mode = assign_interrupt_mode(dev, vectors, capabilities); | 297 | irq_mode = assign_interrupt_mode(dev, vectors, capabilities); |
298 | p_ext->interrupt_mode = irq_mode; | ||
291 | 299 | ||
292 | /* Allocate child services if any */ | 300 | /* Allocate child services if any */ |
293 | for (i = 0; i < PCIE_PORT_DEVICE_MAXSERVICES; i++) { | 301 | for (i = 0; i < PCIE_PORT_DEVICE_MAXSERVICES; i++) { |
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c index e9095ee508e3..30bac7ed7c16 100644 --- a/drivers/pci/pcie/portdrv_pci.c +++ b/drivers/pci/pcie/portdrv_pci.c | |||
@@ -29,6 +29,78 @@ MODULE_LICENSE("GPL"); | |||
29 | /* global data */ | 29 | /* global data */ |
30 | static const char device_name[] = "pcieport-driver"; | 30 | static const char device_name[] = "pcieport-driver"; |
31 | 31 | ||
32 | static void pci_save_msi_state(struct pci_dev *dev) | ||
33 | { | ||
34 | struct pcie_port_device_ext *p_ext = pci_get_drvdata(dev); | ||
35 | int i = 0, pos; | ||
36 | u16 control; | ||
37 | |||
38 | if ((pos = pci_find_capability(dev, PCI_CAP_ID_MSI)) <= 0) | ||
39 | return; | ||
40 | |||
41 | pci_read_config_dword(dev, pos, &p_ext->saved_msi_config_space[i++]); | ||
42 | control = p_ext->saved_msi_config_space[0] >> 16; | ||
43 | pci_read_config_dword(dev, pos + PCI_MSI_ADDRESS_LO, | ||
44 | &p_ext->saved_msi_config_space[i++]); | ||
45 | if (control & PCI_MSI_FLAGS_64BIT) { | ||
46 | pci_read_config_dword(dev, pos + PCI_MSI_ADDRESS_HI, | ||
47 | &p_ext->saved_msi_config_space[i++]); | ||
48 | pci_read_config_dword(dev, pos + PCI_MSI_DATA_64, | ||
49 | &p_ext->saved_msi_config_space[i++]); | ||
50 | } else | ||
51 | pci_read_config_dword(dev, pos + PCI_MSI_DATA_32, | ||
52 | &p_ext->saved_msi_config_space[i++]); | ||
53 | if (control & PCI_MSI_FLAGS_MASKBIT) | ||
54 | pci_read_config_dword(dev, pos + PCI_MSI_MASK_BIT, | ||
55 | &p_ext->saved_msi_config_space[i++]); | ||
56 | } | ||
57 | |||
58 | static void pci_restore_msi_state(struct pci_dev *dev) | ||
59 | { | ||
60 | struct pcie_port_device_ext *p_ext = pci_get_drvdata(dev); | ||
61 | int i = 0, pos; | ||
62 | u16 control; | ||
63 | |||
64 | if ((pos = pci_find_capability(dev, PCI_CAP_ID_MSI)) <= 0) | ||
65 | return; | ||
66 | |||
67 | control = p_ext->saved_msi_config_space[i++] >> 16; | ||
68 | pci_write_config_word(dev, pos + PCI_MSI_FLAGS, control); | ||
69 | pci_write_config_dword(dev, pos + PCI_MSI_ADDRESS_LO, | ||
70 | p_ext->saved_msi_config_space[i++]); | ||
71 | if (control & PCI_MSI_FLAGS_64BIT) { | ||
72 | pci_write_config_dword(dev, pos + PCI_MSI_ADDRESS_HI, | ||
73 | p_ext->saved_msi_config_space[i++]); | ||
74 | pci_write_config_dword(dev, pos + PCI_MSI_DATA_64, | ||
75 | p_ext->saved_msi_config_space[i++]); | ||
76 | } else | ||
77 | pci_write_config_dword(dev, pos + PCI_MSI_DATA_32, | ||
78 | p_ext->saved_msi_config_space[i++]); | ||
79 | if (control & PCI_MSI_FLAGS_MASKBIT) | ||
80 | pci_write_config_dword(dev, pos + PCI_MSI_MASK_BIT, | ||
81 | p_ext->saved_msi_config_space[i++]); | ||
82 | } | ||
83 | |||
84 | static void pcie_portdrv_save_config(struct pci_dev *dev) | ||
85 | { | ||
86 | struct pcie_port_device_ext *p_ext = pci_get_drvdata(dev); | ||
87 | |||
88 | pci_save_state(dev); | ||
89 | if (p_ext->interrupt_mode == PCIE_PORT_MSI_MODE) | ||
90 | pci_save_msi_state(dev); | ||
91 | } | ||
92 | |||
93 | static void pcie_portdrv_restore_config(struct pci_dev *dev) | ||
94 | { | ||
95 | struct pcie_port_device_ext *p_ext = pci_get_drvdata(dev); | ||
96 | |||
97 | pci_restore_state(dev); | ||
98 | if (p_ext->interrupt_mode == PCIE_PORT_MSI_MODE) | ||
99 | pci_restore_msi_state(dev); | ||
100 | pci_enable_device(dev); | ||
101 | pci_set_master(dev); | ||
102 | } | ||
103 | |||
32 | /* | 104 | /* |
33 | * pcie_portdrv_probe - Probe PCI-Express port devices | 105 | * pcie_portdrv_probe - Probe PCI-Express port devices |
34 | * @dev: PCI-Express port device being probed | 106 | * @dev: PCI-Express port device being probed |
@@ -64,16 +136,21 @@ static int __devinit pcie_portdrv_probe (struct pci_dev *dev, | |||
64 | static void pcie_portdrv_remove (struct pci_dev *dev) | 136 | static void pcie_portdrv_remove (struct pci_dev *dev) |
65 | { | 137 | { |
66 | pcie_port_device_remove(dev); | 138 | pcie_port_device_remove(dev); |
139 | kfree(pci_get_drvdata(dev)); | ||
67 | } | 140 | } |
68 | 141 | ||
69 | #ifdef CONFIG_PM | 142 | #ifdef CONFIG_PM |
70 | static int pcie_portdrv_suspend (struct pci_dev *dev, pm_message_t state) | 143 | static int pcie_portdrv_suspend (struct pci_dev *dev, pm_message_t state) |
71 | { | 144 | { |
72 | return pcie_port_device_suspend(dev, state); | 145 | int ret = pcie_port_device_suspend(dev, state); |
146 | |||
147 | pcie_portdrv_save_config(dev); | ||
148 | return ret; | ||
73 | } | 149 | } |
74 | 150 | ||
75 | static int pcie_portdrv_resume (struct pci_dev *dev) | 151 | static int pcie_portdrv_resume (struct pci_dev *dev) |
76 | { | 152 | { |
153 | pcie_portdrv_restore_config(dev); | ||
77 | return pcie_port_device_resume(dev); | 154 | return pcie_port_device_resume(dev); |
78 | } | 155 | } |
79 | #endif | 156 | #endif |
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 6a0a82f0508b..df3bdae2040f 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -239,9 +239,8 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child) | |||
239 | 239 | ||
240 | if (dev->transparent) { | 240 | if (dev->transparent) { |
241 | printk(KERN_INFO "PCI: Transparent bridge - %s\n", pci_name(dev)); | 241 | printk(KERN_INFO "PCI: Transparent bridge - %s\n", pci_name(dev)); |
242 | for(i = 0; i < PCI_BUS_NUM_RESOURCES; i++) | 242 | for(i = 3; i < PCI_BUS_NUM_RESOURCES; i++) |
243 | child->resource[i] = child->parent->resource[i]; | 243 | child->resource[i] = child->parent->resource[i - 3]; |
244 | return; | ||
245 | } | 244 | } |
246 | 245 | ||
247 | for(i=0; i<3; i++) | 246 | for(i=0; i<3; i++) |
@@ -398,6 +397,16 @@ static void pci_enable_crs(struct pci_dev *dev) | |||
398 | pci_write_config_word(dev, rpcap + PCI_EXP_RTCTL, rpctl); | 397 | pci_write_config_word(dev, rpcap + PCI_EXP_RTCTL, rpctl); |
399 | } | 398 | } |
400 | 399 | ||
400 | static void __devinit pci_fixup_parent_subordinate_busnr(struct pci_bus *child, int max) | ||
401 | { | ||
402 | struct pci_bus *parent = child->parent; | ||
403 | while (parent->parent && parent->subordinate < max) { | ||
404 | parent->subordinate = max; | ||
405 | pci_write_config_byte(parent->self, PCI_SUBORDINATE_BUS, max); | ||
406 | parent = parent->parent; | ||
407 | } | ||
408 | } | ||
409 | |||
401 | unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus); | 410 | unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus); |
402 | 411 | ||
403 | /* | 412 | /* |
@@ -499,7 +508,13 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max | |||
499 | 508 | ||
500 | if (!is_cardbus) { | 509 | if (!is_cardbus) { |
501 | child->bridge_ctl = PCI_BRIDGE_CTL_NO_ISA; | 510 | child->bridge_ctl = PCI_BRIDGE_CTL_NO_ISA; |
502 | 511 | /* | |
512 | * Adjust subordinate busnr in parent buses. | ||
513 | * We do this before scanning for children because | ||
514 | * some devices may not be detected if the bios | ||
515 | * was lazy. | ||
516 | */ | ||
517 | pci_fixup_parent_subordinate_busnr(child, max); | ||
503 | /* Now we can scan all subordinate buses... */ | 518 | /* Now we can scan all subordinate buses... */ |
504 | max = pci_scan_child_bus(child); | 519 | max = pci_scan_child_bus(child); |
505 | } else { | 520 | } else { |
@@ -513,6 +528,7 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max | |||
513 | max+i+1)) | 528 | max+i+1)) |
514 | break; | 529 | break; |
515 | max += i; | 530 | max += i; |
531 | pci_fixup_parent_subordinate_busnr(child, max); | ||
516 | } | 532 | } |
517 | /* | 533 | /* |
518 | * Set the subordinate bus number to its real value. | 534 | * Set the subordinate bus number to its real value. |
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 968033fd29f0..1521fd5d95cc 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -767,6 +767,7 @@ static void __init asus_hides_smbus_hostbridge(struct pci_dev *dev) | |||
767 | if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_ASUSTEK)) { | 767 | if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_ASUSTEK)) { |
768 | if (dev->device == PCI_DEVICE_ID_INTEL_82845_HB) | 768 | if (dev->device == PCI_DEVICE_ID_INTEL_82845_HB) |
769 | switch(dev->subsystem_device) { | 769 | switch(dev->subsystem_device) { |
770 | case 0x8025: /* P4B-LX */ | ||
770 | case 0x8070: /* P4B */ | 771 | case 0x8070: /* P4B */ |
771 | case 0x8088: /* P4B533 */ | 772 | case 0x8088: /* P4B533 */ |
772 | case 0x1626: /* L3C notebook */ | 773 | case 0x1626: /* L3C notebook */ |
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 6b628de948af..c1bdfb424658 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c | |||
@@ -273,6 +273,8 @@ find_free_bus_resource(struct pci_bus *bus, unsigned long type) | |||
273 | 273 | ||
274 | for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) { | 274 | for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) { |
275 | r = bus->resource[i]; | 275 | r = bus->resource[i]; |
276 | if (r == &ioport_resource || r == &iomem_resource) | ||
277 | continue; | ||
276 | if (r && (r->flags & type_mask) == type && !r->parent) | 278 | if (r && (r->flags & type_mask) == type && !r->parent) |
277 | return r; | 279 | return r; |
278 | } | 280 | } |
diff --git a/drivers/sbus/char/bpp.c b/drivers/sbus/char/bpp.c index 8f0f46907a81..87302fb14885 100644 --- a/drivers/sbus/char/bpp.c +++ b/drivers/sbus/char/bpp.c | |||
@@ -79,10 +79,6 @@ struct inst { | |||
79 | 79 | ||
80 | unsigned char run_length; | 80 | unsigned char run_length; |
81 | unsigned char repeat_byte; | 81 | unsigned char repeat_byte; |
82 | |||
83 | /* These members manage timeouts for programmed delays */ | ||
84 | wait_queue_head_t wait_queue; | ||
85 | struct timer_list timer_list; | ||
86 | }; | 82 | }; |
87 | 83 | ||
88 | static struct inst instances[BPP_NO]; | 84 | static struct inst instances[BPP_NO]; |
@@ -297,16 +293,10 @@ static unsigned short get_pins(unsigned minor) | |||
297 | 293 | ||
298 | #endif /* __sparc__ */ | 294 | #endif /* __sparc__ */ |
299 | 295 | ||
300 | static void bpp_wake_up(unsigned long val) | ||
301 | { wake_up(&instances[val].wait_queue); } | ||
302 | |||
303 | static void snooze(unsigned long snooze_time, unsigned minor) | 296 | static void snooze(unsigned long snooze_time, unsigned minor) |
304 | { | 297 | { |
305 | init_timer(&instances[minor].timer_list); | 298 | set_current_state(TASK_UNINTERRUPTIBLE); |
306 | instances[minor].timer_list.expires = jiffies + snooze_time + 1; | 299 | schedule_timeout(snooze_time + 1); |
307 | instances[minor].timer_list.data = minor; | ||
308 | add_timer(&instances[minor].timer_list); | ||
309 | sleep_on (&instances[minor].wait_queue); | ||
310 | } | 300 | } |
311 | 301 | ||
312 | static int wait_for(unsigned short set, unsigned short clr, | 302 | static int wait_for(unsigned short set, unsigned short clr, |
@@ -880,11 +870,8 @@ static void probeLptPort(unsigned idx) | |||
880 | instances[idx].enhanced = 0; | 870 | instances[idx].enhanced = 0; |
881 | instances[idx].direction = 0; | 871 | instances[idx].direction = 0; |
882 | instances[idx].mode = COMPATIBILITY; | 872 | instances[idx].mode = COMPATIBILITY; |
883 | instances[idx].wait_queue = 0; | ||
884 | instances[idx].run_length = 0; | 873 | instances[idx].run_length = 0; |
885 | instances[idx].run_flag = 0; | 874 | instances[idx].run_flag = 0; |
886 | init_timer(&instances[idx].timer_list); | ||
887 | instances[idx].timer_list.function = bpp_wake_up; | ||
888 | if (!request_region(lpAddr,3, dev_name)) return; | 875 | if (!request_region(lpAddr,3, dev_name)) return; |
889 | 876 | ||
890 | /* | 877 | /* |
@@ -977,11 +964,8 @@ static void probeLptPort(unsigned idx) | |||
977 | instances[idx].enhanced = 0; | 964 | instances[idx].enhanced = 0; |
978 | instances[idx].direction = 0; | 965 | instances[idx].direction = 0; |
979 | instances[idx].mode = COMPATIBILITY; | 966 | instances[idx].mode = COMPATIBILITY; |
980 | init_waitqueue_head(&instances[idx].wait_queue); | ||
981 | instances[idx].run_length = 0; | 967 | instances[idx].run_length = 0; |
982 | instances[idx].run_flag = 0; | 968 | instances[idx].run_flag = 0; |
983 | init_timer(&instances[idx].timer_list); | ||
984 | instances[idx].timer_list.function = bpp_wake_up; | ||
985 | 969 | ||
986 | if (!rp) return; | 970 | if (!rp) return; |
987 | 971 | ||
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 9224fc3184ea..7e8fc7c1d4cc 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
@@ -2061,7 +2061,8 @@ static void __init serial8250_isa_init_ports(void) | |||
2061 | up->port.ops = &serial8250_pops; | 2061 | up->port.ops = &serial8250_pops; |
2062 | } | 2062 | } |
2063 | 2063 | ||
2064 | for (i = 0, up = serial8250_ports; i < ARRAY_SIZE(old_serial_port); | 2064 | for (i = 0, up = serial8250_ports; |
2065 | i < ARRAY_SIZE(old_serial_port) && i < UART_NR; | ||
2065 | i++, up++) { | 2066 | i++, up++) { |
2066 | up->port.iobase = old_serial_port[i].port; | 2067 | up->port.iobase = old_serial_port[i].port; |
2067 | up->port.irq = irq_canonicalize(old_serial_port[i].irq); | 2068 | up->port.irq = irq_canonicalize(old_serial_port[i].irq); |
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c index de26cf7b003c..7911912f50c7 100644 --- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c +++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c | |||
@@ -94,12 +94,42 @@ void smc1_lineif(struct uart_cpm_port *pinfo) | |||
94 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits; | 94 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits; |
95 | } | 95 | } |
96 | 96 | ||
97 | #ifdef CONFIG_MPC885ADS | ||
98 | /* Enable SMC1 transceivers */ | ||
99 | { | ||
100 | volatile uint __iomem *bcsr1 = ioremap(BCSR1, 4); | ||
101 | uint tmp; | ||
102 | |||
103 | tmp = in_be32(bcsr1); | ||
104 | tmp &= ~BCSR1_RS232EN_1; | ||
105 | out_be32(bcsr1, tmp); | ||
106 | iounmap(bcsr1); | ||
107 | } | ||
108 | #endif | ||
109 | |||
97 | pinfo->brg = 1; | 110 | pinfo->brg = 1; |
98 | } | 111 | } |
99 | 112 | ||
100 | void smc2_lineif(struct uart_cpm_port *pinfo) | 113 | void smc2_lineif(struct uart_cpm_port *pinfo) |
101 | { | 114 | { |
102 | /* XXX SMC2: insert port configuration here */ | 115 | #ifdef CONFIG_MPC885ADS |
116 | volatile cpm8xx_t *cp = cpmp; | ||
117 | volatile uint __iomem *bcsr1; | ||
118 | uint tmp; | ||
119 | |||
120 | cp->cp_pepar |= 0x00000c00; | ||
121 | cp->cp_pedir &= ~0x00000c00; | ||
122 | cp->cp_peso &= ~0x00000400; | ||
123 | cp->cp_peso |= 0x00000800; | ||
124 | |||
125 | /* Enable SMC2 transceivers */ | ||
126 | bcsr1 = ioremap(BCSR1, 4); | ||
127 | tmp = in_be32(bcsr1); | ||
128 | tmp &= ~BCSR1_RS232EN_2; | ||
129 | out_be32(bcsr1, tmp); | ||
130 | iounmap(bcsr1); | ||
131 | #endif | ||
132 | |||
103 | pinfo->brg = 2; | 133 | pinfo->brg = 2; |
104 | } | 134 | } |
105 | 135 | ||
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c index 5c4678478b1d..7365d4b50b95 100644 --- a/drivers/serial/s3c2410.c +++ b/drivers/serial/s3c2410.c | |||
@@ -522,14 +522,11 @@ static void s3c24xx_serial_shutdown(struct uart_port *port) | |||
522 | static int s3c24xx_serial_startup(struct uart_port *port) | 522 | static int s3c24xx_serial_startup(struct uart_port *port) |
523 | { | 523 | { |
524 | struct s3c24xx_uart_port *ourport = to_ourport(port); | 524 | struct s3c24xx_uart_port *ourport = to_ourport(port); |
525 | unsigned long flags; | ||
526 | int ret; | 525 | int ret; |
527 | 526 | ||
528 | dbg("s3c24xx_serial_startup: port=%p (%08lx,%p)\n", | 527 | dbg("s3c24xx_serial_startup: port=%p (%08lx,%p)\n", |
529 | port->mapbase, port->membase); | 528 | port->mapbase, port->membase); |
530 | 529 | ||
531 | local_irq_save(flags); | ||
532 | |||
533 | rx_enabled(port) = 1; | 530 | rx_enabled(port) = 1; |
534 | 531 | ||
535 | ret = request_irq(RX_IRQ(port), | 532 | ret = request_irq(RX_IRQ(port), |
@@ -563,12 +560,10 @@ static int s3c24xx_serial_startup(struct uart_port *port) | |||
563 | /* the port reset code should have done the correct | 560 | /* the port reset code should have done the correct |
564 | * register setup for the port controls */ | 561 | * register setup for the port controls */ |
565 | 562 | ||
566 | local_irq_restore(flags); | ||
567 | return ret; | 563 | return ret; |
568 | 564 | ||
569 | err: | 565 | err: |
570 | s3c24xx_serial_shutdown(port); | 566 | s3c24xx_serial_shutdown(port); |
571 | local_irq_restore(flags); | ||
572 | return ret; | 567 | return ret; |
573 | } | 568 | } |
574 | 569 | ||
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 139863a787f3..54699c3a00ab 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c | |||
@@ -1808,6 +1808,12 @@ uart_set_options(struct uart_port *port, struct console *co, | |||
1808 | struct termios termios; | 1808 | struct termios termios; |
1809 | int i; | 1809 | int i; |
1810 | 1810 | ||
1811 | /* | ||
1812 | * Ensure that the serial console lock is initialised | ||
1813 | * early. | ||
1814 | */ | ||
1815 | spin_lock_init(&port->lock); | ||
1816 | |||
1811 | memset(&termios, 0, sizeof(struct termios)); | 1817 | memset(&termios, 0, sizeof(struct termios)); |
1812 | 1818 | ||
1813 | termios.c_cflag = CREAD | HUPCL | CLOCAL; | 1819 | termios.c_cflag = CREAD | HUPCL | CLOCAL; |
@@ -2196,10 +2202,16 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *port) | |||
2196 | 2202 | ||
2197 | state->port = port; | 2203 | state->port = port; |
2198 | 2204 | ||
2199 | spin_lock_init(&port->lock); | ||
2200 | port->cons = drv->cons; | 2205 | port->cons = drv->cons; |
2201 | port->info = state->info; | 2206 | port->info = state->info; |
2202 | 2207 | ||
2208 | /* | ||
2209 | * If this port is a console, then the spinlock is already | ||
2210 | * initialised. | ||
2211 | */ | ||
2212 | if (!uart_console(port)) | ||
2213 | spin_lock_init(&port->lock); | ||
2214 | |||
2203 | uart_configure_port(drv, state, port); | 2215 | uart_configure_port(drv, state, port); |
2204 | 2216 | ||
2205 | /* | 2217 | /* |
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index b209adbd508a..9dd0fbccf994 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c | |||
@@ -142,7 +142,6 @@ static int fbcon_set_origin(struct vc_data *); | |||
142 | #define CURSOR_DRAW_DELAY (1) | 142 | #define CURSOR_DRAW_DELAY (1) |
143 | 143 | ||
144 | /* # VBL ints between cursor state changes */ | 144 | /* # VBL ints between cursor state changes */ |
145 | #define ARM_CURSOR_BLINK_RATE (10) | ||
146 | #define ATARI_CURSOR_BLINK_RATE (42) | 145 | #define ATARI_CURSOR_BLINK_RATE (42) |
147 | #define MAC_CURSOR_BLINK_RATE (32) | 146 | #define MAC_CURSOR_BLINK_RATE (32) |
148 | #define DEFAULT_CURSOR_BLINK_RATE (20) | 147 | #define DEFAULT_CURSOR_BLINK_RATE (20) |
@@ -288,7 +287,7 @@ static void fb_flashcursor(void *private) | |||
288 | release_console_sem(); | 287 | release_console_sem(); |
289 | } | 288 | } |
290 | 289 | ||
291 | #if (defined(__arm__) && defined(IRQ_VSYNCPULSE)) || defined(CONFIG_ATARI) || defined(CONFIG_MAC) | 290 | #if defined(CONFIG_ATARI) || defined(CONFIG_MAC) |
292 | static int cursor_blink_rate; | 291 | static int cursor_blink_rate; |
293 | static irqreturn_t fb_vbl_handler(int irq, void *dev_id, struct pt_regs *fp) | 292 | static irqreturn_t fb_vbl_handler(int irq, void *dev_id, struct pt_regs *fp) |
294 | { | 293 | { |
@@ -878,11 +877,6 @@ static const char *fbcon_startup(void) | |||
878 | } | 877 | } |
879 | #endif /* CONFIG_MAC */ | 878 | #endif /* CONFIG_MAC */ |
880 | 879 | ||
881 | #if defined(__arm__) && defined(IRQ_VSYNCPULSE) | ||
882 | cursor_blink_rate = ARM_CURSOR_BLINK_RATE; | ||
883 | irqres = request_irq(IRQ_VSYNCPULSE, fb_vbl_handler, SA_SHIRQ, | ||
884 | "framebuffer vbl", info); | ||
885 | #endif | ||
886 | /* Initialize the work queue. If the driver provides its | 880 | /* Initialize the work queue. If the driver provides its |
887 | * own work queue this means it will use something besides | 881 | * own work queue this means it will use something besides |
888 | * default timer to flash the cursor. */ | 882 | * default timer to flash the cursor. */ |