Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309611
b: refs/heads/master
c: d02e1f0
h: refs/heads/master
i:
  309609: f53aa48
  309607: 9563dc5
v: v3
  • Loading branch information
Asai Thambi S P authored and Jens Axboe committed May 31, 2012
1 parent a94f790 commit bea2415
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 971890f25834e1e81ccb97b9413d0c2852d49208
refs/heads/master: d02e1f0ad098b3b36853d639e9befeb273c63cc5
60 changes: 30 additions & 30 deletions trunk/drivers/block/mtip32xx/mtip32xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -781,13 +781,24 @@ static void mtip_handle_tfe(struct driver_data *dd)

/* Stop the timer to prevent command timeouts. */
del_timer(&port->cmd_timer);
set_bit(MTIP_PF_EH_ACTIVE_BIT, &port->flags);

if (test_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags) &&
test_bit(MTIP_TAG_INTERNAL, port->allocated)) {
cmd = &port->commands[MTIP_TAG_INTERNAL];
dbg_printk(MTIP_DRV_NAME " TFE for the internal command\n");

atomic_inc(&cmd->active); /* active > 1 indicates error */
if (cmd->comp_data && cmd->comp_func) {
cmd->comp_func(port, MTIP_TAG_INTERNAL,
cmd->comp_data, PORT_IRQ_TF_ERR);
}
goto handle_tfe_exit;
}

/* clear the tag accumulator */
memset(tagaccum, 0, SLOTBITS_IN_LONGS * sizeof(long));

/* Set eh_active */
set_bit(MTIP_PF_EH_ACTIVE_BIT, &port->flags);

/* Loop through all the groups */
for (group = 0; group < dd->slot_groups; group++) {
completed = readl(port->completed[group]);
Expand Down Expand Up @@ -939,6 +950,7 @@ static void mtip_handle_tfe(struct driver_data *dd)
}
print_tags(dd, "reissued (TFE)", tagaccum, cmd_cnt);

handle_tfe_exit:
/* clear eh_active */
clear_bit(MTIP_PF_EH_ACTIVE_BIT, &port->flags);
wake_up_interruptible(&port->svc_wait);
Expand Down Expand Up @@ -1328,22 +1340,6 @@ static int mtip_exec_internal_command(struct mtip_port *port,
}
rv = -EAGAIN;
}

if (readl(port->cmd_issue[MTIP_TAG_INTERNAL])
& (1 << MTIP_TAG_INTERNAL)) {
dev_warn(&port->dd->pdev->dev,
"Retiring internal command but CI is 1.\n");
if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT,
&port->dd->dd_flag)) {
hba_reset_nosleep(port->dd);
rv = -ENXIO;
} else {
mtip_restart_port(port);
rv = -EAGAIN;
}
goto exec_ic_exit;
}

} else {
/* Spin for <timeout> checking if command still outstanding */
timeout = jiffies + msecs_to_jiffies(timeout);
Expand All @@ -1360,21 +1356,25 @@ static int mtip_exec_internal_command(struct mtip_port *port,
rv = -ENXIO;
goto exec_ic_exit;
}
if (readl(port->mmio + PORT_IRQ_STAT) & PORT_IRQ_ERR) {
atomic_inc(&int_cmd->active); /* error */
break;
}
}
}

if (readl(port->cmd_issue[MTIP_TAG_INTERNAL])
if (atomic_read(&int_cmd->active) > 1) {
dev_err(&port->dd->pdev->dev,
"Internal command [%02X] failed\n", fis->command);
rv = -EIO;
}
if (readl(port->cmd_issue[MTIP_TAG_INTERNAL])
& (1 << MTIP_TAG_INTERNAL)) {
dev_err(&port->dd->pdev->dev,
"Internal command did not complete [atomic]\n");
rv = -ENXIO;
if (!test_bit(MTIP_DDF_REMOVE_PENDING_BIT,
&port->dd->dd_flag)) {
mtip_restart_port(port);
rv = -EAGAIN;
if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT,
&port->dd->dd_flag)) {
hba_reset_nosleep(port->dd);
rv = -ENXIO;
} else {
mtip_restart_port(port);
rv = -EAGAIN;
}
}
}
exec_ic_exit:
Expand Down

0 comments on commit bea2415

Please sign in to comment.