diff options
author | Jens Axboe <axboe@kernel.dk> | 2017-06-23 09:18:54 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-06-23 09:18:54 -0600 |
commit | 8c66ac6a28a460273e1ad263bb05056dc0e68760 (patch) | |
tree | 0778d025344fed439505041f203c94a0813be86b /drivers/block | |
parent | f95a0d6a95b12a79b7492da7ab687ae4cd741124 (diff) | |
download | linux-stable-8c66ac6a28a460273e1ad263bb05056dc0e68760.tar.gz linux-stable-8c66ac6a28a460273e1ad263bb05056dc0e68760.tar.bz2 linux-stable-8c66ac6a28a460273e1ad263bb05056dc0e68760.zip |
mtip32xx: fix up the checking for internal command failure
This fixes up two commits that have touched this driver. The
command status field is now a blk_status_t, so we can't check
for < 0 and we definitely can't assume it's holding -Exxxx error
values. All we care about here is whether ->status is zero or not.
Check for that, and remove the various attempts at smart error
reporting. Just log to dmesg what command failed, and the
blk_status_t value.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 2a842acab109 ("block: introduce new block status code type")
Fixes: 3f5e6a35774c ("mtip32xx: convert internal command issue to block IO path")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/mtip32xx/mtip32xx.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index d8618a71da74..61b046f256ca 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -1063,23 +1063,10 @@ static int mtip_exec_internal_command(struct mtip_port *port, /* insert request and run queue */ blk_execute_rq(rq->q, NULL, rq, true); - rv = int_cmd->status; - if (rv < 0) { - if (rv == -ERESTARTSYS) { /* interrupted */ - dev_err(&dd->pdev->dev, - "Internal command [%02X] was interrupted after %u ms\n", - fis->command, - jiffies_to_msecs(jiffies - start)); - rv = -EINTR; - goto exec_ic_exit; - } else if (rv == 0) /* timeout */ - dev_err(&dd->pdev->dev, - "Internal command did not complete [%02X] within timeout of %lu ms\n", - fis->command, timeout); - else - dev_err(&dd->pdev->dev, - "Internal command [%02X] wait returned code [%d] after %lu ms - unhandled\n", - fis->command, rv, timeout); + if (int_cmd->status) { + dev_err(&dd->pdev->dev, "Internal command [%02X] failed %d\n", + fis->command, int_cmd->status); + rv = -EIO; if (mtip_check_surprise_removal(dd->pdev) || test_bit(MTIP_DDF_REMOVE_PENDING_BIT, |