Re: [PATCH] drm/amdgpu: Need to disable msix when unloading driver

2019-11-06 Thread Deucher, Alexander
Reviewed-by: Alex Deucher 

From: Deng, Emily 
Sent: Wednesday, November 6, 2019 5:09 AM
To: Koenig, Christian ; amd-gfx@lists.freedesktop.org 
; Deucher, Alexander 
Subject: RE: [PATCH] drm/amdgpu: Need to disable msix when unloading driver

Hi Christian,
We use " pci_alloc_irq_vectors " in amdgpu_irq_init. This patch use " 
pci_free_irq_vectors " in amdgpu_irq_fini.

Hi Alex,
Could you help to review this?

Best wishes
Emily Deng



>-Original Message-
>From: Christian König 
>Sent: Wednesday, November 6, 2019 5:32 PM
>To: Deng, Emily ; amd-gfx@lists.freedesktop.org
>Subject: Re: [PATCH] drm/amdgpu: Need to disable msix when unloading
>driver
>
>Not an expert on the PCI IRQ stuff, but from what I know that looks correct to
>me.
>
>Only question I can see is why don't we use pci_alloc_irq_vectors()?
>Alex probably needs to take a look.
>
>Regards,
>Christian.
>
>Am 06.11.19 um 07:28 schrieb Deng, Emily:
>> Hi all,
>>  Please help to review this. This is to fix driver reload issue.
>>
>> Best wishes
>> Emily Deng
>>
>>
>>> -Original Message-
>>> From: Emily Deng 
>>> Sent: Wednesday, November 6, 2019 2:24 PM
>>> To: amd-gfx@lists.freedesktop.org
>>> Cc: Deng, Emily 
>>> Subject: [PATCH] drm/amdgpu: Need to disable msix when unloading
>>> driver
>>>
>>> For driver reload test, it will report "can't enable MSI (MSI-X already
>enabled)".
>>>
>>> Signed-off-by: Emily Deng 
>>> ---
>>> drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
>>> index 6f3b03f..30d540d 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
>>> @@ -311,7 +311,7 @@ void amdgpu_irq_fini(struct amdgpu_device *adev)
>>>  drm_irq_uninstall(adev->ddev);
>>>  adev->irq.installed = false;
>>>  if (adev->irq.msi_enabled)
>>> -   pci_disable_msi(adev->pdev);
>>> +   pci_free_irq_vectors(adev->pdev);
>>>  if (!amdgpu_device_has_dc_support(adev))
>>>  flush_work(&adev->hotplug_work);
>>>  }
>>> --
>>> 2.7.4
>> ___
>> amd-gfx mailing list
>> amd-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

RE: [PATCH] drm/amdgpu: Need to disable msix when unloading driver

2019-11-06 Thread Deng, Emily
Hi Christian,
We use " pci_alloc_irq_vectors " in amdgpu_irq_init. This patch use " 
pci_free_irq_vectors " in amdgpu_irq_fini.

Hi Alex,
Could you help to review this?

Best wishes
Emily Deng



>-Original Message-
>From: Christian König 
>Sent: Wednesday, November 6, 2019 5:32 PM
>To: Deng, Emily ; amd-gfx@lists.freedesktop.org
>Subject: Re: [PATCH] drm/amdgpu: Need to disable msix when unloading
>driver
>
>Not an expert on the PCI IRQ stuff, but from what I know that looks correct to
>me.
>
>Only question I can see is why don't we use pci_alloc_irq_vectors()?
>Alex probably needs to take a look.
>
>Regards,
>Christian.
>
>Am 06.11.19 um 07:28 schrieb Deng, Emily:
>> Hi all,
>>  Please help to review this. This is to fix driver reload issue.
>>
>> Best wishes
>> Emily Deng
>>
>>
>>> -Original Message-
>>> From: Emily Deng 
>>> Sent: Wednesday, November 6, 2019 2:24 PM
>>> To: amd-gfx@lists.freedesktop.org
>>> Cc: Deng, Emily 
>>> Subject: [PATCH] drm/amdgpu: Need to disable msix when unloading
>>> driver
>>>
>>> For driver reload test, it will report "can't enable MSI (MSI-X already
>enabled)".
>>>
>>> Signed-off-by: Emily Deng 
>>> ---
>>> drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
>>> index 6f3b03f..30d540d 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
>>> @@ -311,7 +311,7 @@ void amdgpu_irq_fini(struct amdgpu_device *adev)
>>> drm_irq_uninstall(adev->ddev);
>>> adev->irq.installed = false;
>>> if (adev->irq.msi_enabled)
>>> -   pci_disable_msi(adev->pdev);
>>> +   pci_free_irq_vectors(adev->pdev);
>>> if (!amdgpu_device_has_dc_support(adev))
>>> flush_work(&adev->hotplug_work);
>>> }
>>> --
>>> 2.7.4
>> ___
>> amd-gfx mailing list
>> amd-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Re: [PATCH] drm/amdgpu: Need to disable msix when unloading driver

2019-11-06 Thread Christian König
Not an expert on the PCI IRQ stuff, but from what I know that looks 
correct to me.


Only question I can see is why don't we use pci_alloc_irq_vectors()? 
Alex probably needs to take a look.


Regards,
Christian.

