From patchwork Fri May 15 08:33:09 2020 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: 215605 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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, 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 1E654C433E0 for ; Fri, 15 May 2020 08:34:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DB7A120657 for ; Fri, 15 May 2020 08:34:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="YjiIkmVJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728056AbgEOIeE (ORCPT ); Fri, 15 May 2020 04:34:04 -0400 Received: from mail-dm6nam11on2086.outbound.protection.outlook.com ([40.107.223.86]:6138 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728015AbgEOIeD (ORCPT ); Fri, 15 May 2020 04:34:03 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TpkibvZ71J4dIkCBQJhw3yWeGefBLq1nNS/VPhhOO4g/vIfBUDYpxfWmIK57STWUxBwNHhXkHPYnl0IM9tl0CiIIqQau8F5mFAYi5eJ5toXPUxudzzMFPjb7/2m0SuOpRRwfSWYC6COmnipOKoITh59P2CoKMtDW9gPURU2VqvoUfNkn6hFZ/fDL5hpizxeB+FUjq6MuJ/O4wfrG0rDWBtZp3ekEzfmsnWyTRxXhwu0AXklDpggW2eCXOb+E3Xad/GJBOhNM0QdRRZKN0aJRdIrIABz8uUKRP7pdz1u4t3rj7cFI2K8rVH0uX+PvaxPu6SB79sFp2ZGMU30CL5M28A== 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:X-MS-Exchange-SenderADCheck; bh=gUUFM756JXmxwyceH0imV4Uq4UE4xaRnUvhSWgljqwY=; b=es8L4ZNb0Zj0SvlyJPFPNtlSRnpmLvGvAv5zX4EV8IMrtSsKiKqWZwf7/220HaE2IAD1DtgiRhIGAUIubZFPcITjwQ+WXHFXa1D+fQhjArdZrfQTPmpgilozmVWzr/7X7fyCkYLf/b77KnJlgRGTlNz4J1fKcuj9taLaqtbFIyOPZ1ovazf0+kjR8L0O95xVgIcNY1N7+zACLWwoCFbaO1Pg1k3A6XB1bygxIF5OgyLCgqlzwXzb7hEFgJ43z8P88/o+aBTVF9dn6jcAzaJ6ODhu/AbJxHh9KW2bIRmfjjThO3xzheBbcu5vgdTo8dtboghX1ixYn6WG/tn16OmqLg== 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=gUUFM756JXmxwyceH0imV4Uq4UE4xaRnUvhSWgljqwY=; b=YjiIkmVJIM5Uv9WWiF4EGceAt1g21Yz8CRU1gJOrA5okJJa+mNloAqqGPLcRsv1ieit/P8/WOSk2IbCAfQpP//O37HjWKcsLHi4wWDrJ4q2wghgewlCT7MEorax+ckBHIIMa6DJqlWTTZMjq4V4WqNJKGHnLcwHRHljPCCkrLNs= 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 MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) by MWHPR11MB1310.namprd11.prod.outlook.com (2603:10b6:300:28::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26; Fri, 15 May 2020 08:33:54 +0000 Received: from MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da]) by MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da%5]) with mapi id 15.20.3000.022; Fri, 15 May 2020 08:33:54 +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=?= , Dan Carpenter Subject: [PATCH 03/19] staging: wfx: check pointers returned by allocations Date: Fri, 15 May 2020 10:33:09 +0200 Message-Id: <20200515083325.378539-4-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200515083325.378539-1-Jerome.Pouiller@silabs.com> References: <20200515083325.378539-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR0P264CA0076.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:18::16) To MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.home (82.67.86.106) by PR0P264CA0076.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:18::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.24 via Frontend Transport; Fri, 15 May 2020 08:33:52 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [82.67.86.106] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 25e9ad93-f6aa-477b-a8d6-08d7f8aab3bc X-MS-TrafficTypeDiagnostic: MWHPR11MB1310: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:109; X-Forefront-PRVS: 04041A2886 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FLRmaPrFR66IoO0pAxMYHXEZCjzcX/QrAXudOW1o8Hn7wuW/enUF0PYhhs1N88iEJTi7MasXm8ghdSfo4J13SZW27WuEGVkpFDAkK8/ftG4/P2khXM5ZPo26vqFhGKFhLX0eRrhwMoWRAEzt8wfFGJZtGf93INxDXFyyARBHbpsuMwHjZ00nix7Wmuihl3Upg+UZLfjoj7WvaSD77ZHAZIABEOBtRcnoG5Cp0bXc5mm9A61qG+2ypbxfNxtWDDiANss3NQkBARiKLDZTVV4eVbAPIFPHThObvjMxrGEmNvh9CmJZuWXD6XF9R3VnxG/OzSHOf0voKhxv/8qIEXIVrc3H4E4ExaEdtjce9jlpp9EDB9iR8exlb5zMAl/0om+7EYWZF0gCtyqXsBe0jnMsFQ+dSwD14963gY/BHBnkWHjc/wdsAXbeg4NWbuWwj5zrAElybfE1NhuWlkgD+rEw7QiDQvyBBVY1Hs8t9GK37TewIyAV2xD7LLwnYnCEqx42WwuQZKRJtQSzFiMO6Ja5UQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1775.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(346002)(136003)(376002)(366004)(39850400004)(396003)(8886007)(66556008)(186003)(6512007)(66946007)(966005)(6506007)(36756003)(316002)(66476007)(26005)(52116002)(16526019)(6666004)(54906003)(2906002)(2616005)(478600001)(66574014)(956004)(8936002)(86362001)(8676002)(6486002)(5660300002)(4326008)(1076003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Qgr5o1s4VthL720BE1UX9vjTTrHrVy2iWQQ+bEb0wBnCf9AEDtKCtduoMzQKnj/GoLAhpLBO3TcWVpxVE6ImNTKJ6mOBNCLpNOJRkqIMtiSwvO+D8rcuuCwWnaw+Aj+UgyVM9leips5HJbdhSH6ToM22OWzTlj6Sm5/KVbI0T3N8+ExBBOP0hK7dsh9Mf2nybrWSOTan691ixYEiukUuQ6y04PmNPuD2IE2nCcRc8Mv3n4G4SCxmuguOUh5U4PVYf9bV7RWwoeyIqUZ2HuMsZfIlaeGda3EEm4p6TjEcIbFkw8mos0m52V44OPkKWhzOiyjfoXrVLGE8wC4oWcFjYqfvpLFRejoFKEUTxB0lapULZ3/ycIzdJznU68uT2hvzjnngF1XN7cn9IJtkea2HrC2ENrAlU7SK6iKVbScFU3v+kmBb3K3Navanmdv5HN15cRuIVkUMHloyvQWQHTOKCYQi6geplIduEQPejVycQ64= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 25e9ad93-f6aa-477b-a8d6-08d7f8aab3bc X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2020 08:33:54.0988 (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: N3RxXwmsGbRVC4kGAv/lAtFC2bJNvuEr2EZ6s2UEx7klkVU/NlSzmFZcQ96JDhqUyFux5U3GjmOGYxXmj7yQNA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1310 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Until now, the driver did not always check if the allocations success. The issue was discussed here: https://lore.kernel.org/netdev/2026476.QLiXXEGFCf@pc-42/ Reported-by: Dan Carpenter Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 43 ++++++++++++++++++++++++++++++++ drivers/staging/wfx/hif_tx_mib.c | 2 ++ 2 files changed, 45 insertions(+) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 58adfaf8066d..1cb71f0ad804 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -134,6 +134,8 @@ int hif_shutdown(struct wfx_dev *wdev) if (wdev->chip_frozen) return 0; wfx_alloc_hif(0, &hif); + if (!hif) + return -ENOMEM; wfx_fill_header(hif, -1, HIF_REQ_ID_SHUT_DOWN, 0); ret = wfx_cmd_send(wdev, hif, NULL, 0, true); // After this command, chip won't reply. Be sure to give enough time to @@ -157,6 +159,8 @@ int hif_configuration(struct wfx_dev *wdev, const u8 *conf, size_t len) struct hif_msg *hif; struct hif_req_configuration *body = wfx_alloc_hif(buf_len, &hif); + if (!hif) + return -ENOMEM; body->length = cpu_to_le16(len); memcpy(body->pds_data, conf, len); wfx_fill_header(hif, -1, HIF_REQ_ID_CONFIGURATION, buf_len); @@ -171,6 +175,8 @@ int hif_reset(struct wfx_vif *wvif, bool reset_stat) struct hif_msg *hif; struct hif_req_reset *body = wfx_alloc_hif(sizeof(*body), &hif); + if (!hif) + return -ENOMEM; body->reset_flags.reset_stat = reset_stat; wfx_fill_header(hif, wvif->id, HIF_REQ_ID_RESET, sizeof(*body)); ret = wfx_cmd_send(wvif->wdev, hif, NULL, 0, false); @@ -187,6 +193,10 @@ int hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, struct hif_req_read_mib *body = wfx_alloc_hif(sizeof(*body), &hif); struct hif_cnf_read_mib *reply = kmalloc(buf_len, GFP_KERNEL); + if (!body || !reply) { + ret = -ENOMEM; + goto out; + } body->mib_id = cpu_to_le16(mib_id); wfx_fill_header(hif, vif_id, HIF_REQ_ID_READ_MIB, sizeof(*body)); ret = wfx_cmd_send(wdev, hif, reply, buf_len, false); @@ -204,6 +214,7 @@ int hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, memcpy(val, &reply->mib_data, le16_to_cpu(reply->length)); else memset(val, 0xFF, val_len); +out: kfree(hif); kfree(reply); return ret; @@ -217,6 +228,8 @@ int hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, int buf_len = sizeof(struct hif_req_write_mib) + val_len; struct hif_req_write_mib *body = wfx_alloc_hif(buf_len, &hif); + if (!hif) + return -ENOMEM; body->mib_id = cpu_to_le16(mib_id); body->length = cpu_to_le16(val_len); memcpy(&body->mib_data, val, val_len); @@ -241,6 +254,8 @@ int hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req, compiletime_assert(IEEE80211_MAX_SSID_LEN == HIF_API_SSID_SIZE, "API inconsistency"); + if (!hif) + return -ENOMEM; for (i = 0; i < req->n_ssids; i++) { memcpy(body->ssid_def[i].ssid, req->ssids[i].ssid, IEEE80211_MAX_SSID_LEN); @@ -288,6 +303,8 @@ int hif_stop_scan(struct wfx_vif *wvif) // body associated to HIF_REQ_ID_STOP_SCAN is empty wfx_alloc_hif(0, &hif); + if (!hif) + return -ENOMEM; wfx_fill_header(hif, wvif->id, HIF_REQ_ID_STOP_SCAN, 0); ret = wfx_cmd_send(wvif->wdev, hif, NULL, 0, false); kfree(hif); @@ -305,6 +322,8 @@ int hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, WARN_ON(!conf->basic_rates); WARN_ON(sizeof(body->ssid) < ssidlen); WARN(!conf->ibss_joined && !ssidlen, "joining an unknown BSS"); + if (!hif) + return -ENOMEM; body->infrastructure_bss_mode = !conf->ibss_joined; body->short_preamble = conf->use_short_preamble; if (channel && channel->flags & IEEE80211_CHAN_NO_IR) @@ -333,6 +352,8 @@ int hif_set_bss_params(struct wfx_vif *wvif, int aid, int beacon_lost_count) struct hif_req_set_bss_params *body = wfx_alloc_hif(sizeof(*body), &hif); + if (!hif) + return -ENOMEM; body->aid = cpu_to_le16(aid); body->beacon_lost_count = beacon_lost_count; wfx_fill_header(hif, wvif->id, HIF_REQ_ID_SET_BSS_PARAMS, @@ -349,6 +370,8 @@ int hif_add_key(struct wfx_dev *wdev, const struct hif_req_add_key *arg) // FIXME: only send necessary bits struct hif_req_add_key *body = wfx_alloc_hif(sizeof(*body), &hif); + if (!hif) + return -ENOMEM; // FIXME: swap bytes as necessary in body memcpy(body, arg, sizeof(*body)); if (wfx_api_older_than(wdev, 1, 5)) @@ -369,6 +392,8 @@ int hif_remove_key(struct wfx_dev *wdev, int idx) struct hif_msg *hif; struct hif_req_remove_key *body = wfx_alloc_hif(sizeof(*body), &hif); + if (!hif) + return -ENOMEM; body->entry_index = idx; wfx_fill_header(hif, -1, HIF_REQ_ID_REMOVE_KEY, sizeof(*body)); ret = wfx_cmd_send(wdev, hif, NULL, 0, false); @@ -388,6 +413,8 @@ int hif_set_edca_queue_params(struct wfx_vif *wvif, u16 queue, return -ENOMEM; WARN_ON(arg->aifs > 255); + if (!hif) + return -ENOMEM; body->aifsn = arg->aifs; body->cw_min = cpu_to_le16(arg->cw_min); body->cw_max = cpu_to_le16(arg->cw_max); @@ -414,6 +441,8 @@ int hif_set_pm(struct wfx_vif *wvif, bool ps, int dynamic_ps_timeout) if (!body) return -ENOMEM; + if (!hif) + return -ENOMEM; if (ps) { body->pm_mode.enter_psm = 1; // Firmware does not support more than 128ms @@ -435,6 +464,8 @@ int hif_start(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, struct hif_req_start *body = wfx_alloc_hif(sizeof(*body), &hif); WARN_ON(!conf->beacon_int); + if (!hif) + return -ENOMEM; body->dtim_period = conf->dtim_period; body->short_preamble = conf->use_short_preamble; body->channel_number = channel->hw_value; @@ -456,6 +487,8 @@ int hif_beacon_transmit(struct wfx_vif *wvif, bool enable) struct hif_req_beacon_transmit *body = wfx_alloc_hif(sizeof(*body), &hif); + if (!hif) + return -ENOMEM; body->enable_beaconing = enable ? 1 : 0; wfx_fill_header(hif, wvif->id, HIF_REQ_ID_BEACON_TRANSMIT, sizeof(*body)); @@ -470,6 +503,8 @@ int hif_map_link(struct wfx_vif *wvif, u8 *mac_addr, int flags, int sta_id) struct hif_msg *hif; struct hif_req_map_link *body = wfx_alloc_hif(sizeof(*body), &hif); + if (!hif) + return -ENOMEM; if (mac_addr) ether_addr_copy(body->mac_addr, mac_addr); body->map_link_flags = *(struct hif_map_link_flags *)&flags; @@ -487,6 +522,8 @@ int hif_update_ie_beacon(struct wfx_vif *wvif, const u8 *ies, size_t ies_len) int buf_len = sizeof(struct hif_req_update_ie) + ies_len; struct hif_req_update_ie *body = wfx_alloc_hif(buf_len, &hif); + if (!hif) + return -ENOMEM; body->ie_flags.beacon = 1; body->num_ies = cpu_to_le16(1); memcpy(body->ie, ies, ies_len); @@ -504,6 +541,8 @@ int hif_sl_send_pub_keys(struct wfx_dev *wdev, struct hif_req_sl_exchange_pub_keys *body = wfx_alloc_hif(sizeof(*body), &hif); + if (!hif) + return -ENOMEM; body->algorithm = HIF_SL_CURVE25519; memcpy(body->host_pub_key, pubkey, sizeof(body->host_pub_key)); memcpy(body->host_pub_key_mac, pubkey_hmac, @@ -524,6 +563,8 @@ int hif_sl_config(struct wfx_dev *wdev, const unsigned long *bitmap) struct hif_msg *hif; struct hif_req_sl_configure *body = wfx_alloc_hif(sizeof(*body), &hif); + if (!hif) + return -ENOMEM; memcpy(body->encr_bmp, bitmap, sizeof(body->encr_bmp)); wfx_fill_header(hif, -1, HIF_REQ_ID_SL_CONFIGURE, sizeof(*body)); ret = wfx_cmd_send(wdev, hif, NULL, 0, false); @@ -538,6 +579,8 @@ int hif_sl_set_mac_key(struct wfx_dev *wdev, const u8 *slk_key, int destination) struct hif_req_set_sl_mac_key *body = wfx_alloc_hif(sizeof(*body), &hif); + if (!hif) + return -ENOMEM; memcpy(body->key_value, slk_key, sizeof(body->key_value)); body->otp_or_ram = destination; wfx_fill_header(hif, -1, HIF_REQ_ID_SET_SL_MAC_KEY, sizeof(*body)); diff --git a/drivers/staging/wfx/hif_tx_mib.c b/drivers/staging/wfx/hif_tx_mib.c index 567c61d1fe2e..1689cb42acc0 100644 --- a/drivers/staging/wfx/hif_tx_mib.c +++ b/drivers/staging/wfx/hif_tx_mib.c @@ -222,6 +222,8 @@ int hif_set_tx_rate_retry_policy(struct wfx_vif *wvif, int ret; arg = kzalloc(size, GFP_KERNEL); + if (!arg) + return -ENOMEM; arg->num_tx_rate_policies = 1; arg->tx_rate_retry_policy[0].policy_index = policy_index; arg->tx_rate_retry_policy[0].short_retry_count = 255; From patchwork Fri May 15 08:33:10 2020 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: 215599 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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, 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 B3D17C433DF for ; Fri, 15 May 2020 08:35:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8CA8B2054F for ; Fri, 15 May 2020 08:35:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="mlWmAi1z" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728206AbgEOIeU (ORCPT ); Fri, 15 May 2020 04:34:20 -0400 Received: from mail-dm6nam11on2086.outbound.protection.outlook.com ([40.107.223.86]:6138 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726694AbgEOIeQ (ORCPT ); Fri, 15 May 2020 04:34:16 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ffGLu70hxTnA5HhcJGRocs5nZGV5r1szLZNuL3USMm+XakJPfkXAzzI3lMy35rgucsZfemni7Gcm6X+v1BS/46IlecXJXCMF6GyjEUSghcgzBU5Ss9I9HFNjO1IPAeVjmBJJOCxWLT1v2dPEfapS9r/QMygYOMZQh4bmkj0udnw7SPyQcBAaMJ9ajiXOUZnLzwTn/yyE2QBY2v7FfW0YEsjCxNO/5XO+dlEVRXDwpu/uE09wlZyrN6/dMA14PD2gjIIHHMRF/avzI5DD5/7FToBCsaC8XC79I0ooYA63IiclVgkkBEUaO5FGVjws4MDZZ6STbECWjq8oo/ohaZ9NGA== 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:X-MS-Exchange-SenderADCheck; bh=8jRlFmhUxyj2LOBO/Mc6KTUuxSiZl0gfbJMZcHyEgAY=; b=lWw7a6XNqC1YjuyFajHUaE9Jst4SG2r6P3E+0BDZ0wZxJMTd9CLSYsGU2UM0ZOs1uXrqhMUVFbmq3RqZWfOytK1XnzgTsGRKN6+bKhVr6ZHEXBf+5AIamORb20pGDn+gh247NDpQTFswj6JXP5ulEVPZQwSEW/OLKPg0MK2vOrf0Fs4M+IOrHAAGasvaTLLv5bwFxtwoso0jxguP0xNps+a0rF2GmCCqVBmb+eC1irXeFvo/Yz6kRfTdaWY8mv0IcdUhpifuqbwsuTKd64pkryG7UoIeYESPQisiMb/N1ay0twSqZYOngGVwuFdKVAM+nOA2+nYT1tPIzZK4hOCFwg== 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=8jRlFmhUxyj2LOBO/Mc6KTUuxSiZl0gfbJMZcHyEgAY=; b=mlWmAi1zqZQaxxDuCrgTJtMAHyGNwc2IJwgO4+bSlT1fYFIxvUjY9O9toKfpvJLk/zVQ9nU4phPR5YIV+L22Y/Z0j8kKOkcNOUAhTfYi++EsnGIQiU6Iiawr/5qNRpZRgx2Y4XN0fcwIp9cdP13eYVrSIOiK66yhfO37zUmLJLA= 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 MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) by MWHPR11MB1310.namprd11.prod.outlook.com (2603:10b6:300:28::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26; Fri, 15 May 2020 08:33:56 +0000 Received: from MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da]) by MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da%5]) with mapi id 15.20.3000.022; Fri, 15 May 2020 08:33:56 +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 04/19] staging: wfx: fix value of scan timeout Date: Fri, 15 May 2020 10:33:10 +0200 Message-Id: <20200515083325.378539-5-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200515083325.378539-1-Jerome.Pouiller@silabs.com> References: <20200515083325.378539-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR0P264CA0076.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:18::16) To MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.home (82.67.86.106) by PR0P264CA0076.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:18::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.24 via Frontend Transport; Fri, 15 May 2020 08:33:54 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [82.67.86.106] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7340fee5-4fe9-4ae1-d6f8-08d7f8aab4d4 X-MS-TrafficTypeDiagnostic: MWHPR11MB1310: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3826; X-Forefront-PRVS: 04041A2886 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cBKptWlY9Jyf9CA8yDlfINQpmxxVRwdbgixvEdXLwWB6lmF6jopqKhxtgyKyVp7yRQk9fn2qC/jso7qZLAlXimVjIpBgiE048NAtKT+a+cPECfcgjXnC0Ua24AaU/fFOAN/uuQb0vri4fjzRhvTaGsq5VoBTEIqi2aK/jz16Vj9JXy20k9XiABqQIfs6xEcu7+lMZC5gDTu7C+Rn6qx7dn+4qFx6wJw5GY6KL978PQ5QRt+n02YSGd9fTIsA+jQ9hAzF8I9106y3+MhBrH+wgiyIUrxFSlLVlvp35c+DvMC08MpRXDBynxn4DLl4kNQaIwsc95kqstmlDwOCN/WQ1M30QFOCsHzCdnTFGCIDjdkPsnEWT6k3SFsjJyIUUAIa/+fG42a02FMJkFCGekjTpDgLbnyFcsauMhMPssS3dJXTrMzzHCQ5eia0ky+l3TgA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1775.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(346002)(136003)(376002)(366004)(39850400004)(396003)(8886007)(66556008)(186003)(6512007)(66946007)(6506007)(36756003)(316002)(66476007)(26005)(52116002)(16526019)(6666004)(54906003)(2906002)(2616005)(478600001)(66574014)(107886003)(956004)(8936002)(86362001)(8676002)(6486002)(5660300002)(4326008)(1076003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 4H8gx0tcifNjFZDJ2vma6U8k57MWrbO7UUD0f2Dt6y1DkkxJzPc/eqmsoULhY6JIHsRRbZY8yZJSx7FsOlQXPqoUpz2pa99jVw+xicvH/mpf1Z9jLRx6TKQO+MezrPCR98cI8BJQEKIAlZShAMDVxS07MeaxGLd3hfvmrZZjIB4w3w3HottcuQGCUizYTB589EqfxeBUpYUr7dA/BldICe6NWCn+KlbEAnuE+yd9KTnwBH4C+sJB14QITExDvvmoizlEtDeC99DqGk5dagoxachRbIrCigaC6zG28rWb2RU3Ac/HNCeuuk4nv1XFj3q1BttTtnZqrI92U79XHNAiz4Nxtrb9Xbr3DTAAgw6Wk/T8cfA9C8KRJy1YO8V4d/YhBGWf5l0Y/kYMYWkVjlhGpSGOcfUxYr+hrLcUaIRGP7CdbV3Wx+jligKstWNbY8WrJfgvd3LLshSvbFB89Ze4rwTvP7iSLPV1Jw5qZ7w1MB4= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7340fee5-4fe9-4ae1-d6f8-08d7f8aab4d4 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2020 08:33:55.9620 (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: VCMO2a2uyBueqx+8kC+nh3JGeEVztaBMFcQ1mvqTuxxhT3KILdNnyWXMsCvRMNw6/v3kCY4R1x33mRaNqg2M5w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1310 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Before to start the scan request, the firmware signals (with a null frame) to the AP it won't be able to receive data. This frame can be long to send: up to 512TU. The current calculus of the scan timeout does not take into account this delay. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 1cb71f0ad804..893b67f2f792 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -288,7 +288,7 @@ int hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req, tmo_chan_bg = le32_to_cpu(body->max_channel_time) * USEC_PER_TU; tmo_chan_fg = 512 * USEC_PER_TU + body->probe_delay; tmo_chan_fg *= body->num_of_probe_requests; - tmo = chan_num * max(tmo_chan_bg, tmo_chan_fg); + tmo = chan_num * max(tmo_chan_bg, tmo_chan_fg) + 512 * USEC_PER_TU; wfx_fill_header(hif, wvif->id, HIF_REQ_ID_START_SCAN, buf_len); ret = wfx_cmd_send(wvif->wdev, hif, NULL, 0, false); From patchwork Fri May 15 08:33:11 2020 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: 215597 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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, 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 9F06DC433DF for ; Fri, 15 May 2020 08:36:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 76FA52054F for ; Fri, 15 May 2020 08:36:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="OXn1dTlK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728095AbgEOIeL (ORCPT ); Fri, 15 May 2020 04:34:11 -0400 Received: from mail-dm6nam11on2053.outbound.protection.outlook.com ([40.107.223.53]:55808 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727853AbgEOIeK (ORCPT ); Fri, 15 May 2020 04:34:10 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NSfMXlm+XHr6iBmbFfwq+qyJ3zF5vUoLIHEkT2tSFKNVmbeH/8BYBycHk8PZXRj/zRjpNKZa8TQhf1GMM03zi50OyqIIHUmH8d8YzJ/yQwoU1fJxBW4UPAWMd6E0XQIsJb3NKkc8fzcmNsSrxaUGZd1iYo4YoB1QOcuPO9wvEmpiKIptGPxtC8aWlYJLYE/mr0d6vpC34fQuQZIDhhNXFtAOYyJGJUS/sy7YmIBqOUNntRZhxahNb2K3o/XnDfgccgP4Hp8hF7b72LLZLOmCWnMnw2rvG2HKT+mQ1Sk+m2bXjdGyKrrtuL7WRfisRrYi/2sCwsmvAio0GFVJqumBJQ== 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:X-MS-Exchange-SenderADCheck; bh=yRGzSAKxWDeKco+3lbUM824AhIj80UEP/NKfp2lWdm4=; b=BRCE+N5L79vZl5CRZbcu8orQ73h5gb3Pfk9ZA/yujsIw8IsPK0KxSRbsvQggg9wlXpoQSaA8T90ok4oPPRaDSpGCrNuScSveFs1q0IcFMzDM/RVKRnDM5WPMojormI2EJyzLpYZnzwSmrmjnGDzOVksO/5qo18hzztxrMLpDSCJbL5Jsy9iBSgVkIgW/141nArfFVIaZtTIfaPrs36ASFZqPq+Uw6UbSkHcgR8QISuFoU55UIXYyqQt2y0c0oQcjttkno26oE1nhFTHy/k+JNmwZWKEnLYxVeg35qiFc4JZGmVWTMCIOvSAFZGIWKtVTQrI2/j/D3oQHq0Xd0SjOyg== 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=yRGzSAKxWDeKco+3lbUM824AhIj80UEP/NKfp2lWdm4=; b=OXn1dTlK3W+hOtqQ1x5hzK6LlfHaYt7rzNdq2zmtA/PQB4G3uXGXjWzkMk6WCi0tw91aOKGkFA8bpEPPM31zFdP5TI8zCWDwRksc7wa3jUDz1HsN+LFuw5AWp4Rd9x4fjLI2duQs8Du7k13DEPtdgyY/6HTAcXsDNExALWCOK0c= 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 MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) by MWHPR11MB1310.namprd11.prod.outlook.com (2603:10b6:300:28::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26; Fri, 15 May 2020 08:33:58 +0000 Received: from MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da]) by MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da%5]) with mapi id 15.20.3000.022; Fri, 15 May 2020 08:33:58 +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 05/19] staging: wfx: fix coherency of hif_scan() prototype Date: Fri, 15 May 2020 10:33:11 +0200 Message-Id: <20200515083325.378539-6-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200515083325.378539-1-Jerome.Pouiller@silabs.com> References: <20200515083325.378539-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR0P264CA0076.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:18::16) To MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.home (82.67.86.106) by PR0P264CA0076.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:18::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.24 via Frontend Transport; Fri, 15 May 2020 08:33:56 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [82.67.86.106] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9f408363-c6a3-47d4-0518-08d7f8aab5ed X-MS-TrafficTypeDiagnostic: MWHPR11MB1310: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-Forefront-PRVS: 04041A2886 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uhDt7bKbqQFpQLDTfRV0T9/JMYa9czxGdItWY3j34w0SfCMA23zSHs58BtzHwELPtT6iYuVnRJBdGidqiMgHWrf8Yh6+fSCzbFWCWsuuuKAz2MtFzM44OQga0tk14/bThABYk4TzCj8crJpqfsVVhbTd3DjT6YF6VbCQJ+jMVKZOJrE/yqUYQ2wTmqJiUM5g0ahU2nqHXjctL8MMZkw1PvGzXTSgDCj+kmIdH8kr77TandDOtdppk3YsgF6TQ0d/Jmgyth+9mo4x7J4GeSbcxBO+aAOGkrktrFhmoyRovoxFMEiFN/mgo42miiB745bNCAWx30nbyTCPRyZ4ZUDTkBngr3xgcXvVnvZ+0rY4op5Kjbi2dvtGlCWh6/C1rginKRgkleOveTbNq3SyfXBueOpevj/ltHfXSh0n8ie1vzVTupyshldUzx1eVR2+TSPV X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1775.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(346002)(136003)(376002)(366004)(39850400004)(396003)(8886007)(66556008)(186003)(6512007)(66946007)(6506007)(36756003)(316002)(66476007)(26005)(52116002)(16526019)(6666004)(54906003)(2906002)(2616005)(478600001)(66574014)(107886003)(956004)(8936002)(86362001)(8676002)(6486002)(5660300002)(4326008)(1076003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: b3nfpVl0OMkTslIA80A1d61DuTeknEQTnnypTlZswfUFoPhOGZ8v0NheP4c2dMebDDQzgEv00x2rTavrA+ZnAb83JHJrwWHfm8ViP1bVefBfz8s5KL4Qi6jp36isBZrOM51WNVz5E03AjDdlYN8+janh46lU0UJPwWey7tVxxMtbizcA7Ig/akx8+Dd/TYLw8gGeS/CMHnAFDR2zRbCDJTFsYugrhk4RUSUBux9yJboxHb0H636QrDPXESDl1MNs8GBEDl8YHDJaWBQwp3Kxnf3EsTWs9HWc9nL92guOd5vFNnYbs0w6IS2jsQEMIIFRNSUixR7y7N3ftulgljjHbLurMp7TwRp43rr297AH/nkmWdqfjcGIz9j3AezLX/A/EOLA5F2nSdqjQxoYiTFnT2h1vo9XexaOyJlRULi2yAfxL8Kjyji9WFvfwCpnMyzXbgqq+uKEiARh7TjakO96JDkYZ1BSR0TjAbiTFvzz8fM= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9f408363-c6a3-47d4-0518-08d7f8aab5ed X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2020 08:33:57.8142 (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: Wus/aBxObzoCubdhe5csx7JmUqZySVwHAZPfnayKB0g7V7y2LMse4jDiT8P+OWUcPles4FP8taKWnHyyCsgyRQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1310 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The function hif_scan() return the timeout for the completion of the scan request. It is the only function from hif_tx.c that return another thing than just an error code. This behavior is not coherent with the rest of file. Worse, if value returned is positive, the caller can't make say if it is a timeout or the value returned by the hardware. Uniformize API with other HIF functions, only return the error code and pass timeout with parameters. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 6 ++++-- drivers/staging/wfx/hif_tx.h | 2 +- drivers/staging/wfx/scan.c | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 893b67f2f792..6db41587cc7a 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -240,7 +240,7 @@ int hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, } int hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req, - int chan_start_idx, int chan_num) + int chan_start_idx, int chan_num, int *timeout) { int ret, i; struct hif_msg *hif; @@ -289,11 +289,13 @@ int hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req, tmo_chan_fg = 512 * USEC_PER_TU + body->probe_delay; tmo_chan_fg *= body->num_of_probe_requests; tmo = chan_num * max(tmo_chan_bg, tmo_chan_fg) + 512 * USEC_PER_TU; + if (*timeout) + *timeout = usecs_to_jiffies(tmo); wfx_fill_header(hif, wvif->id, HIF_REQ_ID_START_SCAN, buf_len); ret = wfx_cmd_send(wvif->wdev, hif, NULL, 0, false); kfree(hif); - return ret ? ret : usecs_to_jiffies(tmo); + return ret; } int hif_stop_scan(struct wfx_vif *wvif) diff --git a/drivers/staging/wfx/hif_tx.h b/drivers/staging/wfx/hif_tx.h index e9eca9330178..e1da28aef706 100644 --- a/drivers/staging/wfx/hif_tx.h +++ b/drivers/staging/wfx/hif_tx.h @@ -42,7 +42,7 @@ int hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, int hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, void *buf, size_t buf_size); int hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req80211, - int chan_start, int chan_num); + int chan_start, int chan_num, int *timeout); int hif_stop_scan(struct wfx_vif *wvif); int hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, struct ieee80211_channel *channel, const u8 *ssid, int ssidlen); diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index eff1be9fb28f..bf7ddc75c7db 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -56,10 +56,10 @@ static int send_scan_req(struct wfx_vif *wvif, wfx_tx_lock_flush(wvif->wdev); wvif->scan_abort = false; reinit_completion(&wvif->scan_complete); - timeout = hif_scan(wvif, req, start_idx, i - start_idx); - if (timeout < 0) { + ret = hif_scan(wvif, req, start_idx, i - start_idx, &timeout); + if (ret) { wfx_tx_unlock(wvif->wdev); - return timeout; + return -EIO; } ret = wait_for_completion_timeout(&wvif->scan_complete, timeout); if (req->channels[start_idx]->max_power != wvif->vif->bss_conf.txpower) From patchwork Fri May 15 08:33:12 2020 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: 215598 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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, 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 51CB2C433DF for ; Fri, 15 May 2020 08:35:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2DFBC2054F for ; Fri, 15 May 2020 08:35:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="K4Ooj/T4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728139AbgEOIeN (ORCPT ); Fri, 15 May 2020 04:34:13 -0400 Received: from mail-dm6nam11on2053.outbound.protection.outlook.com ([40.107.223.53]:55808 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727933AbgEOIeM (ORCPT ); Fri, 15 May 2020 04:34:12 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LqFYdv/fg2ZKWoXNDrcfkdi5RIRF8LvCnIC+DIOTncwJ3yu+JtklFj1Vle5fBX8UzOMNQIiD3UApy3aaeKHmPE77xoiyOTBeGXIp27u+JBcYUx/G7es4EThg8ani016UI+oD+qtdCLbbgQcYu0Hvo20UueoACPXWcLmaHshLqIqEKF7+miFo5jksrjLcbmL1MzNiBMpwJYcNumtMA9eCu16Unw+KUtjQRIdL6f6Mi7kdZOgCyfaBpY47hwn3BUzWryfr7JyhVAfM4gVVlkexRS3OkskTbnBINvxDgzb33mZRVIW1+auctU/sFS3A3TURi+Bj4JXOMtY9j43j/EUQBQ== 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:X-MS-Exchange-SenderADCheck; bh=XiJtijyQah2+739rbh2zhSH+M8adLOJAGFU/ENZT2Y8=; b=TuasE0BrNYBkALJK12VQ9CG2YdQPjUjO0XRY9OfqQ++AA1J74JsaEZRHou1bm4uaat86dv4gd42aXFtR6xlEB2mHlG3982Vbl72FJ6M5BJdUm1K3s1iK38aeHqY4UM2MbW0plBdBKnBCsh+TD0U96DTdTueRURuwXsb9PpTJonniLVJ18oqdfDAXBKYd8UODLfdRy6DcBo78lzzQnwfdYocppIOoX2JUECYltN7PbiuQf8N2I+mk95LDrfGTpfwjzVJsb59j55eO6btaUTcdQWmujydkz9CHKMA4qgE0i4im262tjuv8v+lzAPSx/fY+KrOAEo86in0uo7t4d7KCXA== 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=XiJtijyQah2+739rbh2zhSH+M8adLOJAGFU/ENZT2Y8=; b=K4Ooj/T4n8odZGet5ajA1Ixc/SoBUUGemmNKqp4jbqLQjF/N4VhgjnZXCdLvWozam0vV9uRCIQbj4HuZZIzo3g6SE0sMrTo/+ZOWUJW7LyD0m7+MBUuqiNC/n1W3ewmS0o8KDF+tsIa/VFLzfaGDPSVwVhUeBdQSJTKlYJZZZic= 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 MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) by MWHPR11MB1310.namprd11.prod.outlook.com (2603:10b6:300:28::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26; Fri, 15 May 2020 08:34:00 +0000 Received: from MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da]) by MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da%5]) with mapi id 15.20.3000.022; Fri, 15 May 2020 08:33:59 +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 06/19] staging: wfx: fix indentation Date: Fri, 15 May 2020 10:33:12 +0200 Message-Id: <20200515083325.378539-7-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200515083325.378539-1-Jerome.Pouiller@silabs.com> References: <20200515083325.378539-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR0P264CA0076.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:18::16) To MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.home (82.67.86.106) by PR0P264CA0076.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:18::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.24 via Frontend Transport; Fri, 15 May 2020 08:33:58 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [82.67.86.106] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 383b1453-9c77-419e-0bd2-08d7f8aab70e X-MS-TrafficTypeDiagnostic: MWHPR11MB1310: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:393; X-Forefront-PRVS: 04041A2886 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Xk4dHKn9cmNl6JzkMt5Vc9WVmYaixg5/h2AaP7vdJ8hGPAqE5GQIfaPWfCTtF7LYRfbispBNpXJpQJDLkXJPNEV18yEqSZkGQci/uoeHtc79Qp8BQP2eJAmNMEi5om36Zhi1iKwSObfR+f0wE5DWdZoqLPHk8svWmXIJXbmVxCXdO3+qa6S3KpOnLDG+2Pl+eedQacKC/LUDw2HVBqmvk+jtsLr1fHfpRhqy1e9MqKUCJ0Z+9AIV8QO8GryqGB80kI4rKRBe8d+RZwm4wt5DOMMo16lI28vNIZ5fbBOdCo+dQJbr4jJEUsjddmaZvtkxKip8eRY2zm5vrRg0T5YeVLwx1VqgHxEO0cu9KA8BKWBVt9TY3Xftq18HtrFBfAPU74GT5b0nC1ImrrqpOVAh9rInaPeG7dEXfDMAXv88R14NcOUGP9tLtwZQlUfJp4IF X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1775.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(346002)(136003)(376002)(366004)(39850400004)(396003)(8886007)(66556008)(186003)(6512007)(4744005)(66946007)(6506007)(36756003)(316002)(66476007)(26005)(52116002)(16526019)(6666004)(54906003)(2906002)(2616005)(478600001)(107886003)(956004)(8936002)(86362001)(8676002)(6486002)(5660300002)(4326008)(1076003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: bt7jtJu/POM4ecK+ORrJbc+dY6phZKB+U0AXX5R65Ox5KMPlX494do8L3K4AyO2WAdjIaFRTSiVGSld6cQFInI9ht3meknYCWwrYn2e1B4FAzZPfBtuvYab+tbrCOfXKehybKck2KP5tQK7QivxiUwu/9r2E2An7X8gyo0aMSyPaxnM8GOtGImRxCHp319WdlP6hz2Dn/bNmXLFapW4w2XlqSCnvCVDRN6I2/3b34EZZtNLJEcuITcbdNMCAFyj8y8U0qR+1BQlZFgBhm2w/4SCFH4My2xEEw9wCBRa9Vxju3f/OjGfk/9ggC7yNPGIjfPqbozOrdePIxD0xhyHJm2pzEM7RlfKuKGTIUv+Yj69XoP4N/hiixX4WAH74zyZKwWl7qUzOb2JJRo20ur6FszUL+gtwO58P8BRPCkPwW+Rt00LWpIfDnpoM++2Y1kO1NZNWvAFj68zuXDB0IN+TEhCXj/vkAgLDOMvFENFxYbc= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 383b1453-9c77-419e-0bd2-08d7f8aab70e X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2020 08:33:59.8253 (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: Uwni32SPb4yzAUI1EHRc6Mh7eA63MPAwXLsUR9IK4LB8jAvMFnWrugMSeKR3VVskt6AuYXILd0Ajtm9712Rtkg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1310 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Fix indention of wfx_skb_dtor(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index cac8c9ecbc34..a12590214a5d 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -484,9 +484,9 @@ static void wfx_skb_dtor(struct wfx_dev *wdev, struct hif_msg *hif = (struct hif_msg *)skb->data; struct hif_req_tx *req = (struct hif_req_tx *)hif->body; struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); - unsigned int offset = sizeof(struct hif_req_tx) + - sizeof(struct hif_msg) + - req->data_flags.fc_offset; + unsigned int offset = sizeof(struct hif_msg) + + sizeof(struct hif_req_tx) + + req->data_flags.fc_offset; WARN_ON(!wvif); skb_pull(skb, offset); From patchwork Fri May 15 08:33:16 2020 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: 215604 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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 C6E1BC433DF for ; Fri, 15 May 2020 08:34:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9D68E2078C for ; Fri, 15 May 2020 08:34:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="RPz4QLf+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728285AbgEOIe2 (ORCPT ); Fri, 15 May 2020 04:34:28 -0400 Received: from mail-dm6nam11on2053.outbound.protection.outlook.com ([40.107.223.53]:55808 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728228AbgEOIeW (ORCPT ); Fri, 15 May 2020 04:34:22 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UISsZ+IQCOAc3jGEJDmIBLx+reWz92eWxTFua0UN7g0VaoewQOvA0C9pg6cr9gKge4k5iEl8ZIIiW6CkohOeGJpUlezsApDUNQKjZRj3Lw7CQAK/TURTNhe45SHNiPWfl610biLtpyS+rxGi1byY9Z5iscPIfm+U2cHg/p9Teh9DJsUzBxYtARsdOlX5VfYJRUmwi0L1aETrQF7a4PHd/ctWbopo+bGvvjvTUwLs05ZijRInEHvWLdGitQM/Bp/1EPYmhxTwSVt+KReVemsfWWODatypfys3aQDyqrypeyLJAmQRkb76rc5csByPc/hWsvi2d5gdNkOV4B60UbwyxA== 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:X-MS-Exchange-SenderADCheck; bh=g2/uJBnFXK1MccmUxLJTBKzXkhhxxrrgq2O7Ydk7FRw=; b=EZnbDTall97ToupXoSEy+CI7pa2UwDEZXxv3fgVC3n3+37StG5wJ2t6l3eEue+/Dtu+44f3CMldNlTGKRW00Fn8FYR3+lAXU908KcIfTVmcBMMRo60X1K6+oGpYaPIF+Xq1e2ZbF4SxIkahB6ZBOnNXnSaIYNwjiD5KVLTLJKxHjFy39IBgqDQHUpUwx3ZAtQIf+TwaukMUILjoYNacOTqtlDNwiUkUkOMxRODyfO7K9aSmrrsKw3BsqdU4bISe/qgssXir2HS3e7wv/Q24PBYBIPwqWXd6E5f0+867rG6JyEtbB6NcGsvw2DDs6E+vV0I5tWzZz7W9oeWL8stVYBw== 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=g2/uJBnFXK1MccmUxLJTBKzXkhhxxrrgq2O7Ydk7FRw=; b=RPz4QLf+Jx/YOD7gbtDJxYktT4xmRxOPLnvnrU0EjEnbT+jcUWkwCV6vv9GWbNc4ENdPbgQLN6TJGRkERVe+1+8AjXGqP0hf8HjG8h0LxWG/feKape6VcTljZNzy5/uGHTw3UH7fX279XkxRJ89Xj8uoSimQd5Jk++114IzlSOQ= 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 MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) by MWHPR11MB1310.namprd11.prod.outlook.com (2603:10b6:300:28::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26; Fri, 15 May 2020 08:34:07 +0000 Received: from MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da]) by MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da%5]) with mapi id 15.20.3000.022; Fri, 15 May 2020 08:34:07 +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 10/19] staging: wfx: fix potential use-after-free Date: Fri, 15 May 2020 10:33:16 +0200 Message-Id: <20200515083325.378539-11-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200515083325.378539-1-Jerome.Pouiller@silabs.com> References: <20200515083325.378539-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR0P264CA0076.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:18::16) To MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.home (82.67.86.106) by PR0P264CA0076.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:18::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.24 via Frontend Transport; Fri, 15 May 2020 08:34:05 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [82.67.86.106] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 141ff5bb-92f0-4cfe-62a6-08d7f8aabbac X-MS-TrafficTypeDiagnostic: MWHPR11MB1310: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-Forefront-PRVS: 04041A2886 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: g10O0dick9Axs7LvbpGPnOZRJAAFwDJJR9oehfWBBMkJKIh/Wek0g16XhSby/Nj5sNfOD7TuywKlMNi+Djb4/6UOE8Lq60FW9z81iMIdUaFHfgR7XXDT+ZRPEmYxBeuT8/fEeDFu6flZxGGdxnoQBiFoFCPZndpq33Accog6xStWrFsqfPvQYf71f3TYdjzFf1Ul5D9DnIV9Cq1AjepJqASPHNZCHHal3302BE9hIey0XsUZ9PSxGuqMk4SxQcu1sEMqNqA1VsML0Fx0pe7QnB+b794qU1rq9hRLRq5ccslAzJ66i/Jz8/5he6BUBrmnsWH9AUU4HNJkjrhWQb+0yGM8HEc6hi+u3tipaKI54UKdasIrU+7th8Cpi0vcSCednPdtbnHqlVaI81lhE0pPF09s4ZW3DHx5hgpc4s9VTYUloXIFByg7m/Jaek2wBVdK X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1775.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(346002)(136003)(376002)(366004)(39850400004)(396003)(8886007)(66556008)(186003)(6512007)(4744005)(66946007)(6506007)(36756003)(316002)(66476007)(26005)(52116002)(16526019)(6666004)(54906003)(2906002)(2616005)(478600001)(66574014)(107886003)(956004)(8936002)(86362001)(8676002)(6486002)(5660300002)(4326008)(1076003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: vsxLaBW+KtWbiaWQYiGiL8mLPmd/vRbHAjN7Z9HW/RHy5cLucF4eUG6S2uB+xHVZS6J8zfH1clXp8Yi9Nr8oeXvJ4wsrutPpeRFCmx+Je8iND+OnDB+8vqAV+RwlT5tQy2K5cyaOk0vmpLG79jwtWUxFyaAbCVyp13wit7DWAJhlD2+HPLnkhO8b7GM4CKF7jSYc+iKDDSXvU+nTUlUSv2ioAXX+CwBZYqVgz4WFjPsekbPPfuVPl62VhY/dhkXost8nMGFCkp/NnzYboeNUXH+OdONghk02mRh51unuWic59xmrvkwwg7oF6QIWvO/uqsDuSa5xJt6GuULML65OzInZvQr4frb4xTRxattkml+dQiRLEzIxZLUuZ7ijMUn5fMpzaLzQDr6ZN5B4x/yzyOAq1T4brCMtiFFWuSi9aobNZGo4MjIh7uqZn3rEsH8wFD17UDk4oVxIcPkFeFXQLK3DhPcEjO4C6vwetqJngKo= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 141ff5bb-92f0-4cfe-62a6-08d7f8aabbac X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2020 08:34:07.5848 (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: P3qjQrSmlEfp3IoHTDqUgzw80SW9BGHxYWnExmiu/ZBKKEYK1/JUhDhOEKbFkJ5fHWMStMhcLo1B/uyLBmJ5vw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1310 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller wfx_tx_policy_put() use data from the skb. However, the call to skb_pull() has just discarded them (even if the memory is in fact not really discarded). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 314cc2743a2b..d01e679b0880 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -494,8 +494,8 @@ static void wfx_skb_dtor(struct wfx_vif *wvif, struct sk_buff *skb) req->data_flags.fc_offset; WARN_ON(!wvif); - skb_pull(skb, offset); wfx_tx_policy_put(wvif, req->tx_flags.retry_policy_index); + skb_pull(skb, offset); ieee80211_tx_status_irqsafe(wvif->wdev->hw, skb); } From patchwork Fri May 15 08:33:17 2020 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: 215600 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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, 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 295D9C433E0 for ; Fri, 15 May 2020 08:35:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 00E0B205CB for ; Fri, 15 May 2020 08:35:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="kdTav/fZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728476AbgEOIfU (ORCPT ); Fri, 15 May 2020 04:35:20 -0400 Received: from mail-dm6nam11on2086.outbound.protection.outlook.com ([40.107.223.86]:6138 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728270AbgEOIeY (ORCPT ); Fri, 15 May 2020 04:34:24 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ScwwXEfV/KkR54B7d8ErHT/5b7sOVDm1FnGgOSG2KliRqaUQK42ecsdQ728o/MfHocwWGzN+52D8SkwCVTb46qptnh46hMVXfo6xogOEko3qpKD6eV3u+3+poqLO6FImWXQcDfwYH+OSbRWpC7zFa6yXlFoADta0cWI3KG8b4kAQtYeJ+Z4APnhzIbeCuGL5taOzCkCEUQmQzuTMT1vnCFdVyct315z2+tFtT/nT9fKHiQ0GT0W05PB4gcwV5vxmxI3F7zjAmZgwYchAfN7uqhbeFqdBDOXPhJjd9SiEcBZAbsGK+sgwmjDfjwpunCgYU9vTkXW5ptuoY3H8a62law== 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:X-MS-Exchange-SenderADCheck; bh=T1KsEeVqMBr+/ebPyiN3ljP2PGoIgoaLYOBcpxbcrOw=; b=eT8ack5uarry2KRXNC0qy9jfdxm7WOXJoPq4RJ9fN67+ST1IcHdOmHTaUh1J6BFrxwXTp1+GbfScwPRO6mLNSVebYXJmuAkocqMumuXYYo3FRz80CmuSpK4NuPAVQV7P5wqaSGhiK3y5RBPxpFHy2GgZFAREe6G6WTDLgbDDHhdxj0qqyD41rDLlbULiBjwcmRMU1eBrwr1sIuQC2DtFbP/whvRaC7QacDVN1D0PG6lkJkoX8gmxlRTaexVVRsCGBYUJsN0xM7NpZ9hejF8M8mi57pnwXmr+dN7cKwrfFZ6VQn/Ar6EAhdmwgGnKqJqpVz6+v9QFAzP9MLkPlXNRNA== 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=T1KsEeVqMBr+/ebPyiN3ljP2PGoIgoaLYOBcpxbcrOw=; b=kdTav/fZy1uOgfHjQ64vxncOqS1aw4lG18OYwl4bBt6zaUjBLK0V0tMorbrPahyVlAHmD7FxXB7BW6ZEnSA/1Ke5i6qQJq3IxzCrzzUiNluQmj/2n+Dw9SXeJM35ds+oLCY6AGEMghxsxifHK0sBiU239brCPqj/Clgm0fgRP9s= 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 MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) by MWHPR11MB1310.namprd11.prod.outlook.com (2603:10b6:300:28::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26; Fri, 15 May 2020 08:34:09 +0000 Received: from MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da]) by MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da%5]) with mapi id 15.20.3000.022; Fri, 15 May 2020 08:34:09 +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 11/19] staging: wfx: rename wfx_do_unjoin() into wfx_reset() Date: Fri, 15 May 2020 10:33:17 +0200 Message-Id: <20200515083325.378539-12-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200515083325.378539-1-Jerome.Pouiller@silabs.com> References: <20200515083325.378539-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR0P264CA0076.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:18::16) To MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.home (82.67.86.106) by PR0P264CA0076.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:18::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.24 via Frontend Transport; Fri, 15 May 2020 08:34:07 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [82.67.86.106] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 29607120-9d94-4515-4e45-08d7f8aabceb X-MS-TrafficTypeDiagnostic: MWHPR11MB1310: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-Forefront-PRVS: 04041A2886 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MpacTwfz80ffgfmYG50vIYjWGmVAhIoaeojKEwlNBA65XLiOcVr+MLeBp9iTsYybvTd02IjxPowtFc/GYoCS+oaAyQgsTSLFzbwrOQbZgbSft9GOsHFcUDG5T8qkffoAWu/9C6jBevCnISqvT1UOy0e59KN6lhzjkvN/1dYOpgSf4wQ8U4AZFn7nP+K+nkhK/dSd5m+o7vQenjBGEDAR9A6UkxmXMTBjLX0CZhYDLqouvmalU8Osda6IOeG62zssUzcHmZzz4CnVsBXuc5EHCHwo3D8vbbwnujzeKYLJflVu2xjmE1nUgWByrjq1iZGqujmBr/4TUVjRtuuTDgBUvBF0G0EWqhN87ofHFAPP7EUoOYgwWotmeKNmJwu4DocdKTZA6N+1iCoAyqJQgBsmujPKqUyBeoOKBwJ3Q/gq42COi74e49XMYJnFDMs2F6Ek X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1775.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(346002)(136003)(376002)(366004)(39850400004)(396003)(8886007)(66556008)(186003)(6512007)(66946007)(6506007)(36756003)(316002)(66476007)(26005)(52116002)(16526019)(6666004)(54906003)(2906002)(2616005)(478600001)(66574014)(107886003)(956004)(8936002)(86362001)(8676002)(6486002)(5660300002)(4326008)(1076003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: wi4a1l+jRG+ZOG3251G1mTU6LvL8mqfdfTMoIZkLFM+qLbp36giC5o85fqSTDjLqwTLLQ/dRQdlhpFSgtzcO/jSF+uXMGzNUuMgaU/FCGQXIYK/iAwvSOdK3Grg5w4briGv3Jr1xJcq0o1G6FdLxbHHMVThsZIB+Lbv/7xSnysd5meJXp4PUCipsUd4odnO3tp4KGopdzfGoPL79b7sel8SDPJL9EOg68Tgn2ajiaI8PqUOgMnki9QFs1grRRmSN5RwE/zElunYQbqqrcMz7+ALNE9bI5dS+yX1oOHtZO9VuNa/JxZHXTITb/TXPfF0eZQXLpnPBsrntL/82kljGQRPozLC3WI6ChW8WL0WT2qGVN1k9KGhAvm1cd9P7jmWhfdoxsod71q/P5erpFq6tw9ShyPXn5M0jN0Mz+SPuqGEURcmRCQR4FQOkoivriPSVvTdE3ZqAB9TIyi3IW6Lh5mb5KDe2QSu2FGYAYGoRhcw= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29607120-9d94-4515-4e45-08d7f8aabceb X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2020 08:34:09.5200 (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: JGf9KnfMA7NVDFVfd0Gh/2iMh/9k4KUYYQJtVM/2oNd/LS0i63SQN7H5MH+LnPGsQEZV/CbDdqY9Ly74cLtPig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1310 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller In fact, wfx_do_unjoin() resets the interface. This mechanism can be used in more cases than just disassociating from a BSS. So, rename it to reflect that fact. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 32 +++++++++++++++----------------- drivers/staging/wfx/sta.h | 1 + 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 1a876a0faaf5..e077f42b62dc 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -315,20 +315,6 @@ void wfx_set_default_unicast_key(struct ieee80211_hw *hw, hif_wep_default_key_id(wvif, idx); } -// Call it with wdev->conf_mutex locked -static void wfx_do_unjoin(struct wfx_vif *wvif) -{ - /* Unjoin is a reset. */ - wfx_tx_lock_flush(wvif->wdev); - hif_reset(wvif, false); - wfx_tx_policy_init(wvif); - if (wvif_count(wvif->wdev) <= 1) - hif_set_block_ack_policy(wvif, 0xFF, 0xFF); - wfx_tx_unlock(wvif->wdev); - wvif->bss_not_support_ps_poll = false; - cancel_delayed_work_sync(&wvif->beacon_loss_work); -} - static void wfx_set_mfp(struct wfx_vif *wvif, struct cfg80211_bss *bss) { @@ -359,6 +345,18 @@ static void wfx_set_mfp(struct wfx_vif *wvif, hif_set_mfp(wvif, mfpc, mfpr); } +void wfx_reset(struct wfx_vif *wvif) +{ + wfx_tx_lock_flush(wvif->wdev); + hif_reset(wvif, false); + wfx_tx_policy_init(wvif); + if (wvif_count(wvif->wdev) <= 1) + hif_set_block_ack_policy(wvif, 0xFF, 0xFF); + wfx_tx_unlock(wvif->wdev); + wvif->bss_not_support_ps_poll = false; + cancel_delayed_work_sync(&wvif->beacon_loss_work); +} + static void wfx_do_join(struct wfx_vif *wvif) { int ret; @@ -395,7 +393,7 @@ static void wfx_do_join(struct wfx_vif *wvif) ret = hif_join(wvif, conf, wvif->channel, ssid, ssidlen); if (ret) { ieee80211_connection_loss(wvif->vif); - wfx_do_unjoin(wvif); + wfx_reset(wvif); } else { /* Due to beacon filtering it is possible that the * AP's beacon is not known for the mac80211 stack. @@ -513,7 +511,7 @@ void wfx_leave_ibss(struct ieee80211_hw *hw, struct ieee80211_vif *vif) { struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv; - wfx_do_unjoin(wvif); + wfx_reset(wvif); } static void wfx_enable_beacon(struct wfx_vif *wvif, bool enable) @@ -580,7 +578,7 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, if (info->assoc || info->ibss_joined) wfx_join_finalize(wvif, info); else if (!info->assoc && vif->type == NL80211_IFTYPE_STATION) - wfx_do_unjoin(wvif); + wfx_reset(wvif); else dev_warn(wdev->dev, "%s: misunderstood change: ASSOC\n", __func__); diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h index c84c3749ec4f..8a20ad9ae017 100644 --- a/drivers/staging/wfx/sta.h +++ b/drivers/staging/wfx/sta.h @@ -71,6 +71,7 @@ void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd cmd); void wfx_event_report_rssi(struct wfx_vif *wvif, u8 raw_rcpi_rssi); // Other Helpers +void wfx_reset(struct wfx_vif *wvif); u32 wfx_rate_mask_to_hw(struct wfx_dev *wdev, u32 rates); #endif /* WFX_STA_H */ From patchwork Fri May 15 08:33:21 2020 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: 215601 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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, 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 695BBC433E1 for ; Fri, 15 May 2020 08:35:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4417C205CB for ; Fri, 15 May 2020 08:35:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="p/34v0f1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728317AbgEOIee (ORCPT ); Fri, 15 May 2020 04:34:34 -0400 Received: from mail-dm6nam11on2053.outbound.protection.outlook.com ([40.107.223.53]:55808 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728305AbgEOIec (ORCPT ); Fri, 15 May 2020 04:34:32 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dkvGPDRhx5zYtXEByF7oAux1HeDwRhjfQOWmC9QIoGCj7GP5TdcCN7jKG5p/OWmUr1U6Fpp8FmwHwykoFbiSiWRQ4ve3bZ9NVDFnygQX2U5LLoW3ZTwFjdFnVYL0iMMKBXzRVmwIkOu+whL5WTdT+479lP+ve1U0xbETa57Gx4/BuqH4zGSPH6Cawu/NLFeT41CQn6mYV/ESJrxPZi9VBMlIjFQznnx1z1twmAzilxoBSSb4QBtNF2Oy4zPp/nz6d0Cb5mOCjsEKzGjgVAOfEkO9Cyaw+2uaSTmQbkxXh/Ffc30BL68leE8My6KuxEojndh0p3aT7PSEiNyzIKt2cw== 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:X-MS-Exchange-SenderADCheck; bh=EYjX8N6WvaJV/3mN6jM7EZ7iDmTvplyybVaBshUG9T8=; b=HAkVHc8X5sYg2p9sZ7JCx4o07BRW38JJ0hokk5vzsQ8TG3+SdLa4+Ao8NwQGD44SiAYLqR9g+qiYbJSGY7GEZ58DxvRaja1SdfL0yy+cajZ5UVJsoWVnLA3noQAUB3bJ9zvzTvq1Wv25tWg5Wh4du+zaO66ydiv9e8FuW2e4qYjLj4lbaoLj+ZmDE3KzcTnrUqf9gbRge1Gafehd6izz4eRSG2qO09QDkkjaM0JWauzPmjSP4rru7hDme6UbAxob9fLeBh+jVXohILUS821GUFCrAQ001OQNxXcel1ZO2+YrV2EhMQX3wzIUaLu3UiFJUQthhx8X3a1BN0O4YHzYKQ== 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=EYjX8N6WvaJV/3mN6jM7EZ7iDmTvplyybVaBshUG9T8=; b=p/34v0f1C2OqxBuR+GJ8fLDhXlcqdDp6PZuFO3savRgNfk9WZMZK2K9T9WGr6Gr4qyBy414pRUtTQ+hgnX1qtsCJqX/V5jACg6TWyO/OjVMG9ifhnUZpMTDPSdGyZjaLOci4X8JHMLn76nIj4BtgVxADkFN4JARzu3/Yb49/kD8= 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 MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) by MWHPR11MB1310.namprd11.prod.outlook.com (2603:10b6:300:28::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26; Fri, 15 May 2020 08:34:17 +0000 Received: from MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da]) by MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da%5]) with mapi id 15.20.3000.022; Fri, 15 May 2020 08:34:17 +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 15/19] staging: wfx: drop unnecessary filter configuration when disabling filter Date: Fri, 15 May 2020 10:33:21 +0200 Message-Id: <20200515083325.378539-16-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200515083325.378539-1-Jerome.Pouiller@silabs.com> References: <20200515083325.378539-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR0P264CA0076.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:18::16) To MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.home (82.67.86.106) by PR0P264CA0076.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:18::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.24 via Frontend Transport; Fri, 15 May 2020 08:34:15 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [82.67.86.106] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f31271fd-43d1-4bc4-1c2f-08d7f8aac154 X-MS-TrafficTypeDiagnostic: MWHPR11MB1310: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1360; X-Forefront-PRVS: 04041A2886 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7spwvnyZz1zDCdwFVLqPTMw9uigAeEJCaKbESp3Wd7/Yu43irsj7sTV4vuDxdab1yBgnfhIv8vprm2uXoxH9F4frgnrLKJ41Y84ly1mcXHEp8iphxHfo/+vKrjXpGG7cgTggft2aXU6Ky+PopnHRkx2i+zNxLFwmEYZ3QjX2xc9RdVSXfjLKSWj+m2VeUYbrqHYvRsYVTbw5UdDXk00r9sC+hvcBLHlVxS2fH9LMVJikDwH3wuaXomqVDEBzoWcUpq+Yfx1u5a35ww7YI8P7J6WCuF7Sy+W+xn/oRxkfjhXy/6yLoF9IFtxPEWGET4uFi70lCalPQhFn9aS2WdhZ6R75a/o2Dg+sbal0LEjESxyAtxKJeYhagLKK3mDTlkmYs6bqrZxpBF+ryqOPIiajPHtgjpJfKRiz08vzRV7vroh/4/BBks7BSE9NiZbJVfnX X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1775.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(346002)(136003)(376002)(366004)(39850400004)(396003)(8886007)(66556008)(186003)(6512007)(4744005)(66946007)(6506007)(36756003)(316002)(66476007)(26005)(52116002)(16526019)(6666004)(54906003)(2906002)(2616005)(478600001)(66574014)(107886003)(956004)(8936002)(86362001)(8676002)(6486002)(5660300002)(4326008)(1076003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: mY0kyWcsGMoETkrbbtgi+BWDTKhHnrPQtKMReK2QcokXzHYyozw/zipmcgvDnpTf03f88KdC1KubO/GmWDAjOSnjT2l5Z9WisVN1K53bymp0nvXr8hhkcmlAwZuuCmyBnehLHNRG3panMH1FYgO38T56FUoskspF6Hb8eB/66riaeGEZDZ4yRiJO1LowO9Cq7/kxLcx+zR3yDbaIQQtpeBmz5PfjUNaAk5S8nzjjpITlOlkrPUvmaH7Q4v3YVyRdcC7QOUVJ2lNjfRn5Jx6YtKK7BdWSxGYFG8b74WG8Y8NsNiAcLLrSS8690lkjq2eRiAnZqQQd510Sk2AJ8SJeLgxJckLv1Hvof2lw7ZCBqwtPr9GA2ORZxdihlQTix4Qq7omE5/T2SCDHkcVTMNOGkWS6xExpjjF4l/EFeh0dkjmwsfqwP9/uWHDqJItplK35S8/uRyiqTmxHOJ8sd0+UFG0ohvwFITwoc3+PlnkV4Zs= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: f31271fd-43d1-4bc4-1c2f-08d7f8aac154 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2020 08:34:17.0726 (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: B/E9qCeCJYuiYUt7By3Kvd1mwq456uyT6LO40NoM3Z560Rz5cLcOqmiZqX2lTj9lWyqsBG3gsyMKIKxy/MR15g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1310 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Currently, when mac80211 want to disable beacon filtering, the driver reset the filter table and disable the beacon filtering. Only the latter action is required. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 0cb7315bb050..57304ed42e79 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -84,7 +84,6 @@ static void wfx_filter_beacon(struct wfx_vif *wvif, bool filter_beacon) }; if (!filter_beacon) { - hif_set_beacon_filter_table(wvif, 0, NULL); hif_beacon_filter_control(wvif, 0, 1); } else { hif_set_beacon_filter_table(wvif, 3, filter_ies); From patchwork Fri May 15 08:33:23 2020 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: 215603 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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, 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 63098C433DF for ; Fri, 15 May 2020 08:34:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3D28E206F4 for ; Fri, 15 May 2020 08:34:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="fK2cOhFH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728371AbgEOIej (ORCPT ); Fri, 15 May 2020 04:34:39 -0400 Received: from mail-dm6nam11on2086.outbound.protection.outlook.com ([40.107.223.86]:6138 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728329AbgEOIeh (ORCPT ); Fri, 15 May 2020 04:34:37 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hWtqyw7OvG5ftZl1C0XP4XTKLOHDiLvz0CuBcAfu3DzRKN4LImU6AS5eE+naT+1NNwW11RFehVCE9v7bJcxVOxp9q9AGfjic1xUaT5cE3M4CuLIlfhCcMda9DdFqv9lgK/Ob75audjfv9UJOW2luuvIrX1ilK3JtcuMPkQ+snxU2VD+4pZqZ+5TeppOC1KQoYCSckoVemw/lzdKh9yn1wyKzvwUe8Nq6hH+t/LoyXz8n4JUAKwlUPYBjryk1woWz/jpqFV0ILg55QOBAzxRrScmPi+p3gjllhOMDfvUPIxTXt6LfqN2tfdrfp8IwPZd8TvHgJA3swJR9LdPKatvqWA== 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:X-MS-Exchange-SenderADCheck; bh=gA6OR2oUdWaDAB+nq0jkFBd0As9cc8QT1KEc72rsWyI=; b=MXDflFDbTZYSKFTtxQ455I/NoPena4MJvhW9fWddVaqsI1BtFztnpEBYa5+22AnWAfzt6ZxeEvzrdafiAlEcuBTec9vSUhI9fs3YlWoVd5eAtsASjGIDkTRhxbqNEDpbUQZPq4sBc++7CTdrg2QV51Pp2QbV/GoINB/DomOtSU5SllhpHv2xJNp2bk0O60efOsZ0p/P1fvbvlJRmtfUdhVx51t+C7/OQNs8R4w7QMkzplyylmcvrdUG7emZ1Jktyg9vBMQBhDUhtFY9MHw3TQ3vVKzeG+zA+zJ6Fq1I+leFC6+oPPLgUCDNIZvnjKszyMB43Tr2p4Qh22Yebae4tUg== 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=gA6OR2oUdWaDAB+nq0jkFBd0As9cc8QT1KEc72rsWyI=; b=fK2cOhFHvMI/w+md359s94GT4tK6+C/GDcFNUzWDXjLSVrbpAEffxY3pmnLlmvMcaZ2AKpE24fc5z7cwO21CyKZvPvZtxY2HFE0YNqc6+CpuOgTH6+rlArBtpaKbDWemIvLuoJ6bI1pCxIlY6mmQ3dzNHFyIAU6Uu4unqP40t0U= 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 MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) by MWHPR11MB1310.namprd11.prod.outlook.com (2603:10b6:300:28::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26; Fri, 15 May 2020 08:34:20 +0000 Received: from MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da]) by MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da%5]) with mapi id 15.20.3000.022; Fri, 15 May 2020 08:34: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 17/19] staging: wfx: remove false-positive WARN() Date: Fri, 15 May 2020 10:33:23 +0200 Message-Id: <20200515083325.378539-18-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200515083325.378539-1-Jerome.Pouiller@silabs.com> References: <20200515083325.378539-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR0P264CA0076.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:18::16) To MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.home (82.67.86.106) by PR0P264CA0076.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:18::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.24 via Frontend Transport; Fri, 15 May 2020 08:34:19 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [82.67.86.106] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fca40e28-9172-474d-31d1-08d7f8aac3a4 X-MS-TrafficTypeDiagnostic: MWHPR11MB1310: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-Forefront-PRVS: 04041A2886 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Kxc2GBEh10E5AJW0iZM2sKa/aAboNACW5nEFI7ZU541QOQas0dJxZr2MVqnwmoMl+33iwg2InHhTUNCEzIiQ3mjrzZxozg0A1WiaOEfjLvZzfevxSYE++jbes1SLh7eEXxUzly4buSnOvKyY/Cr74j6t31PG1uaxNhEGwsonIAG2NGAGNEIIk65HFyMFGBO5GjYBuDWYUHbuoGGddasi9VQau4EX+GQl2Ppp/s73/S0XmBgl0cUwstKE2jBpkIEaFX3AihlxiXV1MqccRNBXEAheQX+ka9VGKW8mAtovGK3pQrA1d0vfqtCiRZThk7C+mWw558C1ZZYoFhON8L/urW2grE0+hP2OSRvyHPVY9nXKcuGbNiYig/OlYBuBhza7GXQWXWMUqP3o6BfGvqhJR4igY6UW/dW9I1PQILE78Yie1bZ13gmM9w/jHnNPvSDS X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1775.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(346002)(136003)(376002)(366004)(39850400004)(396003)(8886007)(66556008)(186003)(6512007)(66946007)(6506007)(36756003)(316002)(66476007)(26005)(52116002)(16526019)(6666004)(54906003)(2906002)(2616005)(478600001)(66574014)(107886003)(956004)(8936002)(86362001)(8676002)(6486002)(5660300002)(4326008)(1076003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: bWwi66Q7D7gg5SHogjpjj51ZFAbIHFjzY7yjT4Bd7ydF66bOBFnQTqeD5NXDPw9foPRVpPvuXqe4HwBndo5mBdKKycgD+2ne9czKwNkhOMicx3Ij8EZE5J5Fyk1tgh0C26y+g9k19mSrCmBKi4ih/io2amd2Ol3SUqTBFr5KsIvy8l8KjsBLHSIidZIFnzhe0Z4RrOF69xoYsha0bazGQSrO2oGy9PEQAFt+gnyhh4Vqs+0JLQqhZmLr3vsuUe5BM8StCpYukZMjP+kPUlqSPuZLb4v6kzNdky3yZtpJSiyLe1axOW9XGxioaLdKbJGxZKHBPmIs19cTRS+7VoxTgm0be2bBCx76PBZFJxjtwMMpTPzXlmamBI+Qdlgekq+PcJ8bW1HPbuqSIBgCYFXDkIZcn3k723J+DH6T5YX01XLiRF0jGQobdI/4j00MzrjIXfQm5RZ7gQZJwMqpPCATQXhy0LovPTHYPUysLR/5SxI= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: fca40e28-9172-474d-31d1-08d7f8aac3a4 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2020 08:34:20.7670 (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: gBFOxPy+qeww3kRKJnJBRhsyotDZp5GaMNTJ6aNuwNUO3W0tkPSmKC3nTUoPkgICeXWTfy+HF1GJtvZklA3Gww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1310 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The function wfx_tx_flush() wait for there is no more queued frames in hardware queue. Then, for the sanity, it checks that there is no more pending frame on any AC queue. However, there is a race here. It may happens that hardware queues are empty, but the counters of the AC queues are not yet updated. So, it may produce false-positive warning. The easiest way to solve the problem is just to remove the sanity check. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 0c799cedd101..26b141cbd303 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -30,7 +30,6 @@ void wfx_tx_unlock(struct wfx_dev *wdev) void wfx_tx_flush(struct wfx_dev *wdev) { int ret; - int i; // Do not wait for any reply if chip is frozen if (wdev->chip_frozen) @@ -41,12 +40,6 @@ void wfx_tx_flush(struct wfx_dev *wdev) ret = wait_event_timeout(wdev->hif.tx_buffers_empty, !wdev->hif.tx_buffers_used, msecs_to_jiffies(3000)); - if (ret) { - for (i = 0; i < IEEE80211_NUM_ACS; i++) - WARN(atomic_read(&wdev->tx_queue[i].pending_frames), - "there are still %d pending frames on queue %d", - atomic_read(&wdev->tx_queue[i].pending_frames), i); - } if (!ret) { dev_warn(wdev->dev, "cannot flush tx buffers (%d still busy)\n", wdev->hif.tx_buffers_used); From patchwork Fri May 15 08:33:24 2020 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: 215602 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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, 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 833A0C433E1 for ; Fri, 15 May 2020 08:35:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 57D6E206F4 for ; Fri, 15 May 2020 08:35:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="gBCBY2Ph" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728305AbgEOIez (ORCPT ); Fri, 15 May 2020 04:34:55 -0400 Received: from mail-dm6nam11on2053.outbound.protection.outlook.com ([40.107.223.53]:55808 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728344AbgEOIei (ORCPT ); Fri, 15 May 2020 04:34:38 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=krHkc+fWyHE6nOwxoR+k7/MmYtQoP2+bE/d0GFaK+HjRXISzhHDp1hQFjmvABCtcSINgjyqXxoY06KN/qXg1zEF9PiB5OH/mgPXo7YWezA74JtJH1asNR0lH1KrHioTuesq8mDYqVZrrfPLwS4MKPxli0wKndvB9zPED1/IjrSbeVZkitqJKolpqF/GLzp3JBCNQ4xA4PQMZpP63ky3irpPOVvkjZcZAhnQgWikBValSpuq93SfB5sFjPzKm8Oz/zbZqVLzSRgZ3R7pQp9Pg0+rfHLALMzTW+N+WEavHUJe5JCtywpjitSBj09zQzyqgOenWYjCDELuFcIglJI4K+A== 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:X-MS-Exchange-SenderADCheck; bh=lSbIlKTe3enIqg9YTCmAByx5NCD0EeouBjtUegseYYU=; b=EH7fqbfCraRuto5q7MFisH7iztjz8qEpJc/FUrQhe4Z9bncPBjJbuy4D6AIi8GRfy5ADbYrZ3yF5Zv2RsztLZZT0VYCeBAJjC0BhMvIvoyfAwNMA6O3QDrpftGwj++17SrrQCtbtHePH0+O6vjuutXxNZcLr8BWz+6dGKJ6Po3ZUJJEU6EhtZMvpOq7jxvLOM9jTmfXKLkU5uCEqNk8cmmc1ocUfSz/emYRAWuQqdVJ9YjBp+vCOxWs+xxdZO9T3gRSrHE0DGpSxetaGUEsQLBFlLsjcD0hCOyaDEOoAmqL5o8LbcuW1Xv9O9lcW6d9vHvaL40RZqUDUvEsw+XAekQ== 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=lSbIlKTe3enIqg9YTCmAByx5NCD0EeouBjtUegseYYU=; b=gBCBY2Ph8Fa2tj0PWz0Ytuz88QUyxq6oahaTIlyjq99S2+Y1u4HcWEBv0AQKRGe09kN02BIFkAMwKITIHdqnDemvJt1PybMirjWbbvLtxSYOfXOw1KiNY+IuoTfq673i8vqScWzCvvKq9sMU+DarBzNWtj+CH6dIyBF61tPCXPU= 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 MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) by MWHPR11MB1310.namprd11.prod.outlook.com (2603:10b6:300:28::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26; Fri, 15 May 2020 08:34:22 +0000 Received: from MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da]) by MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da%5]) with mapi id 15.20.3000.022; Fri, 15 May 2020 08:34:22 +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 18/19] staging: wfx: trace acknowledges not linked to any stations Date: Fri, 15 May 2020 10:33:24 +0200 Message-Id: <20200515083325.378539-19-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200515083325.378539-1-Jerome.Pouiller@silabs.com> References: <20200515083325.378539-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR0P264CA0076.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:18::16) To MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.home (82.67.86.106) by PR0P264CA0076.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:18::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.24 via Frontend Transport; Fri, 15 May 2020 08:34:21 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [82.67.86.106] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 43c43a91-d1fb-49d1-5773-08d7f8aac4b7 X-MS-TrafficTypeDiagnostic: MWHPR11MB1310: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-Forefront-PRVS: 04041A2886 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eYb2UtXedCp75ekRa6RPesk76BXq/5yaxjDmXuTXbTEZugF2FYqWwM3L/E60VX891Mxu07xcjrtWvrQv0XumCYzzAiqyq6FKhdLfig4k5U2u+daYRWHjed5RKrlehhnGc8+JIjA9V1+01XY/oiFM/fEbuL3ZOnQPuVT1/CjRAlQUBUAlrWJP3d8+i4BlxZ41zLf0hi5cBMl6tWlYGzjxCA4OHLFUIMP0creovKlatZyIruIOQwF2wwe5ACRSVVYxSnKG1H9+gCE0lMIII28jyseeB5LpLYw12janyAYt9Sdk+RlfuN64+Z3C7h2a18sHge6ewxkpaGQ1OZghFeIjD9zX0/0wjKJh6ZslO8LsGU7ePSrtMizx95yURx4Ac7r1KibJknMop3IEefmNJFDXSg3l7xMC1IDxW/DYrIjmU2qZHM8Lj7u/gVzwXtj1R0ym X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1775.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(346002)(136003)(376002)(366004)(39850400004)(396003)(8886007)(66556008)(186003)(6512007)(4744005)(66946007)(6506007)(36756003)(316002)(66476007)(26005)(52116002)(16526019)(54906003)(2906002)(2616005)(478600001)(66574014)(107886003)(956004)(8936002)(86362001)(8676002)(6486002)(5660300002)(4326008)(1076003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: n5TnXYb/si5hi1eG4/zNN8NPvKeew/p+dQnqWqH874TiIlNS0PT+4nFMQarO6y5H1BhB40buBa74hU5ov0ggXFXb23pIl7tikju0AsMWklbdHqVj8c701UUp/Re10QUWIVODgemomE2/A5/LVZnrtbiWMoJkmMC2VXgNlLhFTwevqHTFWC+HcZqlW0e1CwcvnVSgZ1mMA5fGOicdNm8gRdN+sRA1q7RTZNfAqxwhUbBqrqdcLhuwI4Zafs2/nQfrPRLBYZBAowMlzaLsyr8tXsrXyAhYmz+1DE4OS/2H04IKXrU/laMLZiuCX2pNY1+0bYciUONolvj2ngI3anw59vH6UBqRALbJY8yDD/Lehg3kliYLj7tT8p7plY7bXV/y924H20sAJwFZHZyrGCQ5HvMlkSUmojkGce8a38YuLcyWKwmkIDGeM3FA0eYqVe11/Rl7ik3xuAx5H5xXdLZKGa3GGBSHJTh7WEN5AqPPiow= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 43c43a91-d1fb-49d1-5773-08d7f8aac4b7 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2020 08:34:22.7461 (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: KnoYlfXH466jUDuA8tuom+8LYDB6DD3Bd+TA8grh6/TllKm4wbVlAcXufCsFjGEdMgEiIhOR0vSLB1UTO39o1w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1310 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Some resources are associated to the outgoing of the stations. To avoid any resource leaks. It is important to understand why an acknowledge is not associated to any station. Add a trace for that purpose. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index d01e679b0880..a82f00f8f17b 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -481,6 +481,9 @@ static void wfx_tx_update_sta(struct wfx_vif *wvif, struct ieee80211_hdr *hdr) if (!sta_priv->buffered[tid]) ieee80211_sta_set_buffered(sta, tid, false); spin_unlock_bh(&sta_priv->lock); + } else { + dev_dbg(wvif->wdev->dev, "%s: sta does not exist anymore\n", + __func__); } rcu_read_unlock(); }