All of lore.kernel.org
 help / color / mirror / Atom feed
* Question about aborting commands
@ 2011-05-25 13:50 scameron
  2011-05-25 18:57 ` Peter Chang
  2011-05-25 20:24 ` scameron
  0 siblings, 2 replies; 4+ messages in thread
From: scameron @ 2011-05-25 13:50 UTC (permalink / raw)
  To: linux-scsi; +Cc: scameron


If a command is aborted by an abort error handler function in
a LLD, and the aborted command comes back from the HBA with a
status that indicates it was aborted, what status (in cmd->result,
and/or sense data?) is the mid layer expecting in such a case?

Just wondering, because in playing around with adding an abort
handler to the hpsa driver for controllers which are able to do
aborts, I can cause commands to be aborted, and I copy the
sense data back to the mid layer, and give it a
cmd->result = DID_ABORT << 16.  

That is, it's hitting this case in hpsa.c: complete_scsi_command()

        case CMD_ABORTED:
                cmd->result = DID_ABORT << 16;
                dev_warn(&h->pdev->dev, "cmd %s was aborted with "
                                "status 0x%x\n", fmtcmd, ei->ScsiStatus);

it does not seem to be hitting this case below, (same function).
That is, it's not getting a target status/check condition/aborted command.)

                        if (sense_key == ABORTED_COMMAND) {
                                /* Aborted command is retryable */
                                dev_warn(&h->pdev->dev, "cmd %s "
                                        "has check condition: aborted command: "
                                        "ASC: 0x%x, ASCQ: 0x%x\n",
                                        fmtcmd, asc, ascq);
                                cmd->result = DID_SOFT_ERROR << 16;
                                break;
                        }

And, I have a dd running which
I think I have aborted one of the commands that was reading data
for that dd, and yet the dd proceeds happily along, oblivious.
This makes me think I'm not doing the right thing to alert the
mid layer that the command got aborted -- or else the midlayer is
retrying the command somehow? I didn't see how this would happen,
but maybe I missed it.

Or, maybe I should be reporting the CMD_ABORTED case back as

	cmd->result = DID_SOFT_ERROR << 16;

-- steve


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-05-26 22:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-25 13:50 Question about aborting commands scameron
2011-05-25 18:57 ` Peter Chang
2011-05-25 20:24 ` scameron
2011-05-26 22:56   ` Mike Christie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.