A soft lockup was observed on ARM multicore platform while UDP
RX iperf was running on station.
Reason for this is delay_main_task was not taken into consideration while
jumping to process_start. Now if delay_main_task is true, we would exit
mwifiex_main_process instead of going to process_start again.
This ensure other process is scheduled on this CPU and soft lockup is avoided.
Signed-off-by: Amitkumar Karwar <[email protected]>
Signed-off-by: Kevin Gan <[email protected]>
Signed-off-by: Marc Yang <[email protected]>
Signed-off-by: Avinash Patil <[email protected]>
Signed-off-by: Cathy Luo <[email protected]>
---
drivers/net/wireless/mwifiex/main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index b522f7c..be52189 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -330,7 +330,8 @@ process_start:
} while (true);
spin_lock_irqsave(&adapter->main_proc_lock, flags);
- if ((adapter->int_status) || IS_CARD_RX_RCVD(adapter)) {
+ if (!adapter->delay_main_work &&
+ (adapter->int_status || IS_CARD_RX_RCVD(adapter))) {
spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
goto process_start;
}
--
1.8.1.4
SKB lists have their own lock. So this lock is not needed.
Signed-off-by: Avinash Patil <[email protected]>
---
drivers/net/wireless/mwifiex/init.c | 1 -
drivers/net/wireless/mwifiex/main.h | 2 --
drivers/net/wireless/mwifiex/pcie.c | 4 ----
drivers/net/wireless/mwifiex/sdio.c | 3 ---
4 files changed, 10 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c
index f7c97cf..580aa45 100644
--- a/drivers/net/wireless/mwifiex/init.c
+++ b/drivers/net/wireless/mwifiex/init.c
@@ -447,7 +447,6 @@ int mwifiex_init_lock_list(struct mwifiex_adapter *adapter)
spin_lock_init(&adapter->cmd_free_q_lock);
spin_lock_init(&adapter->cmd_pending_q_lock);
spin_lock_init(&adapter->scan_pending_q_lock);
- spin_lock_init(&adapter->rx_q_lock);
spin_lock_init(&adapter->rx_proc_lock);
skb_queue_head_init(&adapter->usb_rx_data_q);
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index 1a99999..b5dc78b 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -763,8 +763,6 @@ struct mwifiex_adapter {
struct list_head scan_pending_q;
/* spin lock for scan_pending_q */
spinlock_t scan_pending_q_lock;
- /* spin lock for RX queue */
- spinlock_t rx_q_lock;
/* spin lock for RX processing routine */
spinlock_t rx_proc_lock;
struct sk_buff_head usb_rx_data_q;
diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c
index 1504b16..7e8d9b0 100644
--- a/drivers/net/wireless/mwifiex/pcie.c
+++ b/drivers/net/wireless/mwifiex/pcie.c
@@ -1233,7 +1233,6 @@ static int mwifiex_pcie_process_recv_data(struct mwifiex_adapter *adapter)
struct sk_buff *skb_tmp = NULL;
struct mwifiex_pcie_buf_desc *desc;
struct mwifiex_pfu_buf_desc *desc2;
- unsigned long flags;
if (!mwifiex_pcie_ok_to_access_hw(adapter))
mwifiex_pm_wakeup_card(adapter);
@@ -1285,10 +1284,7 @@ static int mwifiex_pcie_process_recv_data(struct mwifiex_adapter *adapter)
card->rxbd_rdptr, wrptr, rx_len);
skb_pull(skb_data, INTF_HEADER_LEN);
if (adapter->rx_work_enabled) {
- spin_lock_irqsave(&adapter->rx_q_lock, flags);
skb_queue_tail(&adapter->rx_data_q, skb_data);
- spin_unlock_irqrestore(&adapter->rx_q_lock,
- flags);
adapter->data_received = true;
atomic_inc(&adapter->rx_pending);
} else {
diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
index ea8fc58..db9e4e3 100644
--- a/drivers/net/wireless/mwifiex/sdio.c
+++ b/drivers/net/wireless/mwifiex/sdio.c
@@ -1039,7 +1039,6 @@ static int mwifiex_decode_rx_packet(struct mwifiex_adapter *adapter,
struct sk_buff *skb, u32 upld_typ)
{
u8 *cmd_buf;
- unsigned long flags;
__le16 *curr_ptr = (__le16 *)skb->data;
u16 pkt_len = le16_to_cpu(*curr_ptr);
@@ -1050,9 +1049,7 @@ static int mwifiex_decode_rx_packet(struct mwifiex_adapter *adapter,
case MWIFIEX_TYPE_DATA:
dev_dbg(adapter->dev, "info: --- Rx: Data packet ---\n");
if (adapter->rx_work_enabled) {
- spin_lock_irqsave(&adapter->rx_q_lock, flags);
skb_queue_tail(&adapter->rx_data_q, skb);
- spin_unlock_irqrestore(&adapter->rx_q_lock, flags);
adapter->data_received = true;
atomic_inc(&adapter->rx_pending);
} else {
--
1.8.1.4
Hi John,
Yes; I have sent 2/3 as well; maybe there was some issue. I will resend V1.
Thanks,
Avinash.
________________________________________
From: John W. Linville [[email protected]]
Sent: Friday, September 26, 2014 11:02 PM
To: Avinash Patil
Cc: [email protected]; Amitkumar Karwar; Xinming Hu; Marc Yang; Cathy Luo; Maithili Hinge
Subject: Re: [PATCH 3/3] mwifiex: remove unnecessary rx_q lock
I only got 1/3 and 3/3 -- was there a 2/3 posted?
On Thu, Sep 25, 2014 at 05:16:42PM +0530, Avinash Patil wrote:
> SKB lists have their own lock. So this lock is not needed.
>
> Signed-off-by: Avinash Patil <[email protected]>
> ---
> drivers/net/wireless/mwifiex/init.c | 1 -
> drivers/net/wireless/mwifiex/main.h | 2 --
> drivers/net/wireless/mwifiex/pcie.c | 4 ----
> drivers/net/wireless/mwifiex/sdio.c | 3 ---
> 4 files changed, 10 deletions(-)
>
> diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c
> index f7c97cf..580aa45 100644
> --- a/drivers/net/wireless/mwifiex/init.c
> +++ b/drivers/net/wireless/mwifiex/init.c
> @@ -447,7 +447,6 @@ int mwifiex_init_lock_list(struct mwifiex_adapter *adapter)
> spin_lock_init(&adapter->cmd_free_q_lock);
> spin_lock_init(&adapter->cmd_pending_q_lock);
> spin_lock_init(&adapter->scan_pending_q_lock);
> - spin_lock_init(&adapter->rx_q_lock);
> spin_lock_init(&adapter->rx_proc_lock);
>
> skb_queue_head_init(&adapter->usb_rx_data_q);
> diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
> index 1a99999..b5dc78b 100644
> --- a/drivers/net/wireless/mwifiex/main.h
> +++ b/drivers/net/wireless/mwifiex/main.h
> @@ -763,8 +763,6 @@ struct mwifiex_adapter {
> struct list_head scan_pending_q;
> /* spin lock for scan_pending_q */
> spinlock_t scan_pending_q_lock;
> - /* spin lock for RX queue */
> - spinlock_t rx_q_lock;
> /* spin lock for RX processing routine */
> spinlock_t rx_proc_lock;
> struct sk_buff_head usb_rx_data_q;
> diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c
> index 1504b16..7e8d9b0 100644
> --- a/drivers/net/wireless/mwifiex/pcie.c
> +++ b/drivers/net/wireless/mwifiex/pcie.c
> @@ -1233,7 +1233,6 @@ static int mwifiex_pcie_process_recv_data(struct mwifiex_adapter *adapter)
> struct sk_buff *skb_tmp = NULL;
> struct mwifiex_pcie_buf_desc *desc;
> struct mwifiex_pfu_buf_desc *desc2;
> - unsigned long flags;
>
> if (!mwifiex_pcie_ok_to_access_hw(adapter))
> mwifiex_pm_wakeup_card(adapter);
> @@ -1285,10 +1284,7 @@ static int mwifiex_pcie_process_recv_data(struct mwifiex_adapter *adapter)
> card->rxbd_rdptr, wrptr, rx_len);
> skb_pull(skb_data, INTF_HEADER_LEN);
> if (adapter->rx_work_enabled) {
> - spin_lock_irqsave(&adapter->rx_q_lock, flags);
> skb_queue_tail(&adapter->rx_data_q, skb_data);
> - spin_unlock_irqrestore(&adapter->rx_q_lock,
> - flags);
> adapter->data_received = true;
> atomic_inc(&adapter->rx_pending);
> } else {
> diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
> index ea8fc58..db9e4e3 100644
> --- a/drivers/net/wireless/mwifiex/sdio.c
> +++ b/drivers/net/wireless/mwifiex/sdio.c
> @@ -1039,7 +1039,6 @@ static int mwifiex_decode_rx_packet(struct mwifiex_adapter *adapter,
> struct sk_buff *skb, u32 upld_typ)
> {
> u8 *cmd_buf;
> - unsigned long flags;
> __le16 *curr_ptr = (__le16 *)skb->data;
> u16 pkt_len = le16_to_cpu(*curr_ptr);
>
> @@ -1050,9 +1049,7 @@ static int mwifiex_decode_rx_packet(struct mwifiex_adapter *adapter,
> case MWIFIEX_TYPE_DATA:
> dev_dbg(adapter->dev, "info: --- Rx: Data packet ---\n");
> if (adapter->rx_work_enabled) {
> - spin_lock_irqsave(&adapter->rx_q_lock, flags);
> skb_queue_tail(&adapter->rx_data_q, skb);
> - spin_unlock_irqrestore(&adapter->rx_q_lock, flags);
> adapter->data_received = true;
> atomic_inc(&adapter->rx_pending);
> } else {
> --
> 1.8.1.4
>
>
--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.
I only got 1/3 and 3/3 -- was there a 2/3 posted?
On Thu, Sep 25, 2014 at 05:16:42PM +0530, Avinash Patil wrote:
> SKB lists have their own lock. So this lock is not needed.
>
> Signed-off-by: Avinash Patil <[email protected]>
> ---
> drivers/net/wireless/mwifiex/init.c | 1 -
> drivers/net/wireless/mwifiex/main.h | 2 --
> drivers/net/wireless/mwifiex/pcie.c | 4 ----
> drivers/net/wireless/mwifiex/sdio.c | 3 ---
> 4 files changed, 10 deletions(-)
>
> diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c
> index f7c97cf..580aa45 100644
> --- a/drivers/net/wireless/mwifiex/init.c
> +++ b/drivers/net/wireless/mwifiex/init.c
> @@ -447,7 +447,6 @@ int mwifiex_init_lock_list(struct mwifiex_adapter *adapter)
> spin_lock_init(&adapter->cmd_free_q_lock);
> spin_lock_init(&adapter->cmd_pending_q_lock);
> spin_lock_init(&adapter->scan_pending_q_lock);
> - spin_lock_init(&adapter->rx_q_lock);
> spin_lock_init(&adapter->rx_proc_lock);
>
> skb_queue_head_init(&adapter->usb_rx_data_q);
> diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
> index 1a99999..b5dc78b 100644
> --- a/drivers/net/wireless/mwifiex/main.h
> +++ b/drivers/net/wireless/mwifiex/main.h
> @@ -763,8 +763,6 @@ struct mwifiex_adapter {
> struct list_head scan_pending_q;
> /* spin lock for scan_pending_q */
> spinlock_t scan_pending_q_lock;
> - /* spin lock for RX queue */
> - spinlock_t rx_q_lock;
> /* spin lock for RX processing routine */
> spinlock_t rx_proc_lock;
> struct sk_buff_head usb_rx_data_q;
> diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c
> index 1504b16..7e8d9b0 100644
> --- a/drivers/net/wireless/mwifiex/pcie.c
> +++ b/drivers/net/wireless/mwifiex/pcie.c
> @@ -1233,7 +1233,6 @@ static int mwifiex_pcie_process_recv_data(struct mwifiex_adapter *adapter)
> struct sk_buff *skb_tmp = NULL;
> struct mwifiex_pcie_buf_desc *desc;
> struct mwifiex_pfu_buf_desc *desc2;
> - unsigned long flags;
>
> if (!mwifiex_pcie_ok_to_access_hw(adapter))
> mwifiex_pm_wakeup_card(adapter);
> @@ -1285,10 +1284,7 @@ static int mwifiex_pcie_process_recv_data(struct mwifiex_adapter *adapter)
> card->rxbd_rdptr, wrptr, rx_len);
> skb_pull(skb_data, INTF_HEADER_LEN);
> if (adapter->rx_work_enabled) {
> - spin_lock_irqsave(&adapter->rx_q_lock, flags);
> skb_queue_tail(&adapter->rx_data_q, skb_data);
> - spin_unlock_irqrestore(&adapter->rx_q_lock,
> - flags);
> adapter->data_received = true;
> atomic_inc(&adapter->rx_pending);
> } else {
> diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
> index ea8fc58..db9e4e3 100644
> --- a/drivers/net/wireless/mwifiex/sdio.c
> +++ b/drivers/net/wireless/mwifiex/sdio.c
> @@ -1039,7 +1039,6 @@ static int mwifiex_decode_rx_packet(struct mwifiex_adapter *adapter,
> struct sk_buff *skb, u32 upld_typ)
> {
> u8 *cmd_buf;
> - unsigned long flags;
> __le16 *curr_ptr = (__le16 *)skb->data;
> u16 pkt_len = le16_to_cpu(*curr_ptr);
>
> @@ -1050,9 +1049,7 @@ static int mwifiex_decode_rx_packet(struct mwifiex_adapter *adapter,
> case MWIFIEX_TYPE_DATA:
> dev_dbg(adapter->dev, "info: --- Rx: Data packet ---\n");
> if (adapter->rx_work_enabled) {
> - spin_lock_irqsave(&adapter->rx_q_lock, flags);
> skb_queue_tail(&adapter->rx_data_q, skb);
> - spin_unlock_irqrestore(&adapter->rx_q_lock, flags);
> adapter->data_received = true;
> atomic_inc(&adapter->rx_pending);
> } else {
> --
> 1.8.1.4
>
>
--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.