All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mario Limonciello <superm1@kernel.org>
To: Manivannan Sadhasivam <mani@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] PCI: Fix warning without CONFIG_VIDEO
Date: Fri, 18 Jul 2025 12:26:49 -0500	[thread overview]
Message-ID: <ca34c473-579b-4991-984d-4e037005c979@kernel.org> (raw)
In-Reply-To: <hwdswlzbejlrawrrsgdlqtmzb6437kyei4hl5uqpe24orey2qd@2u7i7dzkhfyu>

On 7/18/2025 12:23 PM, Manivannan Sadhasivam wrote:
> On Fri, Jul 18, 2025 at 12:06:22PM GMT, Mario Limonciello wrote:
>> On 7/18/2025 12:00 PM, Manivannan Sadhasivam wrote:
>>> On Fri, Jul 18, 2025 at 08:41:33AM GMT, Mario Limonciello wrote:
>>>> From: Mario Limonciello <mario.limonciello@amd.com>
>>>>
>>>> When compiled without CONFIG_VIDEO pci_create_boot_display_file() will
>>>> never create a sysfs file for boot_display. Guard the sysfs file
>>>> declaration against CONFIG_VIDEO.
>>>>
>>>> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
>>>> Closes: https://lore.kernel.org/linux-next/20250718224118.5b3f22b0@canb.auug.org.au/
>>>> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>>>> ---
>>>>    drivers/pci/pci-sysfs.c | 2 ++
>>>>    1 file changed, 2 insertions(+)
>>>>
>>>> diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
>>>> index 6b1a0ae254d3a..f6540a72204d3 100644
>>>> --- a/drivers/pci/pci-sysfs.c
>>>> +++ b/drivers/pci/pci-sysfs.c
>>>> @@ -680,12 +680,14 @@ const struct attribute_group *pcibus_groups[] = {
>>>>    	NULL,
>>>>    };
>>>> +#ifdef CONFIG_VIDEO
>>>>    static ssize_t boot_display_show(struct device *dev, struct device_attribute *attr,
>>>>    				 char *buf)
>>>>    {
>>>>    	return sysfs_emit(buf, "1\n");
>>>>    }
>>>>    static DEVICE_ATTR_RO(boot_display);
>>>
>>> I failed to give my comment during the offending series itself, but it is never
>>> late than never. Why are we adding non-PCI attributes under bus/pci in the first
>>> place? Though the underlying device uses PCI as a transport, only the PCI bus
>>> specific attrbutes should be placed under bus/pci and the driver/peripheral
>>> specific attrbutes should belong to the respective bus/class/device hierarchy.
>>>
>>> Now, if other peripherals (like netdev) start adding these device specific
>>> attributes under bus/pci, it will turn out to be a mess.
>>>
>>> - Mani
>>>
>>
>> It was mostly to mirror the location of where boot_vga is, which arguably
>> has the same issue you raise.
>>
> 
> Yes, I agree. But 'boot_vga' has set a bad precedence IMO.
> 
>> I would be incredibly surprised if there was a proposal to add a
>> 'boot_display' attribute from netdev..
> 
> Not 'boot_display' but why not 'boot_network' or something else. I was just
> merely pointing out the fact that the other subsystems can start dumping
> device/usecase specific attributes under bus/pci.
> 
> - Mani
> 

This is a pretty general problem that exists that attributes are first 
come first served.  For example amdgpu adds mem_busy_percent and it has 
certain semantics.  Now PCI core can't add that.

And if nouveau.ko wants to add the same thing they need to follow the 
same semantics because userspace will look for those.

  reply	other threads:[~2025-07-18 17:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-18 13:41 [PATCH] PCI: Fix warning without CONFIG_VIDEO Mario Limonciello
2025-07-18 17:00 ` Manivannan Sadhasivam
2025-07-18 17:06   ` Mario Limonciello
2025-07-18 17:23     ` Manivannan Sadhasivam
2025-07-18 17:26       ` Mario Limonciello [this message]
2025-07-19  2:47         ` Manivannan Sadhasivam
2025-07-19 13:46           ` Mario Limonciello
2025-07-21  8:00             ` Manivannan Sadhasivam
2025-07-21 15:53               ` 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=ca34c473-579b-4991-984d-4e037005c979@kernel.org \
    --to=superm1@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=sfr@canb.auug.org.au \
    /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.