[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOMdWSJX43mqaSWaoVkNep9zJjr+v6OXup9YK9EuA_CWH+wThA@mail.gmail.com>
Date: Wed, 28 Feb 2024 10:00:08 -0800
From: Allen <allen.lkml@...il.com>
To: Tejun Heo <tj@...nel.org>
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
> > > @@ -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.
>
Ah, my bad. Thanks for pointing it out.
> > 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.
>
If the above is okay, I could send out a patch. Please let me know.
Thanks.
Powered by blists - more mailing lists