Thread (48 messages) flat view 48 messages, 3 authors, 2021-10-18

Re: [RFC PATCH 08/17] net: ipa: Add support for IPA v2.x interrupts

From: Alex Elder <hidden>
Date: 2021-10-13 22:30:13
Also in: linux-arm-msm, lkml, phone-devel

On 9/19/21 10:08 PM, Sireesh Kodali wrote:
From: Vladimir Lypak <redacted>

Interrupts on IPA v2.x have different numbers from the v3.x and above
interrupts. IPA v2.x also doesn't support the TX_SUSPEND irq, like v3.0
I'm not sure I like this way of fixing the interrupt ids (by
adding an offset), but it's a simple change.  (And now I have
a better understanding for why the "fixup" function exists).

					-Alex
quoted hunk ↗ jump to hunk
Signed-off-by: Vladimir Lypak <redacted>
Signed-off-by: Sireesh Kodali <redacted>
---
  drivers/net/ipa/ipa_interrupt.c | 11 ++++++++---
  1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ipa/ipa_interrupt.c b/drivers/net/ipa/ipa_interrupt.c
index 94708a23a597..37b5932253aa 100644
--- a/drivers/net/ipa/ipa_interrupt.c
+++ b/drivers/net/ipa/ipa_interrupt.c
@@ -63,6 +63,11 @@ static bool ipa_interrupt_check_fixup(enum ipa_irq_id *irq_id, enum ipa_version
  
  	if (*irq_id >= IPA_IRQ_DRBIP_PKT_EXCEED_MAX_SIZE_EN)
  		return version >= IPA_VERSION_4_9;
+	else if (*irq_id > IPA_IRQ_BAM_GSI_IDLE)
+		return version >= IPA_VERSION_3_0;
+	else if (version <= IPA_VERSION_2_6L &&
+			*irq_id >= IPA_IRQ_PROC_UC_ACK_Q_NOT_EMPTY)
+		*irq_id += 2;
  
  	return true;
  }
@@ -152,8 +157,8 @@ static void ipa_interrupt_suspend_control(struct ipa_interrupt *interrupt,
  
  	WARN_ON(!(mask & ipa->available));
  
-	/* IPA version 3.0 does not support TX_SUSPEND interrupt control */
-	if (ipa->version == IPA_VERSION_3_0)
+	/* IPA version <=3.0 does not support TX_SUSPEND interrupt control */
+	if (ipa->version <= IPA_VERSION_3_0)
  		return;
  
  	offset = ipa_reg_irq_suspend_en_offset(ipa->version);
@@ -190,7 +195,7 @@ void ipa_interrupt_suspend_clear_all(struct ipa_interrupt *interrupt)
  	val = ioread32(ipa->reg_virt + offset);
  
  	/* SUSPEND interrupt status isn't cleared on IPA version 3.0 */
-	if (ipa->version == IPA_VERSION_3_0)
+	if (ipa->version <= IPA_VERSION_3_0)
  		return;
  
  	offset = ipa_reg_irq_suspend_clr_offset(ipa->version);
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help