Skip to contentSkip to conversation

hv: Use PCI_VENDOR_ID_MICROSOFT for better discoverability

PATCH Superseded [email protected] 5 participants 12 messages Sep 8, 2022 – Sep 19, 2022 1 message not in the archive

Subsystems (9)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 hv: Use PCI_VENDOR_ID_MICROSOFT for better discoverability

From: Easwar Hariharan <[email protected]>

---
 drivers/hv/vmbus_drv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/hv/vmbus_drv.c +3 -1
index 23c680d..8d90855 100644
@@ -38,6 +38,8 @@
 #include <clocksource/hyperv_timer.h>
 #include "hyperv_vmbus.h"
 
+#define PCI_VENDOR_ID_MICROSOFT 0x1414
+
 struct vmbus_dynid {
 	struct list_head node;
 	struct hv_vmbus_device_id id;
@@ -2051,7 +2053,7 @@ struct hv_device *vmbus_device_create(const guid_t *type,
 	child_device_obj->channel = channel;
 	guid_copy(&child_device_obj->dev_type, type);
 	guid_copy(&child_device_obj->dev_instance, instance);
-	child_device_obj->vendor_id = 0x1414; /* MSFT vendor ID */
+	child_device_obj->vendor_id = PCI_VENDOR_ID_MICROSOFT;
 
 	return child_device_obj;
 }
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 2/3 pci_ids: Add Microsoft PCI Vendor ID, and remove redundant definitions

From: Easwar Hariharan <[email protected]>

Move the Microsoft PCI Vendor ID from the various drivers to the pci_ids file

---
 drivers/gpu/drm/hyperv/hyperv_drm_drv.c         | 1 -
 drivers/net/ethernet/microsoft/mana/gdma_main.c | 4 ----
 drivers/video/fbdev/hyperv_fb.c                 | 3 ---
 include/linux/pci_ids.h                         | 2 ++
 4 files changed, 2 insertions(+), 8 deletions(-)
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +0 -1
index 6d11e79..61083c7 100644
@@ -23,7 +23,6 @@
 #define DRIVER_MAJOR 1
 #define DRIVER_MINOR 0
 
-#define PCI_VENDOR_ID_MICROSOFT 0x1414
 #define PCI_DEVICE_ID_HYPERV_VIDEO 0x5353
 
 DEFINE_DRM_GEM_FOPS(hv_fops);
drivers/net/ethernet/microsoft/mana/gdma_main.c +0 -4
index 5f92401..00d8198 100644
@@ -1465,10 +1465,6 @@ static void mana_gd_shutdown(struct pci_dev *pdev)
 	pci_disable_device(pdev);
 }
 
-#ifndef PCI_VENDOR_ID_MICROSOFT
-#define PCI_VENDOR_ID_MICROSOFT 0x1414
-#endif
-
 static const struct pci_device_id mana_id_table[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_MICROSOFT, MANA_PF_DEVICE_ID) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_MICROSOFT, MANA_VF_DEVICE_ID) },
drivers/video/fbdev/hyperv_fb.c +0 -3
index 886c564..a502c80 100644
@@ -58,7 +58,6 @@
 
 #include <linux/hyperv.h>
 
-
 /* Hyper-V Synthetic Video Protocol definitions and structures */
 #define MAX_VMBUS_PKT_SIZE 0x4000
 
@@ -74,10 +73,8 @@
 #define SYNTHVID_DEPTH_WIN8 32
 #define SYNTHVID_FB_SIZE_WIN8 (8 * 1024 * 1024)
 
-#define PCI_VENDOR_ID_MICROSOFT 0x1414
 #define PCI_DEVICE_ID_HYPERV_VIDEO 0x5353
 
