From 3aa074f33878408db927bda4d366ff30034ca822 Mon Sep 17 00:00:00 2001 From: Houston Hoffman Date: Wed, 23 Nov 2016 11:53:25 -0800 Subject: [PATCH] qcacmn: override irq disable/enable for msi mode irq_enable/disable may be different for legacy srng and msi vs single line interrupts. Provide a place to insert the interrupt mitigation scheeme. Change-Id: I66559a404b0c2105da143215203c04f2311a763a CRs-Fixed: 1093364 --- hif/src/pcie/if_pci.c | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/hif/src/pcie/if_pci.c b/hif/src/pcie/if_pci.c index 489442a6ea..b714454c1f 100644 --- a/hif/src/pcie/if_pci.c +++ b/hif/src/pcie/if_pci.c @@ -3551,7 +3551,27 @@ irqreturn_t hif_ce_interrupt_handler(int irq, void *context) } extern const char *ce_name[]; -static int hif_ce_srng_msi_request_irq(struct hif_softc *scn) +/* hif_srng_msi_irq_disable() - disable the irq for msi + * @hif_sc: hif context + * @ce_id: which ce to disable copy complete interrupts for + * + * since MSI interrupts are not level based, the system can function + * without disabling these interrupts. Interrupt mitigation can be + * added here for better system performance. + */ +static void hif_ce_srng_msi_irq_disable(struct hif_softc *hif_sc, int ce_id) +{} + +static void hif_ce_srng_msi_irq_enable(struct hif_softc *hif_sc, int ce_id) +{} + +static void hif_ce_legacy_msi_irq_disable(struct hif_softc *hif_sc, int ce_id) +{} + +static void hif_ce_legacy_msi_irq_enable(struct hif_softc *hif_sc, int ce_id) +{} + +static int hif_ce_msi_configure_irq(struct hif_softc *scn) { int ret; int ce_id, irq; @@ -3586,6 +3606,20 @@ static int hif_ce_srng_msi_request_irq(struct hif_softc *scn) goto free_irq; } + if (ce_srng_based(scn)) { + scn->bus_ops.hif_irq_disable = + &hif_ce_srng_msi_irq_disable; + scn->bus_ops.hif_irq_enable = + &hif_ce_srng_msi_irq_enable; + } else { + scn->bus_ops.hif_irq_disable = + &hif_ce_legacy_msi_irq_disable; + scn->bus_ops.hif_irq_enable = + &hif_ce_legacy_msi_irq_enable; + } + + + return ret; free_irq: @@ -3601,6 +3635,7 @@ free_irq: return ret; } + /** * hif_configure_irq() - configure interrupt * @@ -3620,7 +3655,7 @@ int hif_configure_irq(struct hif_softc *scn) hif_init_reschedule_tasklet_work(sc); - ret = hif_ce_srng_msi_request_irq(scn); + ret = hif_ce_msi_configure_irq(scn); if (ret == 0) { goto end; }