Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2370653rdb; Tue, 14 Nov 2023 21:02:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IHXsQ6CmDZpkud+ABxy4+t5+WQ//SYenDZiyOQYuWww9MndVzcEt+IgoVH9aqRjOXpWFnHM X-Received: by 2002:a17:903:2341:b0:1c7:5f03:8562 with SMTP id c1-20020a170903234100b001c75f038562mr6271278plh.30.1700024532548; Tue, 14 Nov 2023 21:02:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700024532; cv=none; d=google.com; s=arc-20160816; b=OEbraKbGpoYHMp8zdMultviWjQemg0Mq1mxKG2lCi3Q2igux1J4ndi1d6GwTPabUJb rpAHAX50epIu32CLQdya7bN1aKBb4FXrWTHCKo8r1P5miM+4dMjdqjtDug4DyXNEN9Dt x9oniOn9nIp1mEPdLueyLT0rt3MD7PKj0c3OQSH9XYx5wAT0U3K1k9H4wge675CqggNk M1fkhGFMrfOIdNjUWPSC0TcwOUYjBEbRlk4Qop6+/3X0HQBpIqrKuDwvLqWOIkbqks8w a3lCPWbGgTePE2pBJ9ZX8q34846b7rZarrQXqD0zJP+wsrBla3BXQuBcxa7reBew5dxb QIqA== 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 :message-id:date:subject:cc:to:from; bh=Uz1xiqSNqHcYMjf+xHmtsx85m4JmEG5BxJc20vlEAHc=; fh=As0jz46gUtfaFBPwdZLywluAv565LNTOQEFVjclnAxI=; b=eIUNWWduR9S1ygH+PhEXksgdaQWMyoLCYwpzowg1/g06TofwR9UvLYNSLlxgGQ6fbA UmRMfl6dukMFgOzTa+eT8xUo8y1aEld0CZVGLxsPQiSrFkyLgrgQ8nXJhHBZinwPA1nd 3g8ZQyGryEohMEq0Xizmv8aJmvU7SLEIu6yIOlOvs6vGGS8yyEdnbYYzng0WvI/giicf wNJIIc6e2tx7Tdyi1PkQAEzZtP6i39T4fVglcwrE3RUapdMSFUNvrSBqbAeUTq9yMYZU 7e8YH2KhzCuI802tsE1ZMfrm1LDwRnIYVwMf3Y3hDWpqyGPhERvH5Q0mErfcDE21Vdlw BYxw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id f2-20020a170902ce8200b001ca24970584si9884589plg.572.2023.11.14.21.02.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 21:02:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 10769803693C; Tue, 14 Nov 2023 21:02:09 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234296AbjKOFCJ (ORCPT + 52 others); Wed, 15 Nov 2023 00:02:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229572AbjKOFCI (ORCPT ); Wed, 15 Nov 2023 00:02:08 -0500 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id AECA4D9; Tue, 14 Nov 2023 21:02:04 -0800 (PST) Received: from localhost.localdomain (unknown [180.167.10.98]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 0765760A15476; Wed, 15 Nov 2023 13:02:00 +0800 (CST) X-MD-Sfrom: suhui@nfschina.com X-MD-SrcIP: 180.167.10.98 From: Su Hui To: pkshih@realtek.com, Jes.Sorensen@gmail.com Cc: Su Hui , kvalo@kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH v2] wifi: rtl8xxxu: correct the error value of 'timeout' Date: Wed, 15 Nov 2023 13:01:24 +0800 Message-Id: <20231115050123.951862-1-suhui@nfschina.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 14 Nov 2023 21:02:09 -0800 (PST) When 'rtl8xxxu_dma_agg_pages <= page_thresh', 'timeout' should equal to 'page_thresh' rather than '4'. Change the code order to fix this problem. Fixes: fd83f1227826 ("rtl8xxxu: gen1: Add module parameters to adjust DMA aggregation parameters") Signed-off-by: Su Hui --- v2: - correct the problem about Fixes tag. .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c index 43ee7592bc6e..9cab8b1dc486 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -4757,6 +4757,12 @@ void rtl8xxxu_gen1_init_aggregation(struct rtl8xxxu_priv *priv) * RxAggPageTimeout = 4 or 6 (absolute time 34ms/(2^6)) */ + /* REG_RXDMA_AGG_PG_TH + 1 seems to be the timeout register on + * gen2 chips and rtl8188eu. The rtl8723au seems unhappy if we + * don't set it, so better set both. + */ + timeout = 4; + page_thresh = (priv->fops->rx_agg_buf_size / 512); if (rtl8xxxu_dma_agg_pages >= 0) { if (rtl8xxxu_dma_agg_pages <= page_thresh) @@ -4771,12 +4777,6 @@ void rtl8xxxu_gen1_init_aggregation(struct rtl8xxxu_priv *priv) __func__, rtl8xxxu_dma_agg_pages, page_thresh); } rtl8xxxu_write8(priv, REG_RXDMA_AGG_PG_TH, page_thresh); - /* - * REG_RXDMA_AGG_PG_TH + 1 seems to be the timeout register on - * gen2 chips and rtl8188eu. The rtl8723au seems unhappy if we - * don't set it, so better set both. - */ - timeout = 4; if (rtl8xxxu_dma_agg_timeout >= 0) { if (rtl8xxxu_dma_agg_timeout <= 127) -- 2.30.2