diff options
author | Hannes Reinecke <hare@suse.de> | 2006-04-07 07:47:03 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-04-13 14:23:11 -0400 |
commit | b0d2364887e94c880680f1e17943cd660bcf8979 (patch) | |
tree | e47c89b7aabe572bc3a807b5cb74abca00382a71 /drivers/scsi | |
parent | 441f987ca4cdca9c72aaf32fdd0d0ca9ebf46e94 (diff) |
[SCSI] aic79xx: target hotplug fixes
When a target is added aic79xx tries to be overly clever: it changes
the command on the fly to TEST UNIT READY and tries to requeue the
original command. Sadly this breaks SCSI compability and of course
the midlayer is getting a bit confused by it.
So we're just removing that bit of code and let the midlayer deal with
it. It's clever enough by now. And the driver code is getting simpler.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx.h | 2 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_core.c | 52 |
2 files changed, 10 insertions, 44 deletions
diff --git a/drivers/scsi/aic7xxx/aic79xx.h b/drivers/scsi/aic7xxx/aic79xx.h index 933e5101edf6..bb5166da4358 100644 --- a/drivers/scsi/aic7xxx/aic79xx.h +++ b/drivers/scsi/aic7xxx/aic79xx.h | |||
@@ -589,7 +589,7 @@ typedef enum { | |||
589 | SCB_PACKETIZED = 0x00800, | 589 | SCB_PACKETIZED = 0x00800, |
590 | SCB_EXPECT_PPR_BUSFREE = 0x01000, | 590 | SCB_EXPECT_PPR_BUSFREE = 0x01000, |
591 | SCB_PKT_SENSE = 0x02000, | 591 | SCB_PKT_SENSE = 0x02000, |
592 | SCB_CMDPHASE_ABORT = 0x04000, | 592 | SCB_EXTERNAL_RESET = 0x04000,/* Device was reset externally */ |
593 | SCB_ON_COL_LIST = 0x08000, | 593 | SCB_ON_COL_LIST = 0x08000, |
594 | SCB_SILENT = 0x10000 /* | 594 | SCB_SILENT = 0x10000 /* |
595 | * Be quiet about transmission type | 595 | * Be quiet about transmission type |
diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c index 880a10def1aa..08771f6f6859 100644 --- a/drivers/scsi/aic7xxx/aic79xx_core.c +++ b/drivers/scsi/aic7xxx/aic79xx_core.c | |||
@@ -1053,12 +1053,10 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) | |||
1053 | * If a target takes us into the command phase | 1053 | * If a target takes us into the command phase |
1054 | * assume that it has been externally reset and | 1054 | * assume that it has been externally reset and |
1055 | * has thus lost our previous packetized negotiation | 1055 | * has thus lost our previous packetized negotiation |
1056 | * agreement. Since we have not sent an identify | 1056 | * agreement. |
1057 | * message and may not have fully qualified the | 1057 | * Revert to async/narrow transfers until we |
1058 | * connection, we change our command to TUR, assert | 1058 | * can renegotiate with the device and notify |
1059 | * ATN and ABORT the task when we go to message in | 1059 | * the OSM about the reset. |
1060 | * phase. The OSM will see the REQUEUE_REQUEST | ||
1061 | * status and retry the command. | ||
1062 | */ | 1060 | */ |
1063 | scbid = ahd_get_scbptr(ahd); | 1061 | scbid = ahd_get_scbptr(ahd); |
1064 | scb = ahd_lookup_scb(ahd, scbid); | 1062 | scb = ahd_lookup_scb(ahd, scbid); |
@@ -1085,31 +1083,15 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) | |||
1085 | ahd_set_syncrate(ahd, &devinfo, /*period*/0, | 1083 | ahd_set_syncrate(ahd, &devinfo, /*period*/0, |
1086 | /*offset*/0, /*ppr_options*/0, | 1084 | /*offset*/0, /*ppr_options*/0, |
1087 | AHD_TRANS_ACTIVE, /*paused*/TRUE); | 1085 | AHD_TRANS_ACTIVE, /*paused*/TRUE); |
1088 | ahd_outb(ahd, SCB_CDB_STORE, 0); | 1086 | scb->flags |= SCB_EXTERNAL_RESET; |
1089 | ahd_outb(ahd, SCB_CDB_STORE+1, 0); | ||
1090 | ahd_outb(ahd, SCB_CDB_STORE+2, 0); | ||
1091 | ahd_outb(ahd, SCB_CDB_STORE+3, 0); | ||
1092 | ahd_outb(ahd, SCB_CDB_STORE+4, 0); | ||
1093 | ahd_outb(ahd, SCB_CDB_STORE+5, 0); | ||
1094 | ahd_outb(ahd, SCB_CDB_LEN, 6); | ||
1095 | scb->hscb->control &= ~(TAG_ENB|SCB_TAG_TYPE); | ||
1096 | scb->hscb->control |= MK_MESSAGE; | ||
1097 | ahd_outb(ahd, SCB_CONTROL, scb->hscb->control); | ||
1098 | ahd_outb(ahd, MSG_OUT, HOST_MSG); | ||
1099 | ahd_outb(ahd, SAVED_SCSIID, scb->hscb->scsiid); | ||
1100 | /* | ||
1101 | * The lun is 0, regardless of the SCB's lun | ||
1102 | * as we have not sent an identify message. | ||
1103 | */ | ||
1104 | ahd_outb(ahd, SAVED_LUN, 0); | ||
1105 | ahd_outb(ahd, SEQ_FLAGS, 0); | ||
1106 | ahd_assert_atn(ahd); | ||
1107 | scb->flags &= ~SCB_PACKETIZED; | ||
1108 | scb->flags |= SCB_ABORT|SCB_CMDPHASE_ABORT; | ||
1109 | ahd_freeze_devq(ahd, scb); | 1087 | ahd_freeze_devq(ahd, scb); |
1110 | ahd_set_transaction_status(scb, CAM_REQUEUE_REQ); | 1088 | ahd_set_transaction_status(scb, CAM_REQUEUE_REQ); |
1111 | ahd_freeze_scb(scb); | 1089 | ahd_freeze_scb(scb); |
1112 | 1090 | ||
1091 | /* Notify XPT */ | ||
1092 | ahd_send_async(ahd, devinfo.channel, devinfo.target, | ||
1093 | CAM_LUN_WILDCARD, AC_SENT_BDR, NULL); | ||
1094 | |||
1113 | /* | 1095 | /* |
1114 | * Allow the sequencer to continue with | 1096 | * Allow the sequencer to continue with |
1115 | * non-pack processing. | 1097 | * non-pack processing. |
@@ -2218,22 +2200,6 @@ ahd_handle_nonpkt_busfree(struct ahd_softc *ahd) | |||
2218 | if (sent_msg == MSG_ABORT_TAG) | 2200 | if (sent_msg == MSG_ABORT_TAG) |
2219 | tag = SCB_GET_TAG(scb); | 2201 | tag = SCB_GET_TAG(scb); |
2220 | 2202 | ||
2221 | if ((scb->flags & SCB_CMDPHASE_ABORT) != 0) { | ||
2222 | /* | ||
2223 | * This abort is in response to an | ||
2224 | * unexpected switch to command phase | ||
2225 | * for a packetized connection. Since | ||
2226 | * the identify message was never sent, | ||
2227 | * "saved lun" is 0. We really want to | ||
2228 | * abort only the SCB that encountered | ||
2229 | * this error, which could have a different | ||
2230 | * lun. The SCB will be retried so the OS | ||
2231 | * will see the UA after renegotiating to | ||
2232 | * packetized. | ||
2233 | */ | ||
2234 | tag = SCB_GET_TAG(scb); | ||
2235 | saved_lun = scb->hscb->lun; | ||
2236 | } | ||
2237 | found = ahd_abort_scbs(ahd, target, 'A', saved_lun, | 2203 | found = ahd_abort_scbs(ahd, target, 'A', saved_lun, |
2238 | tag, ROLE_INITIATOR, | 2204 | tag, ROLE_INITIATOR, |
2239 | CAM_REQ_ABORTED); | 2205 | CAM_REQ_ABORTED); |