From patchwork Tue Nov 3 20:35:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 317109 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE699C2D0A3 for ; Tue, 3 Nov 2020 21:04:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A87DF2236F for ; Tue, 3 Nov 2020 21:04:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437477; bh=4QZvZJNefxpLQmb5bdwsvFumMXg2nUnNIhRGW+TTBxg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=wj2+b3zNwq6x8mfq+7oZ7Ygv8ZMkMc6Mn5fUiO6JzkEVqzSc0kBou72XRVa2Yyfm2 h58FFhkjZHOJXfyXplAD5YJmOoBiFQnnSnBRZMp7KyFXUyBbYW7Vm1ZWQb5l+dOBwr A7t+IECSabcP+cTpuzc/P7JCfwNjK0kk6N1FMqqw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732459AbgKCVEg (ORCPT ); Tue, 3 Nov 2020 16:04:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:42624 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387627AbgKCVEc (ORCPT ); Tue, 3 Nov 2020 16:04:32 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 02D9A20658; Tue, 3 Nov 2020 21:04:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437472; bh=4QZvZJNefxpLQmb5bdwsvFumMXg2nUnNIhRGW+TTBxg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eCfDB/VTM7lXDUUwmoZ8JXQYzKl/h7fXhfLOgwJq3CMoc1AI6vS+n44+QgDZL9VtS ftiFG0FVhSmZdKpUtEs5yG+YxcaG1QzNgH1N7omngiMmvccvFOpXK4WFi1HkXkCZ9B Vac485fBQscJ/MlJ2r1s2oZwQSyxCBe5q5a+8CNk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?utf-8?q?Pali_Roh=C3=A1r?= , Sascha Hauer , Jens Axboe , Sasha Levin Subject: [PATCH 4.19 053/191] ata: sata_nv: Fix retrieving of active qcs Date: Tue, 3 Nov 2020 21:35:45 +0100 Message-Id: <20201103203239.510532893@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203232.656475008@linuxfoundation.org> References: <20201103203232.656475008@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Sascha Hauer [ 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 --- drivers/ata/sata_nv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c index 798d549435cc1..2248a40631bf1 100644 --- a/drivers/ata/sata_nv.c +++ b/drivers/ata/sata_nv.c @@ -2122,7 +2122,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");