diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/mvsas/mv_sas.c | 11 | ||||
-rw-r--r-- | drivers/scsi/mvsas/mv_sas.h | 1 |
2 files changed, 9 insertions, 3 deletions
diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c index f14665a6293d..6b1b4e91e53f 100644 --- a/drivers/scsi/mvsas/mv_sas.c +++ b/drivers/scsi/mvsas/mv_sas.c | |||
@@ -1857,11 +1857,16 @@ int mvs_slot_complete(struct mvs_info *mvi, u32 rx_desc, u32 flags) | |||
1857 | goto out; | 1857 | goto out; |
1858 | } | 1858 | } |
1859 | 1859 | ||
1860 | /* error info record present */ | 1860 | /* |
1861 | if (unlikely((rx_desc & RXQ_ERR) && (*(u64 *) slot->response))) { | 1861 | * error info record present; slot->response is 32 bit aligned but may |
1862 | * not be 64 bit aligned, so check for zero in two 32 bit reads | ||
1863 | */ | ||
1864 | if (unlikely((rx_desc & RXQ_ERR) | ||
1865 | && (*((u32 *)slot->response) | ||
1866 | || *(((u32 *)slot->response) + 1)))) { | ||
1862 | mv_dprintk("port %d slot %d rx_desc %X has error info" | 1867 | mv_dprintk("port %d slot %d rx_desc %X has error info" |
1863 | "%016llX.\n", slot->port->sas_port.id, slot_idx, | 1868 | "%016llX.\n", slot->port->sas_port.id, slot_idx, |
1864 | rx_desc, (u64)(*(u64 *)slot->response)); | 1869 | rx_desc, get_unaligned_le64(slot->response)); |
1865 | tstat->stat = mvs_slot_err(mvi, task, slot_idx); | 1870 | tstat->stat = mvs_slot_err(mvi, task, slot_idx); |
1866 | tstat->resp = SAS_TASK_COMPLETE; | 1871 | tstat->resp = SAS_TASK_COMPLETE; |
1867 | goto out; | 1872 | goto out; |
diff --git a/drivers/scsi/mvsas/mv_sas.h b/drivers/scsi/mvsas/mv_sas.h index 60e2fb7f2dca..d6b19dc80bee 100644 --- a/drivers/scsi/mvsas/mv_sas.h +++ b/drivers/scsi/mvsas/mv_sas.h | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/irq.h> | 39 | #include <linux/irq.h> |
40 | #include <linux/slab.h> | 40 | #include <linux/slab.h> |
41 | #include <linux/vmalloc.h> | 41 | #include <linux/vmalloc.h> |
42 | #include <asm/unaligned.h> | ||
42 | #include <scsi/libsas.h> | 43 | #include <scsi/libsas.h> |
43 | #include <scsi/scsi.h> | 44 | #include <scsi/scsi.h> |
44 | #include <scsi/scsi_tcq.h> | 45 | #include <scsi/scsi_tcq.h> |