Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1528928lqa; Mon, 29 Apr 2024 10:58:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUltG/nY9inQE4BlKrJti06ftrGEeO32XFDFG/fpsqu6rJPx9SeMgPdl/gzbLwzmfGyG3Our4mGc3mvBDLkrC+oBdq2RiiU6dNBCEwu2g== X-Google-Smtp-Source: AGHT+IHSEDikdr1nDPxU+T2BX1smvhTGJ+RMxCpzq75qYLI57JCOMO24+gBIVE7HXr4lBKpTeR1L X-Received: by 2002:a05:690c:d81:b0:61b:3304:b724 with SMTP id da1-20020a05690c0d8100b0061b3304b724mr11100741ywb.10.1714413495728; Mon, 29 Apr 2024 10:58:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714413495; cv=pass; d=google.com; s=arc-20160816; b=Tcrl6fqeWTL4G0/aRc+0MUOauyvGihSx7HT+MVpUY7Kaf02w52UYnP5OxlygnVPEKn 9VLwUQiMsgBnRqE4dbZMFDlkAfVqVJ5I2IpNfN1zM2ReM2BAysRlCZHN58Ay+6Qce6sR rjs4G1ZALjPm/TbLoFjNBCFgez/HL4ntHApnD0YpTQ0H3i3ttSVLa8j0lNmcjRq/BxS4 vb3XNV+zzURmJ0CmIB0v/zTC8/VJhJGkPcO474KwhoJ0Ple18Dhg2jSmb1HmeeqRUwBI uofZK0Z0WS7uZ9JBRHU6V4AWUNzTpBbMJ0jydOrBboFvIFs1imlzMvkAsSpEI8jb3Qx4 z/uw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id:dkim-signature; bh=7SibA/Ql+XBg+fLqRKXHnbTQ4WwI0I66p3A9mv5LAXs=; fh=W9u7LD1eSKmMk2q+qTuerfw0q38uetajqeZJcQPgeZI=; b=r+BDmvx1S26uAYw0seywFLj5Uhq8qE4cpjxQAlT62NG5oNZnQQ59hllecmb35RrykL yLNDdpsZ/4XIYJvpSJrjm1Sh31Ky6E76k9iVD4fh+yx3o8PplNCiDVTToTrbPUSE3oSD HmmvdAjWl+uz+igFqO88LbvkM/3IEHfBHwNuT/UBoAza3yw8iwTjLV4l3nnJAkbLuoKz Tar4+valwuXA5ebej9/iHhQDl/1ssheGYHUFTSgqWaF4FPfADcM2RTipQQR4DqmcuR+H ZOMp/3fsua1orbC0pddRBqjOJy8T0Kk1X+cPsNiUA+d6uOkLFPAGTUr/48WtJWl1+UDO ptDA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ibXU8cZY; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-wireless+bounces-7001-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7001-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id c8-20020a05622a024800b0043af565a4e8si2288834qtx.499.2024.04.29.10.58.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 10:58:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-7001-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ibXU8cZY; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-wireless+bounces-7001-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7001-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 739361C21545 for ; Mon, 29 Apr 2024 17:58:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E768A126F0A; Mon, 29 Apr 2024 17:57:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ibXU8cZY" X-Original-To: linux-wireless@vger.kernel.org Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 415A571727 for ; Mon, 29 Apr 2024 17:57:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714413477; cv=none; b=ZO2U4EcB19McyJ6wbnp4W62aPBqs4bm2UivfU3FiNARwmyE+zH8oe4FVTHSR8svy2AKEwN2NzsTHY/cMLOjJVT7pNUPkHn2bdwIFncwA5d5WEXFo+whNlLfMcKLFE9RbhVqO0Rc4g1zZs/U0JaQ9D8pJIIYBtQptAiRbLL6B3aI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714413477; c=relaxed/simple; bh=1vpui76ReUU+ZNOMGsNcUKgtm7jtNOXDU+JTxeE9GDE=; h=Message-ID:Date:MIME-Version:To:Cc:From:Subject:Content-Type; b=ROJbygN2G1Gg0FdjD4OTv4ADntPbdZ8sFHgwtvH9aPQ01X7Y5uCnDzUTUuyIC4fAAfqY8R93m+GX8IbbV2Tq+6vgpd8kW8MmWpL+C6HI8HG9pQWAmOfqYQNzvb4ci1bt9Ftg4oj5n8wa749oRdjgnkyWWG6ww5REH6khDu/0AZQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ibXU8cZY; arc=none smtp.client-ip=209.85.221.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-34d1ede7e51so803631f8f.1 for ; Mon, 29 Apr 2024 10:57:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714413474; x=1715018274; darn=vger.kernel.org; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=7SibA/Ql+XBg+fLqRKXHnbTQ4WwI0I66p3A9mv5LAXs=; b=ibXU8cZYmCtq2HNJGZHrdcc5B0L2BBmtNFM+PAvsCDPOFH1+b3HAifyLDCxfcCY6qO Rib2/90sI9D1l5wUqQiNpgdJXkE44IT8pe/iJ9ssW9TCK84f4zyd10bI/mlUffphoYql gI/isMJV5aXOJbh5pH4G1mNUyKVPzraiVzdsWt6LCONQR213KeOeY32DfozrfKf3OBeQ gB68woby2Y0iWsNPJx/uy/ltz+vns5vvhhyUJCNsrgNCyGNc7MQ7iO+qjFDeacIJv4nn c+stloEnNUXswgPUC5Bw//s8eGuei5945coLhM/WESELTfPsPojovAdrj1lwCEjAI5MD Lhmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714413474; x=1715018274; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=7SibA/Ql+XBg+fLqRKXHnbTQ4WwI0I66p3A9mv5LAXs=; b=m46NugnHag8V+vPuKCA+DzBVO1ne8xbWrd1V9XH3uQdH7JZ+Hh+vSNl8CxA/jc2YgI WGCwGq4A0CEsj31ITG6UKkYVxkLzC51nxV//SvmysqE3hr5SCYeHQ/QeZt/5DhtsrS3Q QTOWLJwcDz+VnD1K67zgtXMeaUfYrr0gOkvn4hBuS8B7UyjNWEK0zad7sSwZCBl/OzLA 01QhfRKRpXDWRjmAJDQNuNt6jNq5NSo2y/ReKEuvkm5K35QgSh7A+YH+SzzYnY0qwd/X S2UXG7yPGI7SHS4T7IAhSDJyumo5bRXYqfZqwXLKrs+9S5nKmHEZG9lBNWU1hqy5F7wG 61GQ== X-Gm-Message-State: AOJu0YyLiPIiRiQaIE8u4HWMFjLWFcJ8B8qQMfGvE9W0onv+avqvcy8X 8cx0KlISCJOSf6owQE0QKvFdIv/qnVY55zo5AxIUg1fNrgfcqEPKQd7Na6dk X-Received: by 2002:adf:e789:0:b0:34b:5d10:1d48 with SMTP id n9-20020adfe789000000b0034b5d101d48mr328841wrm.26.1714413474256; Mon, 29 Apr 2024 10:57:54 -0700 (PDT) Received: from [192.168.1.50] ([79.113.154.240]) by smtp.gmail.com with ESMTPSA id z18-20020a5d6412000000b00347ec0469b2sm30012085wru.46.2024.04.29.10.57.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 29 Apr 2024 10:57:54 -0700 (PDT) Message-ID: Date: Mon, 29 Apr 2024 20:57:52 +0300 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: "linux-wireless@vger.kernel.org" Cc: Ping-Ke Shih , Sascha Hauer From: Bitterblue Smith Subject: [PATCH] wifi: rtw88: usb: Fix disconnection after beacon loss Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit When there is beacon loss, for example due to unrelated Bluetooth devices transmitting music nearby, the wifi connection dies soon after the first beacon loss message: Apr 28 20:47:14 ideapad2 wpa_supplicant[1161]: wlp3s0f3u4: CTRL-EVENT-BEACON-LOSS Apr 28 20:47:15 ideapad2 wpa_supplicant[1161]: wlp3s0f3u4: CTRL-EVENT-DISCONNECTED bssid=... reason=4 locally_generated=1 Apr 28 20:47:24 ideapad2 wpa_supplicant[1161]: wlp3s0f3u4: CTRL-EVENT-BEACON-LOSS Apr 28 20:47:25 ideapad2 wpa_supplicant[1161]: wlp3s0f3u4: CTRL-EVENT-DISCONNECTED bssid=... reason=4 locally_generated=1 Apr 28 20:47:34 ideapad2 wpa_supplicant[1161]: wlp3s0f3u4: CTRL-EVENT-BEACON-LOSS Apr 28 20:47:35 ideapad2 wpa_supplicant[1161]: wlp3s0f3u4: CTRL-EVENT-DISCONNECTED bssid=... reason=4 locally_generated=1 When the beacon loss happens, mac80211 makes rtw88 transmit a QOS NULL frame and asks to confirm the ACK status. Even though rtw88 confirms to mac80211 that the QOS NULL was transmitted successfully, the connection still dies. This is because rtw88 is handing the QOS NULL back to mac80211 with skb->data pointing to the headroom (the TX descriptor) instead of ieee80211_hdr. Fix the disconnection by moving skb->data to the correct position before ieee80211_tx_status_irqsafe(). The problem was observed with RTL8811AU (TP-Link Archer T2U Nano) and the potential future rtw88_8821au driver. Also tested with RTL8811CU (Tenda U9). Cc: stable@vger.kernel.org Signed-off-by: Bitterblue Smith --- drivers/net/wireless/realtek/rtw88/usb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw88/usb.c b/drivers/net/wireless/realtek/rtw88/usb.c index 3ba7b81c6080..1dfe7c6ae4ba 100644 --- a/drivers/net/wireless/realtek/rtw88/usb.c +++ b/drivers/net/wireless/realtek/rtw88/usb.c @@ -278,6 +278,8 @@ static void rtw_usb_write_port_tx_complete(struct urb *urb) info = IEEE80211_SKB_CB(skb); tx_data = rtw_usb_get_tx_data(skb); + skb_pull(skb, rtwdev->chip->tx_pkt_desc_sz); + /* enqueue to wait for tx report */ if (info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS) { rtw_tx_report_enqueue(rtwdev, skb, tx_data->sn); -- 2.44.0