ath10k: Fix ath10k_init_uart when uart_print is false
diff mbox series

Message ID 20190925090856.6964-2-fedux@fedux.com.ar
State Rejected
Delegated to: Kalle Valo
Headers show
Series
  • ath10k: Fix ath10k_init_uart when uart_print is false
Related show

Commit Message

Federico Cuello Sept. 25, 2019, 9:08 a.m. UTC
Patch 4504f0e5b5714d9d26b1a80bf1fc133c95830588 introduced a workaround
for a firmware UART pin configuration bug, but it caused uart_print to be
interpreted as true when it was false and uart_pin_workaround also false.

This patch corrects the exit condition when uart_print is false.

Signed-off-by: Federico Cuello <fedux@fedux.com.ar>
---
 drivers/net/wireless/ath/ath10k/core.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

Comments

Kalle Valo Sept. 25, 2019, 12:02 p.m. UTC | #1
+ ath10k

Federico Cuello <fedux@fedux.com.ar> writes:

> Patch 4504f0e5b5714d9d26b1a80bf1fc133c95830588 introduced a workaround
> for a firmware UART pin configuration bug, but it caused uart_print to be
> interpreted as true when it was false and uart_pin_workaround also false.
>
> This patch corrects the exit condition when uart_print is false.
>
> Signed-off-by: Federico Cuello <fedux@fedux.com.ar>

I have already applied a fix for this:

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=ath-next&id=1340cc631bd00431e2f174525c971f119df9efa1

But it's not CCed for stable, hopefully the stable bots still catch it.

Patch
diff mbox series

diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index dc45d16e8d21..dd1311910d6a 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -2118,12 +2118,14 @@  static int ath10k_init_uart(struct ath10k *ar)
 		return ret;
 	}
 
-	if (!uart_print && ar->hw_params.uart_pin_workaround) {
-		ret = ath10k_bmi_write32(ar, hi_dbg_uart_txpin,
-					 ar->hw_params.uart_pin);
-		if (ret) {
-			ath10k_warn(ar, "failed to set UART TX pin: %d", ret);
-			return ret;
+	if (!uart_print) {
+		if (ar->hw_params.uart_pin_workaround) {
+			ret = ath10k_bmi_write32(ar, hi_dbg_uart_txpin,
+						 ar->hw_params.uart_pin);
+			if (ret) {
+				ath10k_warn(ar, "failed to set UART TX pin: %d", ret);
+				return ret;
+			}
 		}
 
 		return 0;