From bf800022b2529e50ac28efcefebe629edd519e89 Mon Sep 17 00:00:00 2001 From: Masafumi UTSUGI Date: Tue, 1 Oct 2019 18:59:18 +0900 Subject: ipq40xx: essedma: Fix dead lock edma_read_append_stats() gets called from two places in the driver. The first place is the kernel timer that periodically updates the statistics, so nothing gets lost due to overflows. The second one it's part of the userspace ethtool ioctl handler to provide up-to-date values. For this configuration, the use of spin_lock() is not sufficient and as per: the locking has to be upgraded to spin_lock_bh(). Signed-off-by: Masafumi UTSUGI [folded patch into 710-, rewrote message] Signed-off-by: Christian Lamparter (cherry picked from commit f1d761f95e9664a9c11ce1b98f9e121b43c79d35) --- .../patches-4.14/710-net-add-qualcomm-essedma-ethernet-driver.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/ipq40xx/patches-4.14/710-net-add-qualcomm-essedma-ethernet-driver.patch b/target/linux/ipq40xx/patches-4.14/710-net-add-qualcomm-essedma-ethernet-driver.patch index e304911f1d..1e47f2fe90 100644 --- a/target/linux/ipq40xx/patches-4.14/710-net-add-qualcomm-essedma-ethernet-driver.patch +++ b/target/linux/ipq40xx/patches-4.14/710-net-add-qualcomm-essedma-ethernet-driver.patch @@ -2775,7 +2775,7 @@ Signed-off-by: Christian Lamparter + int i; + u32 stat; + -+ spin_lock(&edma_cinfo->stats_lock); ++ spin_lock_bh(&edma_cinfo->stats_lock); + p = (uint32_t *)&(edma_cinfo->edma_ethstats); + + for (i = 0; i < EDMA_MAX_TRANSMIT_QUEUE; i++) { @@ -2802,7 +2802,7 @@ Signed-off-by: Christian Lamparter + p++; + } + -+ spin_unlock(&edma_cinfo->stats_lock); ++ spin_unlock_bh(&edma_cinfo->stats_lock); +} + +static void edma_statistics_timer(unsigned long data) -- cgit v1.2.3