Received: by 2002:a05:7412:8d11:b0:fa:4934:9f with SMTP id bj17csp76762rdb; Sun, 14 Jan 2024 07:15:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IHVaUACUtXwuPSdnrroTdyghg7gcQmYWC5TIm6tHkK5mMm9sQVfUadyohrQfZ7Nz0eHF7Rx X-Received: by 2002:a05:6808:11c6:b0:3bd:3e8b:8734 with SMTP id p6-20020a05680811c600b003bd3e8b8734mr4771520oiv.99.1705245358958; Sun, 14 Jan 2024 07:15:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705245358; cv=none; d=google.com; s=arc-20160816; b=DVCZGeDgKPpoWWIEzJvxSFq5RbvYDyWjui57f4wSgcJeAWikYcgmStgUOx6kZWuesh v9IX8z76g3zuvS2eaPYejH/rfgWQBfu3IeMTW+Aa7T9V+u+tzs7QebjPO3gNi/y7x3dM 6/BN5KTmRkWKJPmycLdNTQMeY8K/G5hEgz+Ok7JsY+zmh6pVBTIazUFYZcOR8iBftB6O w6ZE7praGa9N3xyR+vmCGyi1Y/Rvk8oKg5+muCcVpWNOMav3CUaj9Pcc6xOeQ6zF6TtK mZoXeyzcx4GqI/HjjXylRYqLopGsvyZCxAcJz7FY1z06GFXy+1rPdhkXcLm2JupixgEZ S+VQ== 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=gGvgGoM0e1dEjbodoGgiPLnqIqDMOOhcBuBKmJRpc0g=; fh=ZmUqMD2i/oE3wzYCYhvULYgcxL3qZyKL6cnqicmVJBc=; b=RC9FQ6YAq3O5dkmt4rcAqfvtIFKuZgvZ3UMWVi28WRv1D2LgAyQe/x5qSmmfQAa49J 1hPYwCd9JYJ5ILXoW4N7XDFyMOpRpJu8LgUmz3T903iq9/IsQlFIPtPkKtCD6FyJ5877 Aq7F4sr0gmq6RxTG2ZmJzkqPDbaqkpfM921vqd4AWVFAEsiluyAW/S23ehOVV9u7dcvB Ig92GGkciLpdIWYZxc7BTlNTjeHJWLgU8Jv0QCf05RuubLHPs4tFeLvuU8RNmqOhJODz /VAVJTC/uQJUN0BtxSzhUymveToj7sUzm82wh1g3om35rhJT5KhMkqwP8iM5F373CqNK N72Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=BtgUzr6P; spf=pass (google.com: domain of linux-kernel+bounces-25494-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25494-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id w8-20020a056a0014c800b006d93395deddsi7169338pfu.190.2024.01.14.07.15.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jan 2024 07:15:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25494-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=BtgUzr6P; spf=pass (google.com: domain of linux-kernel+bounces-25494-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25494-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 10E37B20F66 for ; Sun, 14 Jan 2024 15:15:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 419722582; Sun, 14 Jan 2024 15:15:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="BtgUzr6P" 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 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: 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/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/gpu/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 = 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 = 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; @@ -2183,8 +2182,8 @@ static void __release_guc_id(struct intel_guc *guc, struct 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); -- 2.43.0