Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752777AbbBKNND (ORCPT ); Wed, 11 Feb 2015 08:13:03 -0500 Received: from mga09.intel.com ([134.134.136.24]:16634 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752272AbbBKNNA (ORCPT ); Wed, 11 Feb 2015 08:13:00 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,558,1418112000"; d="scan'208";a="676319844" Date: Wed, 11 Feb 2015 15:12:55 +0200 From: Heikki Krogerus To: David Cohen Cc: Felipe Balbi , Greg Kroah-Hartman , Baolu Lu , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Kishon Vijay Abraham I Subject: Re: [PATCH 8/8] phy: add driver for TI TUSB1210 ULPI PHY Message-ID: <20150211131255.GA10985@kuha.fi.intel.com> References: <20150127173801.GA8441@psi-dev26.jf.intel.com> <20150128142024.GA2378@kuha.fi.intel.com> <20150128180255.GA7551@psi-dev26.jf.intel.com> <20150129141412.GA2570@kuha.fi.intel.com> <20150129162023.GF21217@saruman.tx.rr.com> <20150130092956.GE2570@kuha.fi.intel.com> <20150130162038.GB20689@psi-dev26.jf.intel.com> <20150202125959.GB30962@kuha.fi.intel.com> <20150210190531.GC28827@psi-dev26.jf.intel.com> <20150210192350.GD28827@psi-dev26.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150210192350.GD28827@psi-dev26.jf.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2742 Lines: 69 Hi David, > > > > In order for phy to be functional, it does not depend only on toggling > > > > GPIOs. It depends on DWC3 going to reset state, then phy executes power > > > > on sequence, then DWC3 going out of reset state to sync clocks with phy. > > > > You're saying we should tell BIOS is concurrently mess with dwc3 > > > > together with dwc3 driver? > > > > > > I don't understand what you are saying here? > > > > TUSB1210 needs to come out of reset only when DWC3 is in reset state. > > This is how current code works in dwc3_core_soft_reset(): > > - dwc3 goes to reset > > - phy goes to reset > > - phy gets out of reset > > - dwc3 gets out of reset > > > > This is how you're proposing: > > - phy goes to reset (DSDT code, when loading module) > > - phy gets out of reset (DSDT code, when loading module) > > > > - dwc3 goes to reset (dwc3_core_soft_reset()) > > - dwc3 gets our of reset (dwc3_core_soft_reset()) > > > > Felipe, do you see a problem with this new context? If not, I'm > > satisfied with Heikki's ULPI bus proposal considering my comment below. > > Sorry, guess I spoke too soon :/ > I am satisfied with the phy case, but I forgot about the chicken/egg > problem I reported earlier: > DWC3 will not be functional when reloading the module after it went to > reset state. Then ULPI enumeration can't happen regardless DSDT code > powered on phy. One point here. If we have DSDT handling the gpios with the operation region, those gpio resources don't need to be given to any device (actually I think they really shouldn't be given to anything in that case). > Heikki, do you have a proposal for that? IMHO that's the main missing > point if we forget about BYT-CR legacy. I'm sorry but I'm still not sure about the scenario you are talking about. When we load dwc3, we end up autoloading phy-tusb1210 in this case and increasing the phy devices ref count i.e. preventing phy-tusb1210 module from being unloaded before dwc3 is unloaded. If we unload dwc3 we can also unload phy-tusb1210 if we like but if after that we load dwc3 again, the ULPI will be accessible the moment we register the ulpi interface as it was before. That I believe is actually a must in case of ULPI. When dwc3 is reset with GCTL or DCTL SoftReset, it will first write to the ULPI FunctionControl register's reset bit in order to but the PHY to reset (PHYSoftRst has no effect in case of ULPI), so ULPI really has to be accessible before the core is soft reset. Thanks, -- heikki -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/