From patchwork Mon Feb 4 06:33:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siva Rebbagondla X-Patchwork-Id: 10794977 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CA312922 for ; Mon, 4 Feb 2019 06:33:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B54391FFD8 for ; Mon, 4 Feb 2019 06:33:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A67F1212D8; Mon, 4 Feb 2019 06:33:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 525411FFD8 for ; Mon, 4 Feb 2019 06:33:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726489AbfBDGdw (ORCPT ); Mon, 4 Feb 2019 01:33:52 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:43872 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725903AbfBDGdw (ORCPT ); Mon, 4 Feb 2019 01:33:52 -0500 Received: by mail-pg1-f193.google.com with SMTP id v28so5836238pgk.10 for ; Sun, 03 Feb 2019 22:33:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=N962v1NYYO1siutE7EpJRXlUasnp8tyEzinNsSx9Z9I=; b=XRU8yBlhKQoch4sQXyOwr/Tq6FtuPbFvHkAk54/GZSZA3lEc6DUUF38PugAMm/T/r2 6SeXixbzoFBfgTDb6uDM0SWib7W9z3XugoZs/vLhQOnFMY6OjyRkmGHYjIMk3Ig6ftIH Aaw5bf5IgpPhSfOgH3KiRS9FYB0u8PTaxAgy7HV/2CXTzHSnUA0Gwu1M6y3mAnzM5F0c /vR+hIkNhiXLqZ3eX15IBgKq0E6Xzs4MmJh8h2xU/5qcaXJ+Quun2cumWK7NVSGDLV++ w9csbyC09Nv/w9Ut2tY0i+1TOhurNEAFlyJn6732TGn+LS38HdWcZ5vhevuLyhzyE5id 43Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=N962v1NYYO1siutE7EpJRXlUasnp8tyEzinNsSx9Z9I=; b=NW5MIR965MjYvkkbkZzVNKd/3Sz5CQLVxUKfTroSEWc9/O4eV2geY6Q3N8xp9omCe7 lNFzfTt3Ju2iLsNlWTzf+E143+rQ+9hZYvlWUDO9QIWx7kRJfyd1z7Y1A2qaDIxScQB5 U6tgI69YXRdr9nzdmeY8i2FwJ0p4ycAZVEcBVyhRIrWOW5TbD3Hnmf1nJHGybcQKf3lc teSYZJYBsLkBrklKd/gRaVhqGU6ImMvHJs/wNZSuPTzxuAmRGifc52Q56+xMcOZ2frNB PUWpnDKg/SyH+43tBVV+Xy4B9pNSmrk851v6tgE6BQZJ54qlCPi+4tvL94sWFJ6/aJkX Ah2g== X-Gm-Message-State: AHQUAuY/WKCBGBPtmmoK5QOYsf/b60WxB+gOIuZ94AeYtuarhiapNAwc aPQUo1uPuxvqCDuaLbBpjlQ= X-Google-Smtp-Source: AHgI3IbiS45oVh9C83JvO2XI1L8d1a+NI3VSLkxy0HAn+W4VjzbyStRpnERTtvxYGOAdUviRaWEfFg== X-Received: by 2002:a63:160d:: with SMTP id w13mr12079272pgl.43.1549262030919; Sun, 03 Feb 2019 22:33:50 -0800 (PST) Received: from cpu459.localdomain ([27.59.252.63]) by smtp.gmail.com with ESMTPSA id t21sm20240438pgg.24.2019.02.03.22.33.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Feb 2019 22:33:50 -0800 (PST) From: Siva Rebbagondla To: Kalle Valo Cc: linux-wireless@vger.kernel.org, rishikesh.basu@redpinesignals.com, siva.rebbagondla@redpinesignals.com, krishna.pedda@redpinesignals.com, amitkarwar@gmail.com Subject: [v3 1/5] rsi: Add debug support for wowlan wakeup confirmation Date: Mon, 4 Feb 2019 12:03:25 +0530 Message-Id: <1549262009-8766-2-git-send-email-siva8118@gmail.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1549262009-8766-1-git-send-email-siva8118@gmail.com> References: <1549262009-8766-1-git-send-email-siva8118@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Siva Rebbagondla When a wowlan magic-packet has received to wake up the device, currently driver is not taking care of what kind of packet has received. This patch will add debug support for wakeup reason in driver. Signed-off-by: Siva Rebbagondla --- drivers/net/wireless/rsi/rsi_91x_mgmt.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/net/wireless/rsi/rsi_91x_mgmt.c b/drivers/net/wireless/rsi/rsi_91x_mgmt.c index 4042414..4c2c776 100644 --- a/drivers/net/wireless/rsi/rsi_91x_mgmt.c +++ b/drivers/net/wireless/rsi/rsi_91x_mgmt.c @@ -2003,6 +2003,35 @@ int rsi_mgmt_pkt_recv(struct rsi_common *common, u8 *msg) return -1; rsi_send_beacon(common); break; + case WOWLAN_WAKEUP_REASON: + rsi_dbg(ERR_ZONE, "\n\nWakeup Type: %x\n", msg[15]); + switch (msg[15]) { + case RSI_UNICAST_MAGIC_PKT: + rsi_dbg(ERR_ZONE, + "*** Wakeup for Unicast magic packet ***\n"); + break; + case RSI_BROADCAST_MAGICPKT: + rsi_dbg(ERR_ZONE, + "*** Wakeup for Broadcast magic packet ***\n"); + break; + case RSI_EAPOL_PKT: + rsi_dbg(ERR_ZONE, + "*** Wakeup for GTK renewal ***\n"); + break; + case RSI_DISCONNECT_PKT: + rsi_dbg(ERR_ZONE, + "*** Wakeup for Disconnect ***\n"); + break; + case RSI_HW_BMISS_PKT: + rsi_dbg(ERR_ZONE, + "*** Wakeup for HW Beacon miss ***\n"); + break; + default: + rsi_dbg(ERR_ZONE, + "##### Un-intentional Wakeup #####\n"); + break; + } + break; case RX_DOT11_MGMT: return rsi_mgmt_pkt_to_core(common, msg, msg_len); default: From patchwork Mon Feb 4 06:33:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siva Rebbagondla X-Patchwork-Id: 10794981 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8DCFB746 for ; Mon, 4 Feb 2019 06:34:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 789FA1FFD8 for ; Mon, 4 Feb 2019 06:34:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C5B021FAD; Mon, 4 Feb 2019 06:34:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC9F31FFD8 for ; Mon, 4 Feb 2019 06:33:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726716AbfBDGd4 (ORCPT ); Mon, 4 Feb 2019 01:33:56 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:40588 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725903AbfBDGdz (ORCPT ); Mon, 4 Feb 2019 01:33:55 -0500 Received: by mail-pg1-f193.google.com with SMTP id z10so5838694pgp.7 for ; Sun, 03 Feb 2019 22:33:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ueHLsE/JFrX5xf26D7R38A2Ik+NTkR/KFj4XZmiWrTQ=; b=Cgy8k7exju3TTVy9Hb00q+9IjJipMOEIU7e6Wy98Ze05mSmHzDz3pu4jd/upLGssWT icLh802dDLIHN6XCpOB2PCsK+SgJ5hoGJw5uRpelSqcoGiht+VZIdxAQnBnDEobJBXnQ 4ajXao72vMWI/lmvj83Fay4/AnFXsFacTpxd/IOYk9RjXvvrW/LWQMvQipVF/9V2XHvi pHrx6UHu67stBSfXi7prqutYubEGSgyDGWGRvcFRHEPG880qrq2RljbBUAulMCXsydWQ Xgig+uJkKnnB/t1DVXQq7vBxnPefzMCUchv0j3c++e3bup8XzmugNMVBfhy/7mf5BYTP pdGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ueHLsE/JFrX5xf26D7R38A2Ik+NTkR/KFj4XZmiWrTQ=; b=BG6es8Z/o2vzP87udFDm/AqatSxiZNDZEEi5IVekYmBX0hF4Mupc/AuVnYMuhhhgVs WPcTsdsLc1tIgO4IIsYdzwXjo9bOqPFP+bAoFSYBweAff13Kv+eOle01AWM9eWxKGf1L ZqIkMoIhxFWg7/mz/ThejoYX+q5lSTlKzmCrf4j9SgRpI/UVAMYDyAqY1KoluJtByEC5 tvcfsrh2Smd2y/OUsW5Tdy6INsOcGwUkv0XeLIyKLDjc0LQFd0Xxw2iPog/Ue/y3KeyS twE2DrWf7TXVWmjPlm7+rMOw7aOhnuzdObj7BXAGEnILL5NZFC3TCzmQhc/lrRMyN/Oc hJ8A== X-Gm-Message-State: AHQUAuZybfsJideQmsjv2r4YAIVY1yMgga3JsWqxFAVu+X0kFObz1rUN rWbKD7IrtXZf2F4w6DXGGYM= X-Google-Smtp-Source: AHgI3Ib1VUaUgdJNkKCayQhJm6eZ8eiO924M/d6h+RLPj3FKFoNZ47e4Q65hnUMONBR5GejWca5MEw== X-Received: by 2002:a65:64d6:: with SMTP id t22mr11647458pgv.52.1549262034673; Sun, 03 Feb 2019 22:33:54 -0800 (PST) Received: from cpu459.localdomain ([27.59.252.63]) by smtp.gmail.com with ESMTPSA id t21sm20240438pgg.24.2019.02.03.22.33.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Feb 2019 22:33:54 -0800 (PST) From: Siva Rebbagondla To: Kalle Valo Cc: linux-wireless@vger.kernel.org, rishikesh.basu@redpinesignals.com, siva.rebbagondla@redpinesignals.com, krishna.pedda@redpinesignals.com, amitkarwar@gmail.com Subject: [v3 2/5] rsi: add hci detach for hibernation and poweroff Date: Mon, 4 Feb 2019 12:03:26 +0530 Message-Id: <1549262009-8766-3-git-send-email-siva8118@gmail.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1549262009-8766-1-git-send-email-siva8118@gmail.com> References: <1549262009-8766-1-git-send-email-siva8118@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Siva Rebbagondla As we missed to detach HCI, while entering power off or hibernation, an extra hci interface gets created whenever system is woken up, to avoid this we added hci_detach() in rsi_disconnect(), rsi_freeze(), and rsi_shutdown() functions which are invoked for these tests. This patch fixes the issue Signed-off-by: Siva Rebbagondla --- drivers/net/wireless/rsi/rsi_91x_sdio.c | 18 ++++++++++++++++++ drivers/net/wireless/rsi/rsi_91x_usb.c | 7 +++++++ 2 files changed, 25 insertions(+) diff --git a/drivers/net/wireless/rsi/rsi_91x_sdio.c b/drivers/net/wireless/rsi/rsi_91x_sdio.c index b412b65e..9a3bb0d 100644 --- a/drivers/net/wireless/rsi/rsi_91x_sdio.c +++ b/drivers/net/wireless/rsi/rsi_91x_sdio.c @@ -1132,6 +1132,12 @@ static void rsi_disconnect(struct sdio_func *pfunction) rsi_mac80211_detach(adapter); mdelay(10); + if (IS_ENABLED(CONFIG_RSI_COEX) && adapter->priv->coex_mode > 1 && + adapter->priv->bt_adapter) { + rsi_bt_ops.detach(adapter->priv->bt_adapter); + adapter->priv->bt_adapter = NULL; + } + /* Reset Chip */ rsi_reset_chip(adapter); @@ -1308,6 +1314,12 @@ static int rsi_freeze(struct device *dev) rsi_dbg(ERR_ZONE, "##### Device can not wake up through WLAN\n"); + if (IS_ENABLED(CONFIG_RSI_COEX) && common->coex_mode > 1 && + common->bt_adapter) { + rsi_bt_ops.detach(common->bt_adapter); + common->bt_adapter = NULL; + } + ret = rsi_sdio_disable_interrupts(pfunction); if (sdev->write_fail) @@ -1355,6 +1367,12 @@ static void rsi_shutdown(struct device *dev) if (rsi_config_wowlan(adapter, wowlan)) rsi_dbg(ERR_ZONE, "Failed to configure WoWLAN\n"); + if (IS_ENABLED(CONFIG_RSI_COEX) && adapter->priv->coex_mode > 1 && + adapter->priv->bt_adapter) { + rsi_bt_ops.detach(adapter->priv->bt_adapter); + adapter->priv->bt_adapter = NULL; + } + rsi_sdio_disable_interrupts(sdev->pfunction); if (sdev->write_fail) diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c index f360690..d31f9cd 100644 --- a/drivers/net/wireless/rsi/rsi_91x_usb.c +++ b/drivers/net/wireless/rsi/rsi_91x_usb.c @@ -816,6 +816,13 @@ static void rsi_disconnect(struct usb_interface *pfunction) return; rsi_mac80211_detach(adapter); + + if (IS_ENABLED(CONFIG_RSI_COEX) && adapter->priv->coex_mode > 1 && + adapter->priv->bt_adapter) { + rsi_bt_ops.detach(adapter->priv->bt_adapter); + adapter->priv->bt_adapter = NULL; + } + rsi_reset_card(adapter); rsi_deinit_usb_interface(adapter); rsi_91x_deinit(adapter); From patchwork Mon Feb 4 06:33:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siva Rebbagondla X-Patchwork-Id: 10794979 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C9DAF922 for ; Mon, 4 Feb 2019 06:34:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B721B20950 for ; Mon, 4 Feb 2019 06:34:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA0942228E; Mon, 4 Feb 2019 06:34:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 56AC220950 for ; Mon, 4 Feb 2019 06:34:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726727AbfBDGd7 (ORCPT ); Mon, 4 Feb 2019 01:33:59 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:33323 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725903AbfBDGd7 (ORCPT ); Mon, 4 Feb 2019 01:33:59 -0500 Received: by mail-pg1-f195.google.com with SMTP id z11so5858908pgu.0 for ; Sun, 03 Feb 2019 22:33:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=b1A3SSSDbacjmzYcSWgZVrdshnUClX93HmbOH70KG3w=; b=KlkHpbQebFjzZYlBbdgmWaYPILKnX7OYshjdosAPyBAVH3uGExRrW/JUkjgp+hMCUe tLo7J/YC6anK606qxalYquLJlN1jvpsc7G6zkvkjhu0V/qjWRcBQLPZGPHT6mGYzQnGg Qpqmjpf+L3h+unS7aFBREYF7VrD8xhKkLnaq6mj5KrHmS0kBOfLuMAF49X8gqPVm2BaP 62mFvKffR6O+pPyfkfThChrEO9Gk2FbVQEJClOe5FFMxpkvTPK5XqLacE3VNruztOOW0 +mx0B0yFd7dhq0RRmyKrVgIpJoFCNbVhpQN64ALbreb6UO3dVuV6AqufQiBxjgFYf0WN zY2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=b1A3SSSDbacjmzYcSWgZVrdshnUClX93HmbOH70KG3w=; b=MSJmejxsOR7qPFTYrsw3MSUUOSKDPtuPalMoO/6RL3cjyRxmVXp7nniVQpT8+FdANt XLNbEUAfml3zkRhJACcOSBB1mRQkrgmN4znfYpTIV4euMNXDTv/RyATsnYBwcy/c5SFF 9mx3+upaq0t/k3b16AmVbBUVgq06cMs6FTqLBfn5mRcS6W9Q6h3iz2AiVoEa7dooqJ1V 29B1tXf+6zHG7BrtE++2ZhlYA7Jgws052Nf8goOSItcQM59tB0Hy0u3+wQBbnGZhDYa4 t9K7tz4EHl2LBW5rrvaUKsMtqPkpuVJ0oYI8pKy+hcPo7MIOFNjUMvmebqvRo9bLm+Zq LLYg== X-Gm-Message-State: AJcUukfq5ZvNi1B+/wvLZVwcLBQyQgSDkTvAe2oeL0G39/9tRJIDdQrh iix8mVXDRKeVfhCMFa3GtSA= X-Google-Smtp-Source: ALg8bN5/PKZC5YKUVaFr51/OCnFTuMGfL+dYF9CjKT1kknZ2pXUrN1ZgjpQ6LmsMBeI9RS4x6hatPw== X-Received: by 2002:a62:1b83:: with SMTP id b125mr51800305pfb.42.1549262038091; Sun, 03 Feb 2019 22:33:58 -0800 (PST) Received: from cpu459.localdomain ([27.59.252.63]) by smtp.gmail.com with ESMTPSA id t21sm20240438pgg.24.2019.02.03.22.33.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Feb 2019 22:33:57 -0800 (PST) From: Siva Rebbagondla To: Kalle Valo Cc: linux-wireless@vger.kernel.org, rishikesh.basu@redpinesignals.com, siva.rebbagondla@redpinesignals.com, krishna.pedda@redpinesignals.com, amitkarwar@gmail.com Subject: [v3 3/5] rsi: fix wowlan wakeup issue for hibernate(S4) Date: Mon, 4 Feb 2019 12:03:27 +0530 Message-Id: <1549262009-8766-4-git-send-email-siva8118@gmail.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1549262009-8766-1-git-send-email-siva8118@gmail.com> References: <1549262009-8766-1-git-send-email-siva8118@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Siva Rebbagondla At SDIO restore ieee80211_restart_hw() is getting called to restart all MAC operations. This step is not required. Returning 1 from mac80211_resume() will serve this purpose. Signed-off-by: Siva Rebbagondla --- drivers/net/wireless/rsi/rsi_91x_mac80211.c | 8 ++++++-- drivers/net/wireless/rsi/rsi_91x_sdio.c | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c index aded1ae..8d1282f 100644 --- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c +++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c @@ -1938,8 +1938,12 @@ static int rsi_mac80211_resume(struct ieee80211_hw *hw) rsi_dbg(INFO_ZONE, "%s: mac80211 resume\n", __func__); - if (common->hibernate_resume) - return 0; + if (common->hibernate_resume) { + /* Device need a complete restart of all MAC operations. + * returning 1 will serve this purpose. + */ + return 1; + } mutex_lock(&common->mutex); rsi_send_wowlan_request(common, 0, 0); diff --git a/drivers/net/wireless/rsi/rsi_91x_sdio.c b/drivers/net/wireless/rsi/rsi_91x_sdio.c index 9a3bb0d..449803c 100644 --- a/drivers/net/wireless/rsi/rsi_91x_sdio.c +++ b/drivers/net/wireless/rsi/rsi_91x_sdio.c @@ -1396,7 +1396,6 @@ static int rsi_restore(struct device *dev) common->iface_down = true; adapter->sc_nvifs = 0; - ieee80211_restart_hw(adapter->hw); common->wow_flags = 0; common->iface_down = false; From patchwork Mon Feb 4 06:33:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siva Rebbagondla X-Patchwork-Id: 10794983 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AB350746 for ; Mon, 4 Feb 2019 06:34:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 989ED1FFD8 for ; Mon, 4 Feb 2019 06:34:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C40D21FAD; Mon, 4 Feb 2019 06:34:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 280941FFD8 for ; Mon, 4 Feb 2019 06:34:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726806AbfBDGeD (ORCPT ); Mon, 4 Feb 2019 01:34:03 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:37205 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725903AbfBDGeD (ORCPT ); Mon, 4 Feb 2019 01:34:03 -0500 Received: by mail-pg1-f193.google.com with SMTP id c25so5849983pgb.4 for ; Sun, 03 Feb 2019 22:34:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=C/IPLfRZQKxy/vjOToflTi/6W+HYcEMZq2LJ+fpWG7Y=; b=qA1hSeafCq6Zv0kqydoq2/mpxAvftejt6ngnDRkiqEV9U4D044GfWuMD6F5fT8zW9o keyRiUmsZip6bPz+10aioBxn3T5+E8WjbM2ZyPGUj0zFhZ7ksq9CJiK1BKP0qD9nIKQs KC3ISYHdlX61eUqZO2kpgaazMYezUJxDBCjjMjfVpzKd25aMVUcTYbwrYdSF44sIlKNn 21WFP7mq46JbUJiIc5Vyng+MoJebmCwYN5/yvt1LCXrdlEa1Sv1IacfExlOcVWtfBDec daF1PJS1gnL1EIlTI5qGCbDjDcy2R/Dtkw9m6Gmaf1DJ6hoqYBQg0f+GVK9PrkdnfcMo 6Uyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=C/IPLfRZQKxy/vjOToflTi/6W+HYcEMZq2LJ+fpWG7Y=; b=H9IRYGjTCsplfph7U9pAbL2/ydNEsvL8v8bdPktzeOTYszXsKlhiiQhAEAzbPnINQj 5j6RuUp9Z8tdWQaTR+8MsLrWFadyGE/EUXIgOKmVFfpxRpqZFhEsZ2U7PAxrVBrmzWjG JjUg+sunoFa8x/9tTLzpYztJIDARvIyCLPqhu3tjczor9EF5SWYJ5D5PtLGTp8kycGKK WTuxUDhtSoDvFxuOYHVgZqONQS6An+cesLi9iBrz7XaKIf4/xjg+xqSLNSFwCPsJ/Ul4 kGQTpBL2W9q5/bdjhGIH6pEqkmy4Y80wXq80BlzvKCjH7OqeMHgm/ITWVfAhx5KbU5JV raXg== X-Gm-Message-State: AJcUukdT1PMme30YdjVVwxt/KzS+D2zkS2gKFW4xYGdKFpFuTWZ1OTY2 MZ8OVhD3m00VbVVRkBZc8OY= X-Google-Smtp-Source: ALg8bN6w/KR611aBkNZPM0at9grpleYM0c/cgxoc+Jde+zWwOwfDIaBeJyEBs9qm6i085lGbv4kFnA== X-Received: by 2002:a62:1709:: with SMTP id 9mr49309297pfx.249.1549262042123; Sun, 03 Feb 2019 22:34:02 -0800 (PST) Received: from cpu459.localdomain ([27.59.252.63]) by smtp.gmail.com with ESMTPSA id t21sm20240438pgg.24.2019.02.03.22.33.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Feb 2019 22:34:01 -0800 (PST) From: Siva Rebbagondla To: Kalle Valo Cc: linux-wireless@vger.kernel.org, rishikesh.basu@redpinesignals.com, siva.rebbagondla@redpinesignals.com, krishna.pedda@redpinesignals.com, amitkarwar@gmail.com Subject: [v3 4/5] rsi: resolve power save issue after S4 resume Date: Mon, 4 Feb 2019 12:03:28 +0530 Message-Id: <1549262009-8766-5-git-send-email-siva8118@gmail.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1549262009-8766-1-git-send-email-siva8118@gmail.com> References: <1549262009-8766-1-git-send-email-siva8118@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Siva Rebbagondla We are redownloading the firmware after S4 restore and observed in stress test that mac80211 sometimes gives power save request after resume which causes the firmware in bad state. mac_ops_resumed flag is added to skip that request until initialisation is done and Keeping power save state is NONE. Signed-off-by: Siva Rebbagondla --- drivers/net/wireless/rsi/rsi_91x_mac80211.c | 9 ++++++++- drivers/net/wireless/rsi/rsi_91x_sdio.c | 1 + drivers/net/wireless/rsi/rsi_main.h | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c index 8d1282f..7bc8da6 100644 --- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c +++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c @@ -239,6 +239,7 @@ static int rsi_mac80211_hw_scan_start(struct ieee80211_hw *hw, struct ieee80211_bss_conf *bss = &vif->bss_conf; rsi_dbg(INFO_ZONE, "***** Hardware scan start *****\n"); + common->mac_ops_resumed = false; if (common->fsm_state != FSM_MAC_INIT_DONE) return -ENODEV; @@ -370,6 +371,10 @@ static void rsi_mac80211_tx(struct ieee80211_hw *hw, { struct rsi_hw *adapter = hw->priv; struct rsi_common *common = adapter->priv; + struct ieee80211_hdr *wlh = (struct ieee80211_hdr *)skb->data; + + if (ieee80211_is_auth(wlh->frame_control)) + common->mac_ops_resumed = false; rsi_core_xmit(common, skb); } @@ -677,7 +682,8 @@ static int rsi_mac80211_config(struct ieee80211_hw *hw, } /* Power save parameters */ - if (changed & IEEE80211_CONF_CHANGE_PS) { + if ((changed & IEEE80211_CONF_CHANGE_PS) && + !common->mac_ops_resumed) { struct ieee80211_vif *vif, *sta_vif = NULL; unsigned long flags; int i, set_ps = 1; @@ -1939,6 +1945,7 @@ static int rsi_mac80211_resume(struct ieee80211_hw *hw) rsi_dbg(INFO_ZONE, "%s: mac80211 resume\n", __func__); if (common->hibernate_resume) { + common->mac_ops_resumed = true; /* Device need a complete restart of all MAC operations. * returning 1 will serve this purpose. */ diff --git a/drivers/net/wireless/rsi/rsi_91x_sdio.c b/drivers/net/wireless/rsi/rsi_91x_sdio.c index 449803c..764ad06 100644 --- a/drivers/net/wireless/rsi/rsi_91x_sdio.c +++ b/drivers/net/wireless/rsi/rsi_91x_sdio.c @@ -1396,6 +1396,7 @@ static int rsi_restore(struct device *dev) common->iface_down = true; adapter->sc_nvifs = 0; + adapter->ps_state = PS_NONE; common->wow_flags = 0; common->iface_down = false; diff --git a/drivers/net/wireless/rsi/rsi_main.h b/drivers/net/wireless/rsi/rsi_main.h index 4dc0c01..35d13f3 100644 --- a/drivers/net/wireless/rsi/rsi_main.h +++ b/drivers/net/wireless/rsi/rsi_main.h @@ -311,6 +311,7 @@ struct rsi_common { struct cfg80211_scan_request *hwscan; struct rsi_bgscan_params bgscan; u8 bgscan_en; + u8 mac_ops_resumed; }; struct eepromrw_info { From patchwork Mon Feb 4 06:33:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siva Rebbagondla X-Patchwork-Id: 10794985 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 93981922 for ; Mon, 4 Feb 2019 06:34:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 832411FFD8 for ; Mon, 4 Feb 2019 06:34:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7717F21FAD; Mon, 4 Feb 2019 06:34:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2DA5B1FFD8 for ; Mon, 4 Feb 2019 06:34:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726841AbfBDGeG (ORCPT ); Mon, 4 Feb 2019 01:34:06 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:46942 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725903AbfBDGeG (ORCPT ); Mon, 4 Feb 2019 01:34:06 -0500 Received: by mail-pf1-f194.google.com with SMTP id c73so6279356pfe.13 for ; Sun, 03 Feb 2019 22:34:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9c5Qv3xKOnSbwK7hxSyqCi1So4hNP+y66JHHTtRgqGg=; b=sZ2WYW0Qub0ZWOMCSGxSE1YW1VkNUH+cqe7TTBhWfFXYrjogJjUCg8dyX6ImR7yj6P rnnLdx0HfZYLBtqsmGO+uStFt1zBhDlw13rPkjztH469GS4v2+Qwd3YK1+PjBf9TWTUU q8SnU738lDeAO2Thi3xQOMNWX8z9z9VywoXO3eOFK/tj1CLI/378TtO+qpNX/6zF3LWV oBnOtJSbMoDfgnQgyi1v/4g9xaZ5LaaMDwyUKuDBc23YESQF+Nj0MLnby0m83rGuw5e3 Vsrh88wIw/ITtydMN+Kad3PhZ3F9iWa/c5quK5tqYslaT1cwRODg3v93bmthMND008DK wxsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9c5Qv3xKOnSbwK7hxSyqCi1So4hNP+y66JHHTtRgqGg=; b=RDKxdb8RZV1rVjLhn8LfLv3xtfcrRx1kZB352L7UzPFj0KQw5Lmn4eRsrtvpsM9WUU Dn8O+Jk3juwiEOb4M1pkSNwG4t7xLUGU25lApC8i38uRkKxj0iHLdV5ZxWiTDm8wIx0a pD6Cw80ae7PDg8z9SyelZe2BrI9alwtl/nlOBMkurPx/wLFYbcCZ8x4JGgNFr49bDFA1 yUL0K2TfjWyGt3Zd1yFB+YwiK9GsxHeavOCuYr7GlNBjSRprZF9RIMvkg4bWiwBstRga 6iyMJhzHx7URQUP49rqVL/SC/iovKURpUrevuJs5VKwtbx4gYPjiHyRQJOxyfT2xqrqJ DPsA== X-Gm-Message-State: AHQUAuZ2omw1sfxbBD+QtvNxv4/urNokcJKimyp6g7nWy48+YOuW9zdO T6hvd8X7fHqY3alVCtj2+wg= X-Google-Smtp-Source: AHgI3IaRlFYBvH/iv9xRsXUx7HwdzJ0zgffCaoA3MkwD2YvbPeA0B71bNHI+nph06MZUve2MJ6WQHg== X-Received: by 2002:a63:2ccd:: with SMTP id s196mr11798433pgs.194.1549262045405; Sun, 03 Feb 2019 22:34:05 -0800 (PST) Received: from cpu459.localdomain ([27.59.252.63]) by smtp.gmail.com with ESMTPSA id t21sm20240438pgg.24.2019.02.03.22.34.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Feb 2019 22:34:04 -0800 (PST) From: Siva Rebbagondla To: Kalle Valo Cc: linux-wireless@vger.kernel.org, rishikesh.basu@redpinesignals.com, siva.rebbagondla@redpinesignals.com, krishna.pedda@redpinesignals.com, amitkarwar@gmail.com Subject: [v3 5/5] rsi: fix for wowlan wakeup failure Date: Mon, 4 Feb 2019 12:03:29 +0530 Message-Id: <1549262009-8766-6-git-send-email-siva8118@gmail.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1549262009-8766-1-git-send-email-siva8118@gmail.com> References: <1549262009-8766-1-git-send-email-siva8118@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Siva Rebbagondla During wowlan regression tests, sometimes radio is not waking up for wowlan packet in coex mode. This is because of power save is enabled by default in case of coex mode greater than one. Hence, disable power save in coex mode to avoid radio loss. Signed-off-by: Siva Rebbagondla --- drivers/net/wireless/rsi/rsi_91x_mac80211.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c index 7bc8da6..3fd2571 100644 --- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c +++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c @@ -1901,6 +1901,10 @@ int rsi_config_wowlan(struct rsi_hw *adapter, struct cfg80211_wowlan *wowlan) return 0; } rsi_dbg(INFO_ZONE, "TRIGGERS %x\n", triggers); + + if (common->coex_mode > 1) + rsi_disable_ps(adapter, adapter->vifs[0]); + rsi_send_wowlan_request(common, triggers, 1); /**