Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4624168pxj; Wed, 12 May 2021 09:28:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJqLRVQBdCYcYhEFX0qGlYEV+1JYqcy6XZoFk93ykTtbKO+MQIsqD6wZLuJwXUnJa5fd1V X-Received: by 2002:a17:906:4c8c:: with SMTP id q12mr38548357eju.254.1620836923931; Wed, 12 May 2021 09:28:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620836923; cv=none; d=google.com; s=arc-20160816; b=wUgK/SryjpybEfIEPfPbSyLWgP4if+zWXi0BvhTLhzWO51MO1dWmwiPBAPkJdLA5dk JxQhQ048z+V9eI8LMqCBd4VL2ZJEkEnuHyVg14ATAHBZd6iyVn9qUK0tP0FUcsgMXelR GEWE2UejvaDRtjvrCderbVg9LPAbZsQ/uqRrr34NTWK+UE27hIZFKeX2k1trj36ZfWAs wHSsqPb/tBCo7lw4RwXzrfd4LPqn6Sx27Qwv3wSZTauJvCHhJjiFObd8RSzatYO+kWrR i1uP7TfBA7XQQnQQDRYbECLksORZPV/YP+dnDOFHW8ZALBZh4DRYKrJSSGINqiJmxVjn ROOQ== 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=FEFkuqKZgdJnkJQaIV8sS7EuwPetXBlq5hh6rOUohpQ=; b=HWbC4KV8UA+Q0npQ7uT2/IS44WJX0YxluE8OUGoZ2sTlRuDX8MtKWrHucIYGht9XGP B4kUydsil+GrqV8ifS8sXL8Yk7lnUF3rHSgpKnWVxdtplsd7xm8MnXdqYea5DiGj1ozI zvfD1mC6Ppi7hx1sRTcoIAz+Qn3EaehDLKQltouJQxTfLzNvcNzsT7lHRRoEyHHrWya9 zS10XCht76bi2IR+e+ixRJFLcj1lHXPddFlZJssASs4jlwt/aWR1DwI76OQAJw8TzhHq XgskPFelZ0x3I2GNtmH3wwac5ei/Jzw170Rxp+BpX0HSJWcAe7NOr+LwO/RbMUzvCU6F J1/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SN8JIeQy; 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 gq9si385901ejb.720.2021.05.12.09.28.19; Wed, 12 May 2021 09:28:43 -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=SN8JIeQy; 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 S241055AbhELQ0R (ORCPT + 99 others); Wed, 12 May 2021 12:26:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:55166 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236386AbhELPhu (ORCPT ); Wed, 12 May 2021 11:37:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1AA8C61993; Wed, 12 May 2021 15:19:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832773; bh=CGO2sFoVdylIdaV4vRLZrGCCDcNNIkPwS96faCCOph0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SN8JIeQyNsT79ls6FMGTYKsh1a9IxxXHmvn0+wuqjcyLCw7APsIEjAXgRe1t2+/mw JskrslORQu5uovu9DfjFdCDb7kovTpI8Stw45uCrBKupfnOqOFXqcsxHJZoauKE0z4 9/XNLXjuDqiWHrteVEJ053h9zrGYA02st+1nWJ9E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sean Wang , Felix Fietkau , Sasha Levin Subject: [PATCH 5.10 418/530] mt76: mt7663s: fix the possible device hang in high traffic Date: Wed, 12 May 2021 16:48:48 +0200 Message-Id: <20210512144833.505772490@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@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: Sean Wang [ Upstream commit 45247a85614b49b07b9dc59a4e6783b17e766ff2 ] Use the additional memory barrier to ensure the skb list up-to-date between the skb producer and consumer to avoid the invalid skb content written into sdio controller and then cause device hang due to mcu assert caught by WR_TIMEOUT_INT. Fixes: 1522ff731f84 ("mt76: mt7663s: introduce sdio tx aggregation") Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c | 2 ++ drivers/net/wireless/mediatek/mt76/sdio.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c b/drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c index 2c269fee8555..d7d61a5b66a3 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c @@ -201,6 +201,8 @@ static int mt7663s_tx_run_queue(struct mt76_dev *dev, enum mt76_txq_id qid) struct mt76_queue_entry *e = &q->entry[q->first]; struct sk_buff *iter; + smp_rmb(); + if (!test_bit(MT76_STATE_MCU_RUNNING, &dev->phy.state)) { __skb_put_zero(e->skb, 4); err = __mt7663s_xmit_queue(dev, e->skb->data, diff --git a/drivers/net/wireless/mediatek/mt76/sdio.c b/drivers/net/wireless/mediatek/mt76/sdio.c index 9a4d95a2a707..439ea4158260 100644 --- a/drivers/net/wireless/mediatek/mt76/sdio.c +++ b/drivers/net/wireless/mediatek/mt76/sdio.c @@ -215,6 +215,9 @@ mt76s_tx_queue_skb(struct mt76_dev *dev, enum mt76_txq_id qid, q->entry[q->head].skb = tx_info.skb; q->entry[q->head].buf_sz = len; + + smp_wmb(); + q->head = (q->head + 1) % q->ndesc; q->queued++; -- 2.30.2