From 62d7a00fdcdd14599719fc70fa56f8513d0c2ed6 Mon Sep 17 00:00:00 2001 From: Russ Meyerriecks Date: Thu, 16 Apr 2015 12:08:25 -0500 Subject: [PATCH] wctc4xxp: Fix continuous "errored receive packets" with 2+ transcoders In the case where two transcoders are loaded in a system and one transcoder experiences an errored receive packet condition, the logic would ping pong the error between the two cards, causing a runaway stream of errors in the kernel log. This fix moves the global error count var into the wcdte struct to allow for per-card logic. Signed-off-by: Russ Meyerriecks Acked-by: Shaun Ruffell (cherry picked from commit 4df03284a89abae9e03445f7ec0081992b57e453) --- drivers/dahdi/wctc4xxp/base.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/dahdi/wctc4xxp/base.c b/drivers/dahdi/wctc4xxp/base.c index 02ea625..20a03f3 100644 --- a/drivers/dahdi/wctc4xxp/base.c +++ b/drivers/dahdi/wctc4xxp/base.c @@ -375,6 +375,7 @@ struct wcdte { #endif struct timer_list watchdog; u16 open_channels; + unsigned long packet_errors; }; struct wcdte_netdev_priv { @@ -2019,14 +2020,16 @@ wctc4xxp_disable_polling(struct wcdte *wc) static void wctc4xxp_check_for_rx_errors(struct wcdte *wc) { - static unsigned long last_errors = 0; + /* get_packet_errors() returns the accumulated total errors */ unsigned long errors = wctc4xxp_get_packet_errors(wc->rxd); - if (last_errors != errors) { + + /* Print warning when the number of errors changes */ + if (wc->packet_errors != errors) { if (printk_ratelimit()) { dev_err(&wc->pdev->dev, "%lu errored receive packets.\n", - errors - last_errors); - last_errors = errors; + errors - wc->packet_errors); + wc->packet_errors = errors; } } }