From 7168b87cb593ebc3025042297c7019402279963a Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Fri, 2 May 2014 11:04:48 -0500 Subject: [PATCH] wctc4xxp: Always ack a response packet. Even if it is duplicated or we don't have an outbound message waiting, we should ack it so that the firmware does not keep trying to send it to the host. Otherwise the firmware could get into situations where it was constantly retrying to send packets for which it did not receive our previous ACK and exhaust memory. I was only seeing this on platforms were packets were going missing in the stream, increasing the probability that the driver would miss early responses. Signed-off-by: Shaun Ruffell Signed-off-by: Russ Meyerriecks --- drivers/dahdi/wctc4xxp/base.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/dahdi/wctc4xxp/base.c b/drivers/dahdi/wctc4xxp/base.c index d498089..0b38a37 100644 --- a/drivers/dahdi/wctc4xxp/base.c +++ b/drivers/dahdi/wctc4xxp/base.c @@ -2217,7 +2217,7 @@ wctc4xxp_send_ack(struct wcdte *wc, u8 seqno, __be16 channel) wctc4xxp_transmit_cmd(wc, cmd); } -static bool do_rx_response_packet(struct wcdte *wc, struct tcb *cmd) +static void do_rx_response_packet(struct wcdte *wc, struct tcb *cmd) { const struct csm_encaps_hdr *listhdr, *rxhdr; struct tcb *pos, *temp; @@ -2228,7 +2228,7 @@ static bool do_rx_response_packet(struct wcdte *wc, struct tcb *cmd) /* We received a duplicate response. */ if (rxhdr->seq_num == wc->last_rx_seq_num) { free_cmd(cmd); - return false; + return; } wc->last_rx_seq_num = rxhdr->seq_num; } @@ -2261,10 +2261,7 @@ static bool do_rx_response_packet(struct wcdte *wc, struct tcb *cmd) "Freeing unhandled response ch:(%04x)\n", be16_to_cpu(rxhdr->channel)); free_cmd(cmd); - return false; } - - return true; } static void @@ -2363,7 +2360,8 @@ receive_csm_encaps_packet(struct wcdte *wc, struct tcb *cmd) u8 seq_num = hdr->seq_num; __be16 channel = hdr->channel; - if (do_rx_response_packet(wc, cmd) && !suppress_ack) + do_rx_response_packet(wc, cmd); + if (!suppress_ack) wctc4xxp_send_ack(wc, seq_num, channel); } else if (0xc1 == hdr->type) {