From: Sascha Hauer Date: Fri, 8 May 2020 05:28:19 +0000 (+0200) Subject: ata: sata_nv: Fix retrieving of active qcs X-Git-Tag: v5.4.75~193 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=87d9ac94c7e77fb44d275912f467376cc115c840;p=users%2Fdwmw2%2Flinux.git ata: sata_nv: Fix retrieving of active qcs [ Upstream commit 8e4c309f9f33b76c09daa02b796ef87918eee494 ] ata_qc_complete_multiple() has to be called with the tags physically active, that is the hw tag is at bit 0. ap->qc_active has the same tag at bit ATA_TAG_INTERNAL instead, so call ata_qc_get_active() to fix that up. This is done in the vein of 8385d756e114 ("libata: Fix retrieving of active qcs"). Fixes: 28361c403683 ("libata: add extra internal command") Tested-by: Pali Rohár Signed-off-by: Sascha Hauer Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c index 18b147c182b96..0514aa7e80e39 100644 --- a/drivers/ata/sata_nv.c +++ b/drivers/ata/sata_nv.c @@ -2100,7 +2100,7 @@ static int nv_swncq_sdbfis(struct ata_port *ap) pp->dhfis_bits &= ~done_mask; pp->dmafis_bits &= ~done_mask; pp->sdbfis_bits |= done_mask; - ata_qc_complete_multiple(ap, ap->qc_active ^ done_mask); + ata_qc_complete_multiple(ap, ata_qc_get_active(ap) ^ done_mask); if (!ap->qc_active) { DPRINTK("over\n");