Skip to contentSkip to conversation

drm/hyperv: A fix and a few cleanups

PATCH In review Uwe Kleine-König (The Capable Hub) 4 participants 17 messages Jul 1 – Jul 20

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

cover drm/hyperv: A fix and a few cleanups

Hello,

while working on a tree-wide cleanup I found a few issues in the drm/hyperv driver that are addressed here.

While the first patch is a fix, the issue is so old (from 2021, included in v5.14-rc1) that applying the series during the next merge window is probably the right choice.

Best regards
Uwe

Uwe Kleine-König (The Capable Hub) (4):
drm/hyperv: Unregister pci driver in error path before module unload drm/hyperv: Explicitly set subvendor and subdevice for pci match array drm/hyperv: Drop useless empty remove callback
drm/hyperv: Move MODULE_DEVICE_TABLE to the device_id arrays

 drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

base-commit: be5c93fa674f0fc3c8f359c2143abce6bbb422e6

Signature · 1 line
2.55.0.11.g153666a7d9bb
#1 lore raw

PATCH 1/4 drm/hyperv: Unregister pci driver in error path before module unload

The pci driver must not kept registered if the module is unloaded after vmbus_driver_register() fails. So check the return value of vmbus_driver_register() and unregister the pci driver on failure.

Fixes 76c56a5affeb ("drm/hyperv: Add DRM driver for hyperv synthetic video device")
---
 drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +5 -1
index 20f35c48c0b8..2e75fb793495 100644
@@ -249,7 +249,11 @@ static int __init hv_drm_init(void)
 	if (ret != 0)
 		return ret;
 
-	return vmbus_driver_register(&hv_drm_hv_driver);
+	ret = vmbus_driver_register(&hv_drm_hv_driver);
+	if (ret)
+		pci_unregister_driver(&hv_drm_pci_driver);
+
+	return ret;
 }
 
 static void __exit hv_drm_exit(void)
Signature · 1 line
2.55.0.11.g153666a7d9bb
maintainer Reviewed-by on v1 1/4
#2 lore raw

Re: [PATCH v1 1/4] drm/hyperv: Unregister pci driver in error path before module unload

Am 01.07.26 um 19:05 schrieb Uwe Kleine-König (The Capable Hub):

Quoted 6 lines

The pci driver must not kept registered if the module is unloaded after vmbus_driver_register() fails. So check the return value of vmbus_driver_register() and unregister the pci driver on failure.

Fixes 76c56a5affeb ("drm/hyperv: Add DRM driver for hyperv synthetic video device")
Quoted 21 lines
---
  drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +5 -1
index 20f35c48c0b8..2e75fb793495 100644
@@ -249,7 +249,11 @@ static int __init hv_drm_init(void)
  	if (ret != 0)
  		return ret;
 
-	return vmbus_driver_register(&hv_drm_hv_driver);
+	ret = vmbus_driver_register(&hv_drm_hv_driver);
+	if (ret)
+		pci_unregister_driver(&hv_drm_pci_driver);
+
+	return ret;
  }
 
  static void __exit hv_drm_exit(void)
Signature · 6 lines
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)
Reviewed-by on v1 1/4
#3 lore raw

RE: [PATCH v1 1/4] drm/hyperv: Unregister pci driver in error path before module unload

In reply to Uwe Kleine-König (The Capable Hub)

From: Uwe Kleine-König (The Capable Hub) <[email protected]> Sent: Wednesday, July 1, 2026 10:05 AM

Quoted 30 lines

The pci driver must not kept registered if the module is unloaded after vmbus_driver_register() fails. So check the return value of vmbus_driver_register() and unregister the pci driver on failure.

Fixes 76c56a5affeb ("drm/hyperv: Add DRM driver for hyperv synthetic video device")
---
 drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +5 -2
index 20f35c48c0b8..2e75fb793495 100644
@@ -249,7 +249,11 @@ static int __init hv_drm_init(void)
 	if (ret != 0)
 		return ret;
 
-	return vmbus_driver_register(&hv_drm_hv_driver);
+	ret = vmbus_driver_register(&hv_drm_hv_driver);
+	if (ret)
+		pci_unregister_driver(&hv_drm_pci_driver);
+
+	return ret;
 }
 
 static void __exit hv_drm_exit(void)
