Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3501234pxf; Mon, 15 Mar 2021 10:56:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynsaqWYNavpkqkdtmsFQlY/R5YmazPmbubw6UKZJwEgzcKHzwb0bVyg273FPTw9QqYzXCO X-Received: by 2002:a17:906:8147:: with SMTP id z7mr24087804ejw.436.1615830974708; Mon, 15 Mar 2021 10:56:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615830974; cv=none; d=google.com; s=arc-20160816; b=oh1GxQl91+PNWjw0A4W5IKHFCHvu0J5erzu5to2+8r0EP61/8DZfzZg2s7bh9uGye4 8XAZGzoW6i8oOcQNrqyrEp8+pZBJ7AryNp1xwzig3oZYJml7VctH2u38gmpyeTCbwnRQ Ur0VoE2TS0IR4Lxp/bFyAeiurxLuCQ6c+iiAZoyfUd+cg0v5WzNjmyQnrBBphgyiGmx0 Ag82MLQFQ3CZayyLKLTI3VhY2SjDR0914A0yRnj12gJH/L6NOo/8ir0fdrUDb4DI39Zb cDq3AthPGHOGGLxdv53Tqpl9iKcXcYJAj4xyvSm37p96U+TdB+t99jGjg+vKR63yolTR uCdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8LliLGjrV7tHsSfS0ACsoV5f19x1ixyydGjjdENNDAw=; b=N0asPbXv7KENYiNtCgUeeKVdUgl1k0ZAKSJVdP2A7bF7dBPo5Mbenlq23mYzM3Cr09 ReippGPwhMTcrjo6+HaASVd/exBe9eNd9KX+j4oatjrlEcj8hOKR7qbSLI/E6Y6aIfYD lyvQTJmswN/jwq31xmU+RWajHMdAXfuBw1zAQh+QBOWzmRx4+magNtNJNloFcwVUNBAs FaVIeqveb1l/Ta8v7RTvrGZAo/6/PKFAmxVicVAGIUKmLyEiFQANGoZ5XYMmAhWZ9lxP wW61+qjK5BZjB3cPQMLxg0O18xaaR0ntJyoKU+WUPaKHIs2KdVSc14/Y1mNDYrwiAJDb ZX2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="MuK/6X/l"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hp15si11608616ejc.548.2021.03.15.10.55.46; Mon, 15 Mar 2021 10:56:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="MuK/6X/l"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233688AbhCOOCS (ORCPT + 99 others); Mon, 15 Mar 2021 10:02:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:33716 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231707AbhCON4t (ORCPT ); Mon, 15 Mar 2021 09:56:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 735B064F31; Mon, 15 Mar 2021 13:56:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816597; bh=MLwSzS5Vnp2OoJVdpI1dqdnD2DwcwS0rspTGTGTA9UM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MuK/6X/lVp9SsuNu+J+yJaZlxXbFyJikr7x+ZTqkNzvhlAXL73x78dNNbtIzGuRMF TNzF9FWAabXRzJGfRBhfw6NFabHOGHRSlg7e8ifYddDzjoQyPqcqeARrBrTkfrOKG1 7d3+6/QX6Ck3Y4uv+C13WBugEf3ytXHFLKz9WpM0= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kalle Valo Subject: [PATCH 5.11 012/306] ath11k: fix AP mode for QCA6390 Date: Mon, 15 Mar 2021 14:51:15 +0100 Message-Id: <20210315135508.030734513@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Kalle Valo commit 77d7e87128d4dfb400df4208b2812160e999c165 upstream. Commit c134d1f8c436 ("ath11k: Handle errors if peer creation fails") completely broke AP mode on QCA6390: kernel: [ 151.230734] ath11k_pci 0000:06:00.0: failed to create peer after vdev start delay: -22 wpa_supplicant[2307]: Failed to set beacon parameters wpa_supplicant[2307]: Interface initialization failed wpa_supplicant[2307]: wlan0: interface state UNINITIALIZED->DISABLED wpa_supplicant[2307]: wlan0: AP-DISABLED wpa_supplicant[2307]: wlan0: Unable to setup interface. wpa_supplicant[2307]: Failed to initialize AP interface This was because commit c134d1f8c436 ("ath11k: Handle errors if peer creation fails") added error handling for ath11k_peer_create(), which had been failing all along but was unnoticed due to the missing error handling. The actual bug was introduced already in commit aa44b2f3ecd4 ("ath11k: start vdev if a bss peer is already created"). ath11k_peer_create() was failing because for AP mode the peer is created already earlier op_add_interface() and we should skip creation here, but the check for modes was wrong. Fixing that makes AP mode work again. This shouldn't affect IPQ8074 nor QCN9074 as they have hw_params.vdev_start_delay disabled. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Fixes: c134d1f8c436 ("ath11k: Handle errors if peer creation fails") Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1614006849-25764-1-git-send-email-kvalo@codeaurora.org Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/ath/ath11k/mac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -5299,8 +5299,8 @@ ath11k_mac_op_assign_vif_chanctx(struct } if (ab->hw_params.vdev_start_delay && - (arvif->vdev_type == WMI_VDEV_TYPE_AP || - arvif->vdev_type == WMI_VDEV_TYPE_MONITOR)) { + arvif->vdev_type != WMI_VDEV_TYPE_AP && + arvif->vdev_type != WMI_VDEV_TYPE_MONITOR) { param.vdev_id = arvif->vdev_id; param.peer_type = WMI_PEER_TYPE_DEFAULT; param.peer_addr = ar->mac_addr;