mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: balbi@kernel.org, gregkh@linuxfoundation.org,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Davidlohr Bueso <dbueso@suse.de>
Subject: Re: [PATCH] usb/gadget: f_midi: Replace tasklet with work
Date: Mon, 11 Jan 2021 09:28:29 +0100	[thread overview]
Message-ID: <s5hh7nnvpw2.wl-tiwai@suse.de> (raw)
In-Reply-To: <20210111042855.73289-1-dave@stgolabs.net>

On Mon, 11 Jan 2021 05:28:55 +0100,
Davidlohr Bueso wrote:
> 
> Currently a tasklet is used to transmit input substream buffer
> data. However, tasklets have long been deprecated as being too
> heavy on the system by running in irq context - and this is not
> a performance critical path. If a higher priority process wants
> to run, it must wait for the tasklet to finish before doing so.
> 
> Deferring work to a workqueue and executing in process context
> should be fine considering the callback already does
> f_midi_do_transmit() under the transmit_lock and thus changes in
> semantics are ok regarding concurrency - tasklets being serialized
> against itself.
> 
> Cc: Takashi Iwai <tiwai@suse.de>
> Signed-off-by: Davidlohr Bueso <dbueso@suse.de>

The patch looks good to me.
Reviewed-by: Takashi Iwai <tiwai@suse.de>


BTW, now I found that the driver doesn't have the cancel call for
tasklet or work at the unbind.  Practically seen it's no big problem,
but its lack is a bait for syzbot.  We may need to just call
cancel_work_sync() somewhere, probably at f_midi_drop_out_substreams()
or f_midi_disable(), but it can be in another patch.


thanks,

Takashi

      parent reply	other threads:[~2021-01-11  8:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-11  4:28 Davidlohr Bueso
2021-01-11  7:28 ` Felipe Balbi
2021-01-11  8:28 ` Takashi Iwai [this message]

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=s5hh7nnvpw2.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=balbi@kernel.org \
    --cc=dave@stgolabs.net \
    --cc=dbueso@suse.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®