Skip to contentSkip to conversation

net/ibmvnic: Fix EOI when running in XIVE mode.

PATCH In review Cédric Le Goater 3 participants 3 messages Oct 11, 2019 – Oct 13, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ibmvnic: Fix EOI when running in XIVE mode.

pSeries machines on POWER9 processors can run with the XICS (legacy) interrupt mode or with the XIVE exploitation interrupt mode. These interrupt contollers have different interfaces for interrupt management : XICS uses hcalls and XIVE loads and stores on a page. H_EOI being a XICS interface the enable_scrq_irq() routine can fail when the machine runs in XIVE mode.

Fix that by calling the EOI handler of the interrupt chip.

Fixes f23e0643cd0b ("ibmvnic: Clear pending interrupt after device reset")
---
 drivers/net/ethernet/ibm/ibmvnic.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/net/ethernet/ibm/ibmvnic.c +3 -5
index 2b073a3c0b84..f59d9a8e35e2 100644
@@ -2878,12 +2878,10 @@ static int enable_scrq_irq(struct ibmvnic_adapter *adapter,
 
 	if (test_bit(0, &adapter->resetting) &&
 	    adapter->reset_reason == VNIC_RESET_MOBILITY) {
-		u64 val = (0xff000000) | scrq->hw_irq;
+		struct irq_desc *desc = irq_to_desc(scrq->irq);
+		struct irq_chip *chip = irq_desc_get_chip(desc);
 
-		rc = plpar_hcall_norets(H_EOI, val);
-		if (rc)
-			dev_err(dev, "H_EOI FAILED irq 0x%llx. rc=%ld\n",
-				val, rc);
+		chip->irq_eoi(&desc->irq_data);
 	}
 
 	rc = plpar_hcall_norets(H_VIOCTL, adapter->vdev->unit_address,
Signature · 1 line
2.21.0
#1 lore raw
Quoted 7 lines · Cédric Le Goater

pSeries machines on POWER9 processors can run with the XICS (legacy) interrupt mode or with the XIVE exploitation interrupt mode. These interrupt contollers have different interfaces for interrupt management : XICS uses hcalls and XIVE loads and stores on a page. H_EOI being a XICS interface the enable_scrq_irq() routine can fail when the machine runs in XIVE mode.

Quoted 5 lines

Fix that by calling the EOI handler of the interrupt chip.

Fixes f23e0643cd0b ("ibmvnic: Clear pending interrupt after device reset")

---

Thank you for this fix, Cedric!

Tom

Quoted 23 lines
  drivers/net/ethernet/ibm/ibmvnic.c | 8 +++-----
  1 file changed, 3 insertions(+), 5 deletions(-)
drivers/net/ethernet/ibm/ibmvnic.c +3 -5
index 2b073a3c0b84..f59d9a8e35e2 100644
@@ -2878,12 +2878,10 @@ static int enable_scrq_irq(struct ibmvnic_adapter *adapter,
 
  	if (test_bit(0, &adapter->resetting) &&
  	    adapter->reset_reason == VNIC_RESET_MOBILITY) {
-		u64 val = (0xff000000) | scrq->hw_irq;
+		struct irq_desc *desc = irq_to_desc(scrq->irq);
+		struct irq_chip *chip = irq_desc_get_chip(desc);
 
-		rc = plpar_hcall_norets(H_EOI, val);
-		if (rc)
-			dev_err(dev, "H_EOI FAILED irq 0x%llx. rc=%ld\n",
-				val, rc);
+		chip->irq_eoi(&desc->irq_data);
  	}
 
  	rc = plpar_hcall_norets(H_VIOCTL, adapter->vdev->unit_address,
maintainer
#2 lore raw
In reply to Cédric Le Goater

From: Cédric Le Goater <[email protected]>
Date: Fri, 11 Oct 2019 07:52:54 +0200

Quoted 11 lines

pSeries machines on POWER9 processors can run with the XICS (legacy) interrupt mode or with the XIVE exploitation interrupt mode. These interrupt contollers have different interfaces for interrupt management : XICS uses hcalls and XIVE loads and stores on a page. H_EOI being a XICS interface the enable_scrq_irq() routine can fail when the machine runs in XIVE mode.

Fix that by calling the EOI handler of the interrupt chip.

Fixes f23e0643cd0b ("ibmvnic: Clear pending interrupt after device reset")

Applied and queued up for -stable, thanks.