Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp3780781ybe; Mon, 16 Sep 2019 00:46:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqyfsDHuT1DRPsYChrT7nv8ZLG4XPQcK4RjuGHZd7fVjybOAmevLbdt/Pcno8WyhWycXs7Kx X-Received: by 2002:aa7:db05:: with SMTP id t5mr61248482eds.242.1568620006296; Mon, 16 Sep 2019 00:46:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568620006; cv=none; d=google.com; s=arc-20160816; b=cfo2+HOPHz2qF5Y+3ThL5kcHXFuo4riRTKtDoSEkqmzTnYSjvrjmA5FOQF4EOVfu5s Qs/0or6C9m6JE6cJF3T0+Ti9OhoAOXcaEpxTmDCNllBzF6afFShajBzHJOm+1/d3+z3T bcX5Zh3wN9ebI951EIi4h80iP2zSNmThI3liMVgnoKh2bp8SMp/kOBWqAfLBNWmqZPM/ lTiL/XclvPzggxQC3pSRLXPmbIoctGGD0MsvxOv+k7FxcCUZc3ZnPBKiXQ+5H5W6mGQT ezBtoBUP9dOjtSq7mTibxLWVI58mJ1NnAeul+IGV6Jh9yJ7RBLNefm407vOAOVGHNsya a46A== 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=hY+E46RsT7MtFiSodf6E3RNRc1WyDB2WgJU6E+aKQ6w=; b=WjvWOxxj6Qp3BAM2Y/qhf4WXj9Gm7wAlqybxGGmTX4im17EXExR8bRcCtYjequjZD4 CAfdkvJEDfIaypW5t/2B0x6SXtPe5XwS3vOE84d5A/JoR/jkHpVnpo2q36M5NSCp3vKJ RKpX+FH0FgcPX+f4Vpl7YE5+qYbRkk+gPfoncGHs4uMWWgynEs3EZFpRUycwYr7SHtfe iT2QqlyuFsWeLv+PHhxw+kBlE8DiVGYk6pKbDe53+NqDBbFOzLSbFTnB5bIeRscx5OAN 0Lal6HFN+HEmRJUafG6qA5AV5FS5/E8OyxNsfbo6XoYdCXhKubE1u0QYrL7dRz9dUMc1 1QtA== 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 k12si18864225ejz.304.2019.09.16.00.46.22; Mon, 16 Sep 2019 00:46:46 -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 S1728237AbfIPHD6 (ORCPT + 99 others); Mon, 16 Sep 2019 03:03:58 -0400 Received: from rtits2.realtek.com ([211.75.126.72]:60331 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726946AbfIPHD5 (ORCPT ); Mon, 16 Sep 2019 03:03:57 -0400 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.62 with qID x8G73q9k029963, 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 x8G73q9k029963 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 16 Sep 2019 15:03:52 +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; Mon, 16 Sep 2019 15:03:51 +0800 From: To: CC: , Subject: [PATCH 03/15] rtw88: pci: reset H2C queue indexes in a single write Date: Mon, 16 Sep 2019 15:03:33 +0800 Message-ID: <1568617425-28062-4-git-send-email-yhchuang@realtek.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1568617425-28062-1-git-send-email-yhchuang@realtek.com> References: <1568617425-28062-1-git-send-email-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 --- 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 3fdb52a..9cc068a 100644 --- a/drivers/net/wireless/realtek/rtw88/pci.c +++ b/drivers/net/wireless/realtek/rtw88/pci.c @@ -441,9 +441,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.7.4