[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5c0a8a41-db58-ac73-da08-681b20156786@linux.dev>
Date: Fri, 28 Oct 2022 14:18:48 -0500
From: Jonathan Derrick <jonathan.derrick@...ux.dev>
To: Bjorn Helgaas <helgaas@...nel.org>,
"David E. Box" <david.e.box@...ux.intel.com>
Cc: nirmal.patel@...ux.intel.com, lorenzo.pieralisi@....com,
hch@...radead.org, kw@...ux.com, robh@...nel.org,
bhelgaas@...gle.com, michael.a.bottini@...el.com,
rafael@...nel.org, me@...ityamohan.in, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH V7 3/4] PCI: vmd: Add vmd_device_data
On 10/28/2022 2:13 PM, Bjorn Helgaas wrote:
> On Mon, Oct 24, 2022 at 05:44:10PM -0700, David E. Box wrote:
>> Add vmd_device_data to allow adding additional info for driver data.
>
>> {PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_VMD_9A0B),
>> - .driver_data = VMD_FEAT_HAS_MEMBAR_SHADOW_VSCAP |
>> - VMD_FEAT_HAS_BUS_RESTRICTIONS |
>> - VMD_FEAT_OFFSET_FIRST_VECTOR,},
>> + (kernel_ulong_t)&(struct vmd_device_data) {
>> + .features = VMD_FEAT_HAS_MEMBAR_SHADOW_VSCAP |
>> + VMD_FEAT_HAS_BUS_RESTRICTIONS |
>> + VMD_FEAT_OFFSET_FIRST_VECTOR,
>> + },
>> + },
>
> It looks like these devices come in families where several device IDs
> share the same features. I think this would be more readable if you
> defined each family outside this table and simply referenced the
> family here. E.g., you could do something like:
>
> static struct vmd_device_data vmd_v1 = {
> .features = VMD_FEAT_HAS_MEMBAR_SHADOW_VSCAP |
> VMD_FEAT_HAS_BUS_RESTRICTIONS |
> VMD_FEAT_OFFSET_FIRST_VECTOR,
> };
I seem to recall it being similar to this in one of the previous revisions
It's fine with me either way
>
> {PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_VMD_9A0B),
> .driver_data = (kernel_ulong_t) &vmd_v1,
>
> Then you can add VMD_FEAT_BIOS_PM_QUIRK and the .ltr value in one place
> instead of repeating it a half dozen times.
>
>> {0,}
>> };
>> MODULE_DEVICE_TABLE(pci, vmd_ids);
>> --
>> 2.25.1
>>
Powered by blists - more mailing lists