net: ipa: get rid of workaround in ipa_endpoint_stop()

In ipa_endpoint_stop(), a workaround is used for IPA version 3.5.1
where a 1-byte DMA request is issued between GSI channel stop
retries.

It turns out that this workaround is only required for IPA versions
3.1 and 3.2, and we don't support those.  So remove the call to
ipa_endpoint_stop_rx_dma() in that function.  That leaves that
function unused, so get rid of it.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Alex Elder 2020-05-04 18:53:42 -05:00 коммит произвёл David S. Miller
Родитель 97e4692dda
Коммит c72ddf0dbf
1 изменённых файлов: 1 добавлений и 38 удалений

Просмотреть файл

@ -33,13 +33,10 @@
#define IPA_RX_BUFFER_OVERHEAD (PAGE_SIZE - SKB_MAX_ORDER(NET_SKB_PAD, 0)) #define IPA_RX_BUFFER_OVERHEAD (PAGE_SIZE - SKB_MAX_ORDER(NET_SKB_PAD, 0))
#define IPA_ENDPOINT_STOP_RX_RETRIES 10 #define IPA_ENDPOINT_STOP_RX_RETRIES 10
#define IPA_ENDPOINT_STOP_RX_SIZE 1 /* bytes */
#define IPA_ENDPOINT_RESET_AGGR_RETRY_MAX 3 #define IPA_ENDPOINT_RESET_AGGR_RETRY_MAX 3
#define IPA_AGGR_TIME_LIMIT_DEFAULT 1000 /* microseconds */ #define IPA_AGGR_TIME_LIMIT_DEFAULT 1000 /* microseconds */
#define ENDPOINT_STOP_DMA_TIMEOUT 15 /* milliseconds */
/** enum ipa_status_opcode - status element opcode hardware values */ /** enum ipa_status_opcode - status element opcode hardware values */
enum ipa_status_opcode { enum ipa_status_opcode {
IPA_STATUS_OPCODE_PACKET = 0x01, IPA_STATUS_OPCODE_PACKET = 0x01,
@ -1274,32 +1271,6 @@ static void ipa_endpoint_reset(struct ipa_endpoint *endpoint)
ret, endpoint->channel_id, endpoint->endpoint_id); ret, endpoint->channel_id, endpoint->endpoint_id);
} }
static int ipa_endpoint_stop_rx_dma(struct ipa *ipa)
{
u16 size = IPA_ENDPOINT_STOP_RX_SIZE;
struct gsi_trans *trans;
dma_addr_t addr;
int ret;
trans = ipa_cmd_trans_alloc(ipa, 1);
if (!trans) {
dev_err(&ipa->pdev->dev,
"no transaction for RX endpoint STOP workaround\n");
return -EBUSY;
}
/* Read into the highest part of the zero memory area */
addr = ipa->zero_addr + ipa->zero_size - size;
ipa_cmd_dma_task_32b_addr_add(trans, size, addr, false);
ret = gsi_trans_commit_wait_timeout(trans, ENDPOINT_STOP_DMA_TIMEOUT);
if (ret)
gsi_trans_free(trans);
return ret;
}
/** /**
* ipa_endpoint_stop() - Stops a GSI channel in IPA * ipa_endpoint_stop() - Stops a GSI channel in IPA
* @client: Client whose endpoint should be stopped * @client: Client whose endpoint should be stopped
@ -1315,20 +1286,12 @@ int ipa_endpoint_stop(struct ipa_endpoint *endpoint)
int ret; int ret;
do { do {
struct ipa *ipa = endpoint->ipa; struct gsi *gsi = &endpoint->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 || endpoint->toward_ipa) if (ret != -EAGAIN || endpoint->toward_ipa)
break; break;
/* For IPA v3.5.1, send a DMA read task and check again */
if (ipa->version == IPA_VERSION_3_5_1) {
ret = ipa_endpoint_stop_rx_dma(ipa);
if (ret)
break;
}
msleep(1); msleep(1);
} while (retries--); } while (retries--);