diff mbox series

[Xenial,SRU,v2] UBUNTU: SAUCE: Redpine: improve cancel_hw_scan handling to fix kernel panic

Message ID 1529502223-15116-1-git-send-email-siva8118@gmail.com
State New
Headers show
Series [Xenial,SRU,v2] UBUNTU: SAUCE: Redpine: improve cancel_hw_scan handling to fix kernel panic | expand

Commit Message

Siva Rebbagondla June 20, 2018, 1:43 p.m. UTC
From: Siva Rebbagondla <siva.rebbagondla@redpinesignals.com>

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1773410
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1777850

Kernel panic is observed when network manager is stopped while system
is entering into hibernation. The root cause of the issue is scan work
function keeps running even after cancel_hw_scan() call.
Issue is resolved by calling cancel_work_sync().

[ 1171.913244] BUG: unable to handle page request at 00000000001067e38
[ 1171.913248] IP: cfg80211_scan_done+0xb0/0xc0 [cfg80211]
[ 1171.913554] Hardware name: Dell Inc. Edge Gateway 3003/      , BIOS 01.00.06 01/22/2018
[ 1171.913668] Workqueue: phy1 ieee80211_scan_work [mac80211]
[ 1171.913773] RIP: 0010:cfg80211_scan_done+0xb0/0xc0 [cfg80211]
[ 1171.913780] RSP: 0018:ffffc1fe41b47dc8 EFLAGS: 00010286
[ 1171.913789] RAX: 0000000000000001 RBX: ffffffffc0e60120 RCX: 0000000100080006
[ 1171.913794] RDX: ffff9eeab7e3bc58 RSI: ffff9eeab0c69080 RDI: ffff9eeab7e3bc00
[ 1171.913799] RBP: ffff9eeab7e3bc00 R08: 00000000b7e3b201 R09: 0000000100080006
[ 1171.913805] R10: ffffc1fe41b47d20 R11: 0000000000000000 R12: ffff9eeab0c69080
[ 1171.913810] R13: 0000000000000022 R14: ffff9eeab0c68760 R15: ffff9eeab7af3c00
[ 1171.913817] FS:  0000000000000000(0000) GS:ffff9eeab0000000(0000) knlGS:0000000000000000
[ 1171.913823] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1171.913828] CR2: 00007f76c73ac190 CR3: 000000006e20a000 CR4: 00000000001006f0
[ 1171.913833] Call Trace:
[ 1171.913864]  ? rsi_mac80211_sta_remove+0x260/0x260 [rsi_91x]
[ 1171.913971]  __ieee80211_scan_completed+0xb1/0x390 [mac80211]
[ 1171.914078]  ieee80211_scan_work+0x7e/0x480 [mac80211]
[ 1171.914098]  process_one_work+0x142/0x3d0
[ 1171.914111]  worker_thread+0x229/0x440
[ 1171.914122]  kthread+0xf5/0x130
[ 1171.914132]  ? process_one_work+0x3d0/0x3d0
[ 1171.914140]  ? kthread_associate_blkcg+0x90/0x90
[ 1171.914152]  ret_from_fork+0x35/0x40

Signed-off-by: Siva Rebbagondla <siva.rebbagondla@redpinesignals.com>
---
v2: Added enhancement in case of AP mode [Shrirang]
---
 ubuntu/rsi/rsi_91x_mac80211.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Siva Rebbagondla June 21, 2018, 8:17 a.m. UTC | #1
Shrirang,

I will re-submit the patch and also, i will take care of BugLink format.

Thanks.

On Thu, Jun 21, 2018 at 1:03 PM, Shrirang Bagul <
shrirang.bagul@canonical.com> wrote:

