All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Mario Limonciello <superm1@kernel.org>
Cc: mario.limonciello@amd.com, bhelgaas@google.com,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-pci@vger.kernel.org
Subject: Re: [PATCH v2] PCI: Adjust visibility of boot_display attribute instead of creation
Date: Sun, 20 Jul 2025 17:34:44 +0200	[thread overview]
Message-ID: <aH0MlOshychrsvg9@wunner.de> (raw)
In-Reply-To: <20250720151551.735348-1-superm1@kernel.org>

On Sun, Jul 20, 2025 at 10:15:08AM -0500, Mario Limonciello wrote:
> There is a desire to avoid creating new sysfs files late, so instead
> of dynamically deciding to create the boot_display attribute, make
> it static and use sysfs_update_group() to adjust visibility on the
> applicable devices.
[...]
> @@ -1698,7 +1690,7 @@ int __must_check pci_create_sysfs_dev_files(struct pci_dev *pdev)
>  	if (!sysfs_initialized)
>  		return -EACCES;
>  
> -	retval = pci_create_boot_display_file(pdev);
> +	retval = sysfs_update_group(&pdev->dev.kobj, &pci_display_attr_group);
>  	if (retval)
>  		return retval;
>

pci_create_sysfs_dev_files() is called from two places, pci_bus_add_device()
and the late_initcall pci_sysfs_init().

Do you really need to update the group in both or would one of them suffice?
If the latter, please update it only in that single place.  Better yet,
if you know where visibility of the attribute may change (e.g. after certain
function calls in graphics drivers), add the call there instead of in the
PCI core.

We should probably add a code comment to pci_create_sysfs_dev_files() that
it is slated for removal (once the resource files have been converted to
static as well) and that no new attributes are allowed to be added here.

Thanks,

Lukas

  reply	other threads:[~2025-07-20 15:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-20 15:15 [PATCH v2] PCI: Adjust visibility of boot_display attribute instead of creation Mario Limonciello
2025-07-20 15:34 ` Lukas Wunner [this message]
2025-07-21  7:15   ` Manivannan Sadhasivam
2025-07-21 15:23     ` Mario Limonciello
2025-07-22 11:02     ` [External] " Shuan He
2025-07-21  9:57 ` Jonathan Cameron
2025-07-21 15:28   ` Mario Limonciello

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aH0MlOshychrsvg9@wunner.de \
    --to=lukas@wunner.de \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=sfr@canb.auug.org.au \
    --cc=superm1@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.