2010-12-16 20:00:08

by John W. Linville

[permalink] [raw]
Subject: [RFT] rtlwifi: use alloc_workqueue

create_workqueue is deprecated. The workqueue usage does not seem to
demand any special treatment, so do not set any flags either.

Signed-off-by: John W. Linville <[email protected]>
---
I don't have the hardware to test...

drivers/net/wireless/rtlwifi/base.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c
index 9e860ff..24a7cd3 100644
--- a/drivers/net/wireless/rtlwifi/base.c
+++ b/drivers/net/wireless/rtlwifi/base.c
@@ -225,7 +225,7 @@ static void _rtl_init_deferred_work(struct ieee80211_hw *hw)

/* <2> work queue */
rtlpriv->works.hw = hw;
- rtlpriv->works.rtl_wq = create_workqueue(rtlpriv->cfg->name);
+ rtlpriv->works.rtl_wq = alloc_workqueue(rtlpriv->cfg->name, 0, 0);
INIT_DELAYED_WORK(&rtlpriv->works.watchdog_wq,
(void *)rtl_watchdog_wq_callback);
INIT_DELAYED_WORK(&rtlpriv->works.ips_nic_off_wq,
--
1.7.3.3



2010-12-18 01:29:36

by Larry Finger

[permalink] [raw]
Subject: Re: [RFT] rtlwifi: use alloc_workqueue

On 12/16/2010 01:59 PM, John W. Linville wrote:
> create_workqueue is deprecated. The workqueue usage does not seem to
> demand any special treatment, so do not set any flags either.
>
> Signed-off-by: John W. Linville <[email protected]>
> ---
> I don't have the hardware to test...
>
> drivers/net/wireless/rtlwifi/base.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c
> index 9e860ff..24a7cd3 100644
> --- a/drivers/net/wireless/rtlwifi/base.c
> +++ b/drivers/net/wireless/rtlwifi/base.c
> @@ -225,7 +225,7 @@ static void _rtl_init_deferred_work(struct ieee80211_hw *hw)
>
> /* <2> work queue */
> rtlpriv->works.hw = hw;
> - rtlpriv->works.rtl_wq = create_workqueue(rtlpriv->cfg->name);
> + rtlpriv->works.rtl_wq = alloc_workqueue(rtlpriv->cfg->name, 0, 0);
> INIT_DELAYED_WORK(&rtlpriv->works.watchdog_wq,
> (void *)rtl_watchdog_wq_callback);
> INIT_DELAYED_WORK(&rtlpriv->works.ips_nic_off_wq,

After further testing, this patch is OK. The problem I saw had another source.

Add Tested-by: Larry Finger

Larry


2010-12-17 09:57:27

by Tejun Heo

[permalink] [raw]
Subject: Re: [RFT] rtlwifi: use alloc_workqueue

Hello,

On 12/17/2010 04:45 AM, Larry Finger wrote:
> On 12/16/2010 01:59 PM, John W. Linville wrote:
>> create_workqueue is deprecated. The workqueue usage does not seem to
>> demand any special treatment, so do not set any flags either.
>>
>> Signed-off-by: John W. Linville <[email protected]>
>> ---
>> I don't have the hardware to test...
>
> Hold off on this one. It seems to break the driver, but I do not
> know why just yet.

There are two differences between create_workqueue(name) and
alloc_workqueue(name, 0, 0).

* The former has WQ_MEM_RECLAIM set and forward progress is guaranteed
regardless of memory pressure. In this case, this shouldn't make
any difference.

* The former has @max_active set to 1 while the latter to
WQ_DFL_ACTIVE. IOW, works queued on the same CPU would be allowed
to run concurrently while before conversion only different CPUs can
run works queued to the workqueue in parallel. This usually
shouldn't make difference either as works could have run in parallel
on different CPUs before too.

Does alloc_workqueue(name, 0, 1) fix the problem? If so, it might be
that the current workqueue usage has problem too.

Thanks.

--
tejun

2010-12-17 03:45:06

by Larry Finger

[permalink] [raw]
Subject: Re: [RFT] rtlwifi: use alloc_workqueue

On 12/16/2010 01:59 PM, John W. Linville wrote:
> create_workqueue is deprecated. The workqueue usage does not seem to
> demand any special treatment, so do not set any flags either.
>
> Signed-off-by: John W. Linville <[email protected]>
> ---
> I don't have the hardware to test...

Hold off on this one. It seems to break the driver, but I do not know why just yet.

Larry


2010-12-18 07:13:08

by Tejun Heo

[permalink] [raw]
Subject: Re: [RFT] rtlwifi: use alloc_workqueue

Hello,

On 12/18/2010 02:29 AM, Larry Finger wrote:
> After further testing, this patch is OK. The problem I saw had another source.
>
> Add Tested-by: Larry Finger

Thanks for verifying.

Acked-by: Tejun Heo <[email protected]>

--
tejun