From patchwork Thu Jul 9 11:08:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 6755041 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8CDF9C05AF for ; Thu, 9 Jul 2015 11:09:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F137F206F9 for ; Thu, 9 Jul 2015 11:09:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4A566206BE for ; Thu, 9 Jul 2015 11:09:26 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZD9hd-0004Ol-Ck; Thu, 09 Jul 2015 11:09:17 +0000 Received: from mail-lb0-x22f.google.com ([2a00:1450:4010:c04::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZD9ha-0004GS-Vh for ath10k@lists.infradead.org; Thu, 09 Jul 2015 11:09:15 +0000 Received: by lblf12 with SMTP id f12so3424692lbl.2 for ; Thu, 09 Jul 2015 04:08:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=StEhePY7FgZjMCCxzBpVNrbDQOW8bQGfcm+CdrraHTo=; b=iRZHaqMOZMw075lxJ2gbC+5aCSN1vtDGrElsgCdR+pVaTEpNFN0Avbe9NRKHOYEoWN vD/09sa7K+uZKineGqSWvBq9HJI0HDxS0woM59PjXosKUt+FlzYFw2B2apxoD3ClbTb9 yfapn2pC+FiqFj6Ugu8aWjq5aANICndYDBF4Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=StEhePY7FgZjMCCxzBpVNrbDQOW8bQGfcm+CdrraHTo=; b=HJS+FSxK8ioMDKMrrS/UGHc0uFTD1jz3sCmG7VBgrfrj48yuZMr65cs2BX5ayyoqWG MJXWx0fAAWIrsitQByUtwexsbL6t9un2jjjGHeVlcB5fGKHfkueW/p1HMcSOjIzx2CzP Qt6XkfrkoF66azTnyoCFHzIq12igjrzEyvKxCHk3bq0jM92uMaTPoenVII4JbhVvohVq HvFba+0RwEVXWKsUyMqs0fhkGw6nTqtMJCa0RoZEELXJYijEyMvWAxc8jY7oRlPB90Et jMR0hppsjkC3HPqDwplm43OUKKl6Uw2l7BH5ZJDb7ktstcPVFoFh76MUOT5ldnQBYPjr bCVg== X-Gm-Message-State: ALoCoQnlyD9XsFj75vjEfNEP27snm2zMG9Mlu1zCfQf3H/OTbHhUrP1iEGJbrQF7PeI/n35QvB3kOroUgJs7UK/8peYB78sME+afXV7+jkdAiGiT7mTeKWfuJ5cq0/E2GaUu1P2/B9KUCIcsApmUzNOIlQ+rwMDqL6BMgdA6H+x6dExjvWxvWQDgcm50fvct8v6hJl/4Y0h3 X-Received: by 10.112.24.233 with SMTP id x9mr11331909lbf.7.1436440130368; Thu, 09 Jul 2015 04:08:50 -0700 (PDT) Received: from localhost.localdomain ([91.198.246.8]) by smtp.gmail.com with ESMTPSA id t15sm1433507lbk.0.2015.07.09.04.08.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Jul 2015 04:08:49 -0700 (PDT) From: Michal Kazior To: ath10k@lists.infradead.org Subject: [PATCH 3/6] ath10k: fix hw roc expiration notifcation Date: Thu, 9 Jul 2015 13:08:36 +0200 Message-Id: <1436440119-30231-4-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1436440119-30231-1-git-send-email-michal.kazior@tieto.com> References: <1436440119-30231-1-git-send-email-michal.kazior@tieto.com> X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150709_040915_202339_1016F616 X-CRM114-Status: GOOD ( 13.00 ) X-Spam-Score: 0.6 (/) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, Michal Kazior MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_SBL_CSS,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no 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 The expiration function must not be called when roc is explicitly cancelled by mac80211. However since fcf9844636be ("ath10k: fix hw roc expiration") the notification was never sent when roc actually expired. This fixes some P2P connection setup issues. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/core.h | 1 + drivers/net/wireless/ath/ath10k/mac.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 2e5c935579c4..78e07051b897 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -633,6 +633,7 @@ struct ath10k { bool is_roc; int vdev_id; int roc_freq; + bool roc_notify; } scan; struct { diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 115889cb0ff6..a060b7708f4a 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -3449,14 +3449,13 @@ void __ath10k_scan_finish(struct ath10k *ar) case ATH10K_SCAN_IDLE: break; case ATH10K_SCAN_RUNNING: - if (ar->scan.is_roc) - ieee80211_remain_on_channel_expired(ar->hw); - /* fall through */ case ATH10K_SCAN_ABORTING: if (!ar->scan.is_roc) ieee80211_scan_completed(ar->hw, (ar->scan.state == ATH10K_SCAN_ABORTING)); + else if (ar->scan.roc_notify) + ieee80211_remain_on_channel_expired(ar->hw); /* fall through */ case ATH10K_SCAN_STARTING: ar->scan.state = ATH10K_SCAN_IDLE; @@ -5459,6 +5458,7 @@ static int ath10k_remain_on_channel(struct ieee80211_hw *hw, ar->scan.is_roc = true; ar->scan.vdev_id = arvif->vdev_id; ar->scan.roc_freq = chan->center_freq; + ar->scan.roc_notify = true; ret = 0; break; case ATH10K_SCAN_STARTING: @@ -5522,7 +5522,13 @@ static int ath10k_cancel_remain_on_channel(struct ieee80211_hw *hw) struct ath10k *ar = hw->priv; mutex_lock(&ar->conf_mutex); + + spin_lock_bh(&ar->data_lock); + ar->scan.roc_notify = false; + spin_unlock_bh(&ar->data_lock); + ath10k_scan_abort(ar); + mutex_unlock(&ar->conf_mutex); cancel_delayed_work_sync(&ar->scan.timeout);