From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-vk1-f179.google.com (mail-vk1-f179.google.com [209.85.221.179]) (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 60E601E376C for ; Mon, 23 Feb 2026 13:21:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771852908; cv=none; b=KE40QWUz3AFJMsM48imzXzJHwT8pJ1n4JWBBLynjKYd2FDAl4qGiEs+f1O8QIxC3Xw8f/aVV67+lgIk5D3Lqb2EPYao91i5lXo8ACAKVuEStirjJmT+gIlN6dZNEQE+3XN9FsEN6o9BmdqPQRM5rpx7E0B2a0uPfC5O/gHaHno4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771852908; c=relaxed/simple; bh=DFBwfom+CxQd6x7ic+XSQnIbLdiN8FcFEBOf6x+BltY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=lhG+3jIVYbQ77ZtWu23z/OVEJFk8tzfqEjPBh4tsbcpneXUiliH4MFEkvrtTXdOOeYkrQyhUxsquhF9EvC9qaVkbFwUZd+eN4bH51Mjjd9OGODS6RmWIvHbIQQkL3uceoplWUTPFOQ1Qq7XegfZEm296VMvEBDek6S+rxFzev1o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.221.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-vk1-f179.google.com with SMTP id 71dfb90a1353d-5665171836cso5177500e0c.2 for ; Mon, 23 Feb 2026 05:21:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771852906; x=1772457706; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=x0CXl7ooZIKZBR/9WuxpQTwfG3DhRjXklstmaRrGH4A=; b=FjOrCGzNdsw3/bwB3su41BbpuxYZFhdoH4DHviaBejMKZu13U9yBJs3ZxN4lSlbFpS e8vkSx8Vb59/aSSdShd5peBzWHhm1Jq8uVA/PCT4GxXZAH+D6Gm4PrFPncakEToYgfzC p1R9eklnsWvkV8ffwo4cueH9m7/GiLEXysX+Ij+7D6x+JQI4kA/UBcRZWuuiueEUsNIE m7fWPSp+2m3WfDhuytJsK6xa7uat2dgw2LAEj6eDA82FKg0WnQgRuaC17DUwR3in/BUD Bab8TzC2T+M2J+9zUj9KDsUaWsuM9+FkOUPDsLEgoD2WjbBloONCghKHpvibPyTFoqh8 R67A== X-Forwarded-Encrypted: i=1; AJvYcCU01tS6bvkg65+DxAhiE6dsjNFq4RS7Ii1raMS37N31GtrLCQhLXkBTSsV1zGd+TT1GZsa/Tgu6OrS6VB8=@vger.kernel.org X-Gm-Message-State: AOJu0YwIVcH9L6GcjXSrgcQZ5eVJPL+JkIwZXM5DvfujemIhUHEKJ9a5 IbIAaEqfkD8H979EC1tkoxeMSVLWSf4E629a8lozT1Sxl0lxzMBcIYt50yjt0eT5 X-Gm-Gg: AZuq6aJFtdoqmmVCSzudNMId0sKL1VuPQ4rj8hW4WX/Nl6rqynBovHjq6WpxtIOqh84 FE0ufKvx3aXE2eN8aOnjyVsa1hThA9lv6K/cEoH1ZJa2pP4uH6q3MhVTdmZ+2yQKPp6qn2v+dSt MeY1TbYETdd54TvZGPtF7W/iD6yRJph6lwnqnursgj/xRvQI3LcFl+pDrCyleX0wXQDCBN/Q3R1 xI2CCxxFiJ051r/zq2PaPGdX2cZqbKPHEm7M0iKpRHMWsDZpmp85106MJROylEvSi3K2q0pfYx3 t3T+qu0Nii24PmU9ONV2UJ4FVlunAxZX99Mn0WTpUD6apHFjXrErqjyPLfbKktOCu2s4rZakGw/ z78frpY8AQmEaHpQ0YAo2ad8Wanx2DRsAdaeK+fIkIK5RT7+W4cCTLmrMUo2wlddbgAPGuuL9X6 ShWTEt6SEnKkprh+x/Bz11xNw+DvbG2qZLn6oi/s6hpWL3RVbX4/m210d/UtkERbD8 X-Received: by 2002:a05:6122:1ac9:b0:563:618f:b7e1 with SMTP id 71dfb90a1353d-568e475251emr3976726e0c.4.1771852906321; Mon, 23 Feb 2026 05:21:46 -0800 (PST) Received: from mail-vk1-f180.google.com (mail-vk1-f180.google.com. [209.85.221.180]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-568e593a666sm8602133e0c.17.2026.02.23.05.21.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Feb 2026 05:21:45 -0800 (PST) Received: by mail-vk1-f180.google.com with SMTP id 71dfb90a1353d-567530bc03fso3662144e0c.3 for ; Mon, 23 Feb 2026 05:21:45 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUQ2/U6svydJhe+6OamAX1tGS2HM4QjLlH9+xtAd9PanXwZcBfIDwRUiLvtq/Ekt4opZhDI1f/NZBlg0Lo=@vger.kernel.org X-Received: by 2002:a05:6122:3306:b0:567:54cd:f258 with SMTP id 71dfb90a1353d-568e4883762mr3858484e0c.9.1771852905007; Mon, 23 Feb 2026 05:21:45 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20260113-device-support-info-v1-0-91e5db7f7294@imgtec.com> <20260113-device-support-info-v1-6-91e5db7f7294@imgtec.com> In-Reply-To: <20260113-device-support-info-v1-6-91e5db7f7294@imgtec.com> From: Geert Uytterhoeven Date: Mon, 23 Feb 2026 14:21:33 +0100 X-Gmail-Original-Message-ID: X-Gm-Features: AaiRm51wonfdpnxXafgHLkyNjFl6HLu4ultQI2-gg0aP3kgQDiY6wlG_WR4tQxI Message-ID: Subject: Re: [PATCH 6/6] drm/imagination: Warn or error on unsupported hardware To: Matt Coster Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Frank Binns , Brajesh Gupta , Alessio Belle , Alexandru Dadu , Marek Vasut , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Linux-Renesas Content-Type: text/plain; charset="UTF-8" Hi Matt, On Tue, 13 Jan 2026 at 11:21, Matt Coster wrote: > Gate the use of unsupported hardware behind a new module parameter > (exp_hw_support). > > Signed-off-by: Matt Coster Thanks for your patch, which is now commit 1c21f240fbc1e47b ("drm/imagination: Warn or error on unsupported hardware") in v7.0-rc1. > --- a/drivers/gpu/drm/imagination/pvr_device.c > +++ b/drivers/gpu/drm/imagination/pvr_device.c > @@ -525,6 +525,77 @@ pvr_gpuid_decode_string(const struct pvr_device *pvr_dev, > } > EXPORT_SYMBOL_IF_KUNIT(pvr_gpuid_decode_string); > > +static bool pvr_exp_hw_support; > +module_param_named(exp_hw_support, pvr_exp_hw_support, bool, 0600); > +MODULE_PARM_DESC(exp_hw_support, "Bypass runtime checks for fully supported GPU cores. WARNING: enabling this option may result in a buggy, insecure, or otherwise unusable driver."); > + > +/** > + * enum pvr_gpu_support_level - The level of support for a gpu_id in the current > + * version of the driver. > + * > + * @PVR_GPU_UNKNOWN: Cores that are unknown to the driver. These may not even exist. > + * @PVR_GPU_EXPERIMENTAL: Cores that have experimental support. > + * @PVR_GPU_SUPPORTED: Cores that are supported and maintained. > + */ > +enum pvr_gpu_support_level { > + PVR_GPU_UNKNOWN, > + PVR_GPU_EXPERIMENTAL, > + PVR_GPU_SUPPORTED, > +}; > + > +static enum pvr_gpu_support_level > +pvr_gpu_support_level(const struct pvr_gpu_id *gpu_id) > +{ > + switch (pvr_gpu_id_to_packed_bvnc(gpu_id)) { > + case PVR_PACKED_BVNC(33, 15, 11, 3): > + case PVR_PACKED_BVNC(36, 53, 104, 796): > + return PVR_GPU_SUPPORTED; > + > + case PVR_PACKED_BVNC(36, 52, 104, 182): > + return PVR_GPU_EXPERIMENTAL; > + > + default: > + return PVR_GPU_UNKNOWN; > + } > +} > + > +static int > +pvr_check_gpu_supported(struct pvr_device *pvr_dev, > + const struct pvr_gpu_id *gpu_id) > +{ > + struct drm_device *drm_dev = from_pvr_device(pvr_dev); > + > + switch (pvr_gpu_support_level(gpu_id)) { > + case PVR_GPU_SUPPORTED: > + if (pvr_exp_hw_support) > + drm_info(drm_dev, "Module parameter 'exp_hw_support' was set, but this hardware is fully supported by the current driver."); > + > + break; > + > + case PVR_GPU_EXPERIMENTAL: > + if (!pvr_exp_hw_support) { > + drm_err(drm_dev, "Unsupported GPU! Set 'exp_hw_support' to bypass this check."); > + return -ENODEV; > + } > + > + drm_warn(drm_dev, "Running on unsupported hardware; you may encounter bugs!"); > + break; > + > + /* NOTE: This code path may indicate misbehaving hardware. */ > + case PVR_GPU_UNKNOWN: > + default: > + if (!pvr_exp_hw_support) { > + drm_err(drm_dev, "Unknown GPU! Set 'exp_hw_support' to bypass this check."); After marking the gpu device node enabled in DTS for Renesas Salvator-X with R-Car M3-W (as you are aware, it is still disabled upstream because the system may crash when the firmware is not found), this error message is triggered: powervr fd000000.gpu: [drm] *ERROR* Unknown GPU! Set 'exp_hw_support' to bypass this check. and the driver fails to probe. Using the exp_hw_support flag makes the driver probe (when the firmware is available): # echo 1 > /sys/module/powervr/parameters/exp_hw_support # echo fd000000.gpu > /sys/bus/platform/drivers/powervr/bind powervr fd000000.gpu: [drm] Running on unknown hardware; expect issues. powervr fd000000.gpu: [drm] loaded firmware powervr/rogue_4.45.2.58_v1.fw powervr fd000000.gpu: [drm] FW version v1.0 (build 6513336 OS) [drm] Initialized powervr 1.0.0 for fd000000.gpu on minor 1 I am not sure if this counts as a regression. Given firmware is available for this device, I'd expect it to fall (at least) in the the PVR_GPU_EXPERIMENTAL case? Thanks! > + return -ENODEV; > + } > + > + drm_warn(drm_dev, "Running on unknown hardware; expect issues."); > + break; > + } > + > + return 0; > +} > + > static char *pvr_gpuid_override; > module_param_named(gpuid, pvr_gpuid_override, charp, 0400); > MODULE_PARM_DESC(gpuid, "GPU ID (BVNC) to be used instead of the value read from hardware."); > @@ -555,7 +626,7 @@ pvr_load_gpu_id(struct pvr_device *pvr_dev) > return err; > } > > - return 0; > + return pvr_check_gpu_supported(pvr_dev, gpu_id); > } > > /** Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds