[PATCH 1/4] UBUNTU: SAUCE: Redpine: fix wowlan issue

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 1/4] UBUNTU: SAUCE: Redpine: fix wowlan issue

Amitkumar Karwar
From: Prameela Rani Garnepudi <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1736097
BugLink: https://bugs.launchpad.net/bugs/1738169

Two issues were observed, kernel warning at S4 restore and other
is failing to wakeup at times.
Kernel warning is because, at hibernate resume while mac80211
is resuming, driver is issuing mac80211 detach. The warning is
as below:
[  374.972073] WARNING: CPU: 1 PID: 3725 at linux-4.4.0/net/mac80211/iface.c:1000 ieee80211_do_stop+0x6ea/0x810 [mac80211]()
....
[  374.972211] CPU: 1 PID: 3725 Comm: kworker/u4:44 Tainted: G        W       4.4.0-98-generic #121-Ubuntu
[  374.972213] Hardware name: Dell Inc. Edge Gateway 3002/      , BIOS 01.00.05 11/22/2017
[  374.972223] Workqueue: events_unbound async_run_entry_fn
[  374.972230]  0000000000000286 bf3948ba9db4c154 ffff88005a733ad8 ffffffff813fb2c3
[  374.972235]  0000000000000000 ffffffffc04b8ac8 ffff88005a733b10 ffffffff810812e2
[  374.972239]  ffff8800787c0840 ffff88006f18e700 0000000000000000 ffff88006f18ee90
[  374.972240] Call Trace:
[  374.972249]  [<ffffffff813fb2c3>] dump_stack+0x63/0x90
[  374.972256]  [<ffffffff810812e2>] warn_slowpath_common+0x82/0xc0
[  374.972260]  [<ffffffff8108142a>] warn_slowpath_null+0x1a/0x20
[  374.972305]  [<ffffffffc045915a>] ieee80211_do_stop+0x6ea/0x810 [mac80211]
[  374.972312]  [<ffffffff818441ee>] ? _raw_spin_unlock_bh+0x1e/0x20
[  374.972317]  [<ffffffff817608ba>] ? dev_deactivate_many+0x20a/0x240
[  374.972359]  [<ffffffffc045929a>] ieee80211_stop+0x1a/0x20 [mac80211]
[  374.972365]  [<ffffffff81732a39>] __dev_close_many+0x99/0x100
[  374.972369]  [<ffffffff81732b31>] dev_close_many+0x91/0x140
[  374.972374]  [<ffffffff810e6171>] ? synchronize_sched_expedited+0x4e1/0x880
[  374.972379]  [<ffffffff81734e2a>] dev_close.part.79+0x4a/0x70
[  374.972383]  [<ffffffff81734e6a>] dev_close+0x1a/0x20
[  374.972425]  [<ffffffffc035fac1>] cfg80211_shutdown_all_interfaces+0x41/0xa0 [cfg80211]
[  374.972467]  [<ffffffffc045a6c6>] ieee80211_remove_interfaces+0x56/0x1f0 [mac80211]
[  374.972506]  [<ffffffffc0441bca>] ieee80211_unregister_hw+0x4a/0x120 [mac80211]

This is avoided by calling ieee80211_restart_hw and reinitializing
device as usual in sdio restore and waiting in mac80211_resume
until device is ready.
Other issue may be due to firmware assertion observed at times for
the length of bgscan probe request at restore. To avoid this,
unnecessary IEs are cut from the frame at end.

Signed-off-by: Prameela Rani Garnepudi <[hidden email]>
Signed-off-by: Amitkumar Karwar <[hidden email]>
---
 ubuntu/rsi/rsi_91x_hal.c      |  3 ++-
 ubuntu/rsi/rsi_91x_mac80211.c | 15 ++++++++++++---
 ubuntu/rsi/rsi_91x_main.c     |  1 +
 ubuntu/rsi/rsi_91x_mgmt.c     | 24 +++++++++++++++++++++++-
 ubuntu/rsi/rsi_91x_sdio.c     | 10 +++++++---
 ubuntu/rsi/rsi_common.h       |  2 ++
 ubuntu/rsi/rsi_main.h         |  2 ++
 7 files changed, 49 insertions(+), 8 deletions(-)

diff --git a/ubuntu/rsi/rsi_91x_hal.c b/ubuntu/rsi/rsi_91x_hal.c
index cccedaf..971d5ee 100644
--- a/ubuntu/rsi/rsi_91x_hal.c
+++ b/ubuntu/rsi/rsi_91x_hal.c
@@ -188,7 +188,8 @@ int rsi_prepare_data_desc(struct rsi_common *common, struct sk_buff *skb)
  frame_desc[0] = cpu_to_le16((skb->len - FRAME_DESC_SZ) |
     (RSI_WIFI_MGMT_Q << 12));
  }