-
 enum pipe_msg_type {
 	PIPE_MSG_INVALID,
 	PIPE_MSG_DATA,
include/linux/pci_ids.h +2 -0
index 6feade6..c008fda 100644
@@ -2079,6 +2079,8 @@
 #define PCI_DEVICE_ID_ICE_1712		0x1712
 #define PCI_DEVICE_ID_VT1724		0x1724
 
+#define PCI_VENDOR_ID_MICROSOFT  	0x1414
+
 #define PCI_VENDOR_ID_OXSEMI		0x1415
 #define PCI_DEVICE_ID_OXSEMI_12PCI840	0x8403
 #define PCI_DEVICE_ID_OXSEMI_PCIe840		0xC000
Signature · 1 line
1.8.3.1
#12 lore raw

PATCH 3/3 pci_ids: Add the various Microsoft PCI device IDs

In reply to [email protected]

From: Easwar Hariharan <[email protected]>

---
 drivers/gpu/drm/hyperv/hyperv_drm_drv.c         | 4 +---
 drivers/net/ethernet/microsoft/mana/gdma.h      | 3 ---
 drivers/net/ethernet/microsoft/mana/gdma_main.c | 6 +++---
 drivers/video/fbdev/hyperv_fb.c                 | 6 ++----
 include/linux/pci_ids.h                         | 3 +++
 5 files changed, 9 insertions(+), 13 deletions(-)
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +1 -3
index 61083c7..695d3a7 100644
@@ -23,8 +23,6 @@
 #define DRIVER_MAJOR 1
 #define DRIVER_MINOR 0
 
-#define PCI_DEVICE_ID_HYPERV_VIDEO 0x5353
-
 DEFINE_DRM_GEM_FOPS(hv_fops);
 
 static struct drm_driver hyperv_driver = {
@@ -53,7 +51,7 @@ static void hyperv_pci_remove(struct pci_dev *pdev)
 static const struct pci_device_id hyperv_pci_tbl[] = {
 	{
 		.vendor = PCI_VENDOR_ID_MICROSOFT,
-		.device = PCI_DEVICE_ID_HYPERV_VIDEO,
+		.device = PCI_DEVICE_ID_MICROSOFT_HYPERV_VIDEO,
 	},
 	{ /* end of list */ }
 };
drivers/net/ethernet/microsoft/mana/gdma.h +0 -3
index 4a6efe6..9d3a9f7 100644
@@ -476,9 +476,6 @@ struct gdma_eqe {
 
 #define GDMA_SRIOV_REG_CFG_BASE_OFF	0x108
 
-#define MANA_PF_DEVICE_ID 0x00B9
-#define MANA_VF_DEVICE_ID 0x00BA
-
 struct gdma_posted_wqe_info {
 	u32 wqe_size_in_bu;
 };
drivers/net/ethernet/microsoft/mana/gdma_main.c +3 -3
index 00d8198..18cf168 100644
@@ -1333,7 +1333,7 @@ static void mana_gd_cleanup(struct pci_dev *pdev)
 
 static bool mana_is_pf(unsigned short dev_id)
 {
-	return dev_id == MANA_PF_DEVICE_ID;
+	return dev_id == PCI_DEVICE_ID_MICROSOFT_MANA_PF;
 }
 
 static int mana_gd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
@@ -1466,8 +1466,8 @@ static void mana_gd_shutdown(struct pci_dev *pdev)
 }
 
 static const struct pci_device_id mana_id_table[] = {
-	{ PCI_DEVICE(PCI_VENDOR_ID_MICROSOFT, MANA_PF_DEVICE_ID) },
-	{ PCI_DEVICE(PCI_VENDOR_ID_MICROSOFT, MANA_VF_DEVICE_ID) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_MICROSOFT, PCI_DEVICE_ID_MICROSOFT_MANA_PF) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_MICROSOFT, PCI_DEVICE_ID_MICROSOFT_MANA_VF) },
 	{ }
 };
 
drivers/video/fbdev/hyperv_fb.c +2 -4
index a502c80..b9277e5 100644
@@ -73,8 +73,6 @@
 #define SYNTHVID_DEPTH_WIN8 32
 #define SYNTHVID_FB_SIZE_WIN8 (8 * 1024 * 1024)
 
-#define PCI_DEVICE_ID_HYPERV_VIDEO 0x5353
-
 enum pipe_msg_type {
 	PIPE_MSG_INVALID,
 	PIPE_MSG_DATA,
@@ -998,7 +996,7 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info)
 
 	if (!gen2vm) {
 		pdev = pci_get_device(PCI_VENDOR_ID_MICROSOFT,
-			PCI_DEVICE_ID_HYPERV_VIDEO, NULL);
+			PCI_DEVICE_ID_MICROSOFT_HYPERV_VIDEO, NULL);
 		if (!pdev) {
 			pr_err("Unable to find PCI Hyper-V video\n");
 			return -ENODEV;
@@ -1312,7 +1310,7 @@ static int hvfb_resume(struct hv_device *hdev)
 static const struct pci_device_id pci_stub_id_table[] = {
 	{
 		.vendor      = PCI_VENDOR_ID_MICROSOFT,
-		.device      = PCI_DEVICE_ID_HYPERV_VIDEO,
+		.device      = PCI_DEVICE_ID_MICROSOFT_HYPERV_VIDEO,
 	},
 	{ /* end of list */ }
 };
include/linux/pci_ids.h +3 -0
index c008fda..0bef8e6 100644
@@ -2080,6 +2080,9 @@
 #define PCI_DEVICE_ID_VT1724		0x1724
 
 #define PCI_VENDOR_ID_MICROSOFT  	0x1414
+#define PCI_DEVICE_ID_MICROSOFT_HYPERV_VIDEO 	0x5353
+#define PCI_DEVICE_ID_MICROSOFT_MANA_PF  	0x00B9
+#define PCI_DEVICE_ID_MICROSOFT_MANA_VF  	0x00BA
 
 #define PCI_VENDOR_ID_OXSEMI		0x1415
 #define PCI_DEVICE_ID_OXSEMI_12PCI840	0x8403
Signature · 1 line
1.8.3.1
#2 lore raw

Re: [PATCH 2/3] pci_ids: Add Microsoft PCI Vendor ID, and remove redundant definitions

In reply to [email protected]
Quoted 68 lines · [email protected] writes:

From: Easwar Hariharan <[email protected]>

Move the Microsoft PCI Vendor ID from the various drivers to the pci_ids file

---
 drivers/gpu/drm/hyperv/hyperv_drm_drv.c         | 1 -
 drivers/net/ethernet/microsoft/mana/gdma_main.c | 4 ----
 drivers/video/fbdev/hyperv_fb.c                 | 3 ---
 include/linux/pci_ids.h                         | 2 ++
 4 files changed, 2 insertions(+), 8 deletions(-)
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +0 -1
index 6d11e79..61083c7 100644
@@ -23,7 +23,6 @@
 #define DRIVER_MAJOR 1
 #define DRIVER_MINOR 0
 
-#define PCI_VENDOR_ID_MICROSOFT 0x1414
 #define PCI_DEVICE_ID_HYPERV_VIDEO 0x5353
 
 DEFINE_DRM_GEM_FOPS(hv_fops);
drivers/net/ethernet/microsoft/mana/gdma_main.c +0 -4
index 5f92401..00d8198 100644
@@ -1465,10 +1465,6 @@ static void mana_gd_shutdown(struct pci_dev *pdev)
 	pci_disable_device(pdev);
 }
 
