From: Jonathan Derrick <jonathan.derrick@linux.dev>
To: Bjorn Helgaas <helgaas@kernel.org>,
"David E. Box" <david.e.box@linux.intel.com>
Cc: nirmal.patel@linux.intel.com, lorenzo.pieralisi@arm.com,
hch@infradead.org, kw@linux.com, robh@kernel.org,
bhelgaas@google.com, michael.a.bottini@intel.com,
rafael@kernel.org, me@adhityamohan.in, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH V7 3/4] PCI: vmd: Add vmd_device_data
Date: Fri, 28 Oct 2022 14:18:48 -0500 [thread overview]
Message-ID: <5c0a8a41-db58-ac73-da08-681b20156786@linux.dev> (raw)
In-Reply-To: <20221028191308.GA903098@bhelgaas>
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
>>
next prev parent reply other threads:[~2022-10-28 19:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-25 0:44 [PATCH V7 0/4] PCI: vmd: Enable PCIe ASPM and LTR on select hardware David E. Box
2022-10-25 0:44 ` [PATCH V7 1/4] PCI/ASPM: Add pci_enable_link_state() David E. Box
2022-10-25 0:44 ` [PATCH V7 2/4] PCI: vmd: Use PCI_VDEVICE in device list David E. Box
2022-10-25 0:44 ` [PATCH V7 3/4] PCI: vmd: Add vmd_device_data David E. Box
2022-10-28 19:13 ` Bjorn Helgaas
2022-10-28 19:18 ` Jonathan Derrick [this message]
2022-10-28 19:40 ` Bjorn Helgaas
2022-10-28 20:22 ` David E. Box
2022-10-28 21:14 ` Jonathan Derrick
2022-10-28 21:24 ` Patel, Nirmal
2022-10-31 7:04 ` Christoph Hellwig
2022-10-31 15:40 ` David E. Box
2022-10-25 0:44 ` [PATCH V7 4/4] PCI: vmd: Add quirk to configure PCIe ASPM and LTR David E. Box
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=5c0a8a41-db58-ac73-da08-681b20156786@linux.dev \
--to=jonathan.derrick@linux.dev \
--cc=bhelgaas@google.com \
--cc=david.e.box@linux.intel.com \
--cc=hch@infradead.org \
--cc=helgaas@kernel.org \
--cc=kw@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=me@adhityamohan.in \
--cc=michael.a.bottini@intel.com \
--cc=nirmal.patel@linux.intel.com \
--cc=rafael@kernel.org \
--cc=robh@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).