From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94F4E21ABD0 for ; Tue, 9 Dec 2025 08:42:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765269729; cv=none; b=hSyM8ss+T9IexzBgMRTp4snhPB/P2hWE/LGOQx2OPB/QEaxqVJs0W8Z6BtiB84/ha0KOJ1OLoex3t8r4C0WofqqRjPMWJdbYpNbC5oiZ60AWdG4puLJmQQ2QJ5igDTLEZYnwRwzN0zKLxQhMOmjsJ8tebcNtfWIGL4gTvP+3WBI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765269729; c=relaxed/simple; bh=JBWSMZz/pAuMr1EDIhh90m65W9QWEUMQMBfoaVwWb3g=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=jS9r7lb1ITQF7I0OLn0vPQUdZfdbMCC3zr2g3yzEZ/6qLgBO3FBtu9XNEWMR3IxC0Alq2CRidRr+OgJ7EsFh6hLFrlWvWmNNWVFQKlbCmltoOkOBiZ5tIrqyXLdnAfzOiWMJgg8lvEY4e5dJls4yioZlV0P5wsgvk7M8ERTBwEc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=OL0r6LgL; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=oLmnYet/; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=OL0r6LgL; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=oLmnYet/; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="OL0r6LgL"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="oLmnYet/"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="OL0r6LgL"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="oLmnYet/" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 5830D5BD9C; Tue, 9 Dec 2025 08:42:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1765269724; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=mkXnCCDibCT6NceqYRV8oQpGMsdF6XLcZr94DE5nJVM=; b=OL0r6LgL1+dDhQOl7ThMpm9FBdi/rtKKgh7S0BNaKeKoJeh5UAHjwydL9yZgwbjpwApKGx wv1vwOufVjqto5L/erjFModKsmTreWPCdoqJ6yu5avyCehoIpuCDlKfGLSbDUezhdkwd/D 8SEdupw1qEa6UZ57UIPaRQvZYJyEXhg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1765269724; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=mkXnCCDibCT6NceqYRV8oQpGMsdF6XLcZr94DE5nJVM=; b=oLmnYet/MjU46NsSflbcbECEhtMK/NXBx/ljSwhF5VfaLajWXCuUV2Vuu75a0Ul6wqv2Bz XwkvZp7cQUZZOfBg== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=OL0r6LgL; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="oLmnYet/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1765269724; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=mkXnCCDibCT6NceqYRV8oQpGMsdF6XLcZr94DE5nJVM=; b=OL0r6LgL1+dDhQOl7ThMpm9FBdi/rtKKgh7S0BNaKeKoJeh5UAHjwydL9yZgwbjpwApKGx wv1vwOufVjqto5L/erjFModKsmTreWPCdoqJ6yu5avyCehoIpuCDlKfGLSbDUezhdkwd/D 8SEdupw1qEa6UZ57UIPaRQvZYJyEXhg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1765269724; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=mkXnCCDibCT6NceqYRV8oQpGMsdF6XLcZr94DE5nJVM=; b=oLmnYet/MjU46NsSflbcbECEhtMK/NXBx/ljSwhF5VfaLajWXCuUV2Vuu75a0Ul6wqv2Bz XwkvZp7cQUZZOfBg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 1841C3EA63; Tue, 9 Dec 2025 08:42:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id Jb93BNzgN2l8DQAAD6G6ig (envelope-from ); Tue, 09 Dec 2025 08:42:04 +0000 Message-ID: <90afab05-eb56-4c81-afd5-35337335c562@suse.de> Date: Tue, 9 Dec 2025 09:42:03 +0100 Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/3] fbdev: Guard sysfs interfaces under CONFIG_FB_DEVICE To: Helge Deller , Chintan Patel , linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev, linux-omap@vger.kernel.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, andy@kernel.org, gregkh@linuxfoundation.org References: <20251209042744.7875-1-chintanlike@gmail.com> <19e8a1b0-75e3-4c8d-911a-15fd70f60bea@suse.de> Content-Language: en-US From: Thomas Zimmermann Autocrypt: addr=tzimmermann@suse.de; keydata= xsBNBFs50uABCADEHPidWt974CaxBVbrIBwqcq/WURinJ3+2WlIrKWspiP83vfZKaXhFYsdg XH47fDVbPPj+d6tQrw5lPQCyqjwrCPYnq3WlIBnGPJ4/jreTL6V+qfKRDlGLWFjZcsrPJGE0 BeB5BbqP5erN1qylK9i3gPoQjXGhpBpQYwRrEyQyjuvk+Ev0K1Jc5tVDeJAuau3TGNgah4Yc hdHm3bkPjz9EErV85RwvImQ1dptvx6s7xzwXTgGAsaYZsL8WCwDaTuqFa1d1jjlaxg6+tZsB 9GluwvIhSezPgnEmimZDkGnZRRSFiGP8yjqTjjWuf0bSj5rUnTGiyLyRZRNGcXmu6hjlABEB AAHNJ1Rob21hcyBaaW1tZXJtYW5uIDx0emltbWVybWFubk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WE93XeQBhIJHQfnc+YBLprdnxR446Sh8Wn/2D Ya8cavuWf2zrB6cZurs048xe0UbSW5AOSo4V9M0jzYI4nZqTmPxYyXbm30Kvmz0rYVRaitYJ 4kyYYMhuULvrJDMjZRvaNe52tkKAvMevcGdt38H4KSVXAylqyQOW5zvPc4/sq9c= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-4.51 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com,gmx.de]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_TO(0.00)[gmx.de,gmail.com,vger.kernel.org,lists.linux.dev]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; RCPT_COUNT_SEVEN(0.00)[9]; MID_RHS_MATCH_FROM(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:url,suse.de:email,suse.de:dkim,suse.de:mid,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spam-Level: X-Rspamd-Queue-Id: 5830D5BD9C X-Spam-Flag: NO X-Spam-Score: -4.51 Hi Am 09.12.25 um 09:22 schrieb Helge Deller: > On 12/9/25 08:27, Thomas Zimmermann wrote: >> Hi >> >> Am 09.12.25 um 05:27 schrieb Chintan Patel: >>> Hi all, >>> >>> This small series makes several legacy fbdev drivers buildable with >>> CONFIG_FB_DEVICE=n. Currently, multiple fbdev drivers rely on >>> fb_info->dev >>> and sysfs attribute registration unconditionally, which leads to build >>> failures whenever FB_DEVICE is disabled. >>> >>> Thomas previously noted that FB_DEVICE should eventually become >>> optional >>> and that drivers should not depend on sysfs or fb_info->dev being >>> present >>> unless the Kconfig explicitly selects it. This series pushes in that >>> direction by tightening the FB_DEVICE dependency boundary without >>> changing >>> any runtime behaviour when FB_DEVICE=y. >>> >>> What this series does *not* change >>> >>> - No functional behaviour changes when FB_DEVICE=y. >>> - No removal of sysfs interfaces. >>> - No changes to fbops, memory allocation, or display update paths. >>> >>> Build & test coverage >>> >>> Tested with the following combinations: >>> >>> 1. **FB=y, FB_DEVICE=y** >>>     - Baseline configuration; no regressions expected. >>> >>> 2. **FB=y, FB_DEVICE=n** >>>     - Drivers build successfully. >>>     - No sysfs attributes are created. >>>     - fbdev devices operate normally (where applicable). >>> >>> 3. **FB=n** >>>     - Drivers depend on FB, so they properly do not build, unchanged. >>> >>> Motivation >>> >>> This moves fbdev closer to supporting FB_DEVICE as truly optional, >>> helps >>> reduce Kconfig entanglement, and clears several long-standing TODO >>> items >>> as suggested by Thomas Zimmermann around legacy sysfs usage inside >>> fbdev >>> drivers. >>> >>> Feedback is welcome, especially on whether the guard boundaries around >>> sysfs are placed correctly or whether more logic should be pulled under >>> CONFIG_FB_DEVICE. >> >> I left a comment on the first patch. If things still build nicely, then >> >> Acked-by: Thomas Zimmermann >> >> for the series. > > This whole series adds a whole lot of ifdef'ery, which I think is the > worst approach. It makes the code less readable and leads to two code > paths, which may trigger different build errors depending on the config. > > I'm sure it must be possible to do the same without adding more #ifdefs, > e.g. by introducing a function like   dev_of_fbinfo(fbinfo)  which > simply returns NULL for the FB_DEVICE=n case.  Then, that value can be > tested > like >     if (dev_of_fbinfo(fbinfo)) >         {...do-the-things...} > For the FB_DEVICE=n case this will then be optimized out by the compiler, > while you still have full compiler syntax checking. > > Thoughts? Your choice. I don't see this as an important fix. The FB_DEVICE=n case is mostly useful for DRM-based systems that do not want to expose fbdev interfaces to user space. Those are the vast majority today. The very few special builds with fbdev drivers would likely use FB_DEVICE=y anyway. Best regards Thomas > > Helge > -- -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)