-#ifndef PCI_VENDOR_ID_MICROSOFT
-#define PCI_VENDOR_ID_MICROSOFT 0x1414
-#endif
-
 static const struct pci_device_id mana_id_table[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_MICROSOFT, MANA_PF_DEVICE_ID) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_MICROSOFT, MANA_VF_DEVICE_ID) },
drivers/video/fbdev/hyperv_fb.c +0 -3
index 886c564..a502c80 100644
@@ -58,7 +58,6 @@
 
 #include <linux/hyperv.h>
 
-
 /* Hyper-V Synthetic Video Protocol definitions and structures */
 #define MAX_VMBUS_PKT_SIZE 0x4000
 
@@ -74,10 +73,8 @@
 #define SYNTHVID_DEPTH_WIN8 32
 #define SYNTHVID_FB_SIZE_WIN8 (8 * 1024 * 1024)
 
-#define PCI_VENDOR_ID_MICROSOFT 0x1414
 #define PCI_DEVICE_ID_HYPERV_VIDEO 0x5353
 
-
 enum pipe_msg_type {
 	PIPE_MSG_INVALID,
 	PIPE_MSG_DATA,
include/linux/pci_ids.h +0 -0
index 6feade6..c008fda 100644

include/linux/pci_ids.h line 2086

Quoted 8 lines
include/linux/pci_ids.h +2 -0
@@ -2079,6 +2079,8 @@
 #define PCI_DEVICE_ID_ICE_1712		0x1712
 #define PCI_DEVICE_ID_VT1724		0x1724
 
+#define PCI_VENDOR_ID_MICROSOFT  	0x1414
+
 #define PCI_VENDOR_ID_OXSEMI		0x1415
 #define PCI_DEVICE_ID_OXSEMI_12PCI840	0x8403
 #define PCI_DEVICE_ID_OXSEMI_PCIe840		0xC000

I've sent a similar patch recently:
https://lore.kernel.org/linux-hyperv/[email protected]/

which Wei has already queued to hyperv/fixes. Moving PCI_DEVICE_ID_MICROSOFT_MANA_PF/VF definitions to 'pci_ids.h' does make sense but please rebase first.

Signature · 1 line
Vitaly
#4 lore raw

PATCH v2 1/2 hv: Use PCI_VENDOR_ID_MICROSOFT for better discoverability

In reply to a message not in the archive

From: Easwar Hariharan <[email protected]>

---
 drivers/hv/vmbus_drv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/hv/vmbus_drv.c +3 -1
index 3c833ea..6b77a53 100644
@@ -39,6 +39,8 @@
 #include <clocksource/hyperv_timer.h>
 #include "hyperv_vmbus.h"
 
+#define PCI_VENDOR_ID_MICROSOFT 0x1414
+
 struct vmbus_dynid {
 	struct list_head node;
 	struct hv_vmbus_device_id id;
@@ -2052,7 +2054,7 @@ struct hv_device *vmbus_device_create(const guid_t *type,
 	child_device_obj->channel = channel;
 	guid_copy(&child_device_obj->dev_type, type);
 	guid_copy(&child_device_obj->dev_instance, instance);
-	child_device_obj->vendor_id = 0x1414; /* MSFT vendor ID */
+	child_device_obj->vendor_id = PCI_VENDOR_ID_MICROSOFT;
 
 	return child_device_obj;
 }
Signature · 1 line
1.8.3.1
#7 lore raw

PATCH v2 2/2 pci_ids: Add the various Microsoft PCI device IDs

In reply to a message not in the archive

From: Easwar Hariharan <[email protected]>

---
 drivers/gpu/drm/hyperv/hyperv_drm_drv.c         | 2 +-
 drivers/net/ethernet/microsoft/mana/gdma.h      | 3 ---
 drivers/net/ethernet/microsoft/mana/gdma_main.c | 6 +++---
 drivers/video/fbdev/hyperv_fb.c                 | 4 ++--
 include/linux/pci_ids.h                         | 4 +++-
 5 files changed, 9 insertions(+), 10 deletions(-)
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +1 -1
index f84d397..24c2def 100644
@@ -51,7 +51,7 @@ static void hyperv_pci_remove(struct pci_dev *pdev)
 static const struct pci_device_id hyperv_pci_tbl[] = {
 	{
 		.vendor = PCI_VENDOR_ID_MICROSOFT,
-		.device = PCI_DEVICE_ID_HYPERV_VIDEO,
+		.device = PCI_DEVICE_ID_MICROSOFT_HYPERV_VIDEO,
 	},
 	{ /* end of list */ }
 };
drivers/net/ethernet/microsoft/mana/gdma.h +0 -3
index 4a6efe6..9d3a9f7 100644
@@ -476,9 +476,6 @@ struct gdma_eqe {
 
 #define GDMA_SRIOV_REG_CFG_BASE_OFF	0x108
 
-#define MANA_PF_DEVICE_ID 0x00B9
-#define MANA_VF_DEVICE_ID 0x00BA
-
 struct gdma_posted_wqe_info {
 	u32 wqe_size_in_bu;
 };
drivers/net/ethernet/microsoft/mana/gdma_main.c +3 -3
index 00d8198..18cf168 100644
@@ -1333,7 +1333,7 @@ static void mana_gd_cleanup(struct pci_dev *pdev)
 
 static bool mana_is_pf(unsigned short dev_id)
 {
-	return dev_id == MANA_PF_DEVICE_ID;
+	return dev_id == PCI_DEVICE_ID_MICROSOFT_MANA_PF;
 }
 
 static int mana_gd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
@@ -1466,8 +1466,8 @@ static void mana_gd_shutdown(struct pci_dev *pdev)
 }
 
 static const struct pci_device_id mana_id_table[] = {
-	{ PCI_DEVICE(PCI_VENDOR_ID_MICROSOFT, MANA_PF_DEVICE_ID) },
-	{ PCI_DEVICE(PCI_VENDOR_ID_MICROSOFT, MANA_VF_DEVICE_ID) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_MICROSOFT, PCI_DEVICE_ID_MICROSOFT_MANA_PF) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_MICROSOFT, PCI_DEVICE_ID_MICROSOFT_MANA_VF) },
 	{ }
 };
 
