Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6

+90 -80
+52 -33
drivers/scsi/aha152x.c
··· 1260 1260 * Reset the bus 1261 1261 * 1262 1262 */ 1263 - static int aha152x_bus_reset(Scsi_Cmnd *SCpnt) 1263 + static int aha152x_bus_reset_host(struct Scsi_Host *shpnt) 1264 1264 { 1265 - struct Scsi_Host *shpnt = SCpnt->device->host; 1266 1265 unsigned long flags; 1267 1266 1268 1267 DO_LOCK(flags); 1269 1268 1270 1269 #if defined(AHA152X_DEBUG) 1271 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 1272 show_queues(shpnt); 1274 1273 } 1275 1274 #endif ··· 1276 1277 free_hard_reset_SCs(shpnt, &ISSUE_SC); 1277 1278 free_hard_reset_SCs(shpnt, &DISCONNECTED_SC); 1278 1279 1279 - DPRINTK(debug_eh, DEBUG_LEAD "resetting bus\n", CMDINFO(SCpnt)); 1280 + DPRINTK(debug_eh, KERN_DEBUG "scsi%d: resetting bus\n", shpnt->host_no); 1280 1281 1281 1282 SETPORT(SCSISEQ, SCSIRSTO); 1282 1283 mdelay(256); 1283 1284 SETPORT(SCSISEQ, 0); 1284 1285 mdelay(DELAY); 1285 1286 1286 - DPRINTK(debug_eh, DEBUG_LEAD "bus resetted\n", CMDINFO(SCpnt)); 1287 + DPRINTK(debug_eh, KERN_DEBUG "scsi%d: bus resetted\n", shpnt->host_no); 1287 1288 1288 1289 setup_expected_interrupts(shpnt); 1289 1290 if(HOSTDATA(shpnt)->commands==0) ··· 1294 1295 return SUCCESS; 1295 1296 } 1296 1297 1298 + /* 1299 + * Reset the bus 1300 + * 1301 + */ 1302 + static int aha152x_bus_reset(Scsi_Cmnd *SCpnt) 1303 + { 1304 + return aha152x_bus_reset_host(SCpnt->device->host); 1305 + } 1297 1306 1298 1307 /* 1299 1308 * Restore default values to the AIC-6260 registers and reset the fifos ··· 1344 1337 * Reset the host (bus and controller) 1345 1338 * 1346 1339 */ 1347 - int aha152x_host_reset(Scsi_Cmnd * SCpnt) 1340 + int aha152x_host_reset_host(struct Scsi_Host *shpnt) 1348 1341 { 1349 - #if defined(AHA152X_DEBUG) 1350 - struct Scsi_Host *shpnt = SCpnt->device->host; 1351 - #endif 1342 + DPRINTK(debug_eh, KERN_DEBUG "scsi%d: host reset\n", shpnt->host_no); 1352 1343 1353 - DPRINTK(debug_eh, DEBUG_LEAD "aha152x_host_reset(%p)\n", CMDINFO(SCpnt), SCpnt); 1344 + aha152x_bus_reset_host(shpnt); 1354 1345 1355 - aha152x_bus_reset(SCpnt); 1356 - 1357 - DPRINTK(debug_eh, DEBUG_LEAD "resetting ports\n", CMDINFO(SCpnt)); 1358 - reset_ports(SCpnt->device->host); 1346 + DPRINTK(debug_eh, KERN_DEBUG "scsi%d: resetting ports\n", shpnt->host_no); 1347 + reset_ports(shpnt); 1359 1348 1360 1349 return SUCCESS; 1350 + } 1351 + 1352 + /* 1353 + * Reset the host (bus and controller) 1354 + * 1355 + */ 1356 + static int aha152x_host_reset(Scsi_Cmnd *SCpnt) 1357 + { 1358 + return aha152x_host_reset_host(SCpnt->device->host); 1361 1359 } 1362 1360 1363 1361 /* ··· 1443 1431 { 1444 1432 int i; 1445 1433 for (i = 0; i<ARRAY_SIZE(aha152x_host); i++) { 1446 - struct Scsi_Host *shpnt = aha152x_host[i]; 1447 - if (shpnt && HOSTDATA(shpnt)->service) { 1448 - HOSTDATA(shpnt)->service=0; 1449 - is_complete(shpnt); 1450 - } 1434 + is_complete(aha152x_host[i]); 1451 1435 } 1452 1436 } 1453 1437 1454 1438 /* 1455 - * Interrupts handler 1439 + * Interrupt handler 1456 1440 * 1457 1441 */ 1458 - 1459 1442 static irqreturn_t intr(int irqno, void *dev_id, struct pt_regs *regs) 1460 1443 { 1461 1444 struct Scsi_Host *shpnt = lookup_irq(irqno); 1445 + unsigned long flags; 1462 1446 unsigned char rev, dmacntrl0; 1463 1447 1464 1448 if (!shpnt) { ··· 1480 1472 if ((rev == 0xFF) && (dmacntrl0 == 0xFF)) 1481 1473 return IRQ_NONE; 1482 1474 1475 + if( TESTLO(DMASTAT, INTSTAT) ) 1476 + return IRQ_NONE; 1477 + 1483 1478 /* no more interrupts from the controller, while we're busy. 1484 1479 INTEN is restored by the BH handler */ 1485 1480 CLRBITS(DMACNTRL0, INTEN); 1486 1481 1487 - #if 0 1488 - /* check if there is already something to be 1489 - serviced; should not happen */ 1490 - if(HOSTDATA(shpnt)->service) { 1491 - printk(KERN_ERR "aha152x%d: lost interrupt (%d)\n", HOSTNO, HOSTDATA(shpnt)->service); 1492 - show_queues(shpnt); 1482 + DO_LOCK(flags); 1483 + if( HOSTDATA(shpnt)->service==0 ) { 1484 + HOSTDATA(shpnt)->service=1; 1485 + 1486 + /* Poke the BH handler */ 1487 + INIT_WORK(&aha152x_tq, (void *) run, NULL); 1488 + schedule_work(&aha152x_tq); 1493 1489 } 1494 - #endif 1495 - 1496 - /* Poke the BH handler */ 1497 - HOSTDATA(shpnt)->service++; 1498 - INIT_WORK(&aha152x_tq, (void *) run, NULL); 1499 - schedule_work(&aha152x_tq); 1490 + DO_UNLOCK(flags); 1491 + 1500 1492 return IRQ_HANDLED; 1501 1493 } 1502 1494 ··· 2535 2527 unsigned long flags; 2536 2528 int pending; 2537 2529 2530 + if(!shpnt) 2531 + return; 2532 + 2538 2533 DO_LOCK(flags); 2534 + 2535 + if( HOSTDATA(shpnt)->service==0 ) { 2536 + DO_UNLOCK(flags); 2537 + return; 2538 + } 2539 + 2540 + HOSTDATA(shpnt)->service = 0; 2541 + 2539 2542 if(HOSTDATA(shpnt)->in_intr) { 2540 2543 DO_UNLOCK(flags); 2541 2544 /* aha152x_error never returns.. */
+1 -1
drivers/scsi/aha152x.h
··· 332 332 333 333 struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *); 334 334 void aha152x_release(struct Scsi_Host *); 335 - int aha152x_host_reset(Scsi_Cmnd *); 335 + int aha152x_host_reset_host(struct Scsi_Host *); 336 336 337 337 #endif /* _AHA152X_H */
-21
drivers/scsi/jazz_esp.c
··· 65 65 return 0; 66 66 } 67 67 68 - static 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 68 /***************************************************************** Detection */ 90 69 static int jazz_esp_detect(struct scsi_host_template *tpnt) 91 70 {
+15 -14
drivers/scsi/megaraid/megaraid_sas.c
··· 793 793 return 0; 794 794 } 795 795 796 + static 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 811 * megasas_wait_for_outstanding - Wait for all outstanding cmds 798 812 * @instance: Adapter soft state ··· 957 943 .module = THIS_MODULE, 958 944 .name = "LSI Logic SAS based MegaRAID driver", 959 945 .proc_name = "megaraid_sas", 946 + .slave_configure = megasas_slave_configure, 960 947 .queuecommand = megasas_queue_command, 961 948 .eh_device_reset_handler = megasas_reset_device, 962 949 .eh_bus_reset_handler = megasas_reset_bus_host, ··· 1084 1069 cmd->sync_cmd = 0; 1085 1070 megasas_complete_int_cmd(instance, cmd); 1086 1071 break; 1087 - } 1088 - 1089 - /* 1090 - * Don't export physical disk devices to mid-layer. 1091 - */ 1092 - if (!MEGASAS_IS_LOGICAL(cmd->scmd) && 1093 - (hdr->cmd_status == MFI_STAT_OK) && 1094 - (cmd->scmd->cmnd[0] == INQUIRY)) { 1095 - 1096 - if (((*(u8 *) cmd->scmd->request_buffer) & 0x1F) == 1097 - TYPE_DISK) { 1098 - cmd->scmd->result = DID_BAD_TARGET << 16; 1099 - exception = 1; 1100 - } 1101 1072 } 1102 1073 1103 1074 case MFI_CMD_LD_READ:
+1 -3
drivers/scsi/pcmcia/aha152x_stub.c
··· 275 275 276 276 link->state &= ~DEV_SUSPEND; 277 277 if (link->state & DEV_CONFIG) { 278 - Scsi_Cmnd tmp; 279 278 pcmcia_request_configuration(link->handle, &link->conf); 280 - tmp.device->host = info->host; 281 - aha152x_host_reset(&tmp); 279 + aha152x_host_reset_host(info->host); 282 280 } 283 281 284 282 return 0;
+2 -2
drivers/scsi/scsi_error.c
··· 1308 1308 * the request was not marked fast fail. Note that above, 1309 1309 * even if the request is marked fast fail, we still requeue 1310 1310 * for queue congestion conditions (QUEUE_FULL or BUSY) */ 1311 - if ((++scmd->retries) < scmd->allowed 1311 + if ((++scmd->retries) <= scmd->allowed 1312 1312 && !blk_noretry_request(scmd->request)) { 1313 1313 return NEEDS_RETRY; 1314 1314 } else { ··· 1433 1433 list_del_init(&scmd->eh_entry); 1434 1434 if (scsi_device_online(scmd->device) && 1435 1435 !blk_noretry_request(scmd->request) && 1436 - (++scmd->retries < scmd->allowed)) { 1436 + (++scmd->retries <= scmd->allowed)) { 1437 1437 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: flush" 1438 1438 " retry cmd: %p\n", 1439 1439 current->comm,
+1 -1
drivers/scsi/scsi_lib.c
··· 1498 1498 static void scsi_softirq_done(struct request *rq) 1499 1499 { 1500 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 1502 int disposition; 1503 1503 1504 1504 INIT_LIST_HEAD(&cmd->eh_entry);
+14 -2
drivers/scsi/scsi_scan.c
··· 752 752 753 753 transport_configure_device(&sdev->sdev_gendev); 754 754 755 - if (sdev->host->hostt->slave_configure) 756 - sdev->host->hostt->slave_configure(sdev); 755 + if (sdev->host->hostt->slave_configure) { 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 771 * Ok, the device is now all set up, we can
+1 -2
drivers/scsi/scsi_transport_fc.c
··· 1498 1498 } 1499 1499 1500 1500 /* Search the bindings array */ 1501 - if (likely((ids->roles & FC_RPORT_ROLE_FCP_TARGET) && 1502 - (fc_host_tgtid_bind_type(shost) != FC_TGTID_BIND_NONE))) { 1501 + if (fc_host_tgtid_bind_type(shost) != FC_TGTID_BIND_NONE) { 1503 1502 1504 1503 /* search for a matching consistent binding */ 1505 1504
+1 -1
drivers/scsi/sg.c
··· 2162 2162 2163 2163 srp->res_used = 1; 2164 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 2167 for (k = 0; k < rsv_schp->k_use_sg; ++k, ++sg) { 2168 2168 num = sg->length;
+2
drivers/scsi/sym53c8xx_2/sym_hipd.c
··· 919 919 920 920 tp->usrflags |= (SYM_DISC_ENABLED | SYM_TAGS_ENABLED); 921 921 tp->usrtags = SYM_SETUP_MAX_TAG; 922 + tp->usr_width = np->maxwide; 923 + tp->usr_period = 9; 922 924 923 925 sym_nvram_setup_target(tp, i, nvram); 924 926