Am 06.11.19 um 07:28 schrieb Deng, Emily:

Hi all,
 Please help to review this. This is to fix driver reload issue.

Best wishes
Emily Deng



-Original Message-
From: Emily Deng 
Sent: Wednesday, November 6, 2019 2:24 PM
To: amd-gfx@lists.freedesktop.org
Cc: Deng, Emily 
Subject: [PATCH] drm/amdgpu: Need to disable msix when unloading driver

For driver reload test, it will report "can't enable MSI (MSI-X already 
enabled)".

Signed-off-by: Emily Deng 
---
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
index 6f3b03f..30d540d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
@@ -311,7 +311,7 @@ void amdgpu_irq_fini(struct amdgpu_device *adev)
drm_irq_uninstall(adev->ddev);
adev->irq.installed = false;
if (adev->irq.msi_enabled)
-   pci_disable_msi(adev->pdev);
+   pci_free_irq_vectors(adev->pdev);
if (!amdgpu_device_has_dc_support(adev))
flush_work(&adev->hotplug_work);
}
--
2.7.4

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

RE: [PATCH] drm/amdgpu: Need to disable msix when unloading driver

2019-11-05 Thread Deng, Emily
Hi all,
Please help to review this. This is to fix driver reload issue.

Best wishes
Emily Deng


>-Original Message-
>From: Emily Deng 
>Sent: Wednesday, November 6, 2019 2:24 PM
>To: amd-gfx@lists.freedesktop.org
>Cc: Deng, Emily 
>Subject: [PATCH] drm/amdgpu: Need to disable msix when unloading driver
>
>For driver reload test, it will report "can't enable MSI (MSI-X already 
>enabled)".
>
>Signed-off-by: Emily Deng 
>---
> drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
>b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
>index 6f3b03f..30d540d 100644
>--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
>+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
>@@ -311,7 +311,7 @@ void amdgpu_irq_fini(struct amdgpu_device *adev)
>   drm_irq_uninstall(adev->ddev);
>   adev->irq.installed = false;
>   if (adev->irq.msi_enabled)
>-  pci_disable_msi(adev->pdev);
>+  pci_free_irq_vectors(adev->pdev);
>   if (!amdgpu_device_has_dc_support(adev))
>   flush_work(&adev->hotplug_work);
>   }
>--
>2.7.4

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

RE: [PATCH] drm/amdgpu: Need to disable msix when unloading driver

2019-11-05 Thread Deng, Emily
Sorry, please ignore this, will send another patch later.

Best wishes
Emily Deng



>-Original Message-
>From: Emily Deng 
>Sent: Wednesday, November 6, 2019 2:18 PM
>To: amd-gfx@lists.freedesktop.org
>Cc: Deng, Emily 
>Subject: [PATCH] drm/amdgpu: Need to disable msix when unloading driver
>
>For driver reload test, it will report "can't enable MSI (MSI-X already 
>enabled)".
>
>Signed-off-by: Emily Deng 
>---
> drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 4 
> 1 file changed, 4 insertions(+)
>
>diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
>b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
>index 6040eb3..48d9cf0d 100644
>--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
>+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
>@@ -325,7 +325,11 @@ void amdgpu_irq_fini(struct amdgpu_device *adev)
>   drm_irq_uninstall(adev->ddev);
>   adev->irq.installed = false;
>   if (adev->irq.msi_enabled)
>+#ifdef PCI_IRQ_MSI
>+  pci_free_irq_vectors(adev->pdev);
>+#else
>   pci_disable_msi(adev->pdev);
>+#endif
>   if (!amdgpu_device_has_dc_support(adev))
>   flush_work(&adev->hotplug_work);
>   }
>--
>2.7.4

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[PATCH] drm/amdgpu: Need to disable msix when unloading driver

2019-11-05 Thread Emily Deng
For driver reload test, it will report "can't enable
MSI (MSI-X already enabled)".

Signed-off-by: Emily Deng 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
index 6f3b03f..30d540d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
@@ -311,7 +311,7 @@ void amdgpu_irq_fini(struct amdgpu_device *adev)
drm_irq_uninstall(adev->ddev);
adev->irq.installed = false;
if (adev->irq.msi_enabled)
-   pci_disable_msi(adev->pdev);
+   pci_free_irq_vectors(adev->pdev);
if (!amdgpu_device_has_dc_support(adev))
flush_work(&adev->hotplug_work);
}
-- 
2.7.4

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[PATCH] drm/amdgpu: Need to disable msix when unloading driver

2019-11-05 Thread Emily Deng
For driver reload test, it will report "can't enable
MSI (MSI-X already enabled)".

Signed-off-by: Emily Deng 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
index 6040eb3..48d9cf0d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
@@ -325,7 +325,11 @@ void amdgpu_irq_fini(struct amdgpu_device *adev)
drm_irq_uninstall(adev->ddev);
adev->irq.installed = false;
if (adev->irq.msi_enabled)
+#ifdef PCI_IRQ_MSI
+   pci_free_irq_vectors(adev->pdev);
+#else
pci_disable_msi(adev->pdev);
+#endif
if (!amdgpu_device_has_dc_support(adev))
flush_work(&adev->hotplug_work);
}
-- 
2.7.4

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx