From patchwork Fri Jan 30 08:31:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 5747561 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 D5C329F358 for ; Fri, 30 Jan 2015 08:32:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 121262021A for ; Fri, 30 Jan 2015 08:32:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9180B20142 for ; Fri, 30 Jan 2015 08:32:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752244AbbA3Icm (ORCPT ); Fri, 30 Jan 2015 03:32:42 -0500 Received: from mail-wi0-f175.google.com ([209.85.212.175]:50729 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751644AbbA3Icm (ORCPT ); Fri, 30 Jan 2015 03:32:42 -0500 Received: by mail-wi0-f175.google.com with SMTP id fb4so1310444wid.2 for ; Fri, 30 Jan 2015 00:32:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id; bh=pVfhvtm1ZHFYbrTTs0BPUlJEMzy011cb/pWKRjmd1lY=; b=iMznpdHTqBlS9sG35w5hF/ltfVZMZKqkWvBICIZPLYF7i4H11FSGoNDtWBMRF4aCEH oMvbX5g3HUlSMZeqRZbC8VyH5jpssfCfh4NKKoXucjzucBsmcfOlCKSMCNdwWu0MOI3+ PqTL8MCSxAkksfKaZURm+4w7akODNdppExr/8= 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; bh=pVfhvtm1ZHFYbrTTs0BPUlJEMzy011cb/pWKRjmd1lY=; b=lXCDP7XomFhwf3mVSOq3DoMmZBy6urBSO1m3MGHgAKUCVE1lW/VxRuHco3UjDiut5t 8hgChQt8tGRmccgktcbfdAKxcOISmtks4ocp3SKXg/8ieVUQIyPI2DspscH+VeL77mYu c54qqZoSd4s5iaH4v1LHXyRwYEhJzWW1TaQCiRmY9s3mpxkIsHW6ADlzUkJq/HCssMem wl5KgR0K2vAKJF6UWzvGaGpmi0RtIEuZJuqHRuOPlSfB8JXXDSXMhr4kWz8HNLludvhT +cM2TvZ9YqKb+0+zJRBlilInbLgvD53REZRifYZZyLxETlEc0vBNYuQuf6dIbCOjIwbW qqog== X-Gm-Message-State: ALoCoQmpVLLgxyrXS9xAq09RPW0zMAPxoMEzbd+u9DXlUarCgg3YMYDWqx9hjtapgbWZf9nBK9iLRBv3DYBAppPnLmvD0uwH9eeN0svkZX2o5/hp7Yh6Oy44WuKHo7jOqwD/7tZnh3dU X-Received: by 10.194.120.40 with SMTP id kz8mr9541881wjb.21.1422606760595; Fri, 30 Jan 2015 00:32:40 -0800 (PST) Received: from bob.homerouter.cpe (apn-31-1-134-151.dynamic.gprs.plus.pl. [31.1.134.151]) by mx.google.com with ESMTPSA id er13sm13849902wjc.11.2015.01.30.00.32.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Jan 2015 00:32:39 -0800 (PST) From: Michal Kazior To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Michal Kazior Subject: [PATCH] ath10k: defer AP self-peer removal wait Date: Fri, 30 Jan 2015 09:31:22 +0100 Message-Id: <1422606682-12121-1-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 X-DomainID: tieto.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham 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 Some firmware revisions don't notify host about self-bss-peer removal until after associated vdev is deleted. This has been observed with qca6174 WLAN.RM.2.0-00073 firmware. This patch fixes AP teardown slowdowns and prevents delays and warnings: ath10k_pci 0000:00:05.0: failed to remove peer for AP vdev 0: -110 ath10k_pci 0000:00:05.0: removing stale peer xx:xx:xx:xx:xx:xx from vdev_id 0 ath10k_pci 0000:00:05.0: peer-unmap-event: unknown peer id 24 ath10k_pci 0000:00:05.0: peer-unmap-event: unknown peer id 8 Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/mac.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 15e47f4..75f2564 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -3377,9 +3377,10 @@ static void ath10k_remove_interface(struct ieee80211_hw *hw, list_del(&arvif->list); if (arvif->vdev_type == WMI_VDEV_TYPE_AP) { - ret = ath10k_peer_delete(arvif->ar, arvif->vdev_id, vif->addr); + ret = ath10k_wmi_peer_delete(arvif->ar, arvif->vdev_id, + vif->addr); if (ret) - ath10k_warn(ar, "failed to remove peer for AP vdev %i: %d\n", + ath10k_warn(ar, "failed to submit AP self-peer removal on vdev %i: %d\n", arvif->vdev_id, ret); kfree(arvif->u.ap.noa_data); @@ -3393,6 +3394,21 @@ static void ath10k_remove_interface(struct ieee80211_hw *hw, ath10k_warn(ar, "failed to delete WMI vdev %i: %d\n", arvif->vdev_id, ret); + /* Some firmware revisions don't notify host about self-peer removal + * until after associated vdev is deleted. + */ + if (arvif->vdev_type == WMI_VDEV_TYPE_AP) { + ret = ath10k_wait_for_peer_deleted(ar, arvif->vdev_id, + vif->addr); + if (ret) + ath10k_warn(ar, "failed to remove AP self-peer on vdev %i: %d\n", + arvif->vdev_id, ret); + + spin_lock_bh(&ar->data_lock); + ar->num_peers--; + spin_unlock_bh(&ar->data_lock); + } + ath10k_peer_cleanup(ar, arvif->vdev_id); mutex_unlock(&ar->conf_mutex);