From nobody Thu Dec 25 17:52:39 2025 Received: from smtp.smtpout.orange.fr (smtp-20.smtpout.orange.fr [80.12.242.20]) (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 1354A7E for ; Sun, 14 Jan 2024 15:15:46 +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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="BtgUzr6P" Received: from fedora.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id P2D2rpeDvx8edP2D2ruurW; Sun, 14 Jan 2024 16:15:39 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1705245339; bh=gGvgGoM0e1dEjbodoGgiPLnqIqDMOOhcBuBKmJRpc0g=; h=From:To:Cc:Subject:Date; b=BtgUzr6PiLEDrT5U7hh+Jo3YWfcnNrYPzC3/04dcm9p4EHAa9TcvqKQ27kwu4TTql Ol4tDykXmDjWOXTK6OH3AbkkQ2j/8QVv1zsYOcOntfb3BZQw97Y//wzeWOeSWkVHFT g9KyBM5JsNeU/wMxd/IpUtc0lcYLS0wntGq8wrHXwLu98r+ZdA0M/MIcEjGLk8chV9 Uj18E1i+0gWvdYH+lSQ4TB2snhTdGsg9fnsgdmAYm3yyJaUtmTxkCxHEmT2W3Jspja SR3DQdevSDv+pir+9kftCvA/RpF+w6MKEVKOp43eus0qVfRr3qtHZvlDg8K4utfFlE KTdg05vxZI/TQ== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 14 Jan 2024 16:15:39 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/i915/guc: Remove usage of the deprecated ida_simple_xx() API Date: Sun, 14 Jan 2024 16:15:34 +0100 Message-ID: <7108c1871c6cb08d403c4fa6534bc7e6de4cb23d.1705245316.git.christophe.jaillet@wanadoo.fr> 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: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Matthew Brost --- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gp= u/drm/i915/gt/uc/intel_guc_submission.c index a259f1118c5a..73ce21ddf682 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c @@ -2156,11 +2156,10 @@ static int new_guc_id(struct intel_guc *guc, struct= intel_context *ce) order_base_2(ce->parallel.number_children + 1)); else - ret =3D ida_simple_get(&guc->submission_state.guc_ids, - NUMBER_MULTI_LRC_GUC_ID(guc), - guc->submission_state.num_guc_ids, - GFP_KERNEL | __GFP_RETRY_MAYFAIL | - __GFP_NOWARN); + ret =3D ida_alloc_range(&guc->submission_state.guc_ids, + NUMBER_MULTI_LRC_GUC_ID(guc), + guc->submission_state.num_guc_ids - 1, + GFP_KERNEL | __GFP_RETRY_MAYFAIL | __GFP_NOWARN); if (unlikely(ret < 0)) return ret; =20 @@ -2183,8 +2182,8 @@ static void __release_guc_id(struct intel_guc *guc, s= truct intel_context *ce) + 1)); } else { --guc->submission_state.guc_ids_in_use; - ida_simple_remove(&guc->submission_state.guc_ids, - ce->guc_id.id); + ida_free(&guc->submission_state.guc_ids, + ce->guc_id.id); } clr_ctx_id_mapping(guc, ce->guc_id.id); set_context_guc_id_invalid(ce); --=20 2.43.0