From patchwork Wed Mar 20 22:09:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 2309711 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 24ACDDF24C for ; Wed, 20 Mar 2013 22:09:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752382Ab3CTWJ4 (ORCPT ); Wed, 20 Mar 2013 18:09:56 -0400 Received: from mail-ee0-f50.google.com ([74.125.83.50]:44848 "EHLO mail-ee0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752257Ab3CTWJz (ORCPT ); Wed, 20 Mar 2013 18:09:55 -0400 Received: by mail-ee0-f50.google.com with SMTP id e51so1452408eek.9 for ; Wed, 20 Mar 2013 15:09:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=x-received:from:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id; bh=E6wWU7kqq1CtvTwHVUHzlY8BBigDDtB1RY4DDmtos3Y=; b=IJQSh9XqDaOQzWIDmKenR1AU+Fj62BLpCn0WiYcjeZN8ZLY+P4U+XUfF/dexS18TkU JkTgh3Rh0rgWtqkm+Uqv1EI8M/QK/XHcGR9u9C8wos1J1mHZvxp9TpalIELEJ1ubfY6q cpF21Kt0aWxg3e7XdG5g0PXA65tzsH8wkdUlQvWoGMa/Qfl55gyxEasmaRBj3vgFu+T5 cQzeqqeWBRILZH4nvyfydan/iVqdLuUjdvZsGlNi29xfkD4p4DijTBnCvWBLqvC5sf2S by04B8c7kv77O0KLB7Qk5rqxO71Yz6QEld0J3OJ3GoIEVZebH71orZjBiV5pkA+deB1e l0Jw== X-Received: by 10.14.110.68 with SMTP id t44mr75736971eeg.25.1363817394502; Wed, 20 Mar 2013 15:09:54 -0700 (PDT) Received: from blech.mobile (f053222038.adsl.alicedsl.de. [78.53.222.38]) by mx.google.com with ESMTPS id q42sm5092977eem.14.2013.03.20.15.09.52 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 20 Mar 2013 15:09:53 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by blech.mobile (Postfix) with ESMTP id D6319100589; Wed, 20 Mar 2013 23:09:48 +0100 (CET) Received: from blech.mobile ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MYZe4NgIY24X; Wed, 20 Mar 2013 23:09:47 +0100 (CET) Received: from blech.localnet (localhost [127.0.0.1]) by blech.mobile (Postfix) with ESMTP id D882D100576; Wed, 20 Mar 2013 23:09:47 +0100 (CET) From: Christian Lamparter To: Marco Fonseca Subject: Re: carl9170: monitor mode hangs due to channel changes Date: Wed, 20 Mar 2013 23:09:47 +0100 User-Agent: KMail/1.13.7 (Linux/3.9.0-rc3+; KDE/4.8.4; x86_64; ; ) Cc: linux-wireless@vger.kernel.org References: <20130320205013.GA3462@192.168.1.10> In-Reply-To: <20130320205013.GA3462@192.168.1.10> MIME-Version: 1.0 Message-Id: <201303202309.47596.chunkeey@googlemail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hello, On Wednesday, March 20, 2013 09:50:13 PM Marco Fonseca wrote: > I'm seeing a problem with the carl driver. If I change channels > repeatedly on the 2.4ghz band, monitoring (e.g. tcpdump) will > eventually halt. I've seen this on various versions of the carl > driver/firmware (both from 1.9.4 to 1.9.7) thanks for reporting this. You could try either of the attached patch and test if it alleviate the issue. If the patches do help then the problem is caused by rf/phy (code) [which is a problem since the rf/phy parts are taken from the vendor driver as we have no docs or specs for it]. Regards, Chr --- Patch 1: just reinitialize AGC_CONTROL (can also be moved behind CMD_FREQ_START) --- --- -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/wireless/ath/carl9170/phy.c b/drivers/net/wireless/ath/carl9170/phy.c index b72c09c..7fffee6 100644 --- a/drivers/net/wireless/ath/carl9170/phy.c +++ b/drivers/net/wireless/ath/carl9170/phy.c @@ -1638,6 +1638,13 @@ int carl9170_set_channel(struct ar9170 *ar, struct ieee80211_channel *channel, cmd = CARL9170_CMD_FREQUENCY; } + err = carl9170_write_reg(ar, AR9170_PHY_REG_AGC_CONTROL, + carl9170_def_val(AR9170_PHY_REG_AGC_CONTROL, + channel->band == IEEE80211_BAND_2GHZ, + conf_is_ht40(&ar->hw->conf))); + if (err) + return err; + err = carl9170_exec_cmd(ar, CARL9170_CMD_FREQ_START, 0, NULL, 0, NULL); if (err) return err; --- Patch 2: always do warm reset when changing channels --- diff --git a/drivers/net/wireless/ath/carl9170/phy.c b/drivers/net/wireless/ath/carl9170/phy.c index b72c09c..643cc57 100644 --- a/drivers/net/wireless/ath/carl9170/phy.c +++ b/drivers/net/wireless/ath/carl9170/phy.c @@ -1578,7 +1578,7 @@ int carl9170_set_channel(struct ar9170 *ar, struct ieee80211_channel *channel, u32 cmd, tmp, offs = 0, new_ht = 0; int err; enum carl9170_bw bw; - bool warm_reset; + bool warm_reset = true; struct ieee80211_channel *old_channel = NULL; bw = nl80211_to_carl(_bw); @@ -1592,14 +1592,7 @@ int carl9170_set_channel(struct ar9170 *ar, struct ieee80211_channel *channel, /* may be NULL at first setup */ if (ar->channel) { old_channel = ar->channel; - warm_reset = (old_channel->band != channel->band) || - (old_channel->center_freq == - channel->center_freq) || - (ar->ht_settings != new_ht); - ar->channel = NULL; - } else { - warm_reset = true; } /* HW workaround */