Skip to content

Commit b0d2364

Browse files
hreineckeJames Bottomley
authored andcommitted
[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>
1 parent 441f987 commit b0d2364

File tree

2 files changed

+10
-44
lines changed

2 files changed

+10
-44
lines changed

drivers/scsi/aic7xxx/aic79xx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ typedef enum {
589589
SCB_PACKETIZED = 0x00800,
590590
SCB_EXPECT_PPR_BUSFREE = 0x01000,
591591
SCB_PKT_SENSE = 0x02000,
592-
SCB_CMDPHASE_ABORT = 0x04000,
592+
SCB_EXTERNAL_RESET = 0x04000,/* Device was reset externally */
593593
SCB_ON_COL_LIST = 0x08000,
594594
SCB_SILENT = 0x10000 /*
595595
* Be quiet about transmission type

drivers/scsi/aic7xxx/aic79xx_core.c

Lines changed: 9 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,12 +1053,10 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat)
10531053
* If a target takes us into the command phase
10541054
* assume that it has been externally reset and
10551055
* has thus lost our previous packetized negotiation
1056-
* agreement. Since we have not sent an identify
1057-
* message and may not have fully qualified the
1058-
* connection, we change our command to TUR, assert
1059-
* ATN and ABORT the task when we go to message in
1060-
* phase. The OSM will see the REQUEUE_REQUEST
1061-
* status and retry the command.
1056+
* agreement.
1057+
* Revert to async/narrow transfers until we
1058+
* can renegotiate with the device and notify
1059+
* the OSM about the reset.
10621060
*/
10631061
scbid = ahd_get_scbptr(ahd);
10641062
scb = ahd_lookup_scb(ahd, scbid);
@@ -1085,31 +1083,15 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat)
10851083
ahd_set_syncrate(ahd, &devinfo, /*period*/0,
10861084
/*offset*/0, /*ppr_options*/0,
10871085
AHD_TRANS_ACTIVE, /*paused*/TRUE);
1088-
ahd_outb(ahd, SCB_CDB_STORE, 0);
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;
1086+
scb->flags |= SCB_EXTERNAL_RESET;
11091087
ahd_freeze_devq(ahd, scb);
11101088
ahd_set_transaction_status(scb, CAM_REQUEUE_REQ);
11111089
ahd_freeze_scb(scb);
11121090

1091+
/* Notify XPT */
1092+
ahd_send_async(ahd, devinfo.channel, devinfo.target,
1093+
CAM_LUN_WILDCARD, AC_SENT_BDR, NULL);
1094+
11131095
/*
11141096
* Allow the sequencer to continue with
11151097
* non-pack processing.
@@ -2218,22 +2200,6 @@ ahd_handle_nonpkt_busfree(struct ahd_softc *ahd)
22182200
if (sent_msg == MSG_ABORT_TAG)
22192201
tag = SCB_GET_TAG(scb);
22202202

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-
}
22372203
found = ahd_abort_scbs(ahd, target, 'A', saved_lun,
22382204
tag, ROLE_INITIATOR,
22392205
CAM_REQ_ABORTED);

0 commit comments

Comments
 (0)