> On Thu, 2018-06-21 at 12:06 +0530, Siva Rebbagondla wrote:
>
>
> On Thu, Jun 21, 2018 at 11:27 AM, Shrirang Bagul <
> shrirang.bagul@canonical.com> wrote:
>
> On Wed, 2018-06-20 at 19:13 +0530, Siva Rebbagondla wrote:
> > From: Siva Rebbagondla <siva.rebbagondla@redpinesignals.com>
> >
> > https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1773410
> > https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1777850
> >
> > Kernel panic is observed when network manager is stopped while system
> > is entering into hibernation. The root cause of the issue is scan work
> > function keeps running even after cancel_hw_scan() call.
> > Issue is resolved by calling cancel_work_sync().
> >
> > [ 1171.913244] BUG: unable to handle page request at 00000000001067e38
> > [ 1171.913248] IP: cfg80211_scan_done+0xb0/0xc0 [cfg80211]
> > [ 1171.913554] Hardware name: Dell Inc. Edge Gateway 3003/      , BIOS
> 01.00.06
> > 01/22/2018
> > [ 1171.913668] Workqueue: phy1 ieee80211_scan_work [mac80211]
> > [ 1171.913773] RIP: 0010:cfg80211_scan_done+0xb0/0xc0 [cfg80211]
> > [ 1171.913780] RSP: 0018:ffffc1fe41b47dc8 EFLAGS: 00010286
> > [ 1171.913789] RAX: 0000000000000001 RBX: ffffffffc0e60120 RCX:
> 0000000100080006
> > [ 1171.913794] RDX: ffff9eeab7e3bc58 RSI: ffff9eeab0c69080 RDI:
> ffff9eeab7e3bc00
> > [ 1171.913799] RBP: ffff9eeab7e3bc00 R08: 00000000b7e3b201 R09:
> 0000000100080006
> > [ 1171.913805] R10: ffffc1fe41b47d20 R11: 0000000000000000 R12:
> ffff9eeab0c69080
> > [ 1171.913810] R13: 0000000000000022 R14: ffff9eeab0c68760 R15:
> ffff9eeab7af3c00
> > [ 1171.913817] FS:  0000000000000000(0000) GS:ffff9eeab0000000(0000)
> > knlGS:0000000000000000
> > [ 1171.913823] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> > [ 1171.913828] CR2: 00007f76c73ac190 CR3: 000000006e20a000 CR4:
> 00000000001006f0
> > [ 1171.913833] Call Trace:
> > [ 1171.913864]  ? rsi_mac80211_sta_remove+0x260/0x260 [rsi_91x]
> > [ 1171.913971]  __ieee80211_scan_completed+0xb1/0x390 [mac80211]
> > [ 1171.914078]  ieee80211_scan_work+0x7e/0x480 [mac80211]
> > [ 1171.914098]  process_one_work+0x142/0x3d0
> > [ 1171.914111]  worker_thread+0x229/0x440
> > [ 1171.914122]  kthread+0xf5/0x130
> > [ 1171.914132]  ? process_one_work+0x3d0/0x3d0
> > [ 1171.914140]  ? kthread_associate_blkcg+0x90/0x90
> > [ 1171.914152]  ret_from_fork+0x35/0x40
> >
> > Signed-off-by: Siva Rebbagondla <siva.rebbagondla@redpinesignals.com>
> Acked-By: Shrirang Bagul <shrirang.bagul@canonical.com>
> > ---
> > v2: Added enhancement in case of AP mode [Shrirang]
> Why do you need my name in the changelog of the patch?
>
> Hi Shrirang,
>
> Because, As you pointed v1 patch is not solved the issue and need some
> enhancement in patch.
>
> If this is not required, i will remove this in upcoming patches, if any.
> Thanks
>
> Siva,
> I don't deserve so much credit, if possible please remove it and re-submit.
> While you are at it, also make sure the BugLink is in proper format:
>
> BugLink: https://launchpad.net/bugs/<public_bug_number>
> <https://launchpad.net/bugs/&lt;public_bug_number%3E>
>
> Thanks,
> Shrirang
>
> > ---
> >  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 36c0cfd..a797826 100644
> > --- a/ubuntu/rsi/rsi_91x_mac80211.c
> > +++ b/ubuntu/rsi/rsi_91x_mac80211.c
> > @@ -428,6 +428,7 @@ void rsi_mac80211_hw_scan_cancel(struct
> ieee80211_hw *hw,
> >               rsi_wait_event(&common->cancel_hw_scan_event,
> >                              EVENT_WAIT_FOREVER);
> >               rsi_reset_event(&common->cancel_hw_scan_event);
> > +             cancel_work_sync(&common->scan_work);
> >               common->scan_request = NULL;
> >       }
> >
> > @@ -631,6 +632,7 @@ static void rsi_mac80211_stop(struct ieee80211_hw
> *hw)
> >
> >       common->iface_down = true;
> >  #ifdef CONFIG_HW_SCAN_OFFLOAD
> > +     cancel_work_sync(&common->scan_work);
> >       if (common->scan_in_prog)
> >               common->scan_in_prog = false;
> >  #endif
>
>
>
<div dir="ltr"><div class="gmail_default" style="color:#073763">Shrirang,</div><div class="gmail_default" style="color:#073763"><br></div><div class="gmail_default" style="color:#073763">I will re-submit the patch and also, i will take care of BugLink format.</div><div class="gmail_default" style="color:#073763"><br></div><div class="gmail_default" style="color:#073763">Thanks.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 21, 2018 at 1:03 PM, Shrirang Bagul <span dir="ltr">&lt;<a href="mailto:shrirang.bagul@canonical.com" target="_blank">shrirang.bagul@canonical.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div class="h5"><div>On Thu, 2018-06-21 at 12:06 +0530, Siva Rebbagondla wrote:</div><blockquote type="cite" style="margin:0 0 0 .8ex;border-left:2px #729fcf solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 21, 2018 at 11:27 AM, Shrirang Bagul <span dir="ltr">&lt;<a href="mailto:shrirang.bagul@canonical.com" target="_blank">shrirang.bagul@canonical.com</a>&gt;</span> wrote:<br><blockquote type="cite" style="margin:0 0 0 .8ex;border-left:2px #729fcf solid;padding-left:1ex">On Wed, 2018-06-20 at 19:13 +0530, Siva Rebbagondla wrote:<br>
&gt; From: Siva Rebbagondla &lt;<a href="mailto:siva.rebbagondla@redpinesignals.com" target="_blank">siva.rebbagondla@redpinesigna<wbr>ls.com</a>&gt;<br>
&gt; <br>
&gt; <a href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1773410" rel="noreferrer" target="_blank">https://bugs.launchpad.net/ubu<wbr>ntu/+source/linux/+bug/1773410</a><br>
&gt; <a href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1777850" rel="noreferrer" target="_blank">https://bugs.launchpad.net/ubu<wbr>ntu/+source/linux/+bug/1777850</a><br>
&gt; <br>
&gt; Kernel panic is observed when network manager is stopped while system<br>
&gt; is entering into hibernation. The root cause of the issue is scan work<br>
&gt; function keeps running even after cancel_hw_scan() call.<br>
&gt; Issue is resolved by calling cancel_work_sync().<br>
&gt; <br>
&gt; [ 1171.913244] BUG: unable to handle page request at 00000000001067e38<br>
&gt; [ 1171.913248] IP: cfg80211_scan_done+0xb0/0xc0 [cfg80211]<br>
&gt; [ 1171.913554] Hardware name: Dell Inc. Edge Gateway 3003/      , BIOS 01.00.06<br>
&gt; 01/22/2018<br>
&gt; [ 1171.913668] Workqueue: phy1 ieee80211_scan_work [mac80211]<br>
&gt; [ 1171.913773] RIP: 0010:cfg80211_scan_done+0xb0/0<wbr>xc0 [cfg80211]<br>
&gt; [ 1171.913780] RSP: 0018:ffffc1fe41b47dc8 EFLAGS: 00010286<br>
&gt; [ 1171.913789] RAX: 0000000000000001 RBX: ffffffffc0e60120 RCX: 0000000100080006<br>
&gt; [ 1171.913794] RDX: ffff9eeab7e3bc58 RSI: ffff9eeab0c69080 RDI: ffff9eeab7e3bc00<br>
&gt; [ 1171.913799] RBP: ffff9eeab7e3bc00 R08: 00000000b7e3b201 R09: 0000000100080006<br>
&gt; [ 1171.913805] R10: ffffc1fe41b47d20 R11: 0000000000000000 R12: ffff9eeab0c69080<br>
&gt; [ 1171.913810] R13: 0000000000000022 R14: ffff9eeab0c68760 R15: ffff9eeab7af3c00<br>
&gt; [ 1171.913817] FS:  0000000000000000(0000) GS:ffff9eeab0000000(0000)<br>
&gt; knlGS:0000000000000000<br>
&gt; [ 1171.913823] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033<br>
&gt; [ 1171.913828] CR2: 00007f76c73ac190 CR3: 000000006e20a000 CR4: 00000000001006f0<br>
&gt; [ 1171.913833] Call Trace:<br>
&gt; [ 1171.913864]  ? rsi_mac80211_sta_remove+0x260/<wbr>0x260 [rsi_91x]<br>
&gt; [ 1171.913971]  __ieee80211_scan_completed+0xb<wbr>1/0x390 [mac80211]<br>
&gt; [ 1171.914078]  ieee80211_scan_work+0x7e/0x480 [mac80211]<br>
&gt; [ 1171.914098]  process_one_work+0x142/0x3d0<br>
&gt; [ 1171.914111]  worker_thread+0x229/0x440<br>
&gt; [ 1171.914122]  kthread+0xf5/0x130<br>
&gt; [ 1171.914132]  ? process_one_work+0x3d0/0x3d0<br>
&gt; [ 1171.914140]  ? kthread_associate_blkcg+0x90/0<wbr>x90<br>
&gt; [ 1171.914152]  ret_from_fork+0x35/0x40<br>
&gt; <br>
&gt; Signed-off-by: Siva Rebbagondla &lt;<a href="mailto:siva.rebbagondla@redpinesignals.com" target="_blank">siva.rebbagondla@redpinesigna<wbr>ls.com</a>&gt;<br>
Acked-By: Shrirang Bagul &lt;<a href="mailto:shrirang.bagul@canonical.com" target="_blank">shrirang.bagul@canonical.com</a>&gt;<br>
&gt; ---<br>
&gt; v2: Added enhancement in case of AP mode [Shrirang]<br>
Why do you need my name in the changelog of the patch?<br></blockquote><div><div style="color:rgb(7,55,99);display:inline" class="gmail_default">Hi Shrirang,</div><div style="color:rgb(7,55,99);display:inline" class="gmail_default"><br></div><div style="color:rgb(7,55,99);display:inline" class="gmail_default">Because, As you pointed v1 patch is not solved the issue and need some enhancement in patch.</div><div style="color:rgb(7,55,99);display:inline" class="gmail_default"><br></div><div style="color:rgb(7,55,99);display:inline" class="gmail_default"> </div><div style="color:rgb(7,55,99);display:inline" class="gmail_default">If this is not required, i will remove this in upcoming patches, if any. Thanks<br></div></div></div></div></div></blockquote></div></div><div>Siva,</div><div>I don&#39;t deserve so much credit, if possible please remove it and re-submit.</div><div>While you are at it, also make sure the BugLink is in proper format:</div><div><br></div><div>BugLink: <a href="https://launchpad.net/bugs/&amp;lt;public_bug_number%3E" target="_blank">https://launchpad.net/bugs/&lt;<wbr>public_bug_number&gt;</a></div><div><br></div><div>Thanks,</div><div>Shrirang</div><span class=""><blockquote type="cite" style="margin:0 0 0 .8ex;border-left:2px #729fcf solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote type="cite" style="margin:0 0 0 .8ex;border-left:2px #729fcf solid;padding-left:1ex">
&gt; ---<br>
&gt;  ubuntu/rsi/rsi_91x_mac80211.c | 2 ++<br>
&gt;  1 file changed, 2 insertions(+)<br>
&gt; <br>
&gt; diff --git a/ubuntu/rsi/rsi_91x_mac80211.<wbr>c b/ubuntu/rsi/rsi_91x_mac80211.<wbr>c<br>
&gt; index 36c0cfd..a797826 100644<br>
&gt; --- a/ubuntu/rsi/rsi_91x_mac80211.<wbr>c<br>
&gt; +++ b/ubuntu/rsi/rsi_91x_mac80211.<wbr>c<br>
&gt; @@ -428,6 +428,7 @@ void rsi_mac80211_hw_scan_cancel(st<wbr>ruct ieee80211_hw *hw,<br>
&gt;               rsi_wait_event(&amp;common-&gt;cance<wbr>l_hw_scan_event,<br>
&gt;                              EVENT_WAIT_FOREVER);<br>
&gt;               rsi_reset_event(&amp;common-&gt;canc<wbr>el_hw_scan_event);<br>
&gt; +             cancel_work_sync(&amp;common-&gt;sca<wbr>n_work);<br>
&gt;               common-&gt;scan_request = NULL;<br>
&gt;       }<br>
&gt;       <br>
&gt; @@ -631,6 +632,7 @@ static void rsi_mac80211_stop(struct ieee80211_hw *hw)<br>
&gt;       <br>
&gt;       common-&gt;iface_down = true;<br>
&gt;  #ifdef CONFIG_HW_SCAN_OFFLOAD<br>
&gt; +     cancel_work_sync(&amp;common-&gt;sca<wbr>n_work);<br>
&gt;       if (common-&gt;scan_in_prog) <br>
&gt;               common-&gt;scan_in_prog = false;<br>
&gt;  #endif</blockquote></div><br></div></div>
</blockquote></span></div></blockquote></div><br></div>
Shrirang Bagul June 21, 2018, 9:49 a.m. UTC | #2
On Wed, 2018-06-20 at 19:13 +0530, Siva Rebbagondla wrote:
> From: Siva Rebbagondla <siva.rebbagondla@redpinesignals.com>
> 
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1773410
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1777850
> 
> Kernel panic is observed when network manager is stopped while system
> is entering into hibernation. The root cause of the issue is scan work
> function keeps running even after cancel_hw_scan() call.
> Issue is resolved by calling cancel_work_sync().
> 
> [ 1171.913244] BUG: unable to handle page request at 00000000001067e38
> [ 1171.913248] IP: cfg80211_scan_done+0xb0/0xc0 [cfg80211]
> [ 1171.913554] Hardware name: Dell Inc. Edge Gateway 3003/      , BIOS 01.00.06
> 01/22/2018
> [ 1171.913668] Workqueue: phy1 ieee80211_scan_work [mac80211]
> [ 1171.913773] RIP: 0010:cfg80211_scan_done+0xb0/0xc0 [cfg80211]
> [ 1171.913780] RSP: 0018:ffffc1fe41b47dc8 EFLAGS: 00010286
> [ 1171.913789] RAX: 0000000000000001 RBX: ffffffffc0e60120 RCX: 0000000100080006
> [ 1171.913794] RDX: ffff9eeab7e3bc58 RSI: ffff9eeab0c69080 RDI: ffff9eeab7e3bc00
> [ 1171.913799] RBP: ffff9eeab7e3bc00 R08: 00000000b7e3b201 R09: 0000000100080006
> [ 1171.913805] R10: ffffc1fe41b47d20 R11: 0000000000000000 R12: ffff9eeab0c69080
> [ 1171.913810] R13: 0000000000000022 R14: ffff9eeab0c68760 R15: ffff9eeab7af3c00
> [ 1171.913817] FS:  0000000000000000(0000) GS:ffff9eeab0000000(0000)
> knlGS:0000000000000000
> [ 1171.913823] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [ 1171.913828] CR2: 00007f76c73ac190 CR3: 000000006e20a000 CR4: 00000000001006f0
> [ 1171.913833] Call Trace:
> [ 1171.913864]  ? rsi_mac80211_sta_remove+0x260/0x260 [rsi_91x]
> [ 1171.913971]  __ieee80211_scan_completed+0xb1/0x390 [mac80211]
> [ 1171.914078]  ieee80211_scan_work+0x7e/0x480 [mac80211]
> [ 1171.914098]  process_one_work+0x142/0x3d0
> [ 1171.914111]  worker_thread+0x229/0x440
> [ 1171.914122]  kthread+0xf5/0x130
> [ 1171.914132]  ? process_one_work+0x3d0/0x3d0
> [ 1171.914140]  ? kthread_associate_blkcg+0x90/0x90
> [ 1171.914152]  ret_from_fork+0x35/0x40
> 
> Signed-off-by: Siva Rebbagondla <siva.rebbagondla@redpinesignals.com>
This patch has been superseeded. Nack'ing this version.

