Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3524920pxf; Mon, 15 Mar 2021 11:29:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCMhHDgKCY4N+MGqTeVRc09/BgZ1DM60qCnNEM+IGIz2e358Z1jjKxweZrqbSdGACbjyCl X-Received: by 2002:a17:906:314f:: with SMTP id e15mr24867462eje.30.1615832959836; Mon, 15 Mar 2021 11:29:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832959; cv=none; d=google.com; s=arc-20160816; b=OoWFHmlSQxa5d7/psngp+lA07VXDREttV4j4FihdERRUrGivS1MYtAK4FbqLgMTD3l mQCVaIqzwEZI7BlEPD7rM4olZz8kBCxlVUpvGNyaAiZq6mvHtk7otJGe2v01lGagqos6 XYvnvFUgRAtlxFtC8jp7b5oaW+jle/loolzbhEWq4cLRCazJHKw9c9IQDkt1HvWddge9 CpNtpd5WrqeZcjIQ9X9Ef1XYPf8oQ3yssKflhZa9U6mxHyt4+PKK8LuoqCIgbZaD0VOs fr4Qpi8xLD2BfR+BVbSJm4nxDYsdIo6bX1vEjKNmx9+ICtV37ZZVIDYfvMNMs3rNAtMR NxdQ== 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=pFLIU010kyy8n1fSgbquKB5aMFm36ILTWKJgfrliLfk=; b=OKT5tEJzojczCs7MQggxemWnGNim1Io/cyMPU+X7xg9juOEhQk2WHvIkj+Ew6bK76G l1JP9G9Xn/wyEAvFWVpDBYjH+HBqjEFvEigXxzwX+ZICWoaQsKhC88mR3kbo9ILJ/TpA mX5YG7FPE+YxNL/K39KhQGZjjPCIN7cNNGvSJxBgmdk3RBcKmRdqPNG/iiIaQf0+dsIq W+0CpZbWYLcwl8nFJNCedPMcIBmE2+bPZ2n4ygLtF3f1eedVzi/aShbLsT3Qi0z7ENet 7TzOGs67U4gbsPUMnNvpnWcX2lLWrw62Ogkl/8YzedPMHE8nylj4GTTNWmkJrHbwPcgb 0PGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eUJVBrvl; 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 a8si11438106edq.601.2021.03.15.11.28.50; Mon, 15 Mar 2021 11:29:19 -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=eUJVBrvl; 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 S235217AbhCOO34 (ORCPT + 99 others); Mon, 15 Mar 2021 10:29:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:35446 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232306AbhCON6r (ORCPT ); Mon, 15 Mar 2021 09:58:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5C94864F45; Mon, 15 Mar 2021 13:58:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816715; bh=jlVvzcmfAS3ovLC8JdqNKY6c62Pk08N4/aEfwqtaILQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eUJVBrvl/gMuC7gpw/0Bu4O/eT15BaJBaZWApzkGRm0srK3WHBXsZQrNPb1Zmfgvp /AdfSrdUJVt8HFgKrP353M4blG9qosRTLLAf0KS9+Pw6L0XlVSjYsetSLhypsi1VyA 8UO6MTkybPTfHkxj/n7pTZ0/lXRj0421WFVI/OqY= 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.11 081/306] net: stmmac: fix watchdog timeout during suspend/resume stress test Date: Mon, 15 Mar 2021 14:52:24 +0100 Message-Id: <20210315135510.381953478@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@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 @@ -5260,6 +5260,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)); } }