Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1339343ybl; Fri, 13 Dec 2019 13:37:01 -0800 (PST) X-Google-Smtp-Source: APXvYqzcdFOzxHYuT5qaZaVdDhpOFALOkaHjkJGFxakZfFdHvrCxmiF8MUdIrmmNpTC1afEXorDI X-Received: by 2002:aca:b344:: with SMTP id c65mr8213308oif.88.1576273021113; Fri, 13 Dec 2019 13:37:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576273021; cv=none; d=google.com; s=arc-20160816; b=VFKxL6/oW1u4YLPktnGOKhtxsx/TrZm58mDOSdbQAF2TEFHUf+8//ug5/3RCjuTTr0 SFPPzcHc297YUmwNWPQC/AkKisALJEvn9Qvf8OBU5accbzIKHMk5mY9YZvxO/Rl/+rC1 FPUFLt31LUEapJkO6unGwA6mbJZo7grDY6VLnJvQphq24CFRgccaGWahmDRRj6ICT0vT npENuL1x7JgTL1xWo2TLg0GXbiBJ48HbkeHqt9maeXj2Bw0jnQqMkKkr7yw9AI0g3vnm gDsyxlUTpm1/aELQkEbegvxB4pTOM7VBnk+78Mwe9jvPfqGHtU6edpY+dBoQqNkdMgN3 jOBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=arTOw5i32gwSH/Vxa9XtdEqYfXK+VS+6EA+nIi4oE8M=; b=UhKR3Dm53cBVajif6p4YaFWD2SmHmXb+cE1NUttHHOOAaGzWmVI0f5LOfW/IyHXTGw 8vRCNDYWGay1rJ+DeAm0asxHMO42tWOWM6G9pz7PSkHxAW5wqjAOHyEjyPw5DUkBDDe3 cmh/ugZ/jvY/OIsjoSL2j8orUMABtT5aGvZl4Abyaxn4WgLHmw4tFE7EP98mX5GNTPir D7SJ+TqfEilFdkKv+WgBd3d3D+D3dJRqMy6WcllK44NdEcBvBnqn1Ij61B9ZkVy+nK1f HgxU4+FBNr/hbi6cxTEHPN9oIZemSYHVOdXZCbDPbG8w7/wiyBnwFxVzhxYvxpbc2VpX uRJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=frISWk8f; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y198si6060746oia.163.2019.12.13.13.36.34; Fri, 13 Dec 2019 13:37:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=frISWk8f; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726382AbfLMVgb (ORCPT + 99 others); Fri, 13 Dec 2019 16:36:31 -0500 Received: from nbd.name ([46.4.11.11]:47438 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725818AbfLMVgb (ORCPT ); Fri, 13 Dec 2019 16:36:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=arTOw5i32gwSH/Vxa9XtdEqYfXK+VS+6EA+nIi4oE8M=; b=frISWk8fH8ou0RSLuHZg2TupRx DdNSVxflreYzrOagX3Z7SNNbBgCF9bFtOTz6p8j9toRBlSNlKp+WRjHqR9JJvm0asp/btPqP+nqiw Lz3UX4ld4cW9oPuUFolJPMVjoAHjlKT5mTEZ9jNh9SpF6qe4BdGj+pSZU8IcST3glelo=; Received: from p4ff13e83.dip0.t-ipconnect.de ([79.241.62.131] helo=maeck.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ifsbt-0001nY-NS for linux-wireless@vger.kernel.org; Fri, 13 Dec 2019 22:36:30 +0100 Received: by maeck.local (Postfix, from userid 501) id 21E6373C1141; Fri, 13 Dec 2019 22:36:28 +0100 (CET) From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 3/4] mt76: fix rx dma ring descriptor state on reset Date: Fri, 13 Dec 2019 22:36:27 +0100 Message-Id: <20191213213628.73840-3-nbd@nbd.name> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191213213628.73840-1-nbd@nbd.name> References: <20191213213628.73840-1-nbd@nbd.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org To avoid having the hardware potentially write to memory behind stale descriptors, set the dma-done flag on all of them before cleaning up allocated rx buffers Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c index f88d017ff987..2298a4e91943 100644 --- a/drivers/net/wireless/mediatek/mt76/dma.c +++ b/drivers/net/wireless/mediatek/mt76/dma.c @@ -437,7 +437,7 @@ mt76_dma_rx_reset(struct mt76_dev *dev, enum mt76_rxq_id qid) int i; for (i = 0; i < q->ndesc; i++) - q->desc[i].ctrl &= ~cpu_to_le32(MT_DMA_CTL_DMA_DONE); + q->desc[i].ctrl = cpu_to_le32(MT_DMA_CTL_DMA_DONE); mt76_dma_rx_cleanup(dev, q); mt76_dma_sync_idx(dev, q); -- 2.24.0