Received: by 2002:a05:7412:8d11:b0:fa:4934:9f with SMTP id bj17csp76038rdb; Sun, 14 Jan 2024 07:14:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IEIW1zdpOwJ0qMf7JwrlV6pdZ9PAew76EXwelw+jK9L3iY447owSfqHTfOWexsNScRyjMRs X-Received: by 2002:a05:6214:252d:b0:680:d395:cff9 with SMTP id gg13-20020a056214252d00b00680d395cff9mr6460006qvb.93.1705245288336; Sun, 14 Jan 2024 07:14:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705245288; cv=none; d=google.com; s=arc-20160816; b=K3IOSiwxSyhgHaIzt6HjTWUDwCyPJ05B0FLFzGs9qmw1rPVUlTuRrJTU6HjHh1Ix4M hQ0Mgd9z5kluWOS/icEXmcIAq2XERNd5DL+m4dBHtHssxBFEt/lovhtRpWJaM7/N1X3/ Cx+IShcEMzJMFMn3Oh2nl3TQN6mT6+HS1bzaXwL9OwlzuaTH1sgjAnhU/FatRvveBLTy k11DnSjpC2EealY9yUrftezdLtmW+wjvR/KzI2cszPjYErTBkavZmfu22Zfv2tAcTLxF JGwJvJln8TKKBTwA9fL682GVPg3A+PLHdz6cyLZVgP8DEYsnzxD8PSh7+Kwb+sYlrb1+ 7h9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=DyxncyBb2TGhjTPDIO5OZaofh3nX75GnWep1Sd7CadU=; fh=GNizXAXiwZTUiBdgU2oaTTmwkiOkaTn/2iUZmZEibxE=; b=0CrG1DXzgbYaZqSbcS7YTbwPfzgvgbJT4eV1BgADNKUk5Cote0DiziKAoG8jKxFDUq SFMI/ZgxEEi2B32DcQGyXKHfiQyLaAaoSMPWJNL2vdTRfK9ZC6LvkgLuaxWyQLBaWATs cnCXB93c7+Jng5vAVJjpIccP7yfTpyLTLkOs2qF3f2uiUt+jGSS1FEuu+E8iiVB07za/ qQh8vADfCVfmNaJfPJofAVuEKzp18oZQbgiomHGt3ITpRHuh0YM6QGwZ8VbslKIRKpXA 2TQ1AteXgcHMQ2tS82Y2lQisZdg+n4wQYtVP4MGQn7hBN+T7ABrNgGGTEYuAGifkc7Ad RwIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=eFh0JmdM; spf=pass (google.com: domain of linux-kernel+bounces-25493-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25493-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id n9-20020a0ce489000000b0067ec2d04818si6253467qvl.131.2024.01.14.07.14.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jan 2024 07:14:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25493-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=eFh0JmdM; spf=pass (google.com: domain of linux-kernel+bounces-25493-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25493-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id BCA8A1C20BE7 for ; Sun, 14 Jan 2024 15:14:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C2D9A2570; Sun, 14 Jan 2024 15:14:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="eFh0JmdM" Received: from smtp.smtpout.orange.fr (smtp-23.smtpout.orange.fr [80.12.242.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC09223D2 for ; Sun, 14 Jan 2024 15:14:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Received: from fedora.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id P2ByrR95z2jhsP2ByrsvDy; Sun, 14 Jan 2024 16:14:37 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1705245277; bh=DyxncyBb2TGhjTPDIO5OZaofh3nX75GnWep1Sd7CadU=; h=From:To:Cc:Subject:Date; b=eFh0JmdMRV7qpGMY7yfPjvMU1f7MZ9qtKW1SDUmqvVE6fliw9diJPe3raZn5FO+GP SxeXoutXn9VX3VWk0Ej/CDg2zfoeuRmWlPljl4hsmridG6GvNs0vKJaXeMksK0YAoa qdD4qEMba+hVinVJGZwhvbL5faxuDs/mUdPojSqZfGOnlMjMVdOkQyqygAGM+iK5wY oOau+vxJtzypBmGxtbHo6Ico3qjfbysbGw8VViCiGzNL/1LWH8ifZB3FgqI0tlzqJ7 jg84JR8MdXYdt0QOHCrEF2YZoNN+wMEGxepcuIzhKI96dPlNAV2NW4qVdD86Y7myvM BXpw7e72l5a3Q== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 14 Jan 2024 16:14:37 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET To: Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/amdgpu: Remove usage of the deprecated ida_simple_xx() API Date: Sun, 14 Jan 2024 16:14:27 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove(). Note that the upper limit of ida_simple_get() is exclusive, but the one of ida_alloc_range() is inclusive. So a -1 has been added when needed. Signed-off-by: Christophe JAILLET --- drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c index ddd0891da116..3d7fcdeaf8cf 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c @@ -62,9 +62,8 @@ int amdgpu_pasid_alloc(unsigned int bits) int pasid = -EINVAL; for (bits = min(bits, 31U); bits > 0; bits--) { - pasid = ida_simple_get(&amdgpu_pasid_ida, - 1U << (bits - 1), 1U << bits, - GFP_KERNEL); + pasid = ida_alloc_range(&amdgpu_pasid_ida, 1U << (bits - 1), + (1U << bits) - 1, GFP_KERNEL); if (pasid != -ENOSPC) break; } @@ -82,7 +81,7 @@ int amdgpu_pasid_alloc(unsigned int bits) void amdgpu_pasid_free(u32 pasid) { trace_amdgpu_pasid_freed(pasid); - ida_simple_remove(&amdgpu_pasid_ida, pasid); + ida_free(&amdgpu_pasid_ida, pasid); } static void amdgpu_pasid_free_cb(struct dma_fence *fence, -- 2.43.0