[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230810074444.GA11861@wunner.de>
Date: Thu, 10 Aug 2023 09:44:44 +0200
From: Lukas Wunner <lukas@...ner.de>
To: Greg KH <gregkh@...uxfoundation.org>
Cc: Alistair Francis <alistair23@...il.com>, bhelgaas@...gle.com,
linux-pci@...r.kernel.org, Jonathan.Cameron@...wei.com,
alex.williamson@...hat.com, christian.koenig@....com,
kch@...dia.com, logang@...tatee.com, linux-kernel@...r.kernel.org,
Alistair Francis <alistair.francis@....com>
Subject: Re: [PATCH v3] PCI/DOE: Expose the DOE protocols via sysfs
On Thu, Aug 10, 2023 at 07:05:12AM +0200, Greg KH wrote:
> On Wed, Aug 09, 2023 at 07:28:51PM -0400, Alistair Francis wrote:
> > v3:
> > - Expose each DOE feature as a separate file
>
> But you don't actually have anything in the sysfs files, why not?
He wants to expose a list of supported protocols.
He first exposed the list in a single attribute, separated by newlines.
Which made sense because it allows users to grep for a specific protocol.
You told him not to expose multiple values in a single attribute.
So he's exposing the available protocols each in an empty file.
The file name contains the protocol.
You got what you asked for. ;)
> > --- a/drivers/pci/doe.c
> > +++ b/drivers/pci/doe.c
> > @@ -56,6 +56,10 @@ struct pci_doe_mb {
> > wait_queue_head_t wq;
> > struct workqueue_struct *work_queue;
> > unsigned long flags;
> > +
> > +#ifdef CONFIG_SYSFS
> > + struct device_attribute *sysfs_attrs;
> > +#endif
>
> Please don't put #ifdefs in .c files if you can prevent it. I think
> this will work just fine if you don't have the #ifdef. And who would be
> using pci without sysfs?
People with space-constrained devices such as routers.
It is perfectly legal to compile a kernel with CONFIG_PCI=y and
CONFIG_SYSFS=n.
And it is reasonable not to include code in the kernel which has
specifically been deselected in the kernel config.
Thanks,
Lukas
Powered by blists - more mailing lists