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 600D5EB64DA for ; Thu, 20 Jul 2023 16:59:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231669AbjGTQ75 (ORCPT ); Thu, 20 Jul 2023 12:59:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231596AbjGTQ7v (ORCPT ); Thu, 20 Jul 2023 12:59:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60E601986 for ; Thu, 20 Jul 2023 09:59:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 00BE761B94 for ; Thu, 20 Jul 2023 16:59:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D7D2C433C7; Thu, 20 Jul 2023 16:59:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1689872389; bh=BWN8RDW/F3Ur8+fhKfNO7LgQLGDCq1Ig8Du/EwBlLs0=; h=Subject:To:Cc:From:Date:From; b=lLfuHh8aIh9eBnP2BWoDOroyiUKX7T7448MMim9z7pVUbBD5fPR99JzkctR0Ouy8m jLUO7nmncOP5F90H0hGnIZU9cE988L0SwTWPc5crI780p9kd2UMXSpIg+bFoU2AdPz bPbUdmB+sHtsLeXk6ih/CR8Lp3x6Veez2pFOx33w= Subject: FAILED: patch "[PATCH] video/aperture: Only remove sysfb on the default vga pci" failed to apply to 6.1-stable tree To: daniel.vetter@ffwll.ch, alexander.deucher@amd.com, aplattner@nvidia.com, daniel.vetter@intel.com, deller@gmx.de, javierm@redhat.com, sam@ravnborg.org, stable@vger.kernel.org, tzimmermann@suse.de Cc: From: Date: Thu, 20 Jul 2023 18:59:44 +0200 Message-ID: <2023072044-purist-impound-d2d6@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 6.1-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y git checkout FETCH_HEAD git cherry-pick -x 5ae3716cfdcd286268133867f67d0803847acefc # git commit -s git send-email --to '' --in-reply-to '2023072044-purist-impound-d2d6@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^.. Possible dependencies: 5ae3716cfdcd ("video/aperture: Only remove sysfb on the default vga pci device") 5fbcc6708fe3 ("video/aperture: Drop primary argument") 62aeaeaa1b26 ("drm/aperture: Remove primary argument") 80e993988b97 ("drm/gma500: Use drm_aperture_remove_conflicting_pci_framebuffers") 81d2393485f0 ("fbdev/hyperv-fb: Do not set struct fb_info.apertures") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 5ae3716cfdcd286268133867f67d0803847acefc Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Thu, 6 Apr 2023 15:21:07 +0200 Subject: [PATCH] video/aperture: Only remove sysfb on the default vga pci device Instead of calling aperture_remove_conflicting_devices() to remove the conflicting devices, just call to aperture_detach_devices() to detach the device that matches the same PCI BAR / aperture range. Since the former is just a wrapper of the latter plus a sysfb_disable() call, and now that's done in this function but only for the primary devices. This fixes a regression introduced by commit 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 losing 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 restore 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 symptoms. That bug is fixed now, see https://bugzilla.kernel.org/show_bug.cgi?id=216331#c15 Note that we should not have any such issues on non-pci multi-gpu issues, because I could only find two such cases: - SoC with some external panel over spi or similar. These panel drivers do not use drm_aperture_remove_conflicting_framebuffers(), so no problem. - vga+mga, which is a direct console driver and entirely bypasses all this. 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. v2: - Explain a bit better why other multi-gpu that aren't pci shouldn't have any issues with making all this fully pci specific. v3 - polish commit message (Javier) v4: - Fix commit message style (i.e., commit 1234 ("...")) - fix Daniel's S-o-b address v5: - add back an S-o-b tag with Daniel's Intel address Fixes: ee7a69aa38d8 ("fbdev: Disable sysfb device registration when removing conflicting FBs") Tested-by: Aaron Plattner Reviewed-by: Javier Martinez Canillas Link: https://bugzilla.kernel.org/show_bug.cgi?id=216303#c28 Signed-off-by: Daniel Vetter Signed-off-by: Daniel Vetter Signed-off-by: Thomas Zimmermann 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) Link: https://patchwork.freedesktop.org/patch/msgid/20230406132109.32050-8-tzimmermann@suse.de diff --git a/drivers/video/aperture.c b/drivers/video/aperture.c index a0945027e0df..fa71f8257eed 100644 --- a/drivers/video/aperture.c +++ b/drivers/video/aperture.c @@ -322,15 +322,16 @@ int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, const char *na if (pdev == vga_default_device()) primary = true; + 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) {