Commit c778980a authored by David S. Miller's avatar David S. Miller

Merge branch 'net-ipa-three-bug-fixes'

Alex Elder says:

====================
net: ipa: three bug fixes

This series fixes three bugs in the Qualcomm IPA code.  The third
adds a missing error code initialization step.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents de04604e 0b1ba18a
...@@ -1041,6 +1041,7 @@ static void gsi_isr_gp_int1(struct gsi *gsi) ...@@ -1041,6 +1041,7 @@ static void gsi_isr_gp_int1(struct gsi *gsi)
complete(&gsi->completion); complete(&gsi->completion);
} }
/* Inter-EE interrupt handler */ /* Inter-EE interrupt handler */
static void gsi_isr_glob_ee(struct gsi *gsi) static void gsi_isr_glob_ee(struct gsi *gsi)
{ {
...@@ -1493,6 +1494,12 @@ static int gsi_generic_command(struct gsi *gsi, u32 channel_id, ...@@ -1493,6 +1494,12 @@ static int gsi_generic_command(struct gsi *gsi, u32 channel_id,
struct completion *completion = &gsi->completion; struct completion *completion = &gsi->completion;
u32 val; u32 val;
/* First zero the result code field */
val = ioread32(gsi->virt + GSI_CNTXT_SCRATCH_0_OFFSET);
val &= ~GENERIC_EE_RESULT_FMASK;
iowrite32(val, gsi->virt + GSI_CNTXT_SCRATCH_0_OFFSET);
/* Now issue the command */
val = u32_encode_bits(opcode, GENERIC_OPCODE_FMASK); val = u32_encode_bits(opcode, GENERIC_OPCODE_FMASK);
val |= u32_encode_bits(channel_id, GENERIC_CHID_FMASK); val |= u32_encode_bits(channel_id, GENERIC_CHID_FMASK);
val |= u32_encode_bits(GSI_EE_MODEM, GENERIC_EE_FMASK); val |= u32_encode_bits(GSI_EE_MODEM, GENERIC_EE_FMASK);
...@@ -1798,9 +1805,9 @@ static int gsi_channel_init_one(struct gsi *gsi, ...@@ -1798,9 +1805,9 @@ static int gsi_channel_init_one(struct gsi *gsi,
/* Worst case we need an event for every outstanding TRE */ /* Worst case we need an event for every outstanding TRE */
if (data->channel.tre_count > data->channel.event_count) { if (data->channel.tre_count > data->channel.event_count) {
dev_warn(gsi->dev, "channel %u limited to %u TREs\n",
data->channel_id, data->channel.tre_count);
tre_count = data->channel.event_count; tre_count = data->channel.event_count;
dev_warn(gsi->dev, "channel %u limited to %u TREs\n",
data->channel_id, tre_count);
} else { } else {
tre_count = data->channel.tre_count; tre_count = data->channel.tre_count;
} }
......
...@@ -410,6 +410,8 @@ ...@@ -410,6 +410,8 @@
#define INTER_EE_RESULT_FMASK GENMASK(2, 0) #define INTER_EE_RESULT_FMASK GENMASK(2, 0)
#define GENERIC_EE_RESULT_FMASK GENMASK(7, 5) #define GENERIC_EE_RESULT_FMASK GENMASK(7, 5)
#define GENERIC_EE_SUCCESS_FVAL 1 #define GENERIC_EE_SUCCESS_FVAL 1
#define GENERIC_EE_INCORRECT_DIRECTION_FVAL 3
#define GENERIC_EE_INCORRECT_CHANNEL_FVAL 5
#define GENERIC_EE_NO_RESOURCES_FVAL 7 #define GENERIC_EE_NO_RESOURCES_FVAL 7
#define USB_MAX_PACKET_FMASK GENMASK(15, 15) /* 0: HS; 1: SS */ #define USB_MAX_PACKET_FMASK GENMASK(15, 15) /* 0: HS; 1: SS */
#define MHI_BASE_CHANNEL_FMASK GENMASK(31, 24) #define MHI_BASE_CHANNEL_FMASK GENMASK(31, 24)
......
...@@ -1283,7 +1283,7 @@ static int ipa_endpoint_stop_rx_dma(struct ipa *ipa) ...@@ -1283,7 +1283,7 @@ static int ipa_endpoint_stop_rx_dma(struct ipa *ipa)
*/ */
int ipa_endpoint_stop(struct ipa_endpoint *endpoint) int ipa_endpoint_stop(struct ipa_endpoint *endpoint)
{ {
u32 retries = endpoint->toward_ipa ? 0 : IPA_ENDPOINT_STOP_RX_RETRIES; u32 retries = IPA_ENDPOINT_STOP_RX_RETRIES;
int ret; int ret;
do { do {
...@@ -1291,12 +1291,9 @@ int ipa_endpoint_stop(struct ipa_endpoint *endpoint) ...@@ -1291,12 +1291,9 @@ int ipa_endpoint_stop(struct ipa_endpoint *endpoint)
struct gsi *gsi = &ipa->gsi; struct gsi *gsi = &ipa->gsi;
ret = gsi_channel_stop(gsi, endpoint->channel_id); ret = gsi_channel_stop(gsi, endpoint->channel_id);
if (ret != -EAGAIN) if (ret != -EAGAIN || endpoint->toward_ipa)
break; break;
if (endpoint->toward_ipa)
continue;
/* For IPA v3.5.1, send a DMA read task and check again */ /* For IPA v3.5.1, send a DMA read task and check again */
if (ipa->version == IPA_VERSION_3_5_1) { if (ipa->version == IPA_VERSION_3_5_1) {
ret = ipa_endpoint_stop_rx_dma(ipa); ret = ipa_endpoint_stop_rx_dma(ipa);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment