aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOndrej Zary <linux@rainbow-software.org>2015-02-06 17:11:23 -0500
committerJames Bottomley <JBottomley@Odin.com>2015-04-09 21:03:11 -0400
commit6f82fbf3868712576f137ebdf0b9a72aa99b5935 (patch)
treeeea7d3c7e98452ecb25e289799919b2d844e9fa6
parent643a7c43f11ee776701e06410d7b3f9a41e5d284 (diff)
aha1542: remove dead code
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
-rw-r--r--drivers/scsi/aha1542.c243
-rw-r--r--drivers/scsi/aha1542.h6
2 files changed, 1 insertions, 248 deletions
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index b7a62daff063..506e33e9440f 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -570,13 +570,6 @@ static int aha1542_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *
570 570
571 if (*cmd == REQUEST_SENSE) { 571 if (*cmd == REQUEST_SENSE) {
572 /* Don't do the command - we have the sense data already */ 572 /* Don't do the command - we have the sense data already */
573#if 0
574 /* scsi_request_sense() provides a buffer of size 256,
575 so there is no reason to expect equality */
576 if (bufflen != SCSI_SENSE_BUFFERSIZE)
577 printk(KERN_CRIT "aha1542: Wrong buffer length supplied "
578 "for request sense (%d)\n", bufflen);
579#endif
580 SCpnt->result = 0; 573 SCpnt->result = 0;
581 done(SCpnt); 574 done(SCpnt);
582 return 0; 575 return 0;
@@ -1095,24 +1088,14 @@ static int aha1542_restart(struct Scsi_Host *shost)
1095{ 1088{
1096 int i; 1089 int i;
1097 int count = 0; 1090 int count = 0;
1098#if 0
1099 unchar ahacmd = CMD_START_SCSI;
1100#endif
1101 1091
1102 for (i = 0; i < AHA1542_MAILBOXES; i++) 1092 for (i = 0; i < AHA1542_MAILBOXES; i++)
1103 if (HOSTDATA(shost)->SCint[i] && 1093 if (HOSTDATA(shost)->SCint[i] &&
1104 !(HOSTDATA(shost)->SCint[i]->device->soft_reset)) { 1094 !(HOSTDATA(shost)->SCint[i]->device->soft_reset)) {
1105#if 0
1106 HOSTDATA(shost)->mb[i].status = 1; /* Indicate ready to restart... */
1107#endif
1108 count++; 1095 count++;
1109 } 1096 }
1110 printk(KERN_DEBUG "Potential to restart %d stalled commands...\n", count); 1097 printk(KERN_DEBUG "Potential to restart %d stalled commands...\n", count);
1111#if 0 1098
1112 /* start scsi command */
1113 if (count)
1114 aha1542_out(shost->io_port, &ahacmd, 1);
1115#endif
1116 return 0; 1099 return 0;
1117} 1100}
1118 1101
@@ -1177,39 +1160,6 @@ static int aha1542_dev_reset(Scsi_Cmnd * SCpnt)
1177 "Trying device reset for target\n"); 1160 "Trying device reset for target\n");
1178 1161
1179 return SUCCESS; 1162 return SUCCESS;
1180
1181
1182#ifdef ERIC_neverdef
1183 /*
1184 * With the 1542 we apparently never get an interrupt to
1185 * acknowledge a device reset being sent. Then again, Leonard
1186 * says we are doing this wrong in the first place...
1187 *
1188 * Take a wait and see attitude. If we get spurious interrupts,
1189 * then the device reset is doing something sane and useful, and
1190 * we will wait for the interrupt to post completion.
1191 */
1192 printk(KERN_WARNING "Sent BUS DEVICE RESET to target %d\n", SCpnt->target);
1193
1194 /*
1195 * Free the command block for all commands running on this
1196 * target...
1197 */
1198 for (i = 0; i < AHA1542_MAILBOXES; i++) {
1199 if (HOSTDATA(SCpnt->host)->SCint[i] &&
1200 HOSTDATA(SCpnt->host)->SCint[i]->target == SCpnt->target) {
1201 Scsi_Cmnd *SCtmp;
1202 SCtmp = HOSTDATA(SCpnt->host)->SCint[i];
1203 kfree(SCtmp->host_scribble);
1204 SCtmp->host_scribble = NULL;
1205 HOSTDATA(SCpnt->host)->SCint[i] = NULL;
1206 HOSTDATA(SCpnt->host)->mb[i].status = 0;
1207 }
1208 }
1209 return SUCCESS;
1210
1211 return FAILED;
1212#endif /* ERIC_neverdef */
1213} 1163}
1214 1164
1215static int aha1542_bus_reset(Scsi_Cmnd * SCpnt) 1165static int aha1542_bus_reset(Scsi_Cmnd * SCpnt)
@@ -1344,197 +1294,6 @@ fail:
1344 return FAILED; 1294 return FAILED;
1345} 1295}
1346 1296
1347#if 0
1348/*
1349 * These are the old error handling routines. They are only temporarily
1350 * here while we play with the new error handling code.
1351 */
1352static int aha1542_old_abort(Scsi_Cmnd * SCpnt)
1353{
1354#if 0
1355 unchar ahacmd = CMD_START_SCSI;
1356 unsigned long flags;
1357 struct mailbox *mb;
1358 int mbi, mbo, i;
1359
1360 printk(KERN_DEBUG "In aha1542_abort: %x %x\n",
1361 inb(STATUS(SCpnt->host->io_port)),
1362 inb(INTRFLAGS(SCpnt->host->io_port)));
1363
1364 spin_lock_irqsave(&aha1542_lock, flags);
1365 mb = HOSTDATA(SCpnt->host)->mb;
1366 mbi = HOSTDATA(SCpnt->host)->aha1542_last_mbi_used + 1;
1367 if (mbi >= 2 * AHA1542_MAILBOXES)
1368 mbi = AHA1542_MAILBOXES;
1369
1370 do {
1371 if (mb[mbi].status != 0)
1372 break;
1373 mbi++;
1374 if (mbi >= 2 * AHA1542_MAILBOXES)
1375 mbi = AHA1542_MAILBOXES;
1376 } while (mbi != HOSTDATA(SCpnt->host)->aha1542_last_mbi_used);
1377 spin_unlock_irqrestore(&aha1542_lock, flags);
1378
1379 if (mb[mbi].status) {
1380 printk(KERN_ERR "Lost interrupt discovered on irq %d - attempting to recover\n",
1381 SCpnt->host->irq);
1382 aha1542_intr_handle(SCpnt->host, NULL);
1383 return 0;
1384 }
1385 /* OK, no lost interrupt. Try looking to see how many pending commands
1386 we think we have. */
1387
1388 for (i = 0; i < AHA1542_MAILBOXES; i++)
1389 if (HOSTDATA(SCpnt->host)->SCint[i]) {
1390 if (HOSTDATA(SCpnt->host)->SCint[i] == SCpnt) {
1391 printk(KERN_ERR "Timed out command pending for %s\n",
1392 SCpnt->request->rq_disk ?
1393 SCpnt->request->rq_disk->disk_name : "?"
1394 );
1395 if (HOSTDATA(SCpnt->host)->mb[i].status) {
1396 printk(KERN_ERR "OGMB still full - restarting\n");
1397 aha1542_out(SCpnt->host->io_port, &ahacmd, 1);
1398 };
1399 } else
1400 printk(KERN_ERR "Other pending command %s\n",
1401 SCpnt->request->rq_disk ?
1402 SCpnt->request->rq_disk->disk_name : "?"
1403 );
1404 }
1405#endif
1406
1407 DEB(printk("aha1542_abort\n"));
1408#if 0
1409 spin_lock_irqsave(&aha1542_lock, flags);
1410 for (mbo = 0; mbo < AHA1542_MAILBOXES; mbo++) {
1411 if (SCpnt == HOSTDATA(SCpnt->host)->SCint[mbo]) {
1412 mb[mbo].status = 2; /* Abort command */
1413 aha1542_out(SCpnt->host->io_port, &ahacmd, 1); /* start scsi command */
1414 spin_unlock_irqrestore(&aha1542_lock, flags);
1415 break;
1416 }
1417 }
1418 if (AHA1542_MAILBOXES == mbo)
1419 spin_unlock_irqrestore(&aha1542_lock, flags);
1420#endif
1421 return SCSI_ABORT_SNOOZE;
1422}
1423
1424/* We do not implement a reset function here, but the upper level code
1425 assumes that it will get some kind of response for the command in
1426 SCpnt. We must oblige, or the command will hang the scsi system.
1427 For a first go, we assume that the 1542 notifies us with all of the
1428 pending commands (it does implement soft reset, after all). */
1429
1430static int aha1542_old_reset(Scsi_Cmnd * SCpnt, unsigned int reset_flags)
1431{
1432 unchar ahacmd = CMD_START_SCSI;
1433 int i;
1434
1435 /*
1436 * See if a bus reset was suggested.
1437 */
1438 if (reset_flags & SCSI_RESET_SUGGEST_BUS_RESET) {
1439 /*
1440 * This does a scsi reset for all devices on the bus.
1441 * In principle, we could also reset the 1542 - should
1442 * we do this? Try this first, and we can add that later
1443 * if it turns out to be useful.
1444 */
1445 outb(HRST | SCRST, CONTROL(SCpnt->host->io_port));
1446
1447 /*
1448 * Wait for the thing to settle down a bit. Unfortunately
1449 * this is going to basically lock up the machine while we
1450 * wait for this to complete. To be 100% correct, we need to
1451 * check for timeout, and if we are doing something like this
1452 * we are pretty desperate anyways.
1453 */
1454 WAIT(STATUS(SCpnt->host->io_port),
1455 STATMASK, INIT | IDLE, STST | DIAGF | INVDCMD | DF | CDF);
1456
1457 /*
1458 * We need to do this too before the 1542 can interact with
1459 * us again.
1460 */
1461 setup_mailboxes(SCpnt->host->io_port, SCpnt->host);
1462
1463 /*
1464 * Now try to pick up the pieces. Restart all commands
1465 * that are currently active on the bus, and reset all of
1466 * the datastructures. We have some time to kill while
1467 * things settle down, so print a nice message.
1468 */
1469 printk(KERN_WARNING "Sent BUS RESET to scsi host %d\n", SCpnt->host->host_no);
1470
1471 for (i = 0; i < AHA1542_MAILBOXES; i++)
1472 if (HOSTDATA(SCpnt->host)->SCint[i] != NULL) {
1473 Scsi_Cmnd *SCtmp;
1474 SCtmp = HOSTDATA(SCpnt->host)->SCint[i];
1475 SCtmp->result = DID_RESET << 16;
1476 kfree(SCtmp->host_scribble);
1477 SCtmp->host_scribble = NULL;
1478 printk(KERN_WARNING "Sending DID_RESET for target %d\n", SCpnt->target);
1479 SCtmp->scsi_done(SCpnt);
1480
1481 HOSTDATA(SCpnt->host)->SCint[i] = NULL;
1482 HOSTDATA(SCpnt->host)->mb[i].status = 0;
1483 }
1484 /*
1485 * Now tell the mid-level code what we did here. Since
1486 * we have restarted all of the outstanding commands,
1487 * then report SUCCESS.
1488 */
1489 return (SCSI_RESET_SUCCESS | SCSI_RESET_BUS_RESET);
1490fail:
1491 printk(KERN_CRIT "aha1542.c: Unable to perform hard reset.\n");
1492 printk(KERN_CRIT "Power cycle machine to reset\n");
1493 return (SCSI_RESET_ERROR | SCSI_RESET_BUS_RESET);
1494
1495
1496 } else {
1497 /* This does a selective reset of just the one device */
1498 /* First locate the ccb for this command */
1499 for (i = 0; i < AHA1542_MAILBOXES; i++)
1500 if (HOSTDATA(SCpnt->host)->SCint[i] == SCpnt) {
1501 HOSTDATA(SCpnt->host)->ccb[i].op = 0x81; /* BUS DEVICE RESET */
1502 /* Now tell the 1542 to flush all pending commands for this target */
1503 aha1542_out(SCpnt->host->io_port, &ahacmd, 1);
1504
1505 /* Here is the tricky part. What to do next. Do we get an interrupt
1506 for the commands that we aborted with the specified target, or
1507 do we generate this on our own? Try it without first and see
1508 what happens */
1509 printk(KERN_WARNING "Sent BUS DEVICE RESET to target %d\n", SCpnt->target);
1510
1511 /* If the first does not work, then try the second. I think the
1512 first option is more likely to be correct. Free the command
1513 block for all commands running on this target... */
1514 for (i = 0; i < AHA1542_MAILBOXES; i++)
1515 if (HOSTDATA(SCpnt->host)->SCint[i] &&
1516 HOSTDATA(SCpnt->host)->SCint[i]->target == SCpnt->target) {
1517 Scsi_Cmnd *SCtmp;
1518 SCtmp = HOSTDATA(SCpnt->host)->SCint[i];
1519 SCtmp->result = DID_RESET << 16;
1520 kfree(SCtmp->host_scribble);
1521 SCtmp->host_scribble = NULL;
1522 printk(KERN_WARNING "Sending DID_RESET for target %d\n", SCpnt->target);
1523 SCtmp->scsi_done(SCpnt);
1524
1525 HOSTDATA(SCpnt->host)->SCint[i] = NULL;
1526 HOSTDATA(SCpnt->host)->mb[i].status = 0;
1527 }
1528 return SCSI_RESET_SUCCESS;
1529 }
1530 }
1531 /* No active command at this time, so this means that each time we got
1532 some kind of response the last time through. Tell the mid-level code
1533 to request sense information in order to decide what to do next. */
1534 return SCSI_RESET_PUNT;
1535}
1536#endif /* end of big comment block around old_abort + old_reset */
1537
1538static int aha1542_biosparam(struct scsi_device *sdev, 1297static int aha1542_biosparam(struct scsi_device *sdev,
1539 struct block_device *bdev, sector_t capacity, int *ip) 1298 struct block_device *bdev, sector_t capacity, int *ip)
1540{ 1299{
diff --git a/drivers/scsi/aha1542.h b/drivers/scsi/aha1542.h
index 76e6abc944e8..af911258076b 100644
--- a/drivers/scsi/aha1542.h
+++ b/drivers/scsi/aha1542.h
@@ -100,12 +100,6 @@ static inline void any2scsi(u8 *p, u32 v)
100 100
101#define scsi2int(up) ( (((long)*(up)) << 16) + (((long)(up)[1]) << 8) + ((long)(up)[2]) ) 101#define scsi2int(up) ( (((long)*(up)) << 16) + (((long)(up)[1]) << 8) + ((long)(up)[2]) )
102 102
103#define xany2scsi(up, p) \
104(up)[0] = ((long)(p)) >> 24; \
105(up)[1] = ((long)(p)) >> 16; \
106(up)[2] = ((long)(p)) >> 8; \
107(up)[3] = ((long)(p));
108
109#define xscsi2int(up) ( (((long)(up)[0]) << 24) + (((long)(up)[1]) << 16) \ 103#define xscsi2int(up) ( (((long)(up)[0]) << 24) + (((long)(up)[1]) << 16) \
110 + (((long)(up)[2]) << 8) + ((long)(up)[3]) ) 104 + (((long)(up)[2]) << 8) + ((long)(up)[3]) )
111 105