Skip to content

Commit 5d85ea2

Browse files
Vijaya Krishna Nivarthiandersson
authored andcommitted
soc: qcom: geni-se: Do not bother about enable/disable of interrupts in secondary sequencer
The select_fifo/dma_mode() functions in geni driver enable/disable interrupts (secondary included) conditionally for non-uart modes, while uart is supposed to manage this internally. However, only uart uses secondary IRQs while spi, i2c do not care about these at all making their enablement (or disablement) totally unnecessary for these protos. Similarly, select_gpi_mode() also does disable s_irq and its useless again. Drop enabling/disabling secondary IRQs. This doesn't solve any observed problem but only gets rid of code pieces that are not required. Signed-off-by: Vijaya Krishna Nivarthi <quic_vnivarth@quicinc.com> Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/1686742087-30731-1-git-send-email-quic_vnivarth@quicinc.com
1 parent 8d66f7a commit 5d85ea2

1 file changed

Lines changed: 4 additions & 24 deletions

File tree

drivers/soc/qcom/qcom-geni-se.c

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -281,27 +281,14 @@ static void geni_se_select_fifo_mode(struct geni_se *se)
281281

282282
geni_se_irq_clear(se);
283283

284-
/*
285-
* The RX path for the UART is asynchronous and so needs more
286-
* complex logic for enabling / disabling its interrupts.
287-
*
288-
* Specific notes:
289-
* - The done and TX-related interrupts are managed manually.
290-
* - We don't RX from the main sequencer (we use the secondary) so
291-
* we don't need the RX-related interrupts enabled in the main
292-
* sequencer for UART.
293-
*/
284+
/* UART driver manages enabling / disabling interrupts internally */
294285
if (proto != GENI_SE_UART) {
286+
/* Non-UART use only primary sequencer so dont bother about S_IRQ */
295287
val_old = val = readl_relaxed(se->base + SE_GENI_M_IRQ_EN);
296288
val |= M_CMD_DONE_EN | M_TX_FIFO_WATERMARK_EN;
297289
val |= M_RX_FIFO_WATERMARK_EN | M_RX_FIFO_LAST_EN;
298290
if (val != val_old)
299291
writel_relaxed(val, se->base + SE_GENI_M_IRQ_EN);
300-
301-
val_old = val = readl_relaxed(se->base + SE_GENI_S_IRQ_EN);
302-
val |= S_CMD_DONE_EN;
303-
if (val != val_old)
304-
writel_relaxed(val, se->base + SE_GENI_S_IRQ_EN);
305292
}
306293

307294
val_old = val = readl_relaxed(se->base + SE_GENI_DMA_MODE_EN);
@@ -317,17 +304,14 @@ static void geni_se_select_dma_mode(struct geni_se *se)
317304

318305
geni_se_irq_clear(se);
319306

307+
/* UART driver manages enabling / disabling interrupts internally */
320308
if (proto != GENI_SE_UART) {
309+
/* Non-UART use only primary sequencer so dont bother about S_IRQ */
321310
val_old = val = readl_relaxed(se->base + SE_GENI_M_IRQ_EN);
322311
val &= ~(M_CMD_DONE_EN | M_TX_FIFO_WATERMARK_EN);
323312
val &= ~(M_RX_FIFO_WATERMARK_EN | M_RX_FIFO_LAST_EN);
324313
if (val != val_old)
325314
writel_relaxed(val, se->base + SE_GENI_M_IRQ_EN);
326-
327-
val_old = val = readl_relaxed(se->base + SE_GENI_S_IRQ_EN);
328-
val &= ~S_CMD_DONE_EN;
329-
if (val != val_old)
330-
writel_relaxed(val, se->base + SE_GENI_S_IRQ_EN);
331315
}
332316

333317
val_old = val = readl_relaxed(se->base + SE_GENI_DMA_MODE_EN);
@@ -344,10 +328,6 @@ static void geni_se_select_gpi_mode(struct geni_se *se)
344328

345329
writel(0, se->base + SE_IRQ_EN);
346330

347-
val = readl(se->base + SE_GENI_S_IRQ_EN);
348-
val &= ~S_CMD_DONE_EN;
349-
writel(val, se->base + SE_GENI_S_IRQ_EN);
350-
351331
val = readl(se->base + SE_GENI_M_IRQ_EN);
352332
val &= ~(M_CMD_DONE_EN | M_TX_FIFO_WATERMARK_EN |
353333
M_RX_FIFO_WATERMARK_EN | M_RX_FIFO_LAST_EN);

0 commit comments

Comments
 (0)