aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-03-03 12:16:03 -0500
committerJeff Garzik <jeff@garzik.org>2006-03-03 12:16:03 -0500
commit801c63c38ae52e8bfb3f6518de00a0be22c55f9a (patch)
treebb7b9539f2f2b8077a04c2df3b60ac8cc8fa692d /drivers/scsi
parent1ed82ae3df3882bfcb5bfe5e9f97e4e8e23af299 (diff)
parent348edc59a8f9b9a66700781d972c24a46a79ae86 (diff)
Merge branch 'upstream'
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/aha152x.c85
-rw-r--r--drivers/scsi/aha152x.h2
-rw-r--r--drivers/scsi/jazz_esp.c21
-rw-r--r--drivers/scsi/libata-core.c5
-rw-r--r--drivers/scsi/libata-scsi.c2
-rw-r--r--drivers/scsi/libata.h1
-rw-r--r--drivers/scsi/megaraid/megaraid_sas.c29
-rw-r--r--drivers/scsi/pcmcia/aha152x_stub.c4
-rw-r--r--drivers/scsi/sata_sil.c2
-rw-r--r--drivers/scsi/sata_sil24.c1
-rw-r--r--drivers/scsi/scsi_error.c4
-rw-r--r--drivers/scsi/scsi_lib.c2
-rw-r--r--drivers/scsi/scsi_scan.c16
-rw-r--r--drivers/scsi/scsi_transport_fc.c3
-rw-r--r--drivers/scsi/sg.c2
-rw-r--r--drivers/scsi/sym53c8xx_2/sym_hipd.c2
16 files changed, 99 insertions, 82 deletions
diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
index cb2ee25f213f..531a1f9ceb51 100644
--- a/drivers/scsi/aha152x.c
+++ b/drivers/scsi/aha152x.c
@@ -1260,16 +1260,15 @@ static void free_hard_reset_SCs(struct Scsi_Host *shpnt, Scsi_Cmnd **SCs)
1260 * Reset the bus 1260 * Reset the bus
1261 * 1261 *
1262 */ 1262 */
1263static int aha152x_bus_reset(Scsi_Cmnd *SCpnt) 1263static int aha152x_bus_reset_host(struct Scsi_Host *shpnt)
1264{ 1264{
1265 struct Scsi_Host *shpnt = SCpnt->device->host;
1266 unsigned long flags; 1265 unsigned long flags;
1267 1266
1268 DO_LOCK(flags); 1267 DO_LOCK(flags);
1269 1268
1270#if defined(AHA152X_DEBUG) 1269#if defined(AHA152X_DEBUG)
1271 if(HOSTDATA(shpnt)->debug & debug_eh) { 1270 if(HOSTDATA(shpnt)->debug & debug_eh) {
1272 printk(DEBUG_LEAD "aha152x_bus_reset(%p)", CMDINFO(SCpnt), SCpnt); 1271 printk(KERN_DEBUG "scsi%d: bus reset", shpnt->host_no);
1273 show_queues(shpnt); 1272 show_queues(shpnt);
1274 } 1273 }
1275#endif 1274#endif
@@ -1277,14 +1276,14 @@ static int aha152x_bus_reset(Scsi_Cmnd *SCpnt)
1277 free_hard_reset_SCs(shpnt, &ISSUE_SC); 1276 free_hard_reset_SCs(shpnt, &ISSUE_SC);
1278 free_hard_reset_SCs(shpnt, &DISCONNECTED_SC); 1277 free_hard_reset_SCs(shpnt, &DISCONNECTED_SC);
1279 1278
1280 DPRINTK(debug_eh, DEBUG_LEAD "resetting bus\n", CMDINFO(SCpnt)); 1279 DPRINTK(debug_eh, KERN_DEBUG "scsi%d: resetting bus\n", shpnt->host_no);
1281 1280
1282 SETPORT(SCSISEQ, SCSIRSTO); 1281 SETPORT(SCSISEQ, SCSIRSTO);
1283 mdelay(256); 1282 mdelay(256);
1284 SETPORT(SCSISEQ, 0); 1283 SETPORT(SCSISEQ, 0);
1285 mdelay(DELAY); 1284 mdelay(DELAY);
1286 1285
1287 DPRINTK(debug_eh, DEBUG_LEAD "bus resetted\n", CMDINFO(SCpnt)); 1286 DPRINTK(debug_eh, KERN_DEBUG "scsi%d: bus resetted\n", shpnt->host_no);
1288 1287
1289 setup_expected_interrupts(shpnt); 1288 setup_expected_interrupts(shpnt);
1290 if(HOSTDATA(shpnt)->commands==0) 1289 if(HOSTDATA(shpnt)->commands==0)
@@ -1295,6 +1294,14 @@ static int aha152x_bus_reset(Scsi_Cmnd *SCpnt)
1295 return SUCCESS; 1294 return SUCCESS;
1296} 1295}
1297 1296
1297/*
1298 * Reset the bus
1299 *
1300 */
1301static int aha152x_bus_reset(Scsi_Cmnd *SCpnt)
1302{
1303 return aha152x_bus_reset_host(SCpnt->device->host);
1304}
1298 1305
1299/* 1306/*
1300 * Restore default values to the AIC-6260 registers and reset the fifos 1307 * Restore default values to the AIC-6260 registers and reset the fifos
@@ -1337,23 +1344,28 @@ static void reset_ports(struct Scsi_Host *shpnt)
1337 * Reset the host (bus and controller) 1344 * Reset the host (bus and controller)
1338 * 1345 *
1339 */ 1346 */
1340int aha152x_host_reset(Scsi_Cmnd * SCpnt) 1347int aha152x_host_reset_host(struct Scsi_Host *shpnt)
1341{ 1348{
1342#if defined(AHA152X_DEBUG) 1349 DPRINTK(debug_eh, KERN_DEBUG "scsi%d: host reset\n", shpnt->host_no);
1343 struct Scsi_Host *shpnt = SCpnt->device->host;
1344#endif
1345
1346 DPRINTK(debug_eh, DEBUG_LEAD "aha152x_host_reset(%p)\n", CMDINFO(SCpnt), SCpnt);
1347 1350
1348 aha152x_bus_reset(SCpnt); 1351 aha152x_bus_reset_host(shpnt);
1349 1352
1350 DPRINTK(debug_eh, DEBUG_LEAD "resetting ports\n", CMDINFO(SCpnt)); 1353 DPRINTK(debug_eh, KERN_DEBUG "scsi%d: resetting ports\n", shpnt->host_no);
1351 reset_ports(SCpnt->device->host); 1354 reset_ports(shpnt);
1352 1355
1353 return SUCCESS; 1356 return SUCCESS;
1354} 1357}
1355 1358
1356/* 1359/*
1360 * Reset the host (bus and controller)
1361 *
1362 */
1363static int aha152x_host_reset(Scsi_Cmnd *SCpnt)
1364{
1365 return aha152x_host_reset_host(SCpnt->device->host);
1366}
1367
1368/*
1357 * Return the "logical geometry" 1369 * Return the "logical geometry"
1358 * 1370 *
1359 */ 1371 */
@@ -1431,22 +1443,18 @@ static void run(void)
1431{ 1443{
1432 int i; 1444 int i;
1433 for (i = 0; i<ARRAY_SIZE(aha152x_host); i++) { 1445 for (i = 0; i<ARRAY_SIZE(aha152x_host); i++) {
1434 struct Scsi_Host *shpnt = aha152x_host[i]; 1446 is_complete(aha152x_host[i]);
1435 if (shpnt && HOSTDATA(shpnt)->service) {
1436 HOSTDATA(shpnt)->service=0;
1437 is_complete(shpnt);
1438 }
1439 } 1447 }
1440} 1448}
1441 1449
1442/* 1450/*
1443 * Interrupts handler 1451 * Interrupt handler
1444 * 1452 *
1445 */ 1453 */
1446
1447static irqreturn_t intr(int irqno, void *dev_id, struct pt_regs *regs) 1454static irqreturn_t intr(int irqno, void *dev_id, struct pt_regs *regs)
1448{ 1455{
1449 struct Scsi_Host *shpnt = lookup_irq(irqno); 1456 struct Scsi_Host *shpnt = lookup_irq(irqno);
1457 unsigned long flags;
1450 unsigned char rev, dmacntrl0; 1458 unsigned char rev, dmacntrl0;
1451 1459
1452 if (!shpnt) { 1460 if (!shpnt) {
@@ -1472,23 +1480,23 @@ static irqreturn_t intr(int irqno, void *dev_id, struct pt_regs *regs)
1472 if ((rev == 0xFF) && (dmacntrl0 == 0xFF)) 1480 if ((rev == 0xFF) && (dmacntrl0 == 0xFF))
1473 return IRQ_NONE; 1481 return IRQ_NONE;
1474 1482
1483 if( TESTLO(DMASTAT, INTSTAT) )
1484 return IRQ_NONE;
1485
1475 /* no more interrupts from the controller, while we're busy. 1486 /* no more interrupts from the controller, while we're busy.
1476 INTEN is restored by the BH handler */ 1487 INTEN is restored by the BH handler */
1477 CLRBITS(DMACNTRL0, INTEN); 1488 CLRBITS(DMACNTRL0, INTEN);
1478 1489
1479#if 0 1490 DO_LOCK(flags);
1480 /* check if there is already something to be 1491 if( HOSTDATA(shpnt)->service==0 ) {
1481 serviced; should not happen */ 1492 HOSTDATA(shpnt)->service=1;
1482 if(HOSTDATA(shpnt)->service) { 1493
1483 printk(KERN_ERR "aha152x%d: lost interrupt (%d)\n", HOSTNO, HOSTDATA(shpnt)->service); 1494 /* Poke the BH handler */
1484 show_queues(shpnt); 1495 INIT_WORK(&aha152x_tq, (void *) run, NULL);
1496 schedule_work(&aha152x_tq);
1485 } 1497 }
1486#endif 1498 DO_UNLOCK(flags);
1487 1499
1488 /* Poke the BH handler */
1489 HOSTDATA(shpnt)->service++;
1490 INIT_WORK(&aha152x_tq, (void *) run, NULL);
1491 schedule_work(&aha152x_tq);
1492 return IRQ_HANDLED; 1500 return IRQ_HANDLED;
1493} 1501}
1494 1502
@@ -2527,7 +2535,18 @@ static void is_complete(struct Scsi_Host *shpnt)
2527 unsigned long flags; 2535 unsigned long flags;
2528 int pending; 2536 int pending;
2529 2537
2538 if(!shpnt)
2539 return;
2540
2530 DO_LOCK(flags); 2541 DO_LOCK(flags);
2542
2543 if( HOSTDATA(shpnt)->service==0 ) {
2544 DO_UNLOCK(flags);
2545 return;
2546 }
2547
2548 HOSTDATA(shpnt)->service = 0;
2549
2531 if(HOSTDATA(shpnt)->in_intr) { 2550 if(HOSTDATA(shpnt)->in_intr) {
2532 DO_UNLOCK(flags); 2551 DO_UNLOCK(flags);
2533 /* aha152x_error never returns.. */ 2552 /* aha152x_error never returns.. */
diff --git a/drivers/scsi/aha152x.h b/drivers/scsi/aha152x.h
index d277613af29b..d2add24d02a3 100644
--- a/drivers/scsi/aha152x.h
+++ b/drivers/scsi/aha152x.h
@@ -332,6 +332,6 @@ struct aha152x_setup {
332 332
333struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *); 333struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *);
334void aha152x_release(struct Scsi_Host *); 334void aha152x_release(struct Scsi_Host *);
335int aha152x_host_reset(Scsi_Cmnd *); 335int aha152x_host_reset_host(struct Scsi_Host *);
336 336
337#endif /* _AHA152X_H */ 337#endif /* _AHA152X_H */
diff --git a/drivers/scsi/jazz_esp.c b/drivers/scsi/jazz_esp.c
index 23728d1c980c..fcd304e11c26 100644
--- a/drivers/scsi/jazz_esp.c
+++ b/drivers/scsi/jazz_esp.c
@@ -65,27 +65,6 @@ static int jazz_esp_release(struct Scsi_Host *shost)
65 return 0; 65 return 0;
66} 66}
67 67
68static struct scsi_host_template driver_template = {
69 .proc_name = "jazz_esp",
70 .proc_info = &esp_proc_info,
71 .name = "ESP 100/100a/200",
72 .detect = jazz_esp_detect,
73 .slave_alloc = esp_slave_alloc,
74 .slave_destroy = esp_slave_destroy,
75 .release = jazz_esp_release,
76 .info = esp_info,
77 .queuecommand = esp_queue,
78 .eh_abort_handler = esp_abort,
79 .eh_bus_reset_handler = esp_reset,
80 .can_queue = 7,
81 .this_id = 7,
82 .sg_tablesize = SG_ALL,
83 .cmd_per_lun = 1,
84 .use_clustering = DISABLE_CLUSTERING,
85};
86
87#include "scsi_module.c"
88
89/***************************************************************** Detection */ 68/***************************************************************** Detection */
90static int jazz_esp_detect(struct scsi_host_template *tpnt) 69static int jazz_esp_detect(struct scsi_host_template *tpnt)
91{ 70{
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 9de1e285e0b2..9132698d29b8 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -79,6 +79,10 @@ int atapi_enabled = 0;
79module_param(atapi_enabled, int, 0444); 79module_param(atapi_enabled, int, 0444);
80MODULE_PARM_DESC(atapi_enabled, "Enable discovery of ATAPI devices (0=off, 1=on)"); 80MODULE_PARM_DESC(atapi_enabled, "Enable discovery of ATAPI devices (0=off, 1=on)");
81 81
82int libata_fua = 0;
83module_param_named(fua, libata_fua, int, 0444);
84MODULE_PARM_DESC(fua, "FUA support (0=off, 1=on)");
85
82MODULE_AUTHOR("Jeff Garzik"); 86MODULE_AUTHOR("Jeff Garzik");
83MODULE_DESCRIPTION("Library module for ATA devices"); 87MODULE_DESCRIPTION("Library module for ATA devices");
84MODULE_LICENSE("GPL"); 88MODULE_LICENSE("GPL");
@@ -1029,7 +1033,6 @@ static int ata_dev_read_id(struct ata_port *ap, struct ata_device *dev,
1029 err_out: 1033 err_out:
1030 printk(KERN_WARNING "ata%u: dev %u failed to IDENTIFY (%s)\n", 1034 printk(KERN_WARNING "ata%u: dev %u failed to IDENTIFY (%s)\n",
1031 ap->id, dev->devno, reason); 1035 ap->id, dev->devno, reason);
1032 kfree(id);
1033 return rc; 1036 return rc;
1034} 1037}
1035 1038
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
index 538784e65cdc..d0bd94abb413 100644
--- a/drivers/scsi/libata-scsi.c
+++ b/drivers/scsi/libata-scsi.c
@@ -1803,6 +1803,8 @@ static int ata_dev_supports_fua(u16 *id)
1803{ 1803{
1804 unsigned char model[41], fw[9]; 1804 unsigned char model[41], fw[9];
1805 1805
1806 if (!libata_fua)
1807 return 0;
1806 if (!ata_id_has_fua(id)) 1808 if (!ata_id_has_fua(id))
1807 return 0; 1809 return 0;
1808 1810
diff --git a/drivers/scsi/libata.h b/drivers/scsi/libata.h
index 9d76923a2253..d822eba05f3c 100644
--- a/drivers/scsi/libata.h
+++ b/drivers/scsi/libata.h
@@ -41,6 +41,7 @@ struct ata_scsi_args {
41 41
42/* libata-core.c */ 42/* libata-core.c */
43extern int atapi_enabled; 43extern int atapi_enabled;
44extern int libata_fua;
44extern struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap, 45extern struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
45 struct ata_device *dev); 46 struct ata_device *dev);
46extern int ata_rwcmd_protocol(struct ata_queued_cmd *qc); 47extern int ata_rwcmd_protocol(struct ata_queued_cmd *qc);
diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c
index 7de267e14458..4f39dd01936d 100644
--- a/drivers/scsi/megaraid/megaraid_sas.c
+++ b/drivers/scsi/megaraid/megaraid_sas.c
@@ -793,6 +793,20 @@ megasas_queue_command(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd *))
793 return 0; 793 return 0;
794} 794}
795 795
796static int megasas_slave_configure(struct scsi_device *sdev)
797{
798 /*
799 * Don't export physical disk devices to the disk driver.
800 *
801 * FIXME: Currently we don't export them to the midlayer at all.
802 * That will be fixed once LSI engineers have audited the
803 * firmware for possible issues.
804 */
805 if (sdev->channel < MEGASAS_MAX_PD_CHANNELS && sdev->type == TYPE_DISK)
806 return -ENXIO;
807 return 0;
808}
809
796/** 810/**
797 * megasas_wait_for_outstanding - Wait for all outstanding cmds 811 * megasas_wait_for_outstanding - Wait for all outstanding cmds
798 * @instance: Adapter soft state 812 * @instance: Adapter soft state
@@ -943,6 +957,7 @@ static struct scsi_host_template megasas_template = {
943 .module = THIS_MODULE, 957 .module = THIS_MODULE,
944 .name = "LSI Logic SAS based MegaRAID driver", 958 .name = "LSI Logic SAS based MegaRAID driver",
945 .proc_name = "megaraid_sas", 959 .proc_name = "megaraid_sas",
960 .slave_configure = megasas_slave_configure,
946 .queuecommand = megasas_queue_command, 961 .queuecommand = megasas_queue_command,
947 .eh_device_reset_handler = megasas_reset_device, 962 .eh_device_reset_handler = megasas_reset_device,
948 .eh_bus_reset_handler = megasas_reset_bus_host, 963 .eh_bus_reset_handler = megasas_reset_bus_host,
@@ -1071,20 +1086,6 @@ megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd,
1071 break; 1086 break;
1072 } 1087 }
1073 1088
1074 /*
1075 * Don't export physical disk devices to mid-layer.
1076 */
1077 if (!MEGASAS_IS_LOGICAL(cmd->scmd) &&
1078 (hdr->cmd_status == MFI_STAT_OK) &&
1079 (cmd->scmd->cmnd[0] == INQUIRY)) {
1080
1081 if (((*(u8 *) cmd->scmd->request_buffer) & 0x1F) ==
1082 TYPE_DISK) {
1083 cmd->scmd->result = DID_BAD_TARGET << 16;
1084 exception = 1;
1085 }
1086 }
1087
1088 case MFI_CMD_LD_READ: 1089 case MFI_CMD_LD_READ:
1089 case MFI_CMD_LD_WRITE: 1090 case MFI_CMD_LD_WRITE:
1090 1091
diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c
index 0c9edb7051f4..5609847e254a 100644
--- a/drivers/scsi/pcmcia/aha152x_stub.c
+++ b/drivers/scsi/pcmcia/aha152x_stub.c
@@ -275,10 +275,8 @@ static int aha152x_resume(struct pcmcia_device *dev)
275 275
276 link->state &= ~DEV_SUSPEND; 276 link->state &= ~DEV_SUSPEND;
277 if (link->state & DEV_CONFIG) { 277 if (link->state & DEV_CONFIG) {
278 Scsi_Cmnd tmp;
279 pcmcia_request_configuration(link->handle, &link->conf); 278 pcmcia_request_configuration(link->handle, &link->conf);
280 tmp.device->host = info->host; 279 aha152x_host_reset_host(info->host);
281 aha152x_host_reset(&tmp);
282 } 280 }
283 281
284 return 0; 282 return 0;
diff --git a/drivers/scsi/sata_sil.c b/drivers/scsi/sata_sil.c
index 91ecf527bb8a..cdf800e3ec13 100644
--- a/drivers/scsi/sata_sil.c
+++ b/drivers/scsi/sata_sil.c
@@ -202,7 +202,7 @@ static const struct ata_port_info sil_port_info[] = {
202 { 202 {
203 .sht = &sil_sht, 203 .sht = &sil_sht,
204 .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | 204 .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
205 ATA_FLAG_SRST | ATA_FLAG_MMIO | 205 ATA_FLAG_MMIO |
206 SIL_FLAG_RERR_ON_DMA_ACT, 206 SIL_FLAG_RERR_ON_DMA_ACT,
207 .pio_mask = 0x1f, /* pio0-4 */ 207 .pio_mask = 0x1f, /* pio0-4 */
208 .mwdma_mask = 0x07, /* mwdma0-2 */ 208 .mwdma_mask = 0x07, /* mwdma0-2 */
diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c
index a0e35a262156..5c5822e33a49 100644
--- a/drivers/scsi/sata_sil24.c
+++ b/drivers/scsi/sata_sil24.c
@@ -262,6 +262,7 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
262 262
263static const struct pci_device_id sil24_pci_tbl[] = { 263static const struct pci_device_id sil24_pci_tbl[] = {
264 { 0x1095, 0x3124, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BID_SIL3124 }, 264 { 0x1095, 0x3124, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BID_SIL3124 },
265 { 0x8086, 0x3124, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BID_SIL3124 },
265 { 0x1095, 0x3132, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BID_SIL3132 }, 266 { 0x1095, 0x3132, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BID_SIL3132 },
266 { 0x1095, 0x3131, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BID_SIL3131 }, 267 { 0x1095, 0x3131, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BID_SIL3131 },
267 { 0x1095, 0x3531, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BID_SIL3131 }, 268 { 0x1095, 0x3531, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BID_SIL3131 },
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 50f8057be75d..5d169a2881b9 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -1308,7 +1308,7 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd)
1308 * the request was not marked fast fail. Note that above, 1308 * the request was not marked fast fail. Note that above,
1309 * even if the request is marked fast fail, we still requeue 1309 * even if the request is marked fast fail, we still requeue
1310 * for queue congestion conditions (QUEUE_FULL or BUSY) */ 1310 * for queue congestion conditions (QUEUE_FULL or BUSY) */
1311 if ((++scmd->retries) < scmd->allowed 1311 if ((++scmd->retries) <= scmd->allowed
1312 && !blk_noretry_request(scmd->request)) { 1312 && !blk_noretry_request(scmd->request)) {
1313 return NEEDS_RETRY; 1313 return NEEDS_RETRY;
1314 } else { 1314 } else {
@@ -1433,7 +1433,7 @@ void scsi_eh_flush_done_q(struct list_head *done_q)
1433 list_del_init(&scmd->eh_entry); 1433 list_del_init(&scmd->eh_entry);
1434 if (scsi_device_online(scmd->device) && 1434 if (scsi_device_online(scmd->device) &&
1435 !blk_noretry_request(scmd->request) && 1435 !blk_noretry_request(scmd->request) &&
1436 (++scmd->retries < scmd->allowed)) { 1436 (++scmd->retries <= scmd->allowed)) {
1437 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: flush" 1437 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: flush"
1438 " retry cmd: %p\n", 1438 " retry cmd: %p\n",
1439 current->comm, 1439 current->comm,
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 4362dcde74af..701a328f7beb 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1498,7 +1498,7 @@ static void scsi_kill_request(struct request *req, request_queue_t *q)
1498static void scsi_softirq_done(struct request *rq) 1498static void scsi_softirq_done(struct request *rq)
1499{ 1499{
1500 struct scsi_cmnd *cmd = rq->completion_data; 1500 struct scsi_cmnd *cmd = rq->completion_data;
1501 unsigned long wait_for = cmd->allowed * cmd->timeout_per_command; 1501 unsigned long wait_for = (cmd->allowed + 1) * cmd->timeout_per_command;
1502 int disposition; 1502 int disposition;
1503 1503
1504 INIT_LIST_HEAD(&cmd->eh_entry); 1504 INIT_LIST_HEAD(&cmd->eh_entry);
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 5acb83ca5ae5..f9ecc3dea7df 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -752,8 +752,20 @@ static int scsi_add_lun(struct scsi_device *sdev, char *inq_result, int *bflags)
752 752
753 transport_configure_device(&sdev->sdev_gendev); 753 transport_configure_device(&sdev->sdev_gendev);
754 754
755 if (sdev->host->hostt->slave_configure) 755 if (sdev->host->hostt->slave_configure) {
756 sdev->host->hostt->slave_configure(sdev); 756 int ret = sdev->host->hostt->slave_configure(sdev);
757 if (ret) {
758 /*
759 * if LLDD reports slave not present, don't clutter
760 * console with alloc failure messages
761 */
762 if (ret != -ENXIO) {
763 sdev_printk(KERN_ERR, sdev,
764 "failed to configure device\n");
765 }
766 return SCSI_SCAN_NO_RESPONSE;
767 }
768 }
757 769
758 /* 770 /*
759 * Ok, the device is now all set up, we can 771 * Ok, the device is now all set up, we can
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index f2c9acf11bd0..929032e370db 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -1498,8 +1498,7 @@ fc_remote_port_add(struct Scsi_Host *shost, int channel,
1498 } 1498 }
1499 1499
1500 /* Search the bindings array */ 1500 /* Search the bindings array */
1501 if (likely((ids->roles & FC_RPORT_ROLE_FCP_TARGET) && 1501 if (fc_host_tgtid_bind_type(shost) != FC_TGTID_BIND_NONE) {
1502 (fc_host_tgtid_bind_type(shost) != FC_TGTID_BIND_NONE))) {
1503 1502
1504 /* search for a matching consistent binding */ 1503 /* search for a matching consistent binding */
1505 1504
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 2a547538d444..5a0a19322d01 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -2162,7 +2162,7 @@ sg_link_reserve(Sg_fd * sfp, Sg_request * srp, int size)
2162 2162
2163 srp->res_used = 1; 2163 srp->res_used = 1;
2164 SCSI_LOG_TIMEOUT(4, printk("sg_link_reserve: size=%d\n", size)); 2164 SCSI_LOG_TIMEOUT(4, printk("sg_link_reserve: size=%d\n", size));
2165 rem = size = (size + 1) & (~1); /* round to even for aha1542 */ 2165 rem = size;
2166 2166
2167 for (k = 0; k < rsv_schp->k_use_sg; ++k, ++sg) { 2167 for (k = 0; k < rsv_schp->k_use_sg; ++k, ++sg) {
2168 num = sg->length; 2168 num = sg->length;
diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.c b/drivers/scsi/sym53c8xx_2/sym_hipd.c
index f4854c33f48d..2627000ca653 100644
--- a/drivers/scsi/sym53c8xx_2/sym_hipd.c
+++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c
@@ -919,6 +919,8 @@ static int sym_prepare_setting(struct Scsi_Host *shost, struct sym_hcb *np, stru
919 919
920 tp->usrflags |= (SYM_DISC_ENABLED | SYM_TAGS_ENABLED); 920 tp->usrflags |= (SYM_DISC_ENABLED | SYM_TAGS_ENABLED);
921 tp->usrtags = SYM_SETUP_MAX_TAG; 921 tp->usrtags = SYM_SETUP_MAX_TAG;
922 tp->usr_width = np->maxwide;
923 tp->usr_period = 9;
922 924
923 sym_nvram_setup_target(tp, i, nvram); 925 sym_nvram_setup_target(tp, i, nvram);
924 926