Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2432746rdh; Sun, 29 Oct 2023 16:28:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFwySTPY8LxT5UyKneqxqiE4Jlf+Nrrl5ly/+JzWDFFgGmzhc6+eIjyNFDHTiY4TndqSvI5 X-Received: by 2002:a17:902:e887:b0:1c0:aca0:8c44 with SMTP id w7-20020a170902e88700b001c0aca08c44mr8256967plg.19.1698622135819; Sun, 29 Oct 2023 16:28:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698622135; cv=none; d=google.com; s=arc-20160816; b=rpDmSCO6Z4MdmL9RX70O/+hTIUVDACZ0swIldWN60JGSxRElqJ015m4JB4Ywsb9OWG SnnpYUU2HRcQipZmlIY04SBTdk+MBXJu43YKV/qZD2fHdc0DJe7BdffYdIRcN++WIYUM K9QFWOdhNDDDF4rXzG4LUrpZQ30cthJXoZhcSlFZ64vREIixSUXiy2IwtXpyPYYzEIzZ LRkOsvlEvT3I7fSDrhho7ap3XITL9bxhqmoFTZ9v2//yDGPG2YuJPc4dJpy0ePVVJFj9 G4cdfhkawpBJcBjDoujVCWF69lmcArp82qOvvnHQ70xbA1VvYkHzguMJkslKrOJi3YVr uIDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5yDddyDsXpWQ6B6EPGVkU2aUWxQjxotUb3aqy+FS6Mg=; fh=IA+s95l3bdG5kktr2oBtymIkktKpAPt6VLvQ43E+of4=; b=PlJbyGNZAfrJlNKbRCSVBHv/lPpP1G6QQiZZAWtXy0xmtBiQ7p1meoyuwdzWJfIrea x5+cs4huebrVkQ74V/uPhwJ6enw9/MmjlYO+Qp3vgMAq9IzITTupRlkcyvZqvuao6co2 djdgx6eOOdXQzJqkhmt2DWtbO4iunfDMdFIe6tYJTlTB/jH8/wr7z+h+4ucWXem6W+A6 u6OzKDalOFsWpMzpvpimRz01ljmxraV4F6Rsk3++X/yas8YNqafpsGgji1ERxmMv8rBf reF/D2Vz9QeaTfw3DRAbcrfGs9KpGhxnhLefH+5ni8+1VttR2KBIcj31R1tw97WkIbKm 43Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qXShCsmf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id z13-20020a1709027e8d00b001b9dda4e1e7si4188786pla.154.2023.10.29.16.28.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 16:28:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qXShCsmf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 4B3C88057956; Sun, 29 Oct 2023 16:28:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232408AbjJ2X2n (ORCPT + 99 others); Sun, 29 Oct 2023 19:28:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232416AbjJ2X2Z (ORCPT ); Sun, 29 Oct 2023 19:28:25 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 426EE3262; Sun, 29 Oct 2023 15:56:33 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7CC04C43395; Sun, 29 Oct 2023 22:56:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698620179; bh=1kR/CjoxHbIlGsir+rK7ZCbvL48WL1v8bLuqsLL3sds=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qXShCsmf2ThUHKcpIoHfKv9dt4/ldtvRy9eMB4o4fBFgKnPb2E9yt+a3OCI7qC2y+ 0dxHG4CCMsuNZ/UU2ZyuG/8c316Gkrjo3N2MZ3F9jBwfOG0plAS9emrNNmZWgRx3t/ Ly7jfoYC3wSvbcn5lYFVEelHRalk7W36WQT6VOPYJlMh5xzmIf0gG+5Q+rtNm58/JD HCMWxafr6eJ1Qk9klrabRIWRr9m61SdXvfIe++MiLMDXAjhThl6akYQWGdYWwlCT4Y 2khIlO9/zIhkLS4/tx/M3vdJA4fhpYNoZ6d6SWAiK1Vt6qcz4Dyw4CJ8pPJ9K6j9WO NSorb8npxiJ4A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Luben Tuikov , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , Sasha Levin , alexander.deucher@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, James.Zhu@amd.com, lijo.lazar@amd.com, pierre-eric.pelloux-prayer@amd.com, zhenguo.yin@amd.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 6.5 39/52] gpu/drm: Eliminate DRM_SCHED_PRIORITY_UNSET Date: Sun, 29 Oct 2023 18:53:26 -0400 Message-ID: <20231029225441.789781-39-sashal@kernel.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231029225441.789781-1-sashal@kernel.org> References: <20231029225441.789781-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.5.9 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sun, 29 Oct 2023 16:28:53 -0700 (PDT) From: Luben Tuikov [ Upstream commit fa8391ad68c16716e2c06ada397e99ceed2fb647 ] Eliminate DRM_SCHED_PRIORITY_UNSET, value of -2, whose only user was amdgpu. Furthermore, eliminate an index bug, in that when amdgpu boots, it calls drm_sched_entity_init() with DRM_SCHED_PRIORITY_UNSET, which uses it to index sched->sched_rq[]. Cc: Alex Deucher Cc: Christian König Signed-off-by: Luben Tuikov Acked-by: Alex Deucher Link: https://lore.kernel.org/r/20231017035656.8211-2-luben.tuikov@amd.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 3 ++- include/drm/gpu_scheduler.h | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c index 092962b93064f..aac52d9754e6d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c @@ -64,7 +64,8 @@ amdgpu_ctx_to_drm_sched_prio(int32_t ctx_prio) { switch (ctx_prio) { case AMDGPU_CTX_PRIORITY_UNSET: - return DRM_SCHED_PRIORITY_UNSET; + pr_warn_once("AMD-->DRM context priority value UNSET-->NORMAL"); + return DRM_SCHED_PRIORITY_NORMAL; case AMDGPU_CTX_PRIORITY_VERY_LOW: return DRM_SCHED_PRIORITY_MIN; diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h index f9544d9b670d3..ac65f0626cfc9 100644 --- a/include/drm/gpu_scheduler.h +++ b/include/drm/gpu_scheduler.h @@ -68,8 +68,7 @@ enum drm_sched_priority { DRM_SCHED_PRIORITY_HIGH, DRM_SCHED_PRIORITY_KERNEL, - DRM_SCHED_PRIORITY_COUNT, - DRM_SCHED_PRIORITY_UNSET = -2 + DRM_SCHED_PRIORITY_COUNT }; /* Used to chose between FIFO and RR jobs scheduling */ -- 2.42.0