--
Quoted 2 lines

2.55.0.11.g153666a7d9bb

#4 lore raw

PATCH 2/4 drm/hyperv: Explicitly set subvendor and subdevice for pci match array

In reply to Uwe Kleine-König (The Capable Hub)

.subvendor and .subdevice were set to 0 implicitly, so only devices with these two values set to 0 in hardware can probe automatically. Make this requirement explicit.

While touching this array item, also make use of the pci macro designed for that case.

---
 drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +2 -2
index 2e75fb793495..e766d87b7a9d 100644
@@ -51,8 +51,8 @@ static void hv_drm_pci_remove(struct pci_dev *pdev)
 
 static const struct pci_device_id hv_drm_pci_tbl[] = {
 	{
-		.vendor = PCI_VENDOR_ID_MICROSOFT,
-		.device = PCI_DEVICE_ID_HYPERV_VIDEO,
+		PCI_VDEVICE_SUB(MICROSOFT, PCI_DEVICE_ID_HYPERV_VIDEO,
+				0, 0),
 	},
 	{ /* end of list */ }
 };
Signature · 1 line
2.55.0.11.g153666a7d9bb
#5 lore raw

Re: [PATCH v1 2/4] drm/hyperv: Explicitly set subvendor and subdevice for pci match array

Hi

Am 01.07.26 um 19:05 schrieb Uwe Kleine-König (The Capable Hub):

Quoted 17 lines

.subvendor and .subdevice were set to 0 implicitly, so only devices with these two values set to 0 in hardware can probe automatically. Make this requirement explicit.

While touching this array item, also make use of the pci macro designed for that case.

---
  drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +0 -0
index 2e75fb793495..e766d87b7a9d 100644

drivers/gpu/drm/hyperv/hyperv_drm_drv.c static void hv_drm_pci_remove(struct pci_dev *pdev) · line 55

Quoted 7 lines
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +2 -2
@@ -51,8 +51,8 @@ static void hv_drm_pci_remove(struct pci_dev *pdev)
 
  static const struct pci_device_id hv_drm_pci_tbl[] = {
  	{
-		.vendor = PCI_VENDOR_ID_MICROSOFT,
-		.device = PCI_DEVICE_ID_HYPERV_VIDEO,
+		PCI_VDEVICE_SUB(MICROSOFT, PCI_DEVICE_ID_HYPERV_VIDEO,
+				0, 0),

IDK, but it looks like an oversight to me.  Setting the sub-fields to ANY seems like the better fix.

Best regards
Thomas

Quoted 3 lines
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +0 -0
  	},
  	{ /* end of list */ }
  };
Signature · 6 lines
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)
#6 lore raw

Re: [PATCH v1 2/4] drm/hyperv: Explicitly set subvendor and subdevice for pci match array

Hallo Thomas,

Quoted 13 lines · Thomas Zimmermann

Am 01.07.26 um 19:05 schrieb Uwe Kleine-König (The Capable Hub):

Quoted 12 lines

.subvendor and .subdevice were set to 0 implicitly, so only devices with these two values set to 0 in hardware can probe automatically. Make this requirement explicit.

While touching this array item, also make use of the pci macro designed for that case.

---
  drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 14 lines

drivers/gpu/drm/hyperv/hyperv_drm_drv.c static void hv_drm_pci_remove(struct pci_dev *pdev) · line 54

