Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1977793pxb; Fri, 5 Mar 2021 04:37:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJyz3RbJ7CwUK6V7G28Lf9b5jiSXjw6fyiPaOfuu8tmoyhpgPJ5Bv+0yloNSr1p5WO/7GzkW X-Received: by 2002:a05:6402:1a3c:: with SMTP id be28mr8962177edb.125.1614947839913; Fri, 05 Mar 2021 04:37:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614947839; cv=none; d=google.com; s=arc-20160816; b=xDxfCpckyo9a4/v9O8vrTtzQ0aPCoOn+yP3XCtPv6lmlmSOpsMcZEP0RHTWmeyEfwC 2w0Ticknjkl1dfMDpN1UDHELDy39qNux3LKHDJJi17d7ECN4bwerSgwsa3pc21kGDYbs ara0P3ysTv0mAg9MiEWFxDRz2ZhEkG37CZg2FxuC9bv/wC4aa10CjHiEt1GMWLBa9nqI yuQQ9atoNUGJg+xW6owAWUBELqT/NPQagQ0xs8OO/B1JKs1X2NbVCrK4QfSPiAXG9nWx WojmYhMNtvRNicaSVIXex2PqNg2QHZvMOiMpe1nUNs9XYKNbaAu7Ewvk+uM++aNvLehE TJHw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fjNE4CsZz/b4CdNZvlSJStDYh47wh4wvxkUQHRwW87I=; b=IYxFGq4pSzq5YMMH5EB4fsMA7wtldpwZVE/8HzpcQbSk3XM6RcfrSX1DZCYkwpMNni xusdcvu/k6+84nXVU1RHQd1Zf5rBtIE93BvmOVF3YcoB3LEVpZBwi8Wl99A/cajh+wJY nYqT86XHiUj/Y3BdRQF1cTpw4FTQv5dJOJ+NKed516eJ9qFgxSullorxbJujDDfYHuXW sLy0fJWOsRydehS1W8njirFvTWI6zHICIZOH6u84bUyLDI5SFoGDA/S9TWwuSq0dFjuj BJTDlZnmChi4aLVbl8/IYeljNp2D2XLY4HFqG1Q1Up0awYdGv7Y9vzCrEFMaYMxAnolG mdMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bftpFpln; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v24si1360173eja.84.2021.03.05.04.36.57; Fri, 05 Mar 2021 04:37:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=bftpFpln; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232828AbhCEMfx (ORCPT + 99 others); Fri, 5 Mar 2021 07:35:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:47440 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232781AbhCEMf0 (ORCPT ); Fri, 5 Mar 2021 07:35:26 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1A06D6501B; Fri, 5 Mar 2021 12:35:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614947725; bh=rogCNzfi93XtoYDT4BTfo9cWeB3Q9a5K03AptW41Ko0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bftpFplnk83YxTvSAhnQbL6uT5VUxtuzPD8A9n0qmYCw8zuByv1dlMjd45BSB0t22 7UHdwbwuimykHpUcGCP1howVq4A3AJKKONFqclyrPgPOLlqVX+x826Tcgtt1zsA7VI lyImkfDgJFx4xIVUSjL4phi1gpAr9EgklDki8CmI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Raz Bouganim , Tony Lindgren , Kalle Valo , Sasha Levin Subject: [PATCH 5.4 31/72] wlcore: Fix command execute failure 19 for wl12xx Date: Fri, 5 Mar 2021 13:21:33 +0100 Message-Id: <20210305120858.854933128@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210305120857.341630346@linuxfoundation.org> References: <20210305120857.341630346@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 3c9c623bb428..9d7dbfe7fe0c 100644 --- a/drivers/net/wireless/ti/wl12xx/main.c +++ b/drivers/net/wireless/ti/wl12xx/main.c @@ -635,7 +635,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; @@ -659,7 +658,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; @@ -688,7 +686,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 5f74cf821068..be0ed19f9356 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c @@ -2862,21 +2862,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 b7821311ac75..81c94d390623 100644 --- a/drivers/net/wireless/ti/wlcore/wlcore.h +++ b/drivers/net/wireless/ti/wlcore/wlcore.h @@ -547,9 +547,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.30.1