Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp412352pxb; Wed, 24 Feb 2021 05:43:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJyxTUGIASMEfIG3163/2ysjWd69sCYie01/a9zfoCnSo5DV+lFMtDaoYJuHdrRC3hIiJaWm X-Received: by 2002:a17:906:1956:: with SMTP id b22mr32254069eje.114.1614174224563; Wed, 24 Feb 2021 05:43:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614174224; cv=none; d=google.com; s=arc-20160816; b=DdQKw3Y0vEHxHm8v0RCRKFa7kOeWin5A9DH4Dggs7tHd0WLpzmNf/xazAsnqJ7zTJX lf2NEcAAbf4EQPzTS1/8ks0dD24KBVbrqsALLakwms5jvWGgeuCDXpKR2nG2rY6FK4hc c+4zAFqYyLMA4WQDsENtlPqenrd7AP4xCS75/qK6CPzoTj81P9Cva+64HnXdR6Z3BHdR Oob8RvUqEDm7N5EBkB0Y/cOFf9SAkwC2RrBH4LjFMPBkRvCK9ROThUKA9DBplaDkc6t0 bzN+25JWApVAT8pJvc40X3UktNnTiXreGlRmCp2V4XXA07NAT1MKGS3d7zMj6YgtBEFY HL6Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YlJo2k0lJjyBj245LaVo39zLdN8CZYtkr487dHnWHiw=; b=g5JNnGOwEUf8LZnglSlA2RW3Bqq9NLsOWfZpjl2crnPH/IdkwKV42wTg4gr45zA1TD ocOUfvtZ8jS2XvW9SjR219f/DPscIYGEOoyO2hbmBc2Vp0r6Ac/MLGt8W0rbS4nAJnqn E6/hNFAFi9d0TC/Bou1X4FpGJV5knTQepxGbRRBs81/oqPRAwFze79JI2onWQ1D/gDYy 1ABteSSLO8XI5ZGLIHXqX1DX7iUpxeZLV2ra8in1zpiXHXj/AksQVVH+HDxmws+EgH8F Um3DXnCO5vCLXn4DPLCiERwRJZV7/0Kf4pdMMPIr/49uJcPIOH+X1WL+UkgqP+AtqDYe EIiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="lD2VSQ0/"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d23si1254636eje.107.2021.02.24.05.43.21; Wed, 24 Feb 2021 05:43:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="lD2VSQ0/"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237472AbhBXNlF (ORCPT + 99 others); Wed, 24 Feb 2021 08:41:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:59858 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234641AbhBXNLG (ORCPT ); Wed, 24 Feb 2021 08:11:06 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C6B8664E05; Wed, 24 Feb 2021 12:55:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614171319; bh=WN7zw0EDmHVgTa0FH8HJNEJu9mJLgQcVFxWuT8Zn5Ek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lD2VSQ0/Ochoa4ho0axi4AqeEtioLWbSwNNMJkJ2SueqCuIyeJamUqEwT14aa4ZHS JsdGl/AAlK5J5WXENxVdjBgheJpv4udaaKJ+8bv5jx9eEeamW4DfmJl8WtbJFZ1afL WS3NRT2ZFlLdZfNa5J/gWOmRd7nstVpRDE/VmZhWWVBbex/QJPPC0ipHUMg66w2twd baD3ppkM1Hfbd0h071oE6tQBhJSL4GlRgq/pO5xrqkYOjDSmt41fPnrt4CM9qcqWY6 DgdrwfSDvis0/Xs/XzXDnYvrYK01AI75W2DkuKD9gSbu9svDPEtb+0Z96af8EvZ5W4 FfZEv8rxe7Ycg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tony Lindgren , Raz Bouganim , Kalle Valo , Sasha Levin , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 04/16] wlcore: Fix command execute failure 19 for wl12xx Date: Wed, 24 Feb 2021 07:55:01 -0500 Message-Id: <20210224125514.483935-4-sashal@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210224125514.483935-1-sashal@kernel.org> References: <20210224125514.483935-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Tony Lindgren [ Upstream commit cb88d01b67383a095e3f7caeb4cdade5a6cf0417 ] We can currently get a "command execute failure 19" error on beacon loss if the signal is weak: wlcore: Beacon loss detected. roles:0xff wlcore: Connection loss work (role_id: 0). ... wlcore: ERROR command execute failure 19 ... WARNING: CPU: 0 PID: 1552 at drivers/net/wireless/ti/wlcore/main.c:803 ... (wl12xx_queue_recovery_work.part.0 [wlcore]) (wl12xx_cmd_role_start_sta [wlcore]) (wl1271_op_bss_info_changed [wlcore]) (ieee80211_prep_connection [mac80211]) Error 19 is defined as CMD_STATUS_WRONG_NESTING from the wlcore firmware, and seems to mean that the firmware no longer wants to see the quirk handling for WLCORE_QUIRK_START_STA_FAILS done. This quirk got added with commit 18eab430700d ("wlcore: workaround start_sta problem in wl12xx fw"), and it seems that this already got fixed in the firmware long time ago back in 2012 as wl18xx never had this quirk in place to start with. As we no longer even support firmware that early, to me it seems that it's safe to just drop WLCORE_QUIRK_START_STA_FAILS to fix the error. Looks like earlier firmware got disabled back in 2013 with commit 0e284c074ef9 ("wl12xx: increase minimum singlerole firmware version required"). If it turns out we still need WLCORE_QUIRK_START_STA_FAILS with any firmware that the driver works with, we can simply revert this patch and add extra checks for firmware version used. With this fix wlcore reconnects properly after a beacon loss. Cc: Raz Bouganim Signed-off-by: Tony Lindgren Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210115065613.7731-1-tony@atomide.com Signed-off-by: Sasha Levin --- drivers/net/wireless/ti/wl12xx/main.c | 3 --- drivers/net/wireless/ti/wlcore/main.c | 15 +-------------- drivers/net/wireless/ti/wlcore/wlcore.h | 3 --- 3 files changed, 1 insertion(+), 20 deletions(-) diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c index 22009e14a8fc1..9bd635ec7827b 100644 --- a/drivers/net/wireless/ti/wl12xx/main.c +++ b/drivers/net/wireless/ti/wl12xx/main.c @@ -648,7 +648,6 @@ static int wl12xx_identify_chip(struct wl1271 *wl) wl->quirks |= WLCORE_QUIRK_LEGACY_NVS | WLCORE_QUIRK_DUAL_PROBE_TMPL | WLCORE_QUIRK_TKIP_HEADER_SPACE | - WLCORE_QUIRK_START_STA_FAILS | WLCORE_QUIRK_AP_ZERO_SESSION_ID; wl->sr_fw_name = WL127X_FW_NAME_SINGLE; wl->mr_fw_name = WL127X_FW_NAME_MULTI; @@ -672,7 +671,6 @@ static int wl12xx_identify_chip(struct wl1271 *wl) wl->quirks |= WLCORE_QUIRK_LEGACY_NVS | WLCORE_QUIRK_DUAL_PROBE_TMPL | WLCORE_QUIRK_TKIP_HEADER_SPACE | - WLCORE_QUIRK_START_STA_FAILS | WLCORE_QUIRK_AP_ZERO_SESSION_ID; wl->plt_fw_name = WL127X_PLT_FW_NAME; wl->sr_fw_name = WL127X_FW_NAME_SINGLE; @@ -701,7 +699,6 @@ static int wl12xx_identify_chip(struct wl1271 *wl) wl->quirks |= WLCORE_QUIRK_TX_BLOCKSIZE_ALIGN | WLCORE_QUIRK_DUAL_PROBE_TMPL | WLCORE_QUIRK_TKIP_HEADER_SPACE | - WLCORE_QUIRK_START_STA_FAILS | WLCORE_QUIRK_AP_ZERO_SESSION_ID; wlcore_set_min_fw_ver(wl, WL128X_CHIP_VER, diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c index eb3a7971c1d34..9f568034deb35 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c @@ -2832,21 +2832,8 @@ static int wlcore_join(struct wl1271 *wl, struct wl12xx_vif *wlvif) if (is_ibss) ret = wl12xx_cmd_role_start_ibss(wl, wlvif); - else { - if (wl->quirks & WLCORE_QUIRK_START_STA_FAILS) { - /* - * TODO: this is an ugly workaround for wl12xx fw - * bug - we are not able to tx/rx after the first - * start_sta, so make dummy start+stop calls, - * and then call start_sta again. - * this should be fixed in the fw. - */ - wl12xx_cmd_role_start_sta(wl, wlvif); - wl12xx_cmd_role_stop_sta(wl, wlvif); - } - + else ret = wl12xx_cmd_role_start_sta(wl, wlvif); - } return ret; } diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h index 95fbedc8ea342..a75b43f5a6c2a 100644 --- a/drivers/net/wireless/ti/wlcore/wlcore.h +++ b/drivers/net/wireless/ti/wlcore/wlcore.h @@ -560,9 +560,6 @@ wlcore_set_min_fw_ver(struct wl1271 *wl, unsigned int chip, /* Each RX/TX transaction requires an end-of-transaction transfer */ #define WLCORE_QUIRK_END_OF_TRANSACTION BIT(0) -/* the first start_role(sta) sometimes doesn't work on wl12xx */ -#define WLCORE_QUIRK_START_STA_FAILS BIT(1) - /* wl127x and SPI don't support SDIO block size alignment */ #define WLCORE_QUIRK_TX_BLOCKSIZE_ALIGN BIT(2) -- 2.27.0