From patchwork Mon Sep 27 09:14:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: k16622806117@126.com X-Patchwork-Id: 1533241 X-Patchwork-Delegate: gch981213@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=VSxx3TJP; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=126.com header.i=@126.com header.a=rsa-sha256 header.s=s110527 header.b=mBeii5/W; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHxtn3qKVz9tk6 for ; Mon, 27 Sep 2021 19:20:17 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=UxH82agXUmNkls/SXEEkyKH+FXIeioJ8Gwmb5skHj0w=; b=VSxx3TJPdRwVEG 2FtVjYxfpQWQhEtlQ3qzBY8vrtO92hLERqYaqoODkE5JefEO2Xr5s3wEKHwZrJrwjW7ouSMp/2Sxx eGuzMI3XAN0CE2lfxcqHk98utJOF0hExfRRx/5zqDxEHbh5vY4hy8FOarWTMQWPb2G8SGnFtzjSWS IO8RjtR9boLal9jEynRVcaqj0uCl+mnYESYGWpTFevcwOxN9jl3b1pZNH9CDcq4esZSYw52w+AAgQ Om8Ok4FcK+CNqwxgQtGB/nivVCaTcX7g8+DTJy+eAFg1t1Tn1xWefk9l1k5HGO7qSljzHx1sPSKtr OxM6rA7GUUxD1CMxidhA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mUmj9-0028FH-Pc; Mon, 27 Sep 2021 09:15:11 +0000 Received: from m15112.mail.126.com ([220.181.15.112]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mUmj5-0028EB-OP for openwrt-devel@lists.openwrt.org; Mon, 27 Sep 2021 09:15:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-Id; bh=7AEkBnxim0lt1pdQLb 4eJC3Qvu16GKBM+iJJZSqTrRw=; b=mBeii5/W82+r5Rzt8rBtwIyxG2tFAaxo3T Wv9Wk99vRHPL0v8J7GECQwCLq8gdcJpqqbziUoDTuJ+RfTKbq689d0TtR7Olp/IM FGT3N9rm3iwHiLvxiL86GRqjt4V8jrkCIVDN4M3sk7EcOPd3cUWSsymBolDGuvAf LUcUtZW68= Received: from localhost (unknown [113.50.48.181]) by smtp2 (Coremail) with SMTP id DMmowACHTtiTi1Fh_LYSAQ--.1333S2; Mon, 27 Sep 2021 17:15:00 +0800 (CST) From: k16622806117@126.com To: openwrt-devel@lists.openwrt.org Cc: Linkai Subject: [PATCH] mac80211: add support for xiaomi AX9000 Date: Mon, 27 Sep 2021 17:14:57 +0800 Message-Id: <1632734097-26729-1-git-send-email-k16622806117@126.com> X-Mailer: git-send-email 2.7.4 X-CM-TRANSID: DMmowACHTtiTi1Fh_LYSAQ--.1333S2 X-Coremail-Antispam: 1Uf129KBjvJXoW3GryUJrW3Kr15XF47Jw45trb_yoWxGr48pF yxWw45JFW8ZF12grs7Ja18AFyrXan3t3y3Kr47Ka4rWr1FyFn5t3W5XF1UXr1YkrZ7CF45 XF4ayFW5uas8t3DanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jjNtxUUUUU= X-Originating-IP: [113.50.48.181] X-CM-SenderInfo: bnrwljqsyqliirx6ij2wof0z/1tbi5RQbNlpD8FpVbAAAsW X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210927_021508_187521_FC5BAE87 X-CRM114-Status: GOOD ( 17.87 ) X-Spam-Score: 0.4 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Linkai Signed-off-by: Linkai --- ...exclusive-srng_write32-hif-api-for-srng-w.patch | 137 +++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 package/kernel/mac80211/patches/237-005- [...] Content analysis details: (0.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FROM_LOCAL_DIGITS From: localpart has long digit sequence 0.3 FROM_LOCAL_HEX From: localpart has long hexadecimal sequence -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [k16622806117[at]126.com] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit [k16622806117[at]126.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [220.181.15.112 listed in list.dnswl.org] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: Linkai Signed-off-by: Linkai --- ...exclusive-srng_write32-hif-api-for-srng-w.patch | 137 +++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 package/kernel/mac80211/patches/237-005-ath11k-Use-exclusive-srng_write32-hif-api-for-srng-w.patch diff --git a/package/kernel/mac80211/patches/237-005-ath11k-Use-exclusive-srng_write32-hif-api-for-srng-w.patch b/package/kernel/mac80211/patches/237-005-ath11k-Use-exclusive-srng_write32-hif-api-for-srng-w.patch new file mode 100644 index 0000000..6764cf7 --- /dev/null +++ b/package/kernel/mac80211/patches/237-005-ath11k-Use-exclusive-srng_write32-hif-api-for-srng-w.patch @@ -0,0 +1,137 @@ +From 2b867c226aa6dae11cf320342b624caaef23b3f1 Mon Sep 17 00:00:00 2001 +From: P Praneesh +Date: Mon, 14 Dec 2020 21:56:00 +0530 +Subject: [PATCH 5/6] ath11k: Use exclusive srng_write32 hif api for srng write + access + +Currently the pci_write32() performs multiple checks on the offset +argument to identify if its a DP or CE mem offset, and selects +a corresponding window start address to be added to the offset +before performing the write operation. +This could be costly for certain calls falling in the hotpath +such as ath11k_hal_srng_access_end() which is used by the CE +and DP code to update the srng head and tail pointer for src and +dest rings correspondingly. + +Hence offload the window start determination during ring +initialization itself and use the same offset which has window +start address included for write operation. + +Added srng_write32 hif operation for this purpose. +read32 is not used much in the datapath, hence using the +existing hif call itself + +Signed-off-by: Sriram R +Signed-off-by: P Praneesh +--- + drivers/net/wireless/ath/ath11k/ahb.c | 1 + + drivers/net/wireless/ath/ath11k/hal.c | 13 ++++++++----- + drivers/net/wireless/ath/ath11k/hif.h | 6 ++++++ + drivers/net/wireless/ath/ath11k/pci.c | 7 +++++++ + 4 files changed, 22 insertions(+), 5 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/ahb.c ++++ b/drivers/net/wireless/ath/ath11k/ahb.c +@@ -745,6 +745,7 @@ static const struct ath11k_hif_ops ath11 + .stop = ath11k_ahb_stop, + .read32 = ath11k_ahb_read32, + .write32 = ath11k_ahb_write32, ++ .srng_write32 = ath11k_ahb_write32, + .irq_enable = ath11k_ahb_ext_irq_enable, + .irq_disable = ath11k_ahb_ext_irq_disable, + .map_service_to_pipe = ath11k_ahb_map_service_to_pipe, +--- a/drivers/net/wireless/ath/ath11k/hal.c ++++ b/drivers/net/wireless/ath/ath11k/hal.c +@@ -837,13 +837,13 @@ void ath11k_hal_srng_access_end(struct a + if (srng->ring_dir == HAL_SRNG_DIR_SRC) { + srng->u.src_ring.last_tp = + *(volatile u32 *)srng->u.src_ring.tp_addr; +- ath11k_hif_write32(ab, ++ ath11k_hif_srng_write32(ab, + (unsigned long)srng->u.src_ring.hp_addr - + (unsigned long)mem, + srng->u.src_ring.hp); + } else { + srng->u.dst_ring.last_hp = *srng->u.dst_ring.hp_addr; +- ath11k_hif_write32(ab, ++ ath11k_hif_srng_write32(ab, + (unsigned long)srng->u.dst_ring.tp_addr - + (unsigned long)mem, + srng->u.dst_ring.tp); +@@ -957,6 +957,7 @@ int ath11k_hal_srng_setup(struct ath11k_ + int i; + u32 reg_base; + unsigned long *mem; ++ u32 offset; + + ring_id = ath11k_hal_srng_get_ring_id(ab, type, ring_num, mac_id); + if (ring_id < 0) +@@ -1015,8 +1016,9 @@ int ath11k_hal_srng_setup(struct ath11k_ + lmac_idx); + srng->flags |= HAL_SRNG_FLAGS_LMAC_RING; + } else { ++ offset = ath11k_hif_get_window_offset(ab, reg_base); + srng->u.src_ring.hp_addr = +- (u32 *)((unsigned long)mem + reg_base); ++ (u32 *)((unsigned long)mem + offset); + } + } else { + /* During initialization loop count in all the descriptors +@@ -1040,9 +1042,10 @@ int ath11k_hal_srng_setup(struct ath11k_ + lmac_idx); + srng->flags |= HAL_SRNG_FLAGS_LMAC_RING; + } else { +- srng->u.dst_ring.tp_addr = +- (u32 *)((unsigned long)mem + reg_base + ++ offset = ath11k_hif_get_window_offset(ab, reg_base + + (HAL_REO1_RING_TP(ab) - HAL_REO1_RING_HP(ab))); ++ srng->u.dst_ring.tp_addr = ++ (u32 *)((unsigned long)mem + offset); + } + } + +--- a/drivers/net/wireless/ath/ath11k/hif.h ++++ b/drivers/net/wireless/ath/ath11k/hif.h +@@ -11,6 +11,7 @@ + struct ath11k_hif_ops { + u32 (*read32)(struct ath11k_base *sc, u32 address); + void (*write32)(struct ath11k_base *sc, u32 address, u32 data); ++ void (*srng_write32)(struct ath11k_base *sc, u32 address, u32 data); + void (*irq_enable)(struct ath11k_base *sc); + void (*irq_disable)(struct ath11k_base *sc); + int (*start)(struct ath11k_base *sc); +@@ -72,6 +73,11 @@ static inline void ath11k_hif_write32(st + sc->hif.ops->write32(sc, address, data); + } + ++static inline void ath11k_hif_srng_write32(struct ath11k_base *sc, u32 address, u32 data) ++{ ++ sc->hif.ops->srng_write32(sc, address, data); ++} ++ + static inline int ath11k_hif_map_service_to_pipe(struct ath11k_base *sc, u16 service_id, + u8 *ul_pipe, u8 *dl_pipe) + { +--- a/drivers/net/wireless/ath/ath11k/pci.c ++++ b/drivers/net/wireless/ath/ath11k/pci.c +@@ -140,6 +140,12 @@ void ath11k_pci_write32(struct ath11k_ba + } + EXPORT_SYMBOL(ath11k_pci_write32); + ++/* To be used for ce/dp srng pointer write */ ++void ath11k_pci_srng_write32(struct ath11k_base *ab, u32 offset, u32 value) ++{ ++ iowrite32(value, ab->mem + offset); ++} ++ + u32 ath11k_pci_read32(struct ath11k_base *ab, u32 offset) + { + struct ath11k_pci *ab_pci = NULL; +@@ -1012,6 +1018,7 @@ static const struct ath11k_hif_ops ath11 + .stop = ath11k_pci_stop, + .read32 = ath11k_pci_read32, + .write32 = ath11k_pci_write32, ++ .srng_write32 = ath11k_pci_srng_write32, + .power_down = ath11k_pci_power_down, + .power_up = ath11k_pci_power_up, + .irq_enable = ath11k_pci_ext_irq_enable,