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 3A892347503; Wed, 8 Apr 2026 18:12:28 +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=1775671949; cv=none; b=TR9K5YS9RqP4NIECS3Fg67E0k1REAC9iIUUR5z7la+O24qfStQbpkeE3wikzbaVnZSn0tSgo9gfrL69pOHTh5s8hMPQJPN0VIgfLL4aSmIxSM8BsphFYoEbufY2FOstsdp9bmm/6Zpbmzx1f6hgQNoDCCCpcGSeiCqsvM2qBtLA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775671949; c=relaxed/simple; bh=8asqhQ1oO6FpVDWdwVzRSFkcwsvc9olqo19V6ORTHGY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=g51giLcvIButjQhShjO4OxRbcJNSiWlYtyW7fGW7J8wj4hjomoRlXlOYOKlj7lf7+ShMiO4w9a0htVGUhmRYo98u0XEPMiG/Q7xYhtSQMKlXpY5nKqiMb+wBE8d/Y0/x9M0KkpsryhZFjalYL6OH0WtmmBogeslAdgfShIwBs1I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=MWtq0YtX; 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="MWtq0YtX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83D8EC19421; Wed, 8 Apr 2026 18:12:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1775671948; bh=8asqhQ1oO6FpVDWdwVzRSFkcwsvc9olqo19V6ORTHGY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MWtq0YtXWqmNRi2N4RvJkrotF4Kg+Luf5eCT50+vd7FMf8hdydbmS7kGxKs+ga7O6 dr3kxAkGSBHCs3hmZCX+0K+QvZm90Q62BuD1H6j5to3gv1+WIRa9PAD1YrU7I4Vh/2 gtXJbAp/1H/xqfgYNs6LWNiudVhWYsJPYOf/7MdU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Christophe JAILLET , Fenghua Yu , Lijun Pan , Vinod Koul , Sasha Levin Subject: [PATCH 6.1 131/312] dmaengine: idxd: Remove usage of the deprecated ida_simple_xx() API Date: Wed, 8 Apr 2026 20:00:48 +0200 Message-ID: <20260408175938.664816328@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260408175933.715315542@linuxfoundation.org> References: <20260408175933.715315542@linuxfoundation.org> User-Agent: quilt/0.69 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.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christophe JAILLET [ Upstream commit 1075ee66a8c19bfa375b19c236fd6a22a867f138 ] ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove(). This is less verbose. Note that the upper limit of ida_simple_get() is exclusive, but the one of ida_alloc_range() is inclusive. Sothis change allows one more device. MINORMASK is ((1U << MINORBITS) - 1), so allowing MINORMASK as a maximum value makes sense. It is also consistent with other "ida_.*MINORMASK" and "ida_*MINOR()" usages. Signed-off-by: Christophe JAILLET Reviewed-by: Fenghua Yu Acked-by: Lijun Pan Link: https://lore.kernel.org/r/ac991f5f42112fa782a881d391d447529cbc4a23.1702967302.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul Stable-dep-of: c311f5e92484 ("dmaengine: idxd: Fix freeing the allocated ida too late") Signed-off-by: Sasha Levin --- drivers/dma/idxd/cdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dma/idxd/cdev.c b/drivers/dma/idxd/cdev.c index 9b07474f450b5..e42c9a9f3c238 100644 --- a/drivers/dma/idxd/cdev.c +++ b/drivers/dma/idxd/cdev.c @@ -49,7 +49,7 @@ static void idxd_cdev_dev_release(struct device *dev) struct idxd_wq *wq = idxd_cdev->wq; cdev_ctx = &ictx[wq->idxd->data->type]; - ida_simple_remove(&cdev_ctx->minor_ida, idxd_cdev->minor); + ida_free(&cdev_ctx->minor_ida, idxd_cdev->minor); kfree(idxd_cdev); } @@ -375,7 +375,7 @@ int idxd_wq_add_cdev(struct idxd_wq *wq) cdev = &idxd_cdev->cdev; dev = cdev_dev(idxd_cdev); cdev_ctx = &ictx[wq->idxd->data->type]; - minor = ida_simple_get(&cdev_ctx->minor_ida, 0, MINORMASK, GFP_KERNEL); + minor = ida_alloc_max(&cdev_ctx->minor_ida, MINORMASK, GFP_KERNEL); if (minor < 0) { kfree(idxd_cdev); return minor; -- 2.53.0