From patchwork Fri Mar 8 15:25:04 2019
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Piotr Figiel
X-Patchwork-Id: 10845051
X-Patchwork-Delegate: kvalo@adurom.com
Return-Path:
Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org
[172.30.200.125])
by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3551A1803
for ;
Fri, 8 Mar 2019 15:25:09 +0000 (UTC)
Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 104432E4C1
for ;
Fri, 8 Mar 2019 15:25:09 +0000 (UTC)
Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
id 035462E282; Fri, 8 Mar 2019 15:25:08 +0000 (UTC)
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
pdx-wl-mail.web.codeaurora.org
X-Spam-Level:
X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED,
DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1
Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DC5C2E4C1
for ;
Fri, 8 Mar 2019 15:25:08 +0000 (UTC)
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
id S1726413AbfCHPZH (ORCPT
);
Fri, 8 Mar 2019 10:25:07 -0500
Received: from mail-eopbgr100075.outbound.protection.outlook.com
([40.107.10.75]:15584
"EHLO GBR01-LO2-obe.outbound.protection.outlook.com"
rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP
id S1726296AbfCHPZH (ORCPT );
Fri, 8 Mar 2019 10:25:07 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=camlinlimited.onmicrosoft.com; s=selector1-camlintechnologies-com;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=3PR/SdB4LMYpipOFkW03otiZL4+XM2jXa+deT/Fca+U=;
b=XiuDnBlQgAke06GPG3D0KdN7RhNE3HS+96xsgk+y1SHItcZLixDsuo7BKQnaQ+HcsAlWYzulFtWHlcJHHYR/qnkwBiAB4krWppGNSP+UB2GZsbrCvolbHNGTKF0yB3L1FsVkbU09MhoP+vfkB5dMq11MHduuKenm/e/hXgnWP+Q=
Received: from LNXP123MB2185.GBRP123.PROD.OUTLOOK.COM (20.179.129.83) by
LNXP123MB2106.GBRP123.PROD.OUTLOOK.COM (20.179.129.11) with Microsoft SMTP
Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
15.20.1686.18; Fri, 8 Mar 2019 15:25:04 +0000
Received: from LNXP123MB2185.GBRP123.PROD.OUTLOOK.COM
([fe80::396a:e27e:d5dd:6bf0]) by LNXP123MB2185.GBRP123.PROD.OUTLOOK.COM
([fe80::396a:e27e:d5dd:6bf0%5]) with mapi id 15.20.1686.018; Fri, 8 Mar 2019
15:25:04 +0000
From: Piotr Figiel
To: "linux-wireless@vger.kernel.org" ,
"arend.vanspriel@broadcom.com" ,
"kvalo@codeaurora.org"
CC: "franky.lin@broadcom.com" ,
"hante.meuleman@broadcom.com" ,
"chi-hsien.lin@cypress.com" ,
"wright.feng@cypress.com" ,
"brcm80211-dev-list@cypress.com" ,
Pawel Lenkow ,
Lech Perczak , =?iso-8859-2?q?Krzysztof_D?=
=?iso-8859-2?q?robi=F1ski?= ,
Piotr Figiel
Subject: [PATCH 1/3] brcmfmac: fix race during disconnect when USB completion
is in progress
Thread-Topic: [PATCH 1/3] brcmfmac: fix race during disconnect when USB
completion is in progress
Thread-Index: AQHU1cMaAlmNpwu8GkCXDUXewU3Jmw==
Date: Fri, 8 Mar 2019 15:25:04 +0000
Message-ID:
<1552058658-23250-2-git-send-email-p.figiel@camlintechnologies.com>
References:
<1552058658-23250-1-git-send-email-p.figiel@camlintechnologies.com>
In-Reply-To:
<1552058658-23250-1-git-send-email-p.figiel@camlintechnologies.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [95.143.242.242]
x-clientproxiedby: DB6PR07CA0010.eurprd07.prod.outlook.com
(2603:10a6:6:2d::20) To LNXP123MB2185.GBRP123.PROD.OUTLOOK.COM
(2603:10a6:600:dc::19)
authentication-results: spf=none (sender IP is )
smtp.mailfrom=p.figiel@camlintechnologies.com;
x-ms-exchange-messagesentrepresentingtype: 1
x-mailer: git-send-email 2.7.4
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: f5285d48-46ec-42e1-3586-08d6a3da3d10
x-microsoft-antispam:
BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(2017052603328)(7153060)(7193020);SRVR:LNXP123MB2106;
x-ms-traffictypediagnostic: LNXP123MB2106:
x-microsoft-exchange-diagnostics: =?iso-8859-2?q?1=3BLNXP123MB2106=3B23=3AV8?=
=?iso-8859-2?q?rl0huorYu4z4V7/ZdMkLvp93hPatZLbQXcTyrg6zVqYHamYziTPWX/n64XUn?=
=?iso-8859-2?q?R1x6D941H4MVk2+Fdv68JTGCVx6AVYeecLdhhHV/d/VeKkgerlcrgRX2nyJ2?=
=?iso-8859-2?q?voSOfH99iKWQfAs3eH51pEqgiGZXK0+a2VOLp1/1whGJH2fepPfmRwbWVf+1?=
=?iso-8859-2?q?3WOvZR9Ve57HxLXC+KbSfwDEWXapHmvdRIZeKl2vDw61egRKHgG3RSOHYZBZ?=
=?iso-8859-2?q?H3wuKQJISvAqKY87urXsewMEeUZKW1koZpiTNSVLMJP0B7/7dd6OLqOUoepl?=
=?iso-8859-2?q?aPzMmm7iquaPSdW5gFt9ACn0494ZMQL+bSoh5zqGpTkHz4xuCZ7LBHXRlyYx?=
=?iso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VXWz66qYHSs78mZEgYWCJv2xbhvJKheWBqGsgowE2KbR06M?=
=?iso-8859-2?q?7coRpuPljaWm9J3N+6M8VbR4YyiO1qMLSBbcLFBnHsNeXDQj+ev3kA0wlA9L?=
=?iso-8859-2?q?o=3D?=
x-microsoft-antispam-prvs:
x-forefront-prvs: 0970508454
x-forefront-antispam-report:
SFV:NSPM;SFS:(10009020)(376002)(136003)(346002)(396003)(366004)(39850400004)(51234002)(189003)(199004)(8676002)(305945005)(97736004)(105586002)(486006)(99286004)(81166006)(3846002)(14454004)(81156014)(6116002)(476003)(106356001)(102836004)(6506007)(66066001)(186003)(6512007)(36756003)(26005)(110136005)(54906003)(6486002)(5660300002)(52116002)(446003)(2616005)(11346002)(386003)(2906002)(53936002)(107886003)(76176011)(71190400001)(71200400001)(86362001)(2201001)(50226002)(6436002)(316002)(4326008)(68736007)(14444005)(5024004)(256004)(25786009)(7736002)(2501003)(8936002)(478600001);DIR:OUT;SFP:1101;SCL:1;SRVR:LNXP123MB2106;H:LNXP123MB2185.GBRP123.PROD.OUTLOOK.COM;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1;
received-spf: None (protection.outlook.com: camlintechnologies.com does not
designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam-message-info:
zmUFUe3iOUiGlL7id1c0pbeob+QtCl0SyVU9CiRUZoovc5cV+b0jRYeZ17BERhZwgIsGcJEDksuH9B8h4a8FsOboXZXDZYpIEgNyusEWRi06YE6XHY+9Dijeyv+hEvCpUAjHClfQe+pPpRZMcmbKYRMlnYIPulFuWaJtAmJ+bSBBAwBUL42nnLpunDsJv8oRYKbS2aV2pyhc+Tz3xdmbD1Edn8KHb7MPjXCPwxplxCIEJLTMib6zjhT7mfWgLZUH6uBPnIDfy2aJCI6TFUWhmJOU+ohjfju9cBb3Xmg3Ga9NC45f5UdRcf/jZrRGXvWWCah8MFiLMOO2XD7q21jyhZe1mRK9iQnF8Ye+NMl/ZrG0wx0zcmkdGobl1BSkx+82wizYpiwKkEuSeALVHErDkfoO8S5iMvi1u/t9u3mbPKM=
MIME-Version: 1.0
X-OriginatorOrg: camlintechnologies.com
X-MS-Exchange-CrossTenant-Network-Message-Id:
f5285d48-46ec-42e1-3586-08d6a3da3d10
X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Mar 2019 15:25:04.5106
(UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: fd4b1729-b18d-46d2-9ba0-2717b852b252
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LNXP123MB2106
Sender: linux-wireless-owner@vger.kernel.org
Precedence: bulk
List-ID:
X-Mailing-List: linux-wireless@vger.kernel.org
X-Virus-Scanned: ClamAV using ClamSMTP
It was observed that rarely during USB disconnect happening shortly after
connect (before full initialization completes) usb_hub_wq would wait
forever for the dev_init_lock to be unlocked. dev_init_lock would remain
locked though because of infinite wait during usb_kill_urb:
[ 2730.656472] kworker/0:2 D 0 260 2 0x00000000
[ 2730.660700] Workqueue: events request_firmware_work_func
[ 2730.664807] [<809dca20>] (__schedule) from [<809dd164>] (schedule+0x4c/0xac)
[ 2730.670587] [<809dd164>] (schedule) from [<8069af44>] (usb_kill_urb+0xdc/0x114)
[ 2730.676815] [<8069af44>] (usb_kill_urb) from [<7f258b50>] (brcmf_usb_free_q+0x34/0xa8 [brcmfmac])
[ 2730.684833] [<7f258b50>] (brcmf_usb_free_q [brcmfmac]) from [<7f2517d4>] (brcmf_detach+0xa0/0xb8 [brcmfmac])
[ 2730.693557] [<7f2517d4>] (brcmf_detach [brcmfmac]) from [<7f251a34>] (brcmf_attach+0xac/0x3d8 [brcmfmac])
[ 2730.702094] [<7f251a34>] (brcmf_attach [brcmfmac]) from [<7f2587ac>] (brcmf_usb_probe_phase2+0x468/0x4a0 [brcmfmac])
[ 2730.711601] [<7f2587ac>] (brcmf_usb_probe_phase2 [brcmfmac]) from [<7f252888>] (brcmf_fw_request_done+0x194/0x220 [brcmfmac])
[ 2730.721795] [<7f252888>] (brcmf_fw_request_done [brcmfmac]) from [<805748e4>] (request_firmware_work_func+0x4c/0x88)
[ 2730.731125] [<805748e4>] (request_firmware_work_func) from [<80141474>] (process_one_work+0x228/0x808)
[ 2730.739223] [<80141474>] (process_one_work) from [<80141a80>] (worker_thread+0x2c/0x564)
[ 2730.746105] [<80141a80>] (worker_thread) from [<80147bcc>] (kthread+0x13c/0x16c)
[ 2730.752227] [<80147bcc>] (kthread) from [<801010b4>] (ret_from_fork+0x14/0x20)
[ 2733.099695] kworker/0:3 D 0 1065 2 0x00000000
[ 2733.103926] Workqueue: usb_hub_wq hub_event
[ 2733.106914] [<809dca20>] (__schedule) from [<809dd164>] (schedule+0x4c/0xac)
[ 2733.112693] [<809dd164>] (schedule) from [<809e2a8c>] (schedule_timeout+0x214/0x3e4)
[ 2733.119621] [<809e2a8c>] (schedule_timeout) from [<809dde2c>] (wait_for_common+0xc4/0x1c0)
[ 2733.126810] [<809dde2c>] (wait_for_common) from [<7f258d00>] (brcmf_usb_disconnect+0x1c/0x4c [brcmfmac])
[ 2733.135206] [<7f258d00>] (brcmf_usb_disconnect [brcmfmac]) from [<8069e0c8>] (usb_unbind_interface+0x5c/0x1e4)
[ 2733.143943] [<8069e0c8>] (usb_unbind_interface) from [<8056d3e8>] (device_release_driver_internal+0x164/0x1fc)
[ 2733.152769] [<8056d3e8>] (device_release_driver_internal) from [<8056c078>] (bus_remove_device+0xd0/0xfc)
[ 2733.161138] [<8056c078>] (bus_remove_device) from [<8056977c>] (device_del+0x11c/0x310)
[ 2733.167939] [<8056977c>] (device_del) from [<8069cba8>] (usb_disable_device+0xa0/0x1cc)
[ 2733.174743] [<8069cba8>] (usb_disable_device) from [<8069507c>] (usb_disconnect+0x74/0x1dc)
[ 2733.181823] [<8069507c>] (usb_disconnect) from [<80695e88>] (hub_event+0x478/0xf88)
[ 2733.188278] [<80695e88>] (hub_event) from [<80141474>] (process_one_work+0x228/0x808)
[ 2733.194905] [<80141474>] (process_one_work) from [<80141a80>] (worker_thread+0x2c/0x564)
[ 2733.201724] [<80141a80>] (worker_thread) from [<80147bcc>] (kthread+0x13c/0x16c)
[ 2733.207913] [<80147bcc>] (kthread) from [<801010b4>] (ret_from_fork+0x14/0x20)
It was traced down to a case where usb_kill_urb would be called on an URB
structure containing more or less random data, including large number in
its use_count. During the debugging it appeared that in brcmf_usb_free_q()
the traversal over URBs' lists is not synchronized with operations on those
lists in brcmf_usb_rx_complete() leading to handling
brcmf_usbdev_info structure (holding lists' head) as lists' element and in
result causing above problem.
Fix it by walking through all URBs during brcmf_cancel_all_urbs using the
arrays of requests instead of linked lists.
Signed-off-by: Piotr Figiel
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
index e9cbfd0..a775409 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
@@ -682,12 +682,18 @@ static int brcmf_usb_up(struct device *dev)
static void brcmf_cancel_all_urbs(struct brcmf_usbdev_info *devinfo)
{
+ int i;
+
if (devinfo->ctl_urb)
usb_kill_urb(devinfo->ctl_urb);
if (devinfo->bulk_urb)
usb_kill_urb(devinfo->bulk_urb);
- brcmf_usb_free_q(&devinfo->tx_postq, true);
- brcmf_usb_free_q(&devinfo->rx_postq, true);
+ if (devinfo->tx_reqs)
+ for (i = 0; i < devinfo->bus_pub.ntxq; i++)
+ usb_kill_urb(devinfo->tx_reqs[i].urb);
+ if (devinfo->rx_reqs)
+ for (i = 0; i < devinfo->bus_pub.nrxq; i++)
+ usb_kill_urb(devinfo->rx_reqs[i].urb);
}
static void brcmf_usb_down(struct device *dev)
From patchwork Fri Mar 8 15:25:06 2019
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Piotr Figiel
X-Patchwork-Id: 10845055
X-Patchwork-Delegate: kvalo@adurom.com
Return-Path:
Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org
[172.30.200.125])
by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 13106139A
for ;
Fri, 8 Mar 2019 15:25:51 +0000 (UTC)
Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F1B0F2521E
for ;
Fri, 8 Mar 2019 15:25:50 +0000 (UTC)
Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
id E5FB92E115; Fri, 8 Mar 2019 15:25:50 +0000 (UTC)
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
pdx-wl-mail.web.codeaurora.org
X-Spam-Level:
X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED,
DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1
Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D38E2521E
for ;
Fri, 8 Mar 2019 15:25:50 +0000 (UTC)
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
id S1726429AbfCHPZt (ORCPT
);
Fri, 8 Mar 2019 10:25:49 -0500
Received: from mail-eopbgr100066.outbound.protection.outlook.com
([40.107.10.66]:11645
"EHLO GBR01-LO2-obe.outbound.protection.outlook.com"
rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP
id S1726424AbfCHPZt (ORCPT );
Fri, 8 Mar 2019 10:25:49 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=camlinlimited.onmicrosoft.com; s=selector1-camlintechnologies-com;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=L8uXgU1/4In7BiyADkKVZAoGe1wiiQHWXMWbjJDSDWI=;
b=jfdos3D9sEXkxxC2EVRR4x/GxcGLro51kYZdvOJTdXKnbLnJmew5eVGo2ZFZiNKOxgc027lJHZbRpCffPLh9KJ6Ah7nTGpLCxMwqLmFAzMaP1zofpzF74sD3yNE2zO+F68/ekSeX/adVYmwm31hx1yNOid1CKSMIhOudlHvfXlk=
Received: from LNXP123MB2185.GBRP123.PROD.OUTLOOK.COM (20.179.129.83) by
LNXP123MB2106.GBRP123.PROD.OUTLOOK.COM (20.179.129.11) with Microsoft SMTP
Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
15.20.1686.18; Fri, 8 Mar 2019 15:25:07 +0000
Received: from LNXP123MB2185.GBRP123.PROD.OUTLOOK.COM
([fe80::396a:e27e:d5dd:6bf0]) by LNXP123MB2185.GBRP123.PROD.OUTLOOK.COM
([fe80::396a:e27e:d5dd:6bf0%5]) with mapi id 15.20.1686.018; Fri, 8 Mar 2019
15:25:07 +0000
From: Piotr Figiel
To: "linux-wireless@vger.kernel.org" ,
"arend.vanspriel@broadcom.com" ,
"kvalo@codeaurora.org"
CC: "franky.lin@broadcom.com" ,
"hante.meuleman@broadcom.com" ,
"chi-hsien.lin@cypress.com" ,
"wright.feng@cypress.com" ,
"brcm80211-dev-list@cypress.com" ,
Pawel Lenkow ,
Lech Perczak , =?iso-8859-2?q?Krzysztof_D?=
=?iso-8859-2?q?robi=F1ski?= ,
Piotr Figiel
Subject: [PATCH 2/3] brcmfmac: remove pending parameter from brcmf_usb_free_q
Thread-Topic: [PATCH 2/3] brcmfmac: remove pending parameter from
brcmf_usb_free_q
Thread-Index: AQHU1cMcob53qBcu4EepzJ+soxNvRA==
Date: Fri, 8 Mar 2019 15:25:06 +0000
Message-ID:
<1552058658-23250-3-git-send-email-p.figiel@camlintechnologies.com>
References:
<1552058658-23250-1-git-send-email-p.figiel@camlintechnologies.com>
In-Reply-To:
<1552058658-23250-1-git-send-email-p.figiel@camlintechnologies.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [95.143.242.242]
x-clientproxiedby: DB6PR07CA0010.eurprd07.prod.outlook.com
(2603:10a6:6:2d::20) To LNXP123MB2185.GBRP123.PROD.OUTLOOK.COM
(2603:10a6:600:dc::19)
authentication-results: spf=none (sender IP is )
smtp.mailfrom=p.figiel@camlintechnologies.com;
x-ms-exchange-messagesentrepresentingtype: 1
x-mailer: git-send-email 2.7.4
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: d9c6c8d7-a664-4286-6029-08d6a3da3e92
x-microsoft-antispam:
BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(2017052603328)(7153060)(7193020);SRVR:LNXP123MB2106;
x-ms-traffictypediagnostic: LNXP123MB2106:
x-microsoft-exchange-diagnostics: =?iso-8859-2?q?1=3BLNXP123MB2106=3B23=3AtE?=
=?iso-8859-2?q?LjxLtU+8XRWf404igN51MQaqlfWr6wey/Vpc5dBZTZ9P7g/YXcQLEWj4ob6Z?=
=?iso-8859-2?q?4x0ZNH3LXBVmAPlRDF+sFKzKNrltc7UZkiB6gdVv3TxdJgPUGMzFTXJJbFwW?=
=?iso-8859-2?q?gWSlTVP8ccAxBQf2/LsGa+SE1YdFu39TLF4D8sApjabbi+pzQShn+UdBXb7f?=
=?iso-8859-2?q?HZluxaWIXM4ZjxPzDhjyXqvwwWwIYa7nRW8wXif3cXPFRsVoPXcWPURyaaV+?=
=?iso-8859-2?q?ozMWZifCgsUHs+xDxNq4sAMYzF5zT8FpnIPPmqFsqfEse26P5lRuhEyP3yH8?=
=?iso-8859-2?q?9PE9RFA4PdpWyN6tlIc1OnDZU54C6MBUvHEUBecSS7JDSd4ie4zhFMCvd9UY?=
=?iso-8859-2?q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Uwga42kDy0GPZlFn03mIznyG09HTITYzKHI/pytmY08YKYd8XloXOGEKz?=
=?iso-8859-2?q?PbV2AwH0SOnsNrCzC2?=
x-microsoft-antispam-prvs:
x-forefront-prvs: 0970508454
x-forefront-antispam-report:
SFV:NSPM;SFS:(10009020)(376002)(136003)(346002)(396003)(366004)(39850400004)(189003)(199004)(8676002)(305945005)(97736004)(105586002)(486006)(99286004)(81166006)(3846002)(14454004)(81156014)(6116002)(476003)(106356001)(102836004)(6506007)(66066001)(186003)(6512007)(36756003)(26005)(110136005)(54906003)(6486002)(5660300002)(52116002)(446003)(2616005)(11346002)(386003)(2906002)(53936002)(107886003)(76176011)(71190400001)(71200400001)(86362001)(2201001)(50226002)(6436002)(316002)(4326008)(68736007)(14444005)(256004)(25786009)(7736002)(2501003)(8936002)(478600001);DIR:OUT;SFP:1101;SCL:1;SRVR:LNXP123MB2106;H:LNXP123MB2185.GBRP123.PROD.OUTLOOK.COM;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1;
received-spf: None (protection.outlook.com: camlintechnologies.com does not
designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam-message-info:
A3iI4jQrIcGPh2xhV92KC5cbfMvNlTXyzJmkiI4cl/FWO/3i6O/fHEoo4NWHQiQ/bIZddsSDManV9wYQ7sMWRWQZQggp8R6ztURvfdvGDOzqq2KSb/i7FUWsmByh7SeqK3NbG2E5kktXhtpCW/47E0B3GpGiP0LKSbHr51jzF017jY10DxWyuZ1LNiSY6YJg9yWPEFlJ4VH9Z2tUtIHtt5s/9Ih7BV95oejAdX38EoVKoeue0gvXPmOh+NC2p0ImcuLjF/I7iEG4gdeXEktu/BubyTJ8/kYqKDlRePLQ7F79qqT90BfxVcoh037A7SN4zURYpjI1IZt32oJrXAJEeBLGaAd2u/9YR/wB5uQf88KnFkon5W34QCj3mPz3+Sr2OcypMuyEK+6KCKYBDjFJCB7IA9WuvHO0X9I1cYgi7CI=
MIME-Version: 1.0
X-OriginatorOrg: camlintechnologies.com
X-MS-Exchange-CrossTenant-Network-Message-Id:
d9c6c8d7-a664-4286-6029-08d6a3da3e92
X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Mar 2019 15:25:06.9883
(UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: fd4b1729-b18d-46d2-9ba0-2717b852b252
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LNXP123MB2106
Sender: linux-wireless-owner@vger.kernel.org
Precedence: bulk
List-ID:
X-Mailing-List: linux-wireless@vger.kernel.org
X-Virus-Scanned: ClamAV using ClamSMTP
brcmf_usb_free_q is no longer called with pending=true thus this boolean
parameter is no longer needed.
Signed-off-by: Piotr Figiel
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
index a775409..5ab397d 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
@@ -445,9 +445,10 @@ brcmf_usbdev_qinit(struct list_head *q, int qsize)
}
-static void brcmf_usb_free_q(struct list_head *q, bool pending)
+static void brcmf_usb_free_q(struct list_head *q)
{
struct brcmf_usbreq *req, *next;
+
int i = 0;
list_for_each_entry_safe(req, next, q, list) {
if (!req->urb) {
@@ -455,12 +456,8 @@ static void brcmf_usb_free_q(struct list_head *q, bool pending)
break;
}
i++;
- if (pending) {
- usb_kill_urb(req->urb);
- } else {
- usb_free_urb(req->urb);
- list_del_init(&req->list);
- }
+ usb_free_urb(req->urb);
+ list_del_init(&req->list);
}
}
@@ -1029,8 +1026,8 @@ static void brcmf_usb_detach(struct brcmf_usbdev_info *devinfo)
brcmf_dbg(USB, "Enter, devinfo %p\n", devinfo);
/* free the URBS */
- brcmf_usb_free_q(&devinfo->rx_freeq, false);
- brcmf_usb_free_q(&devinfo->tx_freeq, false);
+ brcmf_usb_free_q(&devinfo->rx_freeq);
+ brcmf_usb_free_q(&devinfo->tx_freeq);
usb_free_urb(devinfo->ctl_urb);
usb_free_urb(devinfo->bulk_urb);
From patchwork Fri Mar 8 15:25:09 2019
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Piotr Figiel
X-Patchwork-Id: 10845053
X-Patchwork-Delegate: kvalo@adurom.com
Return-Path:
Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org
[172.30.200.125])
by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6FF641669
for ;
Fri, 8 Mar 2019 15:25:48 +0000 (UTC)
Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 595C92521E
for ;
Fri, 8 Mar 2019 15:25:48 +0000 (UTC)
Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
id 4CB242E115; Fri, 8 Mar 2019 15:25:48 +0000 (UTC)
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
pdx-wl-mail.web.codeaurora.org
X-Spam-Level:
X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED,
DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1
Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB5452521E
for ;
Fri, 8 Mar 2019 15:25:47 +0000 (UTC)
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
id S1726412AbfCHPZr (ORCPT
);
Fri, 8 Mar 2019 10:25:47 -0500
Received: from mail-eopbgr100054.outbound.protection.outlook.com
([40.107.10.54]:14944
"EHLO GBR01-LO2-obe.outbound.protection.outlook.com"
rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP
id S1726279AbfCHPZq (ORCPT );
Fri, 8 Mar 2019 10:25:46 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=camlinlimited.onmicrosoft.com; s=selector1-camlintechnologies-com;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=iSog5YJ+q6BjwGhcnwT9lbkTmoNuFHhHL8RnzcTNavw=;
b=SP1k+OdnN9MKcYRr/8AoEigTJck2RhESnY491FAE81bPpwFtQC6vMmAN8/D5W5p4YmlhEkLKH5NDDEX8sqeUEExLZ8SDhQVqjidN/gbexgqnrPxKBumbB61plUqapXjxCJcCv2IwzbdBVMbp1ywGCrrw8ASb51id3+tUqb+Mxqc=
Received: from LNXP123MB2185.GBRP123.PROD.OUTLOOK.COM (20.179.129.83) by
LNXP123MB2106.GBRP123.PROD.OUTLOOK.COM (20.179.129.11) with Microsoft SMTP
Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
15.20.1686.18; Fri, 8 Mar 2019 15:25:09 +0000
Received: from LNXP123MB2185.GBRP123.PROD.OUTLOOK.COM
([fe80::396a:e27e:d5dd:6bf0]) by LNXP123MB2185.GBRP123.PROD.OUTLOOK.COM
([fe80::396a:e27e:d5dd:6bf0%5]) with mapi id 15.20.1686.018; Fri, 8 Mar 2019
15:25:09 +0000
From: Piotr Figiel
To: "linux-wireless@vger.kernel.org" ,
"arend.vanspriel@broadcom.com" ,
"kvalo@codeaurora.org"
CC: "franky.lin@broadcom.com" ,
"hante.meuleman@broadcom.com" ,
"chi-hsien.lin@cypress.com" ,
"wright.feng@cypress.com" ,
"brcm80211-dev-list@cypress.com" ,
Pawel Lenkow ,
Lech Perczak , =?iso-8859-2?q?Krzysztof_D?=
=?iso-8859-2?q?robi=F1ski?= ,
Piotr Figiel
Subject: [PATCH 3/3] brcmfmac: remove unused variable i from brcmf_usb_free_q
Thread-Topic: [PATCH 3/3] brcmfmac: remove unused variable i from
brcmf_usb_free_q
Thread-Index: AQHU1cMd5vOYZC5mAU2ccGUUUcGOeg==
Date: Fri, 8 Mar 2019 15:25:09 +0000
Message-ID:
<1552058658-23250-4-git-send-email-p.figiel@camlintechnologies.com>
References:
<1552058658-23250-1-git-send-email-p.figiel@camlintechnologies.com>
In-Reply-To:
<1552058658-23250-1-git-send-email-p.figiel@camlintechnologies.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [95.143.242.242]
x-clientproxiedby: DB6PR07CA0010.eurprd07.prod.outlook.com
(2603:10a6:6:2d::20) To LNXP123MB2185.GBRP123.PROD.OUTLOOK.COM
(2603:10a6:600:dc::19)
authentication-results: spf=none (sender IP is )
smtp.mailfrom=p.figiel@camlintechnologies.com;
x-ms-exchange-messagesentrepresentingtype: 1
x-mailer: git-send-email 2.7.4
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 7882a4d4-5f90-4408-6a9e-08d6a3da402f
x-microsoft-antispam:
BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(2017052603328)(7153060)(7193020);SRVR:LNXP123MB2106;
x-ms-traffictypediagnostic: LNXP123MB2106:
x-microsoft-exchange-diagnostics: =?iso-8859-2?q?1=3BLNXP123MB2106=3B23=3Aax?=
=?iso-8859-2?q?FqT5Cq98r8h8zWMg9dIXizT4oG1d4UH/ny+XxnkZL3gtvys6MhV/X9hVmEqE?=
=?iso-8859-2?q?cAAiWymCWR/B6+RuUOLAbZRF+QPihcFtFLGY4zznV/IrRzbrbNVVIYhflRdt?=
=?iso-8859-2?q?z0pnKqXHNP4/hnnBOGgsK3StRPqtctBFqz/+N7X2srvgef69CrHn/tH8K3K2?=
=?iso-8859-2?q?HWDATWFd/BD/5xTTQEpxf1gu7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WRceSOrIjEmjx4?=
=?iso-8859-2?q?3ZSd4hYCysj5moBDg10kGUIa91lgtqA94LhK6gLzB5HO3veu0mHLpXnG6NCd?=
=?iso-8859-2?q?Pou7jk0qqceJEIJu5DYDeOXdsL5Aop+nv43002P/bYMf+f5RXbxQKquAfyWG?=
=?iso-8859-2?q?lw3T1Lw28ZtyHCtNCBlMNgf4NfrN9JAJSXUM1qFMmJVEWbxYNOehG8e1lr8a?=
=?iso-8859-2?q?uPUYU0or0WIkzJ1fWY?=
x-microsoft-antispam-prvs:
x-forefront-prvs: 0970508454
x-forefront-antispam-report:
SFV:NSPM;SFS:(10009020)(376002)(136003)(346002)(396003)(366004)(39850400004)(189003)(199004)(8676002)(305945005)(97736004)(105586002)(486006)(99286004)(81166006)(3846002)(14454004)(81156014)(6116002)(476003)(106356001)(102836004)(6506007)(66066001)(186003)(6512007)(36756003)(26005)(110136005)(54906003)(6486002)(5660300002)(52116002)(4744005)(446003)(2616005)(11346002)(386003)(2906002)(53936002)(107886003)(76176011)(71190400001)(71200400001)(86362001)(2201001)(50226002)(6436002)(316002)(4326008)(68736007)(256004)(25786009)(7736002)(2501003)(8936002)(478600001);DIR:OUT;SFP:1101;SCL:1;SRVR:LNXP123MB2106;H:LNXP123MB2185.GBRP123.PROD.OUTLOOK.COM;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1;
received-spf: None (protection.outlook.com: camlintechnologies.com does not
designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam-message-info:
fBFhNPbfK2TUz+HT1/eKyTjOHtuJrH2d0PSFja2aBfPZtS45mW5+mjFKBjA0N8AnXIa/O3OQyprqZIQDeffuIzoqKA4yA6MBkjGBY/j+n+8+7WuCeNHL9OBUEW/l/cQEUA2cuCR9tbLwEO/SvfOsBjTMuXNWmpyU6nUZc4qow5TPBwiwD+c7Mj5P9fOIJEH+pOdaN78wwX3m35udeyyENQfxsHPU1S48oibhn8wuBDOzBqxiXXqkOAZ59aTVypgrLYdhMo7lAZgG/Kq87SCjEwmHOjCV2H5RDjAYZxdAe/AfJzgFHAPGvdp8rK5AR0M/R5lXPA9QDvxB33QeC4KMwrClrag2Cwv6iboRbW+sQsPAZXmE0TB9bOi+PzTRrrK5Nrh0kiEKWbNbKtL1cyNS0mEsmA6OFf9KUnjKUL9x5Fs=
MIME-Version: 1.0
X-OriginatorOrg: camlintechnologies.com
X-MS-Exchange-CrossTenant-Network-Message-Id:
7882a4d4-5f90-4408-6a9e-08d6a3da402f
X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Mar 2019 15:25:09.8013
(UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: fd4b1729-b18d-46d2-9ba0-2717b852b252
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LNXP123MB2106
Sender: linux-wireless-owner@vger.kernel.org
Precedence: bulk
List-ID:
X-Mailing-List: linux-wireless@vger.kernel.org
X-Virus-Scanned: ClamAV using ClamSMTP
Variable i is not used so remove it.
Signed-off-by: Piotr Figiel
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
index 5ab397d..c00b9fd 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
@@ -449,13 +449,11 @@ static void brcmf_usb_free_q(struct list_head *q)
{
struct brcmf_usbreq *req, *next;
- int i = 0;
list_for_each_entry_safe(req, next, q, list) {
if (!req->urb) {
brcmf_err("bad req\n");
break;
}
- i++;
usb_free_urb(req->urb);
list_del_init(&req->list);
}