Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp9607115rwl; Wed, 11 Jan 2023 07:47:36 -0800 (PST) X-Google-Smtp-Source: AMrXdXs87Y1yeLY9yrMRaEgjJoejcNjIJX8JxCLl2O7gZ7WwqdMkIAJvnV4xqeeOTcGCELB3nRuu X-Received: by 2002:a17:90b:3758:b0:225:d698:69b9 with SMTP id ne24-20020a17090b375800b00225d69869b9mr65229708pjb.17.1673452055901; Wed, 11 Jan 2023 07:47:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673452055; cv=none; d=google.com; s=arc-20160816; b=zpI4cs15VrAjLCkKmLdL8kxlyneugnndNCO6l2Vus5Kz++1BYYWuZWWZu3EiWr4YPo ymKj+s7B09Bd9pTPphikOaNfYRVkuUzeaALT+NtOEdDBVvz6aU4P7Vo80JvPf/tOKf/W T/jjm4nRZYPgDr8YskppstdlrtyUkqXPUKigM2yA3HOS44oztDUzlGcguXfJggGE9GBv 6S1D2/fGhJ3QE0rGhzvvH5Kh9IgF+TkcVtLJwjMj4FHpY4OavxhigZLg0HHccPq5SoTg AwvbYx35pfYYTvysPJGoK+ECb+6ipl7f3cUrV6dD6qzST/956Psu7JwRwaeWlJN/f01n LF0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6J5rucn+hYvg3m1RRrffzZkT45tj6msLk6PzkRA+oVc=; b=1JeEgNy2IadIdSKODjp34kzDeRkW7xsYeZ36KIL5Wy7bVPIq/g3HGuQvm0ZQyA4339 obVENutUdZxZlQ8TsFBDWIG0lwWo8MnkczBkWXz5VONYNW9lywGQKE5QiWMtINBRZQVo KCgNqg0TdHRcL7aCYNlstIvdEPTlI4aw2sZfznMumBw36aQ89eGZX9vZsqT9miDUf8qO Jj5gtFmC1E6H7gSumvwBsilm0WzE2Htvq1YGarVECeEZRCagn0Lc/JybVsoujYwmLeWo qpvJr0vX7jwTjafSbplTKxo+JnhK77yTe+pKZGpmgDjUBFkK19SzXOerVYNCnAu+fDXd e/lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=UVhq2xNF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lk13-20020a17090b33cd00b00217b50ee7b6si12921962pjb.1.2023.01.11.07.47.28; Wed, 11 Jan 2023 07:47:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=UVhq2xNF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238964AbjAKPmS (ORCPT + 53 others); Wed, 11 Jan 2023 10:42:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235423AbjAKPlg (ORCPT ); Wed, 11 Jan 2023 10:41:36 -0500 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7846386 for ; Wed, 11 Jan 2023 07:41:35 -0800 (PST) Received: by mail-wm1-x330.google.com with SMTP id k22-20020a05600c1c9600b003d1ee3a6289so12978154wms.2 for ; Wed, 11 Jan 2023 07:41:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6J5rucn+hYvg3m1RRrffzZkT45tj6msLk6PzkRA+oVc=; b=UVhq2xNFtKTEbVePhTQcD+DkCgbC/RTrE0C4YZitCzyqe4S737uZqLY3u5UyA5WYdh DU1EQp1fcY/CsFWajQS4me7Fr87/4MjvTP/R0kLn9HFvOw1ZaYON/UzLgbPfAX349II2 SzM9iGgw+0+m+eT166Z18NC4dIm8W4gJUqyaU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6J5rucn+hYvg3m1RRrffzZkT45tj6msLk6PzkRA+oVc=; b=AjnX5vl7+29NXfQNtNLambGNx4ECgIuyYHcD+FysVvNS75UDnd+/SruV3FFTfk2p/d ofbP/xNpWeHHkwmgrEvCdT8tRng5O5LLevmjZIJBlXhNioMw4oGsVMyjH+rBByfCc+lR 1xDqcqW4jVKIycLITED/9vFg3jj0uVBLKiPOWfPupxYxsRem6VKUgQDSk+g0PcZYz+jK QqCxgytW2RMqZU3FpKVPbx5JCuawV40R3/xy+4vEPLcCpslUW8ij8Sm9qys5Y5Ii9zpb 6t09AbTwY7sjRuhVp4jxKKbfF8d3AvPpbszilyXhtKgSelIiMo3x4qiFSEMYAKa0WiGa lUXQ== X-Gm-Message-State: AFqh2krb4oFAHFum8itpv3Y/49iLqv6oUIYCVdvMr1n8wh8ZHXsnFCjk vJf9gg5Kzxf36trf0tlzOuunEA== X-Received: by 2002:a05:600c:3b8f:b0:3d0:480b:ac53 with SMTP id n15-20020a05600c3b8f00b003d0480bac53mr55362290wms.12.1673451695486; Wed, 11 Jan 2023 07:41:35 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id t9-20020a05600c198900b003d9e74dd9b2sm15936149wmq.9.2023.01.11.07.41.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jan 2023 07:41:34 -0800 (PST) From: Daniel Vetter To: DRI Development Cc: Intel Graphics Development , LKML , Daniel Vetter , Daniel Vetter , Aaron Plattner , Javier Martinez Canillas , Thomas Zimmermann , Helge Deller , Sam Ravnborg , Alex Deucher , stable@vger.kernel.org Subject: [PATCH 11/11] video/aperture: Only remove sysfb on the default vga pci device Date: Wed, 11 Jan 2023 16:41:12 +0100 Message-Id: <20230111154112.90575-11-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230111154112.90575-1-daniel.vetter@ffwll.ch> References: <20230111154112.90575-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This fixes a regression introduced by ee7a69aa38d8 ("fbdev: Disable sysfb device registration when removing conflicting FBs"), where we remove the sysfb when loading a driver for an unrelated pci device, resulting in the user loosing their efifb console or similar. Note that in practice this only is a problem with the nvidia blob, because that's the only gpu driver people might install which does not come with an fbdev driver of it's own. For everyone else the real gpu driver will restor a working console. Also note that in the referenced bug there's confusion that this same bug also happens on amdgpu. But that was just another amdgpu specific regression, which just happened to happen at roughly the same time and with the same user-observable symptons. That bug is fixed now, see https://bugzilla.kernel.org/show_bug.cgi?id=216331#c15 For the above reasons the cc: stable is just notionally, this patch will need a backport and that's up to nvidia if they care enough. References: https://bugzilla.kernel.org/show_bug.cgi?id=216303#c28 Signed-off-by: Daniel Vetter Cc: Aaron Plattner Cc: Javier Martinez Canillas Cc: Thomas Zimmermann Cc: Helge Deller Cc: Sam Ravnborg Cc: Alex Deucher Cc: # v5.19+ (if someone else does the backport) --- drivers/video/aperture.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/video/aperture.c b/drivers/video/aperture.c index ba565515480d..a1821d369bb1 100644 --- a/drivers/video/aperture.c +++ b/drivers/video/aperture.c @@ -321,15 +321,16 @@ int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, const char *na primary = pdev == vga_default_device(); + if (primary) + sysfb_disable(); + for (bar = 0; bar < PCI_STD_NUM_BARS; ++bar) { if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM)) continue; base = pci_resource_start(pdev, bar); size = pci_resource_len(pdev, bar); - ret = aperture_remove_conflicting_devices(base, size, name); - if (ret) - return ret; + aperture_detach_devices(base, size); } if (!primary) -- 2.39.0