pci-hyperv: Add check for hyperv_initialized in init_hv_pci_drv()
Subsystems (4)
Haiyang Zhang
maintainerPATCH 1/1 pci-hyperv: Add check for hyperv_initialized in init_hv_pci_drv()
Add check for hv_is_hyperv_initialized() at the top of init_hv_pci_drv(), so if the pci-hyperv driver is force-loaded on non Hyper-V platforms, the init_hv_pci_drv() will exit immediately, without any side effects, like assignments to hvpci_block_ops, etc.
--- drivers/pci/controller/pci-hyperv.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/pci/controller/pci-hyperv.c +3 -0
@@ -3476,6 +3476,9 @@ static void __exit exit_hv_pci_drv(void)static int __init init_hv_pci_drv (void ) { +if (!hv_is_hyperv_initialized ()) +return -ENODEV ; +/* Set the invalid domain number's bit, so it will not be used */ set_bit (HVPCI_DOM_INVALID , hvpci_dom_map);
Signature · 1 line
2.25.1
Quoted 7 lines · Haiyang Zhang
Add check for
hv_is_hyperv_initialized()at the top ofinit_hv_pci_drv(), so if the pci-hyperv driver is force-loaded on non Hyper-V platforms, theinit_hv_pci_drv()will exit immediately, without any side effects, like assignments tohvpci_block_ops, etc.Signed-off-by Haiyang Zhang <[email protected]>Reported-and-tested-by Mohammad Alqayeem <[email protected]>
Quoted 21 lines
--- drivers/pci/controller/pci-hyperv.c | 3 +++ 1 file changed, 3 insertions(+)drivers/pci/controller/pci-hyperv.c +3
-0@@ -3476,6 +3476,9 @@ static void __exit exit_hv_pci_drv(void)static int __init init_hv_pci_drv (void ) { +if (!hv_is_hyperv_initialized ()) +return -ENODEV ; +/* Set the invalid domain number's bit, so it will not be used */ set_bit (HVPCI_DOM_INVALID , hvpci_dom_map);Signature · 1 line
2.25.1
Wei Liu
maintainerQuoted 7 lines · Haiyang Zhang
Add check for
hv_is_hyperv_initialized()at the top ofinit_hv_pci_drv(), so if the pci-hyperv driver is force-loaded on non Hyper-V platforms, theinit_hv_pci_drv()will exit immediately, without any side effects, like assignments tohvpci_block_ops, etc.Signed-off-by Haiyang Zhang <[email protected]>Reported-and-tested-by Mohammad Alqayeem <[email protected]>
Hello PCI subsystem maintainers, are you going to take this patch or shall I?
Wei.
Quoted 21 lines
--- drivers/pci/controller/pci-hyperv.c | 3 +++ 1 file changed, 3 insertions(+)drivers/pci/controller/pci-hyperv.c +3
-0@@ -3476,6 +3476,9 @@ static void __exit exit_hv_pci_drv(void)static int __init init_hv_pci_drv (void ) { +if (!hv_is_hyperv_initialized ()) +return -ENODEV ; +/* Set the invalid domain number's bit, so it will not be used */ set_bit (HVPCI_DOM_INVALID , hvpci_dom_map);Signature · 1 line
2.25.1
Quoted 11 lines · Wei Liu
Quoted 7 lines · Haiyang Zhang
Add check for
hv_is_hyperv_initialized()at the top ofinit_hv_pci_drv(), so if the pci-hyperv driver is force-loaded on non Hyper-V platforms, theinit_hv_pci_drv()will exit immediately, without any side effects, like assignments tohvpci_block_ops, etc.Signed-off-by Haiyang Zhang <[email protected]>Reported-and-tested-by Mohammad Alqayeem <[email protected]>Hello PCI subsystem maintainers, are you going to take this patch or shall I?
This was mistakenly assigned to me, so I reassigned it back to Lorenzo.
If you *do* take this, please at least update it to follow the PCI commit log conventions, e.g.,
PCI: hv: Add check ...
and wrap the text so it fits in 75 columns.
Quoted 21 lines
Quoted 21 lines
--- drivers/pci/controller/pci-hyperv.c | 3 +++ 1 file changed, 3 insertions(+)drivers/pci/controller/pci-hyperv.c +3
-0@@ -3476,6 +3476,9 @@ static void __exit exit_hv_pci_drv(void)static int __init init_hv_pci_drv (void ) { +if (!hv_is_hyperv_initialized ()) +return -ENODEV ; +/* Set the invalid domain number's bit, so it will not be used */ set_bit (HVPCI_DOM_INVALID , hvpci_dom_map);Signature · 1 line
2.25.1
Wei Liu
maintainerQuoted 16 lines · Bjorn Helgaas
Quoted 11 lines · Wei Liu
Quoted 7 lines · Haiyang Zhang
Add check for
hv_is_hyperv_initialized()at the top ofinit_hv_pci_drv(), so if the pci-hyperv driver is force-loaded on non Hyper-V platforms, theinit_hv_pci_drv()will exit immediately, without any side effects, like assignments tohvpci_block_ops, etc.Signed-off-by Haiyang Zhang <[email protected]>Reported-and-tested-by Mohammad Alqayeem <[email protected]>Hello PCI subsystem maintainers, are you going to take this patch or shall I?
This was mistakenly assigned to me, so I reassigned it back to Lorenzo.
Quoted 6 lines
If you *do* take this, please at least update it to follow the PCI commit log conventions, e.g.,
PCI: hv: Add check ...
and wrap the text so it fits in 75 columns.
Lorenzo already picked up two Hyper-V PCI patches from Long Li. I think leaving this to him is better.
Wei.
Wei Liu
maintainerQuoted 20 lines · Wei Liu
Quoted 19 lines · Bjorn Helgaas
Quoted 11 lines · Wei Liu
Quoted 7 lines · Haiyang Zhang
Add check for
hv_is_hyperv_initialized()at the top ofinit_hv_pci_drv(), so if the pci-hyperv driver is force-loaded on non Hyper-V platforms, theinit_hv_pci_drv()will exit immediately, without any side effects, like assignments tohvpci_block_ops, etc.Signed-off-by Haiyang Zhang <[email protected]>Reported-and-tested-by Mohammad Alqayeem <[email protected]>Hello PCI subsystem maintainers, are you going to take this patch or shall I?
This was mistakenly assigned to me, so I reassigned it back to Lorenzo.
If you *do* take this, please at least update it to follow the PCI commit log conventions, e.g.,
Quoted 7 lines
Quoted 3 lines
PCI: hv: Add check ...
and wrap the text so it fits in 75 columns.
Lorenzo already picked up two Hyper-V PCI patches from Long Li. I think leaving this to him is better.
This patch is still missing from pci/hv, so I've picked it up via hyperv-next (with the adjustments required by Bjorn).
Wei.
Haiyang Zhang
maintainerQuoted 39 lines
-----Original Message-----
From: Wei Liu <[email protected]>
Sent: Friday, June 18, 2021 9:23 AM
To: Bjorn Helgaas <[email protected]>
Cc: Wei Liu <[email protected]>; Haiyang Zhang <[email protected]>; [email protected]; [email protected]; linux- [email protected]; [email protected]; KY Srinivasan <[email protected]>; [email protected]; vkuznets <[email protected]>; [email protected]
Subject: Re: [PATCH] pci-hyperv: Add check forhyperv_initializedininit_hv_pci_drv()Quoted 24 lines · Wei Liu
Quoted 23 lines · Bjorn Helgaas
Quoted 7 lines · Wei Liu
Quoted 6 lines · Haiyang Zhang
Add check for
hv_is_hyperv_initialized()at the top ofinit_hv_pci_drv(), so if the pci-hyperv driver is force-loaded on non Hyper-V platforms, theinit_hv_pci_drv()will exit immediately, without any side effects, like assignments tohvpci_block_ops, etc.Quoted 6 lines
Quoted 3 lines
Signed-off-by Haiyang Zhang <[email protected]>Reported-and-tested-by Mohammad AlqayeemHello PCI subsystem maintainers, are you going to take this patch or shall I?
This was mistakenly assigned to me, so I reassigned it back to Lorenzo.
If you *do* take this, please at least update it to follow the PCI commit log conventions, e.g.,
PCI: hv: Add check ...
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
and wrap the text so it fits in 75 columns.
Lorenzo already picked up two Hyper-V PCI patches from Long Li. I think leaving this to him is better.
This patch is still missing from pci/hv, so I've picked it up via hyperv-next (with the adjustments required by Bjorn).
Thank you!
- Haiyang