From mboxrd@z Thu Jan 1 00:00:00 1970 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=unavailable 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 D2107C388F9 for ; Tue, 3 Nov 2020 20:53:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 883CE2053B for ; Tue, 3 Nov 2020 20:53:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604436817; bh=pad5wb2kwB7Ic5WG+XZQfY9Tr/exb1vs9d3gQhxGlKc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=CuCxOOxBIw82p+UW925riXrjpinWYnXzK/Ln/vywIiSc1slmY3ccxBI94pIzFB31m eZIn3vZWkGqg7k1ii1aZkGyvWxkoyLPlaG6t+NPc69MnU/+BbsuQx3rIMmjAyvygAA bKYlIzuRRkRwxY+p+K1O+JpENMm68BewuiEOq/fk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732395AbgKCUxf (ORCPT ); Tue, 3 Nov 2020 15:53:35 -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