Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp98670pxb; Thu, 21 Jan 2021 02:14:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJz575d0pJNmIccoaOCyx2juWDKGPkqPGvYNlRD1WL7zyZfB9k86Qx07T4K1fq95v3oMwrQK X-Received: by 2002:a50:fb04:: with SMTP id d4mr7130247edq.315.1611224059462; Thu, 21 Jan 2021 02:14:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611224059; cv=none; d=google.com; s=arc-20160816; b=Y5J/QCanczQ/4sfV98/jEH288WdLLji416FRBaeu7eFd+/QPbk4qkg61tzjBuQZlUl IF7O1Z0vdkFC3sW0A102citjF7YIC7EHTzLJZktGRKkDcWIuezW5jDpKF8b8mplk9Ltn SXhdHstjJ9DH1/1jw0djsHockwKWJ5D8qfj2b/+XXZHn5AwtNhRQQFYjap9WHeRhSd/T QguaWpV9KEnYrRqYUrWomXt96k0xXk+zxaGnC05n4LQ7LmR1IKafSzX7a6wTh5SXnAnm gn0e1TK8CKA59L2R84jmUGbY8wMGWwyunCSl7DNJUMwpUNf4Fd8nnjBJQvnNe62uqNRG PBlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=dJj2FOXjPHE9sZo1soopt/rc3s3NJwbSAWwtdH4WPA8=; b=iYaEiaSVP54tWwYraHPAnFuq3p5juDPzCxGeAOyHkFqQxvxX1mgo2TQPbVf6BymejI VfjaiC706OlhBQHWhb30wFp5VGDFJEKPn4kPu60ippp42OeubOGzI+JHHIT3XPkXjaWs QyAHG1VVXk7WeMAgYeyj9Uu32kOo0pKoYonsq2K/LHkoUHFpJv/wC/s2hLjjJOTbVzGg YzCsj5zpt6A4I1AWz6m66GmXwYb+Hz3F/krPtyRBu5etEBZHWXQF+pbjjDr2Mm2yDwxb oOqd6nO1l1rp8QDZskVHnOuVDcdM6vGCTJ8Q8XId/+CJ4V3ZICfWwnkHR93EVtKa80cS ofXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q4si1587423ejr.478.2021.01.21.02.13.55; Thu, 21 Jan 2021 02:14:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728984AbhAUKM6 (ORCPT + 99 others); Thu, 21 Jan 2021 05:12:58 -0500 Received: from mga11.intel.com ([192.55.52.93]:32295 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729034AbhAUKMl (ORCPT ); Thu, 21 Jan 2021 05:12:41 -0500 IronPort-SDR: E6niDBA9gJTR7cvOBw2U+P6ivJbBPcOML8s+sGe5mUsrNi2ZWdi5xELpspnbfh8dIzs+I0rUQF bWAtEB4b1UKg== X-IronPort-AV: E=McAfee;i="6000,8403,9870"; a="175740727" X-IronPort-AV: E=Sophos;i="5.79,363,1602572400"; d="scan'208";a="175740727" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jan 2021 02:10:46 -0800 IronPort-SDR: uSMUMKGDE8CjOR1D9RKRhatqrMNNcGkc1dDf6wcc56HUsKxyho4JA6fGSyYp8chHGIq7ViYfus B6Br5TKGIJRA== X-IronPort-AV: E=Sophos;i="5.79,363,1602572400"; d="scan'208";a="356407175" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jan 2021 02:10:44 -0800 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1l2WwM-007MxW-HN; Thu, 21 Jan 2021 12:11:46 +0200 Date: Thu, 21 Jan 2021 12:11:46 +0200 From: Andy Shevchenko To: Oh Eomji Cc: balbi@kernel.org, Greg Kroah-Hartman , "Gustavo A. R. Silva" , 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> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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. Can you shed a light on the choice of the timeout length? > 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); > } > > usb_free_all_descriptors(&fsg->function); > -- > 2.7.4 > -- With Best Regards, Andy Shevchenko