Re: [PATCH net-next v3 1/2] pci: Add Cavium PCI vendor id
From: David Daney <hidden>
Date: 2015-05-18 18:25:10
Also in:
linux-pci, lkml
On 05/18/2015 10:26 AM, Bjorn Helgaas wrote:
On Mon, May 18, 2015 at 11:41 AM, David Miller [off-list ref] wrote:quoted
From: Bjorn Helgaas <bhelgaas@google.com> Date: Mon, 18 May 2015 11:35:20 -0500quoted
[+cc Greg] On Sat, May 16, 2015 at 4:14 PM, David Miller [off-list ref] wrote:quoted
From: Bjorn Helgaas <bhelgaas@google.com> Date: Sat, 16 May 2015 09:49:40 -0500quoted
Hi Aleksey, On Fri, May 15, 2015 at 10:36 PM, Aleksey Makarov [off-list ref] wrote:quoted
Signed-off-by: Aleksey Makarov <redacted> --- include/linux/pci_ids.h | 2 ++ 1 file changed, 2 insertions(+)diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index e63c02a..3633cc6 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h@@ -2327,6 +2327,8 @@ #define PCI_DEVICE_ID_ALTIMA_AC9100 0x03ea #define PCI_DEVICE_ID_ALTIMA_AC1003 0x03eb +#define PCI_VENDOR_ID_CAVIUM 0x177dPlease read the note at the top of include/linux/pci_ids.h. If this definition is used in two or more drivers, mention that in the changelog. Otherwise, just use the bare hex value or a private #define in your driver.It is referenced from two foo.c files in the same driver. I don't know what policy we want for situations like that.The current policy (1d4a433fc4e9 ("PCI: Document pci_ids.h addition policy.")) predates me and I don't know the whole rationale. I can see that it might reduce backporting pain for distros. If two foo.c files in the same driver share the PCI ID, they likely share other things as well, so there's likely a shared .h file where a private PCI_VENDOR_ID_CAVIUM could go. But this is a vendor ID (not a device ID), and it seems likely that there will be other devices from Cavium, so maybe it would make sense to apply the policy to device IDs, and go ahead and add vendor IDs to pci_ids.h.That makes sense to me, and therefore this change is probably fine as-is.OK. I assume you'll take the whole series, so: Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Thanks guys, Just for the record, the Cavium ThunderX network controller driver (that is part 2/2 of the series), is just the first user of the PCI_VENDOR_ID_CAVIUM. We have in the pipeline drivers/patches for USB (xHCI), SATA (AHCI), GPIO, I2C, MMC, and maybe others that will also be using this #define. I also agree with the concept that the vendor ID has more if a place in pci_ids.h than device IDs (which usually can go in the driver itself). David Daney