/Shrirang
> ---
> v2: Added enhancement in case of AP mode [Shrirang]
> ---
>  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 36c0cfd..a797826 100644
> --- a/ubuntu/rsi/rsi_91x_mac80211.c
> +++ b/ubuntu/rsi/rsi_91x_mac80211.c
> @@ -428,6 +428,7 @@ void rsi_mac80211_hw_scan_cancel(struct ieee80211_hw *hw,
>  		rsi_wait_event(&common->cancel_hw_scan_event,
>  			       EVENT_WAIT_FOREVER);
>  		rsi_reset_event(&common->cancel_hw_scan_event);
> +		cancel_work_sync(&common->scan_work);
>  		common->scan_request = NULL;
>  	}
>  	
> @@ -631,6 +632,7 @@ static void rsi_mac80211_stop(struct ieee80211_hw *hw)
>  	
>  	common->iface_down = true;
>  #ifdef CONFIG_HW_SCAN_OFFLOAD
> +	cancel_work_sync(&common->scan_work);
>  	if (common->scan_in_prog) 
>  		common->scan_in_prog = false;
>  #endif
diff mbox series

Patch

diff --git a/ubuntu/rsi/rsi_91x_mac80211.c b/ubuntu/rsi/rsi_91x_mac80211.c
index 36c0cfd..a797826 100644
--- a/ubuntu/rsi/rsi_91x_mac80211.c
+++ b/ubuntu/rsi/rsi_91x_mac80211.c
@@ -428,6 +428,7 @@  void rsi_mac80211_hw_scan_cancel(struct ieee80211_hw *hw,
 		rsi_wait_event(&common->cancel_hw_scan_event,
 			       EVENT_WAIT_FOREVER);
 		rsi_reset_event(&common->cancel_hw_scan_event);
+		cancel_work_sync(&common->scan_work);
 		common->scan_request = NULL;
 	}
 	
@@ -631,6 +632,7 @@  static void rsi_mac80211_stop(struct ieee80211_hw *hw)
 	
 	common->iface_down = true;
 #ifdef CONFIG_HW_SCAN_OFFLOAD
+	cancel_work_sync(&common->scan_work);
 	if (common->scan_in_prog) 
 		common->scan_in_prog = false;
 #endif