Skip to content

Commit

Permalink
net: ipa: ignore CHANNEL_NOT_RUNNING errors
Browse files Browse the repository at this point in the history
IPA v4.2 has a hardware quirk that requires the AP to allocate GSI
channels for the modem to use.  It is recommended that these modem
channels get stopped (with a HALT generic command) by the AP when
its IPA driver gets removed.

The AP has no way of knowing the current state of a modem channel.
So when the IPA driver issues a HALT command it's possible the
channel is not running, and in that case we get an error indication.
This error simply means we didn't need to stop the channel, so we
can ignore it.

This patch adds an explanation for this situation, and arranges for
this condition to *not* report an error message.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Alex Elder authored and Jakub Kicinski committed Nov 21, 2020
1 parent 5d28913 commit f849afc
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion drivers/net/ipa/gsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1087,10 +1087,32 @@ static void gsi_isr_gp_int1(struct gsi *gsi)
u32 result;
u32 val;

/* This interrupt is used to handle completions of the two GENERIC
* GSI commands. We use these to allocate and halt channels on
* the modem's behalf due to a hardware quirk on IPA v4.2. Once
* allocated, the modem "owns" these channels, and as a result we
* have no way of knowing the channel's state at any given time.
*
* It is recommended that we halt the modem channels we allocated
* when shutting down, but it's possible the channel isn't running
* at the time we issue the HALT command. We'll get an error in
* that case, but it's harmless (the channel is already halted).
*
* For this reason, we silently ignore a CHANNEL_NOT_RUNNING error
* if we receive it.
*/
val = ioread32(gsi->virt + GSI_CNTXT_SCRATCH_0_OFFSET);
result = u32_get_bits(val, GENERIC_EE_RESULT_FMASK);
if (result != GENERIC_EE_SUCCESS)

switch (result) {
case GENERIC_EE_SUCCESS:
case GENERIC_EE_CHANNEL_NOT_RUNNING:
break;

default:
dev_err(gsi->dev, "global INT1 generic result %u\n", result);
break;
}

complete(&gsi->completion);
}
Expand Down

0 comments on commit f849afc

Please sign in to comment.