aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/osl.c34
-rw-r--r--drivers/ata/libata-core.c2
-rw-r--r--drivers/ata/libata-scsi.c2
-rw-r--r--drivers/ata/pata_artop.c2
-rw-r--r--drivers/ata/pata_hpt37x.c19
-rw-r--r--drivers/block/aoe/aoeblk.c1
-rw-r--r--drivers/block/cciss.c6
-rw-r--r--drivers/block/cpqarray.c15
-rw-r--r--drivers/char/ftape/zftape/zftape-buffers.c4
-rw-r--r--drivers/char/ipmi/ipmi_msghandler.c2
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c2
-rw-r--r--drivers/char/isicom.c3
-rw-r--r--drivers/firmware/dell_rbu.c9
-rw-r--r--drivers/i2c/busses/i2c-ixp4xx.c3
-rw-r--r--drivers/i2c/busses/scx200_acb.c7
-rw-r--r--drivers/ide/legacy/hd.c2
-rw-r--r--drivers/infiniband/hw/ipath/Kconfig2
-rw-r--r--drivers/infiniband/hw/ipath/Makefile5
-rw-r--r--drivers/infiniband/hw/ipath/ipath_driver.c4
-rw-r--r--drivers/input/keyboard/lkkbd.c5
-rw-r--r--drivers/isdn/hisax/Kconfig2
-rw-r--r--drivers/macintosh/windfarm_pm112.c11
-rw-r--r--drivers/macintosh/windfarm_pm81.c1
-rw-r--r--drivers/macintosh/windfarm_pm91.c1
-rw-r--r--drivers/mmc/mmc.c19
-rw-r--r--drivers/net/tg3.c25
-rw-r--r--drivers/parport/parport_ip32.c2
-rw-r--r--drivers/pci/quirks.c27
-rw-r--r--drivers/pcmcia/ds.c3
-rw-r--r--drivers/scsi/3w-9xxx.c141
-rw-r--r--drivers/scsi/3w-9xxx.h14
-rw-r--r--drivers/scsi/aic94xx/aic94xx_hwi.c18
-rw-r--r--drivers/scsi/aic94xx/aic94xx_hwi.h12
-rw-r--r--drivers/scsi/aic94xx/aic94xx_init.c2
-rw-r--r--drivers/scsi/aic94xx/aic94xx_sas.h1
-rw-r--r--drivers/scsi/aic94xx/aic94xx_scb.c72
-rw-r--r--drivers/scsi/aic94xx/aic94xx_seq.c5
-rw-r--r--drivers/scsi/aic94xx/aic94xx_seq.h2
-rw-r--r--drivers/scsi/gdth.c4
-rw-r--r--drivers/scsi/iscsi_tcp.c22
-rw-r--r--drivers/scsi/libiscsi.c9
-rw-r--r--drivers/scsi/libsas/sas_expander.c84
-rw-r--r--drivers/scsi/psi240i.c2
-rw-r--r--drivers/scsi/scsi_lib.c1
-rw-r--r--drivers/scsi/scsi_transport_iscsi.c2
-rw-r--r--drivers/scsi/sg.c25
-rw-r--r--drivers/usb/core/message.c5
-rw-r--r--drivers/usb/host/ohci-hcd.c25
-rw-r--r--drivers/usb/host/ohci-hub.c6
-rw-r--r--drivers/usb/input/hid-core.c5
-rw-r--r--drivers/usb/input/hid-input.c17
-rw-r--r--drivers/usb/input/hid.h1
-rw-r--r--drivers/usb/misc/auerswald.c2
-rw-r--r--drivers/usb/serial/ftdi_sio.c2
-rw-r--r--drivers/usb/serial/ftdi_sio.h11
-rw-r--r--drivers/usb/serial/ipaq.c1
-rw-r--r--drivers/usb/storage/unusual_devs.h18
-rw-r--r--drivers/video/aty/atyfb_base.c2
-rw-r--r--drivers/video/aty/radeon_i2c.c8
-rw-r--r--drivers/video/fb_ddc.c6
-rw-r--r--drivers/video/nvidia/nv_setup.c2
-rw-r--r--drivers/video/pnx4008/pnxrgbfb.c5
-rw-r--r--drivers/video/pnx4008/sdum.c2
-rw-r--r--drivers/w1/masters/matrox_w1.c2
64 files changed, 492 insertions, 264 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index c84286cbbe25..068fe4f100b0 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -73,7 +73,6 @@ static unsigned int acpi_irq_irq;
73static acpi_osd_handler acpi_irq_handler; 73static acpi_osd_handler acpi_irq_handler;
74static void *acpi_irq_context; 74static void *acpi_irq_context;
75static struct workqueue_struct *kacpid_wq; 75static struct workqueue_struct *kacpid_wq;
76static struct workqueue_struct *kacpi_notify_wq;
77 76
78acpi_status acpi_os_initialize(void) 77acpi_status acpi_os_initialize(void)
79{ 78{
@@ -92,9 +91,8 @@ acpi_status acpi_os_initialize1(void)
92 return AE_NULL_ENTRY; 91 return AE_NULL_ENTRY;
93 } 92 }
94 kacpid_wq = create_singlethread_workqueue("kacpid"); 93 kacpid_wq = create_singlethread_workqueue("kacpid");
95 kacpi_notify_wq = create_singlethread_workqueue("kacpi_notify");
96 BUG_ON(!kacpid_wq); 94 BUG_ON(!kacpid_wq);
97 BUG_ON(!kacpi_notify_wq); 95
98 return AE_OK; 96 return AE_OK;
99} 97}
100 98
@@ -106,7 +104,6 @@ acpi_status acpi_os_terminate(void)
106 } 104 }
107 105
108 destroy_workqueue(kacpid_wq); 106 destroy_workqueue(kacpid_wq);
109 destroy_workqueue(kacpi_notify_wq);
110 107
111 return AE_OK; 108 return AE_OK;
112} 109}
@@ -569,7 +566,10 @@ void acpi_os_derive_pci_id(acpi_handle rhandle, /* upper bound */
569 566
570static void acpi_os_execute_deferred(void *context) 567static void acpi_os_execute_deferred(void *context)
571{ 568{
572 struct acpi_os_dpc *dpc = (struct acpi_os_dpc *)context; 569 struct acpi_os_dpc *dpc = NULL;
570
571
572 dpc = (struct acpi_os_dpc *)context;
573 if (!dpc) { 573 if (!dpc) {
574 printk(KERN_ERR PREFIX "Invalid (NULL) context\n"); 574 printk(KERN_ERR PREFIX "Invalid (NULL) context\n");
575 return; 575 return;
@@ -604,12 +604,14 @@ acpi_status acpi_os_execute(acpi_execute_type type,
604 struct acpi_os_dpc *dpc; 604 struct acpi_os_dpc *dpc;
605 struct work_struct *task; 605 struct work_struct *task;
606 606
607 ACPI_FUNCTION_TRACE("os_queue_for_execution");
608
607 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, 609 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
608 "Scheduling function [%p(%p)] for deferred execution.\n", 610 "Scheduling function [%p(%p)] for deferred execution.\n",
609 function, context)); 611 function, context));
610 612
611 if (!function) 613 if (!function)
612 return AE_BAD_PARAMETER; 614 return_ACPI_STATUS(AE_BAD_PARAMETER);
613 615
614 /* 616 /*
615 * Allocate/initialize DPC structure. Note that this memory will be 617 * Allocate/initialize DPC structure. Note that this memory will be
@@ -622,20 +624,26 @@ acpi_status acpi_os_execute(acpi_execute_type type,
622 * from the same memory. 624 * from the same memory.
623 */ 625 */
624 626
625 dpc = kmalloc(sizeof(struct acpi_os_dpc) + 627 dpc =
626 sizeof(struct work_struct), GFP_ATOMIC); 628 kmalloc(sizeof(struct acpi_os_dpc) + sizeof(struct work_struct),
629 GFP_ATOMIC);
627 if (!dpc) 630 if (!dpc)
628 return AE_NO_MEMORY; 631 return_ACPI_STATUS(AE_NO_MEMORY);
632
629 dpc->function = function; 633 dpc->function = function;
630 dpc->context = context; 634 dpc->context = context;
635
631 task = (void *)(dpc + 1); 636 task = (void *)(dpc + 1);
632 INIT_WORK(task, acpi_os_execute_deferred, (void *)dpc); 637 INIT_WORK(task, acpi_os_execute_deferred, (void *)dpc);
633 if (!queue_work((type == OSL_NOTIFY_HANDLER)? 638
634 kacpi_notify_wq : kacpid_wq, task)) { 639 if (!queue_work(kacpid_wq, task)) {
635 status = AE_ERROR; 640 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
641 "Call to queue_work() failed.\n"));
636 kfree(dpc); 642 kfree(dpc);
643 status = AE_ERROR;
637 } 644 }
638 return status; 645
646 return_ACPI_STATUS(status);
639} 647}
640 648
641EXPORT_SYMBOL(acpi_os_execute); 649EXPORT_SYMBOL(acpi_os_execute);
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index a8fd0c3e59b3..915a55a6cc14 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5957,7 +5957,7 @@ static void __exit ata_exit(void)
5957 destroy_workqueue(ata_aux_wq); 5957 destroy_workqueue(ata_aux_wq);
5958} 5958}
5959 5959
5960module_init(ata_init); 5960subsys_initcall(ata_init);
5961module_exit(ata_exit); 5961module_exit(ata_exit);
5962 5962
5963static unsigned long ratelimit_time; 5963static unsigned long ratelimit_time;
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 7af2a4ba4990..5c1fc467fc7f 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -1612,9 +1612,9 @@ early_finish:
1612 1612
1613err_did: 1613err_did:
1614 ata_qc_free(qc); 1614 ata_qc_free(qc);
1615err_mem:
1616 cmd->result = (DID_ERROR << 16); 1615 cmd->result = (DID_ERROR << 16);
1617 done(cmd); 1616 done(cmd);
1617err_mem:
1618 DPRINTK("EXIT - internal\n"); 1618 DPRINTK("EXIT - internal\n");
1619 return 0; 1619 return 0;
1620 1620
diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c
index 690828eb5226..96a098020a8f 100644
--- a/drivers/ata/pata_artop.c
+++ b/drivers/ata/pata_artop.c
@@ -92,7 +92,7 @@ static int artop6260_pre_reset(struct ata_port *ap)
92 return -ENOENT; 92 return -ENOENT;
93 93
94 pci_read_config_byte(pdev, 0x49, &tmp); 94 pci_read_config_byte(pdev, 0x49, &tmp);
95 if (tmp & (1 >> ap->port_no)) 95 if (tmp & (1 << ap->port_no))
96 ap->cbl = ATA_CBL_PATA40; 96 ap->cbl = ATA_CBL_PATA40;
97 else 97 else
98 ap->cbl = ATA_CBL_PATA80; 98 ap->cbl = ATA_CBL_PATA80;
diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c
index 7350443948c1..fce3fcdc7e79 100644
--- a/drivers/ata/pata_hpt37x.c
+++ b/drivers/ata/pata_hpt37x.c
@@ -25,7 +25,7 @@
25#include <linux/libata.h> 25#include <linux/libata.h>
26 26
27#define DRV_NAME "pata_hpt37x" 27#define DRV_NAME "pata_hpt37x"
28#define DRV_VERSION "0.5" 28#define DRV_VERSION "0.5.1"
29 29
30struct hpt_clock { 30struct hpt_clock {
31 u8 xfer_speed; 31 u8 xfer_speed;
@@ -453,7 +453,13 @@ static int hpt37x_pre_reset(struct ata_port *ap)
453{ 453{
454 u8 scr2, ata66; 454 u8 scr2, ata66;
455 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 455 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
456 456 static const struct pci_bits hpt37x_enable_bits[] = {
457 { 0x50, 1, 0x04, 0x04 },
458 { 0x54, 1, 0x04, 0x04 }
459 };
460 if (!pci_test_config_bits(pdev, &hpt37x_enable_bits[ap->port_no]))
461 return -ENOENT;
462
457 pci_read_config_byte(pdev, 0x5B, &scr2); 463 pci_read_config_byte(pdev, 0x5B, &scr2);
458 pci_write_config_byte(pdev, 0x5B, scr2 & ~0x01); 464 pci_write_config_byte(pdev, 0x5B, scr2 & ~0x01);
459 /* Cable register now active */ 465 /* Cable register now active */
@@ -488,10 +494,17 @@ static void hpt37x_error_handler(struct ata_port *ap)
488 494
489static int hpt374_pre_reset(struct ata_port *ap) 495static int hpt374_pre_reset(struct ata_port *ap)
490{ 496{
497 static const struct pci_bits hpt37x_enable_bits[] = {
498 { 0x50, 1, 0x04, 0x04 },
499 { 0x54, 1, 0x04, 0x04 }
500 };
491 u16 mcr3, mcr6; 501 u16 mcr3, mcr6;
492 u8 ata66; 502 u8 ata66;
493
494 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 503 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
504
505 if (!pci_test_config_bits(pdev, &hpt37x_enable_bits[ap->port_no]))
506 return -ENOENT;
507
495 /* Do the extra channel work */ 508 /* Do the extra channel work */
496 pci_read_config_word(pdev, 0x52, &mcr3); 509 pci_read_config_word(pdev, 0x52, &mcr3);
497 pci_read_config_word(pdev, 0x56, &mcr6); 510 pci_read_config_word(pdev, 0x56, &mcr6);
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c
index d433f27e0ce2..aa25f8b09fe3 100644
--- a/drivers/block/aoe/aoeblk.c
+++ b/drivers/block/aoe/aoeblk.c
@@ -68,6 +68,7 @@ static struct attribute *aoe_attrs[] = {
68 &disk_attr_mac.attr, 68 &disk_attr_mac.attr,
69 &disk_attr_netif.attr, 69 &disk_attr_netif.attr,
70 &disk_attr_fwver.attr, 70 &disk_attr_fwver.attr,
71 NULL
71}; 72};
72 73
73static const struct attribute_group attr_group = { 74static const struct attribute_group attr_group = {
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 6ffe2b2bdacc..4105c3bf3476 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1300,6 +1300,12 @@ static void cciss_softirq_done(struct request *rq)
1300 1300
1301 complete_buffers(rq->bio, rq->errors); 1301 complete_buffers(rq->bio, rq->errors);
1302 1302
1303 if (blk_fs_request(rq)) {
1304 const int rw = rq_data_dir(rq);
1305
1306 disk_stat_add(rq->rq_disk, sectors[rw], rq->nr_sectors);
1307 }
1308
1303#ifdef CCISS_DEBUG 1309#ifdef CCISS_DEBUG
1304 printk("Done with %p\n", rq); 1310 printk("Done with %p\n", rq);
1305#endif /* CCISS_DEBUG */ 1311#endif /* CCISS_DEBUG */
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
index 570d2f049323..d5f519ebbc08 100644
--- a/drivers/block/cpqarray.c
+++ b/drivers/block/cpqarray.c
@@ -998,6 +998,7 @@ static inline void complete_buffers(struct bio *bio, int ok)
998 */ 998 */
999static inline void complete_command(cmdlist_t *cmd, int timeout) 999static inline void complete_command(cmdlist_t *cmd, int timeout)
1000{ 1000{
1001 struct request *rq = cmd->rq;
1001 int ok=1; 1002 int ok=1;
1002 int i, ddir; 1003 int i, ddir;
1003 1004
@@ -1029,12 +1030,18 @@ static inline void complete_command(cmdlist_t *cmd, int timeout)
1029 pci_unmap_page(hba[cmd->ctlr]->pci_dev, cmd->req.sg[i].addr, 1030 pci_unmap_page(hba[cmd->ctlr]->pci_dev, cmd->req.sg[i].addr,
1030 cmd->req.sg[i].size, ddir); 1031 cmd->req.sg[i].size, ddir);
1031 1032
1032 complete_buffers(cmd->rq->bio, ok); 1033 complete_buffers(rq->bio, ok);
1033 1034
1034 add_disk_randomness(cmd->rq->rq_disk); 1035 if (blk_fs_request(rq)) {
1036 const int rw = rq_data_dir(rq);
1035 1037
1036 DBGPX(printk("Done with %p\n", cmd->rq);); 1038 disk_stat_add(rq->rq_disk, sectors[rw], rq->nr_sectors);
1037 end_that_request_last(cmd->rq, ok ? 1 : -EIO); 1039 }
1040
1041 add_disk_randomness(rq->rq_disk);
1042
1043 DBGPX(printk("Done with %p\n", rq););
1044 end_that_request_last(rq, ok ? 1 : -EIO);
1038} 1045}
1039 1046
1040/* 1047/*
diff --git a/drivers/char/ftape/zftape/zftape-buffers.c b/drivers/char/ftape/zftape/zftape-buffers.c
index da06f138334e..7ebce2ec7897 100644
--- a/drivers/char/ftape/zftape/zftape-buffers.c
+++ b/drivers/char/ftape/zftape/zftape-buffers.c
@@ -85,7 +85,7 @@ int zft_vmalloc_once(void *new, size_t size)
85 peak_memory = used_memory; 85 peak_memory = used_memory;
86 } 86 }
87 TRACE_ABORT(0, ft_t_noise, 87 TRACE_ABORT(0, ft_t_noise,
88 "allocated buffer @ %p, %d bytes", *(void **)new, size); 88 "allocated buffer @ %p, %zd bytes", *(void **)new, size);
89} 89}
90int zft_vmalloc_always(void *new, size_t size) 90int zft_vmalloc_always(void *new, size_t size)
91{ 91{
@@ -101,7 +101,7 @@ void zft_vfree(void *old, size_t size)
101 if (*(void **)old) { 101 if (*(void **)old) {
102 vfree(*(void **)old); 102 vfree(*(void **)old);
103 used_memory -= size; 103 used_memory -= size;
104 TRACE(ft_t_noise, "released buffer @ %p, %d bytes", 104 TRACE(ft_t_noise, "released buffer @ %p, %zd bytes",
105 *(void **)old, size); 105 *(void **)old, size);
106 *(void **)old = NULL; 106 *(void **)old = NULL;
107 } 107 }
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index a41b8df24073..c47add8e47df 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -2118,7 +2118,7 @@ static int ipmi_bmc_register(ipmi_smi_t intf)
2118 dev_set_drvdata(&bmc->dev->dev, bmc); 2118 dev_set_drvdata(&bmc->dev->dev, bmc);
2119 kref_init(&bmc->refcount); 2119 kref_init(&bmc->refcount);
2120 2120
2121 rv = platform_device_register(bmc->dev); 2121 rv = platform_device_add(bmc->dev);
2122 mutex_unlock(&ipmidriver_mutex); 2122 mutex_unlock(&ipmidriver_mutex);
2123 if (rv) { 2123 if (rv) {
2124 printk(KERN_ERR 2124 printk(KERN_ERR
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index abc5149e30e8..bb1fac104fda 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -2346,7 +2346,7 @@ static int try_smi_init(struct smi_info *new_smi)
2346 new_smi->dev = &new_smi->pdev->dev; 2346 new_smi->dev = &new_smi->pdev->dev;
2347 new_smi->dev->driver = &ipmi_driver; 2347 new_smi->dev->driver = &ipmi_driver;
2348 2348
2349 rv = platform_device_register(new_smi->pdev); 2349 rv = platform_device_add(new_smi->pdev);
2350 if (rv) { 2350 if (rv) {
2351 printk(KERN_ERR 2351 printk(KERN_ERR
2352 "ipmi_si_intf:" 2352 "ipmi_si_intf:"
diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c
index e9e9bf31c369..58c955e390b3 100644
--- a/drivers/char/isicom.c
+++ b/drivers/char/isicom.c
@@ -1062,11 +1062,12 @@ static void isicom_shutdown_port(struct isi_port *port)
1062static void isicom_close(struct tty_struct *tty, struct file *filp) 1062static void isicom_close(struct tty_struct *tty, struct file *filp)
1063{ 1063{
1064 struct isi_port *port = tty->driver_data; 1064 struct isi_port *port = tty->driver_data;
1065 struct isi_board *card = port->card; 1065 struct isi_board *card;
1066 unsigned long flags; 1066 unsigned long flags;
1067 1067
1068 if (!port) 1068 if (!port)
1069 return; 1069 return;
1070 card = port->card;
1070 if (isicom_paranoia_check(port, tty->name, "isicom_close")) 1071 if (isicom_paranoia_check(port, tty->name, "isicom_close"))
1071 return; 1072 return;
1072 1073
diff --git a/drivers/firmware/dell_rbu.c b/drivers/firmware/dell_rbu.c
index 08b161798443..fc702e40bd43 100644
--- a/drivers/firmware/dell_rbu.c
+++ b/drivers/firmware/dell_rbu.c
@@ -705,17 +705,16 @@ static struct bin_attribute rbu_packet_size_attr = {
705 705
706static int __init dcdrbu_init(void) 706static int __init dcdrbu_init(void)
707{ 707{
708 int rc = 0; 708 int rc;
709 spin_lock_init(&rbu_data.lock); 709 spin_lock_init(&rbu_data.lock);
710 710
711 init_packet_head(); 711 init_packet_head();
712 rbu_device = 712 rbu_device = platform_device_register_simple("dell_rbu", -1, NULL, 0);
713 platform_device_register_simple("dell_rbu", -1, NULL, 0); 713 if (IS_ERR(rbu_device)) {
714 if (!rbu_device) {
715 printk(KERN_ERR 714 printk(KERN_ERR
716 "dell_rbu:%s:platform_device_register_simple " 715 "dell_rbu:%s:platform_device_register_simple "
717 "failed\n", __FUNCTION__); 716 "failed\n", __FUNCTION__);
718 return -EIO; 717 return PTR_ERR(rbu_device);
719 } 718 }
720 719
721 rc = sysfs_create_bin_file(&rbu_device->dev.kobj, &rbu_data_attr); 720 rc = sysfs_create_bin_file(&rbu_device->dev.kobj, &rbu_data_attr);
diff --git a/drivers/i2c/busses/i2c-ixp4xx.c b/drivers/i2c/busses/i2c-ixp4xx.c
index 1ce01fb0ac09..05fffb9415a2 100644
--- a/drivers/i2c/busses/i2c-ixp4xx.c
+++ b/drivers/i2c/busses/i2c-ixp4xx.c
@@ -137,7 +137,8 @@ static int ixp4xx_i2c_probe(struct platform_device *plat_dev)
137 gpio_line_set(gpio->scl_pin, 0); 137 gpio_line_set(gpio->scl_pin, 0);
138 gpio_line_set(gpio->sda_pin, 0); 138 gpio_line_set(gpio->sda_pin, 0);
139 139
140 if ((err = i2c_bit_add_bus(&drv_data->adapter) != 0)) { 140 err = i2c_bit_add_bus(&drv_data->adapter);
141 if (err != 0)
141 printk(KERN_ERR "ERROR: Could not install %s\n", plat_dev->dev.bus_id); 142 printk(KERN_ERR "ERROR: Could not install %s\n", plat_dev->dev.bus_id);
142 143
143 kfree(drv_data); 144 kfree(drv_data);
diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c
index 32aab0d34ee9..714bae780953 100644
--- a/drivers/i2c/busses/scx200_acb.c
+++ b/drivers/i2c/busses/scx200_acb.c
@@ -494,11 +494,12 @@ static __init int scx200_create_pci(const char *text, struct pci_dev *pdev,
494 iface->pdev = pdev; 494 iface->pdev = pdev;
495 iface->bar = bar; 495 iface->bar = bar;
496 496
497 pci_enable_device_bars(iface->pdev, 1 << iface->bar); 497 rc = pci_enable_device_bars(iface->pdev, 1 << iface->bar);
498 if (rc)
499 goto errout_free;
498 500
499 rc = pci_request_region(iface->pdev, iface->bar, iface->adapter.name); 501 rc = pci_request_region(iface->pdev, iface->bar, iface->adapter.name);
500 502 if (rc) {
501 if (rc != 0) {
502 printk(KERN_ERR NAME ": can't allocate PCI BAR %d\n", 503 printk(KERN_ERR NAME ": can't allocate PCI BAR %d\n",
503 iface->bar); 504 iface->bar);
504 goto errout_free; 505 goto errout_free;
diff --git a/drivers/ide/legacy/hd.c b/drivers/ide/legacy/hd.c
index b1d5291531b7..45ed03591cd8 100644
--- a/drivers/ide/legacy/hd.c
+++ b/drivers/ide/legacy/hd.c
@@ -459,7 +459,7 @@ ok_to_read:
459#ifdef DEBUG 459#ifdef DEBUG
460 printk("%s: read: sector %ld, remaining = %ld, buffer=%p\n", 460 printk("%s: read: sector %ld, remaining = %ld, buffer=%p\n",
461 req->rq_disk->disk_name, req->sector, req->nr_sectors, 461 req->rq_disk->disk_name, req->sector, req->nr_sectors,
462 req->buffer+512)); 462 req->buffer+512);
463#endif 463#endif
464 if (req->current_nr_sectors <= 0) 464 if (req->current_nr_sectors <= 0)
465 end_request(req, 1); 465 end_request(req, 1);
diff --git a/drivers/infiniband/hw/ipath/Kconfig b/drivers/infiniband/hw/ipath/Kconfig
index 574a678e7fdd..5ca471ac6542 100644
--- a/drivers/infiniband/hw/ipath/Kconfig
+++ b/drivers/infiniband/hw/ipath/Kconfig
@@ -1,6 +1,6 @@
1config INFINIBAND_IPATH 1config INFINIBAND_IPATH
2 tristate "QLogic InfiniPath Driver" 2 tristate "QLogic InfiniPath Driver"
3 depends on PCI_MSI && 64BIT && INFINIBAND 3 depends on (PCI_MSI || HT_IRQ) && 64BIT && INFINIBAND
4 ---help--- 4 ---help---
5 This is a driver for QLogic InfiniPath host channel adapters, 5 This is a driver for QLogic InfiniPath host channel adapters,
6 including InfiniBand verbs support. This driver allows these 6 including InfiniBand verbs support. This driver allows these
diff --git a/drivers/infiniband/hw/ipath/Makefile b/drivers/infiniband/hw/ipath/Makefile
index 5e29cb0095e5..7dc10551cf18 100644
--- a/drivers/infiniband/hw/ipath/Makefile
+++ b/drivers/infiniband/hw/ipath/Makefile
@@ -10,8 +10,6 @@ ib_ipath-y := \
10 ipath_eeprom.o \ 10 ipath_eeprom.o \
11 ipath_file_ops.o \ 11 ipath_file_ops.o \
12 ipath_fs.o \ 12 ipath_fs.o \
13 ipath_iba6110.o \
14 ipath_iba6120.o \
15 ipath_init_chip.o \ 13 ipath_init_chip.o \
16 ipath_intr.o \ 14 ipath_intr.o \
17 ipath_keys.o \ 15 ipath_keys.o \
@@ -31,5 +29,8 @@ ib_ipath-y := \
31 ipath_verbs_mcast.o \ 29 ipath_verbs_mcast.o \
32 ipath_verbs.o 30 ipath_verbs.o
33 31
32ib_ipath-$(CONFIG_HT_IRQ) += ipath_iba6110.o
33ib_ipath-$(CONFIG_PCI_MSI) += ipath_iba6120.o
34
34ib_ipath-$(CONFIG_X86_64) += ipath_wc_x86_64.o 35ib_ipath-$(CONFIG_X86_64) += ipath_wc_x86_64.o
35ib_ipath-$(CONFIG_PPC64) += ipath_wc_ppc64.o 36ib_ipath-$(CONFIG_PPC64) += ipath_wc_ppc64.o
diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c
index 09a13c1fc46a..1aeddb48e355 100644
--- a/drivers/infiniband/hw/ipath/ipath_driver.c
+++ b/drivers/infiniband/hw/ipath/ipath_driver.c
@@ -390,12 +390,16 @@ static int __devinit ipath_init_one(struct pci_dev *pdev,
390 390
391 /* setup the chip-specific functions, as early as possible. */ 391 /* setup the chip-specific functions, as early as possible. */
392 switch (ent->device) { 392 switch (ent->device) {
393#ifdef CONFIG_HT_IRQ
393 case PCI_DEVICE_ID_INFINIPATH_HT: 394 case PCI_DEVICE_ID_INFINIPATH_HT:
394 ipath_init_iba6110_funcs(dd); 395 ipath_init_iba6110_funcs(dd);
395 break; 396 break;
397#endif
398#ifdef CONFIG_PCI_MSI
396 case PCI_DEVICE_ID_INFINIPATH_PE800: 399 case PCI_DEVICE_ID_INFINIPATH_PE800:
397 ipath_init_iba6120_funcs(dd); 400 ipath_init_iba6120_funcs(dd);
398 break; 401 break;
402#endif
399 default: 403 default:
400 ipath_dev_err(dd, "Found unknown QLogic deviceid 0x%x, " 404 ipath_dev_err(dd, "Found unknown QLogic deviceid 0x%x, "
401 "failing\n", ent->device); 405 "failing\n", ent->device);
diff --git a/drivers/input/keyboard/lkkbd.c b/drivers/input/keyboard/lkkbd.c
index 708d5a1bc3d2..979b93e33da7 100644
--- a/drivers/input/keyboard/lkkbd.c
+++ b/drivers/input/keyboard/lkkbd.c
@@ -59,11 +59,6 @@
59 * You should have received a copy of the GNU General Public License 59 * You should have received a copy of the GNU General Public License
60 * along with this program; if not, write to the Free Software 60 * along with this program; if not, write to the Free Software
61 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 61 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
62 *
63 * Should you need to contact me, the author, you can do so either by
64 * email or by paper mail:
65 * Jan-Benedict Glaw, Lilienstraße 16, 33790 Hörste (near Halle/Westf.),
66 * Germany.
67 */ 62 */
68 63
69#include <linux/delay.h> 64#include <linux/delay.h>
diff --git a/drivers/isdn/hisax/Kconfig b/drivers/isdn/hisax/Kconfig
index eb57a988e048..cfd2718a490d 100644
--- a/drivers/isdn/hisax/Kconfig
+++ b/drivers/isdn/hisax/Kconfig
@@ -344,7 +344,7 @@ config HISAX_HFC_SX
344 344
345config HISAX_ENTERNOW_PCI 345config HISAX_ENTERNOW_PCI
346 bool "Formula-n enter:now PCI card" 346 bool "Formula-n enter:now PCI card"
347 depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || FRV)) 347 depends on HISAX_NETJET && PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || FRV))
348 help 348 help
349 This enables HiSax support for the Formula-n enter:now PCI 349 This enables HiSax support for the Formula-n enter:now PCI
350 ISDN card. 350 ISDN card.
diff --git a/drivers/macintosh/windfarm_pm112.c b/drivers/macintosh/windfarm_pm112.c
index fa4b13f89369..b3fbb45bc90a 100644
--- a/drivers/macintosh/windfarm_pm112.c
+++ b/drivers/macintosh/windfarm_pm112.c
@@ -685,6 +685,17 @@ static int __init wf_pm112_init(void)
685 ++nr_cores; 685 ++nr_cores;
686 686
687 printk(KERN_INFO "windfarm: initializing for dual-core desktop G5\n"); 687 printk(KERN_INFO "windfarm: initializing for dual-core desktop G5\n");
688
689#ifdef MODULE
690 request_module("windfarm_smu_controls");
691 request_module("windfarm_smu_sensors");
692 request_module("windfarm_smu_sat");
693 request_module("windfarm_lm75_sensor");
694 request_module("windfarm_max6690_sensor");
695 request_module("windfarm_cpufreq_clamp");
696
697#endif /* MODULE */
698
688 platform_driver_register(&wf_pm112_driver); 699 platform_driver_register(&wf_pm112_driver);
689 return 0; 700 return 0;
690} 701}
diff --git a/drivers/macintosh/windfarm_pm81.c b/drivers/macintosh/windfarm_pm81.c
index 2a944851b8e1..f24fa734046a 100644
--- a/drivers/macintosh/windfarm_pm81.c
+++ b/drivers/macintosh/windfarm_pm81.c
@@ -788,6 +788,7 @@ static int __init wf_smu_init(void)
788 request_module("windfarm_smu_controls"); 788 request_module("windfarm_smu_controls");
789 request_module("windfarm_smu_sensors"); 789 request_module("windfarm_smu_sensors");
790 request_module("windfarm_lm75_sensor"); 790 request_module("windfarm_lm75_sensor");
791 request_module("windfarm_cpufreq_clamp");
791 792
792#endif /* MODULE */ 793#endif /* MODULE */
793 platform_driver_register(&wf_smu_driver); 794 platform_driver_register(&wf_smu_driver);
diff --git a/drivers/macintosh/windfarm_pm91.c b/drivers/macintosh/windfarm_pm91.c
index 9961a67b4f85..26eee69ebe6d 100644
--- a/drivers/macintosh/windfarm_pm91.c
+++ b/drivers/macintosh/windfarm_pm91.c
@@ -719,6 +719,7 @@ static int __init wf_smu_init(void)
719 request_module("windfarm_smu_controls"); 719 request_module("windfarm_smu_controls");
720 request_module("windfarm_smu_sensors"); 720 request_module("windfarm_smu_sensors");
721 request_module("windfarm_lm75_sensor"); 721 request_module("windfarm_lm75_sensor");
722 request_module("windfarm_cpufreq_clamp");
722 723
723#endif /* MODULE */ 724#endif /* MODULE */
724 platform_driver_register(&wf_smu_driver); 725 platform_driver_register(&wf_smu_driver);
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index ee8863c123e3..766bc54406e5 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -475,7 +475,7 @@ static u32 mmc_select_voltage(struct mmc_host *host, u32 ocr)
475 if (bit) { 475 if (bit) {
476 bit -= 1; 476 bit -= 1;
477 477
478 ocr = 3 << bit; 478 ocr &= 3 << bit;
479 479
480 host->ios.vdd = bit; 480 host->ios.vdd = bit;
481 mmc_set_ios(host); 481 mmc_set_ios(host);
@@ -1178,14 +1178,29 @@ static void mmc_rescan(void *data)
1178{ 1178{
1179 struct mmc_host *host = data; 1179 struct mmc_host *host = data;
1180 struct list_head *l, *n; 1180 struct list_head *l, *n;
1181 unsigned char power_mode;
1181 1182
1182 mmc_claim_host(host); 1183 mmc_claim_host(host);
1183 1184
1184 if (host->ios.power_mode == MMC_POWER_ON) 1185 /*
1186 * Check for removed cards and newly inserted ones. We check for
1187 * removed cards first so we can intelligently re-select the VDD.
1188 */
1189 power_mode = host->ios.power_mode;
1190 if (power_mode == MMC_POWER_ON)
1185 mmc_check_cards(host); 1191 mmc_check_cards(host);
1186 1192
1187 mmc_setup(host); 1193 mmc_setup(host);
1188 1194
1195 /*
1196 * Some broken cards process CMD1 even in stand-by state. There is
1197 * no reply, but an ILLEGAL_COMMAND error is cached and returned
1198 * after next command. We poll for card status here to clear any
1199 * possibly pending error.
1200 */
1201 if (power_mode == MMC_POWER_ON)
1202 mmc_check_cards(host);
1203
1189 if (!list_empty(&host->cards)) { 1204 if (!list_empty(&host->cards)) {
1190 /* 1205 /*
1191 * (Re-)calculate the fastest clock rate which the 1206 * (Re-)calculate the fastest clock rate which the
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 06e4f77b0988..1dbdd6bb587b 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -68,8 +68,8 @@
68 68
69#define DRV_MODULE_NAME "tg3" 69#define DRV_MODULE_NAME "tg3"
70#define PFX DRV_MODULE_NAME ": " 70#define PFX DRV_MODULE_NAME ": "
71#define DRV_MODULE_VERSION "3.68" 71#define DRV_MODULE_VERSION "3.69"
72#define DRV_MODULE_RELDATE "November 02, 2006" 72#define DRV_MODULE_RELDATE "November 15, 2006"
73 73
74#define TG3_DEF_MAC_MODE 0 74#define TG3_DEF_MAC_MODE 0
75#define TG3_DEF_RX_MODE 0 75#define TG3_DEF_RX_MODE 0
@@ -4728,10 +4728,11 @@ static int tg3_poll_fw(struct tg3 *tp)
4728 u32 val; 4728 u32 val;
4729 4729
4730 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) { 4730 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) {
4731 for (i = 0; i < 400; i++) { 4731 /* Wait up to 20ms for init done. */
4732 for (i = 0; i < 200; i++) {
4732 if (tr32(VCPU_STATUS) & VCPU_STATUS_INIT_DONE) 4733 if (tr32(VCPU_STATUS) & VCPU_STATUS_INIT_DONE)
4733 return 0; 4734 return 0;
4734 udelay(10); 4735 udelay(100);
4735 } 4736 }
4736 return -ENODEV; 4737 return -ENODEV;
4737 } 4738 }
@@ -10365,7 +10366,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
10365 u32 pci_state_reg, grc_misc_cfg; 10366 u32 pci_state_reg, grc_misc_cfg;
10366 u32 val; 10367 u32 val;
10367 u16 pci_cmd; 10368 u16 pci_cmd;
10368 int err; 10369 int err, pcie_cap;
10369 10370
10370 /* Force memory write invalidate off. If we leave it on, 10371 /* Force memory write invalidate off. If we leave it on,
10371 * then on 5700_BX chips we have to enable a workaround. 10372 * then on 5700_BX chips we have to enable a workaround.
@@ -10540,8 +10541,19 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
10540 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5906) 10541 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5906)
10541 tp->tg3_flags2 |= TG3_FLG2_JUMBO_CAPABLE; 10542 tp->tg3_flags2 |= TG3_FLG2_JUMBO_CAPABLE;
10542 10543
10543 if (pci_find_capability(tp->pdev, PCI_CAP_ID_EXP) != 0) 10544 pcie_cap = pci_find_capability(tp->pdev, PCI_CAP_ID_EXP);
10545 if (pcie_cap != 0) {
10544 tp->tg3_flags2 |= TG3_FLG2_PCI_EXPRESS; 10546 tp->tg3_flags2 |= TG3_FLG2_PCI_EXPRESS;
10547 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) {
10548 u16 lnkctl;
10549
10550 pci_read_config_word(tp->pdev,
10551 pcie_cap + PCI_EXP_LNKCTL,
10552 &lnkctl);
10553 if (lnkctl & PCI_EXP_LNKCTL_CLKREQ_EN)
10554 tp->tg3_flags2 &= ~TG3_FLG2_HW_TSO_2;
10555 }
10556 }
10545 10557
10546 /* If we have an AMD 762 or VIA K8T800 chipset, write 10558 /* If we have an AMD 762 or VIA K8T800 chipset, write
10547 * reordering to the mailbox registers done by the host 10559 * reordering to the mailbox registers done by the host
@@ -11808,6 +11820,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
11808 else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 || 11820 else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 ||
11809 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701 || 11821 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701 ||
11810 tp->pci_chip_rev_id == CHIPREV_ID_5705_A0 || 11822 tp->pci_chip_rev_id == CHIPREV_ID_5705_A0 ||
11823 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906 ||
11811 (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0) { 11824 (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0) {
11812 tp->tg3_flags2 &= ~TG3_FLG2_TSO_CAPABLE; 11825 tp->tg3_flags2 &= ~TG3_FLG2_TSO_CAPABLE;
11813 } else { 11826 } else {
diff --git a/drivers/parport/parport_ip32.c b/drivers/parport/parport_ip32.c
index e3e19277030a..ec44efdbb84e 100644
--- a/drivers/parport/parport_ip32.c
+++ b/drivers/parport/parport_ip32.c
@@ -780,7 +780,7 @@ static irqreturn_t parport_ip32_interrupt(int irq, void *dev_id)
780 enum parport_ip32_irq_mode irq_mode = priv->irq_mode; 780 enum parport_ip32_irq_mode irq_mode = priv->irq_mode;
781 switch (irq_mode) { 781 switch (irq_mode) {
782 case PARPORT_IP32_IRQ_FWD: 782 case PARPORT_IP32_IRQ_FWD:
783 parport_generic_irq(irq, p, regs); 783 parport_generic_irq(irq, p);
784 break; 784 break;
785 case PARPORT_IP32_IRQ_HERE: 785 case PARPORT_IP32_IRQ_HERE:
786 parport_ip32_wakeup(p); 786 parport_ip32_wakeup(p);
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 204b1c8e972b..5b4483811691 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -1460,33 +1460,6 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2609, quirk_intel_pcie_pm);
1460DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260a, quirk_intel_pcie_pm); 1460DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260a, quirk_intel_pcie_pm);
1461DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260b, quirk_intel_pcie_pm); 1461DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260b, quirk_intel_pcie_pm);
1462 1462
1463/*
1464 * Fixup the cardbus bridges on the IBM Dock II docking station
1465 */
1466static void __devinit quirk_ibm_dock2_cardbus(struct pci_dev *dev)
1467{
1468 u32 val;
1469
1470 /*
1471 * tie the 2 interrupt pins to INTA, and configure the
1472 * multifunction routing register to handle this.
1473 */
1474 if ((dev->subsystem_vendor == PCI_VENDOR_ID_IBM) &&
1475 (dev->subsystem_device == 0x0148)) {
1476 printk(KERN_INFO "PCI: Found IBM Dock II Cardbus Bridge "
1477 "applying quirk\n");
1478 pci_read_config_dword(dev, 0x8c, &val);
1479 val = ((val & 0xffffff00) | 0x1002);
1480 pci_write_config_dword(dev, 0x8c, val);
1481 pci_read_config_dword(dev, 0x80, &val);
1482 val = ((val & 0x00ffff00) | 0x2864c077);
1483 pci_write_config_dword(dev, 0x80, val);
1484 }
1485}
1486
1487DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1420,
1488 quirk_ibm_dock2_cardbus);
1489
1490static void __devinit quirk_netmos(struct pci_dev *dev) 1463static void __devinit quirk_netmos(struct pci_dev *dev)
1491{ 1464{
1492 unsigned int num_parallel = (dev->subsystem_device & 0xf0) >> 4; 1465 unsigned int num_parallel = (dev->subsystem_device & 0xf0) >> 4;
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 0f701921c13e..a20d84d707d9 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -1271,6 +1271,9 @@ static void pcmcia_bus_remove_socket(struct class_device *class_dev,
1271 socket->pcmcia_state.dead = 1; 1271 socket->pcmcia_state.dead = 1;
1272 pccard_register_pcmcia(socket, NULL); 1272 pccard_register_pcmcia(socket, NULL);
1273 1273
1274 /* unregister any unbound devices */
1275 pcmcia_card_remove(socket, NULL);
1276
1274 pcmcia_put_socket(socket); 1277 pcmcia_put_socket(socket);
1275 1278
1276 return; 1279 return;
diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
index 5f8c26cd66ca..b091a0fc4eb0 100644
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -66,6 +66,9 @@
66 2.26.02.006 - Fix 9550SX pchip reset timeout. 66 2.26.02.006 - Fix 9550SX pchip reset timeout.
67 Add big endian support. 67 Add big endian support.
68 2.26.02.007 - Disable local interrupts during kmap/unmap_atomic(). 68 2.26.02.007 - Disable local interrupts during kmap/unmap_atomic().
69 2.26.02.008 - Free irq handler in __twa_shutdown().
70 Serialize reset code.
71 Add support for 9650SE controllers.
69*/ 72*/
70 73
71#include <linux/module.h> 74#include <linux/module.h>
@@ -89,7 +92,7 @@
89#include "3w-9xxx.h" 92#include "3w-9xxx.h"
90 93
91/* Globals */ 94/* Globals */
92#define TW_DRIVER_VERSION "2.26.02.007" 95#define TW_DRIVER_VERSION "2.26.02.008"
93static TW_Device_Extension *twa_device_extension_list[TW_MAX_SLOT]; 96static TW_Device_Extension *twa_device_extension_list[TW_MAX_SLOT];
94static unsigned int twa_device_extension_count; 97static unsigned int twa_device_extension_count;
95static int twa_major = -1; 98static int twa_major = -1;
@@ -566,9 +569,9 @@ static int twa_check_srl(TW_Device_Extension *tw_dev, int *flashed)
566 goto out; 569 goto out;
567 } 570 }
568 571
569 tw_dev->working_srl = fw_on_ctlr_srl; 572 tw_dev->tw_compat_info.working_srl = fw_on_ctlr_srl;
570 tw_dev->working_branch = fw_on_ctlr_branch; 573 tw_dev->tw_compat_info.working_branch = fw_on_ctlr_branch;
571 tw_dev->working_build = fw_on_ctlr_build; 574 tw_dev->tw_compat_info.working_build = fw_on_ctlr_build;
572 575
573 /* Try base mode compatibility */ 576 /* Try base mode compatibility */
574 if (!(init_connect_result & TW_CTLR_FW_COMPATIBLE)) { 577 if (!(init_connect_result & TW_CTLR_FW_COMPATIBLE)) {
@@ -590,10 +593,23 @@ static int twa_check_srl(TW_Device_Extension *tw_dev, int *flashed)
590 } 593 }
591 goto out; 594 goto out;
592 } 595 }
593 tw_dev->working_srl = TW_BASE_FW_SRL; 596 tw_dev->tw_compat_info.working_srl = TW_BASE_FW_SRL;
594 tw_dev->working_branch = TW_BASE_FW_BRANCH; 597 tw_dev->tw_compat_info.working_branch = TW_BASE_FW_BRANCH;
595 tw_dev->working_build = TW_BASE_FW_BUILD; 598 tw_dev->tw_compat_info.working_build = TW_BASE_FW_BUILD;
596 } 599 }
600
601 /* Load rest of compatibility struct */
602 strncpy(tw_dev->tw_compat_info.driver_version, TW_DRIVER_VERSION, strlen(TW_DRIVER_VERSION));
603 tw_dev->tw_compat_info.driver_srl_high = TW_CURRENT_DRIVER_SRL;
604 tw_dev->tw_compat_info.driver_branch_high = TW_CURRENT_DRIVER_BRANCH;
605 tw_dev->tw_compat_info.driver_build_high = TW_CURRENT_DRIVER_BUILD;
606 tw_dev->tw_compat_info.driver_srl_low = TW_BASE_FW_SRL;
607 tw_dev->tw_compat_info.driver_branch_low = TW_BASE_FW_BRANCH;
608 tw_dev->tw_compat_info.driver_build_low = TW_BASE_FW_BUILD;
609 tw_dev->tw_compat_info.fw_on_ctlr_srl = fw_on_ctlr_srl;
610 tw_dev->tw_compat_info.fw_on_ctlr_branch = fw_on_ctlr_branch;
611 tw_dev->tw_compat_info.fw_on_ctlr_build = fw_on_ctlr_build;
612
597 retval = 0; 613 retval = 0;
598out: 614out:
599 return retval; 615 return retval;
@@ -631,7 +647,7 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
631 goto out2; 647 goto out2;
632 648
633 /* Check data buffer size */ 649 /* Check data buffer size */
634 if (driver_command.buffer_length > TW_MAX_SECTORS * 512) { 650 if (driver_command.buffer_length > TW_MAX_SECTORS * 2048) {
635 retval = TW_IOCTL_ERROR_OS_EINVAL; 651 retval = TW_IOCTL_ERROR_OS_EINVAL;
636 goto out2; 652 goto out2;
637 } 653 }
@@ -680,13 +696,6 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
680 /* Now wait for command to complete */ 696 /* Now wait for command to complete */
681 timeout = wait_event_timeout(tw_dev->ioctl_wqueue, tw_dev->chrdev_request_id == TW_IOCTL_CHRDEV_FREE, timeout); 697 timeout = wait_event_timeout(tw_dev->ioctl_wqueue, tw_dev->chrdev_request_id == TW_IOCTL_CHRDEV_FREE, timeout);
682 698
683 /* See if we reset while waiting for the ioctl to complete */
684 if (test_bit(TW_IN_RESET, &tw_dev->flags)) {
685 clear_bit(TW_IN_RESET, &tw_dev->flags);
686 retval = TW_IOCTL_ERROR_OS_ERESTARTSYS;
687 goto out3;
688 }
689
690 /* We timed out, and didn't get an interrupt */ 699 /* We timed out, and didn't get an interrupt */
691 if (tw_dev->chrdev_request_id != TW_IOCTL_CHRDEV_FREE) { 700 if (tw_dev->chrdev_request_id != TW_IOCTL_CHRDEV_FREE) {
692 /* Now we need to reset the board */ 701 /* Now we need to reset the board */
@@ -694,11 +703,6 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
694 tw_dev->host->host_no, TW_DRIVER, 0xc, 703 tw_dev->host->host_no, TW_DRIVER, 0xc,
695 cmd); 704 cmd);
696 retval = TW_IOCTL_ERROR_OS_EIO; 705 retval = TW_IOCTL_ERROR_OS_EIO;
697 spin_lock_irqsave(tw_dev->host->host_lock, flags);
698 tw_dev->state[request_id] = TW_S_COMPLETED;
699 twa_free_request_id(tw_dev, request_id);
700 tw_dev->posted_request_count--;
701 spin_unlock_irqrestore(tw_dev->host->host_lock, flags);
702 twa_reset_device_extension(tw_dev, 1); 706 twa_reset_device_extension(tw_dev, 1);
703 goto out3; 707 goto out3;
704 } 708 }
@@ -717,16 +721,7 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
717 tw_ioctl->driver_command.status = 0; 721 tw_ioctl->driver_command.status = 0;
718 /* Copy compatiblity struct into ioctl data buffer */ 722 /* Copy compatiblity struct into ioctl data buffer */
719 tw_compat_info = (TW_Compatibility_Info *)tw_ioctl->data_buffer; 723 tw_compat_info = (TW_Compatibility_Info *)tw_ioctl->data_buffer;
720 strncpy(tw_compat_info->driver_version, TW_DRIVER_VERSION, strlen(TW_DRIVER_VERSION)); 724 memcpy(tw_compat_info, &tw_dev->tw_compat_info, sizeof(TW_Compatibility_Info));
721 tw_compat_info->working_srl = tw_dev->working_srl;
722 tw_compat_info->working_branch = tw_dev->working_branch;
723 tw_compat_info->working_build = tw_dev->working_build;
724 tw_compat_info->driver_srl_high = TW_CURRENT_DRIVER_SRL;
725 tw_compat_info->driver_branch_high = TW_CURRENT_DRIVER_BRANCH;
726 tw_compat_info->driver_build_high = TW_CURRENT_DRIVER_BUILD;
727 tw_compat_info->driver_srl_low = TW_BASE_FW_SRL;
728 tw_compat_info->driver_branch_low = TW_BASE_FW_BRANCH;
729 tw_compat_info->driver_build_low = TW_BASE_FW_BUILD;
730 break; 725 break;
731 case TW_IOCTL_GET_LAST_EVENT: 726 case TW_IOCTL_GET_LAST_EVENT:
732 if (tw_dev->event_queue_wrapped) { 727 if (tw_dev->event_queue_wrapped) {
@@ -895,7 +890,8 @@ static int twa_decode_bits(TW_Device_Extension *tw_dev, u32 status_reg_value)
895 } 890 }
896 891
897 if (status_reg_value & TW_STATUS_QUEUE_ERROR) { 892 if (status_reg_value & TW_STATUS_QUEUE_ERROR) {
898 TW_PRINTK(tw_dev->host, TW_DRIVER, 0xe, "Controller Queue Error: clearing"); 893 if ((tw_dev->tw_pci_dev->device != PCI_DEVICE_ID_3WARE_9650SE) || (!test_bit(TW_IN_RESET, &tw_dev->flags)))
894 TW_PRINTK(tw_dev->host, TW_DRIVER, 0xe, "Controller Queue Error: clearing");
899 writel(TW_CONTROL_CLEAR_QUEUE_ERROR, TW_CONTROL_REG_ADDR(tw_dev)); 895 writel(TW_CONTROL_CLEAR_QUEUE_ERROR, TW_CONTROL_REG_ADDR(tw_dev));
900 } 896 }
901 897
@@ -939,10 +935,12 @@ static int twa_empty_response_queue_large(TW_Device_Extension *tw_dev)
939 unsigned long before; 935 unsigned long before;
940 int retval = 1; 936 int retval = 1;
941 937
942 if (tw_dev->tw_pci_dev->device == PCI_DEVICE_ID_3WARE_9550SX) { 938 if ((tw_dev->tw_pci_dev->device == PCI_DEVICE_ID_3WARE_9550SX) ||
939 (tw_dev->tw_pci_dev->device == PCI_DEVICE_ID_3WARE_9650SE)) {
943 before = jiffies; 940 before = jiffies;
944 while ((response_que_value & TW_9550SX_DRAIN_COMPLETED) != TW_9550SX_DRAIN_COMPLETED) { 941 while ((response_que_value & TW_9550SX_DRAIN_COMPLETED) != TW_9550SX_DRAIN_COMPLETED) {
945 response_que_value = readl(TW_RESPONSE_QUEUE_REG_ADDR_LARGE(tw_dev)); 942 response_que_value = readl(TW_RESPONSE_QUEUE_REG_ADDR_LARGE(tw_dev));
943 msleep(1);
946 if (time_after(jiffies, before + HZ * 30)) 944 if (time_after(jiffies, before + HZ * 30))
947 goto out; 945 goto out;
948 } 946 }
@@ -1214,6 +1212,10 @@ static irqreturn_t twa_interrupt(int irq, void *dev_instance)
1214 1212
1215 handled = 1; 1213 handled = 1;
1216 1214
1215 /* If we are resetting, bail */
1216 if (test_bit(TW_IN_RESET, &tw_dev->flags))
1217 goto twa_interrupt_bail;
1218
1217 /* Check controller for errors */ 1219 /* Check controller for errors */
1218 if (twa_check_bits(status_reg_value)) { 1220 if (twa_check_bits(status_reg_value)) {
1219 if (twa_decode_bits(tw_dev, status_reg_value)) { 1221 if (twa_decode_bits(tw_dev, status_reg_value)) {
@@ -1355,8 +1357,8 @@ static void twa_load_sgl(TW_Command_Full *full_command_packet, int request_id, d
1355 1357
1356 if (TW_OP_OUT(full_command_packet->command.newcommand.opcode__reserved) == TW_OP_EXECUTE_SCSI) { 1358 if (TW_OP_OUT(full_command_packet->command.newcommand.opcode__reserved) == TW_OP_EXECUTE_SCSI) {
1357 newcommand = &full_command_packet->command.newcommand; 1359 newcommand = &full_command_packet->command.newcommand;
1358 newcommand->request_id__lunl = 1360 newcommand->request_id__lunl =
1359 TW_REQ_LUN_IN(TW_LUN_OUT(newcommand->request_id__lunl), request_id); 1361 cpu_to_le16(TW_REQ_LUN_IN(TW_LUN_OUT(newcommand->request_id__lunl), request_id));
1360 newcommand->sg_list[0].address = TW_CPU_TO_SGL(dma_handle + sizeof(TW_Ioctl_Buf_Apache) - 1); 1362 newcommand->sg_list[0].address = TW_CPU_TO_SGL(dma_handle + sizeof(TW_Ioctl_Buf_Apache) - 1);
1361 newcommand->sg_list[0].length = cpu_to_le32(length); 1363 newcommand->sg_list[0].length = cpu_to_le32(length);
1362 newcommand->sgl_entries__lunh = 1364 newcommand->sgl_entries__lunh =
@@ -1531,6 +1533,13 @@ static int twa_post_command_packet(TW_Device_Extension *tw_dev, int request_id,
1531 int retval = 1; 1533 int retval = 1;
1532 1534
1533 command_que_value = tw_dev->command_packet_phys[request_id]; 1535 command_que_value = tw_dev->command_packet_phys[request_id];
1536
1537 /* For 9650SE write low 4 bytes first */
1538 if (tw_dev->tw_pci_dev->device == PCI_DEVICE_ID_3WARE_9650SE) {
1539 command_que_value += TW_COMMAND_OFFSET;
1540 writel((u32)command_que_value, TW_COMMAND_QUEUE_REG_ADDR_LARGE(tw_dev));
1541 }
1542
1534 status_reg_value = readl(TW_STATUS_REG_ADDR(tw_dev)); 1543 status_reg_value = readl(TW_STATUS_REG_ADDR(tw_dev));
1535 1544
1536 if (twa_check_bits(status_reg_value)) 1545 if (twa_check_bits(status_reg_value))
@@ -1557,13 +1566,17 @@ static int twa_post_command_packet(TW_Device_Extension *tw_dev, int request_id,
1557 TW_UNMASK_COMMAND_INTERRUPT(tw_dev); 1566 TW_UNMASK_COMMAND_INTERRUPT(tw_dev);
1558 goto out; 1567 goto out;
1559 } else { 1568 } else {
1560 /* We successfully posted the command packet */ 1569 if (tw_dev->tw_pci_dev->device == PCI_DEVICE_ID_3WARE_9650SE) {
1561 if (sizeof(dma_addr_t) > 4) { 1570 /* Now write upper 4 bytes */
1562 command_que_value += TW_COMMAND_OFFSET; 1571 writel((u32)((u64)command_que_value >> 32), TW_COMMAND_QUEUE_REG_ADDR_LARGE(tw_dev) + 0x4);
1563 writel((u32)command_que_value, TW_COMMAND_QUEUE_REG_ADDR(tw_dev));
1564 writel((u32)((u64)command_que_value >> 32), TW_COMMAND_QUEUE_REG_ADDR(tw_dev) + 0x4);
1565 } else { 1572 } else {
1566 writel(TW_COMMAND_OFFSET + command_que_value, TW_COMMAND_QUEUE_REG_ADDR(tw_dev)); 1573 if (sizeof(dma_addr_t) > 4) {
1574 command_que_value += TW_COMMAND_OFFSET;
1575 writel((u32)command_que_value, TW_COMMAND_QUEUE_REG_ADDR(tw_dev));
1576 writel((u32)((u64)command_que_value >> 32), TW_COMMAND_QUEUE_REG_ADDR(tw_dev) + 0x4);
1577 } else {
1578 writel(TW_COMMAND_OFFSET + command_que_value, TW_COMMAND_QUEUE_REG_ADDR(tw_dev));
1579 }
1567 } 1580 }
1568 tw_dev->state[request_id] = TW_S_POSTED; 1581 tw_dev->state[request_id] = TW_S_POSTED;
1569 tw_dev->posted_request_count++; 1582 tw_dev->posted_request_count++;
@@ -1620,14 +1633,9 @@ static int twa_reset_device_extension(TW_Device_Extension *tw_dev, int ioctl_res
1620 goto out; 1633 goto out;
1621 1634
1622 TW_ENABLE_AND_CLEAR_INTERRUPTS(tw_dev); 1635 TW_ENABLE_AND_CLEAR_INTERRUPTS(tw_dev);
1636 clear_bit(TW_IN_RESET, &tw_dev->flags);
1637 tw_dev->chrdev_request_id = TW_IOCTL_CHRDEV_FREE;
1623 1638
1624 /* Wake up any ioctl that was pending before the reset */
1625 if ((tw_dev->chrdev_request_id == TW_IOCTL_CHRDEV_FREE) || (ioctl_reset)) {
1626 clear_bit(TW_IN_RESET, &tw_dev->flags);
1627 } else {
1628 tw_dev->chrdev_request_id = TW_IOCTL_CHRDEV_FREE;
1629 wake_up(&tw_dev->ioctl_wqueue);
1630 }
1631 retval = 0; 1639 retval = 0;
1632out: 1640out:
1633 return retval; 1641 return retval;
@@ -1736,6 +1744,9 @@ static int twa_scsi_eh_reset(struct scsi_cmnd *SCpnt)
1736 "WARNING: (0x%02X:0x%04X): Command (0x%x) timed out, resetting card.\n", 1744 "WARNING: (0x%02X:0x%04X): Command (0x%x) timed out, resetting card.\n",
1737 TW_DRIVER, 0x2c, SCpnt->cmnd[0]); 1745 TW_DRIVER, 0x2c, SCpnt->cmnd[0]);
1738 1746
1747 /* Make sure we are not issuing an ioctl or resetting from ioctl */
1748 mutex_lock(&tw_dev->ioctl_lock);
1749
1739 /* Now reset the card and some of the device extension data */ 1750 /* Now reset the card and some of the device extension data */
1740 if (twa_reset_device_extension(tw_dev, 0)) { 1751 if (twa_reset_device_extension(tw_dev, 0)) {
1741 TW_PRINTK(tw_dev->host, TW_DRIVER, 0x2b, "Controller reset failed during scsi host reset"); 1752 TW_PRINTK(tw_dev->host, TW_DRIVER, 0x2b, "Controller reset failed during scsi host reset");
@@ -1744,6 +1755,7 @@ static int twa_scsi_eh_reset(struct scsi_cmnd *SCpnt)
1744 1755
1745 retval = SUCCESS; 1756 retval = SUCCESS;
1746out: 1757out:
1758 mutex_unlock(&tw_dev->ioctl_lock);
1747 return retval; 1759 return retval;
1748} /* End twa_scsi_eh_reset() */ 1760} /* End twa_scsi_eh_reset() */
1749 1761
@@ -1753,8 +1765,14 @@ static int twa_scsi_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd
1753 int request_id, retval; 1765 int request_id, retval;
1754 TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; 1766 TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata;
1755 1767
1768 /* If we are resetting due to timed out ioctl, report as busy */
1769 if (test_bit(TW_IN_RESET, &tw_dev->flags)) {
1770 retval = SCSI_MLQUEUE_HOST_BUSY;
1771 goto out;
1772 }
1773
1756 /* Check if this FW supports luns */ 1774 /* Check if this FW supports luns */
1757 if ((SCpnt->device->lun != 0) && (tw_dev->working_srl < TW_FW_SRL_LUNS_SUPPORTED)) { 1775 if ((SCpnt->device->lun != 0) && (tw_dev->tw_compat_info.working_srl < TW_FW_SRL_LUNS_SUPPORTED)) {
1758 SCpnt->result = (DID_BAD_TARGET << 16); 1776 SCpnt->result = (DID_BAD_TARGET << 16);
1759 done(SCpnt); 1777 done(SCpnt);
1760 retval = 0; 1778 retval = 0;
@@ -1960,6 +1978,9 @@ static void __twa_shutdown(TW_Device_Extension *tw_dev)
1960 /* Disable interrupts */ 1978 /* Disable interrupts */
1961 TW_DISABLE_INTERRUPTS(tw_dev); 1979 TW_DISABLE_INTERRUPTS(tw_dev);
1962 1980
1981 /* Free up the IRQ */
1982 free_irq(tw_dev->tw_pci_dev->irq, tw_dev);
1983
1963 printk(KERN_WARNING "3w-9xxx: Shutting down host %d.\n", tw_dev->host->host_no); 1984 printk(KERN_WARNING "3w-9xxx: Shutting down host %d.\n", tw_dev->host->host_no);
1964 1985
1965 /* Tell the card we are shutting down */ 1986 /* Tell the card we are shutting down */
@@ -2091,21 +2112,25 @@ static int __devinit twa_probe(struct pci_dev *pdev, const struct pci_device_id
2091 2112
2092 /* Initialize the card */ 2113 /* Initialize the card */
2093 if (twa_reset_sequence(tw_dev, 0)) 2114 if (twa_reset_sequence(tw_dev, 0))
2094 goto out_release_mem_region; 2115 goto out_iounmap;
2095 2116
2096 /* Set host specific parameters */ 2117 /* Set host specific parameters */
2097 host->max_id = TW_MAX_UNITS; 2118 if (pdev->device == PCI_DEVICE_ID_3WARE_9650SE)
2119 host->max_id = TW_MAX_UNITS_9650SE;
2120 else
2121 host->max_id = TW_MAX_UNITS;
2122
2098 host->max_cmd_len = TW_MAX_CDB_LEN; 2123 host->max_cmd_len = TW_MAX_CDB_LEN;
2099 2124
2100 /* Channels aren't supported by adapter */ 2125 /* Channels aren't supported by adapter */
2101 host->max_lun = TW_MAX_LUNS(tw_dev->working_srl); 2126 host->max_lun = TW_MAX_LUNS(tw_dev->tw_compat_info.working_srl);
2102 host->max_channel = 0; 2127 host->max_channel = 0;
2103 2128
2104 /* Register the card with the kernel SCSI layer */ 2129 /* Register the card with the kernel SCSI layer */
2105 retval = scsi_add_host(host, &pdev->dev); 2130 retval = scsi_add_host(host, &pdev->dev);
2106 if (retval) { 2131 if (retval) {
2107 TW_PRINTK(tw_dev->host, TW_DRIVER, 0x27, "scsi add host failed"); 2132 TW_PRINTK(tw_dev->host, TW_DRIVER, 0x27, "scsi add host failed");
2108 goto out_release_mem_region; 2133 goto out_iounmap;
2109 } 2134 }
2110 2135
2111 pci_set_drvdata(pdev, host); 2136 pci_set_drvdata(pdev, host);
@@ -2145,6 +2170,8 @@ static int __devinit twa_probe(struct pci_dev *pdev, const struct pci_device_id
2145 2170
2146out_remove_host: 2171out_remove_host:
2147 scsi_remove_host(host); 2172 scsi_remove_host(host);
2173out_iounmap:
2174 iounmap(tw_dev->base_addr);
2148out_release_mem_region: 2175out_release_mem_region:
2149 pci_release_regions(pdev); 2176 pci_release_regions(pdev);
2150out_free_device_extension: 2177out_free_device_extension:
@@ -2170,12 +2197,12 @@ static void twa_remove(struct pci_dev *pdev)
2170 twa_major = -1; 2197 twa_major = -1;
2171 } 2198 }
2172 2199
2173 /* Free up the IRQ */
2174 free_irq(tw_dev->tw_pci_dev->irq, tw_dev);
2175
2176 /* Shutdown the card */ 2200 /* Shutdown the card */
2177 __twa_shutdown(tw_dev); 2201 __twa_shutdown(tw_dev);
2178 2202
2203 /* Free IO remapping */
2204 iounmap(tw_dev->base_addr);
2205
2179 /* Free up the mem region */ 2206 /* Free up the mem region */
2180 pci_release_regions(pdev); 2207 pci_release_regions(pdev);
2181 2208
@@ -2193,6 +2220,8 @@ static struct pci_device_id twa_pci_tbl[] __devinitdata = {
2193 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 2220 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
2194 { PCI_VENDOR_ID_3WARE, PCI_DEVICE_ID_3WARE_9550SX, 2221 { PCI_VENDOR_ID_3WARE, PCI_DEVICE_ID_3WARE_9550SX,
2195 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 2222 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
2223 { PCI_VENDOR_ID_3WARE, PCI_DEVICE_ID_3WARE_9650SE,
2224 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
2196 { } 2225 { }
2197}; 2226};
2198MODULE_DEVICE_TABLE(pci, twa_pci_tbl); 2227MODULE_DEVICE_TABLE(pci, twa_pci_tbl);
diff --git a/drivers/scsi/3w-9xxx.h b/drivers/scsi/3w-9xxx.h
index e5685be96f45..7901517d4513 100644
--- a/drivers/scsi/3w-9xxx.h
+++ b/drivers/scsi/3w-9xxx.h
@@ -289,7 +289,6 @@ static twa_message_type twa_error_table[] = {
289#define TW_STATUS_VALID_INTERRUPT 0x00DF0000 289#define TW_STATUS_VALID_INTERRUPT 0x00DF0000
290 290
291/* PCI related defines */ 291/* PCI related defines */
292#define TW_NUMDEVICES 1
293#define TW_PCI_CLEAR_PARITY_ERRORS 0xc100 292#define TW_PCI_CLEAR_PARITY_ERRORS 0xc100
294#define TW_PCI_CLEAR_PCI_ABORT 0x2000 293#define TW_PCI_CLEAR_PCI_ABORT 0x2000
295 294
@@ -335,6 +334,7 @@ static twa_message_type twa_error_table[] = {
335#define TW_ALIGNMENT_9000 4 /* 4 bytes */ 334#define TW_ALIGNMENT_9000 4 /* 4 bytes */
336#define TW_ALIGNMENT_9000_SGL 0x3 335#define TW_ALIGNMENT_9000_SGL 0x3
337#define TW_MAX_UNITS 16 336#define TW_MAX_UNITS 16
337#define TW_MAX_UNITS_9650SE 32
338#define TW_INIT_MESSAGE_CREDITS 0x100 338#define TW_INIT_MESSAGE_CREDITS 0x100
339#define TW_INIT_COMMAND_PACKET_SIZE 0x3 339#define TW_INIT_COMMAND_PACKET_SIZE 0x3
340#define TW_INIT_COMMAND_PACKET_SIZE_EXTENDED 0x6 340#define TW_INIT_COMMAND_PACKET_SIZE_EXTENDED 0x6
@@ -354,7 +354,6 @@ static twa_message_type twa_error_table[] = {
354#define TW_MAX_RESPONSE_DRAIN 256 354#define TW_MAX_RESPONSE_DRAIN 256
355#define TW_MAX_AEN_DRAIN 40 355#define TW_MAX_AEN_DRAIN 40
356#define TW_IN_RESET 2 356#define TW_IN_RESET 2
357#define TW_IN_CHRDEV_IOCTL 3
358#define TW_IN_ATTENTION_LOOP 4 357#define TW_IN_ATTENTION_LOOP 4
359#define TW_MAX_SECTORS 256 358#define TW_MAX_SECTORS 256
360#define TW_AEN_WAIT_TIME 1000 359#define TW_AEN_WAIT_TIME 1000
@@ -417,6 +416,9 @@ static twa_message_type twa_error_table[] = {
417#ifndef PCI_DEVICE_ID_3WARE_9550SX 416#ifndef PCI_DEVICE_ID_3WARE_9550SX
418#define PCI_DEVICE_ID_3WARE_9550SX 0x1003 417#define PCI_DEVICE_ID_3WARE_9550SX 0x1003
419#endif 418#endif
419#ifndef PCI_DEVICE_ID_3WARE_9650SE
420#define PCI_DEVICE_ID_3WARE_9650SE 0x1004
421#endif
420 422
421/* Bitmask macros to eliminate bitfields */ 423/* Bitmask macros to eliminate bitfields */
422 424
@@ -442,6 +444,7 @@ static twa_message_type twa_error_table[] = {
442#define TW_CONTROL_REG_ADDR(x) (x->base_addr) 444#define TW_CONTROL_REG_ADDR(x) (x->base_addr)
443#define TW_STATUS_REG_ADDR(x) ((unsigned char __iomem *)x->base_addr + 0x4) 445#define TW_STATUS_REG_ADDR(x) ((unsigned char __iomem *)x->base_addr + 0x4)
444#define TW_COMMAND_QUEUE_REG_ADDR(x) (sizeof(dma_addr_t) > 4 ? ((unsigned char __iomem *)x->base_addr + 0x20) : ((unsigned char __iomem *)x->base_addr + 0x8)) 446#define TW_COMMAND_QUEUE_REG_ADDR(x) (sizeof(dma_addr_t) > 4 ? ((unsigned char __iomem *)x->base_addr + 0x20) : ((unsigned char __iomem *)x->base_addr + 0x8))
447#define TW_COMMAND_QUEUE_REG_ADDR_LARGE(x) ((unsigned char __iomem *)x->base_addr + 0x20)
445#define TW_RESPONSE_QUEUE_REG_ADDR(x) ((unsigned char __iomem *)x->base_addr + 0xC) 448#define TW_RESPONSE_QUEUE_REG_ADDR(x) ((unsigned char __iomem *)x->base_addr + 0xC)
446#define TW_RESPONSE_QUEUE_REG_ADDR_LARGE(x) ((unsigned char __iomem *)x->base_addr + 0x30) 449#define TW_RESPONSE_QUEUE_REG_ADDR_LARGE(x) ((unsigned char __iomem *)x->base_addr + 0x30)
447#define TW_CLEAR_ALL_INTERRUPTS(x) (writel(TW_STATUS_VALID_INTERRUPT, TW_CONTROL_REG_ADDR(x))) 450#define TW_CLEAR_ALL_INTERRUPTS(x) (writel(TW_STATUS_VALID_INTERRUPT, TW_CONTROL_REG_ADDR(x)))
@@ -626,6 +629,9 @@ typedef struct TAG_TW_Compatibility_Info
626 unsigned short driver_srl_low; 629 unsigned short driver_srl_low;
627 unsigned short driver_branch_low; 630 unsigned short driver_branch_low;
628 unsigned short driver_build_low; 631 unsigned short driver_build_low;
632 unsigned short fw_on_ctlr_srl;
633 unsigned short fw_on_ctlr_branch;
634 unsigned short fw_on_ctlr_build;
629} TW_Compatibility_Info; 635} TW_Compatibility_Info;
630 636
631#pragma pack() 637#pragma pack()
@@ -668,9 +674,7 @@ typedef struct TAG_TW_Device_Extension {
668 wait_queue_head_t ioctl_wqueue; 674 wait_queue_head_t ioctl_wqueue;
669 struct mutex ioctl_lock; 675 struct mutex ioctl_lock;
670 char aen_clobber; 676 char aen_clobber;
671 unsigned short working_srl; 677 TW_Compatibility_Info tw_compat_info;
672 unsigned short working_branch;
673 unsigned short working_build;
674} TW_Device_Extension; 678} TW_Device_Extension;
675 679
676#endif /* _3W_9XXX_H */ 680#endif /* _3W_9XXX_H */
diff --git a/drivers/scsi/aic94xx/aic94xx_hwi.c b/drivers/scsi/aic94xx/aic94xx_hwi.c
index 3c2d7a379931..af7e01134364 100644
--- a/drivers/scsi/aic94xx/aic94xx_hwi.c
+++ b/drivers/scsi/aic94xx/aic94xx_hwi.c
@@ -112,6 +112,21 @@ static int asd_init_phy(struct asd_phy *phy)
112 return 0; 112 return 0;
113} 113}
114 114
115static void asd_init_ports(struct asd_ha_struct *asd_ha)
116{
117 int i;
118
119 spin_lock_init(&asd_ha->asd_ports_lock);
120 for (i = 0; i < ASD_MAX_PHYS; i++) {
121 struct asd_port *asd_port = &asd_ha->asd_ports[i];
122
123 memset(asd_port->sas_addr, 0, SAS_ADDR_SIZE);
124 memset(asd_port->attached_sas_addr, 0, SAS_ADDR_SIZE);
125 asd_port->phy_mask = 0;
126 asd_port->num_phys = 0;
127 }
128}
129
115static int asd_init_phys(struct asd_ha_struct *asd_ha) 130static int asd_init_phys(struct asd_ha_struct *asd_ha)
116{ 131{
117 u8 i; 132 u8 i;
@@ -121,6 +136,7 @@ static int asd_init_phys(struct asd_ha_struct *asd_ha)
121 struct asd_phy *phy = &asd_ha->phys[i]; 136 struct asd_phy *phy = &asd_ha->phys[i];
122 137
123 phy->phy_desc = &asd_ha->hw_prof.phy_desc[i]; 138 phy->phy_desc = &asd_ha->hw_prof.phy_desc[i];
139 phy->asd_port = NULL;
124 140
125 phy->sas_phy.enabled = 0; 141 phy->sas_phy.enabled = 0;
126 phy->sas_phy.id = i; 142 phy->sas_phy.id = i;
@@ -658,6 +674,8 @@ int asd_init_hw(struct asd_ha_struct *asd_ha)
658 goto Out; 674 goto Out;
659 } 675 }
660 676
677 asd_init_ports(asd_ha);
678
661 err = asd_init_scbs(asd_ha); 679 err = asd_init_scbs(asd_ha);
662 if (err) { 680 if (err) {
663 asd_printk("couldn't initialize scbs for %s\n", 681 asd_printk("couldn't initialize scbs for %s\n",
diff --git a/drivers/scsi/aic94xx/aic94xx_hwi.h b/drivers/scsi/aic94xx/aic94xx_hwi.h
index 7b6aca02cf70..c6c3d18222fa 100644
--- a/drivers/scsi/aic94xx/aic94xx_hwi.h
+++ b/drivers/scsi/aic94xx/aic94xx_hwi.h
@@ -193,6 +193,16 @@ struct asd_seq_data {
193 struct asd_ascb **escb_arr; /* array of pointers to escbs */ 193 struct asd_ascb **escb_arr; /* array of pointers to escbs */
194}; 194};
195 195
196/* This is an internal port structure. These are used to get accurate
197 * phy_mask for updating DDB 0.
198 */
199struct asd_port {
200 u8 sas_addr[SAS_ADDR_SIZE];
201 u8 attached_sas_addr[SAS_ADDR_SIZE];
202 u32 phy_mask;
203 int num_phys;
204};
205
196/* This is the Host Adapter structure. It describes the hardware 206/* This is the Host Adapter structure. It describes the hardware
197 * SAS adapter. 207 * SAS adapter.
198 */ 208 */
@@ -211,6 +221,8 @@ struct asd_ha_struct {
211 struct hw_profile hw_prof; 221 struct hw_profile hw_prof;
212 222
213 struct asd_phy phys[ASD_MAX_PHYS]; 223 struct asd_phy phys[ASD_MAX_PHYS];
224 spinlock_t asd_ports_lock;
225 struct asd_port asd_ports[ASD_MAX_PHYS];
214 struct asd_sas_port ports[ASD_MAX_PHYS]; 226 struct asd_sas_port ports[ASD_MAX_PHYS];
215 227
216 struct dma_pool *scb_pool; 228 struct dma_pool *scb_pool;
diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c
index a4cc432bbdab..57c5ba4043f2 100644
--- a/drivers/scsi/aic94xx/aic94xx_init.c
+++ b/drivers/scsi/aic94xx/aic94xx_init.c
@@ -786,8 +786,6 @@ static void asd_remove_driver_attrs(struct device_driver *driver)
786} 786}
787 787
788static struct sas_domain_function_template aic94xx_transport_functions = { 788static struct sas_domain_function_template aic94xx_transport_functions = {
789 .lldd_port_formed = asd_update_port_links,
790
791 .lldd_dev_found = asd_dev_found, 789 .lldd_dev_found = asd_dev_found,
792 .lldd_dev_gone = asd_dev_gone, 790 .lldd_dev_gone = asd_dev_gone,
793 791
diff --git a/drivers/scsi/aic94xx/aic94xx_sas.h b/drivers/scsi/aic94xx/aic94xx_sas.h
index 64d231712345..9050e93bfd5e 100644
--- a/drivers/scsi/aic94xx/aic94xx_sas.h
+++ b/drivers/scsi/aic94xx/aic94xx_sas.h
@@ -733,6 +733,7 @@ struct asd_phy {
733 733
734 struct sas_identify_frame *identify_frame; 734 struct sas_identify_frame *identify_frame;
735 struct asd_dma_tok *id_frm_tok; 735 struct asd_dma_tok *id_frm_tok;
736 struct asd_port *asd_port;
736 737
737 u8 frame_rcvd[ASD_EDB_SIZE]; 738 u8 frame_rcvd[ASD_EDB_SIZE];
738}; 739};
diff --git a/drivers/scsi/aic94xx/aic94xx_scb.c b/drivers/scsi/aic94xx/aic94xx_scb.c
index 7ee49b51b724..b15caf1c8fa2 100644
--- a/drivers/scsi/aic94xx/aic94xx_scb.c
+++ b/drivers/scsi/aic94xx/aic94xx_scb.c
@@ -168,6 +168,70 @@ static inline void asd_get_attached_sas_addr(struct asd_phy *phy, u8 *sas_addr)
168 } 168 }
169} 169}
170 170
171static void asd_form_port(struct asd_ha_struct *asd_ha, struct asd_phy *phy)
172{
173 int i;
174 struct asd_port *free_port = NULL;
175 struct asd_port *port;
176 struct asd_sas_phy *sas_phy = &phy->sas_phy;
177 unsigned long flags;
178
179 spin_lock_irqsave(&asd_ha->asd_ports_lock, flags);
180 if (!phy->asd_port) {
181 for (i = 0; i < ASD_MAX_PHYS; i++) {
182 port = &asd_ha->asd_ports[i];
183
184 /* Check for wide port */
185 if (port->num_phys > 0 &&
186 memcmp(port->sas_addr, sas_phy->sas_addr,
187 SAS_ADDR_SIZE) == 0 &&
188 memcmp(port->attached_sas_addr,
189 sas_phy->attached_sas_addr,
190 SAS_ADDR_SIZE) == 0) {
191 break;
192 }
193
194 /* Find a free port */
195 if (port->num_phys == 0 && free_port == NULL) {
196 free_port = port;
197 }
198 }
199
200 /* Use a free port if this doesn't form a wide port */
201 if (i >= ASD_MAX_PHYS) {
202 port = free_port;
203 BUG_ON(!port);
204 memcpy(port->sas_addr, sas_phy->sas_addr,
205 SAS_ADDR_SIZE);
206 memcpy(port->attached_sas_addr,
207 sas_phy->attached_sas_addr,
208 SAS_ADDR_SIZE);
209 }
210 port->num_phys++;
211 port->phy_mask |= (1U << sas_phy->id);
212 phy->asd_port = port;
213 }
214 ASD_DPRINTK("%s: updating phy_mask 0x%x for phy%d\n",
215 __FUNCTION__, phy->asd_port->phy_mask, sas_phy->id);
216 asd_update_port_links(asd_ha, phy);
217 spin_unlock_irqrestore(&asd_ha->asd_ports_lock, flags);
218}
219
220static void asd_deform_port(struct asd_ha_struct *asd_ha, struct asd_phy *phy)
221{
222 struct asd_port *port = phy->asd_port;
223 struct asd_sas_phy *sas_phy = &phy->sas_phy;
224 unsigned long flags;
225
226 spin_lock_irqsave(&asd_ha->asd_ports_lock, flags);
227 if (port) {
228 port->num_phys--;
229 port->phy_mask &= ~(1U << sas_phy->id);
230 phy->asd_port = NULL;
231 }
232 spin_unlock_irqrestore(&asd_ha->asd_ports_lock, flags);
233}
234
171static inline void asd_bytes_dmaed_tasklet(struct asd_ascb *ascb, 235static inline void asd_bytes_dmaed_tasklet(struct asd_ascb *ascb,
172 struct done_list_struct *dl, 236 struct done_list_struct *dl,
173 int edb_id, int phy_id) 237 int edb_id, int phy_id)
@@ -187,6 +251,7 @@ static inline void asd_bytes_dmaed_tasklet(struct asd_ascb *ascb,
187 asd_get_attached_sas_addr(phy, phy->sas_phy.attached_sas_addr); 251 asd_get_attached_sas_addr(phy, phy->sas_phy.attached_sas_addr);
188 spin_unlock_irqrestore(&phy->sas_phy.frame_rcvd_lock, flags); 252 spin_unlock_irqrestore(&phy->sas_phy.frame_rcvd_lock, flags);
189 asd_dump_frame_rcvd(phy, dl); 253 asd_dump_frame_rcvd(phy, dl);
254 asd_form_port(ascb->ha, phy);
190 sas_ha->notify_port_event(&phy->sas_phy, PORTE_BYTES_DMAED); 255 sas_ha->notify_port_event(&phy->sas_phy, PORTE_BYTES_DMAED);
191} 256}
192 257
@@ -197,6 +262,7 @@ static inline void asd_link_reset_err_tasklet(struct asd_ascb *ascb,
197 struct asd_ha_struct *asd_ha = ascb->ha; 262 struct asd_ha_struct *asd_ha = ascb->ha;
198 struct sas_ha_struct *sas_ha = &asd_ha->sas_ha; 263 struct sas_ha_struct *sas_ha = &asd_ha->sas_ha;
199 struct asd_sas_phy *sas_phy = sas_ha->sas_phy[phy_id]; 264 struct asd_sas_phy *sas_phy = sas_ha->sas_phy[phy_id];
265 struct asd_phy *phy = &asd_ha->phys[phy_id];
200 u8 lr_error = dl->status_block[1]; 266 u8 lr_error = dl->status_block[1];
201 u8 retries_left = dl->status_block[2]; 267 u8 retries_left = dl->status_block[2];
202 268
@@ -221,6 +287,7 @@ static inline void asd_link_reset_err_tasklet(struct asd_ascb *ascb,
221 287
222 asd_turn_led(asd_ha, phy_id, 0); 288 asd_turn_led(asd_ha, phy_id, 0);
223 sas_phy_disconnected(sas_phy); 289 sas_phy_disconnected(sas_phy);
290 asd_deform_port(asd_ha, phy);
224 sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR); 291 sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
225 292
226 if (retries_left == 0) { 293 if (retries_left == 0) {
@@ -248,6 +315,8 @@ static inline void asd_primitive_rcvd_tasklet(struct asd_ascb *ascb,
248 unsigned long flags; 315 unsigned long flags;
249 struct sas_ha_struct *sas_ha = &ascb->ha->sas_ha; 316 struct sas_ha_struct *sas_ha = &ascb->ha->sas_ha;
250 struct asd_sas_phy *sas_phy = sas_ha->sas_phy[phy_id]; 317 struct asd_sas_phy *sas_phy = sas_ha->sas_phy[phy_id];
318 struct asd_ha_struct *asd_ha = ascb->ha;
319 struct asd_phy *phy = &asd_ha->phys[phy_id];
251 u8 reg = dl->status_block[1]; 320 u8 reg = dl->status_block[1];
252 u32 cont = dl->status_block[2] << ((reg & 3)*8); 321 u32 cont = dl->status_block[2] << ((reg & 3)*8);
253 322
@@ -284,6 +353,7 @@ static inline void asd_primitive_rcvd_tasklet(struct asd_ascb *ascb,
284 phy_id); 353 phy_id);
285 /* The sequencer disables all phys on that port. 354 /* The sequencer disables all phys on that port.
286 * We have to re-enable the phys ourselves. */ 355 * We have to re-enable the phys ourselves. */
356 asd_deform_port(asd_ha, phy);
287 sas_ha->notify_port_event(sas_phy, PORTE_HARD_RESET); 357 sas_ha->notify_port_event(sas_phy, PORTE_HARD_RESET);
288 break; 358 break;
289 359
@@ -351,6 +421,7 @@ static void escb_tasklet_complete(struct asd_ascb *ascb,
351 u8 sb_opcode = dl->status_block[0]; 421 u8 sb_opcode = dl->status_block[0];
352 int phy_id = sb_opcode & DL_PHY_MASK; 422 int phy_id = sb_opcode & DL_PHY_MASK;
353 struct asd_sas_phy *sas_phy = sas_ha->sas_phy[phy_id]; 423 struct asd_sas_phy *sas_phy = sas_ha->sas_phy[phy_id];
424 struct asd_phy *phy = &asd_ha->phys[phy_id];
354 425
355 if (edb > 6 || edb < 0) { 426 if (edb > 6 || edb < 0) {
356 ASD_DPRINTK("edb is 0x%x! dl->opcode is 0x%x\n", 427 ASD_DPRINTK("edb is 0x%x! dl->opcode is 0x%x\n",
@@ -395,6 +466,7 @@ static void escb_tasklet_complete(struct asd_ascb *ascb,
395 asd_turn_led(asd_ha, phy_id, 0); 466 asd_turn_led(asd_ha, phy_id, 0);
396 /* the device is gone */ 467 /* the device is gone */
397 sas_phy_disconnected(sas_phy); 468 sas_phy_disconnected(sas_phy);
469 asd_deform_port(asd_ha, phy);
398 sas_ha->notify_port_event(sas_phy, PORTE_TIMER_EVENT); 470 sas_ha->notify_port_event(sas_phy, PORTE_TIMER_EVENT);
399 break; 471 break;
400 case REQ_TASK_ABORT: 472 case REQ_TASK_ABORT:
diff --git a/drivers/scsi/aic94xx/aic94xx_seq.c b/drivers/scsi/aic94xx/aic94xx_seq.c
index 56e4b3ba6a08..845112539d05 100644
--- a/drivers/scsi/aic94xx/aic94xx_seq.c
+++ b/drivers/scsi/aic94xx/aic94xx_seq.c
@@ -1369,10 +1369,9 @@ int asd_start_seqs(struct asd_ha_struct *asd_ha)
1369 * port_map_by_links is also used as the conn_mask byte in the 1369 * port_map_by_links is also used as the conn_mask byte in the
1370 * initiator/target port DDB. 1370 * initiator/target port DDB.
1371 */ 1371 */
1372void asd_update_port_links(struct asd_sas_phy *sas_phy) 1372void asd_update_port_links(struct asd_ha_struct *asd_ha, struct asd_phy *phy)
1373{ 1373{
1374 struct asd_ha_struct *asd_ha = sas_phy->ha->lldd_ha; 1374 const u8 phy_mask = (u8) phy->asd_port->phy_mask;
1375 const u8 phy_mask = (u8) sas_phy->port->phy_mask;
1376 u8 phy_is_up; 1375 u8 phy_is_up;
1377 u8 mask; 1376 u8 mask;
1378 int i, err; 1377 int i, err;
diff --git a/drivers/scsi/aic94xx/aic94xx_seq.h b/drivers/scsi/aic94xx/aic94xx_seq.h
index 42281c36153b..9e715e5496af 100644
--- a/drivers/scsi/aic94xx/aic94xx_seq.h
+++ b/drivers/scsi/aic94xx/aic94xx_seq.h
@@ -64,7 +64,7 @@ int asd_unpause_lseq(struct asd_ha_struct *asd_ha, u8 lseq_mask);
64int asd_init_seqs(struct asd_ha_struct *asd_ha); 64int asd_init_seqs(struct asd_ha_struct *asd_ha);
65int asd_start_seqs(struct asd_ha_struct *asd_ha); 65int asd_start_seqs(struct asd_ha_struct *asd_ha);
66 66
67void asd_update_port_links(struct asd_sas_phy *phy); 67void asd_update_port_links(struct asd_ha_struct *asd_ha, struct asd_phy *phy);
68#endif 68#endif
69 69
70#endif 70#endif
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
index 4bc14ad92e22..4c698a71f66f 100644
--- a/drivers/scsi/gdth.c
+++ b/drivers/scsi/gdth.c
@@ -3531,7 +3531,7 @@ static irqreturn_t gdth_interrupt(int irq,void *dev_id)
3531 IStatus &= ~0x80; 3531 IStatus &= ~0x80;
3532#ifdef INT_COAL 3532#ifdef INT_COAL
3533 if (coalesced) 3533 if (coalesced)
3534 ha->status = pcs->ext_status && 0xffff; 3534 ha->status = pcs->ext_status & 0xffff;
3535 else 3535 else
3536#endif 3536#endif
3537 ha->status = gdth_readw(&dp6m_ptr->i960r.status); 3537 ha->status = gdth_readw(&dp6m_ptr->i960r.status);
@@ -3543,7 +3543,7 @@ static irqreturn_t gdth_interrupt(int irq,void *dev_id)
3543 if (coalesced) { 3543 if (coalesced) {
3544 ha->info = pcs->info0; 3544 ha->info = pcs->info0;
3545 ha->info2 = pcs->info1; 3545 ha->info2 = pcs->info1;
3546 ha->service = (pcs->ext_status >> 16) && 0xffff; 3546 ha->service = (pcs->ext_status >> 16) & 0xffff;
3547 } else 3547 } else
3548#endif 3548#endif
3549 { 3549 {
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index 0a9dbc59663f..d0b139cccbbc 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -415,8 +415,8 @@ iscsi_r2t_rsp(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask)
415 iscsi_solicit_data_init(conn, ctask, r2t); 415 iscsi_solicit_data_init(conn, ctask, r2t);
416 416
417 tcp_ctask->exp_r2tsn = r2tsn + 1; 417 tcp_ctask->exp_r2tsn = r2tsn + 1;
418 tcp_ctask->xmstate |= XMSTATE_SOL_HDR;
419 __kfifo_put(tcp_ctask->r2tqueue, (void*)&r2t, sizeof(void*)); 418 __kfifo_put(tcp_ctask->r2tqueue, (void*)&r2t, sizeof(void*));
419 tcp_ctask->xmstate |= XMSTATE_SOL_HDR;
420 list_move_tail(&ctask->running, &conn->xmitqueue); 420 list_move_tail(&ctask->running, &conn->xmitqueue);
421 421
422 scsi_queue_work(session->host, &conn->xmitwork); 422 scsi_queue_work(session->host, &conn->xmitwork);
@@ -1627,9 +1627,12 @@ static int iscsi_send_sol_pdu(struct iscsi_conn *conn,
1627 if (tcp_ctask->xmstate & XMSTATE_SOL_HDR) { 1627 if (tcp_ctask->xmstate & XMSTATE_SOL_HDR) {
1628 tcp_ctask->xmstate &= ~XMSTATE_SOL_HDR; 1628 tcp_ctask->xmstate &= ~XMSTATE_SOL_HDR;
1629 tcp_ctask->xmstate |= XMSTATE_SOL_DATA; 1629 tcp_ctask->xmstate |= XMSTATE_SOL_DATA;
1630 if (!tcp_ctask->r2t) 1630 if (!tcp_ctask->r2t) {
1631 spin_lock_bh(&session->lock);
1631 __kfifo_get(tcp_ctask->r2tqueue, (void*)&tcp_ctask->r2t, 1632 __kfifo_get(tcp_ctask->r2tqueue, (void*)&tcp_ctask->r2t,
1632 sizeof(void*)); 1633 sizeof(void*));
1634 spin_unlock_bh(&session->lock);
1635 }
1633send_hdr: 1636send_hdr:
1634 r2t = tcp_ctask->r2t; 1637 r2t = tcp_ctask->r2t;
1635 dtask = &r2t->dtask; 1638 dtask = &r2t->dtask;
@@ -1816,21 +1819,14 @@ iscsi_tcp_conn_destroy(struct iscsi_cls_conn *cls_conn)
1816{ 1819{
1817 struct iscsi_conn *conn = cls_conn->dd_data; 1820 struct iscsi_conn *conn = cls_conn->dd_data;
1818 struct iscsi_tcp_conn *tcp_conn = conn->dd_data; 1821 struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
1819 int digest = 0;
1820
1821 if (conn->hdrdgst_en || conn->datadgst_en)
1822 digest = 1;
1823 1822
1824 iscsi_tcp_release_conn(conn); 1823 iscsi_tcp_release_conn(conn);
1825 iscsi_conn_teardown(cls_conn); 1824 iscsi_conn_teardown(cls_conn);
1826 1825
1827 /* now free tcp_conn */ 1826 if (tcp_conn->tx_hash.tfm)
1828 if (digest) { 1827 crypto_free_hash(tcp_conn->tx_hash.tfm);
1829 if (tcp_conn->tx_hash.tfm) 1828 if (tcp_conn->rx_hash.tfm)
1830 crypto_free_hash(tcp_conn->tx_hash.tfm); 1829 crypto_free_hash(tcp_conn->rx_hash.tfm);
1831 if (tcp_conn->rx_hash.tfm)
1832 crypto_free_hash(tcp_conn->rx_hash.tfm);
1833 }
1834 1830
1835 kfree(tcp_conn); 1831 kfree(tcp_conn);
1836} 1832}
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 2865ebd557ef..5d8862189485 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -975,13 +975,13 @@ int iscsi_eh_host_reset(struct scsi_cmnd *sc)
975 if (session->state == ISCSI_STATE_TERMINATE) { 975 if (session->state == ISCSI_STATE_TERMINATE) {
976failed: 976failed:
977 debug_scsi("failing host reset: session terminated " 977 debug_scsi("failing host reset: session terminated "
978 "[CID %d age %d]", conn->id, session->age); 978 "[CID %d age %d]\n", conn->id, session->age);
979 spin_unlock_bh(&session->lock); 979 spin_unlock_bh(&session->lock);
980 return FAILED; 980 return FAILED;
981 } 981 }
982 982
983 if (sc->SCp.phase == session->age) { 983 if (sc->SCp.phase == session->age) {
984 debug_scsi("failing connection CID %d due to SCSI host reset", 984 debug_scsi("failing connection CID %d due to SCSI host reset\n",
985 conn->id); 985 conn->id);
986 fail_session = 1; 986 fail_session = 1;
987 } 987 }
@@ -1054,7 +1054,8 @@ static int iscsi_exec_abort_task(struct scsi_cmnd *sc,
1054 NULL, 0); 1054 NULL, 0);
1055 if (rc) { 1055 if (rc) {
1056 iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); 1056 iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
1057 debug_scsi("abort sent failure [itt 0x%x] %d", ctask->itt, rc); 1057 debug_scsi("abort sent failure [itt 0x%x] %d\n", ctask->itt,
1058 rc);
1058 return rc; 1059 return rc;
1059 } 1060 }
1060 1061
@@ -1071,7 +1072,7 @@ static int iscsi_exec_abort_task(struct scsi_cmnd *sc,
1071 conn->tmabort_timer.function = iscsi_tmabort_timedout; 1072 conn->tmabort_timer.function = iscsi_tmabort_timedout;
1072 conn->tmabort_timer.data = (unsigned long)ctask; 1073 conn->tmabort_timer.data = (unsigned long)ctask;
1073 add_timer(&conn->tmabort_timer); 1074 add_timer(&conn->tmabort_timer);
1074 debug_scsi("abort set timeout [itt 0x%x]", ctask->itt); 1075 debug_scsi("abort set timeout [itt 0x%x]\n", ctask->itt);
1075 } 1076 }
1076 spin_unlock_bh(&session->lock); 1077 spin_unlock_bh(&session->lock);
1077 mutex_unlock(&conn->xmitmutex); 1078 mutex_unlock(&conn->xmitmutex);
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index 30b8014bcc7a..e34a93435497 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -71,55 +71,65 @@ static void smp_task_done(struct sas_task *task)
71static int smp_execute_task(struct domain_device *dev, void *req, int req_size, 71static int smp_execute_task(struct domain_device *dev, void *req, int req_size,
72 void *resp, int resp_size) 72 void *resp, int resp_size)
73{ 73{
74 int res; 74 int res, retry;
75 struct sas_task *task = sas_alloc_task(GFP_KERNEL); 75 struct sas_task *task = NULL;
76 struct sas_internal *i = 76 struct sas_internal *i =
77 to_sas_internal(dev->port->ha->core.shost->transportt); 77 to_sas_internal(dev->port->ha->core.shost->transportt);
78 78
79 if (!task) 79 for (retry = 0; retry < 3; retry++) {
80 return -ENOMEM; 80 task = sas_alloc_task(GFP_KERNEL);
81 81 if (!task)
82 task->dev = dev; 82 return -ENOMEM;
83 task->task_proto = dev->tproto;
84 sg_init_one(&task->smp_task.smp_req, req, req_size);
85 sg_init_one(&task->smp_task.smp_resp, resp, resp_size);
86 83
87 task->task_done = smp_task_done; 84 task->dev = dev;
85 task->task_proto = dev->tproto;
86 sg_init_one(&task->smp_task.smp_req, req, req_size);
87 sg_init_one(&task->smp_task.smp_resp, resp, resp_size);
88 88
89 task->timer.data = (unsigned long) task; 89 task->task_done = smp_task_done;
90 task->timer.function = smp_task_timedout;
91 task->timer.expires = jiffies + SMP_TIMEOUT*HZ;
92 add_timer(&task->timer);
93 90
94 res = i->dft->lldd_execute_task(task, 1, GFP_KERNEL); 91 task->timer.data = (unsigned long) task;
92 task->timer.function = smp_task_timedout;
93 task->timer.expires = jiffies + SMP_TIMEOUT*HZ;
94 add_timer(&task->timer);
95 95
96 if (res) { 96 res = i->dft->lldd_execute_task(task, 1, GFP_KERNEL);
97 del_timer(&task->timer);
98 SAS_DPRINTK("executing SMP task failed:%d\n", res);
99 goto ex_err;
100 }
101 97
102 wait_for_completion(&task->completion); 98 if (res) {
103 res = -ETASK; 99 del_timer(&task->timer);
104 if ((task->task_state_flags & SAS_TASK_STATE_ABORTED)) { 100 SAS_DPRINTK("executing SMP task failed:%d\n", res);
105 SAS_DPRINTK("smp task timed out or aborted\n");
106 i->dft->lldd_abort_task(task);
107 if (!(task->task_state_flags & SAS_TASK_STATE_DONE)) {
108 SAS_DPRINTK("SMP task aborted and not done\n");
109 goto ex_err; 101 goto ex_err;
110 } 102 }
103
104 wait_for_completion(&task->completion);
105 res = -ETASK;
106 if ((task->task_state_flags & SAS_TASK_STATE_ABORTED)) {
107 SAS_DPRINTK("smp task timed out or aborted\n");
108 i->dft->lldd_abort_task(task);
109 if (!(task->task_state_flags & SAS_TASK_STATE_DONE)) {
110 SAS_DPRINTK("SMP task aborted and not done\n");
111 goto ex_err;
112 }
113 }
114 if (task->task_status.resp == SAS_TASK_COMPLETE &&
115 task->task_status.stat == SAM_GOOD) {
116 res = 0;
117 break;
118 } else {
119 SAS_DPRINTK("%s: task to dev %016llx response: 0x%x "
120 "status 0x%x\n", __FUNCTION__,
121 SAS_ADDR(dev->sas_addr),
122 task->task_status.resp,
123 task->task_status.stat);
124 sas_free_task(task);
125 task = NULL;
126 }
111 } 127 }
112 if (task->task_status.resp == SAS_TASK_COMPLETE &&
113 task->task_status.stat == SAM_GOOD)
114 res = 0;
115 else
116 SAS_DPRINTK("%s: task to dev %016llx response: 0x%x "
117 "status 0x%x\n", __FUNCTION__,
118 SAS_ADDR(dev->sas_addr),
119 task->task_status.resp,
120 task->task_status.stat);
121ex_err: 128ex_err:
122 sas_free_task(task); 129 BUG_ON(retry == 3 && task != NULL);
130 if (task != NULL) {
131 sas_free_task(task);
132 }
123 return res; 133 return res;
124} 134}
125 135
diff --git a/drivers/scsi/psi240i.c b/drivers/scsi/psi240i.c
index ac0419e2714a..899e89d6fe67 100644
--- a/drivers/scsi/psi240i.c
+++ b/drivers/scsi/psi240i.c
@@ -328,7 +328,7 @@ static void Irq_Handler (int irq, void *dev_id)
328 pinquiryData->AdditionalLength = 35 - 4; 328 pinquiryData->AdditionalLength = 35 - 4;
329 329
330 // Fill in vendor identification fields. 330 // Fill in vendor identification fields.
331 for ( z = 0; z < 20; z += 2 ) 331 for ( z = 0; z < 8; z += 2 )
332 { 332 {
333 pinquiryData->VendorId[z] = ((UCHAR *)identifyData.ModelNumber)[z + 1]; 333 pinquiryData->VendorId[z] = ((UCHAR *)identifyData.ModelNumber)[z + 1];
334 pinquiryData->VendorId[z + 1] = ((UCHAR *)identifyData.ModelNumber)[z]; 334 pinquiryData->VendorId[z + 1] = ((UCHAR *)identifyData.ModelNumber)[z];
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index d2c02df12fdc..3ac4890ce086 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -410,6 +410,7 @@ int scsi_execute_async(struct scsi_device *sdev, const unsigned char *cmd,
410 goto free_req; 410 goto free_req;
411 411
412 req->cmd_len = cmd_len; 412 req->cmd_len = cmd_len;
413 memset(req->cmd, 0, BLK_MAX_CDB); /* ATAPI hates garbage after CDB */
413 memcpy(req->cmd, cmd, req->cmd_len); 414 memcpy(req->cmd, cmd, req->cmd_len);
414 req->sense = sioc->sense; 415 req->sense = sioc->sense;
415 req->sense_len = 0; 416 req->sense_len = 0;
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index 2d3baa99ca25..9b25124a989e 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -33,7 +33,7 @@
33#define ISCSI_SESSION_ATTRS 11 33#define ISCSI_SESSION_ATTRS 11
34#define ISCSI_CONN_ATTRS 11 34#define ISCSI_CONN_ATTRS 11
35#define ISCSI_HOST_ATTRS 0 35#define ISCSI_HOST_ATTRS 0
36#define ISCSI_TRANSPORT_VERSION "2.0-685" 36#define ISCSI_TRANSPORT_VERSION "2.0-724"
37 37
38struct iscsi_internal { 38struct iscsi_internal {
39 int daemon_pid; 39 int daemon_pid;
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 3f8b93188567..81e3bc7b02a1 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -60,7 +60,7 @@ static int sg_version_num = 30534; /* 2 digits for each component */
60 60
61#ifdef CONFIG_SCSI_PROC_FS 61#ifdef CONFIG_SCSI_PROC_FS
62#include <linux/proc_fs.h> 62#include <linux/proc_fs.h>
63static char *sg_version_date = "20060920"; 63static char *sg_version_date = "20061027";
64 64
65static int sg_proc_init(void); 65static int sg_proc_init(void);
66static void sg_proc_cleanup(void); 66static void sg_proc_cleanup(void);
@@ -710,12 +710,12 @@ sg_common_write(Sg_fd * sfp, Sg_request * srp,
710 (int) cmnd[0], (int) hp->cmd_len)); 710 (int) cmnd[0], (int) hp->cmd_len));
711 711
712 if ((k = sg_start_req(srp))) { 712 if ((k = sg_start_req(srp))) {
713 SCSI_LOG_TIMEOUT(1, printk("sg_write: start_req err=%d\n", k)); 713 SCSI_LOG_TIMEOUT(1, printk("sg_common_write: start_req err=%d\n", k));
714 sg_finish_rem_req(srp); 714 sg_finish_rem_req(srp);
715 return k; /* probably out of space --> ENOMEM */ 715 return k; /* probably out of space --> ENOMEM */
716 } 716 }
717 if ((k = sg_write_xfer(srp))) { 717 if ((k = sg_write_xfer(srp))) {
718 SCSI_LOG_TIMEOUT(1, printk("sg_write: write_xfer, bad address\n")); 718 SCSI_LOG_TIMEOUT(1, printk("sg_common_write: write_xfer, bad address\n"));
719 sg_finish_rem_req(srp); 719 sg_finish_rem_req(srp);
720 return k; 720 return k;
721 } 721 }
@@ -746,7 +746,7 @@ sg_common_write(Sg_fd * sfp, Sg_request * srp,
746 hp->dxfer_len, srp->data.k_use_sg, timeout, 746 hp->dxfer_len, srp->data.k_use_sg, timeout,
747 SG_DEFAULT_RETRIES, srp, sg_cmd_done, 747 SG_DEFAULT_RETRIES, srp, sg_cmd_done,
748 GFP_ATOMIC)) { 748 GFP_ATOMIC)) {
749 SCSI_LOG_TIMEOUT(1, printk("sg_write: scsi_execute_async failed\n")); 749 SCSI_LOG_TIMEOUT(1, printk("sg_common_write: scsi_execute_async failed\n"));
750 /* 750 /*
751 * most likely out of mem, but could also be a bad map 751 * most likely out of mem, but could also be a bad map
752 */ 752 */
@@ -1283,7 +1283,7 @@ sg_cmd_done(void *data, char *sense, int result, int resid)
1283 sg_finish_rem_req(srp); 1283 sg_finish_rem_req(srp);
1284 srp = NULL; 1284 srp = NULL;
1285 if (NULL == sfp->headrp) { 1285 if (NULL == sfp->headrp) {
1286 SCSI_LOG_TIMEOUT(1, printk("sg...bh: already closed, final cleanup\n")); 1286 SCSI_LOG_TIMEOUT(1, printk("sg_cmd_done: already closed, final cleanup\n"));
1287 if (0 == sg_remove_sfp(sdp, sfp)) { /* device still present */ 1287 if (0 == sg_remove_sfp(sdp, sfp)) { /* device still present */
1288 scsi_device_put(sdp->device); 1288 scsi_device_put(sdp->device);
1289 } 1289 }
@@ -1512,12 +1512,12 @@ sg_remove(struct class_device *cl_dev, struct class_interface *cl_intf)
1512 POLL_HUP); 1512 POLL_HUP);
1513 } 1513 }
1514 } 1514 }
1515 SCSI_LOG_TIMEOUT(3, printk("sg_detach: dev=%d, dirty\n", k)); 1515 SCSI_LOG_TIMEOUT(3, printk("sg_remove: dev=%d, dirty\n", k));
1516 if (NULL == sdp->headfp) { 1516 if (NULL == sdp->headfp) {
1517 sg_dev_arr[k] = NULL; 1517 sg_dev_arr[k] = NULL;
1518 } 1518 }
1519 } else { /* nothing active, simple case */ 1519 } else { /* nothing active, simple case */
1520 SCSI_LOG_TIMEOUT(3, printk("sg_detach: dev=%d\n", k)); 1520 SCSI_LOG_TIMEOUT(3, printk("sg_remove: dev=%d\n", k));
1521 sg_dev_arr[k] = NULL; 1521 sg_dev_arr[k] = NULL;
1522 } 1522 }
1523 sg_nr_dev--; 1523 sg_nr_dev--;
@@ -1876,14 +1876,15 @@ sg_build_indirect(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size)
1876 } 1876 }
1877 } 1877 }
1878 sg->page = p; 1878 sg->page = p;
1879 sg->length = ret_sz; 1879 sg->length = (ret_sz > num) ? num : ret_sz;
1880 1880
1881 SCSI_LOG_TIMEOUT(5, printk("sg_build_build: k=%d, a=0x%p, len=%d\n", 1881 SCSI_LOG_TIMEOUT(5, printk("sg_build_indirect: k=%d, num=%d, "
1882 k, p, ret_sz)); 1882 "ret_sz=%d\n", k, num, ret_sz));
1883 } /* end of for loop */ 1883 } /* end of for loop */
1884 1884
1885 schp->k_use_sg = k; 1885 schp->k_use_sg = k;
1886 SCSI_LOG_TIMEOUT(5, printk("sg_build_indirect: k_use_sg=%d, rem_sz=%d\n", k, rem_sz)); 1886 SCSI_LOG_TIMEOUT(5, printk("sg_build_indirect: k_use_sg=%d, "
1887 "rem_sz=%d\n", k, rem_sz));
1887 1888
1888 schp->bufflen = blk_size; 1889 schp->bufflen = blk_size;
1889 if (rem_sz > 0) /* must have failed */ 1890 if (rem_sz > 0) /* must have failed */
@@ -2014,7 +2015,7 @@ sg_remove_scat(Sg_scatter_hold * schp)
2014 for (k = 0; (k < schp->k_use_sg) && sg->page; 2015 for (k = 0; (k < schp->k_use_sg) && sg->page;
2015 ++k, ++sg) { 2016 ++k, ++sg) {
2016 SCSI_LOG_TIMEOUT(5, printk( 2017 SCSI_LOG_TIMEOUT(5, printk(
2017 "sg_remove_scat: k=%d, a=0x%p, len=%d\n", 2018 "sg_remove_scat: k=%d, pg=0x%p, len=%d\n",
2018 k, sg->page, sg->length)); 2019 k, sg->page, sg->length));
2019 sg_page_free(sg->page, sg->length); 2020 sg_page_free(sg->page, sg->length);
2020 } 2021 }
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index fccd1952bad3..7729c0744886 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -828,10 +828,7 @@ char *usb_cache_string(struct usb_device *udev, int index)
828 * Context: !in_interrupt () 828 * Context: !in_interrupt ()
829 * 829 *
830 * Updates the copy of the device descriptor stored in the device structure, 830 * Updates the copy of the device descriptor stored in the device structure,
831 * which dedicates space for this purpose. Note that several fields are 831 * which dedicates space for this purpose.
832 * converted to the host CPU's byte order: the USB version (bcdUSB), and
833 * vendors product and version fields (idVendor, idProduct, and bcdDevice).
834 * That lets device drivers compare against non-byteswapped constants.
835 * 832 *
836 * Not exported, only for use by the core. If drivers really want to read 833 * Not exported, only for use by the core. If drivers really want to read
837 * the device descriptor directly, they can call usb_get_descriptor() with 834 * the device descriptor directly, they can call usb_get_descriptor() with
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 9be6b303e784..ea4714e557e4 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -715,13 +715,6 @@ static irqreturn_t ohci_irq (struct usb_hcd *hcd)
715 return IRQ_NOTMINE; 715 return IRQ_NOTMINE;
716 } 716 }
717 717
718 if (ints & OHCI_INTR_RHSC) {
719 ohci_vdbg (ohci, "rhsc\n");
720 ohci->next_statechange = jiffies + STATECHANGE_DELAY;
721 ohci_writel (ohci, OHCI_INTR_RHSC, &regs->intrstatus);
722 usb_hcd_poll_rh_status(hcd);
723 }
724
725 if (ints & OHCI_INTR_UE) { 718 if (ints & OHCI_INTR_UE) {
726 disable (ohci); 719 disable (ohci);
727 ohci_err (ohci, "OHCI Unrecoverable Error, disabled\n"); 720 ohci_err (ohci, "OHCI Unrecoverable Error, disabled\n");
@@ -731,9 +724,21 @@ static irqreturn_t ohci_irq (struct usb_hcd *hcd)
731 ohci_usb_reset (ohci); 724 ohci_usb_reset (ohci);
732 } 725 }
733 726
734 if (ints & OHCI_INTR_RD) { 727 if (ints & OHCI_INTR_RHSC) {
735 ohci_vdbg (ohci, "resume detect\n"); 728 ohci_vdbg(ohci, "rhsc\n");
736 ohci_writel (ohci, OHCI_INTR_RD, &regs->intrstatus); 729 ohci->next_statechange = jiffies + STATECHANGE_DELAY;
730 ohci_writel(ohci, OHCI_INTR_RD | OHCI_INTR_RHSC,
731 &regs->intrstatus);
732 usb_hcd_poll_rh_status(hcd);
733 }
734
735 /* For connect and disconnect events, we expect the controller
736 * to turn on RHSC along with RD. But for remote wakeup events
737 * this might not happen.
738 */
739 else if (ints & OHCI_INTR_RD) {
740 ohci_vdbg(ohci, "resume detect\n");
741 ohci_writel(ohci, OHCI_INTR_RD, &regs->intrstatus);
737 hcd->poll_rh = 1; 742 hcd->poll_rh = 1;
738 if (ohci->autostop) { 743 if (ohci->autostop) {
739 spin_lock (&ohci->lock); 744 spin_lock (&ohci->lock);
diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c
index 6f113596af66..6995ea36f2e8 100644
--- a/drivers/usb/host/ohci-hub.c
+++ b/drivers/usb/host/ohci-hub.c
@@ -169,7 +169,8 @@ __acquires(ohci->lock)
169 break; 169 break;
170 case OHCI_USB_RESUME: 170 case OHCI_USB_RESUME:
171 /* HCFS changes sometime after INTR_RD */ 171 /* HCFS changes sometime after INTR_RD */
172 ohci_info (ohci, "wakeup\n"); 172 ohci_info(ohci, "%swakeup\n",
173 autostopped ? "auto-" : "");
173 break; 174 break;
174 case OHCI_USB_OPER: 175 case OHCI_USB_OPER:
175 /* this can happen after resuming a swsusp snapshot */ 176 /* this can happen after resuming a swsusp snapshot */
@@ -422,7 +423,8 @@ ohci_hub_status_data (struct usb_hcd *hcd, char *buf)
422 ohci->autostop = 0; 423 ohci->autostop = 0;
423 ohci->next_statechange = jiffies + 424 ohci->next_statechange = jiffies +
424 STATECHANGE_DELAY; 425 STATECHANGE_DELAY;
425 } else if (time_after_eq (jiffies, 426 } else if (device_may_wakeup(&hcd->self.root_hub->dev)
427 && time_after_eq(jiffies,
426 ohci->next_statechange) 428 ohci->next_statechange)
427 && !ohci->ed_rm_list 429 && !ohci->ed_rm_list
428 && !(ohci->hc_control & 430 && !(ohci->hc_control &
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
index 6daf85c6eeee..6d08a3bcc952 100644
--- a/drivers/usb/input/hid-core.c
+++ b/drivers/usb/input/hid-core.c
@@ -1797,11 +1797,12 @@ static const struct hid_blacklist {
1797 { USB_VENDOR_ID_APPLE, 0x020E, HID_QUIRK_POWERBOOK_HAS_FN }, 1797 { USB_VENDOR_ID_APPLE, 0x020E, HID_QUIRK_POWERBOOK_HAS_FN },
1798 { USB_VENDOR_ID_APPLE, 0x020F, HID_QUIRK_POWERBOOK_HAS_FN }, 1798 { USB_VENDOR_ID_APPLE, 0x020F, HID_QUIRK_POWERBOOK_HAS_FN },
1799 { USB_VENDOR_ID_APPLE, 0x0214, HID_QUIRK_POWERBOOK_HAS_FN }, 1799 { USB_VENDOR_ID_APPLE, 0x0214, HID_QUIRK_POWERBOOK_HAS_FN },
1800 { USB_VENDOR_ID_APPLE, 0x0215, HID_QUIRK_POWERBOOK_HAS_FN }, 1800 { USB_VENDOR_ID_APPLE, 0x0215, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_POWERBOOK_ISO_KEYBOARD},
1801 { USB_VENDOR_ID_APPLE, 0x0216, HID_QUIRK_POWERBOOK_HAS_FN }, 1801 { USB_VENDOR_ID_APPLE, 0x0216, HID_QUIRK_POWERBOOK_HAS_FN },
1802 { USB_VENDOR_ID_APPLE, 0x0217, HID_QUIRK_POWERBOOK_HAS_FN }, 1802 { USB_VENDOR_ID_APPLE, 0x0217, HID_QUIRK_POWERBOOK_HAS_FN },
1803 { USB_VENDOR_ID_APPLE, 0x0218, HID_QUIRK_POWERBOOK_HAS_FN }, 1803 { USB_VENDOR_ID_APPLE, 0x0218, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_POWERBOOK_ISO_KEYBOARD},
1804 { USB_VENDOR_ID_APPLE, 0x0219, HID_QUIRK_POWERBOOK_HAS_FN }, 1804 { USB_VENDOR_ID_APPLE, 0x0219, HID_QUIRK_POWERBOOK_HAS_FN },
1805 { USB_VENDOR_ID_APPLE, 0x021B, HID_QUIRK_POWERBOOK_HAS_FN },
1805 { USB_VENDOR_ID_APPLE, 0x030A, HID_QUIRK_POWERBOOK_HAS_FN }, 1806 { USB_VENDOR_ID_APPLE, 0x030A, HID_QUIRK_POWERBOOK_HAS_FN },
1806 { USB_VENDOR_ID_APPLE, 0x030B, HID_QUIRK_POWERBOOK_HAS_FN }, 1807 { USB_VENDOR_ID_APPLE, 0x030B, HID_QUIRK_POWERBOOK_HAS_FN },
1807 1808
diff --git a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c
index 9a808a3b4d37..68e7ebb978a9 100644
--- a/drivers/usb/input/hid-input.c
+++ b/drivers/usb/input/hid-input.c
@@ -121,6 +121,12 @@ static struct hidinput_key_translation powerbook_numlock_keys[] = {
121 { } 121 { }
122}; 122};
123 123
124static struct hidinput_key_translation powerbook_iso_keyboard[] = {
125 { KEY_GRAVE, KEY_102ND },
126 { KEY_102ND, KEY_GRAVE },
127 { }
128};
129
124static int usbhid_pb_fnmode = 1; 130static int usbhid_pb_fnmode = 1;
125module_param_named(pb_fnmode, usbhid_pb_fnmode, int, 0644); 131module_param_named(pb_fnmode, usbhid_pb_fnmode, int, 0644);
126MODULE_PARM_DESC(pb_fnmode, 132MODULE_PARM_DESC(pb_fnmode,
@@ -195,6 +201,14 @@ static int hidinput_pb_event(struct hid_device *hid, struct input_dev *input,
195 } 201 }
196 } 202 }
197 203
204 if (hid->quirks & HID_QUIRK_POWERBOOK_ISO_KEYBOARD) {
205 trans = find_translation(powerbook_iso_keyboard, usage->code);
206 if (trans) {
207 input_event(input, usage->type, trans->to, value);
208 return 1;
209 }
210 }
211
198 return 0; 212 return 0;
199} 213}
200 214
@@ -210,6 +224,9 @@ static void hidinput_pb_setup(struct input_dev *input)
210 224
211 for (trans = powerbook_numlock_keys; trans->from; trans++) 225 for (trans = powerbook_numlock_keys; trans->from; trans++)
212 set_bit(trans->to, input->keybit); 226 set_bit(trans->to, input->keybit);
227
228 for (trans = powerbook_iso_keyboard; trans->from; trans++)
229 set_bit(trans->to, input->keybit);
213} 230}
214#else 231#else
215static inline int hidinput_pb_event(struct hid_device *hid, struct input_dev *input, 232static inline int hidinput_pb_event(struct hid_device *hid, struct input_dev *input,
diff --git a/drivers/usb/input/hid.h b/drivers/usb/input/hid.h
index 9b50effef758..0e76e6dcac37 100644
--- a/drivers/usb/input/hid.h
+++ b/drivers/usb/input/hid.h
@@ -260,6 +260,7 @@ struct hid_item {
260#define HID_QUIRK_POWERBOOK_HAS_FN 0x00001000 260#define HID_QUIRK_POWERBOOK_HAS_FN 0x00001000
261#define HID_QUIRK_POWERBOOK_FN_ON 0x00002000 261#define HID_QUIRK_POWERBOOK_FN_ON 0x00002000
262#define HID_QUIRK_INVERT_HWHEEL 0x00004000 262#define HID_QUIRK_INVERT_HWHEEL 0x00004000
263#define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00008000
263 264
264/* 265/*
265 * This is the global environment of the parser. This information is 266 * This is the global environment of the parser. This information is
diff --git a/drivers/usb/misc/auerswald.c b/drivers/usb/misc/auerswald.c
index 0be9d62d62ae..e4971d6aaafb 100644
--- a/drivers/usb/misc/auerswald.c
+++ b/drivers/usb/misc/auerswald.c
@@ -780,7 +780,7 @@ static int auerbuf_setup (pauerbufctl_t bcp, unsigned int numElements, unsigned
780 780
781bl_fail:/* not enough memory. Free allocated elements */ 781bl_fail:/* not enough memory. Free allocated elements */
782 dbg ("auerbuf_setup: no more memory"); 782 dbg ("auerbuf_setup: no more memory");
783 kfree(bep); 783 auerbuf_free(bep);
784 auerbuf_free_buffers (bcp); 784 auerbuf_free_buffers (bcp);
785 return -ENOMEM; 785 return -ENOMEM;
786} 786}
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index bd76b4c11fcc..c186b4e73c72 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -311,6 +311,7 @@ static struct usb_device_id id_table_combined [] = {
311 { USB_DEVICE(FTDI_VID, FTDI_ACTZWAVE_PID) }, 311 { USB_DEVICE(FTDI_VID, FTDI_ACTZWAVE_PID) },
312 { USB_DEVICE(FTDI_VID, FTDI_IRTRANS_PID) }, 312 { USB_DEVICE(FTDI_VID, FTDI_IRTRANS_PID) },
313 { USB_DEVICE(FTDI_VID, FTDI_IPLUS_PID) }, 313 { USB_DEVICE(FTDI_VID, FTDI_IPLUS_PID) },
314 { USB_DEVICE(FTDI_VID, FTDI_DMX4ALL) },
314 { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) }, 315 { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) },
315 { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) }, 316 { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) },
316 { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) }, 317 { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) },
@@ -511,6 +512,7 @@ static struct usb_device_id id_table_combined [] = {
511 { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13M_PID) }, 512 { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13M_PID) },
512 { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13S_PID) }, 513 { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13S_PID) },
513 { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13U_PID) }, 514 { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13U_PID) },
515 { USB_DEVICE(ELEKTOR_VID, ELEKTOR_FT323R_PID) },
514 { }, /* Optional parameter entry */ 516 { }, /* Optional parameter entry */
515 { } /* Terminating entry */ 517 { } /* Terminating entry */
516}; 518};
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
index f0edb87d2dd5..bae117d359af 100644
--- a/drivers/usb/serial/ftdi_sio.h
+++ b/drivers/usb/serial/ftdi_sio.h
@@ -55,6 +55,9 @@
55/* iPlus device */ 55/* iPlus device */
56#define FTDI_IPLUS_PID 0xD070 /* Product Id */ 56#define FTDI_IPLUS_PID 0xD070 /* Product Id */
57 57
58/* DMX4ALL DMX Interfaces */
59#define FTDI_DMX4ALL 0xC850
60
58/* www.crystalfontz.com devices - thanx for providing free devices for evaluation ! */ 61/* www.crystalfontz.com devices - thanx for providing free devices for evaluation ! */
59/* they use the ftdi chipset for the USB interface and the vendor id is the same */ 62/* they use the ftdi chipset for the USB interface and the vendor id is the same */
60#define FTDI_XF_632_PID 0xFC08 /* 632: 16x2 Character Display */ 63#define FTDI_XF_632_PID 0xFC08 /* 632: 16x2 Character Display */
@@ -175,9 +178,15 @@
175#define FTDI_ASK_RDR400_PID 0xC991 /* ASK RDR 400 series card reader */ 178#define FTDI_ASK_RDR400_PID 0xC991 /* ASK RDR 400 series card reader */
176 179
177/* 180/*
181 * FTDI USB UART chips used in construction projects from the
182 * Elektor Electronics magazine (http://elektor-electronics.co.uk)
183 */
184#define ELEKTOR_VID 0x0C7D
185#define ELEKTOR_FT323R_PID 0x0005 /* RFID-Reader, issue 09-2006 */
186
187/*
178 * DSS-20 Sync Station for Sony Ericsson P800 188 * DSS-20 Sync Station for Sony Ericsson P800
179 */ 189 */
180
181#define FTDI_DSS20_PID 0xFC82 190#define FTDI_DSS20_PID 0xFC82
182 191
183/* 192/*
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c
index 6238aff1e772..d72cf8bc7f76 100644
--- a/drivers/usb/serial/ipaq.c
+++ b/drivers/usb/serial/ipaq.c
@@ -320,6 +320,7 @@ static struct usb_device_id ipaq_id_table [] = {
320 { USB_DEVICE(0x0B05, 0x9200) }, /* ASUS USB Sync */ 320 { USB_DEVICE(0x0B05, 0x9200) }, /* ASUS USB Sync */
321 { USB_DEVICE(0x0B05, 0x9202) }, /* ASUS USB Sync */ 321 { USB_DEVICE(0x0B05, 0x9202) }, /* ASUS USB Sync */
322 { USB_DEVICE(0x0BB4, 0x00CE) }, /* HTC USB Sync */ 322 { USB_DEVICE(0x0BB4, 0x00CE) }, /* HTC USB Sync */
323 { USB_DEVICE(0x0BB4, 0x00CF) }, /* HTC USB Modem */
323 { USB_DEVICE(0x0BB4, 0x0A01) }, /* PocketPC USB Sync */ 324 { USB_DEVICE(0x0BB4, 0x0A01) }, /* PocketPC USB Sync */
324 { USB_DEVICE(0x0BB4, 0x0A02) }, /* PocketPC USB Sync */ 325 { USB_DEVICE(0x0BB4, 0x0A02) }, /* PocketPC USB Sync */
325 { USB_DEVICE(0x0BB4, 0x0A03) }, /* PocketPC USB Sync */ 326 { USB_DEVICE(0x0BB4, 0x0A03) }, /* PocketPC USB Sync */
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index bc1ac07bf6ce..efb047f431e8 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -1306,25 +1306,13 @@ UNUSUAL_DEV( 0x0fce, 0xe030, 0x0000, 0x0000,
1306 US_SC_DEVICE, US_PR_DEVICE, NULL, 1306 US_SC_DEVICE, US_PR_DEVICE, NULL,
1307 US_FL_FIX_CAPACITY ), 1307 US_FL_FIX_CAPACITY ),
1308 1308
1309/* Reported by Jan Mate <mate@fiit.stuba.sk> */
1310UNUSUAL_DEV( 0x0fce, 0xe030, 0x0000, 0x0000,
1311 "Sony Ericsson",
1312 "P990i",
1313 US_SC_DEVICE, US_PR_DEVICE, NULL,
1314 US_FL_FIX_CAPACITY ),
1315
1316/* Reported by Jan Mate <mate@fiit.stuba.sk> */
1317UNUSUAL_DEV( 0x0fce, 0xe030, 0x0000, 0x0000,
1318 "Sony Ericsson",
1319 "P990i",
1320 US_SC_DEVICE, US_PR_DEVICE, NULL,
1321 US_FL_FIX_CAPACITY ),
1322
1323/* Reported by Kevin Cernekee <kpc-usbdev@gelato.uiuc.edu> 1309/* Reported by Kevin Cernekee <kpc-usbdev@gelato.uiuc.edu>
1324 * Tested on hardware version 1.10. 1310 * Tested on hardware version 1.10.
1325 * Entry is needed only for the initializer function override. 1311 * Entry is needed only for the initializer function override.
1312 * Devices with bcd > 110 seem to not need it while those
1313 * with bcd < 110 appear to need it.
1326 */ 1314 */
1327UNUSUAL_DEV( 0x1019, 0x0c55, 0x0110, 0x0110, 1315UNUSUAL_DEV( 0x1019, 0x0c55, 0x0000, 0x0110,
1328 "Desknote", 1316 "Desknote",
1329 "UCR-61S2B", 1317 "UCR-61S2B",
1330 US_SC_DEVICE, US_PR_DEVICE, usb_stor_ucr61s2b_init, 1318 US_SC_DEVICE, US_PR_DEVICE, usb_stor_ucr61s2b_init,
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index b77b30923928..e815b354c09d 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -406,7 +406,7 @@ static struct {
406 { PCI_CHIP_MACH64LB, "3D RAGE LT PRO (Mach64 LB, AGP)", 236, 75, 100, 135, ATI_CHIP_264LTPRO }, 406 { PCI_CHIP_MACH64LB, "3D RAGE LT PRO (Mach64 LB, AGP)", 236, 75, 100, 135, ATI_CHIP_264LTPRO },
407 { PCI_CHIP_MACH64LD, "3D RAGE LT PRO (Mach64 LD, AGP)", 230, 100, 100, 135, ATI_CHIP_264LTPRO }, 407 { PCI_CHIP_MACH64LD, "3D RAGE LT PRO (Mach64 LD, AGP)", 230, 100, 100, 135, ATI_CHIP_264LTPRO },
408 { PCI_CHIP_MACH64LI, "3D RAGE LT PRO (Mach64 LI, PCI)", 230, 100, 100, 135, ATI_CHIP_264LTPRO | M64F_G3_PB_1_1 | M64F_G3_PB_1024x768 }, 408 { PCI_CHIP_MACH64LI, "3D RAGE LT PRO (Mach64 LI, PCI)", 230, 100, 100, 135, ATI_CHIP_264LTPRO | M64F_G3_PB_1_1 | M64F_G3_PB_1024x768 },
409 { PCI_CHIP_MACH64LP, "3D RAGE LT PRO (Mach64 LP, PCI)", 230, 100, 100, 135, ATI_CHIP_264LTPRO }, 409 { PCI_CHIP_MACH64LP, "3D RAGE LT PRO (Mach64 LP, PCI)", 230, 100, 100, 135, ATI_CHIP_264LTPRO | M64F_G3_PB_1024x768 },
410 { PCI_CHIP_MACH64LQ, "3D RAGE LT PRO (Mach64 LQ, PCI)", 230, 100, 100, 135, ATI_CHIP_264LTPRO }, 410 { PCI_CHIP_MACH64LQ, "3D RAGE LT PRO (Mach64 LQ, PCI)", 230, 100, 100, 135, ATI_CHIP_264LTPRO },
411 411
412 { PCI_CHIP_MACH64GM, "3D RAGE XL (Mach64 GM, AGP 2x)", 230, 83, 63, 135, ATI_CHIP_264XL }, 412 { PCI_CHIP_MACH64GM, "3D RAGE XL (Mach64 GM, AGP 2x)", 230, 83, 63, 135, ATI_CHIP_264XL },
diff --git a/drivers/video/aty/radeon_i2c.c b/drivers/video/aty/radeon_i2c.c
index 676754520099..869725a13c21 100644
--- a/drivers/video/aty/radeon_i2c.c
+++ b/drivers/video/aty/radeon_i2c.c
@@ -139,7 +139,13 @@ void radeon_delete_i2c_busses(struct radeonfb_info *rinfo)
139int radeon_probe_i2c_connector(struct radeonfb_info *rinfo, int conn, 139int radeon_probe_i2c_connector(struct radeonfb_info *rinfo, int conn,
140 u8 **out_edid) 140 u8 **out_edid)
141{ 141{
142 u8 *edid = fb_ddc_read(&rinfo->i2c[conn-1].adapter); 142 u32 reg = rinfo->i2c[conn-1].ddc_reg;
143 u8 *edid;
144
145 OUTREG(reg, INREG(reg) &
146 ~(VGA_DDC_DATA_OUTPUT | VGA_DDC_CLK_OUTPUT));
147
148 edid = fb_ddc_read(&rinfo->i2c[conn-1].adapter);
143 149
144 if (out_edid) 150 if (out_edid)
145 *out_edid = edid; 151 *out_edid = edid;
diff --git a/drivers/video/fb_ddc.c b/drivers/video/fb_ddc.c
index 3aa6ebf68f17..f836137a0eda 100644
--- a/drivers/video/fb_ddc.c
+++ b/drivers/video/fb_ddc.c
@@ -20,26 +20,26 @@
20static unsigned char *fb_do_probe_ddc_edid(struct i2c_adapter *adapter) 20static unsigned char *fb_do_probe_ddc_edid(struct i2c_adapter *adapter)
21{ 21{
22 unsigned char start = 0x0; 22 unsigned char start = 0x0;
23 unsigned char *buf = kmalloc(EDID_LENGTH, GFP_KERNEL);
23 struct i2c_msg msgs[] = { 24 struct i2c_msg msgs[] = {
24 { 25 {
25 .addr = DDC_ADDR, 26 .addr = DDC_ADDR,
27 .flags = 0,
26 .len = 1, 28 .len = 1,
27 .buf = &start, 29 .buf = &start,
28 }, { 30 }, {
29 .addr = DDC_ADDR, 31 .addr = DDC_ADDR,
30 .flags = I2C_M_RD, 32 .flags = I2C_M_RD,
31 .len = EDID_LENGTH, 33 .len = EDID_LENGTH,
34 .buf = buf,
32 } 35 }
33 }; 36 };
34 unsigned char *buf;
35 37
36 buf = kmalloc(EDID_LENGTH, GFP_KERNEL);
37 if (!buf) { 38 if (!buf) {
38 dev_warn(&adapter->dev, "unable to allocate memory for EDID " 39 dev_warn(&adapter->dev, "unable to allocate memory for EDID "
39 "block.\n"); 40 "block.\n");
40 return NULL; 41 return NULL;
41 } 42 }
42 msgs[1].buf = buf;
43 43
44 if (i2c_transfer(adapter, msgs, 2) == 2) 44 if (i2c_transfer(adapter, msgs, 2) == 2)
45 return buf; 45 return buf;
diff --git a/drivers/video/nvidia/nv_setup.c b/drivers/video/nvidia/nv_setup.c
index 61dc46fecf2b..eab3e282a4de 100644
--- a/drivers/video/nvidia/nv_setup.c
+++ b/drivers/video/nvidia/nv_setup.c
@@ -262,7 +262,7 @@ static void nv10GetConfig(struct nvidia_par *par)
262#endif 262#endif
263 263
264 dev = pci_find_slot(0, 1); 264 dev = pci_find_slot(0, 1);
265 if ((par->Chipset && 0xffff) == 0x01a0) { 265 if ((par->Chipset & 0xffff) == 0x01a0) {
266 int amt = 0; 266 int amt = 0;
267 267
268 pci_read_config_dword(dev, 0x7c, &amt); 268 pci_read_config_dword(dev, 0x7c, &amt);
diff --git a/drivers/video/pnx4008/pnxrgbfb.c b/drivers/video/pnx4008/pnxrgbfb.c
index 7d9453c91a42..f29e66e2d774 100644
--- a/drivers/video/pnx4008/pnxrgbfb.c
+++ b/drivers/video/pnx4008/pnxrgbfb.c
@@ -154,7 +154,8 @@ static int __devinit rgbfb_probe(struct platform_device *pdev)
154 goto err1; 154 goto err1;
155 } 155 }
156 156
157 if (!fb_get_options("pnxrgbfb", &option) && !strcmp(option, "nocursor")) 157 if (!fb_get_options("pnxrgbfb", &option) && option &&
158 !strcmp(option, "nocursor"))
158 rgbfb_ops.fb_cursor = no_cursor; 159 rgbfb_ops.fb_cursor = no_cursor;
159 160
160 info->node = -1; 161 info->node = -1;
@@ -191,7 +192,7 @@ err:
191 192
192static struct platform_driver rgbfb_driver = { 193static struct platform_driver rgbfb_driver = {
193 .driver = { 194 .driver = {
194 .name = "rgbfb", 195 .name = "pnx4008-rgbfb",
195 }, 196 },
196 .probe = rgbfb_probe, 197 .probe = rgbfb_probe,
197 .remove = rgbfb_remove, 198 .remove = rgbfb_remove,
diff --git a/drivers/video/pnx4008/sdum.c b/drivers/video/pnx4008/sdum.c
index 51f0ecc2a511..d23bf0d659b6 100644
--- a/drivers/video/pnx4008/sdum.c
+++ b/drivers/video/pnx4008/sdum.c
@@ -848,7 +848,7 @@ static int sdum_remove(struct platform_device *pdev)
848 848
849static struct platform_driver sdum_driver = { 849static struct platform_driver sdum_driver = {
850 .driver = { 850 .driver = {
851 .name = "sdum", 851 .name = "pnx4008-sdum",
852 }, 852 },
853 .probe = sdum_probe, 853 .probe = sdum_probe,
854 .remove = sdum_remove, 854 .remove = sdum_remove,
diff --git a/drivers/w1/masters/matrox_w1.c b/drivers/w1/masters/matrox_w1.c
index 2788b8ca9bb1..6f9d880ab2e9 100644
--- a/drivers/w1/masters/matrox_w1.c
+++ b/drivers/w1/masters/matrox_w1.c
@@ -215,6 +215,8 @@ static int __devinit matrox_w1_probe(struct pci_dev *pdev, const struct pci_devi
215 return 0; 215 return 0;
216 216
217err_out_free_device: 217err_out_free_device:
218 if (dev->virt_addr)
219 iounmap(dev->virt_addr);
218 kfree(dev); 220 kfree(dev);
219 221
220 return err; 222 return err;