drivers/video/fbdev/hyperv_fb.c +2 -2
index b58b445..118e244 100644
@@ -997,7 +997,7 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info)
 
 	if (!gen2vm) {
 		pdev = pci_get_device(PCI_VENDOR_ID_MICROSOFT,
-			PCI_DEVICE_ID_HYPERV_VIDEO, NULL);
+			PCI_DEVICE_ID_MICROSOFT_HYPERV_VIDEO, NULL);
 		if (!pdev) {
 			pr_err("Unable to find PCI Hyper-V video\n");
 			return -ENODEV;
@@ -1311,7 +1311,7 @@ static int hvfb_resume(struct hv_device *hdev)
 static const struct pci_device_id pci_stub_id_table[] = {
 	{
 		.vendor      = PCI_VENDOR_ID_MICROSOFT,
-		.device      = PCI_DEVICE_ID_HYPERV_VIDEO,
+		.device      = PCI_DEVICE_ID_MICROSOFT_HYPERV_VIDEO,
 	},
 	{ /* end of list */ }
 };
include/linux/pci_ids.h +3 -1
index 15b49e6..fe3517f 100644
@@ -2080,7 +2080,9 @@
 #define PCI_DEVICE_ID_VT1724		0x1724
 
 #define PCI_VENDOR_ID_MICROSOFT		0x1414
-#define PCI_DEVICE_ID_HYPERV_VIDEO	0x5353
+#define PCI_DEVICE_ID_MICROSOFT_HYPERV_VIDEO	0x5353
+#define PCI_DEVICE_ID_MICROSOFT_MANA_PF  	0x00B9
+#define PCI_DEVICE_ID_MICROSOFT_MANA_VF  	0x00BA
 
 #define PCI_VENDOR_ID_OXSEMI		0x1415
 #define PCI_DEVICE_ID_OXSEMI_12PCI840	0x8403
Signature · 1 line
1.8.3.1
#8 lore raw

Re: [PATCH v2 2/2] pci_ids: Add the various Microsoft PCI device IDs

Please follow the PCI subject line conventions. Discover it with "git log --oneline include/linux/pci_ids.h".

Quoted 2 lines · Easwar Hariharan

From: Easwar Hariharan <[email protected]>

Needs a commit log, even if it is nothing more than the subject line.

Also read the top of include/linux/pci_ids.h, because it looks like some of these are only used in one driver and hence do not need to be in pci_ids.h.

Quoted 100 lines
---
 drivers/gpu/drm/hyperv/hyperv_drm_drv.c         | 2 +-
 drivers/net/ethernet/microsoft/mana/gdma.h      | 3 ---
 drivers/net/ethernet/microsoft/mana/gdma_main.c | 6 +++---
 drivers/video/fbdev/hyperv_fb.c                 | 4 ++--
 include/linux/pci_ids.h                         | 4 +++-
 5 files changed, 9 insertions(+), 10 deletions(-)
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +1 -1
index f84d397..24c2def 100644
@@ -51,7 +51,7 @@ static void hyperv_pci_remove(struct pci_dev *pdev)
 static const struct pci_device_id hyperv_pci_tbl[] = {
 	{
 		.vendor = PCI_VENDOR_ID_MICROSOFT,
-		.device = PCI_DEVICE_ID_HYPERV_VIDEO,
+		.device = PCI_DEVICE_ID_MICROSOFT_HYPERV_VIDEO,
 	},
 	{ /* end of list */ }
 };
drivers/net/ethernet/microsoft/mana/gdma.h +0 -3
index 4a6efe6..9d3a9f7 100644
@@ -476,9 +476,6 @@ struct gdma_eqe {
 
 #define GDMA_SRIOV_REG_CFG_BASE_OFF	0x108
 
-#define MANA_PF_DEVICE_ID 0x00B9
-#define MANA_VF_DEVICE_ID 0x00BA
-
 struct gdma_posted_wqe_info {
 	u32 wqe_size_in_bu;
 };
drivers/net/ethernet/microsoft/mana/gdma_main.c +3 -3
index 00d8198..18cf168 100644
@@ -1333,7 +1333,7 @@ static void mana_gd_cleanup(struct pci_dev *pdev)
 
 static bool mana_is_pf(unsigned short dev_id)
 {
-	return dev_id == MANA_PF_DEVICE_ID;
+	return dev_id == PCI_DEVICE_ID_MICROSOFT_MANA_PF;
 }
 
 static int mana_gd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
@@ -1466,8 +1466,8 @@ static void mana_gd_shutdown(struct pci_dev *pdev)
 }
 
 static const struct pci_device_id mana_id_table[] = {
-	{ PCI_DEVICE(PCI_VENDOR_ID_MICROSOFT, MANA_PF_DEVICE_ID) },
-	{ PCI_DEVICE(PCI_VENDOR_ID_MICROSOFT, MANA_VF_DEVICE_ID) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_MICROSOFT, PCI_DEVICE_ID_MICROSOFT_MANA_PF) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_MICROSOFT, PCI_DEVICE_ID_MICROSOFT_MANA_VF) },
 	{ }
 };
 
