Skip to content

Commit b45873c

Browse files
Farhan Alihcahca
authored andcommitted
s390/pci: Restore IRQ unconditionally for the zPCI device
Commit c1e18c1 ("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 da995d5 ("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. Instead zpci_hot_reset_device() relies on zpci_disable_device() also clearing the IRQs, but misses to reset the zdev->irqs_registered flag. However after a CLP disable/enable reset, the device's IRQ are unregistered, but the flag zdev->irq_registered does not get cleared. It creates an inconsistent state and so arch_restore_msi_irqs() doesn't correctly restore the device's IRQ. This becomes a problem when a PCI driver tries to restore the state of the device through pci_restore_state(). Restore IRQ unconditionally for the device and remove the irq_registered flag as its redundant. Fixes: c1e18c1 ("s390/pci: add zpci_set_irq()/zpci_clear_irq()") Cc: [email protected] Reviewed-by: Niklas Schnelle <[email protected]> Reviewed-by: Matthew Rosato <[email protected]> Signed-off-by: Farhan Ali <[email protected]> Signed-off-by: Heiko Carstens <[email protected]>
1 parent 840bc67 commit b45873c

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

arch/s390/include/asm/pci.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ struct zpci_dev {
145145
u8 has_resources : 1;
146146
u8 is_physfn : 1;
147147
u8 util_str_avail : 1;
148-
u8 irqs_registered : 1;
149148
u8 tid_avail : 1;
150149
u8 rtr_avail : 1; /* Relaxed translation allowed */
151150
unsigned int devfn; /* DEVFN part of the RID*/

arch/s390/pci/pci_irq.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ static int zpci_set_irq(struct zpci_dev *zdev)
107107
else
108108
rc = zpci_set_airq(zdev);
109109

110-
if (!rc)
111-
zdev->irqs_registered = 1;
112-
113110
return rc;
114111
}
115112

@@ -123,9 +120,6 @@ static int zpci_clear_irq(struct zpci_dev *zdev)
123120
else
124121
rc = zpci_clear_airq(zdev);
125122

126-
if (!rc)
127-
zdev->irqs_registered = 0;
128-
129123
return rc;
130124
}
131125

@@ -427,8 +421,7 @@ bool arch_restore_msi_irqs(struct pci_dev *pdev)
427421
{
428422
struct zpci_dev *zdev = to_zpci(pdev);
429423

430-
if (!zdev->irqs_registered)
431-
zpci_set_irq(zdev);
424+
zpci_set_irq(zdev);
432425
return true;
433426
}
434427

0 commit comments

Comments
 (0)