From: Davidlohr Bueso <dave@stgolabs.net>
To: Oliver Neukum <oneukum@suse.com>
Cc: Johan Hovold <johan@kernel.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Davidlohr Bueso <dbueso@suse.de>
Subject: Re: [PATCH] usb/mos7720: process deferred urbs in a workqueue
Date: Mon, 9 Nov 2020 11:14:10 -0800 [thread overview]
Message-ID: <20201109191410.wjywxb5c6ylvekom@linux-p48b.lan> (raw)
In-Reply-To: <574f338f6f0b81fe1e4109f74c6dfcb45aca0d53.camel@suse.com>
On Mon, 09 Nov 2020, Oliver Neukum wrote:
>Am Donnerstag, den 05.11.2020, 22:17 -0800 schrieb Davidlohr Bueso:
>> @@ -1888,16 +1732,8 @@ static void mos7720_release(struct usb_serial *serial)
>> usb_set_serial_data(serial, NULL);
>> mos_parport->serial = NULL;
>>
>> - /* if tasklet currently scheduled, wait for it to complete */
>> - tasklet_kill(&mos_parport->urb_tasklet);
>> -
>> - /* unlink any urbs sent by the tasklet */
>> - spin_lock_irqsave(&mos_parport->listlock, flags);
>> - list_for_each_entry(urbtrack,
>> - &mos_parport->active_urbs,
>> - urblist_entry)
>> - usb_unlink_urb(urbtrack->urb);
>> - spin_unlock_irqrestore(&mos_parport->listlock, flags);
>> + /* if work is currently scheduled, wait for it to complete */
>> + cancel_work_sync(&mos_parport->work);
>> parport_del_port(mos_parport->pp);
>>
>> kref_put(&mos_parport->ref_count, destroy_mos_parport);
>
>Hi,
>
>do you really want to cancel as opposed to wait for work in release()?
Well I tried to maintain the current semantics here. tasklet_kill() is
equivalent to cancel_work_sync() in that they both wait for the delayed
execution to finish running and guarantee that it is no longer queued.
Thanks,
Davidlohr
next prev parent reply other threads:[~2020-11-09 19:36 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-02 21:14 [PATCH] usb/mos7720: process deferred urbs in a workqueue Davidlohr Bueso
2020-11-03 20:40 ` Davidlohr Bueso
2020-11-04 11:06 ` Johan Hovold
2020-11-04 16:25 ` Johan Hovold
2020-11-05 0:13 ` Davidlohr Bueso
2020-11-05 8:25 ` Johan Hovold
2020-11-06 6:17 ` Davidlohr Bueso
2020-11-09 9:22 ` Oliver Neukum
2020-11-09 19:14 ` Davidlohr Bueso [this message]
2020-11-13 9:14 ` Johan Hovold
2020-11-14 4:27 ` [PATCH] USB: serial: mos7720: defer state restore to " Davidlohr Bueso
2020-11-16 17:09 ` Johan Hovold
2020-11-16 22:31 ` Davidlohr Bueso
2020-11-17 16:28 ` Johan Hovold
2020-11-17 16:48 ` [PATCH v2] " Davidlohr Bueso
2020-11-18 10:11 ` Johan Hovold
2020-11-20 4:53 ` [PATCH v3] " Davidlohr Bueso
2020-11-20 9:37 ` Johan Hovold
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=20201109191410.wjywxb5c6ylvekom@linux-p48b.lan \
--to=dave@stgolabs.net \
--cc=dbueso@suse.de \
--cc=johan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=oneukum@suse.com \
/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;
as well as URLs for NNTP newsgroup(s).