]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
scsi: pm8001: Fix NCQ NON DATA command task initialization
authorDamien Le Moal <damien.lemoal@opensource.wdc.com>
Sun, 20 Feb 2022 03:17:53 +0000 (12:17 +0900)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:57:44 +0000 (11:57 +0200)
commit1af3bd5860ca57ebc46e014791e031031f5fb6ab
treeebc81a4b9c7e520a075617c247c6572aef7128c1
parentc694a51125fbed89be5bab08cbe623818768075c
scsi: pm8001: Fix NCQ NON DATA command task initialization

BugLink: https://bugs.launchpad.net/bugs/1969110
[ Upstream commit aa028141ab0bc62c44a84d42f09db35d82df82a2 ]

In the pm8001_chip_sata_req() and pm80xx_chip_sata_req() functions, all
tasks with a DMA direction of DMA_NONE (no data transfer) are initialized
using the ATAP value 0x04. However, NCQ NON DATA commands, while being
DMA_NONE commands are NCQ commands and need to be initialized using the
value 0x07 for ATAP, similarly to other NCQ commands.

Make sure that NCQ NON DATA command tasks are initialized similarly to
other NCQ commands by also testing the task "use_ncq" field in addition to
the DMA direction. While at it, reorganize the code into a chain of if -
else if - else to avoid useless affectations and debug messages.

Link: https://lore.kernel.org/r/20220220031810.738362-15-damien.lemoal@opensource.wdc.com
Fixes: dbf9bfe61571 ("[SCSI] pm8001: add SAS/SATA HBA driver")
Reviewed-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit e4fce9af88ec1eedae8be719cb1154bb6d45e686)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/scsi/pm8001/pm8001_hwi.c
drivers/scsi/pm8001/pm80xx_hwi.c