Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3510685pxf; Mon, 15 Mar 2021 11:08:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxF9BcOltuIXTxA2FXPqWXdsbpCooxT/P2BwMTN+Fstt5mR5MvczVSljTi9mwMvkP0QMQ6O X-Received: by 2002:a17:906:a896:: with SMTP id ha22mr24763974ejb.503.1615831719846; Mon, 15 Mar 2021 11:08:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615831719; cv=none; d=google.com; s=arc-20160816; b=Mt6RHADffAW2+X0Sfq+WUYKh5EaOaH0LSH6Ar4QlD+yoLRiboPNPu5f9ce/380shof frmVSONPQnkr2WAhe6vKQJmWBZM2GbMKhlvlTiZE2T7jdyiAxjUlxTZ3RaVzNyOuPzCY vwYFN/zJF4XoOfu27SA8/5B326CyTivZOdxHAsZr6h2XWKZBZWNtkRVniKWcseTBQYBA bT2OUPl74VW7eceFRapniG3yxjJqGGF0reAHm+ByAWFJZjEvQ5oXxlFVZPhdgrM8n88R j10ZKj9yqOCWCGFJMm9FxvAREnHCmGdJjOW4tIbXrudZHmFq+e/PC8vKizpsUem2D0HO 4bOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nbjyxRfFr4EqtlOVzSBvo4m2xpw8SRmEts11myQFyz8=; b=yu+2/NpW1dii+cdccF8qeUb8/yLIsnx3WW4xUyTzE0Mtkhbh+9wEmmx+tw2xk668zM COIhm8+xT/agCTfWDstE7DradFdUrceLwa+5aQ+kMDxfw2MECEI50ZceEoGNC7JQU04G +lEUkJ8dpRLRvDjH9tKLSUzvmZYE13OUdjcUBJqMn79FmdQTnPw1B2/hCmx7UZ1tWOD9 Le7a09UQ8mFvNmPRw4oBs5lTzUpGSAroXx0yE5bLFXkL15F3voh5ncd0Qj0a+KIT3/u6 pNh/wiVL6DwhsQCCgiyg0rF3U8P6Kjm+6AOmDVCF+l3npWEJalFIbndDFCWSGwlSjdIa 4ufA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FMRX9W1A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ss27si11698919ejb.322.2021.03.15.11.08.17; Mon, 15 Mar 2021 11:08:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FMRX9W1A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235650AbhCOOI6 (ORCPT + 99 others); Mon, 15 Mar 2021 10:08:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:35420 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231799AbhCON6D (ORCPT ); Mon, 15 Mar 2021 09:58:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E5D3B64DAD; Mon, 15 Mar 2021 13:57:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816675; bh=/TT4ZtC6WVwHgJT5wp/OGelqGAh0flI3OPoJ157+y8Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FMRX9W1AQiHzi/6JGg+48DflPsew0vcdNB4hTx4dxfagdF0yxFgCTNX/EYbHX26mw 5+2pjcqUX1Av3RQmsVV3sd2YMuR9Q8X3MCxUvkiD9C9CHCKoi7X56cAOS5G+kPO9Mv 28i0IebuSiY0/HOL/2EoVWTGoEMVlnmIpLXc5Uww= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joakim Zhang , Jakub Kicinski Subject: [PATCH 5.4 040/168] net: stmmac: fix watchdog timeout during suspend/resume stress test Date: Mon, 15 Mar 2021 14:54:32 +0100 Message-Id: <20210315135551.669076212@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135550.333963635@linuxfoundation.org> References: <20210315135550.333963635@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Joakim Zhang commit c511819d138de38e1637eedb645c207e09680d0f upstream. stmmac_xmit() call stmmac_tx_timer_arm() at the end to modify tx timer to do the transmission cleanup work. Imagine such a situation, stmmac enters suspend immediately after tx timer modified, it's expire callback stmmac_tx_clean() would not be invoked. This could affect BQL, since netdev_tx_sent_queue() has been called, but netdev_tx_completed_queue() have not been involved, as a result, dql_avail(&dev_queue->dql) finally always return a negative value. __dev_queue_xmit->__dev_xmit_skb->qdisc_run->__qdisc_run->qdisc_restart->dequeue_skb: if ((q->flags & TCQ_F_ONETXQUEUE) && netif_xmit_frozen_or_stopped(txq)) // __QUEUE_STATE_STACK_XOFF is set Net core will stop transmitting any more. Finillay, net watchdong would timeout. To fix this issue, we should call netdev_tx_reset_queue() in stmmac_resume(). Fixes: 54139cf3bb33 ("net: stmmac: adding multiple buffers for rx") Signed-off-by: Joakim Zhang Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -4821,6 +4821,8 @@ static void stmmac_reset_queues_param(st tx_q->cur_tx = 0; tx_q->dirty_tx = 0; tx_q->mss = 0; + + netdev_tx_reset_queue(netdev_get_tx_queue(priv->dev, queue)); } }