Message ID | 20240224121528.1972719-2-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-79634-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1116117dyb; Sat, 24 Feb 2024 04:16:13 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVdfU0Ubb76qQcZSaVgi01Q6N5LFEr9fSuDzwkGQ4MXo7D/chjOOgqBBNxVmtuImwP7CyNGTgWi8YeOLyeBXiyuQ2ynQA== X-Google-Smtp-Source: AGHT+IFY4/DtoyYJ1jrXoV8zFxSp7tD8mG4axZwcO5HYyIEvNAvbqLsghBb9TiLw2T2PHMmtAMW+ X-Received: by 2002:a17:902:ebc6:b0:1dc:83b3:99a6 with SMTP id p6-20020a170902ebc600b001dc83b399a6mr1465846plg.41.1708776973785; Sat, 24 Feb 2024 04:16:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708776973; cv=pass; d=google.com; s=arc-20160816; b=lTOqi2ts+YEyYoG13HCzqfGwYAu7r38yMXVYEF9SK1HiAKI3qcwXjIrDKpBBgULUNc V0BSGRR8oTris3My20ykD4VV+CF8913cVj1q+j6siT+z712LIhIDSE5oVk4YBSDOfy1a Q+LuKNXt/vjgxtDmrwxF6cqyZ6mD61FZMIp6zqPnJjINVXfN5hpJbcvTDTDkYCLwYyE2 38m7AvWpU52IR2Skc9LFC/qrI03jsDNBU4lDEXuoe2/FGkNxm7GUUgAlu5FXVgXsvgxi zkq53zkqyHutM5qCbpOeyjceocPE7UXtvbLJFhu2vQbhaOVMT3k9Dmpao2/6oeqRhiEl Vciw== ARC-Message-Signature: i=2; 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=AAscUDbnNrUBxmOuKRMN6o7PGZVK20Rg4ZL44kRG4xw=; fh=MyVaxwer/5Lb5eRkA7Fy98q4ek2PUEG3puEBT94s7Bg=; b=J4X6nNyAGxTflFGJfm+3HDoFP7njB6ShThXG3EcofpJG3usZQT6yBlqefKwS6IUbne kCcWlGepQJuuJk30NpH46Okk2MJWaUNtq/ddaqefqO2krL6GfJ0R/NvAwNvpGksoqNYO DkPho22/lHIhPxtFeF622BQMg/1WEb/5iiVDN9EOQx4WmiT1gLu97Vp05FAJZ6eBR8m+ U3zKwWxGLnkMzkt2ZhCK8P1AVn44pZnoB2pP823RSGIBP1RSq7MoZ7Ka93SKZj1lsf3y WeClmlZY3BywHXL+fOgToLmJvoI3NT2/+WwNKDPPDAlZB3Lr1nGe/rUTxO/lhU50paDH maZQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="JWj5D/Lb"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79634-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79634-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d18-20020a170903231200b001db4210203asi768069plh.351.2024.02.24.04.16.13 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 04:16:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79634-ouuuleilei=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=@kernel.org header.s=k20201202 header.b="JWj5D/Lb"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79634-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79634-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 48DA2B219BD for <ouuuleilei@gmail.com>; Sat, 24 Feb 2024 12:16:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4E6DF3F9D8; Sat, 24 Feb 2024 12:15:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JWj5D/Lb" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52A623D988; Sat, 24 Feb 2024 12:15:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708776953; cv=none; b=O6mtecPf9G3SOxaD4h4i+LcmY2mXYa3PYqiGbMLtgwmje8Myxsq41YdFCHkvvPXDIMHkHg70hyedixGlHeb9g1TxZ7W6dahuqpMtkgRHLjUZTJEJKbL1sh9JeLDu0N0NNgEl6g3JMjzhHZ7qMjIBWe7VEy7WtNCeQgbZdpaTSdg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708776953; c=relaxed/simple; bh=oP261W1pt6YMYe8qcA9fKGIH4omThSFAKhryuBOrQu8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=VN0TPeWdvSwQBajmyhfevPe6wLebRd+1E5rrULM5EA9waN94Npnv6ovFkJF/l+VGz8ptHq+0cn9x0J25ZzesYsxuNuIL3XdWPZPLmNyRDQJ2xW+02wT4ghBVgz1XjOP6qIKOkMkWfRHgm83pZWyZWykOsmpI/hWlXi6xQh7Nqa0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JWj5D/Lb; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5597C433C7; Sat, 24 Feb 2024 12:15:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708776952; bh=oP261W1pt6YMYe8qcA9fKGIH4omThSFAKhryuBOrQu8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JWj5D/Lbhnfny8owmLC3lczUAT9S5jtD5sU8TU8QhGT26WP/1weK5cK8AHcWA5qEr vw/Vo5aAnO5uho3XszpE2+nui1H5lIahI6iktAdCxtURW4MTgc3+FC47zrxgJpQba4 H+c9EJ9Y+tW7ixHzdCopIHFqSPERkhYJ0ftNSQwkcoUVYF6PK4IPMVYJBjyiRpwSpP T8uzMrHbYhFjn1bgKF4r1bujG3jbzogaatVPGfE2j6OOHe3x0KCtdpnIYDzWmOCT2c zYLL3n+T6eH/0CWXMh2GovCRMWz1efiHBxRG8DZFfVoPXB1NA7ZXcEeV4d/LN1vZN1 bjOt1HAejD04g== From: Arnd Bergmann <arnd@kernel.org> To: Lucas De Marchi <lucas.demarchi@intel.com>, Oded Gabbay <ogabbay@kernel.org>, =?utf-8?q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com> Cc: Arnd Bergmann <arnd@arndb.de>, Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Nathan Chancellor <nathan@kernel.org>, Nick Desaulniers <ndesaulniers@google.com>, Bill Wendling <morbo@google.com>, Justin Stitt <justinstitt@google.com>, Rodrigo Vivi <rodrigo.vivi@intel.com>, Matt Roper <matthew.d.roper@intel.com>, Matthew Auld <matthew.auld@intel.com>, Matthew Brost <matthew.brost@intel.com>, Koby Elbaz <kelbaz@habana.ai>, "Michael J. Ruhl" <michael.j.ruhl@intel.com>, Francois Dugast <francois.dugast@intel.com>, Dave Airlie <airlied@redhat.com>, intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH 2/3] drm/xe/mmio: fix build warning for BAR resize on 32-bit Date: Sat, 24 Feb 2024 13:15:00 +0100 Message-Id: <20240224121528.1972719-2-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240224121528.1972719-1-arnd@kernel.org> References: <20240224121528.1972719-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791782523649462844 X-GMAIL-MSGID: 1791782523649462844 |
Series |
[1/3] drm/xe/kunit: fix link failure with built-in xe
|
|
Commit Message
Arnd Bergmann
Feb. 24, 2024, 12:15 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de> clang complains about a nonsensical test on builds with a 32-bit phys_addr_t, which means resizing will always fail: drivers/gpu/drm/xe/xe_mmio.c:109:23: error: result of comparison of constant 4294967296 with expression of type 'resource_size_t' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare] 109 | root_res->start > 0x100000000ull) | ~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~ Previously, BAR resize was always disallowed on 32-bit kernels, but this apparently changed recently. Since 32-bit machines can in theory support PAE/LPAE for large address spaces, this may end up useful, so change the driver to shut up the warning but still work when phys_addr_t/resource_size_t is 64 bit wide. Fixes: 9a6e6c14bfde ("drm/xe/mmio: Use non-atomic writeq/readq variant for 32b") Fixes: ea97a66a2218 ("drm/xe: Disable 32bits build") Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/gpu/drm/xe/xe_mmio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Sat, Feb 24, 2024 at 01:15:00PM +0100, Arnd Bergmann wrote: >From: Arnd Bergmann <arnd@arndb.de> > >clang complains about a nonsensical test on builds with a 32-bit phys_addr_t, >which means resizing will always fail: > >drivers/gpu/drm/xe/xe_mmio.c:109:23: error: result of comparison of constant 4294967296 with expression of type 'resource_size_t' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare] > 109 | root_res->start > 0x100000000ull) > | ~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~ > >Previously, BAR resize was always disallowed on 32-bit kernels, but >this apparently changed recently. Since 32-bit machines can in theory >support PAE/LPAE for large address spaces, this may end up useful, >so change the driver to shut up the warning but still work when >phys_addr_t/resource_size_t is 64 bit wide. > >Fixes: 9a6e6c14bfde ("drm/xe/mmio: Use non-atomic writeq/readq variant for 32b") >Fixes: ea97a66a2218 ("drm/xe: Disable 32bits build") this second Fixes should not be here? How would "disabling 32bits build" break 32bits build? I think just the first one is enough, otherwise 237412e45390 ("drm/xe: Enable 32bits build") is your next good candidate. Acked-by: Lucas De Marchi <lucas.demarchi@intel.com> Lucas De Marchi >Signed-off-by: Arnd Bergmann <arnd@arndb.de> >--- > drivers/gpu/drm/xe/xe_mmio.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/drivers/gpu/drm/xe/xe_mmio.c b/drivers/gpu/drm/xe/xe_mmio.c >index e3db3a178760..7ba2477452d7 100644 >--- a/drivers/gpu/drm/xe/xe_mmio.c >+++ b/drivers/gpu/drm/xe/xe_mmio.c >@@ -106,7 +106,7 @@ static void xe_resize_vram_bar(struct xe_device *xe) > > pci_bus_for_each_resource(root, root_res, i) { > if (root_res && root_res->flags & (IORESOURCE_MEM | IORESOURCE_MEM_64) && >- root_res->start > 0x100000000ull) >+ (u64)root_res->start > 0x100000000ul) > break; > } > >-- >2.39.2 >
diff --git a/drivers/gpu/drm/xe/xe_mmio.c b/drivers/gpu/drm/xe/xe_mmio.c index e3db3a178760..7ba2477452d7 100644 --- a/drivers/gpu/drm/xe/xe_mmio.c +++ b/drivers/gpu/drm/xe/xe_mmio.c @@ -106,7 +106,7 @@ static void xe_resize_vram_bar(struct xe_device *xe) pci_bus_for_each_resource(root, root_res, i) { if (root_res && root_res->flags & (IORESOURCE_MEM | IORESOURCE_MEM_64) && - root_res->start > 0x100000000ull) + (u64)root_res->start > 0x100000000ul) break; }