Skip to content

Commit

Permalink
net: ipa: move version test inside ipa_endpoint_program_delay()
Browse files Browse the repository at this point in the history
IPA version 4.2 has a hardware quirk that affects endpoint delay
mode, so it isn't used there.  Isolate the test that avoids using
delay mode for that version inside ipa_endpoint_program_delay(),
rather than making that check in the caller.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Alex Elder authored and David S. Miller committed Jul 2, 2020
1 parent 4e1a691 commit 66eba76
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/net/ipa/ipa_endpoint.c
Original file line number Diff line number Diff line change
@@ -318,7 +318,9 @@ ipa_endpoint_program_delay(struct ipa_endpoint *endpoint, bool enable)
{
/* assert(endpoint->toward_ipa); */

(void)ipa_endpoint_init_ctrl(endpoint, enable);
/* Delay mode doesn't work properly for IPA v4.2 */
if (endpoint->ipa->version != IPA_VERSION_4_2)
(void)ipa_endpoint_init_ctrl(endpoint, enable);
}

/* Returns previous suspend state (true means it was enabled) */
@@ -1294,8 +1296,7 @@ static void ipa_endpoint_reset(struct ipa_endpoint *endpoint)
static void ipa_endpoint_program(struct ipa_endpoint *endpoint)
{
if (endpoint->toward_ipa) {
if (endpoint->ipa->version != IPA_VERSION_4_2)
ipa_endpoint_program_delay(endpoint, false);
ipa_endpoint_program_delay(endpoint, false);
ipa_endpoint_init_hdr_ext(endpoint);
ipa_endpoint_init_aggr(endpoint);
ipa_endpoint_init_deaggr(endpoint);

0 comments on commit 66eba76

Please sign in to comment.