From patchwork Fri Jan 9 11:14:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 5599021 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 E6AE0C058D for ; Fri, 9 Jan 2015 11:15:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 133AB20529 for ; Fri, 9 Jan 2015 11:15:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AC4E8204DF for ; Fri, 9 Jan 2015 11:15:23 +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 1Y9XX6-0007jY-Ri; Fri, 09 Jan 2015 11:15:12 +0000 Received: from mail-wg0-x235.google.com ([2a00:1450:400c:c00::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y9XX2-0006TN-DT for ath10k@lists.infradead.org; Fri, 09 Jan 2015 11:15:09 +0000 Received: by mail-wg0-f53.google.com with SMTP id x13so7511612wgg.12 for ; Fri, 09 Jan 2015 03:14:46 -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:in-reply-to:references; bh=nw3ab3SDBlXo76fHDB3LZHyGHJ8sj49yg1RUrBH9AX4=; b=m2Qphue/WCkAitqf4qxrNWYcPzi56rWXvwzmDi6A5lZQToWgkehFU/Rs1t2S043veS bahSRwtjwMU0vpMAW9eLCcYyI6+ByqP/5ulfUft/bomTu9xUYW43/T+pmsom5VON6yoy qDJ7PXP9pn976e8CHZO+3r3BCL5nj3G5mQqbs= 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=nw3ab3SDBlXo76fHDB3LZHyGHJ8sj49yg1RUrBH9AX4=; b=NGsgZ0xEJG0dy88Me90Lo2Qm2mgQt3Cn+OI1okf+SbixWIEfOz4Djps6sPZBDuUfiR a64LdCDKFh+SSTxDjiXr1CeQmsQPoFBp3xLopd4VhzvIqQ8NTdoATkZnWGi6ChzALavh WtLn3O5qw7IpDKWvLr0osXbtowWHWjb4aKOD1TpuIDYVE9nIbPJIrEcrSAUht9Ulfu+/ W2M12zb1Dl97Vooj9drgVNitDF2CYYpt7qHPZvvwAUFrRMn8Srq5opP6Ss6hA25JwD3E huMutRu7auxANRaXPK1mVLFNvwtCsWVecM4TvuowWZ3MWivMy/uvIOE3PZmoYhuGO4cB PxEA== X-Gm-Message-State: ALoCoQmsdCra8gPcs0MVO2Hx6lGfCYycvO6VZm4QyKhny3PHscOaKVbYu7AwbAanPQ69vZKMlBAAx93rkQBY6dihRz/0HxeJo1s+Scx1rhZn0m0qERzr6D2I35BhCj8oGcbBROB7cvrgf1NnFp2Q8wKrleIkdHp65wamKzmZG5urGorof4NDbI8= X-Received: by 10.194.60.19 with SMTP id d19mr29997211wjr.48.1420802086158; Fri, 09 Jan 2015 03:14:46 -0800 (PST) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id gb10sm9612608wjb.21.2015.01.09.03.14.45 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Jan 2015 03:14:45 -0800 (PST) From: Michal Kazior To: ath10k@lists.infradead.org Subject: [RFC 1/8] ath10k: defer AP self-peer removal wait Date: Fri, 9 Jan 2015 12:14:02 +0100 Message-Id: <1420802049-11962-2-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1420802049-11962-1-git-send-email-michal.kazior@tieto.com> References: <1420802049-11962-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-20150109_031508_652660_B9F58054 X-CRM114-Status: UNSURE ( 9.32 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.8 (/) Cc: linux-wireless@vger.kernel.org, Michal Kazior X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 Some firmware revisions don't notify host about self-bss-peer removal until after associated vdev is deleted. This fixes AP teardown slowdowns and prevents 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 b4d4fec..e3ec6b6 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -3325,9 +3325,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); @@ -3341,6 +3342,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);