diff mbox series

[v2,2/5] rsi: add hci detach for hibernation and poweroff

Message ID 1548913985-7180-3-git-send-email-siva8118@gmail.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series rsi: wowlan debig support and fixes | expand

Commit Message

Siva Rebbagondla Jan. 31, 2019, 5:53 a.m. UTC
From: Siva Rebbagondla <siva.rebbagondla@redpinesignals.com>

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 <siva.rebbagondla@redpinesignals.com>
---
 drivers/net/wireless/rsi/rsi_91x_sdio.c | 15 +++++++++++++++
 drivers/net/wireless/rsi/rsi_91x_usb.c  |  6 ++++++
 2 files changed, 21 insertions(+)

Comments

kernel test robot Feb. 1, 2019, 1:38 p.m. UTC | #1
Hi Siva,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on wireless-drivers-next/master]
[also build test ERROR on v5.0-rc4 next-20190131]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Siva-Rebbagondla/rsi-wowlan-debig-support-and-fixes/20190201-002929
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master
config: x86_64-randconfig-s1-02011457 (attached as .config)
compiler: gcc-6 (Debian 6.5.0-2) 6.5.0 20181026
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   ld: drivers/net/wireless/rsi/rsi_91x_usb.o: in function `rsi_disconnect':
>> drivers/net/wireless/rsi/rsi_91x_usb.c:821: undefined reference to `rsi_bt_ops'
>> ld: drivers/net/wireless/rsi/rsi_91x_usb.c:821: undefined reference to `rsi_bt_ops'

vim +821 drivers/net/wireless/rsi/rsi_91x_usb.c

   803	
   804	/**
   805	 * rsi_disconnect() - This function performs the reverse of the probe function,
   806	 *		      it deinitialize the driver structure.
   807	 * @pfunction: Pointer to the USB interface structure.
   808	 *
   809	 * Return: None.
   810	 */
   811	static void rsi_disconnect(struct usb_interface *pfunction)
   812	{
   813		struct rsi_hw *adapter = usb_get_intfdata(pfunction);
   814	
   815		if (!adapter)
   816			return;
   817	
   818		rsi_mac80211_detach(adapter);
   819	
   820		if (adapter->priv->coex_mode > 1 && adapter->priv->bt_adapter) {
 > 821			rsi_bt_ops.detach(adapter->priv->bt_adapter);
   822			adapter->priv->bt_adapter = NULL;
   823		}
   824	
   825		rsi_reset_card(adapter);
   826		rsi_deinit_usb_interface(adapter);
   827		rsi_91x_deinit(adapter);
   828	
   829		rsi_dbg(INFO_ZONE, "%s: Deinitialization completed\n", __func__);
   830	}
   831	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
kernel test robot Feb. 1, 2019, 3:05 p.m. UTC | #2
Hi Siva,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on wireless-drivers-next/master]
[also build test ERROR on v5.0-rc4 next-20190131]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Siva-Rebbagondla/rsi-wowlan-debig-support-and-fixes/20190201-002929
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master
config: x86_64-randconfig-s0-02011939 (attached as .config)
compiler: gcc-6 (Debian 6.5.0-2) 6.5.0 20181026
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

>> ERROR: "rsi_bt_ops" [drivers/net/wireless/rsi/rsi_sdio.ko] undefined!

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
Siva Rebbagondla Feb. 1, 2019, 3:32 p.m. UTC | #3
Hi Kalle,
On Thu, Jan 31, 2019 at 11:23 AM Siva Rebbagondla <siva8118@gmail.com> wrote:
>
> From: Siva Rebbagondla <siva.rebbagondla@redpinesignals.com>
>
> 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 <siva.rebbagondla@redpinesignals.com>
> ---
>  drivers/net/wireless/rsi/rsi_91x_sdio.c | 15 +++++++++++++++
>  drivers/net/wireless/rsi/rsi_91x_usb.c  |  6 ++++++
>  2 files changed, 21 insertions(+)
>
> diff --git a/drivers/net/wireless/rsi/rsi_91x_sdio.c b/drivers/net/wireless/rsi/rsi_91x_sdio.c
> index b412b65e..4005c1d 100644
> --- a/drivers/net/wireless/rsi/rsi_91x_sdio.c
> +++ b/drivers/net/wireless/rsi/rsi_91x_sdio.c
> @@ -1132,6 +1132,11 @@ static void rsi_disconnect(struct sdio_func *pfunction)
>         rsi_mac80211_detach(adapter);
>         mdelay(10);
>
> +       if (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 +1313,11 @@ static int rsi_freeze(struct device *dev)
>                 rsi_dbg(ERR_ZONE,
>                         "##### Device can not wake up through WLAN\n");
>
> +       if (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 +1365,11 @@ static void rsi_shutdown(struct device *dev)
>         if (rsi_config_wowlan(adapter, wowlan))
>                 rsi_dbg(ERR_ZONE, "Failed to configure WoWLAN\n");
>
> +       if (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..38b4880b 100644
> --- a/drivers/net/wireless/rsi/rsi_91x_usb.c
> +++ b/drivers/net/wireless/rsi/rsi_91x_usb.c
> @@ -816,6 +816,12 @@ static void rsi_disconnect(struct usb_interface *pfunction)
>                 return;
>
>         rsi_mac80211_detach(adapter);
> +
> +       if (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);
> --
> 2.5.5
>
Kindly ignore this patch series as kbuild test got failed. It is
because of "rsi_bt_ops". These ops are defined in
drivers/bluetooth/btrsi.c and this file is under CONFIG_RSI_COEX flag.
I was overlooked on this.
As you suggested in v1 series, I will resend these patches with
"IS_ENABLED(CONFIG_RSI_COEX)" check.

Thanks,
Siva Rebbagondla
diff mbox series

Patch

diff --git a/drivers/net/wireless/rsi/rsi_91x_sdio.c b/drivers/net/wireless/rsi/rsi_91x_sdio.c
index b412b65e..4005c1d 100644
--- a/drivers/net/wireless/rsi/rsi_91x_sdio.c
+++ b/drivers/net/wireless/rsi/rsi_91x_sdio.c
@@ -1132,6 +1132,11 @@  static void rsi_disconnect(struct sdio_func *pfunction)
 	rsi_mac80211_detach(adapter);
 	mdelay(10);
 
+	if (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 +1313,11 @@  static int rsi_freeze(struct device *dev)
 		rsi_dbg(ERR_ZONE,
 			"##### Device can not wake up through WLAN\n");
 
+	if (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 +1365,11 @@  static void rsi_shutdown(struct device *dev)
 	if (rsi_config_wowlan(adapter, wowlan))
 		rsi_dbg(ERR_ZONE, "Failed to configure WoWLAN\n");
 
+	if (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..38b4880b 100644
--- a/drivers/net/wireless/rsi/rsi_91x_usb.c
+++ b/drivers/net/wireless/rsi/rsi_91x_usb.c
@@ -816,6 +816,12 @@  static void rsi_disconnect(struct usb_interface *pfunction)
 		return;
 
 	rsi_mac80211_detach(adapter);
+
+	if (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);