Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751965AbbKKX2T (ORCPT ); Wed, 11 Nov 2015 18:28:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40173 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751035AbbKKX2R (ORCPT ); Wed, 11 Nov 2015 18:28:17 -0500 Date: Wed, 11 Nov 2015 16:28:16 -0700 From: Pete Zaitcev To: Jiri Slaby Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , zaitcev@redhat.com Subject: Re: [PATCH 1/1] usblp: do not set TASK_INTERRUPTIBLE before lock Message-ID: <20151111162816.648e18c9@lembas.zaitcev.lan> In-Reply-To: <1446456420-28218-1-git-send-email-jslaby@suse.cz> References: <1446456420-28218-1-git-send-email-jslaby@suse.cz> Organization: Red Hat, Inc. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1153 Lines: 33 On Mon, 2 Nov 2015 10:27:00 +0100 Jiri Slaby wrote: > Signed-off-by: Jiri Slaby > --- 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 -- Pete -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/