Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp928255rdb; Fri, 1 Dec 2023 02:21:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IF7i7Ky3mrfSnmYPXsLUyBtZCy9hrpFlU7pJuqD0Bz8FU337S1LN4Ykd+LQ2QqC9Smpi+3l X-Received: by 2002:a17:902:f80f:b0:1d0:488e:3827 with SMTP id ix15-20020a170902f80f00b001d0488e3827mr2795279plb.56.1701426108459; Fri, 01 Dec 2023 02:21:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701426108; cv=none; d=google.com; s=arc-20160816; b=zlDjq7rdTBk4rFKYykR/8E554PKZ/aWFVDqc290cEetPnkFcOaj7S/O9cWO8xBARQy sbJmwNzj5je2OtHiYW0/mnzNSCl7fwJMufOTVt3F7qaZsgjAa9Jio+f0RiytRGd/FoZi 1jhj1NLYS1opwtN+ibRji5aZmGzQw7xbmJ3L6bwvmOTUU7RwWR+h7RUrFQXf4Ho5n3WP nmSxwXzorKuEbhVQFBNe6jK91qymtCX+CjxtVB5mbwM6SfSLBgeoyO4IUx08IApPHKY/ OTPBBj7uRc2cECNxEbcWqc8Yrpwlka2Z9NSmBpqNHeDP4CcB1s9egerAUZGuUMDaXLPG qmhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=+Bh0vGQqG6k9jMrVj2KcvFrOUEDKVV6QIbcGZMpO/NE=; fh=RLaZYpbgbijFgsCRVcJSIeXyumxUrHCaBWPrG0K3LF0=; b=yrdcLZKvbMKRJy12DbDHFEoVOFoqE2CuTQbxzTF3nd/GD+xBZWGQNYQxRfiVvgMQUa qrY79voocJ3JrxGOOn04B7gb8IPLlppTBLiHNS2l0hqgbOomywkdDl2Df6x4UM0FE514 gNKU5FT4yonYDvHWt3rtae40+gX6xZEv1t2PWUPWjBseEmcnGMA6X4L1FPS1fWRDDcbu BzEx/RpBkcIiCrSniub1Ho3hokQc7P0vtcjQG1HAh6BjoeBdsSXITjAlNkwkVa4XZbO0 Wm2vJJ4BvxbXxMoKgzy9ImhweT1yLmpUak76CoRah3Id/G7NzPl8thaOAqKN6VdXxAaL nKwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=THk4CnIn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id 1-20020a170902c10100b001cf5d4f91d8si3045455pli.333.2023.12.01.02.21.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 02:21:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=THk4CnIn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id E1DF080A9998; Fri, 1 Dec 2023 02:21:24 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378243AbjLAKVF (ORCPT + 99 others); Fri, 1 Dec 2023 05:21:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378240AbjLAKVD (ORCPT ); Fri, 1 Dec 2023 05:21:03 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8539FF1 for ; Fri, 1 Dec 2023 02:21:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701426066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+Bh0vGQqG6k9jMrVj2KcvFrOUEDKVV6QIbcGZMpO/NE=; b=THk4CnInihMMOP5d+HzTJXiN8RgYyaMXQM7Y6VhJ3sCKNW1B+VgbRktdtIcoUElg94brXh qH9MoEFXXL0KUfadBU16gAm5MqFV3+HuImarJMdri22fC40IWBge3TfhEophBfMUdKg9yY yRS1ZRf4jx10AUT7uiMP+NcAeOSUZew= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-612-nw2wVhCoNQSjMjuNowhBhA-1; Fri, 01 Dec 2023 05:21:04 -0500 X-MC-Unique: nw2wVhCoNQSjMjuNowhBhA-1 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-333127febb2so1664855f8f.2 for ; Fri, 01 Dec 2023 02:21:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701426064; x=1702030864; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+Bh0vGQqG6k9jMrVj2KcvFrOUEDKVV6QIbcGZMpO/NE=; b=mBwh8aXOWh/VaFcXG3xT7iky0vJZ7jDmLScmAZQowR1p/QrKJwzzkntt68opvuffEI MXQdJpBIimab+9nCJXWJCkFORw+P0tzmCpbe7M/PYEIQMGf2+VEOynoV1sz7DeQ4WXMK /Eo506zuSXCTE6w8wg8AOOMiebX8AWpBIgWPpS3oJ/W8Vu5bDkE13l93V5YGWQkovwN2 N3DRkemi4esK2G/aGYBWFQmmWgsyAyzni1sw464I2UI/8abWP5w6BDioRZ2jMvIXnvym MPJnLWvx7hNPq/ywT97mgWbSm8AySR0Uf2WbKFzRBB+ADIwEcmkV+a4jlCaTbzb5G9aB f+fQ== X-Gm-Message-State: AOJu0Yy4gABW86whIhV20yo2HWqF4LsNKCzgohtuXMKRqbaZu+P/BdIz VFNIG1nUiIjkaoT2Bhrj5rki0k2LBRPZXS03B2Hc1Lzep6ZWpvyUwFqpTqIGyUil+HeWZZyEt/9 j3JN4E2Gj0r9sITz9r6z70F0S X-Received: by 2002:a05:600c:4504:b0:40b:5e21:d366 with SMTP id t4-20020a05600c450400b0040b5e21d366mr314303wmo.111.1701426063770; Fri, 01 Dec 2023 02:21:03 -0800 (PST) X-Received: by 2002:a05:600c:4504:b0:40b:5e21:d366 with SMTP id t4-20020a05600c450400b0040b5e21d366mr314294wmo.111.1701426063464; Fri, 01 Dec 2023 02:21:03 -0800 (PST) Received: from localhost (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id h7-20020adf9cc7000000b0032d8eecf901sm3859764wre.3.2023.12.01.02.21.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 02:21:03 -0800 (PST) From: Javier Martinez Canillas To: Thomas Zimmermann , Ard Biesheuvel , Rob Herring Cc: devicetree@vger.kernel.org, Sergio Lopez , Sima Vetter , Hector Martin , Andrew Worsley , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Frank Rowand Subject: Re: [RFC PATCH] of/platform: Disable sysfb if a simple-framebuffer node is found In-Reply-To: <58672ab8-99bf-4a2a-af79-031d1e8fcba0@suse.de> References: <20231113085305.1823455-1-javierm@redhat.com> <87jzqi59bt.fsf@minerva.mail-host-address-is-not-set> <874jhj1fm3.fsf@minerva.mail-host-address-is-not-set> <58672ab8-99bf-4a2a-af79-031d1e8fcba0@suse.de> Date: Fri, 01 Dec 2023 11:21:02 +0100 Message-ID: <87fs0mxlyp.fsf@minerva.mail-host-address-is-not-set> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 01 Dec 2023 02:21:25 -0800 (PST) Thomas Zimmermann writes: > Hi > > Am 18.11.23 um 12:10 schrieb Javier Martinez Canillas: >> Ard Biesheuvel writes: >> >> Hello Ard, >> >>> On Fri, 17 Nov 2023 at 00:09, Rob Herring wrote: >> >> [...] >> >>>>>> >>>>>> This could also lead to an interesting scenario. As simple-framebuffer >>>>>> can define its memory in a /reserved-memory node, but that is ignored >>>>>> in EFI boot. Probably would work, but only because EFI probably >>>>>> generates its memory map table from the /reserved-memory nodes. >>>>>> >>>>> >>>>> I see. So what would be the solution then? Ignoring creating a platform >>>>> device for "simple-framebuffer" if booted using EFI and have an EFI-GOP? >>>> >>>> Shrug. I don't really know anything more about EFI FB, but I would >>>> guess it can't support handling resources like clocks, power domains, >>>> regulators, etc. that simple-fb can. So if a platform needs those, do >>>> we say they should not setup EFI-GOP? Or is there a use case for >>>> having both? Clients that don't muck with resources can use EFI-GOP >>>> and those that do use simple-fb. For example, does/can grub use >>>> EFI-GOP, but not simple-fb? >>>> >>> >>> The EFI GOP is just a dumb framebuffer, and it is not even generally >>> possible to cross reference the GOP with a particular device in the >>> device hierarchy unless you e.g., compare the BARs of each device with >>> the region described by the GOP protocol. >>> >>> GRUB for EFI will use the GOP and nothing else, but only at boot time >>> (the GOP protocol is more than a magic linear memory region, it also >>> implements a Blt() abstraction that permits the use of framebuffers >>> that are not mapped linearly into the address space at all, and GRUB >>> makes use of this) >>> >>> The EFI stub will only expose GOPs to the kernel if they are in fact >>> linear framebuffers, but has zero insight into whether the hardware >>> needs clocks and regulators, and whether or not the framebuffer needs >>> IOMMU pass through (which might be the case if the scanout is using >>> DMA into system memory) >>> >>> So calling EFI GOP 'source of truth' is rather generous, and I think >>> it makes sense to prioritize more accurate descriptions of the >>> underlying framebuffer over EFI GOP. >>> >> >> That was my opinion as well and the reason why I called the DTB the >> single source of truth. >> >>> However, making 'simple-framebuffer' magic in this regard doesn't seem >>> like a great approach to me. Is there a better way we could get the >>> resource conflict to be decided in a way where the EFI GOP gets >>> superseded if its resources are claimed by another device? >>> >> >> There is an aperture [0] framework that is used by the fbdev and DRM >> subsystems to allow native drivers to remove any conflicting devices >> that share the same framebuffer aperture. >> >> But it only makes sense for native drivers to use that I think, but >> in this case is about two drivers that attempt to use the same frame >> buffer provided by the firmware but getting it from different places. >> >> I don't have a better idea than this patch but maybe Thomas or Sima do? > > At SUSE, we've carried such a patch in our repos for some time. It works > around the double-framebuffer problem in a similar way. [1] > Thanks for the information. I see that your patch is basically mine but doing it unconditionally while this one only does the sysfb_disable() if a "simple-framebuffer" DT node has been found. > As Javier mentioned, we do track the framebuffer ranges for EFI/VESA/OF > framebuffers in the graphics aperture helpers. Fbdev has done this for > decades, and the current codebase extends and harmonizes this > functionality among fbdev and DRM drivers. > > WRT DT vs EFI: AFAIK the EFI support on affected platforms looks at the > DT to set up the EFI framebuffer. So IMHO the DT is the authoritative > source on the framebuffer. > Agreed. Sima Vetter also mentioned on IRC that they think this patch is the least bad option. Rob, Ard any thoughts? Maybe we can land this as a fix and then figure how this could be better handled in the long term? > Best regards > Thomas > > [1] https://bugzilla.suse.com/show_bug.cgi?id=1204315 > -- Best regards, Javier Martinez Canillas Core Platforms Red Hat