From patchwork Fri Apr 23 18:29:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 12221397 X-Patchwork-Delegate: kvalo@adurom.com 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,PDS_BAD_THREAD_QP_64,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 C5605C43470 for ; Fri, 23 Apr 2021 18:29:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 974A4613C8 for ; Fri, 23 Apr 2021 18:29:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243645AbhDWSac (ORCPT ); Fri, 23 Apr 2021 14:30:32 -0400 Received: from esa.microchip.iphmx.com ([68.232.153.233]:3592 "EHLO esa.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243716AbhDWSab (ORCPT ); Fri, 23 Apr 2021 14:30:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1619202594; x=1650738594; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=1T+ohFwRXwiWka+DfJ3y7ZQPSHRzkH4LiilKQ8d7cYQ=; b=LPmEhXtjUcu6hbZnCritkTfffNDGLeViB1yCRIDrKDoxY/XcEfTBFgf8 0u5YR8pAQAiWoo1LvmxMHKNib+624vSCanXwzKjsNTTwTTBKKGnZ6gtVe ifJ6XVcFKHzOEO1qHTu13qG+vHgTY1JK7zLPhHfP/WSsGZZENP1UtR7/2 SP+BGu+CsXapOlax6Enp79N1QC+ByxMcdwls6mvXVdagrmGSy8fyrg4st 115Mbgf8N9xYefMPbsnXo9t1z/D8UKxhT8o0IreHp+4hMhvr+PQo2McMt FuFRoSvA4ludUTt1ZiCLMZgRNSJ8TJ8vbeTTigaG7puojjGDgPzrHWpTh w==; IronPort-SDR: NuTfEYYnnOLEXFsC9HUw52WfFXvzUtch9snzCbaWTPyEfOlvDUjFwZIyBoXM6kTjZeT+9Okv1d eMAS/iO8rZnMmfwz3S9kHkYuBFjWIgA1rdzBjA+jJApBrupVCuEagkwPKE3tMnIl3DZ+wBhHvk S+udDVRuO+OprxVNV48W3I45J669KBBbYbMnzzM/6oNTXDOeEn9pKm2eE0UtMyfOI9JdHGbbSd 3AdO3Lvhr/PzK3Js6MWB9SbZYiNJhBbm5FFm/wykdKAa7oScd2SAlvdv/p1UGiVMvlD/1KEs5w l1U= X-IronPort-AV: E=Sophos;i="5.82,246,1613458800"; d="scan'208";a="118174648" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 23 Apr 2021 11:29:54 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) 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.2176.2; Fri, 23 Apr 2021 11:29:43 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2 via Frontend Transport; Fri, 23 Apr 2021 11:29:43 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OU6iJTwb7ebsdsCyZuzucnX9WAeG0PP2guUBMH1HKwrSP0wtg5paHd8qhPbXxUW84y3EzUEudj3VdMNDf+xOJfimawOo5Wb8gm0BYqhcA6CjjgoyZaIPmk8GNo1icGM+yxKlXXcAroP258exMlmU2sMN/oqPDJJ0LYtyq2VQzfRGfhBnoFsAx1F0Oz6kt4JQn7miIygGf+2GbNKU7Rit8lv0fW+EK1ehYE6pMa36udCa10017/F+OxkX9SmpiYUZTDDjW6ScztFhgracbG1C/EyGPo+0TDxTEUZqHH4vo/AjwPWf8Z8EhuAiWw3Bp8Z+/Xu5b6oTeXsIgiXFlWmDmQ== 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=YHxkZFOj+KmlpvelcXauV31zBQOsuG0P/N3fxHDKeCw=; b=WFp+OzJGp8sd0PhnEvtLYyJ+SILTwn260k6xr6hHmjfyDB0gKub6jzI8D5gbljC1bA2mYhiNPfe70LHiDGY5xfruitQlO9RnR/myTpo1EQIPHiNoa+UlX0tnu2JiQgxDltoOH14NVoLXsuB01LsV6o/Qd1CAZQSzHjih40VOBfKiAM9Gz7JYFTmvNpL2noYkiQamOXqkma35QhholK7vLEeUYqqcnhTyVG1suoIU4PDDHk3HreaIfhOje1u5lKyJ/Bh6QfxzpI07C2i2LecFIbUoRXXOrNsLbhZQn28/0fk4/fEHDibiIbX9T7OFEuJkD7UTxHD7BVPFINrWC5/5iA== 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=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YHxkZFOj+KmlpvelcXauV31zBQOsuG0P/N3fxHDKeCw=; b=p27n8ZVgPx8vGADdmY2Y0CWWvxmUcZO8AD7aB7Wu6ljaElGsPMs1nmeuTxLd947sAKS7Bw1WCfrFWdjZLRYloCc0QUvFtYDG/YasFSKBHlV5kkasfvUOtTzp2gv8OlfuIm9i3YHmsprEXlM9uqFDXbyq7JPF8zY5oWpRinT6JWA= Received: from SJ0PR11MB4943.namprd11.prod.outlook.com (2603:10b6:a03:2ad::17) by BYAPR11MB3493.namprd11.prod.outlook.com (2603:10b6:a03:81::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.22; Fri, 23 Apr 2021 18:29:41 +0000 Received: from SJ0PR11MB4943.namprd11.prod.outlook.com ([fe80::5da7:92e6:d6c9:64b3]) by SJ0PR11MB4943.namprd11.prod.outlook.com ([fe80::5da7:92e6:d6c9:64b3%7]) with mapi id 15.20.4065.024; Fri, 23 Apr 2021 18:29:41 +0000 From: To: CC: , Subject: [PATCH 01/12] wilc1000: move 'deinit_lock' lock init/destory inside module probe Thread-Topic: [PATCH 01/12] wilc1000: move 'deinit_lock' lock init/destory inside module probe Thread-Index: AQHXOG6fh5Se5HWONEeyioxi64smcA== Date: Fri, 23 Apr 2021 18:29:41 +0000 Message-ID: <20210423182925.5865-2-ajay.kathat@microchip.com> References: <20210423182925.5865-1-ajay.kathat@microchip.com> In-Reply-To: <20210423182925.5865-1-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 authentication-results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=microchip.com; x-originating-ip: [106.51.107.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bb86589c-d1ed-427f-3915-08d90685c277 x-ms-traffictypediagnostic: BYAPR11MB3493: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:923; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: mRHsMZMqwXFny1iQjj2Lf1bqa63X0rZrFNHSR17uF12n9uJ9iErviXbh5Hg59DDQYqTIwf1BEDIh0N73JZM1GlpOMYK590Qhwy6i0q6J7BKwMkwGhKZCPBoGK8y20c/b7jiJJdXsrNp7xvLJARedU0WJ0S7FMvAbWBxQzzhHud7gM6OXA4DybUNJrbP5EbJ4TWt4YnSLFxope5/cZLry+lEo/Fm0t4A6Qsc9+i2RtfW4gno6htCt1cH3y53H/ISL8Og7otz6PtTJl/4OQhdwWI9iNNOgdYFJUwA0Qxv+nQEGtnfxmg9jrwaxoAXIaFcogZIbDUOWwI6Soz1+u+TIYGt86piGLsqxV49en8HWAb2A+qouxIDTKRV+toAMb5TmmZNKG7nZdy9TmpoDytBuqBeyGbXGuw9t6nm2nEOpfm3oZzMByJwcqxaqwcvRFfVEq4lQjt1m7zhKlfLfuxPk0GCuo9y39ijsFqLPz3jk2STpqO0b71TWO+0/kObmpR714xauphLPKQoS4DAXSBbLBS6+DKQX0Tf2N+oYgS3o0Bgi2ioRlqLY1XrpU53VJDxlNsl0W4I8J9sictgGXViatNw/WrHXvpky/FRtrSdi4JQ= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR11MB4943.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(39860400002)(136003)(366004)(346002)(376002)(86362001)(83380400001)(8936002)(66946007)(6486002)(122000001)(66476007)(6512007)(8676002)(2906002)(54906003)(5660300002)(4326008)(38100700002)(6916009)(107886003)(2616005)(71200400001)(186003)(478600001)(316002)(36756003)(76116006)(64756008)(1076003)(66446008)(26005)(6506007)(91956017)(55236004)(66556008);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?iso-8859-1?q?m+rLkd6eEtmpXciQ0ubbEX8E3?= =?iso-8859-1?q?n5mnZSU3l1DRYAQ1QUoGNntDcT7nnX4aCquvnRxtoLXPIvix8JPaezAfC+bN?= =?iso-8859-1?q?uoSTraBowbZn+cubo42+mWAM+tJSyfdfFQWJc4CCQ7xjH2tfCJ5u1e84B43c?= =?iso-8859-1?q?N9D+mJBQ3hFwgqFZZDVvcxrbwq/9JrtZ4LG16pLJN9y+uova9iDsztaH1N8k?= =?iso-8859-1?q?1mSV5TAJ2RaoJJ4WrO/eI0nSCM1/ByUMEcU97B3QZGloV4cV1moEjr5neeDj?= =?iso-8859-1?q?DMGW8/olhUouxS+2Sa47gSr2rHoUuPqqx0FpGlXEWGm5FJzMK1Pu9Hb0TTHZ?= =?iso-8859-1?q?eLLebpvwXUA/vs2APnBu1Dh7mSQGcaHOmC4jDv2iG4iqH02ILU24xs6s9NNw?= =?iso-8859-1?q?BP/GhAUM6k9wKA8bjWQNE41D+/mJEWJJmP1WnFi7p3kErOwckfPqjgYr/aQM?= =?iso-8859-1?q?mlIn18mgCqKzzdQx0tYj8ktgF3XbP5WpxbUUzD9g5+/uZ8nosOlzh9UPx/fP?= =?iso-8859-1?q?rUstUaVGzvKKCEDP11YRGgkV21cOZqLfoqgnoYEXEFCmxEnQ11mblOPFC4uB?= =?iso-8859-1?q?3sVrovkfRvwJwdVoBV8M7y1xZ1EEyjApykR6m1Vl0ZnF1MGvnY+x0BumDOBD?= =?iso-8859-1?q?F5Cqx0Gt5bg8VjLfsM9QxZXgUSsuArYs5AqWiMV1nhlohIQP5corsudNh2SO?= =?iso-8859-1?q?jLzG5DmvRkLCJjv+NJhZsOEaxE9Ivr5Tg0s4Fj4LqwIK8kpybjfj4JkSL/0w?= =?iso-8859-1?q?wQ18EZs0v0P6sciIUT+6cTt01PMpwjr+hdU+W07/HTeM58WjEKkyH9X44Vzm?= =?iso-8859-1?q?HqIMvPWPFBzoSURkVJw7WshffhZM4i2Rp5qDFLHqitlc5PmdqwBVaTD4deXc?= =?iso-8859-1?q?sAogxqNfkIuATmOxUEHBq7B7tC3UyNfcDo5YiByUHu0QLCEcpob0earrAUNB?= =?iso-8859-1?q?SZRsXvToYUDDaVMAh1xdW30dReJyLjmVGE2bNHvmLmrkfqWyBi67OrtGfJjR?= =?iso-8859-1?q?g6WLsqPo5V7zp+fWNdKd+yFESOkX41OEzFSfsJyxPuQnwsn+IXo+IWM4fRci?= =?iso-8859-1?q?QYuUs3Him/a4EVGr7fodMm2cJ0ZZXOozHZy2XQls+Ti1y69LsGXAbLJ3mmd8?= =?iso-8859-1?q?u1xIeTqjKTL6E3eXYSWkcZeTbntk7g8gK8ofZd7UK23erewIaADc4HVdkMZb?= =?iso-8859-1?q?q1BSciu0tHbMNwcNEpUVAnatTxsKHZZz3eNoBuG40vOu9LrjuJvvhmtHQK9P?= =?iso-8859-1?q?/p1uPegFpwdv8WjCdRkoG1kDcTJLfn/GEGZY4PKQrY1DttSIxz3Ec/PelwKL?= =?iso-8859-1?q?D96at2xOCRTplQRVfSFi8QgnGQBPyVWf9Czncrbbkys2eDUNxPD++1pNlVds?= =?iso-8859-1?q?+/brw1Imfn4SjjXohb1mQ=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB4943.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bb86589c-d1ed-427f-3915-08d90685c277 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2021 18:29:41.1441 (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: RQ8yNTQVDAh5Eq/KetMvUjbajUwFogaJD1q9CEuDgNibK5MNO6V3TjvvaRS+5TuAkE1cwG6tDPw2112XxEEgCvNqH/AwXjfZVkUCmQBuHpg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3493 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ajay Singh Move initialization & deinitialization of 'deinit_lock' mutex lock inside driver init and deinit respectively alongside other locks initialization. After following changes no need to maintain client count variable(client_count) just to init/destroy the lock. Signed-off-by: Ajay Singh --- drivers/net/wireless/microchip/wilc1000/cfg80211.c | 2 ++ drivers/net/wireless/microchip/wilc1000/hif.c | 7 ------- drivers/net/wireless/microchip/wilc1000/netdev.h | 1 - 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/microchip/wilc1000/cfg80211.c b/drivers/net/wireless/microchip/wilc1000/cfg80211.c index 96973ec7bd9a..530a768547cc 100644 --- a/drivers/net/wireless/microchip/wilc1000/cfg80211.c +++ b/drivers/net/wireless/microchip/wilc1000/cfg80211.c @@ -1683,6 +1683,7 @@ static void wlan_init_locks(struct wilc *wl) mutex_init(&wl->rxq_cs); mutex_init(&wl->cfg_cmd_lock); mutex_init(&wl->vif_mutex); + mutex_init(&wl->deinit_lock); spin_lock_init(&wl->txq_spinlock); mutex_init(&wl->txq_add_to_head_cs); @@ -1701,6 +1702,7 @@ void wlan_deinit_locks(struct wilc *wilc) mutex_destroy(&wilc->cfg_cmd_lock); mutex_destroy(&wilc->txq_add_to_head_cs); mutex_destroy(&wilc->vif_mutex); + mutex_destroy(&wilc->deinit_lock); cleanup_srcu_struct(&wilc->srcu); } diff --git a/drivers/net/wireless/microchip/wilc1000/hif.c b/drivers/net/wireless/microchip/wilc1000/hif.c index a133736a7821..497a49a182ef 100644 --- a/drivers/net/wireless/microchip/wilc1000/hif.c +++ b/drivers/net/wireless/microchip/wilc1000/hif.c @@ -1494,7 +1494,6 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) { struct host_if_drv *hif_drv; struct wilc_vif *vif = netdev_priv(dev); - struct wilc *wilc = vif->wilc; hif_drv = kzalloc(sizeof(*hif_drv), GFP_KERNEL); if (!hif_drv) @@ -1504,9 +1503,6 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) vif->hif_drv = hif_drv; - if (wilc->clients_count == 0) - mutex_init(&wilc->deinit_lock); - timer_setup(&vif->periodic_rssi, get_periodic_rssi, 0); mod_timer(&vif->periodic_rssi, jiffies + msecs_to_jiffies(5000)); @@ -1518,8 +1514,6 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) hif_drv->p2p_timeout = 0; - wilc->clients_count++; - return 0; } @@ -1550,7 +1544,6 @@ int wilc_deinit(struct wilc_vif *vif) kfree(hif_drv); vif->hif_drv = NULL; - vif->wilc->clients_count--; mutex_unlock(&vif->wilc->deinit_lock); return result; } diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.h b/drivers/net/wireless/microchip/wilc1000/netdev.h index 86209b391a3d..a39c62a20f04 100644 --- a/drivers/net/wireless/microchip/wilc1000/netdev.h +++ b/drivers/net/wireless/microchip/wilc1000/netdev.h @@ -264,7 +264,6 @@ struct wilc { struct device *dev; bool suspend_event; - int clients_count; struct workqueue_struct *hif_workqueue; enum chip_ps_states chip_ps_state; struct wilc_cfg cfg; From patchwork Fri Apr 23 18:29:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 12221381 X-Patchwork-Delegate: kvalo@adurom.com 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,PDS_BAD_THREAD_QP_64,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 A6703C433ED for ; Fri, 23 Apr 2021 18:29:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8A20F613C8 for ; Fri, 23 Apr 2021 18:29:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243662AbhDWSaW (ORCPT ); Fri, 23 Apr 2021 14:30:22 -0400 Received: from esa.microchip.iphmx.com ([68.232.154.123]:44321 "EHLO esa.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229549AbhDWSaV (ORCPT ); Fri, 23 Apr 2021 14:30:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1619202585; x=1650738585; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=RmIWU2X9Whmv6D9wjWB1/bvpHtPm1W74MxWZmUTQbzU=; b=E/N78u+AnUt7r805OPeZiBcBXCL7+ECdWvnbNZgbInfCzi1g7CKAkjyl KSIE25xDdahRO9csTNGzcBS6sBReanSlAA9NpERzTfeYPc77jUfobrh/S VD/jb/v8Jh7i73mP2Z1j6ao/kpNMDDSPVijxGHeEywAh7FjIJYaEHG8HJ EM523bpOv/+IlfQvbKXHMfZ9Dmgd0dvXZwa5E8LigbPhblnD0uIFsmFjG p78b4AG6JcyptrXKQGt/kwY5LbPEYf++r4HIyPA0+K95N1hHctmInu5Uz HxFv4bd9F+Rcb3R7HblIjbAp527xIyu/7TtpmGkpvpfxdkvRBw9G3ggz9 A==; IronPort-SDR: aiqDIWRBZgQJ51LRqtDxnBATZlHjCWDdvAqymeVUZt1pbsPUKILPFC/J+qXxsbT2nebg9TAiUj /oBpa51+2YqwAsyiPFg1wsQK1i8ZskM+inIxRAFs52Q4zSKcGN5wfG6ClkD2JUZ4RE/yiFnZg0 nM5LiUH8HHkSyj61v6gJ34eZu3Ggq9q7PEQ/w2I0yoSRKl+SX7GnoWI9/9qzBgW0bjFLRZGPUK g3+rEOjpARRLEMBrHREcc/y8XR6UwuJDFKuw7bklLuVjueUR9kxiqZC+YdcJ62wAlbBNW6BIGY rG8= X-IronPort-AV: E=Sophos;i="5.82,246,1613458800"; d="scan'208";a="111995807" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 23 Apr 2021 11:29:43 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 23 Apr 2021 11:29:43 -0700 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2 via Frontend Transport; Fri, 23 Apr 2021 11:29:43 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F0c7YMYG5od63JzdALz5kMEL2hb6MY3W1UVGhIeHHfWPcI8JaFUqz0In1RaAJPZ4/RkQcWoH6b2yY4+SQLPPra/By1KuKcMRcZX6qr8cvoowhHur5t3WyoKTPvLh/2caQ4pEkwrWj+IscuojrQPih8LaWUYj8trNRXr1xE59ud/zbCc+N9h7JEiYdWZXmFOrrwUr98aglni0aKcAqNCPbuBo1lEafzemkygWlkVZUY7hcsFjqxo3B2SSthPl8M32ICN4a9Imm+T4ZI77YvCTRYEpFk5m4VD1oJGfbFjPm7ra2MmiqFVvFqlEkBneqMSkPfSu7T/ZHLhefGDH6i7NUw== 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=PtydGo0iCW7MIr4I35vBj5An+woqggA49G96qn1Hrt4=; b=MY4NceISp1MghA/iAwPgCGW7ZAXcOkoB7RSktFaoK/yNEYKOpWJF7dUvzY9ZKUGUZ4pOeSzRhpmwZyjwOrWAZhJUzjiFuGZiVKF7STZz28kXd4iW6z6+sg54oy2I/H9MIx/TEZnCccZVV70n7zn2ENqSlyA3MRDIgt4a3vykVEr/WheCnnG3DYKw0yPapGdohIjz8iXgtBgmvBNQ6RWpCDE5XfXkvn7DDTTh2Zi+bwt0SVGgY1uvSmoDCHoBzEpddZ5EI2dpEP1zhtMGQNiq8YJpTx0PVMdvIds3Tshwf0wU1Go/MrLAf0yXWZ0c3JLnORxg58HYrlLZHwqgiKGzOg== 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=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PtydGo0iCW7MIr4I35vBj5An+woqggA49G96qn1Hrt4=; b=tfdccl+LnihvXD7J/u0WtCWH//UKM6HEWvR4u6bCnyyH1dq+NJhGguA7H/zP8KcF6MILR3N0mSvws+NE8NMZx41+Kmy2FvR0AshtJcoFzKx/MHj6RDCVUNIKltlEiXbfNF3+ziD+0M69vCh64V9kdfYveDGZbRXBs4fB0dKzTWA= Received: from SJ0PR11MB4943.namprd11.prod.outlook.com (2603:10b6:a03:2ad::17) by BYAPR11MB3318.namprd11.prod.outlook.com (2603:10b6:a03:7d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Fri, 23 Apr 2021 18:29:42 +0000 Received: from SJ0PR11MB4943.namprd11.prod.outlook.com ([fe80::5da7:92e6:d6c9:64b3]) by SJ0PR11MB4943.namprd11.prod.outlook.com ([fe80::5da7:92e6:d6c9:64b3%7]) with mapi id 15.20.4065.024; Fri, 23 Apr 2021 18:29:41 +0000 From: To: CC: , Subject: [PATCH 02/12] wilc1000: fix possible memory leak in cfg_scan_result() Thread-Topic: [PATCH 02/12] wilc1000: fix possible memory leak in cfg_scan_result() Thread-Index: AQHXOG6gXo9GfYFCakC9oss6XqjFTA== Date: Fri, 23 Apr 2021 18:29:41 +0000 Message-ID: <20210423182925.5865-3-ajay.kathat@microchip.com> References: <20210423182925.5865-1-ajay.kathat@microchip.com> In-Reply-To: <20210423182925.5865-1-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 authentication-results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=microchip.com; x-originating-ip: [106.51.107.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 376e3913-8271-4fa5-ebae-08d90685c2d1 x-ms-traffictypediagnostic: BYAPR11MB3318: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:569; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: +MfPRWrlcii26gR7zZCRlYzZw7xWJBEe3xUD3AjT6PhZms72r9PCHW2WQOmskChM3EsHzYZ8nN4FnVym95Ild/glnB2WWtEZCAQZQmRtwbj2B4w0KTbJCIKL9r+/xGyoNgl6493YgakmxKhqRNacOp6clk0B/LE1cppzBCy+CRPAZwvV9mcwQAam2LR3xFH8/kdZCYHXT5E/vSDC5rQwpbxKWuYaj8QwKtcGnIm6iB9J010xwjNsG0D50s6nN46mJIbrcyggJe21XmJM3mdoJQrUES4sbQ3AZJzd9+sLJYA5uEUqplR7G7b9jYXw2geyr8tHeymTGHSee5Jdarylo6xMeGj8zbqnNhAnQOXOdSTg7A041QVHYQ5fY1VOHfWd5tph2okMIJVqOO+BfZk7wgIlgeZkX2OTo5sBY+zVIqmMkSWhisbsQwgGFND1tX5/GHQ3RQ3Qs24xyvVdPK3hvWOV6tLV8oy86lHkFMv/8M2LzzcMfaZ9gTbW5m3NfCcd+DVF+bAO0Ii0UzchTR1DuD+ciMr0QU/U2euJha+x/3N1S0JwwJw90yIpWf/HaEX6tVz9p6a1Hb0RqNNdapyJ0Xum5mNVFgswr4io7GvlC48= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR11MB4943.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(376002)(136003)(39860400002)(346002)(366004)(8676002)(478600001)(55236004)(5660300002)(54906003)(6506007)(71200400001)(1076003)(4326008)(2616005)(6486002)(86362001)(316002)(107886003)(6916009)(66476007)(66446008)(186003)(66946007)(36756003)(122000001)(26005)(66556008)(91956017)(83380400001)(38100700002)(8936002)(64756008)(76116006)(6512007)(2906002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?iso-8859-1?q?oAApX65zCNNnjH7dX1O+skGh5?= =?iso-8859-1?q?xQ3N0+NX9mG4NWfSnwVEwFOPBGeckK+Aa//Hmi2ErxDuZmB7vCnzT36lP3AR?= =?iso-8859-1?q?v0HqRJ3zd4oOpOEP/UXpNG3B7gCxTouoyYiJhfh09SvCsYSzNfRzoGVl5Ce/?= =?iso-8859-1?q?wC77GH618ys6eldNMivwnDwSLJF64JkbdBm1dKOM37E9JPiL4n45AfV7KGGL?= =?iso-8859-1?q?uuKNAyt0yKutdMueV3m584B+8Ca75X0DPqnC8FUOpbooxnXs2c3JbVKyhPo9?= =?iso-8859-1?q?yFqtbVlnQC7vSB8KmnlWd5Hb5JkUuy5nGBZlKQll7+uA1SQb3GpaxYqc+plI?= =?iso-8859-1?q?D+7cHGRYYP2IbJG9VGoOLigOy+T6IMyUBIOtx7xhOZAHaLoAypsEi+j7CvkC?= =?iso-8859-1?q?VL92I+c73XsI2xNfFrZWPH4L5jnCfLMytMrdC6oIfKm3gMkaBNeeld3w+YA6?= =?iso-8859-1?q?hHTnOw7Uk3dLcPgk11cZ8NiU+dS6PYuMPZScknZs1Bh/VDaKtldzbKvkQsAb?= =?iso-8859-1?q?0+X/pVR4ti/jTS2V+8VGFm9RxBZLL8HhG9dwgXa2kZvpjVk6Ll9rQoKwO37L?= =?iso-8859-1?q?PvaiLv2MlwweS7kuTZy8v4gD/66kz7pGfPFvy7oJgeYLa6xV7JJoXBizF8o4?= =?iso-8859-1?q?Cs9K4pr69qt3th6wXqc4Ncv3gWH6iYgEKFK7xF8nWXAEa/gPrmDquglE6LjL?= =?iso-8859-1?q?FDlsdIjxdI6FBKmhVZf3QUAxJu0AqsXumvLpyar6knYNvzxq/VFUbRzBUNvn?= =?iso-8859-1?q?wwZ00BcASJCBZBKd84G4JVu2E+xO78F4wL3MvwFZvokd3yUYRfBuI3Gx66QE?= =?iso-8859-1?q?r4FQ8tUFZP1yJo8GeS8T3QeDVloRdMbARJuPLo10LvYNLkg4KnYWp4fyEsts?= =?iso-8859-1?q?50u0O4qXKbT+rpk8xf8snlcNRX3l8TpboGDGOFfHEIx6NSjeTsvLF5GTlOg/?= =?iso-8859-1?q?rcKFqV0PgIJau33fFP6g4d9OKnND/msc2v+/gHn9szlk2tY7A0BTDGSqr8oN?= =?iso-8859-1?q?fxJgIhgn40eiHerh/3ktuAQ06LVZmE5XL/GXpYJEMlS10K0LS4ISTuCOkU8q?= =?iso-8859-1?q?Pgp4YPZ+3Wftykjcb9+v1vfJ8/nACpBhSP5hW8E8J8T6UFqzh4+q/W8A8w1b?= =?iso-8859-1?q?Jt4yMkMMQXNtQm0/ge980lKrf8bE+8XX43plkQAXgoTcqpduFY9csuyNGVGV?= =?iso-8859-1?q?toDAwhX8svrYEmPdghp13BDeeFcRJWe27NGNcXVP2v0zJR6QFZe0R6s4iKcq?= =?iso-8859-1?q?VS2xnyOjFXdaqPRZk4GqWfpKO84Sj5Eltqzn5y3WF8g44Jn0HZ6aWdBixQa4?= =?iso-8859-1?q?YCx2pL0K13aGbpr8J1E6uKXWqV0OzbaoPGw5l18hu+Q7hYy6K1N/+glsA0n4?= =?iso-8859-1?q?CTw0V4cQuqhEpo+5K9sXQ=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB4943.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 376e3913-8271-4fa5-ebae-08d90685c2d1 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2021 18:29:41.7475 (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: Bv7/gORLXdwvesBP/6nDtM1y3daom8+K5ZjfBT1s/My6XhcSt64cnnlANITS/cEeyY9z3XZHzCsWAiFU1tUaG7gI1noda/kp6fSd3Mqg54U= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3318 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ajay Singh Free 'cg80211_bss' reference when 'bss' handler is valid. 'if' condition is incorrect because it calls 'cfg80211_put_bss' when bss is NULL(i.e 'if (!bss) is used instead of 'if (bss)') Remove 'if' condition because 'cfg80211_put_bss' API already takes care of NULL check. Fixes: 6cd4fa5ab691 ("staging: wilc1000: make use of cfg80211_inform_bss_frame()") Signed-off-by: Ajay Singh --- drivers/net/wireless/microchip/wilc1000/cfg80211.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wireless/microchip/wilc1000/cfg80211.c b/drivers/net/wireless/microchip/wilc1000/cfg80211.c index 530a768547cc..36b87ed38092 100644 --- a/drivers/net/wireless/microchip/wilc1000/cfg80211.c +++ b/drivers/net/wireless/microchip/wilc1000/cfg80211.c @@ -129,8 +129,7 @@ static void cfg_scan_result(enum scan_event scan_event, info->frame_len, (s32)info->rssi * 100, GFP_KERNEL); - if (!bss) - cfg80211_put_bss(wiphy, bss); + cfg80211_put_bss(wiphy, bss); } else if (scan_event == SCAN_EVENT_DONE) { mutex_lock(&priv->scan_req_lock); From patchwork Fri Apr 23 18:29:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 12221399 X-Patchwork-Delegate: kvalo@adurom.com 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,PDS_BAD_THREAD_QP_64,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 7D4BBC43462 for ; Fri, 23 Apr 2021 18:29:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4AFDA613CB for ; Fri, 23 Apr 2021 18:29:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243716AbhDWSac (ORCPT ); Fri, 23 Apr 2021 14:30:32 -0400 Received: from esa.microchip.iphmx.com ([68.232.153.233]:3594 "EHLO esa.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243723AbhDWSab (ORCPT ); Fri, 23 Apr 2021 14:30:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1619202594; x=1650738594; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=bYhaGcQCRZn/7J7SkQWVCRs6ykftsD2zlNT3xIeznjo=; b=DtjfLHAfy6uAGqkCmyM5iJYqWTmtKdfsrPowj/zxwsw8Fuwac9tAEkMV oGwcmXEnpTF0jBFgqKj3Jdw6oH7KCw1FIx+UiG7b+wiIAAiISZ4wkEZ2t pTg/7i27butsgLeQ467QFMmYZ8AfuZLuFtHJtqUhRdedLeKp9m6zhVmhU iljhCIpfTY/Z66SlUD3lLuhDSDBt+iGKmfMUhYcMmQWSsslB84RIPVmcV Ku2OKtKHuxBTrRbXM0Z4PgtZCfH1GqXYwHDA8CwDYnjYsqctFHaErHN/c Ta3baeOm/L7dssB24eTwro69TVqUTIvuWh2IX+Wa1hs80q9WbAZ5TOsS4 Q==; IronPort-SDR: 4wW0zPpsVS0zOGddzq/DjNfkdPoe+8tgZz5nBHb+ITV6c2siAzOkOqg5W8aqHlBdvfgREjbK9m DAFsisByyqs2zvkmOxcM2dbFPK2mk6EpJKC3gu6w607A9rUvMCPG13LMqKWRrYqwjmCxexc5zg zJO5PdpRh2KM6YBtopTgToY6J5A9lZHV9c9XY57tUgSqClsBc4PY7ATpB6WD61Ed+4VRmfY8Ty 0YcnkZ5U1fcJA0ytn4Bis6s89+jokOnV08Y/ybDbH5Wnb2zWOK0rqgAvlrY2WaS9oFSwgnuoz2 SYQ= X-IronPort-AV: E=Sophos;i="5.82,246,1613458800"; d="scan'208";a="118174649" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 23 Apr 2021 11:29:54 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) 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.2176.2; Fri, 23 Apr 2021 11:29:43 -0700 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2 via Frontend Transport; Fri, 23 Apr 2021 11:29:43 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NOg6CyQJ52FQDoVXzw7fRAj+1w0gsFFXnW3t6PXuID9/RV/rUraRpB2cioh2WB7BwErvznvhKAe2zBQAekraoMapwNGypdVpa9q5M6+mguqudOgmgWe1TIKHmBFbhA9ZTaA2pcpaOWtqmiuqoZz1mJXcOEtHv8zjshX4AvHORbsOlOrvpNqGiG40oXDqme/T6CX8MFP7u7jxchLt/S4nsv8mZs/siOB7mxhWyhOSdbznBS59HyirHRzQKHkdt5V/aXAXQQ/wFoabM4Fb4Q26VaMvP5SNZ5MbgDq9qNw1tfy1+ANZm+Bp4bmMes4IjNjZTmzIkdMx3K+FoA91/zYrpQ== 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=ERsdS5s7ed0q32z2cd5Fw684ylQPbPC9CqA/EawwHFM=; b=JWsVRg9ZDuM+hlU1qrn7lP9jDkWMIDcK69a1d0obSFpKFYorDTlZVC6TKrk/h48PvePCSH+jM8rEXK55EJF3HIYKYqwJFj60RmfY/Tvn38jzu9EeoEAXxMVJrKjAjT8lohMS/ge1S6kD66upRIlMCg0elywzI1luFNEZXtIFjhcAjMCy+DV2/RdhQq2MTzH4DyrYCwzUxAgJQaNTtpKghMpr8tGc5xdg10l1qTVwaGG89o4H3yCg9AFkH37+crUukwkELiE051K+BZ+zZwwrid3biN6yC9Nd6hRSAUGnDAlelLa/mNfuSze31GmBLcGpBjci7gkRqAPCdRZyuW9PcA== 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=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ERsdS5s7ed0q32z2cd5Fw684ylQPbPC9CqA/EawwHFM=; b=XS+mwSJVKvaDgr6Akjyn/4IDwTCUWlJ9C9FHKmyC4yrFVp2vvMJGKDv2qVsNsk3Gsb0AD6xoZ/RTfMRMqmlzKCaYu/vYwXGuB+YGSPhEk7t/LQuOTp91ndUnS3B5G9Hy+BqG63tosEmb9BLaAaExxXAGrK6jUZtN/tsvx+16Ucw= Received: from SJ0PR11MB4943.namprd11.prod.outlook.com (2603:10b6:a03:2ad::17) by BYAPR11MB3318.namprd11.prod.outlook.com (2603:10b6:a03:7d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Fri, 23 Apr 2021 18:29:42 +0000 Received: from SJ0PR11MB4943.namprd11.prod.outlook.com ([fe80::5da7:92e6:d6c9:64b3]) by SJ0PR11MB4943.namprd11.prod.outlook.com ([fe80::5da7:92e6:d6c9:64b3%7]) with mapi id 15.20.4065.024; Fri, 23 Apr 2021 18:29:42 +0000 From: To: CC: , Subject: [PATCH 03/12] wilc1000: added new WID to pass WOW info to firmware Thread-Topic: [PATCH 03/12] wilc1000: added new WID to pass WOW info to firmware Thread-Index: AQHXOG6gPjibZyJzLUi012SKzLZdng== Date: Fri, 23 Apr 2021 18:29:42 +0000 Message-ID: <20210423182925.5865-4-ajay.kathat@microchip.com> References: <20210423182925.5865-1-ajay.kathat@microchip.com> In-Reply-To: <20210423182925.5865-1-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 authentication-results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=microchip.com; x-originating-ip: [106.51.107.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 58bc36ea-300c-41e6-c709-08d90685c35c x-ms-traffictypediagnostic: BYAPR11MB3318: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4714; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: djGta5PfUjEFAK2qJCPHbqOvRxxDdKQZHVrQEG/OgsyRIPuFh3OBTYX+HN6sATzlT7exR2y8P20o7udbY731kMAfxqvTUFk/FpQTfnrfPWsTTpkuhNexWy1ZV7rpj/DHWuRWmhOEwAU4mDsPlz8DBb50IDE+bMZHrDcHvPjoory4+cirp96UP1F70zKq9lqEd1L+fxTGZNTAbhEYY0ycNSMAkYgrnW6yY5p68Rzg181UviANZoLWSbr0Kze6Q6a7GnNiDo3c3Gy0SPywP7pqE/4gXrfRxzBK0+8o7L+YMigy7xkzzx3h4NDa9m6MB4dWCld9WaHf1hQ53gskjVlCDFu8BI0+DszPbdsAmv27MxTOaTqMtl+vpOTMbVN6SnkC75n5BOo5s66hB1XFWY7Kb8VF7mqGBQT71B+a3jXYJyOtWDqvh6pgylMWozEWgEhAdwb5ihfjD/re44i2eDj90UZfMqr0gSsCPkZe37a1/J6GzvGlEMQVhuKU9gnPeWDT63W44d3ZA9/T+9AkYWBIKBp65DHCngHFSdgdLyWaqngefRzx4ZmnmvMOiyXqKf3KufWwWxZsD2DlvwiZN1Hco6Vl98ofe9loscS//Dfc4II= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR11MB4943.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(376002)(136003)(39860400002)(346002)(366004)(8676002)(478600001)(55236004)(5660300002)(54906003)(6506007)(71200400001)(1076003)(4326008)(2616005)(6486002)(86362001)(316002)(107886003)(6916009)(66476007)(66446008)(186003)(66946007)(36756003)(122000001)(26005)(66556008)(91956017)(83380400001)(38100700002)(8936002)(64756008)(76116006)(6512007)(2906002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?iso-8859-1?q?vFEb7kc5xAyhBak/oKNhRMSiN?= =?iso-8859-1?q?q+tS82krpE0R8atuhqG5H6ejD8NxdThSZraHVvRF1gLqq6tQ+7dyURBGyvFC?= =?iso-8859-1?q?l7tlYpKr7leWDOIeSZkWz4kc0OTerFXndV7DsIyU00+Bb3XbCn7WvKIOcWwt?= =?iso-8859-1?q?XWFQtyhE/kmO3vhQkqOcoNYoLW4e/C92gCOYruzOhlEz7RiB1C4F9kG64tTu?= =?iso-8859-1?q?FQc3pQT+E2m4NzwayD8YmTUfKJWReKf0cw2RpTF21iyvGCzuCAG2B9Y2rLo+?= =?iso-8859-1?q?7K3z9SwEG+R44NqfKkYt9INcovUbYw2PnxvGXj9/zWNPLxkNHqcrv4HwhZ4W?= =?iso-8859-1?q?d5iIFC3iJj5p9yOor3uUi1xHI5z+UNLFedtHggHDMwHKrc1uSA6wSMmr7bJ6?= =?iso-8859-1?q?THCGiDeyHD3igdSbO7Aa5s9UPHccc02W6EZhj4Y8f3/gfI3zMZYx3qOYIR3D?= =?iso-8859-1?q?eVvOAe8dZkb3uq4Umcvi5XQCx8xBZetqwjoTKkNSSlTfiZBkl6u1KfFxVJEa?= =?iso-8859-1?q?UX9P1oiK88vddCAqy+Y2kyLbS1ReDZe5IJwo7Q9YXjmbuHbpz94GZOBKEH8k?= =?iso-8859-1?q?occu4o1r1yTW/hxAFQGS64y3a55/VmdPkZMLoUZDcbJUMG9vvHhI+PNBZVn1?= =?iso-8859-1?q?+HVyuVY96MPUYD6e6O0nMIt5HyTDqAcIUjGRr/Yh4qkd6ZsaJz6mF1iUppag?= =?iso-8859-1?q?64T+yQ139yr//8/VnnZ+PxhtO74p4WnxeuBWt0ZTXI9oPyl8bNjtjsBAByAx?= =?iso-8859-1?q?g2ph/UMGL73+u4VbgUxE7RnXKrTG9qd8HKxSyWdLSLREnyYEczXo1g9rzIt7?= =?iso-8859-1?q?qJ3ZmY7TGLcACWA6knDStwAu++nHZd/eEVDwZqxJ+teSPNsYKK/6PFLRzdnf?= =?iso-8859-1?q?nVx4Qyqzh102IYH8GsXpy5/x9Ux3zaiAhnE9z4v7sJoQHR7sw90CCBHbi3jr?= =?iso-8859-1?q?42c8VzO04ICmfrEjsUkp1rdFGTf6OauKnha7f2uSDbJWlsNbvFn2ziPKd82U?= =?iso-8859-1?q?0bj2TPakZWuCB9ivR+e6V/RhmhX5pTWSrtksXvQbQFouYswHJFICmQez0iLx?= =?iso-8859-1?q?mJsTaJnCEqVZnsSMozfNm27pPfEJ9Ud9H2G+7oZUJmJBIqatA2ha6UIHY0SX?= =?iso-8859-1?q?aqM+EmI9VtjJyGdoamnLPIsTkAIASaP7TVaZ08KMx58arHo6KZomWvwU+b5c?= =?iso-8859-1?q?bsRR3NzbzyKw2NjpHxERJSMejc6/E8C1xHohhsdspgyocmREMHP1XjkflFxF?= =?iso-8859-1?q?A8B7CjdL7exmdkjW0wjgyw2xVHIo/iMhmD4l51kXl7q6kFvSKYhD9XkpucwE?= =?iso-8859-1?q?bTo+GabO8EQIQIqOdvGiNHMl4iBmnEcEfm37Qy7EPF5avNIi6yFd8JSJvvbM?= =?iso-8859-1?q?XAcTLDt3HJF4CJRcC25ZA=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB4943.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 58bc36ea-300c-41e6-c709-08d90685c35c X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2021 18:29:42.6843 (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: uFsCf91ldwflVtyJTSQAmx8gmgAY4y7hlgfYMDz3AR71IFOTfb7gx6fZ0KEjDZi/fEBfashjh1edQAjmMvzsqcHrIBj013TyPKiyO5V+Cj4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3318 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ajay Singh Added new WID to handle WOW and pass the information to FW in wilc_set_wakeup(). Signed-off-by: Ajay Singh --- .../wireless/microchip/wilc1000/cfg80211.c | 1 + drivers/net/wireless/microchip/wilc1000/hif.c | 24 +++++++++++++++++++ drivers/net/wireless/microchip/wilc1000/hif.h | 1 + .../wireless/microchip/wilc1000/wlan_cfg.c | 1 + .../net/wireless/microchip/wilc1000/wlan_if.h | 1 + 5 files changed, 28 insertions(+) diff --git a/drivers/net/wireless/microchip/wilc1000/cfg80211.c b/drivers/net/wireless/microchip/wilc1000/cfg80211.c index 36b87ed38092..75160ab3914a 100644 --- a/drivers/net/wireless/microchip/wilc1000/cfg80211.c +++ b/drivers/net/wireless/microchip/wilc1000/cfg80211.c @@ -1580,6 +1580,7 @@ static void wilc_set_wakeup(struct wiphy *wiphy, bool enabled) } netdev_info(vif->ndev, "cfg set wake up = %d\n", enabled); + wilc_set_wowlan_trigger(vif, enabled); srcu_read_unlock(&wl->srcu, srcu_idx); } diff --git a/drivers/net/wireless/microchip/wilc1000/hif.c b/drivers/net/wireless/microchip/wilc1000/hif.c index 497a49a182ef..e69b9c7f3d31 100644 --- a/drivers/net/wireless/microchip/wilc1000/hif.c +++ b/drivers/net/wireless/microchip/wilc1000/hif.c @@ -23,6 +23,10 @@ struct wilc_set_multicast { u8 *mc_list; }; +struct host_if_wowlan_trigger { + u8 wowlan_trigger; +}; + struct wilc_del_all_sta { u8 assoc_sta; u8 mac[WILC_MAX_NUM_STA][ETH_ALEN]; @@ -34,6 +38,7 @@ union wilc_message_body { struct wilc_set_multicast mc_info; struct wilc_remain_ch remain_on_ch; char *data; + struct host_if_wowlan_trigger wow_trigger; }; struct host_if_msg { @@ -962,6 +967,25 @@ static void handle_set_mcast_filter(struct work_struct *work) kfree(msg); } +void wilc_set_wowlan_trigger(struct wilc_vif *vif, bool enabled) +{ + int ret; + struct wid wid; + u8 wowlan_trigger = 0; + + if (enabled) + wowlan_trigger = 1; + + wid.id = WID_WOWLAN_TRIGGER; + wid.type = WID_CHAR; + wid.val = &wowlan_trigger; + wid.size = sizeof(char); + + ret = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); + if (ret) + pr_err("Failed to send wowlan trigger config packet\n"); +} + static void handle_scan_timer(struct work_struct *work) { struct host_if_msg *msg = container_of(work, struct host_if_msg, work); diff --git a/drivers/net/wireless/microchip/wilc1000/hif.h b/drivers/net/wireless/microchip/wilc1000/hif.h index 58811911213b..cccd54ed0518 100644 --- a/drivers/net/wireless/microchip/wilc1000/hif.h +++ b/drivers/net/wireless/microchip/wilc1000/hif.h @@ -207,6 +207,7 @@ int wilc_get_statistics(struct wilc_vif *vif, struct rf_info *stats); int wilc_get_vif_idx(struct wilc_vif *vif); int wilc_set_tx_power(struct wilc_vif *vif, u8 tx_power); int wilc_get_tx_power(struct wilc_vif *vif, u8 *tx_power); +void wilc_set_wowlan_trigger(struct wilc_vif *vif, bool enabled); void wilc_scan_complete_received(struct wilc *wilc, u8 *buffer, u32 length); void wilc_network_info_received(struct wilc *wilc, u8 *buffer, u32 length); void wilc_gnrl_async_info_received(struct wilc *wilc, u8 *buffer, u32 length); diff --git a/drivers/net/wireless/microchip/wilc1000/wlan_cfg.c b/drivers/net/wireless/microchip/wilc1000/wlan_cfg.c index fe2a7ed8e5cd..dba301378b7f 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan_cfg.c +++ b/drivers/net/wireless/microchip/wilc1000/wlan_cfg.c @@ -22,6 +22,7 @@ static const struct wilc_cfg_byte g_cfg_byte[] = { {WID_STATUS, 0}, {WID_RSSI, 0}, {WID_LINKSPEED, 0}, + {WID_WOWLAN_TRIGGER, 0}, {WID_NIL, 0} }; diff --git a/drivers/net/wireless/microchip/wilc1000/wlan_if.h b/drivers/net/wireless/microchip/wilc1000/wlan_if.h index f85fd575136d..31c68643731d 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan_if.h +++ b/drivers/net/wireless/microchip/wilc1000/wlan_if.h @@ -662,6 +662,7 @@ enum { WID_LOG_TERMINAL_SWITCH = 0x00CD, WID_TX_POWER = 0x00CE, + WID_WOWLAN_TRIGGER = 0X00CF, /* EMAC Short WID list */ /* RTS Threshold */ /* From patchwork Fri Apr 23 18:29:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 12221385 X-Patchwork-Delegate: kvalo@adurom.com 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,PDS_BAD_THREAD_QP_64,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 72844C433B4 for ; Fri, 23 Apr 2021 18:29:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 422DD613CB for ; Fri, 23 Apr 2021 18:29:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243644AbhDWSaY (ORCPT ); Fri, 23 Apr 2021 14:30:24 -0400 Received: from esa.microchip.iphmx.com ([68.232.154.123]:44321 "EHLO esa.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232212AbhDWSaW (ORCPT ); Fri, 23 Apr 2021 14:30:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1619202586; x=1650738586; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=gG59fZ6Y3zCifCUdYL+6mC6i15CGJ2xUfo3o+3aTL/w=; b=1ahLH8EdB+gyFG3Q5Rsfpo4Io+SA3JA64yJ2yfhJ4mSPpg4KEVrAhdjh 7yyErXHsT/lD3qOFIblow52uw2ADuKfE/aUX+16T3fKrapf6OeH+LOvjj AL7GjqBRjRRjzgqfdOEmWs9EKGxTDglGTOG9f3YzzCrECXR5yim8DpVg4 oCoZlEeB2rvcbLl3EzcWw/1QLdj7D55729oS890l2/P1qf5rqvke1CHOI vAt2iARY9FPKutLdvuZBLqLLYIih4TQwmB0Ww7lJfzf/RtNaCDWVLUQOF 1wThwUOND1UqBI5H0S7/75Bn4B+QlfjXF8BDtS3ZZn4k0QJi9AvnvYPOE Q==; IronPort-SDR: vjtCglw3kOdqYRI5oU23AKjFhsFtDmDS2zEibkCQeKMoabjrrFqNtt58dRKKW74757ON7Tgm3q 3mSAuAH44aG1kBCHTz88myH75RIwnkZK8bm4ieOZq2JCFfzPPRO7h6Yd/jgValJVBvLwvrCwBv 9KLfxwDScd1BSBwLO8DJhFpGLyfuDO2sDdOqvCo0Q06EnjEzOskFP/PB8FsEViRrOdSpa9cS+I k/4VUs+RKk0fe4+LXomPuSwVF/7En4f1VkasJ9s7P0G+PiTlcZpqlNs9XqNulI993XcHZfza23 11E= X-IronPort-AV: E=Sophos;i="5.82,246,1613458800"; d="scan'208";a="111995814" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 23 Apr 2021 11:29:45 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 23 Apr 2021 11:29:45 -0700 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2 via Frontend Transport; Fri, 23 Apr 2021 11:29:45 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LlHjeA6m8ilpgEuh9fqfxKbeWFapXR0qtEq80sLVFS3BMFPGoK6eUzTlBM5n8tQdf+8RnOnLjka7XYka9eDSKiMlvj6Nglq0iJLwyEHWTo1ZjpAuLYGiQvfCFMAzRaZthXZQhtEO7eiTaHbAG1KuNq6pdDR5KA/MvwKzSgxSzjGpoIH+EGwzw9mgPazhYwLYJIVmejl97R3rra/FeFJhVAH6lBZ8lSlF7jNIergpRYWa0fQDJ7Gd28mNzTHTPn6R9xMNymQ/uYWrykxivl6vMhjTjjjBBNRwA5/t0ZdpRbgSgyuvhmKYqNRbUqVFI6qrziLfTU3LrGp9H48BVyJqTg== 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=vKrWtAVkz2QPQ9l1QPW/8w+uWwyazbyB7mP445Fft8g=; b=djUeDstosaJCtmp6C5x+t7ew6inNLSnZHoeG1rJDjEhinQt7eG2y05o3GlfCISoVKPy0PLo7Db9f5bzAZI2sG9NTk9virXEsXl/zkddm4x9ia12YjWgRBMSrhWIP+T+XBp1guYXHNJRxuiiWCb2KJfrLduFvU+heqIDetmzf+QCrmF9I1qeOUodHONEKdkrKc02BgtpFtn5eID93yIzy0xi7r1+DsqmO+Qb3CTyMTSw0gEZf1MZdRWLE1N894axIGpf4iU4TUHy3KIlLKKHmNdFqAET+4nBL6qLFOLTatkloEkUQxLeaPk++wJyy7ae7OJ3wGqWAb56N08Rb3AF/Fg== 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=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vKrWtAVkz2QPQ9l1QPW/8w+uWwyazbyB7mP445Fft8g=; b=ZGY6WkQyvMJOehD5+krKN2t0FsBApezmUvTljJuR93ZTgrVvSCzqQYLeuWGyLMdIj/nfQFiP0RwszZifBTAbakUtqZ+Cl+V0OmyCHD7Gg5hIKH0FX/adDxcU80nMzRWpHTa1BEE0YXK08e1MjR9+UKsXzBY+GWJiId/DBCCqi2Y= Received: from SJ0PR11MB4943.namprd11.prod.outlook.com (2603:10b6:a03:2ad::17) by BYAPR11MB3318.namprd11.prod.outlook.com (2603:10b6:a03:7d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Fri, 23 Apr 2021 18:29:44 +0000 Received: from SJ0PR11MB4943.namprd11.prod.outlook.com ([fe80::5da7:92e6:d6c9:64b3]) by SJ0PR11MB4943.namprd11.prod.outlook.com ([fe80::5da7:92e6:d6c9:64b3%7]) with mapi id 15.20.4065.024; Fri, 23 Apr 2021 18:29:44 +0000 From: To: CC: , Subject: [PATCH 04/12] wilc1000: setup registers to support chip wakeup sequence Thread-Topic: [PATCH 04/12] wilc1000: setup registers to support chip wakeup sequence Thread-Index: AQHXOG6hTUGwpdyuKEeBJf3GAG87Fw== Date: Fri, 23 Apr 2021 18:29:44 +0000 Message-ID: <20210423182925.5865-5-ajay.kathat@microchip.com> References: <20210423182925.5865-1-ajay.kathat@microchip.com> In-Reply-To: <20210423182925.5865-1-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 authentication-results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=microchip.com; x-originating-ip: [106.51.107.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7d6cb638-67cb-4d42-4a0f-08d90685c476 x-ms-traffictypediagnostic: BYAPR11MB3318: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1265; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: lrTGpaJt4k43VWpQ1FVgHsa+8SsfqkcklGMQrI2muALRw4PSJ2kw2ZZd56ASSxKverk5S+8rTTvHSEwhOT6tsyyPc60sD2AijA0aEvu7w3hIImZPxAeMI0LXnKjLxVsypuCkzOz8BPVqXn587kYFy20GEAxF8jfQt5Gg7gF5MUv3T/auFo7rZ9hQRazHXV6VpJCQqeUWLP1FejZO6iYu3XR56XM4DObmGkavsoEZsts36e8DZizhpbdICpUvSsk64RMl+xGUGTPTM/9RfI3W0Q2L8iIaa7liDHs2bLw3pmXJpHLxyd+c5euXVdUxAqxR88ZpATqtpJHI+5gIphwzZzE0EqykWOhaI34uHmBeFuUKKJ4F97mRW8uSBLT+gVW2ijdPx4DwjdIHFH4KsR/dIG3h9SYqcyR6o6fcBolUSsKvuqx7KpcFm2Hjy44Z3Cjw0CtUakVZL/aPdP1mk0o2Rw1mzpWflPWemh2rY6u5wF+aQjuzuIeHoxvEAXzN1rFsZEFeJwF/C2PZ+ejEfqacSGqv7LYj4bsUwMdttxmZUQjL296+5p0nzfpFGtYe5Ky0tvwn/nK0nHMmX9P7gCUAjURSCE6b1Uv05250BM7SXmg= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR11MB4943.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(376002)(136003)(39860400002)(346002)(366004)(8676002)(478600001)(55236004)(5660300002)(54906003)(6506007)(71200400001)(1076003)(4326008)(2616005)(6486002)(86362001)(316002)(107886003)(6916009)(66476007)(66446008)(186003)(66946007)(36756003)(122000001)(26005)(66556008)(91956017)(83380400001)(38100700002)(8936002)(64756008)(76116006)(6512007)(2906002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?iso-8859-1?q?mibETjLTvAgGlIVV9VxTXlPp1?= =?iso-8859-1?q?eVY1TTF6d1Xu+g4+HfF1hN4BSB83+uGxzCHLG+GX33OLgt9rbKH5ySjOaLUA?= =?iso-8859-1?q?gMdhkvhh2tS9am5uxNyMJ4RpNsroamyP6cJZ+dPOV+wWDGE781ii+Tf3O+I9?= =?iso-8859-1?q?RzbgS3MwivpA9TbaK/ukmBiOst4M/OXm2h+VJ1pEZJOM7F4nSwG3pkDkxNag?= =?iso-8859-1?q?9cMOtHI7+wTnSZiNh36h4ULti9yGSg8Yd2Uv3CGm5x7mnodKgHtCX5jLMfqw?= =?iso-8859-1?q?kpWLJ/qTepWnw4o75dmjGyX5VnWOKa9Tebpp6zjO/xEx3eO5LXLcMjKR5mKN?= =?iso-8859-1?q?9MIZsZgouz973/eCzlCNV1noY2w5Dux4FoDus/P+tdJYw8ZN3egJ8BNbtIIT?= =?iso-8859-1?q?cKQ1XsIWF1d+EYPllYSpYvI5/Q19k8uRnOWCq0rGVyd+zZ1jWYFUV2JvJjns?= =?iso-8859-1?q?bcnF8exU7joPV6Zf3Nc3KjCAC9hQK0hmTvR9k19tZ7Q7d13p1+/ywA9gPaLG?= =?iso-8859-1?q?3BTxSCMy/OTWUUxdnlKDb+KLViKHpYWLO5Zc+uT3X31YNS4O8xbH2A3yj7Kr?= =?iso-8859-1?q?rXD68qaxfjRPwuaPuJiUb3oIIkMHHl/WrxAy/vg6V+BZhEFqJqjN3+5ry02W?= =?iso-8859-1?q?Q//4MbYP1zu3irBJVGxRtSt48m+jChwa8199q5Io1LJW6Qwcq5telm3q749t?= =?iso-8859-1?q?VHOZFQOma/nHkXi+XwlHtVndYZZ9DIbAXPlZ0/oF+o+N35ZCfvPuMOk0vFY8?= =?iso-8859-1?q?yRUoG0bcpwcHF9CBE53DRdAaLBHQO6O0PhGvA6Fsa4IcBkYj4IsxbReA0/tB?= =?iso-8859-1?q?w470kBBHUNiDfDyPLwfxCljWz7GU9KM5+o6YhinZcxmWy3iAh7PrkrYb1lFR?= =?iso-8859-1?q?ID6tdEbfAvWquXVJ0Y8B7WWT/cKlstFTyAXiwB7wsI7mkQXVnqQtuSNkdzTy?= =?iso-8859-1?q?HtFMn5dy5mKsTsv85ozg1maGjileHdPDMGGGv9fTzEKDsKs+ZK4G2fUlO5sU?= =?iso-8859-1?q?MIRGFwxrvWqauSSxTGJ5P1VgMUm8fNIpjPPzIVYfbhCfJbpFyjcRwhZjSEIO?= =?iso-8859-1?q?wchTOg2PTcOXCLV6bVe1D4xJkxWSOjffOtGBEBussQCBreyxcv9y+h9nnvP0?= =?iso-8859-1?q?jIliWDRLFcpAF2ETqHHAk6Tm+fvvyqovwz9vEub/bs1HyYI7ZNSYDUeB7cP+?= =?iso-8859-1?q?AfRpBtJjWJTCfE+36rtqQZGK6oD+fm5ZxGd4thzRyJjtLveEhNqDSIYedH8/?= =?iso-8859-1?q?iNOLjFu+ZVCL7Wwzd4Dyk/V6jVuhbYv7EiBDJ1hoZStKRNotwjbmQKAXChE5?= =?iso-8859-1?q?UN/caHXE4J8b8L8DOaKArHYjK2lnesY/vXpJAGwhc1G+aNSUYHFY5drUGdMH?= =?iso-8859-1?q?r/eiPcYz6pK2OOVJTsZPw=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB4943.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d6cb638-67cb-4d42-4a0f-08d90685c476 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2021 18:29:44.4616 (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: l0nqukyruMeY+n8aGjWvq6nu9nTNfM44eDhzByoylj3dZr1NLTDMO5CUnqYM8Yf9PeNhtDJRCZ74Pn4jQL+XW9ZHhDKhBqXrooX7AhS2S9s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3318 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ajay Singh Configure required register for WILC1000 wakeup sequence out of sleep for SPI and SDIO module. Signed-off-by: Ajay Singh --- .../wireless/microchip/wilc1000/cfg80211.c | 1 - .../net/wireless/microchip/wilc1000/netdev.h | 1 - .../net/wireless/microchip/wilc1000/wlan.c | 98 ++++++++++--------- .../net/wireless/microchip/wilc1000/wlan.h | 2 + .../net/wireless/microchip/wilc1000/wlan_if.h | 6 -- 5 files changed, 53 insertions(+), 55 deletions(-) diff --git a/drivers/net/wireless/microchip/wilc1000/cfg80211.c b/drivers/net/wireless/microchip/wilc1000/cfg80211.c index 75160ab3914a..91a471f3b1c8 100644 --- a/drivers/net/wireless/microchip/wilc1000/cfg80211.c +++ b/drivers/net/wireless/microchip/wilc1000/cfg80211.c @@ -1726,7 +1726,6 @@ int wilc_cfg80211_init(struct wilc **wilc, struct device *dev, int io_type, *wilc = wl; wl->io_type = io_type; wl->hif_func = ops; - wl->chip_ps_state = WILC_CHIP_WAKEDUP; for (i = 0; i < NQUEUES; i++) INIT_LIST_HEAD(&wl->txq[i].txq_head.list); diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.h b/drivers/net/wireless/microchip/wilc1000/netdev.h index a39c62a20f04..79f73a72da57 100644 --- a/drivers/net/wireless/microchip/wilc1000/netdev.h +++ b/drivers/net/wireless/microchip/wilc1000/netdev.h @@ -265,7 +265,6 @@ struct wilc { bool suspend_event; struct workqueue_struct *hif_workqueue; - enum chip_ps_states chip_ps_state; struct wilc_cfg cfg; void *bus_data; struct net_device *monitor_dev; diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c index 2030fc7f53ca..177e42a9a603 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan.c +++ b/drivers/net/wireless/microchip/wilc1000/wlan.c @@ -10,6 +10,8 @@ #include "cfg80211.h" #include "wlan_cfg.h" +#define WAKE_UP_TRIAL_RETRY 10000 + static inline bool is_wilc1000(u32 id) { return (id & (~WILC_CHIP_REV_FIELD)) == WILC_1000_BASE_ID; @@ -611,60 +613,62 @@ EXPORT_SYMBOL_GPL(chip_allow_sleep); void chip_wakeup(struct wilc *wilc) { - u32 reg, clk_status_reg; - const struct wilc_hif_func *h = wilc->hif_func; - - if (wilc->io_type == WILC_HIF_SPI) { - do { - h->hif_read_reg(wilc, WILC_SPI_WAKEUP_REG, ®); - h->hif_write_reg(wilc, WILC_SPI_WAKEUP_REG, - reg | WILC_SPI_WAKEUP_BIT); - h->hif_write_reg(wilc, WILC_SPI_WAKEUP_REG, - reg & ~WILC_SPI_WAKEUP_BIT); - - do { - usleep_range(2000, 2500); - wilc_get_chipid(wilc, true); - } while (wilc_get_chipid(wilc, true) == 0); - } while (wilc_get_chipid(wilc, true) == 0); - } else if (wilc->io_type == WILC_HIF_SDIO) { - h->hif_write_reg(wilc, WILC_SDIO_HOST_TO_FW_REG, - WILC_SDIO_HOST_TO_FW_BIT); - usleep_range(200, 400); - h->hif_read_reg(wilc, WILC_SDIO_WAKEUP_REG, ®); - do { - h->hif_write_reg(wilc, WILC_SDIO_WAKEUP_REG, - reg | WILC_SDIO_WAKEUP_BIT); - h->hif_read_reg(wilc, WILC_SDIO_CLK_STATUS_REG, - &clk_status_reg); - - while (!(clk_status_reg & WILC_SDIO_CLK_STATUS_BIT)) { - usleep_range(2000, 2500); + u32 ret = 0; + u32 clk_status_val = 0, trials = 0; + u32 wakeup_reg, wakeup_bit; + u32 clk_status_reg, clk_status_bit; + u32 to_host_from_fw_reg, to_host_from_fw_bit; + u32 from_host_to_fw_reg, from_host_to_fw_bit; + const struct wilc_hif_func *hif_func = wilc->hif_func; - h->hif_read_reg(wilc, WILC_SDIO_CLK_STATUS_REG, - &clk_status_reg); - } - if (!(clk_status_reg & WILC_SDIO_CLK_STATUS_BIT)) { - h->hif_write_reg(wilc, WILC_SDIO_WAKEUP_REG, - reg & ~WILC_SDIO_WAKEUP_BIT); - } - } while (!(clk_status_reg & WILC_SDIO_CLK_STATUS_BIT)); + if (wilc->io_type == WILC_HIF_SDIO) { + wakeup_reg = WILC_SDIO_WAKEUP_REG; + wakeup_bit = WILC_SDIO_WAKEUP_BIT; + clk_status_reg = WILC_SDIO_CLK_STATUS_REG; + clk_status_bit = WILC_SDIO_CLK_STATUS_BIT; + from_host_to_fw_reg = WILC_SDIO_HOST_TO_FW_REG; + from_host_to_fw_bit = WILC_SDIO_HOST_TO_FW_BIT; + to_host_from_fw_reg = WILC_SDIO_FW_TO_HOST_REG; + to_host_from_fw_bit = WILC_SDIO_FW_TO_HOST_BIT; + } else { + wakeup_reg = WILC_SPI_WAKEUP_REG; + wakeup_bit = WILC_SPI_WAKEUP_BIT; + clk_status_reg = WILC_SPI_CLK_STATUS_REG; + clk_status_bit = WILC_SPI_CLK_STATUS_BIT; + from_host_to_fw_reg = WILC_SPI_HOST_TO_FW_REG; + from_host_to_fw_bit = WILC_SPI_HOST_TO_FW_BIT; + to_host_from_fw_reg = WILC_SPI_FW_TO_HOST_REG; + to_host_from_fw_bit = WILC_SPI_FW_TO_HOST_BIT; } - if (wilc->chip_ps_state == WILC_CHIP_SLEEPING_MANUAL) { - if (wilc_get_chipid(wilc, false) < WILC_1000_BASE_ID_2B) { - u32 val32; + /* indicate host wakeup */ + ret = hif_func->hif_write_reg(wilc, from_host_to_fw_reg, + from_host_to_fw_bit); + if (ret) + return; - h->hif_read_reg(wilc, WILC_REG_4_TO_1_RX, &val32); - val32 |= BIT(6); - h->hif_write_reg(wilc, WILC_REG_4_TO_1_RX, val32); + /* Set wake-up bit */ + ret = hif_func->hif_write_reg(wilc, wakeup_reg, + wakeup_bit); + if (ret) + return; - h->hif_read_reg(wilc, WILC_REG_4_TO_1_TX_BANK0, &val32); - val32 |= BIT(6); - h->hif_write_reg(wilc, WILC_REG_4_TO_1_TX_BANK0, val32); + while (trials < WAKE_UP_TRIAL_RETRY) { + ret = hif_func->hif_read_reg(wilc, clk_status_reg, + &clk_status_val); + if (ret) { + pr_err("Bus error %d %x\n", ret, clk_status_val); + return; } + if (clk_status_val & clk_status_bit) + break; + + trials++; + } + if (trials >= WAKE_UP_TRIAL_RETRY) { + pr_err("Failed to wake-up the chip\n"); + return; } - wilc->chip_ps_state = WILC_CHIP_WAKEDUP; } EXPORT_SYMBOL_GPL(chip_wakeup); diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.h b/drivers/net/wireless/microchip/wilc1000/wlan.h index 771c25fa849b..285e5d9a2b48 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan.h +++ b/drivers/net/wireless/microchip/wilc1000/wlan.h @@ -97,6 +97,8 @@ #define WILC_SPI_WAKEUP_REG 0x1 #define WILC_SPI_WAKEUP_BIT BIT(1) +#define WILC_SPI_CLK_STATUS_REG 0x0f +#define WILC_SPI_CLK_STATUS_BIT BIT(2) #define WILC_SPI_HOST_TO_FW_REG 0x0b #define WILC_SPI_HOST_TO_FW_BIT BIT(0) diff --git a/drivers/net/wireless/microchip/wilc1000/wlan_if.h b/drivers/net/wireless/microchip/wilc1000/wlan_if.h index 31c68643731d..6eb7eb4ac294 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan_if.h +++ b/drivers/net/wireless/microchip/wilc1000/wlan_if.h @@ -48,12 +48,6 @@ enum { WILC_FW_MAX_PSPOLL_PS = 4 }; -enum chip_ps_states { - WILC_CHIP_WAKEDUP = 0, - WILC_CHIP_SLEEPING_AUTO = 1, - WILC_CHIP_SLEEPING_MANUAL = 2 -}; - enum bus_acquire { WILC_BUS_ACQUIRE_ONLY = 0, WILC_BUS_ACQUIRE_AND_WAKEUP = 1, From patchwork Fri Apr 23 18:29:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 12221387 X-Patchwork-Delegate: kvalo@adurom.com 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,PDS_BAD_THREAD_QP_64,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 92EECC43460 for ; Fri, 23 Apr 2021 18:29:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 674E8613CB for ; Fri, 23 Apr 2021 18:29:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243728AbhDWSa1 (ORCPT ); Fri, 23 Apr 2021 14:30:27 -0400 Received: from esa.microchip.iphmx.com ([68.232.154.123]:44326 "EHLO esa.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229549AbhDWSaX (ORCPT ); Fri, 23 Apr 2021 14:30:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1619202586; x=1650738586; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=QFicB3L4qgvsaTe1LnysfuYZ2JLhR9ebVCygbVi5giU=; b=sJYbg50K6doQzJTNK1ZtCXDtGPkLTQZNO6R9yIYUyyxGC49UoixLEGDn /fMr5GMtlx78jf56sQ+IK8WGuOj/YVE2I7bDtNImDf3MMDwC2cmhEl2q9 2bSwIezN45j91b6LpV7/GW0IVzG8kBsSPQwCYloyhMrX3Tn4rXoV21Dwe 877SDj//4JBAxgEDb8giojLVIeEykr3o9QRgqalkbI7RcO9oZSZH+VB/M pfl8XzKI4TsTk8HcCJMYC2Y/kTk3YTuyKafEf0p46DBhycMO3nOF+gqaF A7Qc3Ko5Sr+M+X1D9n/cDPLwYlf2pv1Izff+g64LegWB3u0e+2GcWyoNv g==; IronPort-SDR: zDsOARGEu+fv8gCimRShngcaLaSKNqLbhNxs5x3VzleXpyxj2ekGEkbtOSWwyp0sxh/yIoUOP2 ZXli/slLC8K0i1mPH8bnxDNCyJ/kV2YnV43yCh6XVW+QMjrC4EvxbMf1Aq0pBnmZCmEJVhYmdm 61B1lHkFE+vV4Hk8VQAqsD7gzgX5G8hxc2238JlJ+KBcD3GLBd4qer/OjHdI4FVVnVKWh0q95V Yemi8pZzF4l0J2QpMPtZLv78pJHP44G8QtQfbMM4NItqqz250hFKc2VL9rKpAOPRYo+2eCydNG XyE= X-IronPort-AV: E=Sophos;i="5.82,246,1613458800"; d="scan'208";a="111995816" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 23 Apr 2021 11:29:46 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 23 Apr 2021 11:29:46 -0700 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2 via Frontend Transport; Fri, 23 Apr 2021 11:29:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fXdT3/UzCcumcVKesK8wCpTCrMSIraDirL+P+ghwupYmCn0IMjTGwI1Vg/hCkw/XQ0cqx3BDWbZGPl3DOiJ/S0OUcF/0KVCaqeLmxysubdj0OaelMS7mEPjS3l4ivZYfC9AOhXccBa7FaF4Dmx3tOxyWMm9zaTDdnT9v9yazUYhH0qEdPbP0QHkeMPwxevi79k+ufmr89LhZTuIp2Kq/tKZM8ZOCKjOnDv1XbKf/ObA0OG0mYOvAJIkRr0zYePR9zm0xVYOwlxdSmuLICov+qRgT7kyJIb/noh98CEcYImCV62Px9gsTMRJSwvG7mir21cd52XO7UYmbr8+yIAm0IQ== 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=/uyh7oGn1inencRrX435KeD1+FY6No+0ZwBBbhuDg5A=; b=E20YBp5Jt7FvXN8RNdY6D++EUBrt89WyQyMzDQ262ehdRMkrhWOVm4rqMq8tIWI6ZmqcE3iVs8V5GUqNM7DJEvMMlaITO/0diJyUgR8EhHcCvxWdCheSpxWhbfzq5AMcLoLm9odUUc9F3na4Tyg/xt+ftrXRjGQVrT995mfTisMF0Q3IYg3/XNgFnEIhO/LIJ7OERYNOHROzlanK6KlpYuXu9LRd12j6Hg+p5KgA9gLhbVUUmCqdhlO/j+iHJ2gefV7EU8/xvTH8dQM17Fc79frW0vgf4OT2oi7w3VIwQ+5wybzdulzm5uG2j0PUL+s7i0duqMM1AfnSG/ViwVujFQ== 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=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/uyh7oGn1inencRrX435KeD1+FY6No+0ZwBBbhuDg5A=; b=Cruej5jy3yRmTfQnilbBdOZKTjEFlA0B3ThOdZ0MMdjEs5k6S6rNNVOPsG7PWtBTfsd09xmG7OGL0CCwIH7km5LOA2g59XNLt5yq7YMOYuysvCuB/zgoLPaak6W4MYTcNqxB/tGBXVOVBjTUDGeabW+s9ysp2ZXuphrwFAYSC5w= Received: from SJ0PR11MB4943.namprd11.prod.outlook.com (2603:10b6:a03:2ad::17) by BYAPR11MB3318.namprd11.prod.outlook.com (2603:10b6:a03:7d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Fri, 23 Apr 2021 18:29:45 +0000 Received: from SJ0PR11MB4943.namprd11.prod.outlook.com ([fe80::5da7:92e6:d6c9:64b3]) by SJ0PR11MB4943.namprd11.prod.outlook.com ([fe80::5da7:92e6:d6c9:64b3%7]) with mapi id 15.20.4065.024; Fri, 23 Apr 2021 18:29:45 +0000 From: To: CC: , Subject: [PATCH 05/12] wilc1000: add reset/terminate/repeat command support for SPI bus Thread-Topic: [PATCH 05/12] wilc1000: add reset/terminate/repeat command support for SPI bus Thread-Index: AQHXOG6ijAl2K25sXEivkuk3dLQvdA== Date: Fri, 23 Apr 2021 18:29:45 +0000 Message-ID: <20210423182925.5865-6-ajay.kathat@microchip.com> References: <20210423182925.5865-1-ajay.kathat@microchip.com> In-Reply-To: <20210423182925.5865-1-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 authentication-results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=microchip.com; x-originating-ip: [106.51.107.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d6fb5033-a88c-4711-cf53-08d90685c4d2 x-ms-traffictypediagnostic: BYAPR11MB3318: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:147; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jjw/oe1XqbO0DclA0RVNJPUiBHvfc2mFwm8WjZSGhSa8t4cb1G3GWzb5C5I9GvDW6jc3ZTcNvcSw58BNnSPdrJ26nTpXyZ2HXTOC1JMhkCkny5UkH/YjJh5nDQo1q4atBn3/gmMVS3GHwug9etsxWrHS1ZgdfLMCofwAvY4jZULFGoU2/YEazcPiaL8a+kXtvVTI4MhdKQIkZvl8FwBmypaLGaon5Se0u5v6fAAPxSDHvEu6m0PcFDWCafXw62fxYiRX5jQprI3Wg1HFeFhwB731OnanRbxb53pjn7HTon292kQtTfvVju4q16FWY6uXuQzpMZKGD+GuN90t4wbICFt7dzYhNlWpO7XAo3mg9EkPwi724z3FE0Kffdxwp+r52kffVdid2AqhJsuqMrkV3aVgkdZ1q1N2zbUFI2VWVFT64ZfEpczVamAtm3GTgiHQFw2WRsOJF52ztSC/6Nn7aN89b2BZLaHjxuKu+RjwmGzNYAvHFbsvYOvL83v6qACyFp95tZS0AqdCbTKsmlSTxSsWi1gNp+MXXp/+n7xVn1AADLYrJQruz8ysuifQESR1BUY9w0k052E0xWPD8b+ETUC7MiY/xWid58fBCBEyUuI= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR11MB4943.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(376002)(136003)(39860400002)(346002)(366004)(8676002)(478600001)(55236004)(5660300002)(54906003)(6506007)(71200400001)(1076003)(4326008)(2616005)(6486002)(86362001)(316002)(107886003)(6916009)(66476007)(66446008)(186003)(66946007)(36756003)(122000001)(26005)(66556008)(91956017)(38100700002)(8936002)(64756008)(76116006)(6512007)(2906002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?iso-8859-1?q?ezJ8EAO5j9VsUznAXe9VRv2X2?= =?iso-8859-1?q?9LUl4PnylIZJKc77LNdTHrKYpqoZNVrOrtW9fMHPZBKwYmdVHRoz2jLKqVhi?= =?iso-8859-1?q?tH6g8QFCn1rD2zxg5i0dgy6BfhxDg+8EEEOmRXJsz0TLt8LZTWWY646Ml1oZ?= =?iso-8859-1?q?dfITCtHVnacOJ13CQRxx9/R6dRlm57IUnqXIVt5HgRV1yT336csIVhFEFI02?= =?iso-8859-1?q?6Zdo+RCML+NhVIZwnAkk4hF5m6GsbATqbITZsUJzZjjnUeuoFPJ3x+tJ/dBh?= =?iso-8859-1?q?UhB91URNF7wLNQgGsU+Wrh8056OkaKS4e9i5k6P1i+wQOhGuctk2IP8rPSDU?= =?iso-8859-1?q?dEIz0l6rMpplIpXAlX6yMm2KSpFGVza4w7P0/OaSrtjo/rLFjYTR5qAMmnS9?= =?iso-8859-1?q?wVAG0VxqTGZnTWMuiDyC1A6lNxkSGKBTrXC+DXW+awTOdWEg2WIn4V4B3W1t?= =?iso-8859-1?q?jfzV1My/ooVnYrEG8ovZsEz5sBtjhRe8dgJfQDPoC8qlPf2JsnwGYO2xA2g/?= =?iso-8859-1?q?RhQOgCrZGM3xQ/KlJMFbiTg1cO8NU+er9pJmBCuU2yF05EIglUf7PyAcdcMD?= =?iso-8859-1?q?ZyFbXvejDZ5fmmsoeHdJaenKVB2G39nQ5AVqc5evAowyXluwQ2sJL3hrwjZ0?= =?iso-8859-1?q?wXWMSmz8FXFX+JlUcom5APv+VHPz5BTOtb1F4WBErw+pdd6d2i831KCRcPsG?= =?iso-8859-1?q?CKqKVDK9M1hM9ehpXPqRm8t0XhVaMKJLGOo1ySnOMdtMhp55/N/tZxpzAcne?= =?iso-8859-1?q?DFVpwKSZ/vAkQ0y49LgMDsC2P4eCWzeKjXbZ06Fdp8powDKlMlcccRbUOQjC?= =?iso-8859-1?q?cFLJM/oI6E5EqIVukKoWZh+2WRgu2d4+RagaKIvlMpQ08j01C/9YbYf7JB0U?= =?iso-8859-1?q?aIyde+xOY8dqp/a/bK9l26C/B5Fl3Ydhztj0sT+iS/BSPlkSu9zfeg5MRJBR?= =?iso-8859-1?q?6HIs3F7nfqXrfCEXHkxK2UzqREuintTa8r9s3YSjVtx6ftLcJ/Uk81YRCCcI?= =?iso-8859-1?q?hhVMUgct2yGCwz5r3/90XhmKHO6dbeL+VtgQhCzHdfrsQDceq3sBRcHohXUJ?= =?iso-8859-1?q?Xy00iEZc8GWBnnFPSDssSCYDCCfzQ8eU4UdSuW3KHVRoAcLqTwsDkykKjAYN?= =?iso-8859-1?q?gmzeHZ+9IshE+MiXf68+Qh++y3nJWjFYlJnk/8uxtQkI72VK+m4yjtsv8S7g?= =?iso-8859-1?q?V8IdfbefuxWeeGkMrZom4Lrft+/BZebr0k3F7Dv/NKUkGtp4lAEnq6ujkaq4?= =?iso-8859-1?q?GM6HuSgpMhUlLm0autRjOy3OJEyGNb+j+u1Ph6N89llgLuMZRN3m/hmdWuor?= =?iso-8859-1?q?GMmV9B5A010DRRqOB6PmFT7y7YBi8Ivei7BCmfEX7iuVfpsuF6C0U4fXuQp5?= =?iso-8859-1?q?bgZlAWWCQOJn9YdIvxqnQ=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB4943.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d6fb5033-a88c-4711-cf53-08d90685c4d2 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2021 18:29:45.1256 (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: wx86T2FUF3nkcwb5s8E+gtNkaJz0POsvGH4spTivy5q+++BJRq5pndszSg32/qQN6Cn1D1IVU2vVOO6WlmDkDtkhZzv0B2OOUDip8DGW0ZM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3318 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ajay Singh Added API to send reset/terminate/repeat SPI commands to FW. Signed-off-by: Ajay Singh --- drivers/net/wireless/microchip/wilc1000/spi.c | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/drivers/net/wireless/microchip/wilc1000/spi.c b/drivers/net/wireless/microchip/wilc1000/spi.c index 1472e9843896..607c8b642865 100644 --- a/drivers/net/wireless/microchip/wilc1000/spi.c +++ b/drivers/net/wireless/microchip/wilc1000/spi.c @@ -143,6 +143,12 @@ struct wilc_spi_rsp_data { u8 data[]; } __packed; +struct wilc_spi_special_cmd_rsp { + u8 skip_byte; + u8 rsp_cmd_type; + u8 status; +} __packed; + static int wilc_bus_probe(struct spi_device *spi) { int ret; @@ -705,6 +711,61 @@ static int wilc_spi_dma_rw(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz) return 0; } +static int wilc_spi_special_cmd(struct wilc *wilc, u8 cmd) +{ + struct spi_device *spi = to_spi_device(wilc->dev); + struct wilc_spi *spi_priv = wilc->bus_data; + u8 wb[32], rb[32]; + int cmd_len, resp_len = 0; + struct wilc_spi_cmd *c; + struct wilc_spi_special_cmd_rsp *r; + + if (cmd != CMD_TERMINATE && cmd != CMD_REPEAT && cmd != CMD_RESET) + return -EINVAL; + + memset(wb, 0x0, sizeof(wb)); + memset(rb, 0x0, sizeof(rb)); + c = (struct wilc_spi_cmd *)wb; + c->cmd_type = cmd; + + if (cmd == CMD_RESET) + memset(c->u.simple_cmd.addr, 0xFF, 3); + + cmd_len = offsetof(struct wilc_spi_cmd, u.simple_cmd.crc); + resp_len = sizeof(*r); + + if (spi_priv->crc7_enabled) { + c->u.simple_cmd.crc[0] = wilc_get_crc7(wb, cmd_len); + cmd_len += 1; + } + if (cmd_len + resp_len > ARRAY_SIZE(wb)) { + dev_err(&spi->dev, "spi buffer size too small (%d) (%d) (%zu)\n", + cmd_len, resp_len, ARRAY_SIZE(wb)); + return -EINVAL; + } + + if (wilc_spi_tx_rx(wilc, wb, rb, cmd_len + resp_len)) { + dev_err(&spi->dev, "Failed cmd write, bus error...\n"); + return -EINVAL; + } + + r = (struct wilc_spi_special_cmd_rsp *)&rb[cmd_len]; + if (r->rsp_cmd_type != cmd) { + if (!spi_priv->probing_crc) + dev_err(&spi->dev, + "Failed cmd response, cmd (%02x), resp (%02x)\n", + cmd, r->rsp_cmd_type); + return -EINVAL; + } + + if (r->status != WILC_SPI_COMMAND_STAT_SUCCESS) { + dev_err(&spi->dev, "Failed cmd state response state (%02x)\n", + r->status); + return -EINVAL; + } + return 0; +} + static int wilc_spi_read_reg(struct wilc *wilc, u32 addr, u32 *data) { struct spi_device *spi = to_spi_device(wilc->dev); From patchwork Fri Apr 23 18:29:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 12221389 X-Patchwork-Delegate: kvalo@adurom.com 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,PDS_BAD_THREAD_QP_64,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 576F0C433ED for ; Fri, 23 Apr 2021 18:29:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 24968613CB for ; Fri, 23 Apr 2021 18:29:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243459AbhDWSa3 (ORCPT ); Fri, 23 Apr 2021 14:30:29 -0400 Received: from esa.microchip.iphmx.com ([68.232.154.123]:44331 "EHLO esa.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243703AbhDWSaZ (ORCPT ); Fri, 23 Apr 2021 14:30:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1619202588; x=1650738588; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=NyyNGzKusK+33wmLQBQYk1NQCX6NHz42E1ZtTwDVE/4=; b=2UB2FBfLrowmw0ipdmXFNzQRuyPHbL9d2wHNnbfY0mTX1TLepohfeifK RiG2v8FYAzYnc/D5JD0OGR7zhe2W+Xdf+W3ZI1g/7of0iSOlmPGeUjSqt ak8DZsddHvDHiyzeX1uTpX7y5fSEnFR4k5YCcyjRIUCe5gkLQQ1Jjc0So gd/pIGTvHixAThG4EPsL93tR90gwzIf2xiSSW6vFKC6StsWx/N3qtWlkB Qu2lKVrNHSCeK/z3gkGxYJrQqvAtIpftRwLUU5O/w61ozijCLGmYfCofO 4N5XppUDbhPCHJM98f7tnY0gMQqFlr4C4QlzkIQVV6YSiYzSpCwz60WKx w==; IronPort-SDR: BK5AOTpUhkq/YHXMwH7J+SdN8lSkL/M+hMG5uy+I5FHReCkqDBmfwfSgJo+oGO7tT/sSP2Zgop CdbMPj8XlRssNeSQCufWYBdq+4Kf3eLCuNXcruyiGn7OqGW3trRfyLbrXLyQ9jrLahBjZHlcQa kSQQYQpeaQQ/SAxmGMziG4J8p8a5G13s+E89i9izjea7+rXF5bVlvnUgQe9aKHSmi4BOfnTlET 7c1dZ1hKO9WFWMgaVdnOYGGnfMFBtbvinZoh1Wx7pB3nBjwtzWAl0MvZqUDEtZoZgJLqG9uAg9 v5o= X-IronPort-AV: E=Sophos;i="5.82,246,1613458800"; d="scan'208";a="111995830" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 23 Apr 2021 11:29:48 -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.2176.2; Fri, 23 Apr 2021 11:29:48 -0700 Received: from NAM02-DM3-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.2176.2 via Frontend Transport; Fri, 23 Apr 2021 11:29:47 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=llK1zq8DEoGuSXN38ZHEuBGN0WhPCFP9opC2Iq0OuXfhJA6OXCNp22OR5MiHM/XZl6iB5r39Vz9COyx8rBRIOeNjTqhO5OY4YF09Q+mTFbHE5h7z1aosDMEkY/SBflSu7ixQN3RR69M0RDDNXTXx/caG2x5lZkypUj3Z76III1I6ST8f9DGw7EGB0xOCteuxq1nZzOMNM53znPm0fA1BOf7v2tuLU4uPMBQpuVgXEvdZLjY1dABGbG+D0Y8FmvrWB19eDc0L/4SEzYGtFYu5HRpbROEqDeinHhxzoIhA6CVZJBHtw5lzml/XSv3zUVP53p5hD2swNFZjynNUPUl+tA== 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=7s4mW9Xs+ATWgpMX3R8Zl0Shrc+d2kXRwrQHH259c6w=; b=OsnKDQEXk4sJQnL4BAQRK84hJA+LNadp/RJoEz4UpOcdc11rM4qynondJhhJcAL7sSxhlCeSowg4BS2YVA5B+GEXfaVh4KtQLDOvNGZpYLehTFbEhOBDv036rhOKTDZNWYNltqCu1mPiwD6vCkezVtJ9V1N7m6dB/5C090CLzoDZ9cbDW/zZ22P6KlosUL37dtCqZ4rV6HTqy/wiov2Kqgl/+MQDsh23sT+xsCfM3Rzby6W36QPsVof6Iqz3tY+CnbU2YCl2pvwagYfPep7W2D2Ejoae7nSUrYc+rFadjvUAckXsauRLLRYFut+94qFEB3Q7wOsj7n3GyrHCGf6Ldg== 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=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7s4mW9Xs+ATWgpMX3R8Zl0Shrc+d2kXRwrQHH259c6w=; b=h8foofSqZ/sxptWKXB7EOkCIwTEKhF0pFKNOUTnqQnSb9cvw14rXpRHw/T2CsYGIQze+ERMkv0JgQDSYH43qatKAkGj6eIXSQoZJiwr/I+ElK5ETGOqZNgcqY3kLy688TCvsIt568dHPP4R27nFNTlcNtU4csarqnDcw+NZwDF0= Received: from SJ0PR11MB4943.namprd11.prod.outlook.com (2603:10b6:a03:2ad::17) by BYAPR11MB3318.namprd11.prod.outlook.com (2603:10b6:a03:7d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Fri, 23 Apr 2021 18:29:46 +0000 Received: from SJ0PR11MB4943.namprd11.prod.outlook.com ([fe80::5da7:92e6:d6c9:64b3]) by SJ0PR11MB4943.namprd11.prod.outlook.com ([fe80::5da7:92e6:d6c9:64b3%7]) with mapi id 15.20.4065.024; Fri, 23 Apr 2021 18:29:46 +0000 From: To: CC: , Subject: [PATCH 06/12] wilc1000: handle register read fail issue for SPI bus Thread-Topic: [PATCH 06/12] wilc1000: handle register read fail issue for SPI bus Thread-Index: AQHXOG6i85tNg+bmH0+MCYF+QIwh0Q== Date: Fri, 23 Apr 2021 18:29:46 +0000 Message-ID: <20210423182925.5865-7-ajay.kathat@microchip.com> References: <20210423182925.5865-1-ajay.kathat@microchip.com> In-Reply-To: <20210423182925.5865-1-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 authentication-results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=microchip.com; x-originating-ip: [106.51.107.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 43ff8a8c-c0e3-468d-fc60-08d90685c56e x-ms-traffictypediagnostic: BYAPR11MB3318: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:873; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: WAD2L97p4G5OYHRtA9QSCAJf9vePCMTgwBOJ8PYA/8Gu4uhQcepflMdEgb85ybKU/QbKVOOQHLoYh0BEteaWQEAgDabHufxorW5TMIvpkiy5ejKJIUIGmcQAhZB1HEnr+fJMy3EDLWjXi72GBpTSfs3+Y6RxSsjk7Z2Sfq6vEvLtKTxEXws08xKc3J3eiUfNIrD2vsdhe5JOatBidzlif9CqUBwrAzPjoicEZtAxoB61JIk4d8BLjBDhA+J17k8mKr3jd4l8vdWNGrYqSEAnkArwz8Vw1Rv9mct+cgJekeB72oGXXCphj+NRAAB7L9QAd9D6rmeKexvs1EeWrk/ii/qPdW3gsOYl3vlN/E8qKW2E/ldq/psxEVzYtTLmEw58QU0xhQ8j6S/QzQxMHau/ILPloViiHNunFHD+j58XJwBLTwhTNR2wC8V77vki6iOwYQy+CnKPoItXIXgG7ACQ4GiAb9BNVG8PBEd2vnA3Y+T9Dd8bTp5KY/1K9H5Vf5QiAeMJUHCyvcSBXiR0hdn1VmMla4bpjyARZHA2lFDyvJd+gPmwleflLLJEaUAz74WMCpG22mb9pM1TJ8PVK5ZO2OIXkmlth4iazMcr+G72ua0= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR11MB4943.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(376002)(136003)(39860400002)(346002)(366004)(8676002)(478600001)(55236004)(5660300002)(54906003)(6506007)(71200400001)(1076003)(4326008)(2616005)(6486002)(86362001)(316002)(107886003)(6916009)(66476007)(66446008)(186003)(66946007)(36756003)(122000001)(26005)(66556008)(91956017)(83380400001)(38100700002)(8936002)(64756008)(76116006)(6512007)(2906002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?iso-8859-1?q?KNUDpTTGCpelau4kz7tcCamyj?= =?iso-8859-1?q?v2a36GMZzQDfgdtL5yzVtbEQ+M37d9/IMZwg/R/jsNjWnrJek29dltlA+EAE?= =?iso-8859-1?q?DkHejvqUJeyMjvuyXFDMKCjdQyh4XU1bEqa7wI3y+Pghi7HtZlOJnzmAuxdY?= =?iso-8859-1?q?hESanvvldUz1Oxl0JratGy3S/WBFdEmR1s34Ggah28dMy4otKKTd6jd2GB7A?= =?iso-8859-1?q?ixkl3LF8qTa9QoqOAEB4AM8zQbn+NrGrHA1ulDPQI3jqpCE1qU0N3Gq54A77?= =?iso-8859-1?q?qYLfKcoGcwMivvMrQnBjD9y5yqhMkSoITe+6oG57OIEgv45wJVBdGsuIrThC?= =?iso-8859-1?q?QMJXV8VWHvFDZqaaByt8u0fkZW6Usy09NNCPlVoBBrhnk4Oi+scDKuwipDX6?= =?iso-8859-1?q?mXEyriBynp2gFWf/x+BKLkb9/e/CMZBipky+e+QPOwrj1B6L86crKXbkjZra?= =?iso-8859-1?q?Cy0LPq5yQ9l7Do8TQtaN0K6aeNIG1GGs9K1Yo3QHm5VgUn0SlzRqIsqpsS+p?= =?iso-8859-1?q?J/9QjGBjNc5PohqLoE6RsRmCx4mc4oeDSPBRz4lr4jhFXjzXEdWbVwzMghmo?= =?iso-8859-1?q?6v1tFF7OhI54weRw7mxaHO/+GRyBY6ZW+r6D64sAmpQW/NYoWXkcI5Yw9oSA?= =?iso-8859-1?q?2qqc5BSmW1XnSNwgPvINLTsWIo71gPlVCNtBXYqxoHQ/jxTmy3VND06pfzjS?= =?iso-8859-1?q?/wevPhnE856NXI7S4gTT1gtjReURy8+gXmvTC8NfvuNt56LIr5RjPLGBwNuF?= =?iso-8859-1?q?33tg584jaMaRqCkw/MrNu5Gd2BvHsfLXk9w91qmhYBgwD0pRsuWHum/gX/v0?= =?iso-8859-1?q?RrH0xXwytdqbV2Qj4G4wPJhDs7lBwBkTYrFn7AS6/Ul8twQEoiZ+Ne3pLXQo?= =?iso-8859-1?q?7EdwrXLw/2Z4LQVmJQV1CjPn9u8GXcwFr3pkyc+2/W+anPQ5WcP4J/4fEP1c?= =?iso-8859-1?q?fCTDd+OK4iTVY8vD0QlY22NF2jDO9YZQqerLAJi15NMf3BedFBqHbUuxc7P8?= =?iso-8859-1?q?LdicczNOirEH5le75DpRtHLYJJPGNX0IO6jyeqI1xUfn4pUYLfgR7kzbrYfW?= =?iso-8859-1?q?41NiFDbp3BMisRFeD33SUrXAKDKsfdtZx58ZkSKi+Q8WV/+clezrSO1TR7hi?= =?iso-8859-1?q?c8tG8MXmw0yEBWWHwPTSVL0sf+UwtNFzOPNrsF4s96n07lfloYvM0NGJDodY?= =?iso-8859-1?q?KBaT4ON9b60cb2QRXJ61hQyMhJAViMrzNMssxhYGcsdGXqgGZ8LMFxZs0DHK?= =?iso-8859-1?q?2xjyz2g9Zmm1sLEoZN+XplJDhlBGWrZcta3tbLVFz8rCC+CIMhOV4/j531sA?= =?iso-8859-1?q?L2+KOXfzi+t/GFeJ9zuhPWeVhG4t2rd3DuBQ6eBaCrAcff4WAEpIlBsKfBLz?= =?iso-8859-1?q?mVupTSoCRSvSvDxaXJyLw=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB4943.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 43ff8a8c-c0e3-468d-fc60-08d90685c56e X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2021 18:29:46.1472 (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: ztCLpYWR8Oj9OHDWw5Hig/4K8eZkcYz5RLhfk0M4cYwTGv55QU8CMhC2AQQ4RD9qSn5WZfAelyXeKLotY1TleZNAogo+9Av8EhKceEH4hrU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3318 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ajay Singh For SPI bus, sometimes registers read fails after read/write to clockless register so added workaround to issue reset command during wakeup sequence. Signed-off-by: Ajay Singh --- drivers/net/wireless/microchip/wilc1000/sdio.c | 1 + drivers/net/wireless/microchip/wilc1000/spi.c | 16 ++++++++++++++++ drivers/net/wireless/microchip/wilc1000/wlan.c | 5 +++++ drivers/net/wireless/microchip/wilc1000/wlan.h | 1 + 4 files changed, 23 insertions(+) diff --git a/drivers/net/wireless/microchip/wilc1000/sdio.c b/drivers/net/wireless/microchip/wilc1000/sdio.c index e14b9fc2c67a..db490f449c27 100644 --- a/drivers/net/wireless/microchip/wilc1000/sdio.c +++ b/drivers/net/wireless/microchip/wilc1000/sdio.c @@ -975,6 +975,7 @@ static const struct wilc_hif_func wilc_hif_sdio = { .hif_sync_ext = wilc_sdio_sync_ext, .enable_interrupt = wilc_sdio_enable_interrupt, .disable_interrupt = wilc_sdio_disable_interrupt, + .hif_reset = wilc_sdio_reset, }; static int wilc_sdio_resume(struct device *dev) diff --git a/drivers/net/wireless/microchip/wilc1000/spi.c b/drivers/net/wireless/microchip/wilc1000/spi.c index 607c8b642865..95228dc2d7e0 100644 --- a/drivers/net/wireless/microchip/wilc1000/spi.c +++ b/drivers/net/wireless/microchip/wilc1000/spi.c @@ -46,6 +46,8 @@ struct wilc_spi { static const struct wilc_hif_func wilc_hif_spi; +static int wilc_spi_reset(struct wilc *wilc); + /******************************************** * * Spi protocol Function @@ -952,6 +954,19 @@ static int wilc_spi_write(struct wilc *wilc, u32 addr, u8 *buf, u32 size) * ********************************************/ +static int wilc_spi_reset(struct wilc *wilc) +{ + struct spi_device *spi = to_spi_device(wilc->dev); + struct wilc_spi *spi_priv = wilc->bus_data; + int result; + + result = wilc_spi_special_cmd(wilc, CMD_RESET); + if (result && !spi_priv->probing_crc) + dev_err(&spi->dev, "Failed cmd reset\n"); + + return result; +} + static int wilc_spi_deinit(struct wilc *wilc) { /* @@ -1169,4 +1184,5 @@ static const struct wilc_hif_func wilc_hif_spi = { .hif_block_tx_ext = wilc_spi_write, .hif_block_rx_ext = wilc_spi_read, .hif_sync_ext = wilc_spi_sync_ext, + .hif_reset = wilc_spi_reset, }; diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c index 177e42a9a603..9f0bb876975a 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan.c +++ b/drivers/net/wireless/microchip/wilc1000/wlan.c @@ -669,6 +669,11 @@ void chip_wakeup(struct wilc *wilc) pr_err("Failed to wake-up the chip\n"); return; } + /* Sometimes spi fail to read clock regs after reading + * writing clockless registers + */ + if (wilc->io_type == WILC_HIF_SPI) + wilc->hif_func->hif_reset(wilc); } EXPORT_SYMBOL_GPL(chip_wakeup); diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.h b/drivers/net/wireless/microchip/wilc1000/wlan.h index 285e5d9a2b48..150648b2c872 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan.h +++ b/drivers/net/wireless/microchip/wilc1000/wlan.h @@ -373,6 +373,7 @@ struct wilc_hif_func { int (*hif_sync_ext)(struct wilc *wilc, int nint); int (*enable_interrupt)(struct wilc *nic); void (*disable_interrupt)(struct wilc *nic); + int (*hif_reset)(struct wilc *wilc); }; #define WILC_MAX_CFG_FRAME_SIZE 1468 From patchwork Fri Apr 23 18:29:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 12221391 X-Patchwork-Delegate: kvalo@adurom.com 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,PDS_BAD_THREAD_QP_64,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 BB913C43462 for ; Fri, 23 Apr 2021 18:29:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 943B561458 for ; Fri, 23 Apr 2021 18:29:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243738AbhDWSaa (ORCPT ); Fri, 23 Apr 2021 14:30:30 -0400 Received: from esa.microchip.iphmx.com ([68.232.153.233]:3592 "EHLO esa.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243712AbhDWSa1 (ORCPT ); Fri, 23 Apr 2021 14:30:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1619202590; x=1650738590; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=/cXS0EPppWnlG5mdMKig92lZ4mi8uHvsMDOgS/ZQOmA=; b=vJg8k6+9PAO0mIsqrv3ekuCfdPayk/GdZv6yd1JlEsSVAy2/bbiUFYqt dWn+qh6n0llaEkbKFjdhzjPeEVMc/FpTHG7jB8E3Y5g0AD7+tKN1q8byd Bx8/T5x0I9LCETch4EqDefWZUqExs9WDYQLAqjnNdML3tSay/N+axemRc NI4IQn3Y2uJFcsh/CAqbhCYxcE/+B7213CTuaoS9h+l/dOp+qCEQqjMCK fJMb3qA6R6vsn2XVvgoLohPTuvyii2ovGWU67mlo/riqkcmsw8Qvzf8o8 fGvdsIPHe6upr4HBBk4DyaWk1Yo13rYRHhcLwMlY1AvaUm5W2Ip6EdQy7 g==; IronPort-SDR: 1AWWpZ6Bs0TymTO+ksAOCbkTuJVyKO12J9TvT12ivzbNzfBTzoTOZ6Xo71nkvuHQiPEZBdcOty Y+ZIt2i/0QI7wxlc3eRBYK+P/8diHU/Rg/CSdTNKiM10oTGPUYrsZNXIAHZLZNaoRqFGDT0kJi nQ88zNBbOOGOhcSdq/1Ot7yNMMTBO5Kd/AoarhspkeS8LNfg9wEzj6D1JrzrcYrQepMUT8hepK IW8O0LnnfXhbHiIlr/s9AQGhV55LqK1lAKPK2LSlBA49d+EkAyYs2Z+fnoLVpublXue0LqtKq2 5wk= X-IronPort-AV: E=Sophos;i="5.82,246,1613458800"; d="scan'208";a="118174645" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 23 Apr 2021 11:29:48 -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.2176.2; Fri, 23 Apr 2021 11:29:48 -0700 Received: from NAM02-DM3-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.2176.2 via Frontend Transport; Fri, 23 Apr 2021 11:29:48 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UCOOJOE2ntN4NZKsy7LZeJ1iu44FYoKRLFy/CYeutEhv9EDhyWqz4jeA0CEbdCgCemqDMpwJrnDP1etLm1mIxpQ5d8FoE19/AtfezwcdbYio3w22Z+WnKJIcJZHU72sCs74wNx6Sg6jPvVnexRxSPkohGuxTt1M1zhen8iQEYZrKOSGyhjndc98nbvWnlRzgKqSWdF4W+LjWUPy/fHXN3L/y4hHbEhBPsdrjdHNjJbZBJxXiS2cgQp+MPuXBZfuVbEChofIT89J0kNdd0hSmm9e4jBYeZWuzafkMtJ7BaqOVmLQO9CpN2PZdK/QBypos2AMkq/1lkKWhBAX0b4atLQ== 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=ZGEStLg0uD7i2caS+98TpA1OmmwC6/dsvg9jXl1dO0w=; b=ZQf80sUb4Aht1EWCWV2UcLaxkl6XskP97EW3SitNxDVfGPHP8CbvhxApdP/Ves0moi3no6EnWFpn4Tbn3NTBg5B/wzHScShbKmndb/LJLUj0iTuz5dJXmbri5M2LHCljWdLd4VL2z5lGXWxyYPrcmIos8AOwEWToAxPYgaoWxlVg49+me51X+xhcCXD6fhnehYTFA+PR5g2SS/vjBb+6ATQK5aYdHtjxM88KLGsgp+/ylA/YdUVrOxfw99bt+mtbJYQyJC7yXmYuTGgmI4+jqpstpW7oPILVtoF0m1i9L1IjhlwZ8fUyw9h/rYgllzCiSUseMIuE5YkbMsVOe2oXpg== 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=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZGEStLg0uD7i2caS+98TpA1OmmwC6/dsvg9jXl1dO0w=; b=Y48UfmyasWOT+ryDckAxdQaO5RHi/rXMi1dcUnSOTSBFM0MKz8552a1r+mtu1yGOWahVPfWBvu5LKp+JbsVSleJY5Vz1EZ41j049ZrnclgUdnC4LSW3DHAn3G2leYb2fkZ6yzZBIvw8rJVZb0S7zSIKGnIhk+nrm+mtNnDdSZF0= Received: from SJ0PR11MB4943.namprd11.prod.outlook.com (2603:10b6:a03:2ad::17) by BYAPR11MB3318.namprd11.prod.outlook.com (2603:10b6:a03:7d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Fri, 23 Apr 2021 18:29:47 +0000 Received: from SJ0PR11MB4943.namprd11.prod.outlook.com ([fe80::5da7:92e6:d6c9:64b3]) by SJ0PR11MB4943.namprd11.prod.outlook.com ([fe80::5da7:92e6:d6c9:64b3%7]) with mapi id 15.20.4065.024; Fri, 23 Apr 2021 18:29:47 +0000 From: To: CC: , Subject: [PATCH 07/12] wilc1000: ignore error response for SPI clockless registers Thread-Topic: [PATCH 07/12] wilc1000: ignore error response for SPI clockless registers Thread-Index: AQHXOG6jBbCHtMS/ykS4i5hfusovnw== Date: Fri, 23 Apr 2021 18:29:47 +0000 Message-ID: <20210423182925.5865-8-ajay.kathat@microchip.com> References: <20210423182925.5865-1-ajay.kathat@microchip.com> In-Reply-To: <20210423182925.5865-1-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 authentication-results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=microchip.com; x-originating-ip: [106.51.107.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2727b185-ffeb-42b0-4c79-08d90685c5fa x-ms-traffictypediagnostic: BYAPR11MB3318: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3631; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: s1m/cz75OwKO0iitKbJLKxQl0lPQGaHZqJLFCHW1tMmOxTbSSBz1y2gahiitP9NrybHdcvefPJu1CNeRSt0/sxk7niXlL9hHm0iCNeOhtkfs18yEYPJmUmmfRY1W2PdhGEPfVdnMXH2qV5Oi39BIELqKVNDmWvdUoUgmtxkuIakCZkqLiZVg5Mo1sW+FSXKlMOYg+SDvUVVs6rFZJ2eCHlXRj9qUCphLA6BN9uQtFmFjtICh5/KKg/LqMkG7JWmv9qp/o+9eYiXfJ+PIbR5P8FGwCVbgkqIw+M0/o1Lo9AYuB83Y2GxoH7GUQ0MfHRJ2Ck2RFBa98JoAjLH9T1OZeLcijUzDhVMFSMx5D5Jtn7yoMmuOXgPWESnWZNsD3274xGy+/HsnwXu/QonjvnEhjNLZbautaRBgVH4+qLQf4fT0Xc185Zjw/AzKc0LJwCNGCw1jNT3bMpDjAz5ymj8tpYz9D7Gf1aDjmqrihqs3ZUEMk4T6iqTph6Q4surB8B0iAMI7N4ZWFgOSd2gg2501cYHptkFYPuJXIoZrfEzXl6y6Tbk4j9Nq8g+Tg7B9hiOqsfywPG6+CNY9Y5Q4rP45awxD18TksiAJa9hk+SZKQqM= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR11MB4943.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(376002)(136003)(39860400002)(346002)(366004)(8676002)(478600001)(55236004)(5660300002)(54906003)(6506007)(71200400001)(1076003)(4326008)(2616005)(6486002)(86362001)(316002)(107886003)(6916009)(66476007)(66446008)(186003)(66946007)(36756003)(122000001)(26005)(66556008)(91956017)(83380400001)(38100700002)(8936002)(64756008)(76116006)(6512007)(2906002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?iso-8859-1?q?cLYVUGnFyfaXRUF7L0vjvnSC/?= =?iso-8859-1?q?ytlAPoCf3HxhOkN5W1m3ofEkJMBgkZizKJbxkO0BteJHlE+LvbJzCTwVm1ou?= =?iso-8859-1?q?agE+dH5nB/qBG4JR3B9keCzK72YeWm4avLTH5DAumGwZ+EGjZo6F40+YrZ8m?= =?iso-8859-1?q?ilFLXnBVhzl0FzkTGduc6I44mQQ7c4IG7el6LuQQOwNrfbF2EkWdyFoz2GZG?= =?iso-8859-1?q?i5MQUSeXHtO5IVJBOwp7WLAHZtH0xTWny/tpNOHdAqJT9jMbyGMPhN8pi42u?= =?iso-8859-1?q?2ll1IrlX3LETAcVU1McFuYXPmq4Wl9w5w8FCexHGJWcxeQ3lKNjIfM9LVO1P?= =?iso-8859-1?q?6prOsg1av1D9ZZ0ynHIbGYSGejkxKbO+IsjWdievKSLKEVXBUdVNBFriXZFU?= =?iso-8859-1?q?gWtGP90IB2RIe7ennkdcofyQcEXIpB5Rf4qlVbsHpUzplJlxlCn4YE+YBP1m?= =?iso-8859-1?q?pitMZG3LM5NANeZu3rEYKpQ0JZkMa0iP+Obccf/ILa5pFeeDr4xshBZnqa1x?= =?iso-8859-1?q?424f1ZQVb6jf6/DHumaE3ChDS32Ce16/9Kqz6zSlPNkIhoSSSeEaeCPpukix?= =?iso-8859-1?q?/I8Wf1S+NSk4q08icDzMQ4CRu/rfOuAgcXoYeHzhFCvLWgu0Fo6tg5R3Gb0+?= =?iso-8859-1?q?PEJcmzMn2/i4MMvhMC3h9BloGTSqF7y1IXWqrftTmoOpaujF7o2pDjvTrrHE?= =?iso-8859-1?q?c8H3g4FHdp4vp5TUmDxVRuzlbdQhQD0IL/SK/dIidD+TekcfM/ndP6ubv0KL?= =?iso-8859-1?q?7519vYqicIvmORFXNRg14feL2tLTNz9fnakY7OAuHZ39P/uI4Ku/qfp0FCnF?= =?iso-8859-1?q?iJ7Zf2wBThvFAw1oeGLTq4fUE4euO6dT5Kfk6fbVviL8VKDj3sGOZqroA4Hp?= =?iso-8859-1?q?DXGwI0xHnG8y6tW2jMrNtOmE4YEASHJMYMSxi2gNLZYK0F/4yyavoph7S8aD?= =?iso-8859-1?q?YUH2n2xsmcj/B4nF9HCKFh8hU5HN4EVJExx9wgSpjMfF2cZr+ONVEb66hACr?= =?iso-8859-1?q?8f3WKUREJyUD/w+tbLnsYU1nIXBnAvJSeKezDlDx0QkL7Md9KfobkTaeOUG3?= =?iso-8859-1?q?GfaKzfgNXqNXkGRHvjnMPvZIagMdtMHqllgHNDqRnT17SPmGJs5MAvox0/6k?= =?iso-8859-1?q?fUxo7apSmNruxRs9diokHkexv4RUWVm1Jwgn2Xvw8ASby02rFPeh233CHvjr?= =?iso-8859-1?q?KNv7gW3SwFx/LG87UcuMyMpKHAmEJwusC9zRc4LUJpuSiB14r4vHgerd2XLk?= =?iso-8859-1?q?aSGUcv2dtFNznZ0HjTnK0U40lnTdoG6EE2zN4gJziV+QGMznuho9kYuEm98P?= =?iso-8859-1?q?hopXSntmM6tDv616ES0UbGmb9L6duAWx48XgqlXwAz+O0/RAwhuOdu16PHUW?= =?iso-8859-1?q?NSk13BkF9klSb+eo7NTvg=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB4943.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2727b185-ffeb-42b0-4c79-08d90685c5fa X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2021 18:29:47.0064 (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: t4NtS34Sy571llh3TE6ZRVVJno6DOS9A3gt0gCXXSKrDTlrCBYSk66VBg2Svzng+BzGDLEPUVw260s5JPKYr5f6YD759Z1BeZ4l3C4OfnnM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3318 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ajay Singh Sometimes during wake-up sequence, clockless register status is not correct even when the operation is successful. Suppress error for clockless register so that wake-up sequence is successful. Signed-off-by: Ajay Singh --- drivers/net/wireless/microchip/wilc1000/spi.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/microchip/wilc1000/spi.c b/drivers/net/wireless/microchip/wilc1000/spi.c index 95228dc2d7e0..4f5464170426 100644 --- a/drivers/net/wireless/microchip/wilc1000/spi.c +++ b/drivers/net/wireless/microchip/wilc1000/spi.c @@ -470,7 +470,7 @@ static int wilc_spi_single_read(struct wilc *wilc, u8 cmd, u32 adr, void *b, } r = (struct wilc_spi_rsp_data *)&rb[cmd_len]; - if (r->rsp_cmd_type != cmd) { + if (r->rsp_cmd_type != cmd && !clockless) { if (!spi_priv->probing_crc) dev_err(&spi->dev, "Failed cmd, cmd (%02x), resp (%02x)\n", @@ -478,7 +478,7 @@ static int wilc_spi_single_read(struct wilc *wilc, u8 cmd, u32 adr, void *b, return -EINVAL; } - if (r->status != WILC_SPI_COMMAND_STAT_SUCCESS) { + if (r->status != WILC_SPI_COMMAND_STAT_SUCCESS && !clockless) { dev_err(&spi->dev, "Failed cmd state response state (%02x)\n", r->status); return -EINVAL; @@ -567,14 +567,18 @@ static int wilc_spi_write_cmd(struct wilc *wilc, u8 cmd, u32 adr, u32 data, } r = (struct wilc_spi_rsp_data *)&rb[cmd_len]; - if (r->rsp_cmd_type != cmd) { + /* + * Clockless registers operations might return unexptected responses, + * even if successful. + */ + if (r->rsp_cmd_type != cmd && !clockless) { dev_err(&spi->dev, "Failed cmd response, cmd (%02x), resp (%02x)\n", cmd, r->rsp_cmd_type); return -EINVAL; } - if (r->status != WILC_SPI_COMMAND_STAT_SUCCESS) { + if (r->status != WILC_SPI_COMMAND_STAT_SUCCESS && !clockless) { dev_err(&spi->dev, "Failed cmd state response state (%02x)\n", r->status); return -EINVAL; From patchwork Fri Apr 23 18:29:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 12221395 X-Patchwork-Delegate: kvalo@adurom.com 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,PDS_BAD_THREAD_QP_64,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 51212C43460 for ; Fri, 23 Apr 2021 18:29:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 21D4E61458 for ; Fri, 23 Apr 2021 18:29:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243756AbhDWSab (ORCPT ); Fri, 23 Apr 2021 14:30:31 -0400 Received: from esa.microchip.iphmx.com ([68.232.153.233]:3592 "EHLO esa.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243453AbhDWSa2 (ORCPT ); Fri, 23 Apr 2021 14:30:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1619202592; x=1650738592; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=S6AULILydVprhZ60aAOxzuDKn+3RyO50Oe2MNAOm5Bw=; b=TEzDqOriFXeSAZT2VT+PwrZZhkfY7iycsJNaQ5TkOQ67Xy9oyDxFTXoB lpdv/3er3LB4M8SfwBnUDJm6hQZ6cto5UnvBPA3BBUrLpeJ/XeSW929Xx Mcq0qq5JvS4ZNXGmGWAfHL9tXx9TThYDrI0++RLVVObWWyIe+ZR0jA63a j+Jm/J+qxqTjT8epLxitpLHeDlciB3Bp73q9wqyklySW8Mtc2P7fDOqOW h+TWRuKLZRxw3T2QlDBKOhjy+UAEI0+4nb6c0ocUBDPP0ryp+2yA3WgJP 5QM0RpZytuRUX2JRys567sx/oV76KnT02zwVm66H/AY+5vTMwhznpeiS3 A==; IronPort-SDR: 8seebXZvxjaTIKb4ZtudqDIdzXSI8Iama+J9BalBlySkQqKhBBBtTTAOGee+k1i4a5sRqkDVLt CDjR7WCShRfq9X30v9KQV8wwsgJdXXYUdBy6SfKI2Rf4aDaY+QEsH7EergGpM9FkGI6Dwymyqo EQH/+9l6cgivJQXEtDYCqBVtZjX+l9IurnPn5azt4Ex2yQV/4OgZwjqXyXysPdpPzDvwp2B343 2RiCbhR4poB2c2SOvvPwOThhHOBD8dNYe1Y4rAttRW1eizlD27btq6Jm0Ceccs5RKDxgw08fZL F5M= X-IronPort-AV: E=Sophos;i="5.82,246,1613458800"; d="scan'208";a="118174646" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 23 Apr 2021 11:29:49 -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.2176.2; Fri, 23 Apr 2021 11:29:48 -0700 Received: from NAM02-DM3-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.2176.2 via Frontend Transport; Fri, 23 Apr 2021 11:29:48 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l8yibjxErIMxGz/sfzDhJsco4U7g71RNvqi8fAfOnuDrVeO5Q5XjsNqp/FfunZw5gVTAaEfQWGnZr1bUBgxUlPSm6DpByf2IUH0ut56jqkZcU3o5tBCWTrH4rYyCGWr/yrsO833jd6U/ZGcAqna+nzc9sRaK2gFXnZgdXNEt0qc0hdNJc6uh++DHh+JxkUgzIMJhd9jXlSwAJA1eMlRPURvA2ksDGa3el7yXswnm7wxyA7K32yMsJJDGwRbQdJKrchm6ER2X69CsebT3nklPe/T+zrIn5/wHf5BjJNduTwzpxt7vTp02oTzPA734W69Ii1zTO5Wfta8X4NBsI5PTkg== 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=PmnVUDB5J2sOnmpgt1ij2uwNxGcIBPaz72bn9NM93kA=; b=TqzAQ9xjMiJtNbcQUL2T/vU4vFgF+PnmCwRkphbW+crKLNGKK780yFgG+hVbCJidXtrIGRAOJ7S1YDKHFEgpJaVA/ir12bP19qZVKJ52Ldcj9Rd8huweqBmI4IjYQvPbdmxOn334N8+P3Ontimh7dgUxH4Amf56rhFzdW25+DEc36vzfSa7hiGEXTkJi+s9an/KTeKEkv3iz5h+mPs0pINSAUUMDAFHF4Kzch2xiUjyNE+k4S7tpNvgM9fqRvytWFJB6d5uiMPIvr0wrrhQmsfkq7tycwHeKWPyoQs+lGU5tyHmXQE+DsF7Xp4iaWwhA4KCZqDAmqStcfftyfZu4cA== 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=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PmnVUDB5J2sOnmpgt1ij2uwNxGcIBPaz72bn9NM93kA=; b=UDZdtETp3Eaiq1hHJdCov0gg7QBUgk12POqjUMswB0g0JNm0uoCMO0QjOqQBprHsRecB8GhBo6RprJJxRih2npskF+876pfkHacIzOgJSvru7V1sXOIDZ6b8jUHIgwBpyjICVLtz0lCKK//JLNJkeeNBuUcVsQQCAqTThSOj/1M= Received: from SJ0PR11MB4943.namprd11.prod.outlook.com (2603:10b6:a03:2ad::17) by BYAPR11MB3318.namprd11.prod.outlook.com (2603:10b6:a03:7d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Fri, 23 Apr 2021 18:29:47 +0000 Received: from SJ0PR11MB4943.namprd11.prod.outlook.com ([fe80::5da7:92e6:d6c9:64b3]) by SJ0PR11MB4943.namprd11.prod.outlook.com ([fe80::5da7:92e6:d6c9:64b3%7]) with mapi id 15.20.4065.024; Fri, 23 Apr 2021 18:29:47 +0000 From: To: CC: , Subject: [PATCH 08/12] wilc1000: invoke chip reset register while FW download Thread-Topic: [PATCH 08/12] wilc1000: invoke chip reset register while FW download Thread-Index: AQHXOG6jlLzEUJ2GxEOXwEu7VmPRmA== Date: Fri, 23 Apr 2021 18:29:47 +0000 Message-ID: <20210423182925.5865-9-ajay.kathat@microchip.com> References: <20210423182925.5865-1-ajay.kathat@microchip.com> In-Reply-To: <20210423182925.5865-1-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 authentication-results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=microchip.com; x-originating-ip: [106.51.107.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8106f16c-ef96-4523-2fc0-08d90685c658 x-ms-traffictypediagnostic: BYAPR11MB3318: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:529; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: /E8MChLCU/XG3d1Lso3J6l1tdt6iE9P7HcN1pe83H+wQxViHHHnb2jHd8EQeY9uSaSb3JfcFduMLvtTZRoLkfH2RDyuzNEoPZNQl5t1mgAqbEykYVFBL06ohcq2bnNqyaCGwfdCjRGRzaVH6GWVBuu75wTwX6TDf66BMdT7Ps6NP2J9CiH136hq+CSxdktKtyRkewaRVS9fvgX37FwWw3jqGLqO2x+QfUTpJLw1I16CvHfqVnteeq1NT/pgeDiYlaMb9iNNnoJBVt3A3VRrZWZ/5Mb08X90zRbOEKMq4/c/+fdc6pbup/omIgcA4PH/9uX9tM8KWglzbFLeM1jhpQt/GtcZVKs4pkZAYQfYfeHTlBLt61N729Oz7JnuIMqlwYocDJNUEpp9TDk1tH+6U7gSE9oLs3wwq5IFM5czf3HBeXTNg7zO4x9qIHhq3UCFdpXBC2h6cTavP2ICi05GyMrorW075H+UmTkVVIab50yiR9Fgz2BJXkuf5r85NUYTpDmVvg0x8Us1KhPM4430P1Rsqy3HZF2rssX5GZCZMaLBH6V/a1FeZOj77SFJlDHZdi6DIDMb8rZpWXJ7iq8pIDEV/ZCptOrmkFnbg9JlU3zE= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR11MB4943.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(376002)(136003)(39860400002)(346002)(366004)(8676002)(478600001)(55236004)(5660300002)(54906003)(6506007)(71200400001)(1076003)(4326008)(2616005)(6486002)(86362001)(316002)(107886003)(6916009)(66476007)(66446008)(186003)(66946007)(36756003)(122000001)(26005)(66556008)(91956017)(83380400001)(38100700002)(8936002)(64756008)(76116006)(6512007)(2906002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?iso-8859-1?q?WrW22ydweTfsAf3yaetrcpMRF?= =?iso-8859-1?q?FfBZCxzpoeV/IC7iHKmDkC13XLCMECbJX7YNbia475c/UQkNn/ldSX535WFx?= =?iso-8859-1?q?sfu5r1j2qnu+JGe8USR2jGRQRQV7q+jjFxgV5ct2W9A9+cBLO3RUaOV4IT3U?= =?iso-8859-1?q?o0fe6Alpwi2IBt5N5UFYIw91EOfwEu61mjjUfkp5rzC2W9hzw7ehdtNS3kTt?= =?iso-8859-1?q?Daxtur1flOoMFbUxAVlZeckVr0OLOKxY1fcn2b6kP1Sfd2fX04o/7ozgWBnl?= =?iso-8859-1?q?s0Ok+WR9zE2GGpcQl5hRrHdHrN212X/xYjty+fEYDxr2FVj+Q4loqubwXJIB?= =?iso-8859-1?q?kC6jX0J4gUeYSHKgoDWluivVblIiG1t0tvcuatgk+rQYoIVYfOAJ4PErDM8t?= =?iso-8859-1?q?IWu5CnvZ4Bv7iBgR6oty7j8tSir1bDJOQ1B1dEg0GT58M7Hf/du8n8b0c4gT?= =?iso-8859-1?q?x07UYmSwT4AzYB9LpbENoeY7BdN1BcrG9nOKvK3QAH7RNwaNcX/jroSHylV0?= =?iso-8859-1?q?qnrLrEMAfeeh3gQ3VVPzmkgZ2gg0hodNm8WfMCupnyLp3NQ52W5dg8a9lLqj?= =?iso-8859-1?q?5xdVasox0apAU+cv7YWGhasascJFCvyXYiLfVGI5WetXQjNeW4y//76wUSdU?= =?iso-8859-1?q?FECCbzt0rcZypM0vqcZdcljm+xAhPYWSIlvM2gSgp62VtAE2ccfGWUriXxDN?= =?iso-8859-1?q?9WFw5o90WgWDYjAgrDFcPvd/hJR3nRFD3yv4IQwaR76QG3c2C6YHJ1VnpjHQ?= =?iso-8859-1?q?bxxQ/luRDG2RRz6r8wk6HKT7Y6bA5BNtbC2C66e1KME7u8kOWh0gG9RKBiOt?= =?iso-8859-1?q?qZ3WwR9VctthWJ67V2Kgr+Mn8k/XKotCd7R0dLV6cjIVg/n4kMBb1Bnrvl/N?= =?iso-8859-1?q?Ej+vmwjZgM75n2nGDlB0bc09SeMHeNAKasLwj2boJkzLHGYx3VjCLwcqjFc4?= =?iso-8859-1?q?cylyIDY0OdETwn425cbIEn65lTsOUl4BVrkNj44QOSpB0ub2GcrXHIWwTo2M?= =?iso-8859-1?q?h90OG7acpJCgfF8l4h0liluKukmb68b08tUN/wrUHNMpB2J0B5le7edV2KLb?= =?iso-8859-1?q?eDYkn0Buut+Mdt9ysCNqGFjzdcQrXSnCMK9Cchk/FJKp1XJntwmrX3aKRdA8?= =?iso-8859-1?q?54olxQ42HuVdvyx1fovl4HVPLvKHhqJI72gHmsp9JyyN6WahjSGVDtEki7Ce?= =?iso-8859-1?q?cJbYSEIDX2jptITRmzaOPSV0SilAiG4SM1gg8stmL2N5nE/QjZdMCxJXa8I0?= =?iso-8859-1?q?8yZ5Fa+MzQSiZjAheiYwwUXf33NBj9v6EhjZnbZxOV15/BXTpP/7jna4E/uL?= =?iso-8859-1?q?ri73xcREPwZbDemk6F+p0RaKTbTJOG6rIxeua7b7NksxJuEokLLXx5SSkQBK?= =?iso-8859-1?q?AsjTe2dD0B0AspZTsIuSg=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB4943.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8106f16c-ef96-4523-2fc0-08d90685c658 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2021 18:29:47.6566 (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: dWrmlRPWeEhi1a1EX36tAK+CtQWERBpFpAr3k8nBza+SmLgfooXjCcRstaQt6rWPqRwwDa3xdn3SgLJbzIsDXubpNyffCqO396geY5iqUf0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3318 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ajay Singh Added chip-reset command before firmware download to initialize the chip. Also configure chip in wake state, ready to accept the FW binary. Signed-off-by: Ajay Singh --- .../net/wireless/microchip/wilc1000/wlan.c | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c index 9f0bb876975a..24e016a0dfa8 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan.c +++ b/drivers/net/wireless/microchip/wilc1000/wlan.c @@ -1080,6 +1080,7 @@ int wilc_wlan_firmware_download(struct wilc *wilc, const u8 *buffer, u32 addr, size, size2, blksz; u8 *dma_buffer; int ret = 0; + u32 reg = 0; blksz = BIT(12); @@ -1088,10 +1089,22 @@ int wilc_wlan_firmware_download(struct wilc *wilc, const u8 *buffer, return -EIO; offset = 0; + pr_info("%s: Downloading firmware size = %d\n", __func__, buffer_size); + + acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); + + wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, ®); + reg &= ~BIT(10); + ret = wilc->hif_func->hif_write_reg(wilc, WILC_GLB_RESET_0, reg); + wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, ®); + if (reg & BIT(10)) + pr_err("%s: Failed to reset\n", __func__); + + release_bus(wilc, WILC_BUS_RELEASE_ONLY); do { addr = get_unaligned_le32(&buffer[offset]); size = get_unaligned_le32(&buffer[offset + 4]); - acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY); + acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); offset += 8; while (((int)size) && (offset < buffer_size)) { if (size <= blksz) @@ -1109,10 +1122,13 @@ int wilc_wlan_firmware_download(struct wilc *wilc, const u8 *buffer, offset += size2; size -= size2; } - release_bus(wilc, WILC_BUS_RELEASE_ONLY); + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); - if (ret) + if (ret) { + pr_err("%s Bus error\n", __func__); goto fail; + } + pr_info("%s Offset = %d\n", __func__, offset); } while (offset < buffer_size); fail: From patchwork Fri Apr 23 18:29:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 12221401 X-Patchwork-Delegate: kvalo@adurom.com 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,PDS_BAD_THREAD_QP_64,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 3F034C433ED for ; Fri, 23 Apr 2021 18:29:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 12D7A613CB for ; Fri, 23 Apr 2021 18:29:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243776AbhDWSad (ORCPT ); Fri, 23 Apr 2021 14:30:33 -0400 Received: from esa.microchip.iphmx.com ([68.232.153.233]:3592 "EHLO esa.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243751AbhDWSab (ORCPT ); Fri, 23 Apr 2021 14:30:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1619202594; x=1650738594; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=/1JtNMNbW5E5KyVpvYCEUP3YYug7y3xr9VA6bxZZVqI=; b=mWoNrh/3HAOu9mMKbWt0dRtKIMxVS5l8+MlmT1WeHXNQ6ZHPC3fCKAVP X+L5YuPdBI9GWFKZbWSpokobCF2nBW030NUiPPUvxdS1rZgpjmPSF2LaV RN+W8YajxF2+Ce2De67ntLFfsrFCAMEg2fvMU6uJul18++i95CU9GWAwW Mx13g7XoyeHi4UVN5Hx9NRb8B3E7kf2AYNBD2auyr4XIa222eJIfFxzW5 uFqb+KqLIWQUehhw50joiARqvdfGQnbfRq/WUidErAbBgW3yP9XDZPNJK 1tEj2Zh/sqnxJ1Rv9TiwVB38LK13vgQy6i6CWFmp3+NT1MVZHeNL8PqPr Q==; IronPort-SDR: AZltm8P6rtoAi6PKUVp+Sf6dlSkgqY9Rv2MeK8iKV9vEOL6x2HetFm3PHLB+n9b5rtV4ty4PbS wQQ00fQLirGEMRHxEqB4ws7NmXS/J1jIzcfs5y+hlNZI+v829LjBgtIZMI7jzYeevCq/B6CJFM XnrOv1QsNpCfmF1C+MyTzkoY0MPjqdca1cz5Sq+zEGWQxmaJ9pQb1jPNS8ZHBtGCSGIaW8Z1Kt Oov+BvXYhvIheFrxbFHeWh6B27gSS7mcRCUINO6AC4d+z+bUNCSZnuLiRPP3covSkQydyaXSWr DdY= X-IronPort-AV: E=Sophos;i="5.82,246,1613458800"; d="scan'208";a="118174651" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 23 Apr 2021 11:29:54 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) 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.2176.2; Fri, 23 Apr 2021 11:29:50 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2 via Frontend Transport; Fri, 23 Apr 2021 11:29:50 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vk8wQqsHS9YCqiBH4g1rutNDoCOMG9T8XQO6TSiAJlm0xzxCpVTQVHHV8kzU0zik2FYnfNrizrHBy8OuNqWvrm29nYXP9JJEsGCC8lfegwraj8MWoo70u+NW09uIMY7SRq7TYh2FiDzFvZQE7rYOh7zNgzpJx3Ku++BX7K4GLZmqJBzxCZhtmYKtauWKrzhncuHmgna9Ol3uavWeKq49rtiwwHBvofhpAHii7R+HaKAblSZwlJXm3kFFXTe7+aF+AfA+/88+yx39VGxpBo3m61xD2b57LPMCMTDXIw/f6bsc8bEWFkc7bFcku1Iu0MhnugfNLO9XmGkLCeIBRpEhwQ== 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=xl8N5k5qY1Aphqo1kL9oRKHTwDfKjsi3m7Y8wOut6eM=; b=lVIn1z7n09c1KsN7DoIRulPjA1n+3JQ+OWgdP0VMJSR0PWovIKDcp9quoabLRhHdRYqmeC6CFeeymZtQb8f7ffFe7sNSFAV8baDpET93bZlDtp9XhngahcXxu52RmaUzUzNU0C5sit5wuuPDXJ0MQbdJFP649HVfgFo4oGwacSKjeWOHElS+OhZxLrMXXFnWnIt2X6Mg5HC62AXN+fNIOPws9FiEzRHi6WnxEZdO4ndEiR6dJEZY+T4zql9wdxYZ8VBceGcvRUQIvGlxEd6iuzlzW6AhXyHSqoGj846enG7yjfIJ/ewG/Qg/wl2icH6g43rGsoRs1n2FkK2g+qWNMQ== 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=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xl8N5k5qY1Aphqo1kL9oRKHTwDfKjsi3m7Y8wOut6eM=; b=fTSzm/XOsRWL8/oCLuBXDx22YIS22C6S9L5ktVIbAxftL6Pg/w+uGDVbIRz8b4QhWYKDNHJqWE1BXndkfG2Brd1O0ZQm49swpb69znbONtO1gMocHSzA6JyO5Fs+rGlb/m20lLkkjaLkNYHASjQ74Bot9nSQuhY74BcV2etpD20= Received: from SJ0PR11MB4943.namprd11.prod.outlook.com (2603:10b6:a03:2ad::17) by BYAPR11MB3493.namprd11.prod.outlook.com (2603:10b6:a03:81::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.22; Fri, 23 Apr 2021 18:29:48 +0000 Received: from SJ0PR11MB4943.namprd11.prod.outlook.com ([fe80::5da7:92e6:d6c9:64b3]) by SJ0PR11MB4943.namprd11.prod.outlook.com ([fe80::5da7:92e6:d6c9:64b3%7]) with mapi id 15.20.4065.024; Fri, 23 Apr 2021 18:29:48 +0000 From: To: CC: , Subject: [PATCH 09/12] wilc1000: avoid 'isinit' static by moving inside priv data Thread-Topic: [PATCH 09/12] wilc1000: avoid 'isinit' static by moving inside priv data Thread-Index: AQHXOG6kVjxRQlZHKE2uwKahITeHMw== Date: Fri, 23 Apr 2021 18:29:48 +0000 Message-ID: <20210423182925.5865-10-ajay.kathat@microchip.com> References: <20210423182925.5865-1-ajay.kathat@microchip.com> In-Reply-To: <20210423182925.5865-1-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 authentication-results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=microchip.com; x-originating-ip: [106.51.107.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d0536074-855e-4683-291d-08d90685c6f8 x-ms-traffictypediagnostic: BYAPR11MB3493: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Izf6QPDeRxk04CCZivn3rproK6SCUOb3+JIQeOYdvUb4gDL+9GRCQ8V303w2DmPrDb8a2HRz5vzJacDDoV8HgyfGVd0mo/FdDnzQl0rzxI010BmwCF3qFcFjB5rkOvuZ5DC3Ag+epdNoUB8kEXDftISekkTGAANs24odQrXOzNsDkeF1YHM2rBWf7QXNZhAgnYVSfOtIadi9pDx5BTr6QXWZdg+YTPLSHCgxFnQd2kI2roOQw3Gfaj/0o74uCKysB9iQGNcVMCye/WX0+hZ8rXIzTAFkjr+pb0HzyuL5ix6Bo2tuXWyKOjvFFIaaF3O2kE/0m0Q6ykHwf/6MLx53K7wF/rgKx3ifUGHGPmHGtC010qktQDZKtik80aHgQOBrnv2pTRUwauMHLClNhaEAZvuqFvtsXuDhb5vTTqcV3IEmBEnzFrqUnHDnfy5hwux7aVuGYYks4FUDCVQ0DPOjVjBp8rTKnlDsA73cm4Ggn/FvcfmMgF/zKVUC7AihmNdw6Mlu6epD88ydhAAF9HmaucL33a2VqEL6SZsIo48ux1/l+F4SmeAhMkJBgZO2jHKmkXStewQs0p5G+QNyqQpkXXEFucONdysKHkD52KMigyw= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR11MB4943.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(39860400002)(136003)(366004)(346002)(376002)(86362001)(83380400001)(8936002)(66946007)(6486002)(122000001)(66476007)(6512007)(8676002)(2906002)(54906003)(5660300002)(4326008)(38100700002)(6916009)(107886003)(2616005)(71200400001)(186003)(478600001)(316002)(36756003)(76116006)(64756008)(1076003)(66446008)(26005)(6506007)(91956017)(55236004)(66556008);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?iso-8859-1?q?6ikdcm+XwZcQC+rSqlWG1w4v9?= =?iso-8859-1?q?9RJhVVkWGgQSuF7dygGWeuxece5PzbYwR+HXrtWsDH4T1BwzhgDTvUU038wc?= =?iso-8859-1?q?//vtyMOlbkUaSb5FQKZxtNaWykEYjweMtot6bSp9hhZ118mMPizPMuJKOr2t?= =?iso-8859-1?q?Phlx6b1GFINsIFdV1gk757/1gucBcsdBthvSCrjE9Kqxqu0FCoIGOt1LGiTp?= =?iso-8859-1?q?QfwgeoymQ/VrP3tDS33i6ET9514JeealzcCHY0DcUKHf4CYGOBWUmWaFtAjM?= =?iso-8859-1?q?b2unjPVEJeJ5BdV+CcfXrO5Cw2dbxQJZFSY34z/vmLAxkZx73vg1u+KoFVK9?= =?iso-8859-1?q?yjQjTfvRUzOMTII7JQcanElr8NZ2we7n6W6ngc62WEP+Qd222OK56lLftoFm?= =?iso-8859-1?q?q6XixrjxYAaHF7GI8KNTIy2uLWv1Dsb8tsw5AH46n9k8cuow4EmKNsEiKSg6?= =?iso-8859-1?q?FOGbe9c1pnIYCIMAqMCoyfmBe3aNGT7cBT3gHNcY1xccyfGTOQvRIkR8EZ9x?= =?iso-8859-1?q?GnrMTKlk9Swh8u4J2QBrU7rLLCb4wzPwuoTlfs6eEnYLsFchBEllnWeKsu7R?= =?iso-8859-1?q?scn79/dlpMK2YmpL8dR+oebjoFX6Guvwa+GGDZ1SmZ6twcFhWSGBX+EwIbpa?= =?iso-8859-1?q?kZSiZ3Y86fMsFWBFwp1uHMrWrbvqtEfCd4cIwOj2gBPWajzGJuRpYPtEtxDz?= =?iso-8859-1?q?VF8wNGthNiJp9I+tsofE60UvrpX9BRlpaPSGrH5wlbO+HQbROhn55gQ/pCWe?= =?iso-8859-1?q?Cv74QHulhKg9GU+wvJQaKG5NMq1fdg73rXxIhuWsrL92aKVwAcdlRS5tqpqR?= =?iso-8859-1?q?a4okut+LgqXh4aH1IL4xYrXnJRpGFmBAcghsXnxAggkcecl+zyjKo0lIDFOt?= =?iso-8859-1?q?kApoNgQ1U5sDFnqfsye7/XiaexubCiGQGeFRBV+XQGu5R7DSpjBFCOeavxpZ?= =?iso-8859-1?q?Zl9nnsTS+EzcjIZ5IDYfl011AKHN4mkfATY9pFaGT/Gbz8Q9yZKNkU66QnOX?= =?iso-8859-1?q?U637Z4nu37jGLaOdZCW0WkdTPzy4zMumGRTRERAO4mVfSDkDH96uJVLFtznC?= =?iso-8859-1?q?H+pmv6qHEqjto0L+zCGmMOZ37yUYAiYHDcOEkjXLt8ucpcO2NmtFVhNE75ea?= =?iso-8859-1?q?H+Ail8Nv5xN0/MdGKMlYnagSdeM35hZReJ6zuxi8s/i0V04EpbiJNjLyLn61?= =?iso-8859-1?q?VSTUrTd2GLmAXeHLYgBZoVVWABO7s98+2OnFo3VgrQWTg0309x0udHgKm1W1?= =?iso-8859-1?q?mIkUcYOnyGs1LE+bjz7fu+3aWP4u/NghK2rVxPYl9JCRnf1mrx/1+QDfc2NZ?= =?iso-8859-1?q?R5WNIt3lynv6QVhkQUHBERsxdRLki+JvUnP5ZhSb1WdotkayLIwZL++OcXoJ?= =?iso-8859-1?q?BeOOYKucoKE4PuA8AnePA=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB4943.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d0536074-855e-4683-291d-08d90685c6f8 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2021 18:29:48.6622 (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: gY5IwVd7bDvrymLNAK/EaLby2P04+V1upKONWx/Kg5DG94VfCnyk7KZxO86PllapECUvcSKmPVlOwsoHD0enn9e9gQqRnvYwI3h90LYlb4I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3493 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ajay Singh Instead of using static variable(isinit) move to priv struct. Added hif_is_init function to set is_init variable. Signed-off-by: Ajay Singh --- .../net/wireless/microchip/wilc1000/sdio.c | 13 +++++++++++ drivers/net/wireless/microchip/wilc1000/spi.c | 22 +++++++++++++------ .../net/wireless/microchip/wilc1000/wlan.c | 2 +- .../net/wireless/microchip/wilc1000/wlan.h | 1 + 4 files changed, 30 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/microchip/wilc1000/sdio.c b/drivers/net/wireless/microchip/wilc1000/sdio.c index db490f449c27..9c9f46a171b3 100644 --- a/drivers/net/wireless/microchip/wilc1000/sdio.c +++ b/drivers/net/wireless/microchip/wilc1000/sdio.c @@ -26,6 +26,7 @@ static const struct sdio_device_id wilc_sdio_ids[] = { struct wilc_sdio { bool irq_gpio; u32 block_size; + bool is_init; int has_thrpt_enh3; }; @@ -188,6 +189,13 @@ static int wilc_sdio_reset(struct wilc *wilc) return 0; } +static bool wilc_sdio_is_init(struct wilc *wilc) +{ + struct wilc_sdio *sdio_priv = wilc->bus_data; + + return sdio_priv->is_init; +} + static int wilc_sdio_suspend(struct device *dev) { struct sdio_func *func = dev_to_sdio_func(dev); @@ -576,6 +584,9 @@ static int wilc_sdio_read(struct wilc *wilc, u32 addr, u8 *buf, u32 size) static int wilc_sdio_deinit(struct wilc *wilc) { + struct wilc_sdio *sdio_priv = wilc->bus_data; + + sdio_priv->is_init = false; return 0; } @@ -695,6 +706,7 @@ static int wilc_sdio_init(struct wilc *wilc, bool resume) sdio_priv->has_thrpt_enh3); } + sdio_priv->is_init = true; return 0; } @@ -976,6 +988,7 @@ static const struct wilc_hif_func wilc_hif_sdio = { .enable_interrupt = wilc_sdio_enable_interrupt, .disable_interrupt = wilc_sdio_disable_interrupt, .hif_reset = wilc_sdio_reset, + .hif_is_init = wilc_sdio_is_init, }; static int wilc_sdio_resume(struct device *dev) diff --git a/drivers/net/wireless/microchip/wilc1000/spi.c b/drivers/net/wireless/microchip/wilc1000/spi.c index 4f5464170426..8e88986db9a4 100644 --- a/drivers/net/wireless/microchip/wilc1000/spi.c +++ b/drivers/net/wireless/microchip/wilc1000/spi.c @@ -42,6 +42,7 @@ struct wilc_spi { bool probing_crc; /* true if we're probing chip's CRC config */ bool crc7_enabled; /* true if crc7 is currently enabled */ bool crc16_enabled; /* true if crc16 is currently enabled */ + bool is_init; }; static const struct wilc_hif_func wilc_hif_spi; @@ -971,11 +972,19 @@ static int wilc_spi_reset(struct wilc *wilc) return result; } +static bool wilc_spi_is_init(struct wilc *wilc) +{ + struct wilc_spi *spi_priv = wilc->bus_data; + + return spi_priv->is_init; +} + static int wilc_spi_deinit(struct wilc *wilc) { - /* - * TODO: - */ + struct wilc_spi *spi_priv = wilc->bus_data; + + spi_priv->is_init = false; + return 0; } @@ -985,10 +994,9 @@ static int wilc_spi_init(struct wilc *wilc, bool resume) struct wilc_spi *spi_priv = wilc->bus_data; u32 reg; u32 chipid; - static int isinit; int ret, i; - if (isinit) { + if (spi_priv->is_init) { ret = wilc_spi_read_reg(wilc, WILC_CHIPID, &chipid); if (ret) dev_err(&spi->dev, "Fail cmd read chip id...\n"); @@ -1059,8 +1067,7 @@ static int wilc_spi_init(struct wilc *wilc, bool resume) return ret; } - isinit = 1; - + spi_priv->is_init = true; return 0; } @@ -1189,4 +1196,5 @@ static const struct wilc_hif_func wilc_hif_spi = { .hif_block_rx_ext = wilc_spi_read, .hif_sync_ext = wilc_spi_sync_ext, .hif_reset = wilc_spi_reset, + .hif_is_init = wilc_spi_is_init, }; diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c index 24e016a0dfa8..6ae5d82c6f99 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan.c +++ b/drivers/net/wireless/microchip/wilc1000/wlan.c @@ -1255,7 +1255,7 @@ void wilc_wlan_cleanup(struct net_device *dev) wilc->rx_buffer = NULL; kfree(wilc->tx_buffer); wilc->tx_buffer = NULL; - wilc->hif_func->hif_deinit(NULL); + wilc->hif_func->hif_deinit(wilc); } static int wilc_wlan_cfg_commit(struct wilc_vif *vif, int type, diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.h b/drivers/net/wireless/microchip/wilc1000/wlan.h index 150648b2c872..8b7c3d1034ec 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan.h +++ b/drivers/net/wireless/microchip/wilc1000/wlan.h @@ -374,6 +374,7 @@ struct wilc_hif_func { int (*enable_interrupt)(struct wilc *nic); void (*disable_interrupt)(struct wilc *nic); int (*hif_reset)(struct wilc *wilc); + bool (*hif_is_init)(struct wilc *wilc); }; #define WILC_MAX_CFG_FRAME_SIZE 1468 From patchwork Fri Apr 23 18:29:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 12221393 X-Patchwork-Delegate: kvalo@adurom.com 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,PDS_BAD_THREAD_QP_64,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 8405DC433B4 for ; Fri, 23 Apr 2021 18:29:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5D2EC61458 for ; Fri, 23 Apr 2021 18:29:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231400AbhDWSaa (ORCPT ); Fri, 23 Apr 2021 14:30:30 -0400 Received: from esa.microchip.iphmx.com ([68.232.154.123]:62525 "EHLO esa.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243716AbhDWSa1 (ORCPT ); Fri, 23 Apr 2021 14:30:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1619202590; x=1650738590; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=S3RycHLprh9FaSb6TfjD9tdJys04/BnUJd0/swp8ae0=; b=ylo1JmgMO0QYvwFKjZmLavM1Na4JJ4lNs7bfQrO/qp/ipaUV5XPsckv4 rkR0Rau9B3tAoAT0xPA15G9EsdHpcbkbY5iJnZRX4AkwfZ1zXLr/iaDNp d2XRjSdQzO6E2oo9Oekkoszml/qjqNPD7UWBf9I9ZFVPzzn3E6J7daXrx CIkiaQn2Q2cbIaoyzIReaqi91v2w9E/m+tzVbPL1EnL4duZN/AJVo5wwG AZICE9hLGLDbBlJzNdory1ber3D4IDb321Kqj0Ctwf1hPv6lhIlXLwRmM nLpuKbCgX69Xl4/S0ZxTgu+QLKFeNmE+M2S7YVE5lJKiaRwJi5uKhmEXI g==; IronPort-SDR: ND5Ke5BW32lwcMhCmftiNaBA8gUt0brjpzUjpEmenyGll3kE0vSZBEzjpgyxaOxZmx/sc7IejP O1xdJ6UoSBZ4bsSP9C3Agh5QpcyDMvOelYW47979kXkkwpdsJBXjHevEzkwVildz5RITfkpMDX jhmZEfr7j4Uv8CqO94JzwYXi+RkceMc5hcOshOrTgarRix4ZAS7wxtXRXDrWQy6GCDr7AwbCH7 1k17cbYLcKPu/1twpVnq8OWxdD48+16vBKPmV+aC8FuaVxj3/Pf84J2nmW253C6HwYujtBWCqd dBs= X-IronPort-AV: E=Sophos;i="5.82,246,1613458800"; d="scan'208";a="52310243" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 23 Apr 2021 11:29:50 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 23 Apr 2021 11:29:50 -0700 Received: from NAM02-DM3-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.2176.2 via Frontend Transport; Fri, 23 Apr 2021 11:29:49 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DKpJQCqJ6gWMOMKlXAu76lmi/qqtClG7ENdjzpBnAC3T6O/EwVVuo/AGNkhGxV4UAZ5ci4p98dsVimvgg2f/qJ623gy9SGzjDUrhJLRm2fiLkOPxGTAMnpGmeYeJnsn+mhw0JK4yt4qTDaHa15W6p3MW10qoO15IKwLhGemaevLRpov6Nc5YjREi9LrlwzZKNfPOsPYPEuZMBwJf0Se0EZ1kfvZh/Zjoc7ZVw37Fdm3fRWRs4Vneyct3GxqhVDvW8kTKMlIWs1yldTymmo8d0rrhebSoFErPInWPeFqIbc7rG+1cf8ZKWDMlDLmeOa5ugLX0gfXYi/yiG4zG+exEpg== 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=LXi3MkM6u13qPwJ/yDY/0n8D1DDqoxW+fknlF6NVNgQ=; b=RzN9Utwqr7EF9+wjlI8eHf8ZUbNso6GVZa0vEMrCV4drjxMmlf71b8RdpRd8hKv9bDRdaiQPbvuVkux1c+XSB+bmZJmeXLKn9pDOIVXFdgWluFtS8XFskN3EZXnNEWHtDu9qT7cXGqX9PKloZetV7bdM0M6oFSPAGd36Ln2r0P13ZD0bzGqZk5vuEH9o8dfXF9frWEZOoKnYHxVdWAmHpMrR8TOeKQgL+htlKqiLBDLk2wDz7Cq/Bw1VzKlIRM0M8X+v2uwbekhDO6qoushICfxp7ryOIlLCBFhHYPfmx1lWmdl9RpGeEsLilWvgEc+wz4nnfz7JPMQn/hDtP/lKlA== 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=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LXi3MkM6u13qPwJ/yDY/0n8D1DDqoxW+fknlF6NVNgQ=; b=Tvdh7Y+GbJu9qlB/XJ9mLb0297g9gt4wLBYrVnBCDTOkkiP0d9O+hsXVDi3VNpgMsl6hQf1trJtOAcJXctfjHNNLuFNutLidbKZhB/gcQ2TKiMCh+I+b0DHUs4kkMGkqPfV0XkdR5HSddB/6ftTXh9GyeQK458heFgO+YtZn8oA= Received: from SJ0PR11MB4943.namprd11.prod.outlook.com (2603:10b6:a03:2ad::17) by BYAPR11MB3318.namprd11.prod.outlook.com (2603:10b6:a03:7d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Fri, 23 Apr 2021 18:29:49 +0000 Received: from SJ0PR11MB4943.namprd11.prod.outlook.com ([fe80::5da7:92e6:d6c9:64b3]) by SJ0PR11MB4943.namprd11.prod.outlook.com ([fe80::5da7:92e6:d6c9:64b3%7]) with mapi id 15.20.4065.024; Fri, 23 Apr 2021 18:29:49 +0000 From: To: CC: , Subject: [PATCH 10/12] wilc1000: added initialized variable check before processing Thread-Topic: [PATCH 10/12] wilc1000: added initialized variable check before processing Thread-Index: AQHXOG6ks1bGRrdwpU+UhuTVuozaMw== Date: Fri, 23 Apr 2021 18:29:49 +0000 Message-ID: <20210423182925.5865-11-ajay.kathat@microchip.com> References: <20210423182925.5865-1-ajay.kathat@microchip.com> In-Reply-To: <20210423182925.5865-1-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 authentication-results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=microchip.com; x-originating-ip: [106.51.107.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 713272d6-e293-46de-028d-08d90685c753 x-ms-traffictypediagnostic: BYAPR11MB3318: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1247; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 0WGS20Gjy04VOnuLzioxjj3/iKU4H5W2+oQImGebmXYD+Y9fjTf8d494vxynDyPHrtS2IWCoN3Lrr/OXuYbm6qbhoJGYOmHoKoJiBBlx2pBLOh+fyYNMTI2OiyjpVeFoL44Sgk7Qytg6PBMTfpff12FWdab/uLA8GqICv1tcU26uQPC//Agn7kYIee4E88Vi0Tbv3zjhYwivr8nkwisvgzj+e9pDHL1YJn8WHbNCfsRYBrYlHpVjDT1b9cdb+rjtW5ZLPWeAdbU+Je6Y2MF/BYK7q0cBoKuKa4ma9x4xwGgAW18/wKUZZDpG8sm0QxXrRrMeGoPS600wGs+O9HFhuSws6j0YHCnqtW9NLtBPGpjl+FkrWZYl5WmI45CziCaD8NdjHbcnIGmoIXm99IXiLpvuAO2xrHaESPfshZyfiwm/+y2qyaV8HCoeKQWw9YBJwtmU5n8nB+45Ryul/qVYU1bVwDWQjrJkOcImxJMetO/OypL/wxybKgdBJ/0yhCL3sMwg9Z7nfJQprzbAwkPTH3GlZWY9dch3WE0XyEMeqONzSiUuEmvART6fPjYBLcRTxBgopqQ8v38sJHrU5uSIyWsmi3/abYdQZuUvUU+VgFA= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR11MB4943.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(376002)(136003)(39860400002)(346002)(366004)(8676002)(478600001)(55236004)(5660300002)(54906003)(6506007)(71200400001)(1076003)(4326008)(2616005)(6486002)(86362001)(316002)(107886003)(6916009)(66476007)(66446008)(186003)(66946007)(36756003)(122000001)(26005)(66556008)(91956017)(38100700002)(8936002)(64756008)(76116006)(6512007)(2906002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?iso-8859-1?q?LC/VNrLXsEFo+1p8heQ7tvBPT?= =?iso-8859-1?q?5UVDF6gKWePsZaMr/8uETAp0KgVMO1/TW8aKHWdZM8dXpJOAK6MfpmxcPH1F?= =?iso-8859-1?q?eE2hqTgrZzP8dJKSqAJpYMJFveGhUq90nyhpXOCQx+iWfUIDV8OqGoUpfMYm?= =?iso-8859-1?q?Bk2qnJCSM/osUK8dihxeqXwmX99h3ru360R+Mv8stCBsJ7rGs3D4+IVUATjD?= =?iso-8859-1?q?3rwUa1PT4xX7sxN1zGjEN0iaNAoZljSei14Fg+P7CrMy3ug2EdVsPsSvHeJE?= =?iso-8859-1?q?bvbCTxxzGLd5aaKvshNhU/RYW9qVcPjGL34wnnxROAWoX861blvCUwR5ftXL?= =?iso-8859-1?q?BpSp5RF7sg8KDwVxnF1IfJZ78coTH5tdV1UReW0gXw5vtGYRMHuLVwe/qPUP?= =?iso-8859-1?q?dKzgceKm3JgI+ibsNsPYjfKaVUcebswa69K4jICVuSO7Rf962HEvli7jSaSs?= =?iso-8859-1?q?WsYeRMjiK99p+lLvK4N97bi7LBsquOQwo5TKnPqJghjJqw15L4eXTJ2vKKjL?= =?iso-8859-1?q?0ss8dkCZozb3dQ86qotgMGsr9MlqNP4KnU/NnfGjRnnkgq8pwdHoqr0X91Pd?= =?iso-8859-1?q?MBG6K1noFqjY8ptir1tEfcyUDbpJsk65WMPEPUpy8HeFojjBfAE8XBOyUCM4?= =?iso-8859-1?q?TFfOORLTB3Uyn8QbbVQjG08quElgCnPZAAA7jF0uu0DXk0NQzN0QYELOijft?= =?iso-8859-1?q?FMBmqtsFg+qcVcC5ZiKUkbA9BSy0BLgwrKL+5vMQzPAO9tMfQgJG1h/Pzb1y?= =?iso-8859-1?q?Qdq/AdaIYlYTrrXvnxwc5G7w6k4H1fAKF71cjgC7JjG7XpI8ZY2uVrihZpE/?= =?iso-8859-1?q?jUj+00ynHbe4xOr/PReVTwS6Ai6BXcyaAjyFdfJ85LCJzZQqXCOqSfHKnIK4?= =?iso-8859-1?q?io6sS3iy7wzopcff/WsJnaEArUatEs/MK1HfnvcLxrbF5rDtAEmO86d/Rlzn?= =?iso-8859-1?q?ibG4GXBQtQ51OrSXce8wWrw90h5ZO5twIOmIC6jS9A+r4RfNZScNAJDK2IUv?= =?iso-8859-1?q?NA9xiI6VpHs63YrnlR/xIkhjfgd7OBv25hwSNgq+NGM0WOHK4A44lBkq0i44?= =?iso-8859-1?q?gz8UyReSHemSsDtaNsFI4DIL1aH1JzQjO8kBp/asPnzqvlshucj8Eylj4BSL?= =?iso-8859-1?q?TMlkJUpQMrdScbO3m8B7H0vf8jt/HBRsKzbk5avAG9wlkQYha58f9KBuR8Q9?= =?iso-8859-1?q?L/x33ZgD/ArW7AelGmnT11ER0Dhtm2CVoakg13/GNKudA/w4OVLyHQZgyiuh?= =?iso-8859-1?q?mGvVvtVQ5Ph+dEjVgU2uXz/MlX7/IS7qlkDOMj2GakopW7m9cq2WekHjrm5N?= =?iso-8859-1?q?nDJmtDavGbPZMLitlW74M2/yEkbdT76l/57bHgXHOMtnSDviozbN2AMRty/g?= =?iso-8859-1?q?dH+8MiiaCjGSvLB714sNA=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB4943.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 713272d6-e293-46de-028d-08d90685c753 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2021 18:29:49.3292 (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: f3IBu8NIU6VZnLNRg1sGn91DcKpkexHJL769Tr3jypNSd4D3S/csC0EnEEm6bjZ4QdbK6tSGUtl0CTgwTXWjYSG+KYon7to3xeI17jiyQgc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3318 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ajay Singh Added initialization success check before adding net/mgmt packet to Tx queue and processing wilc_get_statistics() command to FW. Signed-off-by: Ajay Singh --- drivers/net/wireless/microchip/wilc1000/cfg80211.c | 4 ++++ drivers/net/wireless/microchip/wilc1000/wlan.c | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/drivers/net/wireless/microchip/wilc1000/cfg80211.c b/drivers/net/wireless/microchip/wilc1000/cfg80211.c index 91a471f3b1c8..dc4bfe7be378 100644 --- a/drivers/net/wireless/microchip/wilc1000/cfg80211.c +++ b/drivers/net/wireless/microchip/wilc1000/cfg80211.c @@ -728,6 +728,7 @@ static int get_station(struct wiphy *wiphy, struct net_device *dev, { struct wilc_vif *vif = netdev_priv(dev); struct wilc_priv *priv = &vif->priv; + struct wilc *wilc = vif->wilc; u32 i = 0; u32 associatedsta = ~0; u32 inactive_time = 0; @@ -754,6 +755,9 @@ static int get_station(struct wiphy *wiphy, struct net_device *dev, } else if (vif->iftype == WILC_STATION_MODE) { struct rf_info stats; + if (!wilc->initialized) + return -EBUSY; + wilc_get_statistics(vif, &stats); sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL) | diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c index 6ae5d82c6f99..0e059b889fbd 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan.c +++ b/drivers/net/wireless/microchip/wilc1000/wlan.c @@ -427,6 +427,11 @@ int wilc_wlan_txq_add_net_pkt(struct net_device *dev, return 0; } + if (!wilc->initialized) { + tx_complete_fn(tx_data, 0); + return 0; + } + tqe = kmalloc(sizeof(*tqe), GFP_ATOMIC); if (!tqe) { @@ -476,6 +481,10 @@ int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer, return 0; } + if (!wilc->initialized) { + tx_complete_fn(priv, 0); + return 0; + } tqe = kmalloc(sizeof(*tqe), GFP_ATOMIC); if (!tqe) { From patchwork Fri Apr 23 18:29:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 12221403 X-Patchwork-Delegate: kvalo@adurom.com 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,PDS_BAD_THREAD_QP_64,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 E0D70C433B4 for ; Fri, 23 Apr 2021 18:29:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B195E613CB for ; Fri, 23 Apr 2021 18:29:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243723AbhDWSae (ORCPT ); Fri, 23 Apr 2021 14:30:34 -0400 Received: from esa.microchip.iphmx.com ([68.232.153.233]:3594 "EHLO esa.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243763AbhDWSab (ORCPT ); Fri, 23 Apr 2021 14:30:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1619202595; x=1650738595; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=qm71vc3tlF1M51gRNDOspdEz4hzegMwwe98vYnk2J1Y=; b=qFSE4dD1r+3hUjOtAB5pU2SPQu2V0NEobjtq3j6WaOVOYApMat4CnIfc GJ2uJ3OrdhW8P/Y7W38cq7WmRt7xVPhdNlgMvPguf+0/YHenrgg+oOvCe g3uZ6wztdF6TjHq3kgl6Bu5x9YfabtXtSKNUhSbE6NX747v5XzzMltmDq eg0aeSDTcRMjN/wMIf5Opv+o28ugKhXI1GqXBqBWp2r68fCng5lH6qxAk Dh5yTrVVnwZbgG1yLHekB4cUhA3WPTaWaHoXf57A31UWA2N//lJ7wrfFm LjHS/82nyXjX1BWq+Y5N1yZGjYBlEgZPUXT+KoNlsTxtXuqZ8eVx89uHA w==; IronPort-SDR: K+R8SPkzku9/vd638Rn0do9E5r+bbTRB2kBj8t+OSqGTxrKEeLKdDFnjC+D2hQdu4VT4NKkS3T 4Ba7xrBJPPr1iKFU2/JS4g/PUpmhKeBDZt2PCKr1juj0t8oLzQLrX3MNiKOA6sg6EIAP9HehFg 34L1W4xApYzILJFvje/UXBUb8OyQQmRo2TXOrtuPQn1m47IR61fxfaJ5QGOtRSRLXNKcnl4Sys lZnzbzOm0hiCtyptvu2xGH4+QcDtJiDJd1LyKhJ27C2Z65paZIwSqDMA3q01cdjQS1OxCRv69I 9F0= X-IronPort-AV: E=Sophos;i="5.82,246,1613458800"; d="scan'208";a="118174653" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 23 Apr 2021 11:29:54 -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.2176.2; Fri, 23 Apr 2021 11:29:50 -0700 Received: from NAM02-DM3-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.2176.2 via Frontend Transport; Fri, 23 Apr 2021 11:29:50 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UwzIKQZbTCtxqpuNHv20AX383MyqTyhbEq1zTz0t/fHWdgfkts24hhuPR3xSdy/ma51i5XGaTRigbQjxFweomXqIOSzJ1jZSWW/nNwUwAPKHl5FKWmgGnCT61OIohWfhJy+jadhFDlHW2Lq7bdt2wDST/7OBnTpO5uNGGtKc6hI4DbreqRXMoV5rK0/Lvj1EvhyOv3ud4tzwT82d6HwskAguwTRksQ77VY7hjqzFlH0hw4YyeJK060ygTENdJplxhT/bTaCfhRntM4HtQlytOYtqloNwrfA4Ybuen9bE0O+5nA2it5HYGQvtZ1Prv7syYrIClLEi3rWOS6AosWgDTw== 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=wtbF4jTB6xItvpq3WBA5J69Z4fhvvXpSER5zsClzpCw=; b=WeF2TGj5FapykIuPO14TOP2hwhHVQu042r6k1ev26qB2ohauF+DQdFpQ/H6wUcpLlNpfaMpJfCgYaxstlhasJzsr6BgOEkjUIvpR6chLxOFFoJFA9z92hnrB+bm6uAqTdkq7ABOmCa4DkG/TxssReNtlxM8Jsx4opTmRXRpNX0mW+2uXXUKg8DSfm8Im3pJbehKxPEwUEE1Cp8MIRqb67/fu9V96rV2+sGDz9uvxpvvz+1IqVLITj+xW6EZlzcdutdY6zRcRd04751R+ecFsMqm0iOzCbhqqDazJgGz87lIeLBQcEq3S/03vgNRbshDpT5s1kZEibBe4Vwx+lXECiw== 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=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wtbF4jTB6xItvpq3WBA5J69Z4fhvvXpSER5zsClzpCw=; b=l5u54P2SXe6+c7qr2MNyAq2rwgCX113xu0eAU9mL6jF7VUXDOnCyhG2U8szFLllN7MzqiicPpmyB5WMgr8nAUe/JGBOC8A5sfQUMkyifFFW4xehPP0b7e+xSzjMF7c/3o4AMR+Snmqqft4fG8rNZXxLvEsyg5isQM8xnlCVw6mw= Received: from SJ0PR11MB4943.namprd11.prod.outlook.com (2603:10b6:a03:2ad::17) by BYAPR11MB3318.namprd11.prod.outlook.com (2603:10b6:a03:7d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Fri, 23 Apr 2021 18:29:49 +0000 Received: from SJ0PR11MB4943.namprd11.prod.outlook.com ([fe80::5da7:92e6:d6c9:64b3]) by SJ0PR11MB4943.namprd11.prod.outlook.com ([fe80::5da7:92e6:d6c9:64b3%7]) with mapi id 15.20.4065.024; Fri, 23 Apr 2021 18:29:49 +0000 From: To: CC: , Subject: [PATCH 11/12] wilc1000: use write command after read in wilc_spi_sync_ext() Thread-Topic: [PATCH 11/12] wilc1000: use write command after read in wilc_spi_sync_ext() Thread-Index: AQHXOG6lNmP3/zddBk+/8QqBnnrwEA== Date: Fri, 23 Apr 2021 18:29:49 +0000 Message-ID: <20210423182925.5865-12-ajay.kathat@microchip.com> References: <20210423182925.5865-1-ajay.kathat@microchip.com> In-Reply-To: <20210423182925.5865-1-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 authentication-results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=microchip.com; x-originating-ip: [106.51.107.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b1356ac0-0180-4754-22ec-08d90685c7a4 x-ms-traffictypediagnostic: BYAPR11MB3318: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1247; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MT4ESFy78F+mUVGtdSHSfVTXAAwjaj4bF0nAZjFWTCPBnYTsJ7NYsBQc9g1Ndl8v8UpCF9KvxKvINEOoTE0jG1Qf2AOZOb14QQSezeVN2kIJwX6KGVYYY2W1VGpRUOm1t4wMiGFWdzBDNx99+tvhhU100L6aEXh8i7H7+3pNtQYfh3Csdw5+csoqcWA0T7rLQxmAeOoyKcQN4XK6loAEHr2PUwD8uqwhWzENPiEH8mrO3/EVt8P0qbVjjwGyuQG4pw7brGisa0rAj5Fxj+EDKRQGavDgg6BC0tbrIrJsp/g4CV+P4KFIuManWA7bBEtaiw0QqoEKuL1eLc5vF5cTSbOWcQCch/rNfmlW0E6Ps9u8ps0MKX//3izjoDhW+drbXR1EZVEW5C//aaUm/8zUO9pB7DWYavUrPWbSiJYPzw4iYC3ECc+uY8i8iUSdOzh8Btdf2bduZ7duSHO5pDls5wbMjNNHn2nSpb3Mkm2lcCeiP8wKJpoutFaOruHM/Jc65sRPjr9izSVcpwk/grJiKfjbPXRq9BZOQSnkUYRn4TXUghluB+37N+9GsJ0ZHkmUnPsfv2KdC/FUfgFq0BZBlhQxjL16nrpqQPs1ZLcvHLM= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR11MB4943.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(376002)(136003)(39860400002)(346002)(366004)(8676002)(478600001)(55236004)(5660300002)(54906003)(4744005)(6506007)(71200400001)(1076003)(4326008)(2616005)(6486002)(86362001)(316002)(107886003)(6916009)(66476007)(66446008)(186003)(66946007)(36756003)(122000001)(26005)(66556008)(91956017)(83380400001)(38100700002)(8936002)(64756008)(76116006)(6512007)(2906002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?iso-8859-1?q?y83WhNSZRf1Bskm9yiRFeTmMy?= =?iso-8859-1?q?kmftw+nOzm0Gl3XzZxKK0H18H03O3LgEjG6qaO9pewQmkjHpA1EaiBIKD2n+?= =?iso-8859-1?q?pZrmk/wAYc39+2fOIXigxxG2PzFWQ3jZ3RS1aaSjYaFSYp/AcjkazZtSu5QU?= =?iso-8859-1?q?lq8AsuHidjY6c5d954ID2OytPKNMkNCbvQH3khGsOp8jqaW72/YKTAY7FfCx?= =?iso-8859-1?q?7HMSwu8Gwe1TW+l5AuBPj/Uyc99aaeoIlgC/wSJwxUSAKbL+Zz8ARWYziLP8?= =?iso-8859-1?q?x/LMdvtpaEdr1g4IWV2QvgCHHR/jVecaOSEtblUfcWys4g5vnWXSD9PquBIW?= =?iso-8859-1?q?tU84hLvkFtJXD227FTvyUQYorouTemhcJ/g1aLbg7tnLDrqCigK37TUR3fxM?= =?iso-8859-1?q?pSCoOuo5Pe5pdPqkXzshqZCuihFC4a+4osHrovzHPDiClJ0j9K6GyL2gJxDt?= =?iso-8859-1?q?WVCPOjJXrpwR+AqQE6qFdRqWh5CCFElDuEsFkbQ+oDKfaIlL+0BYHe4QDe8v?= =?iso-8859-1?q?NnU308MwUyUvc0WJHZBiS25yxqkThpW6gVUV5xhF24nShiz/hcF8pomjjzYI?= =?iso-8859-1?q?McNvtpRiH93cwKzcyGV14Y33lWZphVCDWmbYc7/xseAERP42hbQR7U5V099H?= =?iso-8859-1?q?fRwIksj21doqLqb0PeJPS0RJznXeiRkIHCQxkL26GDGkgUKhQBf8N7wLHzUY?= =?iso-8859-1?q?w+Cwc2qG3Y3K9MxwzcS29XEO3uUwlS4CZjyTdlu11efeu7O1D/060dcS0LR5?= =?iso-8859-1?q?RQfPO0kFa0XNr/Z2SEWUuMN0EaRNDIcDtJsc3BLLsz1Lv+wNE4o9Gopiy3K/?= =?iso-8859-1?q?+kURQdGvba2Y4oJRCIypodY8PfHh0qQrvHEYdcmjuy2iyeNmNpXuba0InlYK?= =?iso-8859-1?q?GB3xEHjX1A/pW9Z1hc6wtUVgYwNopa2jfYn5l60k3eikEbmkFyDM6ZzoQQ6b?= =?iso-8859-1?q?atDhXZF5v7cIS7uvIBKeMGvyj6yeHn6Wg/vaY1Jp4b8G7dZn1Kh3ybI13UXi?= =?iso-8859-1?q?NkiCLFhpuVjRqeQIp63n0vamhrdJfYG8eeL7mjQ9/EtOJAVJOqpyz8jO9E26?= =?iso-8859-1?q?KkUngE7yqr8asuD5U5aFZwa8dteXQBPbo3eUbYygb4nrBYMvG9EpY/YOMt3+?= =?iso-8859-1?q?Y6z/k6BexUwOyqv0Sa72WdibAi8gClKCxvNHFEOtQjgpmS8SeFCWMmx6vIut?= =?iso-8859-1?q?JPBaEQU0csYyBm0bktGIfHbISVn4MgiiRd2sewQwHmMvnl1iiuKnhWNl5qZM?= =?iso-8859-1?q?SK0UTqlY8AbLWG8LW4VD04RqXlmCIj+cGUG52I7zd70bLjeNPsfmv9kmbPi9?= =?iso-8859-1?q?r9hGhxHpU/kJ+ckECYgHr4YTKgRGlFpJW9JIiLjQNYqDUse0kATirbv9wZOR?= =?iso-8859-1?q?bxMXZ3OdrBxAEl4k5xM0g=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB4943.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b1356ac0-0180-4754-22ec-08d90685c7a4 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2021 18:29:49.8410 (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: +wh9p9E2/TW2CGqkkdR79lUaJGjS4rvP7/41ofGn2g0Qnr1W91f850xx81cWOUBx/yr2ml2U4N8soDpxJ/tJpqnCFb82A78yIuVQIhNVmHo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3318 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ajay Singh Use write command instead of read command to have correct sequence of reg read followed by write operation. Signed-off-by: Ajay Singh --- drivers/net/wireless/microchip/wilc1000/spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/microchip/wilc1000/spi.c b/drivers/net/wireless/microchip/wilc1000/spi.c index 8e88986db9a4..1ab0b6dd0288 100644 --- a/drivers/net/wireless/microchip/wilc1000/spi.c +++ b/drivers/net/wireless/microchip/wilc1000/spi.c @@ -1170,7 +1170,7 @@ static int wilc_spi_sync_ext(struct wilc *wilc, int nint) for (i = 0; (i < 3) && (nint > 0); i++, nint--) reg |= BIT(i); - ret = wilc_spi_read_reg(wilc, WILC_INTR2_ENABLE, ®); + ret = wilc_spi_write_reg(wilc, WILC_INTR2_ENABLE, reg); if (ret) { dev_err(&spi->dev, "Failed write reg (%08x)...\n", WILC_INTR2_ENABLE); From patchwork Fri Apr 23 18:29:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 12221405 X-Patchwork-Delegate: kvalo@adurom.com 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,PDS_BAD_THREAD_QP_64,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 68EE7C43460 for ; Fri, 23 Apr 2021 18:29:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3A99A613CC for ; Fri, 23 Apr 2021 18:29:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243770AbhDWSaf (ORCPT ); Fri, 23 Apr 2021 14:30:35 -0400 Received: from esa.microchip.iphmx.com ([68.232.153.233]:3592 "EHLO esa.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243642AbhDWSab (ORCPT ); Fri, 23 Apr 2021 14:30:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1619202595; x=1650738595; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=lhpmgexJoYr2rv6AZzfcPYi87Iirgl+9xiuWQ8Y4rxY=; b=TLv0q0r5naosbR0lfyEqneYA6vpI+KlSdwzpCtCRUSqh6c/fL48gJ3J2 eGGaSOrMgPWoT2ohrWqL08qVqxk4QlVhRvK6gNeuqJwhbxe03zy0kq6OS NKOw/TggIuFl2W//7njXoACgrFg7a7qvYDPpZ7v7RL1ROXVUXCF9lqjZ5 2zjgSnWQZle8FvNET0KQGXiASXKt8UrQzh3TxKTPzJeOGDccMkVtK+qTw b21rF8e8Uf5tlF8IolXRNyBzbH5YNgijrpFqiZCxgD8jXFlUr6Z2QMSoW ImFoims42qSUasuDWVPkV6c6ETAaJj+RvFLoIsmUfTrzWqa0xgLRew7Q4 A==; IronPort-SDR: vzUwRPeVlHyh0yYcSjFc+DFYTu25TvvsiE8zq4BaRWBo++0t1Psof2LTZg4oTKcStbJQa7I8wF 59BMVeQGYCmqR01iDy6bG61JeUkkcSXBeP1I7hLZaeHHTGw5OgnkDEyNaAZMQRQP7UcrN6+wBk tTVH11THR+1GTGy8ChMoLeL8YYylktNGm+xfMKGcYjq0EsqRmq8m8YOxMWi8L+dekL0RZnNO4G A944OIlsVBCVf/Ec5t1ZtcGtKCWXEhd8z0/ROwmze2r0xQ8mc6yg0OaGX813hAecrAz3Mp2PLJ C7o= X-IronPort-AV: E=Sophos;i="5.82,246,1613458800"; d="scan'208";a="118174654" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 23 Apr 2021 11:29:54 -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.2176.2; Fri, 23 Apr 2021 11:29:51 -0700 Received: from NAM02-DM3-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.2176.2 via Frontend Transport; Fri, 23 Apr 2021 11:29:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RMPGDdeVsNGw/qE/SZ5REJF/h8GOH+DW65GzmGn48FFZdYJ+9krLi+OVFcEpVMnYswQRPELGLMcKwiztv1DdxBDGmFIdwW8YEX9fIew69TxjmFeWvIiLDL9Qn3E7fWg3CNJ5f4d811zQLXjPr8WJzJf2e7XbhVTRlxa4vI+jNzXfPAq7UYaSBGwzt/U9JK525xc26InHyMI3rXAN9FQcD7rWYMdbVhjCf27tDgSKSIquTuGmT7BxdsPAGqZUjfbsyGu4sLGiMuOqBkB9ZCd6HxEz6b+2SKxBxZu/oDBAvr1qVlm5XigjvrzxhsGGzMchSYu4LJPjqCa92QXNrymVOA== 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=MSeRLMci2TZMfwUcHoWkTFGhUK+ab4S77qCj1mwxtPE=; b=NeIAjJUty7JtjuLKT2agMa4HVRHEmBCCtkICd+s75/QEH8yDtmxfOdT+FTWce/fMFbI/GQS55PFKVTtc2au9a4dNPA+3GtMlyN20TYO6tm7ty29ilZBOSJZpdoqmyjz6/O4/Z5lL+WSkLmC7vxxSX/PZE/rceShzAzFo8SR4XVRAoupNCvNSNucDrnAHcecTfAIyReY6ZGWa6GZvrrTCmJ0qnlLi4RdFidN1SWo+V2t5JJNVbboGsTO4ypU9/FHGy24jvE9AmY4bGL3LywQnrzSAS2uVnokfPyZgQBnIchjshgZ6NZzqC3sWMddZL8PZBL07aIYNakdJ4T/NpmGOHA== 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=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MSeRLMci2TZMfwUcHoWkTFGhUK+ab4S77qCj1mwxtPE=; b=OizuwQBkER0PS4X9AYmxPNceCI3J3DoRWqdjfBoXkZOodOHOqarKI44q8RZfez9dbBT5XW/GG95BG0NIqmwaln24h1X3pmAEj8WLRVPwmj6GWiGtYUkQWbIGVCPsD1+jWwqf1o9bifzTMr4VJPr2ATf5fbPJ97CY8ODtP1XbuRM= Received: from SJ0PR11MB4943.namprd11.prod.outlook.com (2603:10b6:a03:2ad::17) by BYAPR11MB3318.namprd11.prod.outlook.com (2603:10b6:a03:7d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Fri, 23 Apr 2021 18:29:50 +0000 Received: from SJ0PR11MB4943.namprd11.prod.outlook.com ([fe80::5da7:92e6:d6c9:64b3]) by SJ0PR11MB4943.namprd11.prod.outlook.com ([fe80::5da7:92e6:d6c9:64b3%7]) with mapi id 15.20.4065.024; Fri, 23 Apr 2021 18:29:50 +0000 From: To: CC: , Subject: [PATCH 12/12] wilc1000: increase WILC_CFG_PKTS_TIMEOUT timeout value Thread-Topic: [PATCH 12/12] wilc1000: increase WILC_CFG_PKTS_TIMEOUT timeout value Thread-Index: AQHXOG6lkreKSwAGb0WB+JwDkyBpuQ== Date: Fri, 23 Apr 2021 18:29:50 +0000 Message-ID: <20210423182925.5865-13-ajay.kathat@microchip.com> References: <20210423182925.5865-1-ajay.kathat@microchip.com> In-Reply-To: <20210423182925.5865-1-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 authentication-results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=microchip.com; x-originating-ip: [106.51.107.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7085c3dc-d0ef-4b22-a634-08d90685c81f x-ms-traffictypediagnostic: BYAPR11MB3318: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3044; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: q2xgeK2i7o/aMEKmOD1axBOK3WwIj6y+4mB/0FCgVO1+7CNpibotClVakhV0pHQJyjHFDNO6O97qwywm6D2ADVcwzK28SJLw1Ny24QlIZnBu3l31ttl2HvGKPmuMyoaznIPCqdFin8XvMAFamOp5G5d7cFs50Q9DLAtl63bMb+TCNvEzHHl6DArG82SAEU1iMmdPyVbC6AquvfdHy0oB4F8hLB1pcmN3eWFXUF1z9gUAM+M5RIAQF4Um8keaF8ICUDKhGcHU4wSTEp+M+X+GM8csZm664AJPABQE5omWiGOhjUf55xy3GMsGoq/ILQ27nauZldlJywgLkFg+QDlA4+9FZPyGwhVkpmKGxym9c5jFj9xi+K609rVwMk81P2m76MzffIti713mUOaP8zXmP9Mce7QqdAfiG5vhRIsEvJ5AgtjWzChAG0d++lQH09lJgfFvXTzgGEi58YVI5nrXqF4k/riGyWJ+ryHuf6gRAAA9AeFPTZ6eHpprbnPstsR3CNgSOPyUEyNnoNY24/VjwpCTt03tpb3XdPIvjIxmjQ2a1C8qnHd7Wp4Lg4we8xjIMwDTjvjPe9KYLLhNsaI4YLMR0AoZCAKH0CZl4XzLU/A= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR11MB4943.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(376002)(136003)(39860400002)(346002)(366004)(8676002)(478600001)(55236004)(5660300002)(54906003)(4744005)(6506007)(71200400001)(1076003)(4326008)(2616005)(6486002)(86362001)(316002)(107886003)(6916009)(66476007)(66446008)(186003)(66946007)(36756003)(122000001)(26005)(66556008)(91956017)(83380400001)(38100700002)(8936002)(64756008)(76116006)(6512007)(2906002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?iso-8859-1?q?YUUKfbn/Mtn9V7sJlZowcIp8b?= =?iso-8859-1?q?81j/hy12QV/hp2Ta5NGe8H6pyQ1j5JPERDqXzWbx2thSaEOL4svJn2xTQq2L?= =?iso-8859-1?q?aOHEdWHV5fvumPWRC6P0YHUS9BPCYoXjCIVI7R9UgR41Zjxe12RF+3rzX08d?= =?iso-8859-1?q?0vtqpv+k6kwBO3euF8l6QZxRXvXoEp9hxFoN8cttXFgRMwvq7vnTwC/Ve5P1?= =?iso-8859-1?q?pAmZdJIUQb8UznpDqzUqv5HQf5WVKEyYJdqz0I8Mklne2sBL/kZgsI96FRhv?= =?iso-8859-1?q?NNix1u0eP4kh+ktrOpAh0NfmXYfXacJGxb6aGFvLzOeT9tdKNNT0xfE0/SIT?= =?iso-8859-1?q?c+3Vsohta3PX+r9/XPlmH/EjfUK9wYMDzoUjjMGA0Qit9gZds65tm42G+T4l?= =?iso-8859-1?q?s6qVNf8aJdbmv+ilNC84n+ZlWhx1regI692X08RAC+3R+UydyJ+tlcqI53y/?= =?iso-8859-1?q?VIJ8JFlq0HRb236clX6ESCJQhJ1LsYX6WdLkUxFAkl7jo/EQqUVaKMtyDpsE?= =?iso-8859-1?q?q9Swgopmbdg+un343GObayDY6RMuGHr9MVJ05BDU+WRFzb9H3bbEieZXqXxn?= =?iso-8859-1?q?kZU7xMt/h5uIFWoRMqHaD2Bk3gaXpKP6fG21gW0dH3586eTF+ullO2pHHXL+?= =?iso-8859-1?q?KrHLwXMH0QlbQvMaEuJNSib3M7qH0Z/oQHKCIsnEGy/8RJCYcgEKcs3euUcn?= =?iso-8859-1?q?Yi367mK2VL5UnoVHJdam/syLP7dqkYblDFEqEgsxnlD+h5rZVq5od6wPZxxW?= =?iso-8859-1?q?sVZdFpqcN7hDys1LaoMb+Md/ezexWBGLazvg6Gh6l+FrqiW/ty1S9nPxgW2K?= =?iso-8859-1?q?4cZxobJKPX8mPwCn2eYgKVisry4ZYiCgsZm7YEnKWC7Q+C5vA6Kj+LTCDQwm?= =?iso-8859-1?q?uO5V4thCVXqGV6reNXm59D2tyZsFqIs8j3OWrtcEmei1l5Zpr1/U/wlerxIz?= =?iso-8859-1?q?UajUPkXG3zQjv+M82dnzjILWqMRjWjaS3CxedHl8iMioATviDS53KJkO+eAS?= =?iso-8859-1?q?hbJTDBaZd+lyBNDWgUe9qX3BbT8dkZ/ke/xtGjhqDQG8DdCJlkbe9i0WJllu?= =?iso-8859-1?q?onTm0SBGb/DZP1ILem1lp/O5CYjuf3Adyj7ZKegUCn3YC5i0Hc+ULTiw056z?= =?iso-8859-1?q?N+6WQrksAmpP2yXEeY7oPcAVlqGIVbIZifSIHxs8La7l2vhwkFa54ijU/KDm?= =?iso-8859-1?q?YO3aea4dWdAiS/olGySztis9RYZV/wCAqwAkhvu4Edzy/pLwdFJgeOkBLJpN?= =?iso-8859-1?q?15EsWMoBa/LBJEHudmgHZI446g5FlbeZ4eGQb1WSiwZtyrDpcUN+vsVgfqty?= =?iso-8859-1?q?y44jGbyg0vPcnfpXmW7MDURXCzhPozUMxGHbKmABuzAFJB2vqpFrB0i/h1zQ?= =?iso-8859-1?q?SDXiQnuX6Kj3WwCkm7tFQ=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB4943.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7085c3dc-d0ef-4b22-a634-08d90685c81f X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2021 18:29:50.6475 (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: MHr+css+gidYuFgY0fms6BBoJNyNdqekpBlHfYftV//AUDkLxVXrg1HwQpn+moVtJ0zoRG09Tc8EMb3ls7B8Hla8iDIsNJpdRSRDgJABMlg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3318 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ajay Singh Increase duration for WID config response timeout to have enough wait for the response message. Signed-off-by: Ajay Singh --- drivers/net/wireless/microchip/wilc1000/wlan.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.h b/drivers/net/wireless/microchip/wilc1000/wlan.h index 8b7c3d1034ec..cb709d3b91df 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan.h +++ b/drivers/net/wireless/microchip/wilc1000/wlan.h @@ -302,7 +302,7 @@ #define ENABLE_RX_VMM (SEL_VMM_TBL1 | EN_VMM) #define ENABLE_TX_VMM (SEL_VMM_TBL0 | EN_VMM) /* time for expiring the completion of cfg packets */ -#define WILC_CFG_PKTS_TIMEOUT msecs_to_jiffies(2000) +#define WILC_CFG_PKTS_TIMEOUT msecs_to_jiffies(3000) #define IS_MANAGMEMENT 0x100 #define IS_MANAGMEMENT_CALLBACK 0x080