From patchwork Fri Sep 10 16:04:35 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: 509089 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, 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 BD93EC433FE for ; Fri, 10 Sep 2021 16:05:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A74AE61205 for ; Fri, 10 Sep 2021 16:05:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229838AbhIJQGv (ORCPT ); Fri, 10 Sep 2021 12:06:51 -0400 Received: from mail-co1nam11on2081.outbound.protection.outlook.com ([40.107.220.81]:23264 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229698AbhIJQGr (ORCPT ); Fri, 10 Sep 2021 12:06:47 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WuHjhkD1jkIACHTmey6dRz0jGniLo4HSfO9Yvc37yyK8efQxK9U9z9BCjfXpADWaDZTF94+UpqPe9nvdzOlkginmK3H5J/bvT/gHLX92MKJHCdQgK3JmFmcNbedPQPwm5EVoN46LIwtypFpeWW1j1L+uB3Xj2KeO6mkDbWz5UGWYkbWdE6Du/Zu45Yj3fLNUi6dfH/HCm20A+GdyGSsXdU14rA2tRcOAlP1ZyVHsp7fFbWOZVwep50cjaXlJDxHyBjAr18WPHpDLS83c1VOKE/FDelvkQfEA3RBguFcspNYIk9KIusfyCv7F3cZwb5F+TUvSBxO9lxw1BMiP0qNFAA== 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=W3xhbbkCQnf2vd3TochAY9N0f/ZMLhJVqHh1xnxRZkk=; b=Q19fZY1KTLfidtu8KdQBQmnBYGadMrJ8j1aBC90JTF+xO1AuvHVAmsDRkisG/vre0LtyQTZ8BZyrLkKgXVCh/quRY2OCIP2GSutEtTSOozsgZjgJhnPsOEJxXuiOTj+AAMwnApd6kMRcanETSdaVAGufEG6b9zKsNrNdE3PDPV2bfc9qRI27kY5v4mtailHZct3kcI28XKHV/AsoKs84f9b83bGZPh1BdgoPduyyqvar0m2dFZNEBeAVSuVv0osoobkM9OWKtns+zHSZduP1x1+WHJkpsouHwGRaew9KgW+voMlH7HM9wsx5nNcTzUrjrjV112CtwVKOTtds+V8ejQ== 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=W3xhbbkCQnf2vd3TochAY9N0f/ZMLhJVqHh1xnxRZkk=; b=L87qdB3NMetYTccwj5MRSqsz9cUAxXoD7NSHoIDMM9xuhwFYvKoDMznjs9SwteyR33W2OAjaAVSirRUxQ6gd5TrTAItVwzQg4ybgI1kxcsQp5jFWMxqm3GG0+LbvwugLwdMwn8eCYU2x82gVDB4KJUUb7AEVwIeALm7jg6ju3u4= 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 SA0PR11MB4592.namprd11.prod.outlook.com (2603:10b6:806:98::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.17; Fri, 10 Sep 2021 16:05:35 +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; Fri, 10 Sep 2021 16:05:35 +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 02/31] staging: wfx: do not send CAB while scanning Date: Fri, 10 Sep 2021 18:04:35 +0200 Message-Id: <20210910160504.1794332-3-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210910160504.1794332-1-Jerome.Pouiller@silabs.com> References: <20210910160504.1794332-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0601CA0006.namprd06.prod.outlook.com (2603:10b6:803:2f::16) To SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) MIME-Version: 1.0 Received: from pc-42.silabs.com (2a01:e34:ecb5:66a0:9876:e1d7:65be:d294) by SN4PR0601CA0006.namprd06.prod.outlook.com (2603:10b6:803:2f::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.15 via Frontend Transport; Fri, 10 Sep 2021 16:05:33 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d0faf153-c32e-435f-4a62-08d97474d2b4 X-MS-TrafficTypeDiagnostic: SA0PR11MB4592: 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: 5i/7GfUt+a40poWp0Bja3ajvWQO8nUeQDrkcdVajrK/rlNfIJycZL+HabYFEup3FOvok89BKROgNxIZ4JwEJi4yE98bdOJVb7X2A4Y1C2F0mEQi3DINcgOqLIcRA6hcYugFDkJsWT1B0/PzZCYhlU80/+r40hromxws0M7LcsoSMNyNBOJScUPveq1NLT0xt1LKTZtoyMCEjlDyINWINm8/9xevgWr8MdnoKY6gMDH6AzHUktRR9fzEnc+mRvYtfU8OEfYSh7kXpv6fPzvx47AU3WIBpSv69nYSXzn7GlcTcoateOG6tLPnKVjxukumlgwir3kf5dwEMOR4yKU582O1I9QQUlmuIRfMTjfxD3ijeWLqL4wkntz/S87WbjDXL1VXcop6g6ZBsjzHfl7eVKfS5ZnM/3wSE0L2HQDESJna6ud0FIzEvslRAvnsCf/GLuINVv314ekO/ExkTDN75YV7FzCsc3jxCYVp8w5vOzAhGrsAGzjhWZ2lGCsY+8Pw8thwheuLeUvsK9T8C17HtxwjJl8Y7J8+XuGU8kk2ZqwnuKsT6W8D2aUd03saP80nuuD7GWMs4zGfNHoXQbuElqT24JwQxX+lk+D6ZeAGMmfJFnMJT2uLY57CN2xDPkth90QOlgvozZ+Flrnnuyf4cpQ== 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:(366004)(508600001)(2906002)(66556008)(66476007)(316002)(66946007)(83380400001)(66574015)(8676002)(8936002)(36756003)(86362001)(6486002)(107886003)(7696005)(52116002)(54906003)(2616005)(5660300002)(4326008)(38100700002)(1076003)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?HPqJQSELzoGLx2VVXkXhKFugn?= =?utf-8?q?sPo4WKYFxcBMwd3A/sUadHziJzkZYGwzzaHScGdFwSoulnpEgmX1+wCV?= =?utf-8?q?5ZSd99AF859iwXsef2MvXCUsvuhyI1rvLu0dH235sa5dW+fi54Pje2vC?= =?utf-8?q?KfgB5gTV+CSWHvWgm+503g4sht12EFpJtER9A42ZY9gr0G4IUx0EiQ6N?= =?utf-8?q?Hw+5IavV35htlZ+p6n7IzAsHzCda0nFNsOZ0I9IEP2IMFtPMXwK5P77B?= =?utf-8?q?EZUDaupGtIsMj1VYmHk5yc7akWA/W0tXvQJy2+bn33vv1QqJTSoVBXNf?= =?utf-8?q?la8tjuofQB+q1MXIAqojOs5SMdIm5hcyLKETOFtw6HnNV4kJ4f8UGD79?= =?utf-8?q?E9w8XEEiKGCLfyKH4M7QOxTM1xP9i1CwxDuhG/A/a0t8UT5hoVXH1v6B?= =?utf-8?q?Cktn7pnXfRzW6FcMrWA0tKzmIEkMDqHABQyAzvxo6VCDxVNtPSfaOla/?= =?utf-8?q?CjtydBIJWYfoguQuZF/4CAV6ETeNmpjU0t+IJbxeV6MIWYtqYBxKH2u3?= =?utf-8?q?rGHnXvzYdJrsHSMiQiCPlig/KOX7Nl6UZEnnbjJBDRl3CBJbGAHo+HQc?= =?utf-8?q?f8VE3ap59BSmWCCfDhsI1wP9BNeD6Yt1X4syRePCDhmk0uryFXK843sk?= =?utf-8?q?zhYn29ZM9CBsvG33kqJCFPmyOAVVcSWau3jDIdL6uLO0bzwigy4Xjfix?= =?utf-8?q?kAwvjM3yCbueU8Sy86CnsUScM1BgM5pEqyxU/ylG/ucWqTZVXrTIRWwc?= =?utf-8?q?v8i+XgEcgG2craOnpPOXFmyqeuEtY1bPiFkpT99HpG9cRleVtITCZLCh?= =?utf-8?q?lF8i7Fj0NufcRU8QaYssvxrjMccMuspMsrAUIBP0b1ox6Va1w/Sw+5zo?= =?utf-8?q?tNLXBJrBbvww0ih9OVWnzGDaLsw7prutbGR3xVkSuinfTckE+NvTT5df?= =?utf-8?q?kLDSBNMsoel9ZL3ezT3+fQ6sk15ULP5tFEbxzwbUf2o0wuTTStpvBA8a?= =?utf-8?q?yCQEb5eP2N4YUyVECAZoHwtj+exKb6+tW/tJ0OF0TNoSElsc+ynCBlio?= =?utf-8?q?O4IqpkGXO/PqDlzuUqvW/724ffgjK/4BegAR6J1zgt2GU2d8A2dCQX1i?= =?utf-8?q?eXYgwEFn4wQFWFLT6GHCmW01cwDqTqZx2yLQ/M0rCxmAdu8XpF0BBN5Z?= =?utf-8?q?1zlBeiT9OxKsl/X1mWvuz+Q7y00sn9jrXo+q9hC+P1Jr6K25XPsMk+1G?= =?utf-8?q?jxnx1gA3qdBzboOMAhb5/ZbTgUGd5SAo92kxo1CuMx5zwwRItWtYyUOX?= =?utf-8?q?A5g5NOPnsNiePxUEq7gwvLa8IcVvAT9SSrQ+IgndtyN2v26lrfO1dsxd?= =?utf-8?q?dT+gUq20nY/RD6XmGImNB1WtujWLimBUGkzV8p+6vuSRKeEoudME/G9S?= =?utf-8?q?smpw2Pfdgxlnk4adCNjGE2HCUmH9gvrz+7w2FyE?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: d0faf153-c32e-435f-4a62-08d97474d2b4 X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2718.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2021 16:05:35.1923 (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: VS+Z512qR3UvN//OaPndQLct8AYIvkPaf39jVCjtnZ9NEFgs49gFh23TpE4R6fcre+P7HxGbi8bq7Ry94weVLA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR11MB4592 Precedence: bulk List-ID: X-Mailing-List: netdev@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 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index a236e5bb6914..d901588237a4 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -629,8 +629,18 @@ 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));