devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Bizon <mbizon@freebox.fr>
To: Manikanta Pubbisetty <quic_mpubbise@quicinc.com>,
	ath11k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org, devicetree@vger.kernel.org,
	robh@kernel.org, mka@chromium.org
Subject: Re: [PATCH v7 4/9] ath11k: Add register access logic for WCN6750
Date: Mon, 30 May 2022 16:19:06 +0200	[thread overview]
Message-ID: <c1c3472427080716c69ad99ebe5d1954db44f03f.camel@freebox.fr> (raw)
In-Reply-To: <c57e8791-b6ce-0752-52ca-a1cb938187d7@quicinc.com>


On Thu, 2022-05-26 at 09:12 +0530, Manikanta Pubbisetty wrote:

> 
> Thanks for letting me know about this, IIRC I don't remember 
> encountering this problem in my testing. Just for my understanding,
> have you reverted this change and confirmed that these errors go away
> ?

I first confirmed the register location was indeed incorrect, then I
fixed it like this:

--- a/drivers/net/wireless/ath/ath11k/pcic.c
+++ b/drivers/net/wireless/ath/ath11k/pcic.c
@@ -143,7 +143,7 @@ EXPORT_SYMBOL(ath11k_pcic_init_msi_config);
 static inline u32 ath11k_pcic_get_window_start(struct ath11k_base *ab,
 					       u32 offset)
 {
-	u32 window_start = 0;
+	u32 window_start = ATH11K_PCI_WINDOW_START;
 
 	if ((offset ^ HAL_SEQ_WCSS_UMAC_OFFSET) < ATH11K_PCI_WINDOW_RANGE_MASK)
 		window_start = ab->hw_params.dp_window_idx * ATH11K_PCI_WINDOW_START;
@@ -170,8 +170,12 @@ void ath11k_pcic_write32(struct ath11k_base *ab, u32 offset, u32 value)
 		iowrite32(value, ab->mem  + offset);
 	} else if (ab->hw_params.static_window_map) {
 		window_start = ath11k_pcic_get_window_start(ab, offset);
-		iowrite32(value, ab->mem + window_start +
-			  (offset & ATH11K_PCI_WINDOW_RANGE_MASK));
+		if (window_start == ATH11K_PCI_WINDOW_START &&
+                    ab->pci.ops->window_write32)
+			ab->pci.ops->window_write32(ab, offset, value);
+		else
+			iowrite32(value, ab->mem + window_start +
+				  (offset & ATH11K_PCI_WINDOW_RANGE_MASK));
 	} else if (ab->pci.ops->window_write32) {
 		ab->pci.ops->window_write32(ab, offset, value);
 	}
@@ -200,8 +204,12 @@ u32 ath11k_pcic_read32(struct ath11k_base *ab, u32 offset)
 		val = ioread32(ab->mem + offset);
 	} else if (ab->hw_params.static_window_map) {
 		window_start = ath11k_pcic_get_window_start(ab, offset);
-		val = ioread32(ab->mem + window_start +
-			       (offset & ATH11K_PCI_WINDOW_RANGE_MASK));
+		if (window_start == ATH11K_PCI_WINDOW_START &&
+		    ab->pci.ops->window_read32)
+			val = ab->pci.ops->window_read32(ab, offset);
+		else
+			val = ioread32(ab->mem + window_start +
+				       (offset & ATH11K_PCI_WINDOW_RANGE_MASK));
 	} else if (ab->pci.ops->window_read32) {
 		val = ab->pci.ops->window_read32(ab, offset);
 	}

-- 
Maxime




  reply	other threads:[~2022-05-30 15:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-29 17:04 [PATCH v7 0/9] add support for WCN6750 Manikanta Pubbisetty
2022-04-29 17:04 ` [PATCH v7 1/9] dt: bindings: net: add bindings of WCN6750 for ath11k Manikanta Pubbisetty
2022-05-02 13:59   ` Kalle Valo
2022-04-29 17:04 ` [PATCH v7 2/9] ath11k: Move parameters in bus_params to hw_params Manikanta Pubbisetty
2022-04-29 17:04 ` [PATCH v7 3/9] ath11k: Add HW params for WCN6750 Manikanta Pubbisetty
2022-04-29 17:04 ` [PATCH v7 4/9] ath11k: Add register access logic " Manikanta Pubbisetty
2022-05-02  9:12   ` Kalle Valo
2022-05-25 18:46   ` Maxime Bizon
2022-05-26  3:42     ` Manikanta Pubbisetty
2022-05-30 14:19       ` Maxime Bizon [this message]
2022-05-30 16:17         ` Kalle Valo
2022-05-30 16:22           ` Maxime Bizon
2022-04-29 17:04 ` [PATCH v7 5/9] ath11k: Fetch device information via QMI " Manikanta Pubbisetty
2022-05-02  9:29   ` Kalle Valo
2022-04-29 17:04 ` [PATCH v7 6/9] ath11k: Add QMI changes " Manikanta Pubbisetty
2022-04-29 17:05 ` [PATCH v7 7/9] ath11k: HAL changes to support WCN6750 Manikanta Pubbisetty
2022-04-29 17:05 ` [PATCH v7 8/9] ath11k: Datapath " Manikanta Pubbisetty
2022-04-29 17:05 ` [PATCH v7 9/9] ath11k: Add support for WCN6750 device Manikanta Pubbisetty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c1c3472427080716c69ad99ebe5d1954db44f03f.camel@freebox.fr \
    --to=mbizon@freebox.fr \
    --cc=ath11k@lists.infradead.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mka@chromium.org \
    --cc=quic_mpubbise@quicinc.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).