From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 62BB610F9309 for ; Tue, 31 Mar 2026 23:06:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F0B6A10E315; Tue, 31 Mar 2026 23:06:50 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="FH1pdVyB"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by gabe.freedesktop.org (Postfix) with ESMTPS id BB6DD10E315 for ; Tue, 31 Mar 2026 23:06:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1774998403; x=1806534403; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=R/DM6g4dfBQ52kmeIfteYDS4Tk0ZR3RoGHJ5/VlRpbs=; b=FH1pdVyBbhEN0/EHv6zTHCZCG1mLCe5Lqfw8iHZUhPwL7wp3frsEylbB sYR7WJmSaTcDPRs3s3F7CgFYokUAYE2iYgIXU7QjmYyNV9+jFb17yV1cW 9ijIgsRWkIDZFe/qAvRsbIRkgANhD5zn2jKFLfH18N/Xi7l1w6D5bV03g FO0sGwQEXEo/JWIvAgLEjw37uSDgZM2Fro9s7EYh/8Rf2FP0BWKTk0RBJ g9DEvFHhHilmhdqCbnK4qOrxIm9Zb/EfjDnEZnfBim2NEgDFcBJg8UZ7y yXGVuG18JSrA/203m8T2V3SUrEXlb2xxle0S964KTMXyF/KLl9wX9wByW g==; X-CSE-ConnectionGUID: vZJII3uHS3eqzi+okmGTMQ== X-CSE-MsgGUID: qDNSS1KzTu+Uw4/oIt/M+Q== X-IronPort-AV: E=McAfee;i="6800,10657,11745"; a="93420733" X-IronPort-AV: E=Sophos;i="6.23,152,1770624000"; d="scan'208";a="93420733" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2026 16:06:42 -0700 X-CSE-ConnectionGUID: vLuOvtF6QYO1lT563uXWDA== X-CSE-MsgGUID: hPLPlZJ5TVq8s9D78z/JtA== X-ExtLoop1: 1 Received: from unknown (HELO adixit-MOBL3.intel.com) ([10.241.243.168]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2026 16:06:41 -0700 Date: Tue, 31 Mar 2026 16:06:40 -0700 Message-ID: <87qzozy4xr.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Cc: , , , Subject: Re: [PATCH i-g-t] lib/intel_pat: add hardcoded PAT fallback for older kernels In-Reply-To: <87se9fy5dy.wl-ashutosh.dixit@intel.com> References: <20260327052212.27431-1-himanshu.girotra@intel.com> <87se9fy5dy.wl-ashutosh.dixit@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-BeenThere: igt-dev@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development mailing list for IGT GPU Tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" On Tue, 31 Mar 2026 15:56:57 -0700, Dixit, Ashutosh wrote: > > > @@ -105,14 +161,26 @@ static void intel_get_pat_idx(int fd, struct intel_pat_cache *pat) > > * For Xe, use the PAT cache stored in struct xe_device. > > * xe_device_get() populates the cache while still root; forked > > * children that inherit the xe_device can use it post-drop_root(). > > + * > > + * Fall back to hardcoded values when the kernel lacks the > > + * pat_sw_config debugfs. Platforms newer than Crescent Island > > + * must have the debugfs available. > > */ > > if (is_xe_device(fd)) { > > struct xe_device *xe_dev = xe_device_get(fd); > > > > - igt_assert_f(xe_dev->pat_cache, > > - "PAT sw_config not available -- " > > - "debugfs not accessible (missing root or not mounted?)\n"); > > - *pat = *xe_dev->pat_cache; > > + if (xe_dev->pat_cache) { > > + *pat = *xe_dev->pat_cache; > > + } else if (xe_pat_fallback(fd, pat)) { > > Shouldn't this be "else if (!xe_pat_fallback(fd, pat)"? Or return 0 from > xe_pat_fallback() on success? Sorry, misread the code, please ignore, code is correct!