提交 1d7794ae 编写于 作者: M Mahesh Rajashekhara 提交者: Zheng Zengkai

scsi: smartpqi: Fix DMA direction for RAID requests

stable inclusion
from stable-v5.10.137
commit 2fe0b06c166cdbec3bae72f38ff509c2187a5e63
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I60PLB

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=2fe0b06c166cdbec3bae72f38ff509c2187a5e63

--------------------------------

[ Upstream commit 69695aea ]

Correct a SOP READ and WRITE DMA flags for some requests.

This update corrects DMA direction issues with SCSI commands removed from
the controller's internal lookup table.

Currently, SCSI READ BLOCK LIMITS (0x5) was removed from the controller
lookup table and exposed a DMA direction flag issue.

SCSI READ BLOCK LIMITS was recently removed from our controller lookup
table so the controller uses the respective IU flag field to set the DMA
data direction. Since the DMA direction is incorrect the FW never completes
the request causing a hang.

Some SCSI commands which use SCSI READ BLOCK LIMITS

      * sg_map
      * mt -f /dev/stX status

After updating controller firmware, users may notice their tape units
failing. This patch resolves the issue.

Also, the AIO path DMA direction is correct.

The DMA direction flag is a day-one bug with no reported BZ.

Fixes: 6c223761 ("smartpqi: initial commit of Microsemi smartpqi driver")
Link: https://lore.kernel.org/r/165730605618.177165.9054223644512926624.stgit@brunhildaReviewed-by: NScott Benesh <scott.benesh@microchip.com>
Reviewed-by: NScott Teel <scott.teel@microchip.com>
Reviewed-by: NMike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: NKevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: NMahesh Rajashekhara <Mahesh.Rajashekhara@microchip.com>
Signed-off-by: NDon Brace <don.brace@microchip.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
上级 e0ad3adc
...@@ -4997,10 +4997,10 @@ static int pqi_raid_submit_scsi_cmd_with_io_request( ...@@ -4997,10 +4997,10 @@ static int pqi_raid_submit_scsi_cmd_with_io_request(
} }
switch (scmd->sc_data_direction) { switch (scmd->sc_data_direction) {
case DMA_TO_DEVICE: case DMA_FROM_DEVICE:
request->data_direction = SOP_READ_FLAG; request->data_direction = SOP_READ_FLAG;
break; break;
case DMA_FROM_DEVICE: case DMA_TO_DEVICE:
request->data_direction = SOP_WRITE_FLAG; request->data_direction = SOP_WRITE_FLAG;
break; break;
case DMA_NONE: case DMA_NONE:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册