Quoted 11 lines
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +2 -2
index 2e75fb793495..e766d87b7a9d 100644
@@ -51,8 +51,8 @@ static void hv_drm_pci_remove(struct pci_dev *pdev)
  static const struct pci_device_id hv_drm_pci_tbl[] = {
  	{
-		.vendor = PCI_VENDOR_ID_MICROSOFT,
-		.device = PCI_DEVICE_ID_HYPERV_VIDEO,
+		PCI_VDEVICE_SUB(MICROSOFT, PCI_DEVICE_ID_HYPERV_VIDEO,
+				0, 0),

IDK, but it looks like an oversight to me.  Setting the sub-fields to ANY seems like the better fix.

That was my initial reflex, too. However while writing the commit log for that change I noticed that since commit d750785f305e ("Staging: hv:
fix hv_utils module to properly autoload") from 2010 (applied to v2.6.35-rc4) the driver never worked for hardware with .subvendor != 0 or .subdevice != 0. I cannot believe that something like that is discovered 16 years later by chance during a rework by someone who didn't try to run that hardware. And if I understand correctly, this is emulated hardware and so I guess used quite a lot.

Best regards
Uwe

#7 lore raw

Re: [PATCH v1 2/4] drm/hyperv: Explicitly set subvendor and subdevice for pci match array

Hi

Am 02.07.26 um 10:52 schrieb Uwe Kleine-König (The Capable Hub):

Quoted 29 lines

Hallo Thomas,

Quoted 13 lines · Thomas Zimmermann

Am 01.07.26 um 19:05 schrieb Uwe Kleine-König (The Capable Hub):

Quoted 12 lines

.subvendor and .subdevice were set to 0 implicitly, so only devices with these two values set to 0 in hardware can probe automatically. Make this requirement explicit.

While touching this array item, also make use of the pci macro designed for that case.

---
   drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 13 lines

drivers/gpu/drm/hyperv/hyperv_drm_drv.c static void hv_drm_pci_remove(struct pci_dev *pdev) · line 54

Quoted 11 lines
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +2 -2
index 2e75fb793495..e766d87b7a9d 100644
@@ -51,8 +51,8 @@ static void hv_drm_pci_remove(struct pci_dev *pdev)
   static const struct pci_device_id hv_drm_pci_tbl[] = {
   	{
-		.vendor = PCI_VENDOR_ID_MICROSOFT,
-		.device = PCI_DEVICE_ID_HYPERV_VIDEO,
+		PCI_VDEVICE_SUB(MICROSOFT, PCI_DEVICE_ID_HYPERV_VIDEO,
+				0, 0),

IDK, but it looks like an oversight to me.  Setting the sub-fields to ANY seems like the better fix.

Quoted 8 lines

That was my initial reflex, too. However while writing the commit log for that change I noticed that since commit d750785f305e ("Staging: hv:
fix hv_utils module to properly autoload") from 2010 (applied to v2.6.35-rc4) the driver never worked for hardware with .subvendor != 0 or .subdevice != 0. I cannot believe that something like that is discovered 16 years later by chance during a rework by someone who didn't try to run that hardware. And if I understand correctly, this is emulated hardware and so I guess used quite a lot.

I wouldn't be surprised. To my knowledge, there's just one implementation of this device, which is Windows. If they clear their host-side structures to 0 and pass them to the guest, no one would ever notice the issue. But let's see what the driver maintainers can comment on the issue.

Best regards
Thomas

Quoted 3 lines

Best regards
Uwe

Signature · 6 lines
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)
Reviewed-by
#8 lore raw

RE: [PATCH v1 2/4] drm/hyperv: Explicitly set subvendor and subdevice for pci match array

From: Thomas Zimmermann <[email protected]> Sent: Thursday, July 2, 2026 2:15 AM

Quoted 42 lines

Hi

Am 02.07.26 um 10:52 schrieb Uwe Kleine-König (The Capable Hub):

Quoted 29 lines

Hallo Thomas,

Quoted 13 lines · Thomas Zimmermann

Am 01.07.26 um 19:05 schrieb Uwe Kleine-König (The Capable Hub):

Quoted 12 lines

.subvendor and .subdevice were set to 0 implicitly, so only devices with these two values set to 0 in hardware can probe automatically. Make this requirement explicit.

While touching this array item, also make use of the pci macro designed for that case.

---
   drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 13 lines

drivers/gpu/drm/hyperv/hyperv_drm_drv.c static void hv_drm_pci_remove(struct pci_dev *pdev) · line 54

Quoted 11 lines
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +2 -2
index 2e75fb793495..e766d87b7a9d 100644
@@ -51,8 +51,8 @@ static void hv_drm_pci_remove(struct pci_dev *pdev)
   static const struct pci_device_id hv_drm_pci_tbl[] = {
   	{
-		.vendor = PCI_VENDOR_ID_MICROSOFT,
-		.device = PCI_DEVICE_ID_HYPERV_VIDEO,
+		PCI_VDEVICE_SUB(MICROSOFT, PCI_DEVICE_ID_HYPERV_VIDEO,
+				0, 0),

IDK, but it looks like an oversight to me.  Setting the sub-fields to ANY seems like the better fix.

Quoted 8 lines

That was my initial reflex, too. However while writing the commit log for that change I noticed that since commit d750785f305e ("Staging: hv:
fix hv_utils module to properly autoload") from 2010 (applied to v2.6.35-rc4) the driver never worked for hardware with .subvendor != 0 or .subdevice != 0. I cannot believe that something like that is discovered 16 years later by chance during a rework by someone who didn't try to run that hardware. And if I understand correctly, this is emulated hardware and so I guess used quite a lot.

Quoted 6 lines

I wouldn't be surprised. To my knowledge, there's just one implementation of this device, which is Windows. If they clear their host-side structures to 0 and pass them to the guest, no one would ever notice the issue. But let's see what the driver maintainers can comment on the issue.

Yes, the device is a synthetic device provided by a host that implements VMBus. Historically that's Windows Hyper-V, but alternate VMBus implementations are arising, such as in the paravisor used in some Azure VMs. That paravisor is also provided by Microsoft, though conceptually a customer could provide their own paravisor.

Since current code is defaulting to requiring .subvendor and .subdevice to be zero, I think that requirement should continue even with this cleanup. That maintains strict consistency with current code. If there's ever a case where a different implementation of VMBus needs to identify the synthetic frame buffer device differently, that's likely because of other changes in how the device presents itself. Any tweaks to the device id matching can be included then as part of whatever other changes are needed to the driver.

Just my $.02 ....

As such,

#9 lore raw

PATCH 3/4 drm/hyperv: Drop useless empty remove callback

In reply to Uwe Kleine-König (The Capable Hub)

Having an empty remove callback is equivalent to no remove callback. (The only minor difference is that with an empty remove callback pm_runtime_get_sync() and pm_runtime_put_noidle() are called.)

Drop this useless function.

---
 drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +0 -5
index e766d87b7a9d..e3f41336a831 100644
@@ -45,10 +45,6 @@ static int hv_drm_pci_probe(struct pci_dev *pdev,
 	return 0;
 }
 
-static void hv_drm_pci_remove(struct pci_dev *pdev)
-{
-}
-
 static const struct pci_device_id hv_drm_pci_tbl[] = {
 	{
 		PCI_VDEVICE_SUB(MICROSOFT, PCI_DEVICE_ID_HYPERV_VIDEO,
@@ -64,7 +60,6 @@ static struct pci_driver hv_drm_pci_driver = {
 	.name =		KBUILD_MODNAME,
 	.id_table =	hv_drm_pci_tbl,
 	.probe =	hv_drm_pci_probe,
-	.remove =	hv_drm_pci_remove,
 };
 
 static int hv_drm_setup_vram(struct hv_drm_device *hv,
Signature · 1 line
2.55.0.11.g153666a7d9bb
#10 lore raw

Re: [PATCH v1 3/4] drm/hyperv: Drop useless empty remove callback

Hi

Am 01.07.26 um 19:05 schrieb Uwe Kleine-König (The Capable Hub):

Quoted 16 lines

Having an empty remove callback is equivalent to no remove callback. (The only minor difference is that with an empty remove callback pm_runtime_get_sync() and pm_runtime_put_noidle() are called.)

Drop this useless function.

---
  drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 5 -----
  1 file changed, 5 deletions(-)
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +0 -0
index e766d87b7a9d..e3f41336a831 100644

drivers/gpu/drm/hyperv/hyperv_drm_drv.c static int hv_drm_pci_probe(struct pci_dev *pdev, · line 49

Quoted 5 lines
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +0 -2
@@ -45,10 +45,6 @@ static int hv_drm_pci_probe(struct pci_dev *pdev,
  	return 0;
  }
 
-static void hv_drm_pci_remove(struct pci_dev *pdev)
-{

It would be better to call drm_dev_unplug() from here.  With a bit more work, the driver can have hot-unplug functionality.

Best regards
Thomas

Quoted 13 lines
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +0 -3
-}
-
  static const struct pci_device_id hv_drm_pci_tbl[] = {
  	{
  		PCI_VDEVICE_SUB(MICROSOFT, PCI_DEVICE_ID_HYPERV_VIDEO,
@@ -64,7 +60,6 @@ static struct pci_driver hv_drm_pci_driver = {
  	.name =		KBUILD_MODNAME,
  	.id_table =	hv_drm_pci_tbl,
  	.probe =	hv_drm_pci_probe,
-	.remove =	hv_drm_pci_remove,
  };
 
  static int hv_drm_setup_vram(struct hv_drm_device *hv,
Signature · 6 lines
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)
#11 lore raw

Re: [PATCH v1 3/4] drm/hyperv: Drop useless empty remove callback

Hello,

Quoted 12 lines · Thomas Zimmermann

Am 01.07.26 um 19:05 schrieb Uwe Kleine-König (The Capable Hub):

Quoted 11 lines

Having an empty remove callback is equivalent to no remove callback. (The only minor difference is that with an empty remove callback pm_runtime_get_sync() and pm_runtime_put_noidle() are called.)

Drop this useless function.

---
  drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 5 -----
  1 file changed, 5 deletions(-)
Quoted 12 lines

drivers/gpu/drm/hyperv/hyperv_drm_drv.c static int hv_drm_pci_probe(struct pci_dev *pdev, · line 48

Quoted 9 lines
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +0 -2
index e766d87b7a9d..e3f41336a831 100644
@@ -45,10 +45,6 @@ static int hv_drm_pci_probe(struct pci_dev *pdev,
  	return 0;
  }
-static void hv_drm_pci_remove(struct pci_dev *pdev)
-{

It would be better to call drm_dev_unplug() from here.  With a bit more work, the driver can have hot-unplug functionality.

I don't have the "hardware" and thus cannot test. So I won't tackle that suggested quest.

Best regards
Uwe

#12 lore raw

PATCH 4/4 drm/hyperv: Move MODULE_DEVICE_TABLE to the device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)

It matches the usual coding style to have the MODULE_DEVICE_TABLE macro directly after the respective arrays.

---
 drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +2 -2
index e3f41336a831..6a28048f687b 100644
@@ -52,6 +52,7 @@ static const struct pci_device_id hv_drm_pci_tbl[] = {
 	},
 	{ /* end of list */ }
 };
+MODULE_DEVICE_TABLE(pci, hv_drm_pci_tbl);
 
 /*
  * PCI stub to support gen1 VM.
@@ -219,6 +220,7 @@ static const struct hv_vmbus_device_id hv_drm_vmbus_tbl[] = {
 	{HV_SYNTHVID_GUID},
 	{}
 };
+MODULE_DEVICE_TABLE(vmbus, hv_drm_vmbus_tbl);
 
 static struct hv_driver hv_drm_hv_driver = {
 	.name = KBUILD_MODNAME,
@@ -260,8 +262,6 @@ static void __exit hv_drm_exit(void)
 module_init(hv_drm_init);
 module_exit(hv_drm_exit);
 
-MODULE_DEVICE_TABLE(pci, hv_drm_pci_tbl);
-MODULE_DEVICE_TABLE(vmbus, hv_drm_vmbus_tbl);
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Deepak Rawat <[email protected]>");
 MODULE_DESCRIPTION("DRM driver for Hyper-V synthetic video device");
Signature · 1 line
2.55.0.11.g153666a7d9bb
maintainer Reviewed-by on v1 4/4
#13 lore raw

Re: [PATCH v1 4/4] drm/hyperv: Move MODULE_DEVICE_TABLE to the device_id arrays

Am 01.07.26 um 19:05 schrieb Uwe Kleine-König (The Capable Hub):

Quoted 4 lines

It matches the usual coding style to have the MODULE_DEVICE_TABLE macro directly after the respective arrays.

Quoted 33 lines
---
  drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +2 -2
index e3f41336a831..6a28048f687b 100644
@@ -52,6 +52,7 @@ static const struct pci_device_id hv_drm_pci_tbl[] = {
  	},
  	{ /* end of list */ }
  };
+MODULE_DEVICE_TABLE(pci, hv_drm_pci_tbl);
 
  /*
   * PCI stub to support gen1 VM.
@@ -219,6 +220,7 @@ static const struct hv_vmbus_device_id hv_drm_vmbus_tbl[] = {
  	{HV_SYNTHVID_GUID},
  	{}
  };
+MODULE_DEVICE_TABLE(vmbus, hv_drm_vmbus_tbl);
 
  static struct hv_driver hv_drm_hv_driver = {
  	.name = KBUILD_MODNAME,
@@ -260,8 +262,6 @@ static void __exit hv_drm_exit(void)
  module_init(hv_drm_init);
  module_exit(hv_drm_exit);
 
-MODULE_DEVICE_TABLE(pci, hv_drm_pci_tbl);
-MODULE_DEVICE_TABLE(vmbus, hv_drm_vmbus_tbl);
  MODULE_LICENSE("GPL");
  MODULE_AUTHOR("Deepak Rawat <[email protected]>");
  MODULE_DESCRIPTION("DRM driver for Hyper-V synthetic video device");
Signature · 6 lines
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)
Reviewed-by on v1 4/4
#14 lore raw

RE: [PATCH v1 4/4] drm/hyperv: Move MODULE_DEVICE_TABLE to the device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)

From: Uwe Kleine-König (The Capable Hub) <[email protected]> Sent: Wednesday, July 1, 2026 10:05 AM

Quoted 40 lines

It matches the usual coding style to have the MODULE_DEVICE_TABLE macro directly after the respective arrays.

---
 drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +2 -3
index e3f41336a831..6a28048f687b 100644
@@ -52,6 +52,7 @@ static const struct pci_device_id hv_drm_pci_tbl[] = {
 	},
 	{ /* end of list */ }
 };
+MODULE_DEVICE_TABLE(pci, hv_drm_pci_tbl);
 
 /*
  * PCI stub to support gen1 VM.
@@ -219,6 +220,7 @@ static const struct hv_vmbus_device_id hv_drm_vmbus_tbl[] = {
 	{HV_SYNTHVID_GUID},
 	{}
 };
+MODULE_DEVICE_TABLE(vmbus, hv_drm_vmbus_tbl);
 
 static struct hv_driver hv_drm_hv_driver = {
 	.name = KBUILD_MODNAME,
@@ -260,8 +262,6 @@ static void __exit hv_drm_exit(void)
 module_init(hv_drm_init);
 module_exit(hv_drm_exit);
 
-MODULE_DEVICE_TABLE(pci, hv_drm_pci_tbl);
-MODULE_DEVICE_TABLE(vmbus, hv_drm_vmbus_tbl);
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Deepak Rawat <[email protected]>");
 MODULE_DESCRIPTION("DRM driver for Hyper-V synthetic video device");
--
Quoted 2 lines

2.55.0.11.g153666a7d9bb

#15 lore raw
In reply to Uwe Kleine-König (The Capable Hub)

Hello,

Quoted 6 lines · Uwe Kleine-König (The Capable Hub)

while working on a tree-wide cleanup I found a few issues in the drm/hyperv driver that are addressed here.

While the first patch is a fix, the issue is so old (from 2021, included in v5.14-rc1) that applying the series during the next merge window is probably the right choice.

I wonder who feels responsible to pick up this series (maybe without patch 3)?

Best regards
Uwe

#16 lore raw
In reply to Uwe Kleine-König (The Capable Hub)
Quoted 11 lines · Uwe Kleine-König (The Capable Hub)

Hello,

while working on a tree-wide cleanup I found a few issues in the drm/hyperv driver that are addressed here.

While the first patch is a fix, the issue is so old (from 2021, included in v5.14-rc1) that applying the series during the next merge window is probably the right choice.

Best regards
Uwe

Applied (sans patch #3), thanks!

Quoted 15 lines

Uwe Kleine-König (The Capable Hub) (4):
drm/hyperv: Unregister pci driver in error path before module unload drm/hyperv: Explicitly set subvendor and subdevice for pci match array drm/hyperv: Drop useless empty remove callback
drm/hyperv: Move MODULE_DEVICE_TABLE to the device_id arrays

 drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

base-commit: be5c93fa674f0fc3c8f359c2143abce6bbb422e6

Signature · 1 line
2.55.0.11.g153666a7d9bb