Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp831277pxb; Tue, 3 Nov 2020 13:48:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJztejB7jcMtgyADerAwq1rZl4Ex4ydCmfUbOZuyBdgTryHQRe8ChDSzBXNlTfMF1TZ1yxhf X-Received: by 2002:a17:906:840e:: with SMTP id n14mr9792421ejx.147.1604440117701; Tue, 03 Nov 2020 13:48:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604440117; cv=none; d=google.com; s=arc-20160816; b=LbHB1iHbyVpOA/FgA6rfn7VLaxyAwItlcT5IMSKbOkhmu/JINc1FwgUlB3/eABOsmu yUoXQU5EUx1d+r/G9F7YKducVpxGIn5ThOdMhWKq23ynd7I0xiDibAJjUMlUEQXGfBzR gnqKMtAmKQcgAB3sCTAI82uw5JvnXaKQz9Rj1PMk0S2Loc/OJfNWXPUGv9zgfbxTI/Sa OhEn9hfhzullm770ZIsrLFFn150jDBmm+rEzVnnHtYEugPgYjiXTApOIk6+GUCNlsGhz 1i3p7q/rdTiRoP9I93J92BHtvp1TkuLV5smg7fDJ6Nx7/ykgxjb7PPMHxouMak/jIvVn 52pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZL16EEIXY06nGCtLIA13/4gVfj+Su5jzNLhhDQzbKrc=; b=LKXyaOXeZ7mgJ4zLQBvfDUjxyhyfTE/ybpk8Xpbus862Vp8nebeF2UeXBw0mVZ372s PqF1Ahz71SNuw4Ynd5TDqxuzOt8wI+AP9oBGex3v/iZFnXkdJCFWKGctx6mFgMYxVVg5 Z2Kw5/EcyFIAUS95lMhclAyf8gxKPyJuM52/E1IoQ56NH7FTGw5C85/CByBb7TW9VFuE NJU7SoArriqNrXRv69IqDoqq0h/nNJcbYXarSDCLUwjZV3zQhsu7eTLsCQItRN9u3IJe 9cK/RYRz0I4vwWHFTdc4AFC7aXzez5jcbF+RhXpPJjkqq3b8C1OGcTQOrJDEwd/tjUkc 4Eog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=v4uM06+A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g17si60593ejr.328.2020.11.03.13.48.14; Tue, 03 Nov 2020 13:48:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=v4uM06+A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732366AbgKCUxe (ORCPT + 99 others); Tue, 3 Nov 2020 15:53:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:51298 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732263AbgKCUxZ (ORCPT ); Tue, 3 Nov 2020 15:53:25 -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 27EE8223BD; Tue, 3 Nov 2020 20:53:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604436804; bh=pad5wb2kwB7Ic5WG+XZQfY9Tr/exb1vs9d3gQhxGlKc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v4uM06+Axn6FxO/71068x6mjBY1Vf95ZEPbStHKkxXU4uRaKJu8GK5s4+C6CBLMZN SRKiA4qKF/Hmovn4aj/oQl5WG9XOv6yPMzJz4t2k5MoNBbp3h2x3B/JfJ2MZibyplB 1kEe4mDLQZaeK8V/8hyxLz4VLw3btxhmvSDqy7KY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= , Sascha Hauer , Jens Axboe , Sasha Levin Subject: [PATCH 5.4 019/214] ata: sata_nv: Fix retrieving of active qcs Date: Tue, 3 Nov 2020 21:34:27 +0100 Message-Id: <20201103203251.704787997@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203249.448706377@linuxfoundation.org> References: <20201103203249.448706377@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 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"); -- 2.27.0