提交 17eb87d2 编写于 作者: S Scott Teel 提交者: James Bottomley

[SCSI] hpsa: fix task management for mode-1 ioaccell path

For "mode 1" io accelerated commands, the command tag is in
a different location than for commands that go down the normal
RAID path, so the abort handler needs to take this into account.
Signed-off-by: NScott Teel <scott.teel@hp.com>
Signed-off-by: NMike Miller <michael.miller@canonical.com>
Signed-off-by: NStephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
上级 2f6ae5cd
...@@ -2602,12 +2602,27 @@ static void swizzle_abort_tag(u8 *tag) ...@@ -2602,12 +2602,27 @@ static void swizzle_abort_tag(u8 *tag)
tag[7] = original_tag[4]; tag[7] = original_tag[4];
} }
static void hpsa_get_tag(struct ctlr_info *h,
struct CommandList *c, u32 *taglower, u32 *tagupper)
{
if (c->cmd_type == CMD_IOACCEL1) {
struct io_accel1_cmd *cm1 = (struct io_accel1_cmd *)
&h->ioaccel_cmd_pool[c->cmdindex];
*tagupper = cm1->Tag.upper;
*taglower = cm1->Tag.lower;
} else {
*tagupper = c->Header.Tag.upper;
*taglower = c->Header.Tag.lower;
}
}
static int hpsa_send_abort(struct ctlr_info *h, unsigned char *scsi3addr, static int hpsa_send_abort(struct ctlr_info *h, unsigned char *scsi3addr,
struct CommandList *abort, int swizzle) struct CommandList *abort, int swizzle)
{ {
int rc = IO_OK; int rc = IO_OK;
struct CommandList *c; struct CommandList *c;
struct ErrorInfo *ei; struct ErrorInfo *ei;
u32 tagupper, taglower;
c = cmd_special_alloc(h); c = cmd_special_alloc(h);
if (c == NULL) { /* trouble... */ if (c == NULL) { /* trouble... */
...@@ -2621,8 +2636,9 @@ static int hpsa_send_abort(struct ctlr_info *h, unsigned char *scsi3addr, ...@@ -2621,8 +2636,9 @@ static int hpsa_send_abort(struct ctlr_info *h, unsigned char *scsi3addr,
if (swizzle) if (swizzle)
swizzle_abort_tag(&c->Request.CDB[4]); swizzle_abort_tag(&c->Request.CDB[4]);
hpsa_scsi_do_simple_cmd_core(h, c); hpsa_scsi_do_simple_cmd_core(h, c);
hpsa_get_tag(h, abort, &taglower, &tagupper);
dev_dbg(&h->pdev->dev, "%s: Tag:0x%08x:%08x: do_simple_cmd_core completed.\n", dev_dbg(&h->pdev->dev, "%s: Tag:0x%08x:%08x: do_simple_cmd_core completed.\n",
__func__, abort->Header.Tag.upper, abort->Header.Tag.lower); __func__, tagupper, taglower);
/* no unmap needed here because no data xfer. */ /* no unmap needed here because no data xfer. */
ei = c->err_info; ei = c->err_info;
...@@ -2634,8 +2650,7 @@ static int hpsa_send_abort(struct ctlr_info *h, unsigned char *scsi3addr, ...@@ -2634,8 +2650,7 @@ static int hpsa_send_abort(struct ctlr_info *h, unsigned char *scsi3addr,
break; break;
default: default:
dev_dbg(&h->pdev->dev, "%s: Tag:0x%08x:%08x: interpreting error.\n", dev_dbg(&h->pdev->dev, "%s: Tag:0x%08x:%08x: interpreting error.\n",
__func__, abort->Header.Tag.upper, __func__, tagupper, taglower);
abort->Header.Tag.lower);
hpsa_scsi_interpret_error(c); hpsa_scsi_interpret_error(c);
rc = -1; rc = -1;
break; break;
...@@ -2747,6 +2762,7 @@ static int hpsa_eh_abort_handler(struct scsi_cmnd *sc) ...@@ -2747,6 +2762,7 @@ static int hpsa_eh_abort_handler(struct scsi_cmnd *sc)
struct scsi_cmnd *as; /* ptr to scsi cmd inside aborted command. */ struct scsi_cmnd *as; /* ptr to scsi cmd inside aborted command. */
char msg[256]; /* For debug messaging. */ char msg[256]; /* For debug messaging. */
int ml = 0; int ml = 0;
u32 tagupper, taglower;
/* Find the controller of the command to be aborted */ /* Find the controller of the command to be aborted */
h = sdev_to_hba(sc->device); h = sdev_to_hba(sc->device);
...@@ -2779,9 +2795,8 @@ static int hpsa_eh_abort_handler(struct scsi_cmnd *sc) ...@@ -2779,9 +2795,8 @@ static int hpsa_eh_abort_handler(struct scsi_cmnd *sc)
msg); msg);
return FAILED; return FAILED;
} }
hpsa_get_tag(h, abort, &taglower, &tagupper);
ml += sprintf(msg+ml, "Tag:0x%08x:%08x ", ml += sprintf(msg+ml, "Tag:0x%08x:%08x ", tagupper, taglower);
abort->Header.Tag.upper, abort->Header.Tag.lower);
as = (struct scsi_cmnd *) abort->scsi_cmd; as = (struct scsi_cmnd *) abort->scsi_cmd;
if (as != NULL) if (as != NULL)
ml += sprintf(msg+ml, "Command:0x%x SN:0x%lx ", ml += sprintf(msg+ml, "Command:0x%x SN:0x%lx ",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册