From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A83B24EABF; Tue, 20 May 2025 14:20:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747750832; cv=none; b=mEtuRnlLoH41qiKr/6Oa9gHdP7cxU+fLVhIyLDss1mMcCoUz/8A/eRbvlBLgUzJfffPsaW0itLLxXn4hoWuO8I/bB1OdCBlCPYm9CaKyoItFrO0PnV05R9mbRDPeO+JaeUlCxZF7EXWoGq1NOVd1xOR5iSANgJlx+hMoAuWplck= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747750832; c=relaxed/simple; bh=n+/zfRBOGJQdwC/Zq95SVXEcKc1I1jraC0/w21iMQNY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eotmx7sIcFxr4PZiKPKHU2eVIs5cMVk7UbzfaDo+FsWm47QJkB4xWGgnS7Jh4dT/uydne9tNdq4fJziGZxyq+bdQ4DA0lPZa/sAYV6GZCVLs32/OjOXE+4Wp3z+6i6vDQJQR3iMvHRJVVTBIT0CHP6VThuxMVN5uw7Gpygn2C1s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XwhEFC1J; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="XwhEFC1J" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20EDCC4CEE9; Tue, 20 May 2025 14:20:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1747750832; bh=n+/zfRBOGJQdwC/Zq95SVXEcKc1I1jraC0/w21iMQNY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XwhEFC1JBRC1jv5vz1qMU5beovCt0CbZSEL4/jUaRfeP/mz424RbzDP81E6q8pGWo qUyAaxy3c8w+tvhuRZcX8yQedUtw18//8DSvO/iI+R6DnrBnPefpbZCacgSHG/vB90 k4Rm7HdLNT4frbToI28kg//3MHppkGAX+8mDMrIA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Vinicius Costa Gomes , Shuai Xue , Fenghua Yu , Dave Jiang , Vinod Koul Subject: [PATCH 6.14 135/145] dmaengine: idxd: Refactor remove call with idxd_cleanup() helper Date: Tue, 20 May 2025 15:51:45 +0200 Message-ID: <20250520125815.825372392@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250520125810.535475500@linuxfoundation.org> References: <20250520125810.535475500@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Shuai Xue commit a409e919ca321cc0e28f8abf96fde299f0072a81 upstream. The idxd_cleanup() helper cleans up perfmon, interrupts, internals and so on. Refactor remove call with the idxd_cleanup() helper to avoid code duplication. Note, this also fixes the missing put_device() for idxd groups, enginces and wqs. Fixes: bfe1d56091c1 ("dmaengine: idxd: Init and probe for Intel data accelerators") Cc: stable@vger.kernel.org Suggested-by: Vinicius Costa Gomes Signed-off-by: Shuai Xue Reviewed-by: Fenghua Yu Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/20250404120217.48772-10-xueshuai@linux.alibaba.com Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/dma/idxd/init.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) --- a/drivers/dma/idxd/init.c +++ b/drivers/dma/idxd/init.c @@ -1309,7 +1309,6 @@ static void idxd_shutdown(struct pci_dev static void idxd_remove(struct pci_dev *pdev) { struct idxd_device *idxd = pci_get_drvdata(pdev); - struct idxd_irq_entry *irq_entry; idxd_unregister_devices(idxd); /* @@ -1322,21 +1321,12 @@ static void idxd_remove(struct pci_dev * get_device(idxd_confdev(idxd)); device_unregister(idxd_confdev(idxd)); idxd_shutdown(pdev); - if (device_pasid_enabled(idxd)) - idxd_disable_system_pasid(idxd); idxd_device_remove_debugfs(idxd); - - irq_entry = idxd_get_ie(idxd, 0); - free_irq(irq_entry->vector, irq_entry); - pci_free_irq_vectors(pdev); + idxd_cleanup(idxd); pci_iounmap(pdev, idxd->reg_base); - if (device_user_pasid_enabled(idxd)) - idxd_disable_sva(pdev); - pci_disable_device(pdev); - destroy_workqueue(idxd->wq); - perfmon_pmu_remove(idxd); put_device(idxd_confdev(idxd)); idxd_free(idxd); + pci_disable_device(pdev); } static struct pci_driver idxd_pci_driver = {