drivers/video/fbdev/hyperv_fb.c +2 -2
index b58b445..118e244 100644
@@ -997,7 +997,7 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info)
 
 	if (!gen2vm) {
 		pdev = pci_get_device(PCI_VENDOR_ID_MICROSOFT,
-			PCI_DEVICE_ID_HYPERV_VIDEO, NULL);
+			PCI_DEVICE_ID_MICROSOFT_HYPERV_VIDEO, NULL);
 		if (!pdev) {
 			pr_err("Unable to find PCI Hyper-V video\n");
 			return -ENODEV;
@@ -1311,7 +1311,7 @@ static int hvfb_resume(struct hv_device *hdev)
 static const struct pci_device_id pci_stub_id_table[] = {
 	{
 		.vendor      = PCI_VENDOR_ID_MICROSOFT,
-		.device      = PCI_DEVICE_ID_HYPERV_VIDEO,
+		.device      = PCI_DEVICE_ID_MICROSOFT_HYPERV_VIDEO,
 	},
 	{ /* end of list */ }
 };
include/linux/pci_ids.h +3 -1
index 15b49e6..fe3517f 100644
@@ -2080,7 +2080,9 @@
 #define PCI_DEVICE_ID_VT1724		0x1724
 
 #define PCI_VENDOR_ID_MICROSOFT		0x1414
-#define PCI_DEVICE_ID_HYPERV_VIDEO	0x5353
+#define PCI_DEVICE_ID_MICROSOFT_HYPERV_VIDEO	0x5353
+#define PCI_DEVICE_ID_MICROSOFT_MANA_PF  	0x00B9
+#define PCI_DEVICE_ID_MICROSOFT_MANA_VF  	0x00BA
 
 #define PCI_VENDOR_ID_OXSEMI		0x1415
 #define PCI_DEVICE_ID_OXSEMI_12PCI840	0x8403
Signature · 1 line
1.8.3.1
#9 lore raw

Re: [PATCH v2 2/2] pci_ids: Add the various Microsoft PCI device IDs

Quoted 2 lines · Bjorn Helgaas

Please follow the PCI subject line conventions. Discover it with "git log --oneline include/linux/pci_ids.h".

Thanks, updated.

Quoted 9 lines · Easwar Hariharan
Quoted 2 lines

From: Easwar Hariharan<[email protected]>

Needs a commit log, even if it is nothing more than the subject line.

Also read the top of include/linux/pci_ids.h, because it looks like some of these are only used in one driver and hence do not need to be in pci_ids.h.

Thanks, this was a separate patch for exactly that reason instead of being

combined with the patch to move the vendor ID. I assume other device IDs

in the pci_ids.h file used only by a single driver are legacy artifacts. After

removing the MANA device IDs, the patch boils down to a trivial rename

of the HYPERV_VIDEO device ID, so I'm just dropping this patch.

- Easwar

Quoted 101 lines
Quoted 101 lines
---
  drivers/gpu/drm/hyperv/hyperv_drm_drv.c         | 2 +-
  drivers/net/ethernet/microsoft/mana/gdma.h      | 3 ---
  drivers/net/ethernet/microsoft/mana/gdma_main.c | 6 +++---
  drivers/video/fbdev/hyperv_fb.c                 | 4 ++--
  include/linux/pci_ids.h                         | 4 +++-
  5 files changed, 9 insertions(+), 10 deletions(-)
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +1 -1
index f84d397..24c2def 100644
@@ -51,7 +51,7 @@ static void hyperv_pci_remove(struct pci_dev *pdev)
  static const struct pci_device_id hyperv_pci_tbl[] = {
  	{
  		.vendor = PCI_VENDOR_ID_MICROSOFT,
-		.device = PCI_DEVICE_ID_HYPERV_VIDEO,
+		.device = PCI_DEVICE_ID_MICROSOFT_HYPERV_VIDEO,
  	},
  	{ /* end of list */ }
  };
drivers/net/ethernet/microsoft/mana/gdma.h +0 -3
index 4a6efe6..9d3a9f7 100644
@@ -476,9 +476,6 @@ struct gdma_eqe {
 
  #define GDMA_SRIOV_REG_CFG_BASE_OFF	0x108
 
-#define MANA_PF_DEVICE_ID 0x00B9
-#define MANA_VF_DEVICE_ID 0x00BA
-
  struct gdma_posted_wqe_info {
  	u32 wqe_size_in_bu;
  };
drivers/net/ethernet/microsoft/mana/gdma_main.c +3 -3
index 00d8198..18cf168 100644
@@ -1333,7 +1333,7 @@ static void mana_gd_cleanup(struct pci_dev *pdev)
 
  static bool mana_is_pf(unsigned short dev_id)
  {
-	return dev_id == MANA_PF_DEVICE_ID;
+	return dev_id == PCI_DEVICE_ID_MICROSOFT_MANA_PF;
  }
 
  static int mana_gd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
@@ -1466,8 +1466,8 @@ static void mana_gd_shutdown(struct pci_dev *pdev)
  }
 
  static const struct pci_device_id mana_id_table[] = {
-	{ PCI_DEVICE(PCI_VENDOR_ID_MICROSOFT, MANA_PF_DEVICE_ID) },
-	{ PCI_DEVICE(PCI_VENDOR_ID_MICROSOFT, MANA_VF_DEVICE_ID) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_MICROSOFT, PCI_DEVICE_ID_MICROSOFT_MANA_PF) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_MICROSOFT, PCI_DEVICE_ID_MICROSOFT_MANA_VF) },
  	{ }
  };
 
