From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752283AbcF1JnH (ORCPT ); Tue, 28 Jun 2016 05:43:07 -0400 Received: from mail-pa0-f66.google.com ([209.85.220.66]:35153 "EHLO mail-pa0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752006AbcF1JnE (ORCPT ); Tue, 28 Jun 2016 05:43:04 -0400 Date: Tue, 28 Jun 2016 17:36:06 +0800 From: Peter Chen To: Stephen Boyd Cc: Jun Li , "linux-usb@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-arm-msm@vger.kernel.org" , Andy Gross , Bjorn Andersson , Neil Armstrong , Arnd Bergmann , Felipe Balbi , Peter Chen , Greg Kroah-Hartman , "Ivan T. Ivanov" Subject: Re: [PATCH 04/21] usb: chipidea: Only read/write OTGSC from one place Message-ID: <20160628093606.GA30392@shlinux2> References: <20160626072838.28082-1-stephen.boyd@linaro.org> <20160626072838.28082-5-stephen.boyd@linaro.org> <146705447431.30684.10431147947045016957@sboyd-linaro> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <146705447431.30684.10431147947045016957@sboyd-linaro> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 27, 2016 at 12:07:54PM -0700, Stephen Boyd wrote: > Quoting Jun Li (2016-06-27 01:04:39) > > > diff --git a/drivers/usb/chipidea/otg.c b/drivers/usb/chipidea/otg.c index > > > 03b6743461d1..763a8332b009 100644 > > > --- a/drivers/usb/chipidea/otg.c > > > +++ b/drivers/usb/chipidea/otg.c > > > @@ -104,7 +104,32 @@ void ci_handle_vbus_change(struct ci_hdrc *ci) > > > usb_gadget_vbus_disconnect(&ci->gadget); > > > } > > > > > > -#define CI_VBUS_STABLE_TIMEOUT_MS 5000 > > > +/** > > > + * Sometimes, it needs to wait register value before going on. > > > + * Eg, when switch to device mode, the vbus value should be lower > > > + * than OTGSC_BSV before connects to host. > > > > This should be updated since this API is dedicated for BSV now. > > Ok I've updated it to say: > > When we switch to device mode, the vbus value should be lower > than OTGSC_BSV before connecting to host. > > > > > > + * > > > + * @ci: the controller > > > + * > > > + * This function returns an error code if timeout */ static int > > > +hw_wait_otgsc_bsv(struct ci_hdrc *ci) { > > > + unsigned long elapse = jiffies + msecs_to_jiffies(5000); > > > + u32 mask = OTGSC_BSV; > > > + > > > + while (!hw_read_otgsc(ci, mask)) { > > > > Reverse logic, should be: > > while (hw_read_otgsc(ci, mask)) { > > > > Good catch! Thanks. Besides above, please delete the declaration at ci.h. -- Best Regards, Peter Chen