Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1459313lqh; Mon, 6 May 2024 08:17:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUDCL02TX2adr5XQWIOIOnum1K0qoLDBW8qO/8CF9nYqsy0L8Eeqe+Og5vaNQ8dWvPb3QgQ1gZ4BBa+WwcuMoiOcRG5/GbQ3hZxRjOhDQ== X-Google-Smtp-Source: AGHT+IHk9HCYGpKsAqg9wb0QVItVD1M0Rz+sYoxegQikbYNs0kNfHhikPcUsQAd0ba3YVoJ4FDPx X-Received: by 2002:a05:6a21:1643:b0:1af:acf5:f9e5 with SMTP id no3-20020a056a21164300b001afacf5f9e5mr5726455pzb.23.1715008676276; Mon, 06 May 2024 08:17:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715008676; cv=pass; d=google.com; s=arc-20160816; b=SgJMJt1AJeXW5FwuS3aeLl6OvvMzOJVP/C4NX3zkMBm2dFXfz7bxvHaPgv1elcD1Tn FtljruSVIUh7iGE/HkHb0D7kNIj+JcC+D1GSqWBcvVFh8X8dZHcateL9QsDWn/Tew0mn 6D15EVFcdI7XT4ZIVBxNHzUI2gi8JNqHHZ6M3Z0QMLSpwo+1EagzFVOmqWpswUslGH/3 JInrrtJPNfdoV7KFMDDAVoELFEUIcHOfkmik2Kyfc/NZf0bGUHACqH0lTfmPZ0la4q8o 2TtrW0tUbYWqU6x2JW2lbfaOUQcBkxKmFezYVksJQZiJebAmoJO/51fxAssk3Hnok9pS cKKw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:cc:to:from:date:references:in-reply-to:message-id :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:feedback-id:dkim-signature:dkim-signature; bh=dPtnUk1mbpBrzGLuCD41oZsYYZwy9oyATpzwrqgmybI=; fh=oePhgneXCft+absdUyhlkmVz8/CgdtSfLT6F+4yVtqQ=; b=Hg2CY3MsTn36dSZ2r7JKH24QhWxf5loV8Sp1j9MwBW9kZovFtymI5gAAqvRAz0F1eO vvEmOS9ISGjmNp6ha1Dtq/Q3QAcVBHj76EBtVN4e+WchSj7v8j86frYqk/g8YccT47PW Ctjgv7DRpaNaJhCqvjRQw3WK5z4Rp0oVBf3pcaYYWbyXjRG3Gt0kx9XwkC9mT+3WGKGq 8XmJ6rKtAeYJNY09danprCWT9qcCZoIlBNhhFPTVKaJoo7C6CdTopFmC9tWiHhjdBuWG iRqix6YBOWddvlI4IJHipzDvoy5z+hzAyHsTagn7NTNhyaDjcvOYrZ9cJwxsPmo8rd/r Ozjw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=Chey0lxV; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=gTcdxjD7; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-170028-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170028-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id mj10-20020a17090b368a00b002b3507c0ce3si8537573pjb.163.2024.05.06.08.17.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 08:17:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170028-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=Chey0lxV; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=gTcdxjD7; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-170028-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170028-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 2279BB267EE for ; Mon, 6 May 2024 14:54:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 488E8153BFF; Mon, 6 May 2024 14:54:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="Chey0lxV"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="gTcdxjD7" Received: from wfout6-smtp.messagingengine.com (wfout6-smtp.messagingengine.com [64.147.123.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8BEE153584; Mon, 6 May 2024 14:54:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.149 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715007253; cv=none; b=otoO0ZRWiMLXL2LeOLEk6Clt1wSCAulGj3HvW4iNVv87eMgrQ38NOpljoHVo7EreNaeVYW4sJHJdv9h7x3xcsDtrGvYbtvqTNjSQToBxZ7kyZwXeDosrvMPi5mOuGHWIKUwaL80+MoLm+MysmCinAwGGtxSlkOXf4+XVoevYSI8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715007253; c=relaxed/simple; bh=fj8G+5iN6xrXO0EcE2PvtvwpqB1x6gZ3g9mxuGRrgUE=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=hopkoVQjUffRb6FbqFvcZHvebwBsH+HZLH0rVxqtVEN80Hdu9aQVJo10K997yZV1ADnR3plJeAv8HQUsMacnsaGNidie09zsFoqGa6gkZ6DMgjMxzYZZ8MM91TWkFIUzTKIC5D3PjJGviBwzsgW75bPBqpi/bE1wwxUHPs6D/G0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=Chey0lxV; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=gTcdxjD7; arc=none smtp.client-ip=64.147.123.149 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.west.internal (Postfix) with ESMTP id 4534C1C000E5; Mon, 6 May 2024 10:54:10 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Mon, 06 May 2024 10:54:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1715007249; x=1715093649; bh=dPtnUk1mbp BrzGLuCD41oZsYYZwy9oyATpzwrqgmybI=; b=Chey0lxVlxFMYXvkJ6KuLqEMXy ueZIv5zskxo0TQKU4ZGN2w0cxAcr++AUayltaRx7FtBqde/2Wg0xzs/O8NVinCE6 7i7Oufv9pLGgmGSsXxgKiF3Yk6ppML5n5esN6IchpPgdZx+7oP/oHHv4+J49BicM MHfSwSwdyKmkAwloOt5kvsOf0N8h3JGyL4HdIbJuAjey3uxZu4qrYt8X3W7sdm9i MCl4BHqcLidnY7xSaL64Z3yoLPfvExHXuOfx23wDTGf6KtwEegiLn0xT/oPwmy+s 0iXh2WxNLCA5vQs/8rA+/2fwLWrwm0bDGwfOlQpA+c1uL/VZqzJBltEaA5TA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1715007249; x=1715093649; bh=dPtnUk1mbpBrzGLuCD41oZsYYZwy 9oyATpzwrqgmybI=; b=gTcdxjD74zi1Fm/O4TOat5ZuozJOkB6VerWhwP3Zomoh YF/8r9kiu5rfAHiHrBh8yinAYBqCX/WLakN2Yg4oAZj8TSYqm38DCSDED1wenj3Y W0LyPc1bZ7X0oUhnhThRajUXH8hehFyZFh0/VXzCcw9xCaLxsE0xIB/JPJv3kk2h 4tVmbpSymQ2fP5hnZDrtfeIxkgnXKaV5kdEwru7ZQlikY9ptMmducvmLWVuD1y4B Sz7HJ6sa9aCU1/TdhZdt++0MKTL+jLgCUwqG11N6nygmUPCf36jA8EW2AIm7erk2 eCVrdxWwZ5OIY7pnUrLroV0qEXxAQCsTEDPMcBYzeQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvddviedgkeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepleehueefffevveejgfelveeiuedutdevtdfhtdevveelgfevuedtkeeiffei geffnecuffhomhgrihhnpehgohhoghhlvghsohhurhgtvgdrtghomhenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrhhnugesrghrnhgusgdr uggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 1D772B6008F; Mon, 6 May 2024 10:54:09 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-437-gcad818a2a-fm-20240502.001-gcad818a2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <47c63c4c-c657-4210-b476-c91c4f192483@app.fastmail.com> In-Reply-To: References: <20240503192858.103640-1-florian.fainelli@broadcom.com> <8e1867fc-34da-457c-b95a-2d51ea97336a@app.fastmail.com> <05a5e893-12f7-49fd-9a9a-abd387571f9b@broadcom.com> Date: Mon, 06 May 2024 16:53:47 +0200 From: "Arnd Bergmann" To: "Daniel Vetter" , "Florian Fainelli" Cc: linux-kernel@vger.kernel.org, "Helge Deller" , "Thomas Zimmermann" , "Javier Martinez Canillas" , "Sam Ravnborg" , "open list:FRAMEBUFFER LAYER" , "open list:FRAMEBUFFER LAYER" Subject: Re: [PATCH] fbdev: Have CONFIG_FB_NOTIFY be tristate Content-Type: text/plain On Mon, May 6, 2024, at 15:14, Daniel Vetter wrote: > On Fri, May 03, 2024 at 01:22:10PM -0700, Florian Fainelli wrote: >> On 5/3/24 12:45, Arnd Bergmann wrote: >> > On Fri, May 3, 2024, at 21:28, Florian Fainelli wrote: >> > > Android devices in recovery mode make use of a framebuffer device to >> > > provide an user interface. In a GKI configuration that has CONFIG_FB=m, >> > > but CONFIG_FB_NOTIFY=y, loading the fb.ko module will fail with: >> > > >> > > fb: Unknown symbol fb_notifier_call_chain (err -2) >> > > >> > > Have CONFIG_FB_NOTIFY be tristate, just like CONFIG_FB such that both >> > > can be loaded as module with fb_notify.ko first, and fb.ko second. >> > > >> > > Signed-off-by: Florian Fainelli >> > >> > I see two problems here, so I don't think this is the right >> > approach: >> > >> > 1. I don't understand your description: Since fb_notifier_call_chain() >> > is an exported symbol, it should work for both FB_NOTIFY=y and >> > FB_NOTIFY=m, unless something in Android drops the exported >> > symbols for some reason. >> >> The symbol is still exported in the Android tree. The issue is that the GKI >> defconfig does not enable any CONFIG_FB options at all. This is left for SoC >> vendors to do in their own "fragment" which would add CONFIG_FB=m. That >> implies CONFIG_FB_NOTIFY=y which was not part of the original kernel image >> we build/run against, and so we cannot resolve the symbol. I see. >> This could be resolved by having the GKI kernel have CONFIG_FB_NOTIFY=y but >> this is a bit wasteful (not by much since the code is very slim anyway) and >> it does require making changes specifically to the Android tree which could >> be beneficial upstream, hence my attempt at going upstream first. > > Making fbdev (the driver subsystem, not the uapi, we'll still happily > merge patches for that) more useful is really not the upstream direction :-) I'm more worried about the idea of enabling an entire subsystem as a loadable module and expecting that to work with an existing kernel, specifically when the drm.ko and fb.ko interact with one another and are built with different .config files. This is the current Android GKI config: https://android.googlesource.com/kernel/common.git/+/refs/heads/android-mainline/arch/arm64/configs/gki_defconfig where I can see that CONFIG_DRM is built-in, but DRM_FBDEV_EMULATION CONFIG_VT, CONFIG_FRAMEBUFFER_CONSOLE, CONFIG_FB_DEVICE and CONFIG_FB_CORE are all disabled. So the console won't work at all,I think this means that there is no way to get the console working, but building a fb.ko module allows using /dev/fb with simplefb.ko (or any other one) happens to almost work, but only by dumb luck rather than by design. >> > $ git grep -w fb_register_client >> > arch/arm/mach-pxa/am200epd.c: fb_register_client(&am200_fb_notif); >> > drivers/leds/trigger/ledtrig-backlight.c: ret = fb_register_client(&n->notifier); >> > drivers/video/backlight/backlight.c: return fb_register_client(&bd->fb_notif); >> > drivers/video/backlight/lcd.c: return fb_register_client(&ld->fb_notif); >> > >> > Somewhat related but not directly addressing your patch, I wonder >> > if Android itself could migrate to using FB_CORE=m FB=n FB_NOTIFY=n >> > instead and use simpledrm for the console in place of the legacy >> > fbdev layer. >> >> That is beyond my reach :) > > This one is. And it doesn't need to be simpledrm, just a drm kms driver > with fbdev emulation. Heck even if you have an fbdev driver you should > control the corresponding backlight explicitly, and not rely on the fb > notifier to magical enable/disable some random backlights somewhere. > > So please do not encourage using this in any modern code. I suppose making CONFIG_FB_NOTIFIER optional for FB (on by default if any of the consumers of the notification are turned on) would not be a bad direction to go in general and also address Florian's link error, but that doesn't solve the more general concern about a third-party fb.ko module on a kernel that was explicitly built with FB disabled. The GKI defconfig was initially done at a time where one could not have CONFIG_FBDEV_EMULATION and CONFIG_FB_DEVICE without pulling in the entire fbdev module, but now that is possible. Maybe that is something that Android could now include? Alternatively, I wonder if that recovery image could be changed to access the screen through the /dev/dri/ interfaces? I have no experience in using those without Xorg or Wayland, is that a sensible thing to do? Arnd