mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pete Zaitcev <zaitcev@redhat.com>
To: Jiri Slaby <jslaby@suse.cz>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	zaitcev@redhat.com
Subject: Re: [PATCH 1/1] usblp: do not set TASK_INTERRUPTIBLE before lock
Date: Wed, 11 Nov 2015 16:28:16 -0700	[thread overview]
Message-ID: <20151111162816.648e18c9@lembas.zaitcev.lan> (raw)
In-Reply-To: <1446456420-28218-1-git-send-email-jslaby@suse.cz>

On Mon,  2 Nov 2015 10:27:00 +0100
Jiri Slaby <jslaby@suse.cz> wrote:

> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> --- a/drivers/usb/class/usblp.c
> +++ b/drivers/usb/class/usblp.c
> @@ -884,11 +884,11 @@ static int usblp_wwait(struct usblp *usblp, int nonblock)
>  
>  	add_wait_queue(&usblp->wwait, &waita);
>  	for (;;) {
> -		set_current_state(TASK_INTERRUPTIBLE);
>  		if (mutex_lock_interruptible(&usblp->mut)) {
>  			rc = -EINTR;
>  			break;
>  		}
> +		set_current_state(TASK_INTERRUPTIBLE);
>  		rc = usblp_wtest(usblp, nonblock);
>  		mutex_unlock(&usblp->mut);
>  		if (rc <= 0)

I'm fully onboard with this. In the original "big cleanup" 317c67b8f,
I got this right. But then I either missed that mutex_lock_interruptible()
can set the state, or it didn't do it back then (it was in 2007), and
the 7f477358e introduced the existing code.

Acked-By: Pete Zaitcev <zaitcev@yahoo.com>

-- Pete

      reply	other threads:[~2015-11-11 23:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-02  9:27 Jiri Slaby
2015-11-11 23:28 ` Pete Zaitcev [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=20151111162816.648e18c9@lembas.zaitcev.lan \
    --to=zaitcev@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.cz \
    --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®