From: Johan Hovold <johan@kernel.org>
To: Davidlohr Bueso <dave@stgolabs.net>
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: serial: mos7720: defer state restore to a workqueue
Date: Tue, 17 Nov 2020 17:28:47 +0100 [thread overview]
Message-ID: <X7P6P018BQSypuP6@localhost> (raw)
In-Reply-To: <20201116223102.eliwt7uh5rkiiq5h@linux-p48b.lan>
On Mon, Nov 16, 2020 at 02:31:02PM -0800, Davidlohr Bueso wrote:
> On Mon, 16 Nov 2020, Johan Hovold wrote:
>
> >On Fri, Nov 13, 2020 at 08:27:25PM -0800, Davidlohr Bueso wrote:
> >> @@ -1883,21 +1724,17 @@ static void mos7720_release(struct usb_serial *serial)
> >> if (mos_parport->msg_pending)
> >> wait_for_completion_timeout(&mos_parport->syncmsg_compl,
> >> msecs_to_jiffies(MOS_WDR_TIMEOUT));
> >> + /*
> >> + * If delayed work is currently scheduled, wait for it to
> >> + * complete. This also implies barriers that ensure the
> >> + * below serial clearing is not hoisted above the ->work.
> >> + */
> >> + cancel_work_sync(&mos_parport->work);
> >
> >As I mentioned, this needs to be done *after* deregistering the port or
> >you could theoretically end up with the work item being requeued.
>
> Hmm sorry yes I forgot to mention this. I was counting on the private_data
> already being null to prevent any new work being actually scheduled, so an
> incoming restore state, for example, would be a nop.
Ah, yes, you're right.
> >Yes, the same applies for the "synchronous" requests, but that's a
> >preexisting issue.
>
> Per the above I also assumed sync requests were also safe as is.
Indeed.
> But I can certainly re-order things, how about:
No, that's ok, no need to change this as part of this clean up.
Can you just fix up that irq comment, and I'll apply this? Thanks.
Johan
next prev parent reply other threads:[~2020-11-17 16:29 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
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 [this message]
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=X7P6P018BQSypuP6@localhost \
--to=johan@kernel.org \
--cc=dave@stgolabs.net \
--cc=dbueso@suse.de \
--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;
as well as URLs for NNTP newsgroup(s).