[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zd9yNByiBMcPxWbU@slm.duckdns.org>
Date: Wed, 28 Feb 2024 07:49:40 -1000
From: Tejun Heo <tj@...nel.org>
To: Allen <allen.lkml@...il.com>
Cc: jiangshanlai@...il.com, torvalds@...ux-foundation.org,
linux-kernel@...r.kernel.org, kernel-team@...a.com,
boqun.feng@...il.com, tglx@...utronix.de, peterz@...radead.org,
romain.perier@...il.com, mingo@...nel.org
Subject: Re: [PATCH 6/6] r8152: Convert from tasklet to BH workqueue
Hello,
On Wed, Feb 28, 2024 at 09:33:40AM -0800, Allen wrote:
> > @@ -6971,7 +6972,7 @@ static int rtl8152_open(struct net_device *netdev)
> > goto out_unlock;
> > }
> > napi_enable(&tp->napi);
> > - tasklet_enable(&tp->tx_tl);
> > + enable_work(&tp->tx_work);
>
> I think we are missing queue_work() above, right?
>
> To avoid such situations, could we combine enable_work() + queue_work(),
> into a single API?
Here, the device is newly being opened and the work item is just disabled
from the init. So, it doesn't need queueing.
> Perhaps, something like:
>
> static inline bool enable_and_queue_work(struct workqueue_struct *wq,
> struct work_struct *work)
> {
> if (enable_work(work))
> {
> queue_work(wq, work);
> return true;
> }
> return false;
> }
That said, this may still be nice to have.
Thanks.
--
tejun
Powered by blists - more mailing lists