From patchwork Fri Aug 9 18:25:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adham Abozaeid X-Patchwork-Id: 11087467 X-Patchwork-Delegate: johannes@sipsolutions.net 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 9A63D14D5 for ; Fri, 9 Aug 2019 18:25:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 897AE201F3 for ; Fri, 9 Aug 2019 18:25:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D8E420246; Fri, 9 Aug 2019 18:25:31 +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 D7F89201F3 for ; Fri, 9 Aug 2019 18:25:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406127AbfHISZa (ORCPT ); Fri, 9 Aug 2019 14:25:30 -0400 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:32511 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726377AbfHISZ3 (ORCPT ); Fri, 9 Aug 2019 14:25:29 -0400 Received-SPF: Pass (esa4.microchip.iphmx.com: domain of Adham.Abozaeid@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Adham.Abozaeid@microchip.com"; x-sender="Adham.Abozaeid@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com a:mx1.microchip.iphmx.com a:mx2.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa4.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Adham.Abozaeid@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa4.microchip.iphmx.com; spf=Pass smtp.mailfrom=Adham.Abozaeid@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: YLSeIwpPtC3aylDhvqWiivptpX529iYzseb0UOWHHL+A0lyPvBOU4JiFp/AVVDKEiSzSFV6Y9/ Utn276ZR5/fXjQCwb6fWkxA01VEp0/y65y0j6o/CItnSuJQblsF6oNClhjqj7GekQrS5eB5seC RoHbqgKwA1Bu6agiYOr588zV1NgAUe20K1Z/QX+YhH8r5qeDk98vffi+K/+ElH89LNQLJM89rA 3kf8ShiHEqZl8m45g+e9btf/F97D+riF7U4KPow32g9RsRSkL5B+wGrGNEB8B+6sCJfxz28anw SgE= X-IronPort-AV: E=Sophos;i="5.64,366,1559545200"; d="scan'208";a="43782626" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 09 Aug 2019 11:25:23 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 9 Aug 2019 11:25:21 -0700 Received: from NAM01-SN1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 9 Aug 2019 11:25:21 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cJLmzcGIgunfrVgQpdYkk3SBgR1lz7hjnyVgd/WPhCxjdCr4NYF008xiyJ/KtaVgNkU886S4DpUUC1cJ75CC+0M9wdvY6bmsmLn6yUD71xOO10S1TSy75jUQl1KZGCi8yOC4GvPE9P6bqlaIsypObmOHxYuoElS+79LnJ29U/jHBNAwCnfNqfrJRBGj0ExM7P58RvXihhmNkBukVFcS8BVyFrL63sy/2BQIMD440N4l7JSO7iAFPj31Gsg3bsWVha7TNXVzQJtde5LzrkZJzD/vmpp41VUgqoL2T7ZiRYpSc5TvIS9HQiFApUkhhVbrQ3ThnuE9yt9hBFyG8ryrQhg== 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=c0CMDwSPJGXQdTy7k+l3/4GrUS6umQJYvASxOlX27QM=; b=HG8XNqz74JTjH3PgEHoZxtmWx9UbpF7eaMWF9nTswuNrQS8qXTg42pk95Ozb8A7nW7yycTGwUkre5AMLHKrFUIPyZtT7aXptgGg8isDpO4WcoI8CSvJ4AyemrApL/ZqzniNe6tZiS7iDPa2JTqrjs6lk7JckMk0g6OIpiuJGy+7iUekhAXliM/gQGxfbIBiAmUWFzXqfa3FUKO/emOD6mbZFPuC51FWrR5iZn3ZNPW4IL0FzjIkRQSzwTSxiOdkij90OMokmvuwErEBzAddaNFEOoQnwnQWtOMqQ6j1jFoZXW/tY/slGc4qfyx8b2sLlr9hphMmXn250uatQGHfQ6A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=c0CMDwSPJGXQdTy7k+l3/4GrUS6umQJYvASxOlX27QM=; b=U71lyPAyg92+2Ac92qO1L1Q84GNezRyjZbvvlbONcXYjzf7Bz/i8qF9Id6Or119tN2u7DTV69URcv4WLdRF6FA++bU8BSbGMnADaT24Mrq/SqTo3fgR/IoGaGy+PJZw2AgHo7DCRfJer4979Z4BdDLGC3AfMgfoy4NnpQGGsYMc= Received: from MWHPR11MB1373.namprd11.prod.outlook.com (10.169.234.141) by MWHPR11MB1950.namprd11.prod.outlook.com (10.175.55.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2157.15; Fri, 9 Aug 2019 18:25:19 +0000 Received: from MWHPR11MB1373.namprd11.prod.outlook.com ([fe80::480d:becc:c567:3336]) by MWHPR11MB1373.namprd11.prod.outlook.com ([fe80::480d:becc:c567:3336%2]) with mapi id 15.20.2157.020; Fri, 9 Aug 2019 18:25:18 +0000 From: To: CC: , , , , Subject: [PATCH v2 1/2] staging: wilc1000: Don't reset WILC CPU disgracefully Thread-Topic: [PATCH v2 1/2] staging: wilc1000: Don't reset WILC CPU disgracefully Thread-Index: AQHVTt/MTyR+QJ6tRkSb4F3LsSrinQ== Date: Fri, 9 Aug 2019 18:25:18 +0000 Message-ID: <20190809182510.22443-2-adham.abozaeid@microchip.com> References: <20190809182510.22443-1-adham.abozaeid@microchip.com> In-Reply-To: <20190809182510.22443-1-adham.abozaeid@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [198.175.253.81] x-clientproxiedby: BYAPR02CA0035.namprd02.prod.outlook.com (2603:10b6:a02:ee::48) To MWHPR11MB1373.namprd11.prod.outlook.com (2603:10b6:300:25::13) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: af80c39a-f610-4608-d5b1-08d71cf6ee70 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020);SRVR:MWHPR11MB1950; x-ms-traffictypediagnostic: MWHPR11MB1950: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5516; x-forefront-prvs: 01244308DF x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(346002)(39860400002)(366004)(396003)(376002)(43544003)(199004)(189003)(5660300002)(6486002)(71200400001)(5640700003)(186003)(6436002)(26005)(66066001)(2351001)(107886003)(6512007)(53936002)(50226002)(1076003)(54906003)(7736002)(2906002)(86362001)(386003)(2501003)(71190400001)(305945005)(8676002)(6506007)(14454004)(11346002)(2616005)(476003)(14444005)(446003)(256004)(99286004)(6116002)(3846002)(486006)(64756008)(76176011)(66556008)(66946007)(52116002)(66446008)(66476007)(81156014)(81166006)(6916009)(8936002)(4326008)(316002)(25786009)(102836004)(36756003)(478600001);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR11MB1950;H:MWHPR11MB1373.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: cpPLHmAlI+mBEpOQ9cvGBs5E7t+Nu677pE6zbN7NZbfW6FLXbBmUGj4bbsxEQt3+/Q87b79DV+EYCYcjYKF1jBhJXMCwjkCYT/zIuqFT9eORVngL32Wq4CAu3p5TNYgSRIuGvVoawv+K3nTzXHVVhQAR+feV81/AoSa+a0++cft/FWlznx3vW/ziS+8JN65a2iyksFAVCy9YVS5YoioRSUkerr+vP6zh8q+bls7bi3GPI8qWPESa+6gm2J+rlc9pxMcgBl5CxWj+HDplhAYuH6fS4/rKcz78DaHS09QMV4isvAkiW2xCUj4et25tvPSKPckfVy8WShtE/tbzaelzWKoXxi+mdIkksUVquPhpXs19PNbRUhIQhxLMmk0tt1CaCgzH9nyxGdk71eZQXEz54A9F7qFmfdKiQItzsHh83uI= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: af80c39a-f610-4608-d5b1-08d71cf6ee70 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Aug 2019 18:25:18.7467 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: da0js8ZRfnUtvsViaFtGz0LcmeQXipPSA/rdu8tF69XjWoAbCG1n7qGes+uH2Vmc91JOn7gEgJzKgRlsW1irMTZNQWF4vq7dTwZ9MqjH6V8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1950 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 From: Adham Abozaeid Send abort request to WILC from wilc_wlan_stop instead of resetting the CPU. The abort request was being sent from wilc_wlan_cleanup after the CPU was reset which wasn't the correct order. The abort request handler in the chip will take care of resetting the CPU. Signed-off-by: Adham Abozaeid --- drivers/staging/wilc1000/wilc_netdev.c | 4 +- drivers/staging/wilc1000/wilc_wlan.c | 75 +++++++------------------- drivers/staging/wilc1000/wilc_wlan.h | 5 +- 3 files changed, 24 insertions(+), 60 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_netdev.c b/drivers/staging/wilc1000/wilc_netdev.c index 57510400f243..cd11c35adcfe 100644 --- a/drivers/staging/wilc1000/wilc_netdev.c +++ b/drivers/staging/wilc1000/wilc_netdev.c @@ -475,7 +475,7 @@ static void wilc_wlan_deinitialize(struct net_device *dev) wlan_deinitialize_threads(dev); deinit_irq(dev); - wilc_wlan_stop(wl); + wilc_wlan_stop(wl, vif); wilc_wlan_cleanup(dev); wlan_deinit_locks(dev); @@ -573,7 +573,7 @@ static int wilc_wlan_initialize(struct net_device *dev, struct wilc_vif *vif) return 0; fail_fw_start: - wilc_wlan_stop(wl); + wilc_wlan_stop(wl, vif); fail_irq_enable: if (!wl->dev_irq_num && diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index d4ca6467485c..3d902b499a34 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -968,60 +968,42 @@ int wilc_wlan_start(struct wilc *wilc) return (ret < 0) ? ret : 0; } -int wilc_wlan_stop(struct wilc *wilc) +int wilc_wlan_stop(struct wilc *wilc, struct wilc_vif *vif) { u32 reg = 0; int ret; - u8 timeout = 10; acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); - ret = wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, ®); + ret = wilc->hif_func->hif_read_reg(wilc, WILC_GP_REG_0, ®); if (!ret) { + netdev_err(vif->ndev, "Error while reading reg\n"); release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); return ret; } - reg &= ~BIT(10); - ret = wilc->hif_func->hif_write_reg(wilc, WILC_GLB_RESET_0, reg); + ret = wilc->hif_func->hif_write_reg(wilc, WILC_GP_REG_0, + (reg | WILC_ABORT_REQ_BIT)); if (!ret) { + netdev_err(vif->ndev, "Error while writing reg\n"); release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); return ret; } - do { - ret = wilc->hif_func->hif_read_reg(wilc, - WILC_GLB_RESET_0, ®); - if (!ret) { - release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); - return ret; - } - - if ((reg & BIT(10))) { - reg &= ~BIT(10); - ret = wilc->hif_func->hif_write_reg(wilc, - WILC_GLB_RESET_0, - reg); - timeout--; - } else { - ret = wilc->hif_func->hif_read_reg(wilc, - WILC_GLB_RESET_0, - ®); - if (!ret) { - release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); - return ret; - } - break; - } - - } while (timeout); - reg = (BIT(0) | BIT(1) | BIT(2) | BIT(3) | BIT(8) | BIT(9) | BIT(26) | - BIT(29) | BIT(30) | BIT(31)); - - wilc->hif_func->hif_write_reg(wilc, WILC_GLB_RESET_0, reg); - reg = (u32)~BIT(10); + ret = wilc->hif_func->hif_read_reg(wilc, WILC_FW_HOST_COMM, ®); + if (!ret) { + netdev_err(vif->ndev, "Error while reading reg\n"); + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); + return ret; + } + reg = BIT(0); - ret = wilc->hif_func->hif_write_reg(wilc, WILC_GLB_RESET_0, reg); + ret = wilc->hif_func->hif_write_reg(wilc, WILC_FW_HOST_COMM, reg); + if (!ret) { + netdev_err(vif->ndev, "Error while writing reg\n"); + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); + return ret; + } release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); @@ -1032,8 +1014,6 @@ void wilc_wlan_cleanup(struct net_device *dev) { struct txq_entry_t *tqe; struct rxq_entry_t *rqe; - u32 reg = 0; - int ret; struct wilc_vif *vif = netdev_priv(dev); struct wilc *wilc = vif->wilc; @@ -1058,23 +1038,6 @@ void wilc_wlan_cleanup(struct net_device *dev) wilc->rx_buffer = NULL; kfree(wilc->tx_buffer); wilc->tx_buffer = NULL; - - acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); - - ret = wilc->hif_func->hif_read_reg(wilc, WILC_GP_REG_0, ®); - if (!ret) { - release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); - return; - } - - ret = wilc->hif_func->hif_write_reg(wilc, WILC_GP_REG_0, - (reg | ABORT_INT)); - if (!ret) { - release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); - return; - } - - release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); wilc->hif_func->hif_deinit(NULL); } diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h index 802f11807659..f566d040bb72 100644 --- a/drivers/staging/wilc1000/wilc_wlan.h +++ b/drivers/staging/wilc1000/wilc_wlan.h @@ -98,6 +98,7 @@ #define WILC_VMM_TBL_RX_SHADOW_BASE WILC_AHB_SHARE_MEM_BASE #define WILC_VMM_TBL_RX_SHADOW_SIZE 256 +#define WILC_FW_HOST_COMM 0x13c0 #define WILC_GP_REG_0 0x149c #define WILC_GP_REG_1 0x14a0 @@ -129,7 +130,7 @@ #define WILC_PLL_TO_SDIO 4 #define WILC_PLL_TO_SPI 2 -#define ABORT_INT BIT(31) +#define WILC_ABORT_REQ_BIT BIT(31) #define WILC_RX_BUFF_SIZE (96 * 1024) #define WILC_TX_BUFF_SIZE (64 * 1024) @@ -280,7 +281,7 @@ struct wilc_vif; int wilc_wlan_firmware_download(struct wilc *wilc, const u8 *buffer, u32 buffer_size); int wilc_wlan_start(struct wilc *wilc); -int wilc_wlan_stop(struct wilc *wilc); +int wilc_wlan_stop(struct wilc *wilc, struct wilc_vif *vif); int wilc_wlan_txq_add_net_pkt(struct net_device *dev, void *priv, u8 *buffer, u32 buffer_size, void (*tx_complete_fn)(void *, int)); From patchwork Fri Aug 9 18:25:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adham Abozaeid X-Patchwork-Id: 11087469 X-Patchwork-Delegate: johannes@sipsolutions.net 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 278B61395 for ; Fri, 9 Aug 2019 18:25:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16BC7201F3 for ; Fri, 9 Aug 2019 18:25:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B23520246; Fri, 9 Aug 2019 18:25:33 +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 9AF2F201F3 for ; Fri, 9 Aug 2019 18:25:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406439AbfHISZb (ORCPT ); Fri, 9 Aug 2019 14:25:31 -0400 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:32511 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726440AbfHISZa (ORCPT ); Fri, 9 Aug 2019 14:25:30 -0400 Received-SPF: Pass (esa4.microchip.iphmx.com: domain of Adham.Abozaeid@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Adham.Abozaeid@microchip.com"; x-sender="Adham.Abozaeid@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com a:mx1.microchip.iphmx.com a:mx2.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa4.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Adham.Abozaeid@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa4.microchip.iphmx.com; spf=Pass smtp.mailfrom=Adham.Abozaeid@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: RvXlqprSjXUvT05ajsqTgBszIr8GBv5dlkGzFr1Ze++KqAE2CJOM7kxrG4t0WxgiUc4m6uwRYp l2vsur7MQXyLTWYj4fpuT+Kyf3HS/CD1hpe74cmT4+96OXl2XbtVOWk/y5mfzxUt9RqY586n/n vJfEK/rPrQLTrRfFVQI4ELNI1ui7FuU8HH/g+rPl5XhK5LykzUIUlijQGQLip/W2c9WFL431Ws CBM0oycSDf8pOLFBZStDyM0Tk66cufkuvBXxHr9hS/vGmwAwmW9TSA/oC2KwnP4c6ygxyAwjje ghI= X-IronPort-AV: E=Sophos;i="5.64,366,1559545200"; d="scan'208";a="43782627" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 09 Aug 2019 11:25:23 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 9 Aug 2019 11:25:23 -0700 Received: from NAM01-SN1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 9 Aug 2019 11:25:21 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jrFYWzBBSDvutPlvxdEuq0RDZ55ol7MtApNAE/NCObYS74S+OGtFEnVpgA71AgSeYnyIbrTw6J5xedv6eUDIuwWsxIZQFH8IsBEkSq3gqdg+PKzR4wl67kcdKmMuACR1rTGXYww5XxAaqoR0XWb9WQG3uovUwFrs8x+d8CW1hIl982dzva96erWKRSprtdcSDpVldB/wEn8fPUb/CYfb+uaYHQZ7dWHQTksx7JP8T9Uz4joF48imhe8oDabXP08P3+uAgjIymERc1eycaA6GsGUo4N2bKAmHXk8HN7sgTTg8TWTLOV0hSnn3Qxc4cxzlS9qASl1+Qb30jhAtS5m3Jw== 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=0iIcI27aQJwo4OugbGOiKqRRehRbwf1u9SlVkhpc5n0=; b=YQox08C5lnu2ZUPkX1OfUoRwKthMdAKJdNJK0gftecRXX8unvMgbrM5bp2hShDfakULKLwqYkiPWqy+ecEB6I5MtSMpQurhOcX15jKpIikcbIKVAb8WbtWzaIQXzNv7NKsXMitjx87/0AGbfQqQLqzj83DHLmOKb6ji/3DJmHuPXF4ivetZmHmwgfwGqDJ9pNydQrlFiULqEpoBvu7GPFmNd7+J4Sg9U8Wfj9CJjcwOUJ87m3ZtWMgMdwtnxqftboC0q68YjCvf1QmRt70TtKbuZTmiATliH0HedDspa92AhiD1xV4XI4SFp+HS+dct/R4AInG513bSGf0uv3K0ohA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0iIcI27aQJwo4OugbGOiKqRRehRbwf1u9SlVkhpc5n0=; b=ktE9Uf/y4UwLEBxxwS80610PqFg545ytpoavgkzVwAa+Zac9peTTv0QZ9nUUiSv8fk2HvVj233jX2QK44B8LEwru67tIEbS6wkBZbiHZuH2r9V+UK1OTaKeKEkK+JPDDzHaLHPAgwgDfeLzCoWO6QBbSwH5MmKoSaeNTAH6RV6g= Received: from MWHPR11MB1373.namprd11.prod.outlook.com (10.169.234.141) by MWHPR11MB1950.namprd11.prod.outlook.com (10.175.55.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2157.15; Fri, 9 Aug 2019 18:25:19 +0000 Received: from MWHPR11MB1373.namprd11.prod.outlook.com ([fe80::480d:becc:c567:3336]) by MWHPR11MB1373.namprd11.prod.outlook.com ([fe80::480d:becc:c567:3336%2]) with mapi id 15.20.2157.020; Fri, 9 Aug 2019 18:25:19 +0000 From: To: CC: , , , , Subject: [PATCH v2 2/2] staging: wilc1000: return kernel error codes from wilc_wlan_stop Thread-Topic: [PATCH v2 2/2] staging: wilc1000: return kernel error codes from wilc_wlan_stop Thread-Index: AQHVTt/Megb7GILlxkecONemIE97uQ== Date: Fri, 9 Aug 2019 18:25:19 +0000 Message-ID: <20190809182510.22443-3-adham.abozaeid@microchip.com> References: <20190809182510.22443-1-adham.abozaeid@microchip.com> In-Reply-To: <20190809182510.22443-1-adham.abozaeid@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [198.175.253.81] x-clientproxiedby: BYAPR02CA0035.namprd02.prod.outlook.com (2603:10b6:a02:ee::48) To MWHPR11MB1373.namprd11.prod.outlook.com (2603:10b6:300:25::13) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f255cc06-c4bd-42ca-67b6-08d71cf6ef03 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020);SRVR:MWHPR11MB1950; x-ms-traffictypediagnostic: MWHPR11MB1950: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:962; x-forefront-prvs: 01244308DF x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(346002)(39860400002)(366004)(396003)(376002)(199004)(189003)(5660300002)(6486002)(71200400001)(5640700003)(186003)(6436002)(26005)(66066001)(2351001)(107886003)(6512007)(53936002)(50226002)(1076003)(54906003)(7736002)(2906002)(86362001)(386003)(2501003)(71190400001)(305945005)(8676002)(6506007)(14454004)(11346002)(2616005)(476003)(446003)(256004)(99286004)(6116002)(3846002)(486006)(64756008)(76176011)(66556008)(66946007)(52116002)(66446008)(66476007)(81156014)(81166006)(6916009)(8936002)(4326008)(316002)(25786009)(102836004)(36756003)(478600001);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR11MB1950;H:MWHPR11MB1373.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 9QCvnwkfRI+ETEb1hgDZ1OKUdl+TLS+1U8CxlRInAx5lg2f3w+bbSPh/Zvc/Hm16vyfl681qXHTZm6+vhvyL+EN+BvuMPPOr/B83sNBhAXZ6pO+Xky7vCIaG9JjqG8CsFQRrA7fIfiAmfih9u7c/3J9uPbIoVOI9wPi/PXcac8oWD9h8JF83+Ms3BolCvtGgTzQtPazDnsQ7J3JbiFJ2aME2TM+/kV0c6ZxKN2LjAJnV8HEYNf6vxKQCk9153OxgoVMsGu+UqH90rbls2XfctOvglcDIIA6hplQJ41h5THW+qZYgGJGgaFVyEDNHBS8vRTqS0jyTZKB7SHkXvuUJQlvv7kM5+ikoiX/UKRwD5sBc8K2ZJLPZm1+SolBzR7StRzhcGebaqkax6cCnowePzYTXDBJCCRBOHTWuMLxD77M= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: f255cc06-c4bd-42ca-67b6-08d71cf6ef03 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Aug 2019 18:25:19.5693 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: l8rGMGJTPN3s9Ng4/FGX8LnhYLh1DO42ZLkl17NGnQ7h8G0m6iqYsUvLKkarmiF8J9ftryJOGsAYudqtxDscLsz2zGT+iZcxA3mp5heI5oo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1950 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 From: Adham Abozaeid return -EIO for bus failures, 0 otherwise. Signed-off-by: Adham Abozaeid --- drivers/staging/wilc1000/wilc_wlan.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 3d902b499a34..2bbb359d2119 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -979,7 +979,7 @@ int wilc_wlan_stop(struct wilc *wilc, struct wilc_vif *vif) if (!ret) { netdev_err(vif->ndev, "Error while reading reg\n"); release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); - return ret; + return -EIO; } ret = wilc->hif_func->hif_write_reg(wilc, WILC_GP_REG_0, @@ -987,14 +987,14 @@ int wilc_wlan_stop(struct wilc *wilc, struct wilc_vif *vif) if (!ret) { netdev_err(vif->ndev, "Error while writing reg\n"); release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); - return ret; + return -EIO; } ret = wilc->hif_func->hif_read_reg(wilc, WILC_FW_HOST_COMM, ®); if (!ret) { netdev_err(vif->ndev, "Error while reading reg\n"); release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); - return ret; + return -EIO; } reg = BIT(0); @@ -1002,12 +1002,12 @@ int wilc_wlan_stop(struct wilc *wilc, struct wilc_vif *vif) if (!ret) { netdev_err(vif->ndev, "Error while writing reg\n"); release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); - return ret; + return -EIO; } release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); - return ret; + return 0; } void wilc_wlan_cleanup(struct net_device *dev)