Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3514810pxf; Mon, 15 Mar 2021 11:14:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxudgkt64Vy2voI18PTQb56Ml2m6oBfomUgyUUMRPYlEWMXRl7ygzqxgDziGAPS/E944bT X-Received: by 2002:a17:906:8614:: with SMTP id o20mr24431192ejx.386.1615832071606; Mon, 15 Mar 2021 11:14:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832071; cv=none; d=google.com; s=arc-20160816; b=Og0n4L0HgxxA9Qs7iVcWz3JTI2KyJQ1odT61NJ+49iiSpatzRE7q/R8EdkMMx31sk+ aYY1WQpPcLpy3igETKxSuBZDUK6XDoHObOP5woffxsLUQHN0rBx6BWfGYJuJ9E3wd5ML ir8QAA+DQWFO7AbUEnd5h+FcWqwWrMs73164H15Nw4ZyZwjauGL6Ji3hZJBpZLqdlcAE 4MdD2kQn0k4GeSf3lr2y/JxSDSv1rrLXZF+K9nRhFrwpG3RvoqO3ZRt+P3hg7wJaOnJ3 eKUvXnsBZvit/CZhVB0xgls5GDlVXvqCPvsAQ7Py8vkuVGtYIh1gs6lgDw2le4pM+NpF hR2Q== 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=FnzYUxRoSdfxW1zzxftbHlHY/genUUwJfTTR3quCyII=; b=IN/K5MC3ErgSlWy2ShGRS1T47uifKDKvgKud9gUtrnLiRsJImoid1cxiTqxD/q9HFd 9uCoBj+WnfgY/ytSlE5yauDT+txfW1dcgVvJqp3VOI0V8jjra1W547hEG4KqbGYwgL3Z 9ZIu1xJvtIQmyBNC+PdwnT/JuAWhHZYsEIX5JCRs43ckXsL73XifwIBWWfTW67CZwhmJ y9hMz5LLzpmd1ETDVYdc8djvfEgq5fT+csid+TgMlS1ElDL+udTMFKlZ5JOuXVDzn31r 7mb2bUf4dl8ubXkZ67RwU+YuH84qDIry8hah65i7DlUAT8MROwHrh9yZbf1JptODwh11 C6ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YNuE8vWv; 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 z24si11255254ejx.462.2021.03.15.11.14.09; Mon, 15 Mar 2021 11:14:31 -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=YNuE8vWv; 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 S236047AbhCOOMP (ORCPT + 99 others); Mon, 15 Mar 2021 10:12:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:37476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232351AbhCON62 (ORCPT ); Mon, 15 Mar 2021 09:58:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AA13B64F18; Mon, 15 Mar 2021 13:58:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816706; bh=3bTbJriGyVpXBp0f/r1CFonGIIs07A4ZzRZa71rgZ4Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YNuE8vWvvJtUyeHQ6WJYzQ9MipntqWsRYsr/T6V5CFRVNGyZKMoCldl5KxXvIguGo XCEsutarcpc+5TUbsDSUlR8iByc2LA+nVt5w/TJOhLcOV1lxlZc2wDuUEozhAYLiDJ kZJWR/ZrVmVot5o01uSfjjZbBcvRllzZOTHjDc9Y= 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.10 067/290] net: stmmac: fix watchdog timeout during suspend/resume stress test Date: Mon, 15 Mar 2021 14:52:40 +0100 Message-Id: <20210315135544.173287463@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@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 @@ -5230,6 +5230,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)); } }