diff mbox series

PCI: vmd: Reset VMD config register between soft reboots

Message ID 20230224202811.644370-1-nirmal.patel@linux.intel.com
State New
Headers show
Series PCI: vmd: Reset VMD config register between soft reboots | expand

Commit Message

Nirmal Patel Feb. 24, 2023, 8:28 p.m. UTC
VMD driver can disable or enable MSI remapping by changing
VMCONFIG_MSI_REMAP register. This register needs to be set to the
default value during soft reboots. Drives failed to enumerate
when Windows boots after performing a soft reboot from Linux.
Windows doesn't support MSI remapping disable feature and stale
register value hinders Windows VMD driver initialization process.
Adding vmd_shutdown function to make sure to set the VMCONFIG
register to the default value.

Signed-off-by: Nirmal Patel <nirmal.patel@linux.intel.com>
Fixes: ee81ee84f873 ("PCI: vmd: Disable MSI-X remapping when possible")
---
 drivers/pci/controller/vmd.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Nirmal Patel March 15, 2023, 9:51 p.m. UTC | #1
On 2/24/2023 1:28 PM, Nirmal Patel wrote:
> VMD driver can disable or enable MSI remapping by changing
> VMCONFIG_MSI_REMAP register. This register needs to be set to the
> default value during soft reboots. Drives failed to enumerate
> when Windows boots after performing a soft reboot from Linux.
> Windows doesn't support MSI remapping disable feature and stale
> register value hinders Windows VMD driver initialization process.
> Adding vmd_shutdown function to make sure to set the VMCONFIG
> register to the default value.
>
> Signed-off-by: Nirmal Patel <nirmal.patel@linux.intel.com>
> Fixes: ee81ee84f873 ("PCI: vmd: Disable MSI-X remapping when possible")
> ---
>  drivers/pci/controller/vmd.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
> index 769eedeb8802..50a187a29a1d 100644
> --- a/drivers/pci/controller/vmd.c
> +++ b/drivers/pci/controller/vmd.c
> @@ -979,6 +979,13 @@ static void vmd_remove(struct pci_dev *dev)
>  	ida_simple_remove(&vmd_instance_ida, vmd->instance);
>  }
>  
> +static void vmd_shutdown(struct pci_dev *dev)
> +{
> +        struct vmd_dev *vmd = pci_get_drvdata(dev);
> +
> +        vmd_remove_irq_domain(vmd);
> +}
> +
>  #ifdef CONFIG_PM_SLEEP
>  static int vmd_suspend(struct device *dev)
>  {
> @@ -1056,6 +1063,7 @@ static struct pci_driver vmd_drv = {
>  	.id_table	= vmd_ids,
>  	.probe		= vmd_probe,
>  	.remove		= vmd_remove,
> +	.shutdown	= vmd_shutdown,
>  	.driver		= {
>  		.pm	= &vmd_dev_pm_ops,
>  	},

Gentle ping.

Thanks
Jonathan Derrick March 18, 2023, 3:15 a.m. UTC | #2
On 3/15/23 3:51 PM, Patel, Nirmal wrote:
> On 2/24/2023 1:28 PM, Nirmal Patel wrote:
>> VMD driver can disable or enable MSI remapping by changing
>> VMCONFIG_MSI_REMAP register. This register needs to be set to the
>> default value during soft reboots. Drives failed to enumerate
>> when Windows boots after performing a soft reboot from Linux.
>> Windows doesn't support MSI remapping disable feature and stale
>> register value hinders Windows VMD driver initialization process.
>> Adding vmd_shutdown function to make sure to set the VMCONFIG
>> register to the default value.
>>
>> Signed-off-by: Nirmal Patel <nirmal.patel@linux.intel.com>
>> Fixes: ee81ee84f873 ("PCI: vmd: Disable MSI-X remapping when possible")
>> ---
>>   drivers/pci/controller/vmd.c | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
>> index 769eedeb8802..50a187a29a1d 100644
>> --- a/drivers/pci/controller/vmd.c
>> +++ b/drivers/pci/controller/vmd.c
>> @@ -979,6 +979,13 @@ static void vmd_remove(struct pci_dev *dev)
>>   	ida_simple_remove(&vmd_instance_ida, vmd->instance);
>>   }
>>   
>> +static void vmd_shutdown(struct pci_dev *dev)
>> +{
>> +        struct vmd_dev *vmd = pci_get_drvdata(dev);
>> +
>> +        vmd_remove_irq_domain(vmd);
>> +}
>> +
>>   #ifdef CONFIG_PM_SLEEP
>>   static int vmd_suspend(struct device *dev)
>>   {
>> @@ -1056,6 +1063,7 @@ static struct pci_driver vmd_drv = {
>>   	.id_table	= vmd_ids,
>>   	.probe		= vmd_probe,
>>   	.remove		= vmd_remove,
>> +	.shutdown	= vmd_shutdown,
>>   	.driver		= {
>>   		.pm	= &vmd_dev_pm_ops,
>>   	},
> 
> Gentle ping.
> 
> Thanks
> 

LGTM
Reviewed-by: Jon Derrick <jonathan.derrick@linux.dev>
Nirmal Patel April 18, 2023, 2:54 p.m. UTC | #3
On 3/17/2023 8:15 PM, Jonathan Derrick wrote:
>
>
> On 3/15/23 3:51 PM, Patel, Nirmal wrote:
>> On 2/24/2023 1:28 PM, Nirmal Patel wrote:
>>> VMD driver can disable or enable MSI remapping by changing
>>> VMCONFIG_MSI_REMAP register. This register needs to be set to the
>>> default value during soft reboots. Drives failed to enumerate
>>> when Windows boots after performing a soft reboot from Linux.
>>> Windows doesn't support MSI remapping disable feature and stale
>>> register value hinders Windows VMD driver initialization process.
>>> Adding vmd_shutdown function to make sure to set the VMCONFIG
>>> register to the default value.
>>>
>>> Signed-off-by: Nirmal Patel <nirmal.patel@linux.intel.com>
>>> Fixes: ee81ee84f873 ("PCI: vmd: Disable MSI-X remapping when possible")
>>> ---
>>>   drivers/pci/controller/vmd.c | 8 ++++++++
>>>   1 file changed, 8 insertions(+)
>>>
>>> diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
>>> index 769eedeb8802..50a187a29a1d 100644
>>> --- a/drivers/pci/controller/vmd.c
>>> +++ b/drivers/pci/controller/vmd.c
>>> @@ -979,6 +979,13 @@ static void vmd_remove(struct pci_dev *dev)
>>>       ida_simple_remove(&vmd_instance_ida, vmd->instance);
>>>   }
>>>   +static void vmd_shutdown(struct pci_dev *dev)
>>> +{
>>> +        struct vmd_dev *vmd = pci_get_drvdata(dev);
>>> +
>>> +        vmd_remove_irq_domain(vmd);
>>> +}
>>> +
>>>   #ifdef CONFIG_PM_SLEEP
>>>   static int vmd_suspend(struct device *dev)
>>>   {
>>> @@ -1056,6 +1063,7 @@ static struct pci_driver vmd_drv = {
>>>       .id_table    = vmd_ids,
>>>       .probe        = vmd_probe,
>>>       .remove        = vmd_remove,
>>> +    .shutdown    = vmd_shutdown,
>>>       .driver        = {
>>>           .pm    = &vmd_dev_pm_ops,
>>>       },
>>
>> Gentle ping.
>>
>> Thanks
>>
>
> LGTM
> Reviewed-by: Jon Derrick <jonathan.derrick@linux.dev>

Gentle ping.

Thanks
Lorenzo Pieralisi April 21, 2023, 8:29 a.m. UTC | #4
On Fri, 24 Feb 2023 13:28:11 -0700, Nirmal Patel wrote:
> VMD driver can disable or enable MSI remapping by changing
> VMCONFIG_MSI_REMAP register. This register needs to be set to the
> default value during soft reboots. Drives failed to enumerate
> when Windows boots after performing a soft reboot from Linux.
> Windows doesn't support MSI remapping disable feature and stale
> register value hinders Windows VMD driver initialization process.
> Adding vmd_shutdown function to make sure to set the VMCONFIG
> register to the default value.
> 
> [...]

Applied to controller/vmd, thanks!

[1/1] PCI: vmd: Reset VMD config register between soft reboots
      https://git.kernel.org/pci/pci/c/e06720c1d9e1

Thanks,
Lorenzo
diff mbox series

Patch

diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index 769eedeb8802..50a187a29a1d 100644
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@ -979,6 +979,13 @@  static void vmd_remove(struct pci_dev *dev)
 	ida_simple_remove(&vmd_instance_ida, vmd->instance);
 }
 
+static void vmd_shutdown(struct pci_dev *dev)
+{
+        struct vmd_dev *vmd = pci_get_drvdata(dev);
+
+        vmd_remove_irq_domain(vmd);
+}
+
 #ifdef CONFIG_PM_SLEEP
 static int vmd_suspend(struct device *dev)
 {
@@ -1056,6 +1063,7 @@  static struct pci_driver vmd_drv = {
 	.id_table	= vmd_ids,
 	.probe		= vmd_probe,
 	.remove		= vmd_remove,
+	.shutdown	= vmd_shutdown,
 	.driver		= {
 		.pm	= &vmd_dev_pm_ops,
 	},