Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3771793pxt; Tue, 10 Aug 2021 10:58:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6ixoSLKJ1GsIBwW6WuQjjOCY8yNaj4zliUt4BXEMcHYZiAog/mU08682r+HDP/VwG71sc X-Received: by 2002:aa7:db13:: with SMTP id t19mr6368363eds.72.1628618290573; Tue, 10 Aug 2021 10:58:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628618290; cv=none; d=google.com; s=arc-20160816; b=zho1fw+i9q+etmX4RqbU/oH1B2BeVRFZzREkK4+izA33o3CgkJyoHN25+HEN3kt3Va lngN+282UdHMMeUh1motXix+w++9CdftQeZXbyHvfSpe+xqeuv4thgVqO/WU/4ZqFZwR Ey7v3Y1F798CMTFidqHpW+skbr+Nxj5LyHQGwak9/CZ4/FZb17QsYBzzqAZG4aqKoVHs Q0WX14eIY9E/ONv40e805qK2XrBbqtnE78jZUCyc3BVid2daaJ8QvRf9KIjApk8fghaZ d/K4yyyub67pVWlbkm8z1ZhrqdTkBnFSpta55RCh2d8FllRPE/bjEEE+SKjhg/AN4K9i f44Q== 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=T8VdT+XywfrpIKLlUZKSc6FKMOsYhFZ9JowR75mZ6Rg=; b=Pd22e9z1UMJnLFWciJG8xntqnSh8IVqfR3JqpPZPlOg351EVupyXgR/RCk+RZ9G8FO ZVGBj4pXA/o8CDjd69tSeZzMNV4mwjOAWNFrexv97oViugbu5g8YbV59mKiUnXw5qzLP ULQguxoTTipzrlnyIVXrhlBOeg6BOeL85ocawRaMWFJc3+XkrRq/2AWFILX3IiBpTq5A 4Nwn3jgtbsk5PbcYxDgB0YB2Bbi5wyCWm5JCYN+6h6Jowgy+AGGpO3D9tEx2R1Z3jUxX WyHng+h6ITKKRUpaIX5U0cWD3ytgmyezxHVxEwmxXeVls2V6h9N1T1lKtsClalGjuCcq ZEnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=EcCQ7NB4; 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=pass (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 h8si22943574ejj.422.2021.08.10.10.57.42; Tue, 10 Aug 2021 10:58:10 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=EcCQ7NB4; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237398AbhHJRye (ORCPT + 99 others); Tue, 10 Aug 2021 13:54:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:43682 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233479AbhHJRuq (ORCPT ); Tue, 10 Aug 2021 13:50:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E67DA611C5; Tue, 10 Aug 2021 17:42:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628617367; bh=xXL8ePronqgP4Q5UI0RrObOC2fXpJugQd8r/svqQrYA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EcCQ7NB4EMK/ZrbtNTAx9gg5uQnSXUGz0OBxT9NJSjE28JubtH9aQxKra0UPg8/MC EhkN3z3R4CHPe4bzHfGipGBR4RBIr1vo4aGmE7lxK4m99q1ZluqGpHw5ILb/g8RpOW ZC4UanlHnJZtgHE03vq5C6efmEEJTxCxYqguYVXA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dave Jiang , Vinod Koul , Sasha Levin Subject: [PATCH 5.13 006/175] dmaengine: idxd: fix array index when int_handles are being used Date: Tue, 10 Aug 2021 19:28:34 +0200 Message-Id: <20210810173001.152548365@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810173000.928681411@linuxfoundation.org> References: <20210810173000.928681411@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: Dave Jiang [ Upstream commit da435aedb00a4ef61019ff11ae0c08ffb9b1fb18 ] The index to the irq vector should be local and has no relation to the assigned interrupt handle. Assign the MSIX interrupt index that is programmed for the descriptor. The interrupt handle only matters when it comes to hardware descriptor programming. Fixes: eb15e7154fbf ("dmaengine: idxd: add interrupt handle request and release support") Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/162456176939.1121476.3366256009925001897.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/idxd/submit.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/dma/idxd/submit.c b/drivers/dma/idxd/submit.c index 19afb62abaff..e29887528077 100644 --- a/drivers/dma/idxd/submit.c +++ b/drivers/dma/idxd/submit.c @@ -128,19 +128,8 @@ int idxd_submit_desc(struct idxd_wq *wq, struct idxd_desc *desc) * Pending the descriptor to the lockless list for the irq_entry * that we designated the descriptor to. */ - if (desc->hw->flags & IDXD_OP_FLAG_RCI) { - int vec; - - /* - * If the driver is on host kernel, it would be the value - * assigned to interrupt handle, which is index for MSIX - * vector. If it's guest then can't use the int_handle since - * that is the index to IMS for the entire device. The guest - * device local index will be used. - */ - vec = !idxd->int_handles ? desc->hw->int_handle : desc->vector; - llist_add(&desc->llnode, &idxd->irq_entries[vec].pending_llist); - } + if (desc->hw->flags & IDXD_OP_FLAG_RCI) + llist_add(&desc->llnode, &idxd->irq_entries[desc->vector].pending_llist); return 0; } -- 2.30.2