From patchwork Thu Apr 7 06:41:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajkumar Manoharan X-Patchwork-Id: 8769171 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 87F559FBEA for ; Thu, 7 Apr 2016 06:42:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C1CB0201C8 for ; Thu, 7 Apr 2016 06:42:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D0543201BC for ; Thu, 7 Apr 2016 06:42:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751559AbcDGGmc (ORCPT ); Thu, 7 Apr 2016 02:42:32 -0400 Received: from wolverine01.qualcomm.com ([199.106.114.254]:62832 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751232AbcDGGmb (ORCPT ); Thu, 7 Apr 2016 02:42:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1460011351; x=1491547351; h=from:to:cc:subject:date:message-id:mime-version; bh=DtoxCqu0BX1KD4WPyKX2ADFhjtAempF08VfURYe2w4A=; b=seQsQY6ctvgFWyCuNJ8rMMMgpRIDln5V+8L6WaqVv9Dlej0J7wdFRn6R tqCR2G3C2oDrrLCKjQdTtUv9PLglN648k7wD6rGgxSAcjQw9oM8V/JfWQ TfbiU+0qfRkMqSk1HOLbMu5Zi3THIemdXk/EYJilZ/2QxEoEqMWBAlZaV M=; X-IronPort-AV: E=Sophos;i="5.24,448,1455004800"; d="scan'208";a="183175121" Received: from ironmsg02-r-new.qualcomm.com (HELO ironmsg02-R.qualcomm.com) ([10.53.140.106]) by wolverine01.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 06 Apr 2016 23:42:30 -0700 X-IronPort-AV: E=McAfee;i="5700,7163,8127"; a="704382168" Received: from nasanexm01g.na.qualcomm.com ([10.85.0.33]) by ironmsg02-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 06 Apr 2016 23:42:30 -0700 Received: from aphydexm01b.ap.qualcomm.com (10.252.127.11) by NASANEXM01G.na.qualcomm.com (10.85.0.33) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Wed, 6 Apr 2016 23:42:29 -0700 Received: from qcmail1.qualcomm.com (10.80.80.8) by aphydexm01b.ap.qualcomm.com (10.252.127.11) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Thu, 7 Apr 2016 12:12:04 +0530 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Thu, 07 Apr 2016 12:11:55 +0530 From: Rajkumar Manoharan To: CC: , , "Rajkumar Manoharan" , Subject: [PATCH] ath10k: fix rx_channel during hw reconfigure Date: Thu, 7 Apr 2016 12:11:54 +0530 Message-ID: <1460011314-15978-1-git-send-email-rmanohar@qti.qualcomm.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01B.na.qualcomm.com (10.85.0.82) To aphydexm01b.ap.qualcomm.com (10.252.127.11) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Upon firmware assert, restart work will be triggered so that mac80211 will reconfigure the driver. An issue is reported that after restart work, survey dump data do not contain in-use (SURVEY_INFO_IN_USE) info for operating channel. During reconfigure, since mac80211 already has valid channel context for given radio, channel context iteration return num_chanctx > 0. Hence rx_channel is always NULL. Fix this by assigning channel context to rx_channel when driver restart is in progress. Cc: stable@vger.kernel.org Signed-off-by: Rajkumar Manoharan --- drivers/net/wireless/ath/ath10k/mac.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index b0e613bc10a5..e31469dd58dd 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -6867,7 +6867,13 @@ ath10k_mac_update_rx_channel(struct ath10k *ar, def = &vifs[0].new_ctx->def; ar->rx_channel = def->chan; - } else if (ctx && ath10k_mac_num_chanctxs(ar) == 0) { + } else if ((ctx && ath10k_mac_num_chanctxs(ar) == 0) || + (ctx && (ar->state == ATH10K_STATE_RESTARTED))) { + /* During driver restart due to firmware assert, since mac80211 + * already has valid channel context for given radio, channel + * context iteration return num_chanctx > 0. So fix rx_channel + * when restart is in progress. + */ ar->rx_channel = ctx->def.chan; } else { ar->rx_channel = NULL;