LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Michael Straube <straube.linux@gmail.com>
To: Martin Kaiser <martin@kaiser.cx>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
	Phillip Potter <phil@philpotter.co.uk>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] staging: r8188eu: use a delayed worker for led updates
Date: Sat, 27 Nov 2021 08:42:08 +0100	[thread overview]
Message-ID: <c4ea42f1-bacb-e7d2-1a97-ba8dd3853ffe@gmail.com> (raw)
In-Reply-To: <20211126114135.18228-1-martin@kaiser.cx>

On 11/26/21 12:41, Martin Kaiser wrote:
> The led layer uses a combination of timer and worker for periodic led
> updates, e.g. for blinking. The reason seems to be that blocking
> operations like a usb read are not allowed in a timer handler.
> 
> Replace the combination of timer and worker with a delayed worker.
> 
> Convert the timeout defines from milliseconds to jiffies to make them
> usable as delays for the delayed worker. Shorten the names of the defines
> and rename the work item to make checkpatch happy.
> 
> Other layers may call SwLedControlMode1 to update the led state. Such
> an update may result in cancelling the delayed worker. SwLedControlMode1
> might be called in interrupt context, we must use cancel_delayed_work to
> cancel the worker. cancel_delayed_work_sync waits until the worker is
> finished, this is not allowed in interrupt context.
> 
> DeInitLed871x is called when the driver is removed or when the system
> goes into standby. We may use cancel_delayed_work_sync here to cancel
> the delayed worker.
> 
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> ---
> v2:
>   - do not block if we cancel a delayed worker in interrupt context
> 

Hi Martin,

v2 works for me without any sleeping/scheduling while atomic bugs.

Thanks,
Michael

  reply	other threads:[~2021-11-27  7:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-25 16:25 [PATCH 0/4] staging: r8188eu: clean up workers Martin Kaiser
2021-11-25 16:25 ` [PATCH 1/4] staging: r8188eu: remove the _set_workitem wrapper Martin Kaiser
2021-11-25 16:25 ` [PATCH 2/4] staging: r8188eu: remove the _init_workitem wrapper Martin Kaiser
2021-11-25 16:25 ` [PATCH 3/4] staging: r8188eu: remove the _cancel_workitem_sync wrapper Martin Kaiser
2021-11-25 16:25 ` [PATCH 4/4] staging: r8188eu: use a delayed worker for led updates Martin Kaiser
2021-11-26 11:41 ` [PATCH v2] " Martin Kaiser
2021-11-27  7:42   ` Michael Straube [this message]
2021-11-29 11:04   ` Dan Carpenter
2021-12-03 14:14     ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c4ea42f1-bacb-e7d2-1a97-ba8dd3853ffe@gmail.com \
    --to=straube.linux@gmail.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=martin@kaiser.cx \
    --cc=phil@philpotter.co.uk \
    --subject='Re: [PATCH v2] staging: r8188eu: use a delayed worker for led updates' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).