]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
scsi: hisi_sas: fix return value of hisi_sas_task_prep()
authorXiaofei Tan <tanxiaofei@huawei.com>
Wed, 7 Mar 2018 12:25:11 +0000 (20:25 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 23 May 2018 09:11:59 +0000 (11:11 +0200)
commit9032ade4c315d05d078433e162bd3f89e4ac7069
tree0678628e404dd022658a221f74b6c49d80d4a9e9
parent6e6e6e563f5ab991034d3356c77d015b77b636e6
scsi: hisi_sas: fix return value of hisi_sas_task_prep()

BugLink: https://bugs.launchpad.net/bugs/1768974
It is an implicit regulation that error code that function returned should
be negative. But hisi_sas_task_prep() doesn't follow this.  This may cause
problems in the upper layer code.

For example, in sas_expander.c of libsas, smp_execute_task_sg() may return
the number of bytes of underrun. It will be conflicted with the scenaio
lldd_execute_task() return an positive error code.

This patch change the return value from SAS_PHY_DOWN to -ECOMM in
hisi_sas_task_prep().

Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 6bf6db518cd10ad57e659607d0abece1b81956c6)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/scsi/hisi_sas/hisi_sas_main.c