Re: [PATCH 1/2] hp100: Fix a possible sleep-in-atomic bug in hp100_login_to_vg_hub

2017-12-15 Thread Siegfried Loeffler
I am sorry, I still have some of these 100VGAnyLan boards somewhere in the attic but I am unable to test. I haven't used 100VGAnyLan for the last 20 years ! :-) - I wonder if anybody is still using it? Cheers Siegfried Loeffler, DG1SEK On 14.12.17 04:56, Jia-Ju Bai wrote: Sorry, I think I kn

Re: [PATCH 1/2] hp100: Fix a possible sleep-in-atomic bug in hp100_login_to_vg_hub

2017-12-13 Thread Jia-Ju Bai
Sorry, I think I know your meaning now. Maybe we can unlock the spinlock before "schedule_timeout_interruptible" and then lock again? Like: spin_unlock(...); schedule_timeout_interruptible(1); spin_lock(...); Best wishes, Jia-Ju Bai On 2017/12/14 11:34, David Miller wrote: Fro

Re: [PATCH 1/2] hp100: Fix a possible sleep-in-atomic bug in hp100_login_to_vg_hub

2017-12-13 Thread David Miller
From: Jia-Ju Bai Date: Thu, 14 Dec 2017 11:13:15 +0800 > Thanks for reply :) > I think I should use "udelay(10/HZ)" instead, do you think it is > right? The delay is too long, please do not ignore that part of my critique of your change. You cannot delay so long under a lock, that's why the

Re: [PATCH 1/2] hp100: Fix a possible sleep-in-atomic bug in hp100_login_to_vg_hub

2017-12-13 Thread Jia-Ju Bai
Sorry, I made a mistake in last e-mail. Maybe "mdelay(1000/HZ)" or "udelay(100/HZ)" . Which one do you think is right? Thanks, Jia-Ju Bai On 2017/12/14 11:13, Jia-Ju Bai wrote: Thanks for reply :) I think I should use "udelay(10/HZ)" instead, do you think it is right? Thanks, Jia-

Re: [PATCH 1/2] hp100: Fix a possible sleep-in-atomic bug in hp100_login_to_vg_hub

2017-12-13 Thread Jia-Ju Bai
Thanks for reply :) I think I should use "udelay(10/HZ)" instead, do you think it is right? Thanks, Jia-Ju Bai On 2017/12/14 5:20, David Miller wrote: I want you to review all of your patches and resend them after you have checked them carefully. The first patch I even looked at, this on

Re: [PATCH 1/2] hp100: Fix a possible sleep-in-atomic bug in hp100_login_to_vg_hub

2017-12-13 Thread Joe Perches
On Wed, 2017-12-13 at 17:47 +0800, Jia-Ju Bai wrote: > The driver may sleep under a spinlock. > The function call path is: > hp100_set_multicast_list (acquire the spinlock) > hp100_login_to_vg_hub > schedule_timeout_interruptible --> may sleep > > To fix it, schedule_timeout_interruptible is

Re: [PATCH 1/2] hp100: Fix a possible sleep-in-atomic bug in hp100_login_to_vg_hub

2017-12-13 Thread David Miller
I want you to review all of your patches and resend them after you have checked them carefully. The first patch I even looked at, this one, is buggy. You changed a schedule_timeout_interruptible(1) into a udelay(10) That's not right. schedule_timeout_interruptible() takes a "jiffies" argument,

[PATCH 1/2] hp100: Fix a possible sleep-in-atomic bug in hp100_login_to_vg_hub

2017-12-13 Thread Jia-Ju Bai
The driver may sleep under a spinlock. The function call path is: hp100_set_multicast_list (acquire the spinlock) hp100_login_to_vg_hub schedule_timeout_interruptible --> may sleep To fix it, schedule_timeout_interruptible is replaced with udelay. This bug is found by my static analysis too