[PATCH v1 1/6] s390/pci: Restore airq unconditionally for the zPCI device

Farhan Ali posted 6 patches 1 month, 3 weeks ago
There is a newer version of this series
[PATCH v1 1/6] s390/pci: Restore airq unconditionally for the zPCI device
Posted by Farhan Ali 1 month, 3 weeks ago
Commit c1e18c17bda6 ("s390/pci: add zpci_set_irq()/zpci_clear_irq()"),
introduced the zpci_set_irq() and zpci_clear_irq(), to be used while
resetting a zPCI device.

Commit da995d538d3a ("s390/pci: implement reset_slot for hotplug slot"),
mentions zpci_clear_irq() being called in the path for zpci_hot_reset_device().
But that is not the case anymore and these functions are not called
outside of this file.

However after a CLP disable/enable reset (zpci_hot_reset_device),
the airq setup of the device will need to be restored. Since we
are no longer calling zpci_clear_airq() in the reset path, we should
restore the airq for device unconditionally.

Signed-off-by: Farhan Ali <alifm@linux.ibm.com>
---
 arch/s390/pci/pci_irq.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/s390/pci/pci_irq.c b/arch/s390/pci/pci_irq.c
index 84482a921332..8b5493f0dee0 100644
--- a/arch/s390/pci/pci_irq.c
+++ b/arch/s390/pci/pci_irq.c
@@ -427,8 +427,7 @@ bool arch_restore_msi_irqs(struct pci_dev *pdev)
 {
 	struct zpci_dev *zdev = to_zpci(pdev);
 
-	if (!zdev->irqs_registered)
-		zpci_set_irq(zdev);
+	zpci_set_irq(zdev);
 	return true;
 }
 
-- 
2.43.0
Re: [PATCH v1 1/6] s390/pci: Restore airq unconditionally for the zPCI device
Posted by Niklas Schnelle 1 month, 3 weeks ago
On Wed, 2025-08-13 at 10:08 -0700, Farhan Ali wrote:
> Commit c1e18c17bda6 ("s390/pci: add zpci_set_irq()/zpci_clear_irq()"),
> introduced the zpci_set_irq() and zpci_clear_irq(), to be used while
> resetting a zPCI device.
> 
> Commit da995d538d3a ("s390/pci: implement reset_slot for hotplug slot"),
> mentions zpci_clear_irq() being called in the path for zpci_hot_reset_device().
> But that is not the case anymore and these functions are not called
> outside of this file.
> 
> However after a CLP disable/enable reset (zpci_hot_reset_device),
> the airq setup of the device will need to be restored. Since we
> are no longer calling zpci_clear_airq() in the reset path, we should
> restore the airq for device unconditionally.
> 
> Signed-off-by: Farhan Ali <alifm@linux.ibm.com>
> ---
>  arch/s390/pci/pci_irq.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/s390/pci/pci_irq.c b/arch/s390/pci/pci_irq.c
> index 84482a921332..8b5493f0dee0 100644
> --- a/arch/s390/pci/pci_irq.c
> +++ b/arch/s390/pci/pci_irq.c
> @@ -427,8 +427,7 @@ bool arch_restore_msi_irqs(struct pci_dev *pdev)
>  {
>  	struct zpci_dev *zdev = to_zpci(pdev);
>  
> -	if (!zdev->irqs_registered)
> -		zpci_set_irq(zdev);
> +	zpci_set_irq(zdev);
>  	return true;
>  }
>  

This would make zdev->irqs_registered effectively without function so
the patch should remove that field from struct zpci_dev and
zpci_set_irq()/zpci_clear_irq(). Alternatively you could also clear
zdev->irqs_registed in zpci_disable_device(). I think the former is
cleaner though.

Thanks,
Niklas
Re: [PATCH v1 1/6] s390/pci: Restore airq unconditionally for the zPCI device
Posted by Farhan Ali 1 month, 3 weeks ago
On 8/14/2025 4:32 AM, Niklas Schnelle wrote:
> On Wed, 2025-08-13 at 10:08 -0700, Farhan Ali wrote:
>> Commit c1e18c17bda6 ("s390/pci: add zpci_set_irq()/zpci_clear_irq()"),
>> introduced the zpci_set_irq() and zpci_clear_irq(), to be used while
>> resetting a zPCI device.
>>
>> Commit da995d538d3a ("s390/pci: implement reset_slot for hotplug slot"),
>> mentions zpci_clear_irq() being called in the path for zpci_hot_reset_device().
>> But that is not the case anymore and these functions are not called
>> outside of this file.
>>
>> However after a CLP disable/enable reset (zpci_hot_reset_device),
>> the airq setup of the device will need to be restored. Since we
>> are no longer calling zpci_clear_airq() in the reset path, we should
>> restore the airq for device unconditionally.
>>
>> Signed-off-by: Farhan Ali <alifm@linux.ibm.com>
>> ---
>>   arch/s390/pci/pci_irq.c | 3 +--
>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/arch/s390/pci/pci_irq.c b/arch/s390/pci/pci_irq.c
>> index 84482a921332..8b5493f0dee0 100644
>> --- a/arch/s390/pci/pci_irq.c
>> +++ b/arch/s390/pci/pci_irq.c
>> @@ -427,8 +427,7 @@ bool arch_restore_msi_irqs(struct pci_dev *pdev)
>>   {
>>   	struct zpci_dev *zdev = to_zpci(pdev);
>>   
>> -	if (!zdev->irqs_registered)
>> -		zpci_set_irq(zdev);
>> +	zpci_set_irq(zdev);
>>   	return true;
>>   }
>>   
> This would make zdev->irqs_registered effectively without function so
> the patch should remove that field from struct zpci_dev and
> zpci_set_irq()/zpci_clear_irq(). Alternatively you could also clear
> zdev->irqs_registed in zpci_disable_device(). I think the former is
> cleaner though.
>
> Thanks,
> Niklas
Yeah agreed, will remove the irqs_registered from zdev as its not needed 
anymore.

Thanks
Farhan