drivers/video/fbdev/hyperv_fb.c +2 -2
index b58b445..118e244 100644
@@ -997,7 +997,7 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info)
 
  	if (!gen2vm) {
  		pdev = pci_get_device(PCI_VENDOR_ID_MICROSOFT,
-			PCI_DEVICE_ID_HYPERV_VIDEO, NULL);
+			PCI_DEVICE_ID_MICROSOFT_HYPERV_VIDEO, NULL);
  		if (!pdev) {
  			pr_err("Unable to find PCI Hyper-V video\n");
  			return -ENODEV;
@@ -1311,7 +1311,7 @@ static int hvfb_resume(struct hv_device *hdev)
  static const struct pci_device_id pci_stub_id_table[] = {
  	{
  		.vendor      = PCI_VENDOR_ID_MICROSOFT,
-		.device      = PCI_DEVICE_ID_HYPERV_VIDEO,
+		.device      = PCI_DEVICE_ID_MICROSOFT_HYPERV_VIDEO,
  	},
  	{ /* end of list */ }
  };
include/linux/pci_ids.h +3 -1
index 15b49e6..fe3517f 100644
@@ -2080,7 +2080,9 @@
  #define PCI_DEVICE_ID_VT1724		0x1724
 
  #define PCI_VENDOR_ID_MICROSOFT		0x1414
-#define PCI_DEVICE_ID_HYPERV_VIDEO	0x5353
+#define PCI_DEVICE_ID_MICROSOFT_HYPERV_VIDEO	0x5353
+#define PCI_DEVICE_ID_MICROSOFT_MANA_PF  	0x00B9
+#define PCI_DEVICE_ID_MICROSOFT_MANA_VF  	0x00BA
 
  #define PCI_VENDOR_ID_OXSEMI		0x1415
  #define PCI_DEVICE_ID_OXSEMI_12PCI840	0x8403
Signature · 1 line
1.8.3.1
#10 lore raw

Re: [PATCH v2 2/2] pci_ids: Add the various Microsoft PCI device IDs

In reply to Bjorn Helgaas
Quoted 11 lines · Bjorn Helgaas

Please follow the PCI subject line conventions. Discover it with "git log --oneline include/linux/pci_ids.h".

Quoted 2 lines · Easwar Hariharan

From: Easwar Hariharan<[email protected]>

Needs a commit log, even if it is nothing more than the subject line.

Also read the top of include/linux/pci_ids.h, because it looks like some of these are only used in one driver and hence do not need to be in pci_ids.h.

Thanks, this was a separate patch for exactly that reason instead of being

combined with the patch to move the vendor ID. I sent it anyway because

of other device IDs in the pci_ids.h file used only by a single driver, which I

assume are legacy artifacts. After removing the MANA device IDs, the patch

boils down to a trivial rename of the HYPERV_VIDEO device ID, so I'm just

dropping this patch.
- Easwar

Quoted 101 lines
Quoted 101 lines
---
  drivers/gpu/drm/hyperv/hyperv_drm_drv.c         | 2 +-
  drivers/net/ethernet/microsoft/mana/gdma.h      | 3 ---
  drivers/net/ethernet/microsoft/mana/gdma_main.c | 6 +++---
  drivers/video/fbdev/hyperv_fb.c                 | 4 ++--
  include/linux/pci_ids.h                         | 4 +++-
  5 files changed, 9 insertions(+), 10 deletions(-)
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +1 -1
index f84d397..24c2def 100644
@@ -51,7 +51,7 @@ static void hyperv_pci_remove(struct pci_dev *pdev)
  static const struct pci_device_id hyperv_pci_tbl[] = {
  	{
  		.vendor = PCI_VENDOR_ID_MICROSOFT,
-		.device = PCI_DEVICE_ID_HYPERV_VIDEO,
+		.device = PCI_DEVICE_ID_MICROSOFT_HYPERV_VIDEO,
  	},
  	{ /* end of list */ }
  };
drivers/net/ethernet/microsoft/mana/gdma.h +0 -3
index 4a6efe6..9d3a9f7 100644
@@ -476,9 +476,6 @@ struct gdma_eqe {
 
  #define GDMA_SRIOV_REG_CFG_BASE_OFF	0x108
 
-#define MANA_PF_DEVICE_ID 0x00B9
-#define MANA_VF_DEVICE_ID 0x00BA
-
  struct gdma_posted_wqe_info {
  	u32 wqe_size_in_bu;
  };
drivers/net/ethernet/microsoft/mana/gdma_main.c +3 -3
index 00d8198..18cf168 100644
@@ -1333,7 +1333,7 @@ static void mana_gd_cleanup(struct pci_dev *pdev)
 
  static bool mana_is_pf(unsigned short dev_id)
  {
-	return dev_id == MANA_PF_DEVICE_ID;
+	return dev_id == PCI_DEVICE_ID_MICROSOFT_MANA_PF;
  }
 
  static int mana_gd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
@@ -1466,8 +1466,8 @@ static void mana_gd_shutdown(struct pci_dev *pdev)
  }
 
  static const struct pci_device_id mana_id_table[] = {
-	{ PCI_DEVICE(PCI_VENDOR_ID_MICROSOFT, MANA_PF_DEVICE_ID) },
-	{ PCI_DEVICE(PCI_VENDOR_ID_MICROSOFT, MANA_VF_DEVICE_ID) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_MICROSOFT, PCI_DEVICE_ID_MICROSOFT_MANA_PF) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_MICROSOFT, PCI_DEVICE_ID_MICROSOFT_MANA_VF) },
  	{ }
  };
 
