Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1279937rbb; Mon, 26 Feb 2024 04:48:29 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX99j4nYQPZVX9u3NLDx1DivteKYxz3SpdOloXUzBJOFvaqFr/fb1vjIhFySVHB52y080xZakICKN/Qt0NdtgyPL4VKdGw8HINzGC/yzg== X-Google-Smtp-Source: AGHT+IEdOv3/DPExT7xcRHBfh/5RLWizdJ8MPUGvQg6OGeAa1hmPJB0HZIQeO7qwhae2NxTNL7SH X-Received: by 2002:ac2:4e05:0:b0:512:fe3d:a991 with SMTP id e5-20020ac24e05000000b00512fe3da991mr1630882lfr.61.1708951709071; Mon, 26 Feb 2024 04:48:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708951709; cv=pass; d=google.com; s=arc-20160816; b=gYyfHlMiGDq+s1OOhYfi649MekuaMq6WK86hpDLDW7nJmP5y1g2jRPXf/Vc1xU6Bm1 3YPDo0AepJHk5jCzt7GwyZ4BcBkUUEsdc789cBwvlbepeeSQV6KUDmBiS3K5ecQUVb0l Tc1DKUjMFvyAgmxyiFBNYKT7k3kIIrIIeQn0jfustY7oh62g8zal/uPOZfQXIvE00P2+ 4JPwEUdLez4DVnyid2oc5u9PNKfQOmnKkddcElD8sak0I9bOWx5KgJNm3Mt1Db8i3dgJ uVXVNqwKU6ixe6SfrgN2TkCgZBO+uUZk3VIRPoPV76wY/wp99/adm0ruGe9o3O7U+nOF is9w== 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=hnkGjdrLayinTjSFm+iK8mnpfmKmHIi84NKh3rBIhbs=; fh=DqK3/oIS1/k2eHjBxY23c3ZbhLUW/1pWCRydn1TZwZc=; b=b+wMn5G07aHz2QpvZsLBNYsimHMDWoxpclcz1Z3iOGmD7R2h1f/2e27DY39aasbnbJ 2xWGD2nn8HKP27JuKNGzW4XFLGrlBzv2UFQ/YCaoTEu2/D/WZZY0b0YA6sWfaTqnKuYw lvy5QyPzy6rBlS75RMjGSz1EjyLxrkK+ugUuWZD6e0U3cVgVHXEkOl2q0iIHJ0GHtkle 6oEcnoB6vDub2xERO7mL28FMwNlo59N1KjPAD1gib1bcSg87thQirNWa8wKg4QSPDy+T XTz7rDmdpt9H5kKI+YDcC2/HRXbirf1czBHMfh7KvEQetDw1Q0GvNQWTk8lZp9XmaSpz z0Fw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Bq8V8bu+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-81406-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81406-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id gs32-20020a1709072d2000b00a43215bff12si1376246ejc.648.2024.02.26.04.48.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 04:48:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81406-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Bq8V8bu+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-81406-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81406-linux.lists.archive=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 7DE331F25AA1 for ; Mon, 26 Feb 2024 12:48:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B0087F7DE; Mon, 26 Feb 2024 12:48:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Bq8V8bu+" 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 3FA89EC7; Mon, 26 Feb 2024 12:48:19 +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=1708951700; cv=none; b=tcu0ilXoIQ2jLg6I0LOsTXOaehD9yAEeQMRen/JzVOgdVfMuek1Djvi9QqNkkxvddE6hNPtmjGhrnmFHpiB3uomZtHVFM3Q0ODgaKHG2tukDiUrcpSm8JPA8Tfpl/FHmDDoCbEjQfTK0n4aoSS7gr247tHpbRFs/eNYhIvQX9o0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708951700; c=relaxed/simple; bh=nwHarD6e/noK0RLpyMyg49ecLqGeQ0DNCXP39VJcJnU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=VMpDgaGtCjOt6YmNCOE1b4ur/Q/TS9SEKDsUFSojHU5+2yETA2EA92wGQVbsufu+oepad+JbbdqWm18lSnVFXyd7I5Osf/9oJzHCTVhaxTjgtxrNYtuWFTVCOH8tHtodHfa7Swo0p/kl/4SzkjtQcf6Qr/lkiDtB4GOSBm66BeI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Bq8V8bu+; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87566C433F1; Mon, 26 Feb 2024 12:48:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708951699; bh=nwHarD6e/noK0RLpyMyg49ecLqGeQ0DNCXP39VJcJnU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bq8V8bu+AnNPQ618fedRUM7MYXae1yTLy649cK81/fffiV4+DdQr+B6CwBXjv1QA/ 9XwitYZerkPdzT5oQ/BMnkEy4pIshL73oouNzyIJoPfQp9+cQuhHNB3RpERuh9m4fH E9M8scMGqCESeLu8Ph8VEitEHpGBWF+T8lMDqXAWow9kDmXkSJ2EMmuDiOL61oW5ak 8GXdCtwNHiGHcJIJA6zt7gf/AdcrTa9iQtsvwNLiQU3QsjS7Nq5smBFZwrq9/k7ZvA uB0u6Yts0KZNO9gSsCmBl/IqxfViSV3BHGkV+4r+G1t7huI2eVrHUs+49XbtkKfIzY CjL4rZQN+bcqg== From: Arnd Bergmann To: Lucas De Marchi , Oded Gabbay , =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= Cc: Arnd Bergmann , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Rodrigo Vivi , Matt Roper , Matthew Auld , Matthew Brost , intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH 2/3] [v2] drm/xe/mmio: fix build warning for BAR resize on 32-bit Date: Mon, 26 Feb 2024 13:46:37 +0100 Message-Id: <20240226124736.1272949-2-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240226124736.1272949-1-arnd@kernel.org> References: <20240226124736.1272949-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arnd Bergmann 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: 237412e45390 ("drm/xe: Enable 32bits build") Signed-off-by: Arnd Bergmann --- v2: use correct Fixes tag --- 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