- if ((skb->len - header_size) == 133) {
+ if (((skb->len - header_size) == 133) ||
+    ((skb->len - header_size) == 131)) {
  ven_rsi_dbg(INFO_ZONE, "*** Tx EAPOL 4*****\n");
  frame_desc[1] |=
  cpu_to_le16(RSI_DESC_REQUIRE_CFM_TO_HOST);
diff --git a/ubuntu/rsi/rsi_91x_mac80211.c b/ubuntu/rsi/rsi_91x_mac80211.c
index 8a4100a..c32a9bb 100644
--- a/ubuntu/rsi/rsi_91x_mac80211.c
+++ b/ubuntu/rsi/rsi_91x_mac80211.c
@@ -363,6 +363,11 @@ static int rsi_mac80211_hw_scan_start(struct ieee80211_hw *hw,
  if (common->fsm_state != FSM_MAC_INIT_DONE)
  return -ENODEV;
 
+#ifdef CONFIG_RSI_WOW
+ if (common->wow_flags & RSI_WOW_ENABLED)
+ return -ENETDOWN;
+#endif
+
  if (scan_req->n_channels == 0)
  return -EINVAL;
 
@@ -404,8 +409,8 @@ static int rsi_mac80211_hw_scan_start(struct ieee80211_hw *hw,
         return 0;
 }
 
-static void rsi_mac80211_hw_scan_cancel(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif)
+void rsi_mac80211_hw_scan_cancel(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif)
 {
  struct rsi_hw *adapter = hw->priv;
  struct rsi_common *common = adapter->priv;
@@ -444,6 +449,7 @@ static void rsi_mac80211_hw_scan_cancel(struct ieee80211_hw *hw,
  common->hw_scan_cancel = false;
  mutex_unlock(&common->mutex);
 }
+EXPORT_SYMBOL_GPL(rsi_mac80211_hw_scan_cancel);
 #endif
 
 /**
@@ -2452,8 +2458,11 @@ static int rsi_mac80211_resume(struct ieee80211_hw *hw)
 
  ven_rsi_dbg(INFO_ZONE, "%s: mac80211 resume\n", __func__);
 
- if (common->hibernate_resume)
+ if (common->hibernate_resume) {
+ if (common->reinit_hw)
+ wait_for_completion(&common->wlan_init_completion);
  return 0;
+ }
 
 #ifdef CONFIG_VEN_RSI_WOW
  mutex_lock(&common->mutex);
diff --git a/ubuntu/rsi/rsi_91x_main.c b/ubuntu/rsi/rsi_91x_main.c
index f7a2e3a..2350dbb61 100644
--- a/ubuntu/rsi/rsi_91x_main.c
+++ b/ubuntu/rsi/rsi_91x_main.c
@@ -415,6 +415,7 @@ struct rsi_hw *ven_rsi_91x_init(void)
  common->roc_timer.data = (unsigned long)common;
  common->roc_timer.function = (void *)&rsi_roc_timeout;
  init_timer(&common->roc_timer);
+ init_completion(&common->wlan_init_completion);
 
  common->init_done = true;
  return adapter;
diff --git a/ubuntu/rsi/rsi_91x_mgmt.c b/ubuntu/rsi/rsi_91x_mgmt.c
index 9976054..94fadc7 100644
--- a/ubuntu/rsi/rsi_91x_mgmt.c
+++ b/ubuntu/rsi/rsi_91x_mgmt.c
@@ -2343,6 +2343,21 @@ int rsi_send_probe_request(struct rsi_common *common,
  }
       
  if (scan_type == 1) {
+ if (len > 120) {
+ u16 t_len = MIN_802_11_HDR_LEN;
+
+ /* Cut some IEs */
+ pos = &skb->data[MIN_802_11_HDR_LEN];
+ while (true) {
+ if ((t_len + pos[1] + 2) > 120) {
+ skb_trim(skb, t_len);
+ len = t_len;
+ break;
+ }
+ t_len += pos[1] + 2;
+ pos += (pos[1] + 2);
+ }
+ }
  common->bgscan_probe_req_len = len;
  return 0;
  }
@@ -2635,7 +2650,14 @@ static int rsi_handle_ta_confirm(struct rsi_common *common, u8 *msg)
  common->bb_rf_prog_count--;
  if (!common->bb_rf_prog_count) {
  common->fsm_state = FSM_MAC_INIT_DONE;
- return rsi_mac80211_attach(common);
+ if (common->reinit_hw) {
+ common->hw_data_qs_blocked = false;
+ ieee80211_wake_queues(adapter->hw);
+ complete(&common->wlan_init_completion);
+ common->reinit_hw = false;
+ } else {
+ return rsi_mac80211_attach(common);
+ }
  }
  } else {
  ven_rsi_dbg(INFO_ZONE,
diff --git a/ubuntu/rsi/rsi_91x_sdio.c b/ubuntu/rsi/rsi_91x_sdio.c
index 07e08f0..336f059 100644
--- a/ubuntu/rsi/rsi_91x_sdio.c
+++ b/ubuntu/rsi/rsi_91x_sdio.c
@@ -1467,9 +1467,6 @@ static int rsi_sdio_reinit_device(struct rsi_hw *adapter)
  for (ii = 0; ii < NUM_SOFT_QUEUES; ii++)
  skb_queue_purge(&adapter->priv->tx_queue[ii]);
 
- /* Detach MAC */
- ven_rsi_mac80211_detach(adapter);
-
  /* Initialize device again */
  sdio_claim_host(pfunction);
 
@@ -1500,7 +1497,14 @@ int rsi_restore(struct device *dev)
  adapter->priv->bt_fsm_state = BT_DEVICE_NOT_READY;
  adapter->priv->iface_down = true;
 
+ adapter->sc_nvifs = 0;
+ rsi_mac80211_hw_scan_cancel(adapter->hw, adapter->priv->scan_vif);
+ flush_workqueue(adapter->priv->scan_workqueue);
+ ieee80211_stop_queues(adapter->hw);
+ ieee80211_restart_hw(adapter->hw);
+
  /* Initialize device again */
+ adapter->priv->reinit_hw = true;
  rsi_sdio_reinit_device(adapter);
 
 #ifdef CONFIG_VEN_RSI_WOW
diff --git a/ubuntu/rsi/rsi_common.h b/ubuntu/rsi/rsi_common.h
index d4385de..e7f1240 100644
--- a/ubuntu/rsi/rsi_common.h
+++ b/ubuntu/rsi/rsi_common.h
@@ -115,4 +115,6 @@ struct ieee80211_vif *rsi_get_vif(struct rsi_hw *adapter, u8 *mac);
 #ifdef CONFIG_VEN_RSI_WOW
 int rsi_config_wowlan(struct rsi_hw *adapter, struct cfg80211_wowlan *wowlan);
 #endif
+void rsi_mac80211_hw_scan_cancel(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif);
 #endif
diff --git a/ubuntu/rsi/rsi_main.h b/ubuntu/rsi/rsi_main.h
index 3f55e36..53b9245 100644
--- a/ubuntu/rsi/rsi_main.h
+++ b/ubuntu/rsi/rsi_main.h
@@ -331,6 +331,8 @@ struct rsi_common {
  u8 ant_in_use;
  bool suspend_in_prog;
  bool hibernate_resume;
+ bool reinit_hw;
+ struct completion wlan_init_completion;
 #ifdef CONFIG_VEN_RSI_WOW
  u8 wow_flags;
 #endif
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 2/4] UBUNTU: SAUCE: Redpine: fix reset card issue

Amitkumar Karwar
From: Prameela Rani Garnepudi <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1736097
BugLink: https://bugs.launchpad.net/bugs/1738169

Sometimes we don't get response for SDIO commands during reset.
Additional parameter 'expected response' is added to cmd52readbyte()
and cmd52writebyte(). This parameter is false during reset (To avoid
waiting for response) and true while disabling or enabling SDIO
interrupts.

Signed-off-by: Prameela Rani Garnepudi <[hidden email]>
Signed-off-by: Amitkumar Karwar <[hidden email]>
---
 ubuntu/rsi/rsi_91x_sdio.c | 38 +++++++++++++++++++++++---------------
 1 file changed, 23 insertions(+), 15 deletions(-)

diff --git a/ubuntu/rsi/rsi_91x_sdio.c b/ubuntu/rsi/rsi_91x_sdio.c
index 336f059..a2e25d0 100644
--- a/ubuntu/rsi/rsi_91x_sdio.c
+++ b/ubuntu/rsi/rsi_91x_sdio.c
@@ -88,7 +88,8 @@ static u32 rsi_sdio_set_cmd52_arg(bool rw,
  */
 static int rsi_cmd52writebyte(struct mmc_card *card,
       u32 address,
-      u8 byte)
+      u8 byte,
+      bool expect_resp)
 {
  struct mmc_command io_cmd;
  u32 arg;
@@ -97,7 +98,9 @@ static int rsi_cmd52writebyte(struct mmc_card *card,
  arg = rsi_sdio_set_cmd52_arg(1, 0, 0, address, byte);
  io_cmd.opcode = SD_IO_RW_DIRECT;
  io_cmd.arg = arg;
- io_cmd.flags = /*MMC_RSP_R5 | */MMC_CMD_AC;
+ io_cmd.flags = MMC_CMD_AC;
+ if (expect_resp)
+ io_cmd.flags |= MMC_RSP_R5;
 
  return mmc_wait_for_cmd(card->host, &io_cmd, 0);
 }
@@ -112,7 +115,8 @@ static int rsi_cmd52writebyte(struct mmc_card *card,
  */
 static int rsi_cmd52readbyte(struct mmc_card *card,
      u32 address,
-     u8 *byte)
+     u8 *byte,
+     bool expect_resp)
 {
  struct mmc_command io_cmd;
  u32 arg;
@@ -122,7 +126,9 @@ static int rsi_cmd52readbyte(struct mmc_card *card,
  arg = rsi_sdio_set_cmd52_arg(0, 0, 0, address, 0);
  io_cmd.opcode = SD_IO_RW_DIRECT;
  io_cmd.arg = arg;
- io_cmd.flags = /*MMC_RSP_R5 | */MMC_CMD_AC;
+ io_cmd.flags = MMC_CMD_AC;
+ if (expect_resp)
+ io_cmd.flags |= MMC_RSP_R5;
 
  err = mmc_wait_for_cmd(card->host, &io_cmd, 0);
  if ((!err) && (byte))
@@ -311,7 +317,7 @@ static void rsi_reset_card(struct sdio_func *pfunction)
  /* Reset 9110 chip */
  err = rsi_cmd52writebyte(pfunction->card,
  SDIO_CCCR_ABORT,
- (1 << 3));
+ (1 << 3), true);
 
  /* Card will not send any response as it is getting reset immediately
  * Hence expect a timeout status from host controller
@@ -446,14 +452,16 @@ static void rsi_reset_card(struct sdio_func *pfunction)
  /* Enable high speed */
  if (card->host->caps & MMC_CAP_SD_HIGHSPEED) {
  ven_rsi_dbg(ERR_ZONE, "%s: Set high speed mode\n", __func__);
- err = rsi_cmd52readbyte(card, SDIO_CCCR_SPEED, &cmd52_resp);
+ err = rsi_cmd52readbyte(card, SDIO_CCCR_SPEED, &cmd52_resp,
+ true);
  if (err) {
  ven_rsi_dbg(ERR_ZONE, "%s: CCCR speed reg read failed: %d\n",
  __func__, err);
  } else {
  err = rsi_cmd52writebyte(card,
  SDIO_CCCR_SPEED,
- (cmd52_resp | SDIO_SPEED_EHS));
+ (cmd52_resp | SDIO_SPEED_EHS),
+ true);
  if (err) {
  ven_rsi_dbg(ERR_ZONE,
  "%s: CCR speed regwrite failed %d\n",
@@ -482,7 +490,7 @@ static void rsi_reset_card(struct sdio_func *pfunction)
  err = rsi_cmd52writebyte(card,
  SDIO_CCCR_IF,
  (SDIO_BUS_CD_DISABLE |
-  SDIO_BUS_WIDTH_4BIT));
+  SDIO_BUS_WIDTH_4BIT), true);
  if (err) {
  ven_rsi_dbg(ERR_ZONE, "%s: Set bus mode failed : %d\n",
  __func__, err);
@@ -1220,7 +1228,7 @@ static int rsi_sdio_disable_interrupts(struct sdio_func *pfunction)
  ven_rsi_dbg(ERR_ZONE, "\nInterrupts cleared");
 
  sdio_claim_host(pfunction);
- ret = rsi_cmd52readbyte(pfunction->card, 0x04, &data);
+ ret = rsi_cmd52readbyte(pfunction->card, 0x04, &data, false);
  if (ret < 0) {
  ven_rsi_dbg(ERR_ZONE,
  "%s: Failed to read INTR_EN register\n",
@@ -1233,7 +1241,7 @@ static int rsi_sdio_disable_interrupts(struct sdio_func *pfunction)
  /* And bit0 and b1 */
  data &= 0xfc;
 
- ret = rsi_cmd52writebyte(pfunction->card, 0x04, data);
+ ret = rsi_cmd52writebyte(pfunction->card, 0x04, data, false);
  if (ret < 0) {
  ven_rsi_dbg(ERR_ZONE,
  "%s: Failed to Write to INTR_EN register\n",
@@ -1241,7 +1249,7 @@ static int rsi_sdio_disable_interrupts(struct sdio_func *pfunction)
  sdio_release_host(pfunction);
  return ret;
  }
- ret = rsi_cmd52readbyte(pfunction->card, 0x04, &data);
+ ret = rsi_cmd52readbyte(pfunction->card, 0x04, &data, false);
  if (ret < 0) {
  ven_rsi_dbg(ERR_ZONE,
  "%s: Failed to read INTR_EN register\n",
@@ -1262,7 +1270,7 @@ static int rsi_sdio_enable_interrupts(struct sdio_func *pfunction)
  int ret;
 
  sdio_claim_host(pfunction);
- ret = rsi_cmd52readbyte(pfunction->card, 0x04, &data);
+ ret = rsi_cmd52readbyte(pfunction->card, 0x04, &data, false);
  if (ret < 0) {
  ven_rsi_dbg(ERR_ZONE,
  "%s: Failed to read INTR_EN register\n", __func__);
@@ -1274,7 +1282,7 @@ static int rsi_sdio_enable_interrupts(struct sdio_func *pfunction)
  /* Enable b1 and b0 */
  data |= 0x03;
 
- ret = rsi_cmd52writebyte(pfunction->card, 0x04, data);
+ ret = rsi_cmd52writebyte(pfunction->card, 0x04, data, false);
  if (ret < 0) {
  ven_rsi_dbg(ERR_ZONE,
  "%s: Failed to Write to INTR_EN register\n",
@@ -1282,8 +1290,8 @@ static int rsi_sdio_enable_interrupts(struct sdio_func *pfunction)
  sdio_release_host(pfunction);
  return ret;
  }
-
-        ret = rsi_cmd52readbyte(pfunction->card, 0x04, &data);
+
+ ret = rsi_cmd52readbyte(pfunction->card, 0x04, &data, false);
  if (ret < 0) {
  ven_rsi_dbg(ERR_ZONE,
  "%s: Failed to read INTR_EN register\n", __func__);
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 3/4] UBUNTU: SAUCE: Redpine: fix data issue with non-uapsd APs

Amitkumar Karwar
In reply to this post by Amitkumar Karwar
From: Prameela Rani Garnepudi <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1736097
BugLink: https://bugs.launchpad.net/bugs/1738169

UAPSD parameter configuration in power save request should be
under UAPSD bitmap check. Otherwise data block issue occurs
with non-UAPSD APs .

Signed-off-by: Prameela Rani Garnepudi <[hidden email]>
Signed-off-by: Amitkumar Karwar <[hidden email]>
---
 ubuntu/rsi/rsi_91x_mgmt.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/ubuntu/rsi/rsi_91x_mgmt.c b/ubuntu/rsi/rsi_91x_mgmt.c
index 94fadc7..8a18c67 100644
--- a/ubuntu/rsi/rsi_91x_mgmt.c
+++ b/ubuntu/rsi/rsi_91x_mgmt.c
@@ -2100,6 +2100,11 @@ int rsi_send_ps_request(struct rsi_hw *adapter, bool enable)
  if (common->uapsd_bitmap) {
 // ps->ps_mimic_support = 1;
  ps->ps_uapsd_acs = common->uapsd_bitmap;
+ ps->ps_uapsd_acs = (adapter->hw->uapsd_max_sp_len <<
+    IEEE80211_WMM_IE_STA_QOSINFO_SP_SHIFT) |
+    IEEE80211_WMM_IE_STA_QOSINFO_AC_MASK;
+ ps->ps_uapsd_wakeup_period = RSI_UAPSD_WAKEUP_PERIOD;
+
  }
 
  ps->ps_sleep.sleep_type = ps_info->sleep_type;
@@ -2119,11 +2124,6 @@ int rsi_send_ps_request(struct rsi_hw *adapter, bool enable)
  if (ps->ps_listen_interval > ps->ps_dtim_interval_duration)
  ps->ps_listen_interval = 0;
 
- ps->ps_uapsd_acs = (adapter->hw->uapsd_max_sp_len <<
-    IEEE80211_WMM_IE_STA_QOSINFO_SP_SHIFT) |
-    IEEE80211_WMM_IE_STA_QOSINFO_AC_MASK;
- ps->ps_uapsd_wakeup_period = RSI_UAPSD_WAKEUP_PERIOD;
-
  skb_put(skb, frame_len);
 
  return rsi_send_internal_mgmt_frame(common, skb);
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 4/4] UBUNTU: SAUCE: Redpine: fix for wowlan wakeup failure

Amitkumar Karwar
In reply to this post by Amitkumar Karwar
From: Pavani Muthyala <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1736097
BugLink: https://bugs.launchpad.net/bugs/1738169

It is observed that magic packet is sometimes missed by firmware
which results in wakeup failure. This happens only in coex mode
when power save is enabled. Issue is resolved by disabling power
save to avoid radio loss for wlan

Signed-off-by: Pavani Muthyala <[hidden email]>
Signed-off-by: Amitkumar Karwar <[hidden email]>
---
Patch series is resent as author details for 4/4 patch were incorrect
in previous patch series
---
 ubuntu/rsi/rsi_91x_mac80211.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ubuntu/rsi/rsi_91x_mac80211.c b/ubuntu/rsi/rsi_91x_mac80211.c
index c32a9bb..2b18259 100644
--- a/ubuntu/rsi/rsi_91x_mac80211.c
+++ b/ubuntu/rsi/rsi_91x_mac80211.c
@@ -2410,6 +2410,8 @@ int rsi_config_wowlan(struct rsi_hw *adapter, struct cfg80211_wowlan *wowlan)
  return 0;
  }
  ven_rsi_dbg(INFO_ZONE, "TRIGGERS %x\n", triggers);
+ if (common->coex_mode > 1)
+ rsi_disable_ps(adapter);
  rsi_send_wowlan_request(common, triggers, 1);
 
  /* Send updated vap caps */
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

NACK/cmnt: [PATCH 1/4] UBUNTU: SAUCE: Redpine: fix wowlan issue

Shrirang Bagul
In reply to this post by Amitkumar Karwar
Hi Amit,

Several issues with the submission of this patch series -
- It's a good practice to have a cover letter explaining the reason for the patch
series
- BugLinks in the patch must point to public bugs against linux package.

Please refer to the SRU submission guidelines (see: https://wiki.ubuntu.com/Kernel/De
v/StablePatchFormat)
and resend the patches. I am NACKing this series.

Thanks,
Shrirang
>
On Mon, 2018-01-08 at 19:24 +0530, Amitkumar Karwar wrote:
> From: Prameela Rani Garnepudi <[hidden email]>
>
> BugLink: https://bugs.launchpad.net/bugs/1736097
> BugLink: https://bugs.launchpad.net/bugs/1738169

> Two issues were observed, kernel warning at S4 restore and other
> is failing to wakeup at times.
> Kernel warning is because, at hibernate resume while mac80211
> is resuming, driver is issuing mac80211 detach. The warning is
> as below:
> [  374.972073] WARNING: CPU: 1 PID: 3725 at linux-4.4.0/net/mac80211/iface.c:1000
> ieee80211_do_stop+0x6ea/0x810 [mac80211]()
> ....
> [  374.972211] CPU: 1 PID: 3725 Comm: kworker/u4:44 Tainted:
> G        W       4.4.0-98-generic #121-Ubuntu
> [  374.972213] Hardware name: Dell Inc. Edge Gateway 3002/      , BIOS 01.00.05
> 11/22/2017
> [  374.972223] Workqueue: events_unbound async_run_entry_fn
> [  374.972230]  0000000000000286 bf3948ba9db4c154 ffff88005a733ad8 ffffffff813fb2c3
> [  374.972235]  0000000000000000 ffffffffc04b8ac8 ffff88005a733b10 ffffffff810812e2
> [  374.972239]  ffff8800787c0840 ffff88006f18e700 0000000000000000 ffff88006f18ee90
> [  374.972240] Call Trace:
> [  374.972249]  [<ffffffff813fb2c3>] dump_stack+0x63/0x90
> [  374.972256]  [<ffffffff810812e2>] warn_slowpath_common+0x82/0xc0
> [  374.972260]  [<ffffffff8108142a>] warn_slowpath_null+0x1a/0x20
> [  374.972305]  [<ffffffffc045915a>] ieee80211_do_stop+0x6ea/0x810 [mac80211]
> [  374.972312]  [<ffffffff818441ee>] ? _raw_spin_unlock_bh+0x1e/0x20
> [  374.972317]  [<ffffffff817608ba>] ? dev_deactivate_many+0x20a/0x240
> [  374.972359]  [<ffffffffc045929a>] ieee80211_stop+0x1a/0x20 [mac80211]
> [  374.972365]  [<ffffffff81732a39>] __dev_close_many+0x99/0x100
> [  374.972369]  [<ffffffff81732b31>] dev_close_many+0x91/0x140
> [  374.972374]  [<ffffffff810e6171>] ? synchronize_sched_expedited+0x4e1/0x880
> [  374.972379]  [<ffffffff81734e2a>] dev_close.part.79+0x4a/0x70
> [  374.972383]  [<ffffffff81734e6a>] dev_close+0x1a/0x20
> [  374.972425]  [<ffffffffc035fac1>] cfg80211_shutdown_all_interfaces+0x41/0xa0
> [cfg80211]
> [  374.972467]  [<ffffffffc045a6c6>] ieee80211_remove_interfaces+0x56/0x1f0
> [mac80211]
> [  374.972506]  [<ffffffffc0441bca>] ieee80211_unregister_hw+0x4a/0x120 [mac80211]
>
> This is avoided by calling ieee80211_restart_hw and reinitializing
> device as usual in sdio restore and waiting in mac80211_resume
> until device is ready.
> Other issue may be due to firmware assertion observed at times for
> the length of bgscan probe request at restore. To avoid this,
> unnecessary IEs are cut from the frame at end.
>
> Signed-off-by: Prameela Rani Garnepudi <[hidden email]>
> Signed-off-by: Amitkumar Karwar <[hidden email]>
> ---
>  ubuntu/rsi/rsi_91x_hal.c      |  3 ++-
>  ubuntu/rsi/rsi_91x_mac80211.c | 15 ++++++++++++---
>  ubuntu/rsi/rsi_91x_main.c     |  1 +
>  ubuntu/rsi/rsi_91x_mgmt.c     | 24 +++++++++++++++++++++++-
>  ubuntu/rsi/rsi_91x_sdio.c     | 10 +++++++---
>  ubuntu/rsi/rsi_common.h       |  2 ++
>  ubuntu/rsi/rsi_main.h         |  2 ++
>  7 files changed, 49 insertions(+), 8 deletions(-)
>
> diff --git a/ubuntu/rsi/rsi_91x_hal.c b/ubuntu/rsi/rsi_91x_hal.c
> index cccedaf..971d5ee 100644
> --- a/ubuntu/rsi/rsi_91x_hal.c
> +++ b/ubuntu/rsi/rsi_91x_hal.c
> @@ -188,7 +188,8 @@ int rsi_prepare_data_desc(struct rsi_common *common, struct
> sk_buff *skb)
>   frame_desc[0] = cpu_to_le16((skb->len - FRAME_DESC_SZ) |
>      (RSI_WIFI_MGMT_Q << 12));
>   }
> - if ((skb->len - header_size) == 133) {
> + if (((skb->len - header_size) == 133) ||
> +    ((skb->len - header_size) == 131)) {
>   ven_rsi_dbg(INFO_ZONE, "*** Tx EAPOL 4*****\n");
>   frame_desc[1] |=
>   cpu_to_le16(RSI_DESC_REQUIRE_CFM_TO_HOST);
> diff --git a/ubuntu/rsi/rsi_91x_mac80211.c b/ubuntu/rsi/rsi_91x_mac80211.c
> index 8a4100a..c32a9bb 100644
> --- a/ubuntu/rsi/rsi_91x_mac80211.c
> +++ b/ubuntu/rsi/rsi_91x_mac80211.c
> @@ -363,6 +363,11 @@ static int rsi_mac80211_hw_scan_start(struct ieee80211_hw *hw,
>   if (common->fsm_state != FSM_MAC_INIT_DONE)
>   return -ENODEV;
>  
> +#ifdef CONFIG_RSI_WOW
> + if (common->wow_flags & RSI_WOW_ENABLED)
> + return -ENETDOWN;
> +#endif
> +
>   if (scan_req->n_channels == 0)
>   return -EINVAL;
>  
> @@ -404,8 +409,8 @@ static int rsi_mac80211_hw_scan_start(struct ieee80211_hw *hw,
>          return 0;
>  }
>  
> -static void rsi_mac80211_hw_scan_cancel(struct ieee80211_hw *hw,
> - struct ieee80211_vif *vif)
> +void rsi_mac80211_hw_scan_cancel(struct ieee80211_hw *hw,
> + struct ieee80211_vif *vif)
>  {
>   struct rsi_hw *adapter = hw->priv;
>   struct rsi_common *common = adapter->priv;
> @@ -444,6 +449,7 @@ static void rsi_mac80211_hw_scan_cancel(struct ieee80211_hw
> *hw,
>   common->hw_scan_cancel = false;
>   mutex_unlock(&common->mutex);
>  }
> +EXPORT_SYMBOL_GPL(rsi_mac80211_hw_scan_cancel);
>  #endif
>  
>  /**
> @@ -2452,8 +2458,11 @@ static int rsi_mac80211_resume(struct ieee80211_hw *hw)
>  
>   ven_rsi_dbg(INFO_ZONE, "%s: mac80211 resume\n", __func__);
>  
> - if (common->hibernate_resume)
> + if (common->hibernate_resume) {
> + if (common->reinit_hw)
> + wait_for_completion(&common->wlan_init_completion);
>   return 0;
> + }
>  
>  #ifdef CONFIG_VEN_RSI_WOW
>   mutex_lock(&common->mutex);
> diff --git a/ubuntu/rsi/rsi_91x_main.c b/ubuntu/rsi/rsi_91x_main.c
> index f7a2e3a..2350dbb61 100644
> --- a/ubuntu/rsi/rsi_91x_main.c
> +++ b/ubuntu/rsi/rsi_91x_main.c
> @@ -415,6 +415,7 @@ struct rsi_hw *ven_rsi_91x_init(void)
>   common->roc_timer.data = (unsigned long)common;
>   common->roc_timer.function = (void *)&rsi_roc_timeout;
>   init_timer(&common->roc_timer);
> + init_completion(&common->wlan_init_completion);
>  
>   common->init_done = true;
>   return adapter;
> diff --git a/ubuntu/rsi/rsi_91x_mgmt.c b/ubuntu/rsi/rsi_91x_mgmt.c
> index 9976054..94fadc7 100644
> --- a/ubuntu/rsi/rsi_91x_mgmt.c
> +++ b/ubuntu/rsi/rsi_91x_mgmt.c
> @@ -2343,6 +2343,21 @@ int rsi_send_probe_request(struct rsi_common *common,
>   }
>        
>   if (scan_type == 1) {
> + if (len > 120) {
> + u16 t_len = MIN_802_11_HDR_LEN;
> +
> + /* Cut some IEs */
> + pos = &skb->data[MIN_802_11_HDR_LEN];
> + while (true) {
> + if ((t_len + pos[1] + 2) > 120) {
> + skb_trim(skb, t_len);
> + len = t_len;
> + break;
> + }
> + t_len += pos[1] + 2;
> + pos += (pos[1] + 2);
> + }
> + }
>   common->bgscan_probe_req_len = len;
>   return 0;
>   }
> @@ -2635,7 +2650,14 @@ static int rsi_handle_ta_confirm(struct rsi_common *common,
> u8 *msg)
>   common->bb_rf_prog_count--;
>   if (!common->bb_rf_prog_count) {
>   common->fsm_state = FSM_MAC_INIT_DONE;
> - return rsi_mac80211_attach(common);
> + if (common->reinit_hw) {
> + common->hw_data_qs_blocked = false;
> + ieee80211_wake_queues(adapter->hw);
> + complete(&common->wlan_init_completion);
> + common->reinit_hw = false;
> + } else {
> + return rsi_mac80211_attach(common);
> + }
>   }
>   } else {
>   ven_rsi_dbg(INFO_ZONE,
> diff --git a/ubuntu/rsi/rsi_91x_sdio.c b/ubuntu/rsi/rsi_91x_sdio.c
> index 07e08f0..336f059 100644
> --- a/ubuntu/rsi/rsi_91x_sdio.c
> +++ b/ubuntu/rsi/rsi_91x_sdio.c
> @@ -1467,9 +1467,6 @@ static int rsi_sdio_reinit_device(struct rsi_hw *adapter)
>   for (ii = 0; ii < NUM_SOFT_QUEUES; ii++)
>   skb_queue_purge(&adapter->priv->tx_queue[ii]);
>  
> - /* Detach MAC */
> - ven_rsi_mac80211_detach(adapter);
> -
>   /* Initialize device again */
>   sdio_claim_host(pfunction);
>  
> @@ -1500,7 +1497,14 @@ int rsi_restore(struct device *dev)
>   adapter->priv->bt_fsm_state = BT_DEVICE_NOT_READY;
>   adapter->priv->iface_down = true;
>  
> + adapter->sc_nvifs = 0;
> + rsi_mac80211_hw_scan_cancel(adapter->hw, adapter->priv->scan_vif);
> + flush_workqueue(adapter->priv->scan_workqueue);
> + ieee80211_stop_queues(adapter->hw);
> + ieee80211_restart_hw(adapter->hw);
> +
>   /* Initialize device again */
> + adapter->priv->reinit_hw = true;
>   rsi_sdio_reinit_device(adapter);
>  
>  #ifdef CONFIG_VEN_RSI_WOW
> diff --git a/ubuntu/rsi/rsi_common.h b/ubuntu/rsi/rsi_common.h
> index d4385de..e7f1240 100644
> --- a/ubuntu/rsi/rsi_common.h
> +++ b/ubuntu/rsi/rsi_common.h
> @@ -115,4 +115,6 @@ struct ieee80211_vif *rsi_get_vif(struct rsi_hw *adapter, u8
> *mac);
>  #ifdef CONFIG_VEN_RSI_WOW
>  int rsi_config_wowlan(struct rsi_hw *adapter, struct cfg80211_wowlan *wowlan);
>  #endif
> +void rsi_mac80211_hw_scan_cancel(struct ieee80211_hw *hw,
> + struct ieee80211_vif *vif);
>  #endif
> diff --git a/ubuntu/rsi/rsi_main.h b/ubuntu/rsi/rsi_main.h
> index 3f55e36..53b9245 100644
> --- a/ubuntu/rsi/rsi_main.h
> +++ b/ubuntu/rsi/rsi_main.h
> @@ -331,6 +331,8 @@ struct rsi_common {
>   u8 ant_in_use;
>   bool suspend_in_prog;
>   bool hibernate_resume;
> + bool reinit_hw;
> + struct completion wlan_init_completion;
>  #ifdef CONFIG_VEN_RSI_WOW
>   u8 wow_flags;
>  #endif
--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: NACK/cmnt: [PATCH 1/4] UBUNTU: SAUCE: Redpine: fix wowlan issue

Amitkumar Karwar
On Tue, Jan 9, 2018 at 9:31 AM, Shrirang Bagul
<[hidden email]> wrote:
> Hi Amit,
>
> Several issues with the submission of this patch series -
> - It's a good practice to have a cover letter explaining the reason for the patch
> series

I will take care of this in updated version.

> - BugLinks in the patch must point to public bugs against linux package.

Currently I am using below bugs in this patch series. Do you want me
to add linux package for them or create new bugs against linux
package?

 BugLink: https://bugs.launchpad.net/bugs/1736097
 BugLink: https://bugs.launchpad.net/bugs/1738169

>
> Please refer to the SRU submission guidelines (see: https://wiki.ubuntu.com/Kernel/De
> v/StablePatchFormat)
> and resend the patches. I am NACKing this series.

Sure. I will go through the guidelines.

Regards,
Amit

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: NACK/cmnt: [PATCH 1/4] UBUNTU: SAUCE: Redpine: fix wowlan issue

Shrirang Bagul
On Tue, 2018-01-09 at 12:37 +0530, Amitkumar Karwar wrote:
> On Tue, Jan 9, 2018 at 9:31 AM, Shrirang Bagul
> <[hidden email]> wrote:
> > Hi Amit,
> >
> > Several issues with the submission of this patch series -
> > - It's a good practice to have a cover letter explaining the reason for the patch
> > series
>
> I will take care of this in updated version.
Thanks.
>
> > - BugLinks in the patch must point to public bugs against linux package.
>
> Currently I am using below bugs in this patch series. Do you want me
> to add linux package for them or create new bugs against linux
> package?
>
>  BugLink: https://bugs.launchpad.net/bugs/1736097
>  BugLink: https://bugs.launchpad.net/bugs/1738169
These are private bugs for internal tracking and cannot be accessed by everyone.
However, when you SRU patches, they are applied against https://launchpad.net/ubuntu/
+source/linux kernel which is open to all. Hence you'll have to file a bug against
this package.
One more detail I forgot to mention is, since these patches are against the Ubuntu
Xenial kernel, please include the '[X][SRU]' or '[Xenial SRU]' prefix in the subject
lines of the individual patches in the series.

/Shrirang

>
> >
> > Please refer to the SRU submission guidelines (see: https://wiki.ubuntu.com/Kerne
> > l/De
> > v/StablePatchFormat)
> > and resend the patches. I am NACKing this series.
>
> Sure. I will go through the guidelines.
>
> Regards,
> Amit
--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (817 bytes) Download Attachment