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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F9A1C433EF for ; Mon, 20 Dec 2021 10:15:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230474AbhLTKPl (ORCPT ); Mon, 20 Dec 2021 05:15:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230459AbhLTKPj (ORCPT ); Mon, 20 Dec 2021 05:15:39 -0500 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6500C061574 for ; Mon, 20 Dec 2021 02:15:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Content-Type:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=alHpGosBZG9KLUVJPord3i/tdWAv/gVYDukIQiUTKBI=; t=1639995339; x=1641204939; b=K07fhTRDuBz1XJ0BQMX22xmeqPl28GvDtHtKt9WB0hTdrAo TQp3rnz09ByihGkeoWRxCkipt7fOUOc36Dv3frJumpkZGk2t/U8btpW3q68sdsLsLj7VcA/NZBA+G woRcK0gQturTSw2pTWNoEZ1Yr9OuFZJRvIN2NTVAipc1FH8nH6RZYCFIZrkhMIC9uUeAAg4nx+nkv X75cVplkODtK5+HnMAElC7CcLW0CqG0Vy4263Tdpp5otfuUrWAIUjKL50yr65XHu1fHwFh1OvH/PQ +1fSGACfS/o7xwy8WlUBaPb7H4GD78DRAC353S0Mb5ylrCNjqOE671fb7h4N9xkg==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.95) (envelope-from ) id 1mzFhf-00E3ko-Uu; Mon, 20 Dec 2021 11:15:36 +0100 From: Johannes Berg To: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org, linux-um@lists.infradead.org, Geert Uytterhoeven , Johannes Berg Subject: [PATCH] drm/ttm: fix compilation on ARCH=um Date: Mon, 20 Dec 2021 11:15:22 +0100 Message-Id: <20211220111519.a4c8c6eff702.Ie4cf4e68698f6a9f546b83379bc52c266504424f@changeid> X-Mailer: git-send-email 2.33.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johannes Berg Even if it's probably not really useful, it can get selected by e.g. randconfig builds, and then failing to compile is an annoyance. Unfortunately, it's hard to fix in Kconfig, since DRM_TTM is selected by many things that don't really depend on any specific architecture, and just depend on PCI (which is indeed now available in ARCH=um via simulation/emulation). Fix this in the code instead by just ifdef'ing the relevant two lines that depend on "real X86". Reported-by: Geert Uytterhoeven Signed-off-by: Johannes Berg --- drivers/gpu/drm/ttm/ttm_module.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_module.c b/drivers/gpu/drm/ttm/ttm_module.c index 0037eefe3239..a3ad7c9736ec 100644 --- a/drivers/gpu/drm/ttm/ttm_module.c +++ b/drivers/gpu/drm/ttm/ttm_module.c @@ -68,9 +68,11 @@ pgprot_t ttm_prot_from_caching(enum ttm_caching caching, pgprot_t tmp) #if defined(__i386__) || defined(__x86_64__) if (caching == ttm_write_combined) tmp = pgprot_writecombine(tmp); +#ifndef CONFIG_UML else if (boot_cpu_data.x86 > 3) tmp = pgprot_noncached(tmp); -#endif +#endif /* CONFIG_UML */ +#endif /* __i386__ || __x86_64__ */ #if defined(__ia64__) || defined(__arm__) || defined(__aarch64__) || \ defined(__powerpc__) || defined(__mips__) if (caching == ttm_write_combined) -- 2.33.1 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 3DBC5C433F5 for ; Mon, 20 Dec 2021 11:00:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1E7B210FCE8; Mon, 20 Dec 2021 11:00:01 +0000 (UTC) X-Greylist: delayed 2660 seconds by postgrey-1.36 at gabe; Mon, 20 Dec 2021 10:59:59 UTC Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by gabe.freedesktop.org (Postfix) with ESMTPS id B82CE10FCE7 for ; Mon, 20 Dec 2021 10:59:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Content-Type:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=alHpGosBZG9KLUVJPord3i/tdWAv/gVYDukIQiUTKBI=; t=1639997999; x=1641207599; b=wPDZSbPW3GiSJxLXnewHXas+qdEEAbmdMeQLh3OfM7GSmml XceVYlDmkyxH/54rnqabFxhPh5sxyvBkb00nM/dkWFfqi1MCZTkKb7qrO+axDE3dRGplOnJDUfBO0 wlTJYkhmjT23sJhLZZDYGMqt9vEyMbWHmmVxo07yOSwIYKYjUhbMemGtLPf7BMfJ1Zri0ALxdirar MIvjF9IMrx4LDLxSQB8yoKUvpU6U4zrUjqvizxcy4NzvrVn/wkisI6Bdy4vrtsoQvtihzZ3nAbfai hLf60xQNWmsxykHCyCBsVRmRpIvCVzHC01pS1js0195NnmU3VyiZaaDqytYjY3WQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.95) (envelope-from ) id 1mzFhf-00E3ko-Uu; Mon, 20 Dec 2021 11:15:36 +0100 From: Johannes Berg To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/ttm: fix compilation on ARCH=um Date: Mon, 20 Dec 2021 11:15:22 +0100 Message-Id: <20211220111519.a4c8c6eff702.Ie4cf4e68698f6a9f546b83379bc52c266504424f@changeid> X-Mailer: git-send-email 2.33.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Geert Uytterhoeven , linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, Johannes Berg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Johannes Berg Even if it's probably not really useful, it can get selected by e.g. randconfig builds, and then failing to compile is an annoyance. Unfortunately, it's hard to fix in Kconfig, since DRM_TTM is selected by many things that don't really depend on any specific architecture, and just depend on PCI (which is indeed now available in ARCH=um via simulation/emulation). Fix this in the code instead by just ifdef'ing the relevant two lines that depend on "real X86". Reported-by: Geert Uytterhoeven Signed-off-by: Johannes Berg --- drivers/gpu/drm/ttm/ttm_module.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_module.c b/drivers/gpu/drm/ttm/ttm_module.c index 0037eefe3239..a3ad7c9736ec 100644 --- a/drivers/gpu/drm/ttm/ttm_module.c +++ b/drivers/gpu/drm/ttm/ttm_module.c @@ -68,9 +68,11 @@ pgprot_t ttm_prot_from_caching(enum ttm_caching caching, pgprot_t tmp) #if defined(__i386__) || defined(__x86_64__) if (caching == ttm_write_combined) tmp = pgprot_writecombine(tmp); +#ifndef CONFIG_UML else if (boot_cpu_data.x86 > 3) tmp = pgprot_noncached(tmp); -#endif +#endif /* CONFIG_UML */ +#endif /* __i386__ || __x86_64__ */ #if defined(__ia64__) || defined(__arm__) || defined(__aarch64__) || \ defined(__powerpc__) || defined(__mips__) if (caching == ttm_write_combined) -- 2.33.1