Path: csiph.com!news.freedyn.net!newsfeed.datemas.de!weretis.net!feeder4.news.weretis.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod From: Peter Chen Newsgroups: linux.kernel Subject: Re: [PATCH v2 04/22] usb: chipidea: Only read/write OTGSC from one place Date: Sun, 07 Aug 2016 01:00:02 +0200 Message-ID: References: X-Original-To: Stephen Boyd Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=d5i7TQyviKMN+ioI89nLcxZ5cUcaFAB2lq6fm+R+xfI=; b=MLZhChX4S/LKlXBv4lj10Td3X3JEE7gVhM2dWHqW+fEx01daftfuCFLndFDs1oH3ZX XS5nJQ2DCpuLXtmziSHnLXJegAdoMj+dSwM8ZvVePDiQaVxNZGuXOp09D7RJzEOVTEym 0tYmpy09drpiJF4Zmt3J3gJKbIx3EzyTYtOtXVamPc9PAaZfLQQNd01yIV9I6PzeMURD GlmHe1BGsK7mb1HzDuVUrVQ6RlNu0yti0qFlp5sR3OiFL/JQvaAtWO1KCPUpLXEgliXb wbtWGBe1TENebIjH7OkVELrcK9IYGWqTIbq5S6Bo9rPr4LpaDvULnOJIyveWR6c1x9zt JMJw== X-Google-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=d5i7TQyviKMN+ioI89nLcxZ5cUcaFAB2lq6fm+R+xfI=; b=Ci0P3EofzoIPXmQ8HBto6eF5c6oI7Ww8/xwG1qoawvpmHG6D6w1LFLWEmvRo8ZQ1is vohldGUH1bGz/FfvkM0n+Tti3ifIDI8yFJJsU9y0kYyXqbutNOU6r/IDnUNDokrT68cP iM3p1dmz7rB6U4L+Qxk7kBPBHgCVM4dDPj+fF2HXjeoQyJEHMVtQmIuLk6KajFx3hxVW 0qUux5kc3H/NM3ya3eBjST1ThtvH+a/brYp0v8Nhfak24md9VOOhiTqL3G8c6scQReEO Bkh6+8WiMRQzIoSDQl4kMnYkcnLgxkk/BJLe6sWC+y8TyTUJ4L2LwHMuBU0AVBoj2Bfg jdSw== X-Gm-Message-State: AEkoouvGHTvrlZ/pxVofHoRkMT9NePmIdBGLY6UR+g1yjACkxk05O7zQZYlahvlkY8nUFg== X-Received: by 10.98.62.65 with SMTP id l62mr142784638pfa.2.1470469923109; Sat, 06 Aug 2016 00:52:03 -0700 (PDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 34 Organization: linux.* mail to news gateway X-Original-Cc: linux-usb@vger.kernel.org, Felipe Balbi , Arnd Bergmann , Neil Armstrong , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Andersson , Peter Chen , Greg Kroah-Hartman , Andy Gross , "Ivan T. Ivanov" , linux-arm-kernel@lists.infradead.org X-Original-Date: Sat, 6 Aug 2016 15:42:58 +0800 X-Original-Message-ID: <20160806074258.GA12298@shlinux2> X-Original-References: <20160707222114.1673-1-stephen.boyd@linaro.org> <20160707222114.1673-5-stephen.boyd@linaro.org> <20160708091456.GC20485@shlinux2> <147043329762.26915.1413688974325107381@sboyd-linaro> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: csiph.com linux.kernel:1457400 On Fri, Aug 05, 2016 at 02:41:37PM -0700, Stephen Boyd wrote: > Quoting Peter Chen (2016-07-08 02:14:57) > > On Thu, Jul 07, 2016 at 03:20:55PM -0700, Stephen Boyd wrote: > > > diff --git a/drivers/usb/chipidea/otg.c b/drivers/usb/chipidea/otg.c > > > index 03b6743461d1..a6fc60934297 100644 > > > --- a/drivers/usb/chipidea/otg.c > > > +++ b/drivers/usb/chipidea/otg.c > > > @@ -104,7 +104,31 @@ void ci_handle_vbus_change(struct ci_hdrc *ci) > > > usb_gadget_vbus_disconnect(&ci->gadget); > > > } > > > > > > -#define CI_VBUS_STABLE_TIMEOUT_MS 5000 > > > +/** > > > + * 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) > > > > I think the function name should reflect "we wait for vbus lower than bsv" > > Care to change one? > > > > Sure, something like hw_wait_vbus_lower_bsv()? Agree. -- Best Regards, Peter Chen