From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B9A8C433DB for ; Thu, 21 Jan 2021 11:25:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4D6A4238E1 for ; Thu, 21 Jan 2021 11:25:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729212AbhAULXw (ORCPT ); Thu, 21 Jan 2021 06:23:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:43894 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730394AbhAULXX (ORCPT ); Thu, 21 Jan 2021 06:23:23 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 613D1238D7; Thu, 21 Jan 2021 11:22:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1611228163; bh=E5lCW8e76KF7jwvUqsIhRLZSQqyjdf7prScrWNH7Nro=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=wnSHf/ilpNKTbTEYx9lGFGhJB2AN0rQKyG+KR6aoSOC4W68hfqDHneEwtc8IlSvBS zkSRN0BfTTA4tiWAy7ywdg633RBYVOtdc31M+MLCXoz1kkY1UUzPBhVojV2ZfcjSDl pfdd7QZz0LQ6zz5N9lr7ZpLgfxlfSdiJW1B6SOQU= Date: Thu, 21 Jan 2021 12:22:40 +0100 From: Greg Kroah-Hartman To: Oh Eomji Cc: balbi@kernel.org, "Gustavo A. R. Silva" , Andy Shevchenko , Bart Van Assche , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: gadget: f_mass_storage: cahnge wait_event to wait_event_timeout Message-ID: References: <1611212208-84202-1-git-send-email-eomji.oh@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1611212208-84202-1-git-send-email-eomji.oh@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Thu, Jan 21, 2021 at 03:56:45PM +0900, Oh Eomji wrote: > Changed to return a timeout error if there is no response for a certain > period of time in order to solve the problem of waiting for a event > complete while executing unbind. > > Signed-off-by: Oh Eomji > --- > drivers/usb/gadget/function/f_mass_storage.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c > index 950c943..b474840 100644 > --- a/drivers/usb/gadget/function/f_mass_storage.c > +++ b/drivers/usb/gadget/function/f_mass_storage.c > @@ -3000,7 +3000,7 @@ static void fsg_unbind(struct usb_configuration *c, struct usb_function *f) > if (fsg->common->fsg == fsg) { > __raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE, NULL); > /* FIXME: make interruptible or killable somehow? */ > - wait_event(common->fsg_wait, common->fsg != fsg); > + wait_event_timeout(common->fsg_wait, common->fsg != fsg, HZ / 4); That's a random choice of a timeout value. Please document this really really really well as to why you picked this number, and what it means. Also, is the commet above this line still correct now? thanks, greg k-h