drivers/video/fbdev/hyperv_fb.c +2 -2
index b58b445..118e244 100644
@@ -997,7 +997,7 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info)
 
  	if (!gen2vm) {
  		pdev = pci_get_device(PCI_VENDOR_ID_MICROSOFT,
-			PCI_DEVICE_ID_HYPERV_VIDEO, NULL);
+			PCI_DEVICE_ID_MICROSOFT_HYPERV_VIDEO, NULL);
  		if (!pdev) {
  			pr_err("Unable to find PCI Hyper-V video\n");
  			return -ENODEV;
@@ -1311,7 +1311,7 @@ static int hvfb_resume(struct hv_device *hdev)
  static const struct pci_device_id pci_stub_id_table[] = {
  	{
  		.vendor      = PCI_VENDOR_ID_MICROSOFT,
-		.device      = PCI_DEVICE_ID_HYPERV_VIDEO,
+		.device      = PCI_DEVICE_ID_MICROSOFT_HYPERV_VIDEO,
  	},
  	{ /* end of list */ }
  };
include/linux/pci_ids.h +3 -1
index 15b49e6..fe3517f 100644
@@ -2080,7 +2080,9 @@
  #define PCI_DEVICE_ID_VT1724		0x1724
 
  #define PCI_VENDOR_ID_MICROSOFT		0x1414
-#define PCI_DEVICE_ID_HYPERV_VIDEO	0x5353
+#define PCI_DEVICE_ID_MICROSOFT_HYPERV_VIDEO	0x5353
+#define PCI_DEVICE_ID_MICROSOFT_MANA_PF  	0x00B9
+#define PCI_DEVICE_ID_MICROSOFT_MANA_VF  	0x00BA
 
  #define PCI_VENDOR_ID_OXSEMI		0x1415
  #define PCI_DEVICE_ID_OXSEMI_12PCI840	0x8403
Signature · 1 line
1.8.3.1
#11 lore raw

Re: [PATCH v2 2/2] pci_ids: Add the various Microsoft PCI device IDs

In reply to Easwar Hariharan
Thank you for the patch! Yet something to improve:

Hi Easwar,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on next-20220909]
[cannot apply to drm-misc/drm-misc-next helgaas-pci/next linus/master v6.0-rc4 v6.0-rc3 v6.0-rc2 v6.0-rc4] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Easwar-Hariharan/hv-Use-PCI_VENDOR_ID_MICROSOFT-for-better-discoverability/20220910-035101
base:    9a82ccda91ed2b40619cb3c10d446ae1f97bab6e
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20220910/[email protected]/config)
compiler: gcc-11 (Debian 11.3.0-5) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/68683df33cefc1108eaa8a0a2857e2f2148231d1
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Easwar-Hariharan/hv-Use-PCI_VENDOR_ID_MICROSOFT-for-better-discoverability/20220910-035101
        git checkout 68683df33cefc1108eaa8a0a2857e2f2148231d1
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/

If you fix the issue, kindly add following tag where applicable

All errors (new ones prefixed by >>):

drivers/hv/vmbus_drv.c: In function 'vmbus_reserve_fb':

>> drivers/hv/vmbus_drv.c:2278:39: error: 'PCI_DEVICE_ID_HYPERV_VIDEO' undeclared (first use in this function); did you mean 'PCI_DEVICE_ID_NS_GX_VIDEO'?
    2278 |                                       PCI_DEVICE_ID_HYPERV_VIDEO, NULL);
         |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
         |                                       PCI_DEVICE_ID_NS_GX_VIDEO

drivers/hv/vmbus_drv.c:2278:39: note: each undeclared identifier is reported only once for each function it appears in

vim +2278 drivers/hv/vmbus_drv.c

