Skip to contentSkip to conversation

PCI/DPC: Fix PCI legacy interrupt acknowledgement

PATCH In review Oza Pawandeep 2 participants 5 messages Mar 14, 2018 – Mar 28, 2018 PCI

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 PCI/DPC: Fix PCI legacy interrupt acknowledgement

Current DPC driver acknowledges the interrupt in deferred work, which works since MSI are edge triggered.

But when MSI is disabled (e.g. pci=nomsi boot option) port service driver falls back to PCI legacy INT interrupt.

With current code we do not acknowledge the interrupt back in dpc_irq() and we get dpc interrupt storm.

This patch acknowledges the interrupt in interrupt handler.

drivers/pci/pcie/pcie-dpc.c +4 -1
index 38e40c6..9c05120 100644
@@ -112,7 +112,7 @@ static void dpc_work(struct work_struct *work)
 	}
 
 	pci_write_config_word(pdev, cap + PCI_EXP_DPC_STATUS,
-		PCI_EXP_DPC_STATUS_TRIGGER | PCI_EXP_DPC_STATUS_INTERRUPT);
+			      PCI_EXP_DPC_STATUS_TRIGGER);
 
 	pci_read_config_word(pdev, cap + PCI_EXP_DPC_CTL, &ctl);
 	pci_write_config_word(pdev, cap + PCI_EXP_DPC_CTL,
@@ -222,6 +222,9 @@ static irqreturn_t dpc_irq(int irq, void *context)
 	if (dpc->rp_extensions && reason == 3 && ext_reason == 0)
 		dpc_process_rp_pio_error(dpc);
 
+	pci_write_config_word(pdev, cap + PCI_EXP_DPC_STATUS,
+			      PCI_EXP_DPC_STATUS_INTERRUPT);
+
 	schedule_work(&dpc->work);
 
 	return IRQ_HANDLED;
Signature · 2 lines
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.,
a Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.
Reviewed-by on v2 1/1
#1 lore raw
Quoted 6 lines · Oza Pawandeep

Current DPC driver acknowledges the interrupt in deferred work, which works since MSI are edge triggered.

But when MSI is disabled (e.g. pci=nomsi boot option) port service driver falls back to PCI legacy INT interrupt.

Quoted 6 lines

With current code we do not acknowledge the interrupt back in dpc_irq() and we get dpc interrupt storm.

This patch acknowledges the interrupt in interrupt handler.

Thanks, this looks good to me.

Reviewed-by Keith Busch <keith
#3 lore raw
Quoted 7 lines · Keith Busch
Quoted 2 lines · Keith Busch
Reviewed-by Keith Busch <keith

Whoops, I accidentally truncated my message. My correct tag:

Hi Bjorn,

Can this be merged ?

Regards,
Oza.

#4 lore raw
In reply to Keith Busch
Quoted 10 lines · Keith Busch
Quoted 9 lines · Oza Pawandeep

Current DPC driver acknowledges the interrupt in deferred work, which works since MSI are edge triggered.

But when MSI is disabled (e.g. pci=nomsi boot option) port service driver falls back to PCI legacy INT interrupt.

With current code we do not acknowledge the interrupt back in dpc_irq() and we get dpc interrupt storm.

Quoted 7 lines
Quoted 3 lines

This patch acknowledges the interrupt in interrupt handler.

Thanks, this looks good to me.

Reviewed-by Keith Busch <keith

checkpatch script shows
WARNING: 'acknowledgement' may be misspelled - perhaps 'acknowledgment'?

but dictionaries shows acknowledgement.

Regards,
Oza.