Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp551804pxb; Fri, 13 Aug 2021 00:36:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzclBHOMZjhnRVOpzc8UdXBYGbCd4Ry/EtfhijLTtC2GHb1akwx3Yc291VjNDSvsvycAQge X-Received: by 2002:a05:6402:452:: with SMTP id p18mr1434455edw.34.1628840205049; Fri, 13 Aug 2021 00:36:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628840205; cv=none; d=google.com; s=arc-20160816; b=KFW6GIfjAutYX8Uc5Ky/gOOW8HbsBrt0ll0ysyYeCUKFb4Yqrz+FOaomat2LCHZ+OM O9kIwhdnB5Hu2R7G9QE84QPT/XeLVhLUf8wbjfxMQpI/+lYQ1h/7aEVO/7NAZSLdHeMw cxdPsum2hCn9SpGMo0Hdq7XtS6jIRx4AQmaUcVHkXMOSBIgw4co3Tt2l3QBEGuQ7n7bl mbVyQ/FcFoaKETwtm2Z2vJ0+1wJ/mx69jZ+2Fi0jOkvxgAZbqNN95dfTnCZIAR6DZN7B 6YMQD4jeZ8s8UJOKG6+Iqq5asIN5VlZdhCzjvcZb1c+MrwAhRSsoAoa8TGDws/8dlTrV P3Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=83r2Zuk1C9kb2S+V8V35Qrd6FDI+jPQGB3nd66U7SQk=; b=Tf4krSGBEtUR9Jy+Nee4/4g5FAxuSqsj5khc/zoxpJ0qk01k1V3KNMsTr7sv5oZGM6 9C1q9D27Ied9uxfuvdUHuUQaDw6U4XaixgPRAjyWiFhGFXJTOQFe98ZdD7UN2/4XxR6f zt2kv1dij/+Zzp7cyCbON6LLTkxjGSurPx7Htf2fkMCOgyTvMeLyrby5hFSz3V4FlaEp ntqZnUjp3bkSRa5bLYFesE2Otq74sov89ztRtGZ84WQY6TwJlMGtYCPnrBUiFPqHRgCj hOWlhAKIuKBm1bURlqA9rSvjf5sjCd6tmTcHVF3mY4BpU8czrk+r2Mbf1PZcD4NRLalK bvnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cXKy9Ri1; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b3si827027edr.477.2021.08.13.00.36.19; Fri, 13 Aug 2021 00:36:45 -0700 (PDT) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cXKy9Ri1; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229932AbhHMHIm (ORCPT + 99 others); Fri, 13 Aug 2021 03:08:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:39564 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239222AbhHMHIj (ORCPT ); Fri, 13 Aug 2021 03:08:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9DBD26056B; Fri, 13 Aug 2021 07:08:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628838493; bh=TpgsIa/y2++/G1mwfOPNpyBa1LqSYUt4QgccMUO9r8s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cXKy9Ri1s0kB+LiLpOZdXFA6fFRSTjTDbWplJQjTiuEI5hW7WhKRQCFK8vMhCtyKy I+6nZmsm/F7mVfnKj1nQ0TvETfYMaxo4Qcl7g5tfjZtR/nTOWYOJyo8x7KRYTPR3M2 tyWsuZs0lHQPY6HNXSQbXkGxcQZHbSVKlOnApJVE= Date: Fri, 13 Aug 2021 09:08:10 +0200 From: Greg Kroah-Hartman To: Jeaho Hwang Cc: Peter Chen , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: chipidea: add loop timeout for hw_ep_set_halt() Message-ID: References: <20210809112048.GA3319230@ubuntu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210809112048.GA3319230@ubuntu> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 09, 2021 at 08:20:48PM +0900, Jeaho Hwang wrote: > If ctrl EP priming is failed (very rare case in standard linux), > hw_ep_set_halt goes infinite loop. 50 was enough for zynq7000. > > Signed-off-by: Jeaho Hwang > --- > drivers/usb/chipidea/udc.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c > index d0cd1de1b6c7..92ca0b7e4310 100644 > --- a/drivers/usb/chipidea/udc.c > +++ b/drivers/usb/chipidea/udc.c > @@ -210,6 +210,9 @@ static int hw_ep_prime(struct ci_hdrc *ci, int num, int dir, int is_ctrl) > return 0; > } > > +/*will it be enough?*/ Please use ' ' characters in your comments. And can you answer this, please do not add a question in a comment, be sure about this. > +#define HW_EP_SET_HALT_COUNT_MAX 100 > + > /** > * hw_ep_set_halt: configures ep halt & resets data toggle after clear (execute > * without interruption) > @@ -222,6 +225,7 @@ static int hw_ep_prime(struct ci_hdrc *ci, int num, int dir, int is_ctrl) > */ > static int hw_ep_set_halt(struct ci_hdrc *ci, int num, int dir, int value) > { > + int count = HW_EP_SET_HALT_COUNT_MAX; > if (value != 0 && value != 1) Please use checkpatch.pl when submitting patches :(