Received: by 2002:a05:7412:8d11:b0:fa:4934:9f with SMTP id bj17csp73251rdb; Sun, 14 Jan 2024 07:09:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IESKR9Q5FpI6c8va7QnFAYeP2kRUTDcFIIIsmouCsy3LLSlEIwCAjA3s1T1MbM9gCSoe9dC X-Received: by 2002:a17:902:d353:b0:1d5:845:d8cf with SMTP id l19-20020a170902d35300b001d50845d8cfmr4731281plk.104.1705244979719; Sun, 14 Jan 2024 07:09:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705244979; cv=none; d=google.com; s=arc-20160816; b=k1n4os8DtmTa8tGNoTL0RE3flh9xA9MqapTKhiKcYd/CzaeahwgNwlWRNOuU8KXXM1 PNe1Y7PF+SDqLl2ukcLyAQTzd+zXHnuP0Cw8MsuyWhVyy24Ax3Dc442FzNA6JuMnj1sY w7MGvVPAjPyK9q+ScooojYooB1qIp0/3KQnPHK71wUilIcraorruQq+6YGDCx2NbfyFm jfbAqmriUUgT1Q6pQnwf18L3jYtXG2UNUebcYk9Zkm/mdPoUPTW2ILg3NEWXYoxfprbm A+6pXsGxvHIcAXIVnIcBb2d1PgzfxhOKtw4HqcfPBDRwxDEUlXr/dLsDaxFWlWLn0nKa euNQ== 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=D4u6ZY8/Ur6FTZ//imiCQyP7Y8yAqe7AAZ58naxjz8A=; fh=G89NcOpiyTKerNpe5NEcF1nWab/CZLdgUw6VY1kmXt4=; b=yJSIxYBqiqfNTd0ctsEzaZ1NAjy6pV4XpVfBMYWoB0cvZQfKeeGYj37cQeRADL027v DouVoygajy+qDJfNjqkkquN+0HfV1Kpyju2dmpwPmT6KOAGHJ9VYS+2SSuNQxlgLeBUW j1FUw7IznaUjVweR5lKIiSLOt6W+wS5uzRm0x8anTKtX+eh5okaGF/nIBiC99/lV9luz h9ud80atqVCX8J7HvyHsfcx3/aXIbx44d1aA4iLtbA7qoQJsZ3I87no9wgq7A1QPpOmp qwyW6r30onpFWkGEHeBO2mGohfIQrhTZWbId7ovlF+vqGFIEj31e0fnK3PEsUrkyioh3 I99A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=nzH4J84c; spf=pass (google.com: domain of linux-kernel+bounces-25489-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25489-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ki6-20020a170903068600b001cf5d537eb6si7217024plb.190.2024.01.14.07.09.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jan 2024 07:09:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25489-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=nzH4J84c; spf=pass (google.com: domain of linux-kernel+bounces-25489-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25489-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 90E2E2820C3 for ; Sun, 14 Jan 2024 15:09:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BC2492599; Sun, 14 Jan 2024 15:09:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="nzH4J84c" Received: from smtp.smtpout.orange.fr (smtp-24.smtpout.orange.fr [80.12.242.24]) (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 CAE5D7E for ; Sun, 14 Jan 2024 15:09:25 +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 P26xrDSR7T1UwP26xrm4KQ; Sun, 14 Jan 2024 16:09:22 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1705244962; bh=D4u6ZY8/Ur6FTZ//imiCQyP7Y8yAqe7AAZ58naxjz8A=; h=From:To:Cc:Subject:Date; b=nzH4J84cZVHQOVW0KPp/cLSC3pL50CpKxdOjirhPLQfNhV/Yrqo75zKzkKfxCwCHu mDt1PvfU1iULiOHF2aQ/bypcGVlUATudKhYMLC0YxipoqpSxTeLzzk5NnyuLp0LOJT G8AgPHmauRqaW/2TMO2NCi8Dy2gKsyghfFsMhrz9EU/3e8a9W2KNfIybrzYWngOZL/ 7+eMRxQYSld9TOdoxLiQXpe4W1LEHQw/Bekr9DzHbrFRtY4YRwfJ8jMexWLZnU2v6O qLd3Qbuo0lerFxtd+xh52kSTkkxixzl5oepVZ63hCe3WYCGjzGLqZpFQ2Vy87kvlrQ B+4a6dzhzd8EQ== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 14 Jan 2024 16:09:22 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET To: Lucas De Marchi , Oded Gabbay , =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/xe/guc: Remove usage of the deprecated ida_simple_xx() API Date: Sun, 14 Jan 2024 16:09:16 +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_max() is inclusive. So a -1 has been added when needed. Signed-off-by: Christophe JAILLET --- drivers/gpu/drm/xe/xe_guc_submit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c index 21ac68e3246f..11ffacd1dd58 100644 --- a/drivers/gpu/drm/xe/xe_guc_submit.c +++ b/drivers/gpu/drm/xe/xe_guc_submit.c @@ -311,7 +311,7 @@ static void __release_guc_id(struct xe_guc *guc, struct xe_exec_queue *q, u32 xa q->guc->id - GUC_ID_START_MLRC, order_base_2(q->width)); else - ida_simple_remove(&guc->submission_state.guc_ids, q->guc->id); + ida_free(&guc->submission_state.guc_ids, q->guc->id); } static int alloc_guc_id(struct xe_guc *guc, struct xe_exec_queue *q) @@ -335,8 +335,8 @@ static int alloc_guc_id(struct xe_guc *guc, struct xe_exec_queue *q) ret = bitmap_find_free_region(bitmap, GUC_ID_NUMBER_MLRC, order_base_2(q->width)); } else { - ret = ida_simple_get(&guc->submission_state.guc_ids, 0, - GUC_ID_NUMBER_SLRC, GFP_NOWAIT); + ret = ida_alloc_max(&guc->submission_state.guc_ids, + GUC_ID_NUMBER_SLRC - 1, GFP_NOWAIT); } if (ret < 0) return ret; -- 2.43.0