From patchwork Mon Sep 13 13:01:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 511493 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65904C433EF for ; Mon, 13 Sep 2021 13:03:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 51AA560F9F for ; Mon, 13 Sep 2021 13:03:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238215AbhIMNDm (ORCPT ); Mon, 13 Sep 2021 09:03:42 -0400 Received: from mail-dm6nam12on2064.outbound.protection.outlook.com ([40.107.243.64]:19681 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S237853AbhIMNDi (ORCPT ); Mon, 13 Sep 2021 09:03:38 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gIJ8/r6Dfopq1NexW056kxnr+fquFXRQzEoBg+286Ym4DyXPM2t2KDAUL+2HK1ZzSBvVTVV00vROXQACwWd7DMD6q5vPRcl2hCVAVbhqKuHJba/kOsQs7lFDNyLovVLf/++UhdX7TOSoXurbQaGt4YwczT5JwUjyQFPOkxbf10zvL/oazwpQfWVmwPQOnqElUUvDmKIXAAeGEI+hEWin6FQFLCqJ6ro/joBwlFa8M7PfGaIGAmjZgrG0RXfTzuMEzbNY69LXotOagHsJgrS4rcZS48c36WiNhrjTwwvCdB1n8vSGyuBbw6rymY0kcPgnJm4rTetBK1Rg0sDgTUVtUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=3TsJ441Hxc5w6kwdECytocZuGWRAv1M22Qp1aIMK6mk=; b=bqA54d6IiNnnKkbFlMsuczZgBXGyy6vO4f3aK92asQ1zmzzSLJRXHg2zK3fnSqoDmlbEGqS7Zg10lGT2AYFJjdeE+Mh5sn6/yaBeq7cI0ZtKUnc3/m/LMpka9eE6nloqIlxDjtSeROZfY0ARmHPwuLespJTug+fON7rf2sZls4ftB1Ff1dTStU60J8X7/cZB8n1rT3IIwmcaZqUAfC8YCIOkpgpL1qosjnx7x0ykD6m5qe0BYYV9OEXh1WuiKlnpjDAWtyK/jNBsFH7mFWHinm8Qd8kEDHiHU+ysA2qeIgBW/MyjksEC+SSGwqNtUKwblb3MrfR/9OOkS5/RVeVLCw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3TsJ441Hxc5w6kwdECytocZuGWRAv1M22Qp1aIMK6mk=; b=BJQNdJOG1204LmyCD9MdvTkImXfFb5hE8gGKIht1CDf/DgywQuDxlykrLe67KjjWoHgy6kNHzekofmdITSlAaYlMN4Pj+B0ToECYOVwHVDq/DWnMDCk0I7p7CJJqdqpUHDkrq40RFe1NdLYjNFuuMjU2PHjftUsEd2j90EEC0Fs= Authentication-Results: driverdev.osuosl.org; dkim=none (message not signed) header.d=none; driverdev.osuosl.org; dmarc=none action=none header.from=silabs.com; Received: from SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) by SN6PR11MB2894.namprd11.prod.outlook.com (2603:10b6:805:d7::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.17; Mon, 13 Sep 2021 13:02:20 +0000 Received: from SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::7050:a0a:415:2ccd]) by SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::7050:a0a:415:2ccd%7]) with mapi id 15.20.4500.017; Mon, 13 Sep 2021 13:02:20 +0000 From: Jerome Pouiller To: devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH v3 02/32] staging: wfx: do not send CAB while scanning Date: Mon, 13 Sep 2021 15:01:33 +0200 Message-Id: <20210913130203.1903622-3-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913130203.1903622-1-Jerome.Pouiller@silabs.com> References: <20210913130203.1903622-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR2P264CA0021.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::33) To SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) MIME-Version: 1.0 Received: from pc-42.silabs.com (37.71.187.125) by PR2P264CA0021.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Mon, 13 Sep 2021 13:02:19 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 07448c20-2f45-463d-f1d2-08d976b6b8bb X-MS-TrafficTypeDiagnostic: SN6PR11MB2894: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 959H5TAnBCnDSq+dN6pEyuJRb5rdeaswWZGgaJIthrg6SK30PVF51TZvB2EphAoHOC1aJdZoIyPvSYfXXAllBV2USdAvugIfmdhALk6ONxNPnH0pWFZqx26DqLn0F8tRBg3c2idq70bh0k+8/0pslm/F+MjatuLhQPPt1U+nzMwxevpKUOUpDtnQwnjq3EECxmDTgsLexYKHNWUIKe1uSRF+Nm85XMFRSstao+PwQDEUwT6vcd7Wm2e8+LKu68uJxJQreZapqUbvdTSaVPF2ycWoPPWY7Jwv9nk5X6vStkmDWGPN8P1YfU0EOgArhSzhV+618aq6eyPZWZJWhkLNomIVaVTqe1O/pxM8bv5d6S5dl05nci6/0pSnUwCwv/Etz5OcJXXZNEyPZQrviaO/577NJXOQQxwriHCXtH5RGsPcpBfMe5as1mac7Ufx93zQicHosWCG4gQQez5b/eENV1UcVHCIOdvFyGXz9eRu0JYH+r8/Z3ZR7ytQURHZrJs29IkBHG31+IgnXITUrFXFinaTvimuFJ2QhB6DYuxenUJCk2ye9Mzi2tToqm8hS0EkUl6kYvF00HZilRuuhfKU5tSDfSKS2qaKABZnkDfOpPtlQw06EhrioBkn0ZDTEyc45JidoXkmgVC0MPZDFYNiSj9GZnqQk5nYl3GZE88zKxIA+GvgAZ5yqYMDtw1wG5p+KOvFgKGFLj3DpfdNVk3ryQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB2718.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(366004)(136003)(39850400004)(346002)(376002)(5660300002)(26005)(8936002)(6486002)(38350700002)(38100700002)(66946007)(7696005)(186003)(316002)(1076003)(8676002)(956004)(478600001)(2616005)(2906002)(52116002)(4326008)(36756003)(6666004)(54906003)(83380400001)(107886003)(66476007)(66556008)(86362001)(66574015); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?PFPQRkRqoAsMtPN4jF4ma5He1?= =?utf-8?q?bfIjIwnnViw8Pr83kPCacJxhjZaMHDzWs+tYR60bigNHz5R/oYtnlh0D?= =?utf-8?q?Fc3CeZTKvQHTsh+r/ThS4GTs0n5ARzgnDkq7CYv4DvBTUo2+PvqjBILi?= =?utf-8?q?fnjf0eInPh9L0xjLatHdLZ+iYSvRqVnz9is5Fm73mGriXW7Um2BqZ54R?= =?utf-8?q?602rJvj3lSgeuWlSxZ0jB/kDCk45UXZV0P7/tSgHIUU1eKiqczTMs6aS?= =?utf-8?q?cV6aUxeKjhqB4Bwo4+Ior3TrWX9cSWaSv7cpq/qXZICENKr5IPa7AlEy?= =?utf-8?q?llf6n+naH3C37BPVgtVKuKdjCohVDob1kNZgiB2Mc+3QWoJnz940zwsX?= =?utf-8?q?xnj6ptzoQC7IIu923016eTCMjbwU4xhR7SbBM6Uq1KykqG/d6iixqTJT?= =?utf-8?q?TzeD8qQET8/cKjDPp/5wJ6nDIi/feBhOJpB8URM0hy3Z23cN40Zc2jo+?= =?utf-8?q?PvibPwABtgIhGE8si8vfV/GmuAaXwZ4fAxgOy34t5oT9dq5jiZohOddS?= =?utf-8?q?YpOPA1umFVwjkTbnijsn86gu5IGTnN/AqELofHV+7XjpoGZFOlZX1qSj?= =?utf-8?q?gLK4NI1izz7XVTuSVh6yt35txhheSINOrpGDZT06LVTFUbs/cVawgGeI?= =?utf-8?q?8x+GsQd/WXXqN2enU4QArNlTRRlVYi7TaHNLoIM6aB/7H4fvLldUPF1t?= =?utf-8?q?t+yEjfXO+/+3TB85mZibWaudFyeUZNb49pznSeqBqC7Hk6IDPUk1KQp1?= =?utf-8?q?9sAZhTUXdD07vMjOevto7+4DV+qyn1LCA+5DyX80U8Cfl4mStGTfvNDK?= =?utf-8?q?r/o/9S382Dd+cWPzf2jHq3EAhPACs0Vm7Kt/w+bO2U43Lr3Wnw3ldwPF?= =?utf-8?q?J7fjeX8sRzIiz8TA4r6bWTBM8sy+BZ/THGaYENFO5st//tq5rvAwPiqI?= =?utf-8?q?fhUQAzhuHV2Vuzf20yZ7ZaX+8bDuv0xXgY+Vti9rjCrpNolUhlaB6KwQ?= =?utf-8?q?A2BliLJ3fDwIkGaDbeOoxSdjzQXXwOpm+O7ac8at44gVadVMEywj6M99?= =?utf-8?q?5CJYPuKwBiqKHErsLGTYd2hJPkBHRcuqPxEc7evqXXhxgH1z6BFqI5/7?= =?utf-8?q?+8BFWsyCACFWMY/z2yjN+zEVeg9KAHJR8mhex2+wqm0NMNZhDeAevltT?= =?utf-8?q?VsgezNAQIuDkHDrRTpkAstJTrbRgAt2CMnLIYg3tcxmWw34JvIaogYnl?= =?utf-8?q?rzMKjgvNbZmZXF/wTdMlKcz/8fWbAXCTDy2UJhKizwOCWH9ieRq13K1s?= =?utf-8?q?zbL9bIFoXjt8yaOQxujjM98SXP4maoR/GdELopgLOnG3hMz+HAxzxeNN?= =?utf-8?q?ZUEAwnAeN1HuJrWlJeoJy0FQKko8fAp?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 07448c20-2f45-463d-f1d2-08d976b6b8bb X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2718.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2021 13:02:20.7025 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: WAOhaiKqQ7P9Ua9JjOSsaBH5SmxCGBuQfqfVoiJhTIoyK82JvorGExxllEyRdU7pudQQrNlYHGQHdLYxRxQ8vw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2894 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller During the scan requests, the Tx traffic is suspended. This lock is shared by all the network interfaces. So, a scan request on one interface will block the traffic on a second interface. This causes trouble when the queued traffic contains CAB (Content After DTIM Beacon) since this traffic cannot be delayed. It could be possible to make the lock local to each interface. But It would only push the problem further. The device won't be able to send the CAB before the end of the scan. So, this patch just ignore the DTIM indication when a scan is in progress. The firmware will send another indication on the next DTIM and this time the system will be able to send the traffic just behind the beacon. The only drawback of this solution is that the stations connected to the AP will wait for traffic after the DTIM for nothing. But since the case is really rare it is not a big deal. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index a236e5bb6914..5de9ccf02285 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -629,8 +629,19 @@ int wfx_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set) void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd) { + struct wfx_vif *wvif_it; + if (notify_cmd != STA_NOTIFY_AWAKE) return; + + /* Device won't be able to honor CAB if a scan is in progress on any + * interface. Prefer to skip this DTIM and wait for the next one. + */ + wvif_it = NULL; + while ((wvif_it = wvif_iterate(wvif->wdev, wvif_it)) != NULL) + if (mutex_is_locked(&wvif_it->scan_lock)) + return; + if (!wfx_tx_queues_has_cab(wvif) || wvif->after_dtim_tx_allowed) dev_warn(wvif->wdev->dev, "incorrect sequence (%d CAB in queue)", wfx_tx_queues_has_cab(wvif));