Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp406129ybn; Tue, 1 Oct 2019 23:30:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqysWPAidp5H2BC8OV5EcVGV1tlkJtUuU++Cv8pSD+Hf7C00BbUMG2EK4P5Njxh3MsDj8rzg X-Received: by 2002:a17:907:20eb:: with SMTP id rh11mr1600011ejb.25.1569997840174; Tue, 01 Oct 2019 23:30:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569997840; cv=none; d=google.com; s=arc-20160816; b=i5qWFaeFuCEDVTRt33+i5adygRmcLkW1ITi0TshbiK23FWFvaMbM/LnPX1avsDhoU2 qgBMRamuX/vVNYfnCzUcT0p0mDH8L7pzOEpTnm42va7rskSmLdXM0Ff202PHxyaC/vHz jQgLMv06YvJRStPv/mmKGY4f2DK91dhIPU3PUEWvOj/z1HapqOuPqfpfphu6WpWD82om vejM//olId34AcA1byyb/4w10G9O9x60tRK+ZSM2v/o1pfdfOLyLQIDUASfEfszuwo8P 4WEc6kpp7bvXjbRTf7dL68S3+foklZwkJiR3p/R8ZT2nThStXCc1Ld+CLdL/H5cn35Rv 8cJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:authenticated-by; bh=zRiWf4KkGn9ZhAjOLY3UiAVVb9fIInOtykSQzOQe/sA=; b=D1TpOMIb7wfsNTlJvO242SCt1BfDpNR3v9XU6Y8a3j/gyVRUQClGUBtc/JIRU/EUWl cClt/V54OAVf1TZJA1gu2yLr5BlejtI5sAR9k44MjFlRCBqU9AtP3T3m9rDDBMz+I/sC VvNixWr1bf6J/CMTISqXQP+zoujmfJpckNLtpAouEcwOgOGIFYfZRReJQWko6LnXazU1 +fGTgJEv9LPvv7lzmL02ZeVZzm3kjWGmvd4TGPmJTAqXemniEdmGCyZneP7jWaNk64s5 7nTazK7XqaXNQSHbZEUiMbci5U/qNQR/Qer3bZi5T2fU00KwuWvw7rxx2+4N1Vgr6+lU HUKg== ARC-Authentication-Results: i=1; mx.google.com; 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 j46si10715405eda.9.2019.10.01.23.30.08; Tue, 01 Oct 2019 23:30:39 -0700 (PDT) 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; 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 S1729538AbfJBCbj (ORCPT + 99 others); Tue, 1 Oct 2019 22:31:39 -0400 Received: from rtits2.realtek.com ([211.75.126.72]:45995 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729030AbfJBCbj (ORCPT ); Tue, 1 Oct 2019 22:31:39 -0400 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.62 with qID x922VW5E031831, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (RTITCASV01.realtek.com.tw[172.21.6.18]) by rtits2.realtek.com.tw (8.15.2/2.57/5.78) with ESMTPS id x922VW5E031831 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 2 Oct 2019 10:31:32 +0800 Received: from localhost.localdomain (172.21.68.126) by RTITCASV01.realtek.com.tw (172.21.6.18) with Microsoft SMTP Server id 14.3.468.0; Wed, 2 Oct 2019 10:31:32 +0800 From: To: CC: , Subject: [PATCH v2 02/12] rtw88: pci: reset H2C queue indexes in a single write Date: Wed, 2 Oct 2019 10:31:18 +0800 Message-ID: <20191002023128.12090-3-yhchuang@realtek.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191002023128.12090-1-yhchuang@realtek.com> References: <20191002023128.12090-1-yhchuang@realtek.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.21.68.126] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Yan-Hsuan Chuang If the driver doesn't reset the host's and device's indexes in a single write, the indexes will become different in a short period. And it will confuse the DMA engine, make it start to process non-existed entries. Better to Write-1-to-reset the indexes, for the DMA engine to know that this is a reset of the H2C queue, not a kick off. Signed-off-by: Yan-Hsuan Chuang --- v1 -> v2 - rebase on top of wireless-drivers-next drivers/net/wireless/realtek/rtw88/pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw88/pci.c b/drivers/net/wireless/realtek/rtw88/pci.c index d90928be663b..509743cfd70a 100644 --- a/drivers/net/wireless/realtek/rtw88/pci.c +++ b/drivers/net/wireless/realtek/rtw88/pci.c @@ -457,9 +457,9 @@ static void rtw_pci_reset_buf_desc(struct rtw_dev *rtwdev) /* reset read/write point */ rtw_write32(rtwdev, RTK_PCI_TXBD_RWPTR_CLR, 0xffffffff); - /* rest H2C Queue index */ - rtw_write32_set(rtwdev, RTK_PCI_TXBD_H2CQ_CSR, BIT_CLR_H2CQ_HOST_IDX); - rtw_write32_set(rtwdev, RTK_PCI_TXBD_H2CQ_CSR, BIT_CLR_H2CQ_HW_IDX); + /* reset H2C Queue index in a single write */ + rtw_write32_set(rtwdev, RTK_PCI_TXBD_H2CQ_CSR, + BIT_CLR_H2CQ_HOST_IDX | BIT_CLR_H2CQ_HW_IDX); } static void rtw_pci_reset_trx_ring(struct rtw_dev *rtwdev) -- 2.17.1