7f163a6fd957a8 Jake Oshins      2015-08-05  2265  
6d146aefbaa5c5 Jake Oshins      2016-04-05  2266  static void vmbus_reserve_fb(void)
6d146aefbaa5c5 Jake Oshins      2016-04-05  2267  {
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2268  	resource_size_t start = 0, size;
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2269  	struct pci_dev *pdev;
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2270  
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2271  	if (efi_enabled(EFI_BOOT)) {
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2272  		/* Gen2 VM: get FB base from EFI framebuffer */
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2273  		start = screen_info.lfb_base;
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2274  		size = max_t(__u32, screen_info.lfb_size, 0x800000);
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2275  	} else {
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2276  		/* Gen1 VM: get FB base from PCI */
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2277  		pdev = pci_get_device(PCI_VENDOR_ID_MICROSOFT,
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27 @2278  				      PCI_DEVICE_ID_HYPERV_VIDEO, NULL);
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2279  		if (!pdev)
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2280  			return;
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2281  
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2282  		if (pdev->resource[0].flags & IORESOURCE_MEM) {
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2283  			start = pci_resource_start(pdev, 0);
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2284  			size = pci_resource_len(pdev, 0);
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2285  		}
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2286  
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2287  		/*
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2288  		 * Release the PCI device so hyperv_drm or hyperv_fb driver can
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2289  		 * grab it later.
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2290  		 */
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2291  		pci_dev_put(pdev);
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2292  	}
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2293  
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2294  	if (!start)
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2295  		return;
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2296  
6d146aefbaa5c5 Jake Oshins      2016-04-05  2297  	/*
6d146aefbaa5c5 Jake Oshins      2016-04-05  2298  	 * Make a claim for the frame buffer in the resource tree under the
6d146aefbaa5c5 Jake Oshins      2016-04-05  2299  	 * first node, which will be the one below 4GB.  The length seems to
6d146aefbaa5c5 Jake Oshins      2016-04-05  2300  	 * be underreported, particularly in a Generation 1 VM.  So start out
6d146aefbaa5c5 Jake Oshins      2016-04-05  2301  	 * reserving a larger area and make it smaller until it succeeds.
6d146aefbaa5c5 Jake Oshins      2016-04-05  2302  	 */
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2303  	for (; !fb_mmio && (size >= 0x100000); size >>= 1)
2a8a8afba0c305 Vitaly Kuznetsov 2022-08-27  2304  		fb_mmio = __request_region(hyperv_mmio, start, size, fb_mmio_name, 0);
6d146aefbaa5c5 Jake Oshins      2016-04-05  2305  }
6d146aefbaa5c5 Jake Oshins      2016-04-05  2306  
Signature · 2 lines
0-DAY CI Kernel Test Service
https://01.org/lkp
maintainer
#5 lore raw
In reply to Easwar Hariharan
Quoted 13 lines · Easwar Hariharan

From: Easwar Hariharan <[email protected]>

---
 drivers/hv/vmbus_drv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/hv/vmbus_drv.c +0 -0
index 3c833ea..6b77a53 100644

drivers/hv/vmbus_drv.c line 43

Quoted 5 lines
drivers/hv/vmbus_drv.c +2 -0
@@ -39,6 +39,8 @@
 #include <clocksource/hyperv_timer.h>
 #include "hyperv_vmbus.h"
 
+#define PCI_VENDOR_ID_MICROSOFT 0x1414
+

There is a patch in hyperv-fixes that puts this definition to a proper header. You can wait for that to land and rebase this patch.

In the future when you send out a series, please chain all the patches to a cover letter.

Thanks,
Wei.

Quoted 15 lines
drivers/hv/vmbus_drv.c +1 -1
 struct vmbus_dynid {
 	struct list_head node;
 	struct hv_vmbus_device_id id;
@@ -2052,7 +2054,7 @@ struct hv_device *vmbus_device_create(const guid_t *type,
 	child_device_obj->channel = channel;
 	guid_copy(&child_device_obj->dev_type, type);
 	guid_copy(&child_device_obj->dev_instance, instance);
-	child_device_obj->vendor_id = 0x1414; /* MSFT vendor ID */
+	child_device_obj->vendor_id = PCI_VENDOR_ID_MICROSOFT;
 
 	return child_device_obj;
 }
Signature · 1 line
1.8.3.1
#6 lore raw
Quoted 17 lines · Wei Liu
Quoted 16 lines · Easwar Hariharan

From: Easwar Hariharan <[email protected]>

---
 drivers/hv/vmbus_drv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/hv/vmbus_drv.c +0 -0
index 3c833ea..6b77a53 100644
@@ -39,6 +39,8 @@
 #include <clocksource/hyperv_timer.h>
 #include "hyperv_vmbus.h"
 
Quoted 8 lines

drivers/hv/vmbus_drv.c line 43

Quoted 2 lines
drivers/hv/vmbus_drv.c +2 -0
+#define PCI_VENDOR_ID_MICROSOFT 0x1414
+

There is a patch in hyperv-fixes that puts this definition to a proper header. You can wait for that to land and rebase this patch.

In the future when you send out a series, please chain all the patches to a cover letter.

Hi Wei,

This patch is already rebased on hyperv/fixes in response to Vitaly's pointer in this thread:
https://lore.kernel.org/lkml/[email protected]

I'll pull in the pci_ids.h inclusion if that's more acceptable.

Thanks,
Easwar

Quoted 4 lines
Quoted 3 lines
drivers/hv/vmbus_drv.c +0 -1
--

1.8.3.1