Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3301634rdb; Thu, 16 Nov 2023 06:09:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IFqsqxXAIpe45hFaSG6XQ+5t2A6/ZcZ5OrtxGkJBNptzD3ac90F6//JGIKQiIm0Sl3rRL7s X-Received: by 2002:a17:902:c083:b0:1cc:ae1a:b0b8 with SMTP id j3-20020a170902c08300b001ccae1ab0b8mr8645411pld.44.1700143777180; Thu, 16 Nov 2023 06:09:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700143777; cv=none; d=google.com; s=arc-20160816; b=Jy5EKxpqKueSM9tGcs7uTHdw1czIs4UWfD5kKmeRTSEb0deSWJvqdxap/Ht0PNkEUB x/NzvNR8DDrjf9PaHiBV01xjpw2TwcrOL1u8DwLt2BO9IMr9C1hnUP4uOFaZoP/NMX3w 070WY7CqxYcapq/lR23Zio8oSfa/E5Xp37pJhy3uxLR1ylghlmaDHpG0rRc6UIJ5h205 QO/Iu6f9gCX5WrvtxjF0T1QwxTJVl7GWkiPK4zKuddd5PeV1sBjeAtoPtaIjV7Zka2eh 9oLW91AoC50DoKDuPQ3l/7lJeTgISM/CZ+nA+MRd4LfIgfzRiOz5aElYpDOi9OMGDJNe ed0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=5PsOUlHrhKopQsLCpZlhU/JN2081dyR7W2q2zUFplr8=; fh=hFExfKGXXW+8CMqYVV4TZ6755DH223XrzGS5zy1+u4k=; b=nw7Fx4/WZDmsABCzsKPJv2P9xnhdcXRfROwB9Z/G34Yq/ZYl93/OhiyKTyapcIFshf tzkSw5Zi2BW5LKpCcSQ+QVtbKEaDLTTprm2rDa7pSA5KTPF/0lol+hWO8p4LA8tVDuDx q4UL+ukRLi9211vGtw43/Oov4y6peKmd3l3vJ1E1Gea3RAkE/yqFTl4ZH2lnKKnhrQHE g8oGf8cSer7nJgzeoFAouPX2nIorppWS5oE+zdbrlkvsLezm1jMfC7Ed3UtgG3sz0gXC ELFn0C40sXu4UMrXliD+VYHMRRk9Rrz6t3x1W4ejvp51By8eJfJbXDwHZiSZpzzeribV WEhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nE6+snsg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id i12-20020a1709026acc00b001ce16042052si11551402plt.400.2023.11.16.06.09.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 06:09:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nE6+snsg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id A172C82159E4; Thu, 16 Nov 2023 06:09:35 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345215AbjKPOJb (ORCPT + 99 others); Thu, 16 Nov 2023 09:09:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230307AbjKPOJa (ORCPT ); Thu, 16 Nov 2023 09:09:30 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BEB2B7 for ; Thu, 16 Nov 2023 06:09:27 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7492C433CA; Thu, 16 Nov 2023 14:09:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700143766; bh=rB/Mvb26W5AmN+4f3AC1SZzpW+ppLKByhsjYNB+6EEI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=nE6+snsgpW57FufOCRNrLAGFfnNrWJwNYXcujeLqmsBTGpvYPlVOALApRz8fjQNiU 7ZeYNzUp+Z5nwQIXMoOaAMNb7uk2XtO6UCBaCKo9U0lRj93evUBs7++lUaGa9WMLhE EsshxHFYHOXCsUeKziJUY2U0IO/mFjLCVKv7iBjXvvNank9zzvb3XtMQBT56uvNZdg KvqQhZS3iewwuPlgG9J3FU+FdFj1sD4U4qf5H0oApIlRrp6G42uC3djNWvlnVjrKL7 Am0ylm9fIQTO1cfjcRuMNjHdQsrE/CE5IgGIgfhSOLD6WkIF4fHcL+jiN/Zu2m8jNp TmCcwg5oMdNvg== Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-5079f3f3d7aso1212853e87.1; Thu, 16 Nov 2023 06:09:26 -0800 (PST) X-Gm-Message-State: AOJu0YwmfeCKkWYD7Eso+vzdWMLe9i3rKhBG75C/WwI0/MVqlQDv/nHx dAXON72fQUJZZ4/wCcphfqHN7BfJoNPReCqzMA== X-Received: by 2002:a19:f811:0:b0:507:c7ae:32cc with SMTP id a17-20020a19f811000000b00507c7ae32ccmr11147917lff.41.1700143764953; Thu, 16 Nov 2023 06:09:24 -0800 (PST) MIME-Version: 1.0 References: <20231113085305.1823455-1-javierm@redhat.com> <87jzqi59bt.fsf@minerva.mail-host-address-is-not-set> In-Reply-To: <87jzqi59bt.fsf@minerva.mail-host-address-is-not-set> From: Rob Herring Date: Thu, 16 Nov 2023 08:09:12 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH] of/platform: Disable sysfb if a simple-framebuffer node is found To: Javier Martinez Canillas Cc: linux-kernel@vger.kernel.org, Thomas Zimmermann , Ard Biesheuvel , Sima Vetter , dri-devel@lists.freedesktop.org, Andrew Worsley , Hector Martin , Sergio Lopez , Frank Rowand , devicetree@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 16 Nov 2023 06:09:35 -0800 (PST) On Thu, Nov 16, 2023 at 3:36=E2=80=AFAM Javier Martinez Canillas wrote: > > Rob Herring writes: > > Hello Rob, > > > On Mon, Nov 13, 2023 at 2:53=E2=80=AFAM Javier Martinez Canillas > > wrote: > >> > >> Some DT platforms use EFI to boot and in this case the EFI Boot Servic= es > >> may register a EFI_GRAPHICS_OUTPUT_PROTOCOL handle, that will later be > >> queried by the Linux EFI stub to fill the global struct screen_info da= ta. > >> > >> The data is used by the Generic System Framebuffers (sysfb) framework = to > >> add a platform device with platform data about the system framebuffer. > >> > >> But if there is a "simple-framebuffer" node in the DT, the OF core wil= l > >> also do the same and add another device for the system framebuffer. > >> > >> This could lead for example, to two platform devices ("simple-framebuf= fer" > >> and "efi-framebuffer") to be added and matched with their correspondin= g > >> drivers. So both efifb and simpledrm will be probed, leading to follow= ing: > >> > >> [ 0.055752] efifb: framebuffer at 0xbd58dc000, using 16000k, total = 16000k > >> [ 0.055755] efifb: mode is 2560x1600x32, linelength=3D10240, pages= =3D1 > >> [ 0.055758] efifb: scrolling: redraw > >> [ 0.055759] efifb: Truecolor: size=3D2:10:10:10, shift=3D30:20:10:0 > >> ... > >> [ 3.295896] simple-framebuffer bd58dc000.framebuffer: [drm] *ERROR* > >> could not acquire memory range [??? 0xffff79f30a29ee40-0x2a5000001a7 > >> flags 0x0]: -16 > >> [ 3.298018] simple-framebuffer: probe of bd58dc000.framebuffer > >> failed with error -16 > >> > >> To prevent the issue, make the OF core to disable sysfb if there is a = node > >> with a "simple-framebuffer" compatible. That way only this device will= be > >> registered and sysfb would not attempt to register another one using t= he > >> screen_info data even if this has been filled. > >> > >> This seems the correct thing to do in this case because: > >> > >> a) On a DT platform, the DTB is the single source of truth since is wh= at > >> describes the hardware topology. Even if EFI Boot Services are used= to > >> boot the machine. > > > > This is the opposite of what we do for memory and memory reservations. > > EFI is the source of truth for those. > > > > 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? Rob