Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp338480imm; Thu, 31 May 2018 01:03:32 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJDP5qYHK3qpgbjkvZEWVyjq02d0QKpEuHD1xeP3zVGziKBV1xJ/ss6EiO1wYg/1yVF+0Jw X-Received: by 2002:a17:902:8602:: with SMTP id f2-v6mr5977970plo.5.1527753812340; Thu, 31 May 2018 01:03:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527753812; cv=none; d=google.com; s=arc-20160816; b=wn39AcCSrQplbxBW9ihvapjhFyg3pkAtM3VOAjINs3TXfRiZR6FCxLOsQDW2e+vrz9 GobNhD5wClK+DV+OHpWDGi9RPmkGyVwULOkRjuSffTmWCrvAU3fPno4esCQKqEM90uXk bbT52RfmBNGQ7WpUQaAn/ciHb1/fBtD2pSAqzo44zhD1k+qaMedrt/JG9iDxSCs0Wqxf 0Jrm3boAxPw/WpAhceCfFfzk5/0r8IaaAXwtmrdIE8p1ElFVL+B9rzdnL200wklA2b6H JvNtptjPZAJM1873pChf9SQ+B2T5+PBelG1JXw8nrJ5HgmB7mMIyzDUAz0A1ot12I+PN fDvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:arc-authentication-results; bh=BWsC1MGGN4uGykom1JXEqvQNCAFiWQx/rVRAwl4wC3g=; b=EQsdHUhTTAHIg7jk8E/NSA+NKNSxiLFNBrMfb2NRIrHKc/796LiiNhG2VhE/fIetnK CqwLVcAh9dfxZNetH5HAmyGUNrdnpysqG8eo7WRhLGnLU2eFCCOtHbogeJOEgP2zgpAW yzBmYb1U41I6U2tP27N5fhhNQqk8X+8UyQCVHigwgFurqMRgCjJcI/ik4PYr+u/xbfrf 8+uDin0Mgyj0imNWMauxB1+oFJ5Vl4y47rPR3PxQAgJfXP+YLPlBr8vPbcnsfsWEjxdp riIcZeTucpt4Q7N4XmfhvitT7qcHaRpIrLlTIWwmNyOBxJGZq88kLzZEvyLk8HoYzSNv 4oew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v41-v6si36551761plg.451.2018.05.31.01.03.18; Thu, 31 May 2018 01:03:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754073AbeEaIBy (ORCPT + 99 others); Thu, 31 May 2018 04:01:54 -0400 Received: from mga01.intel.com ([192.55.52.88]:54703 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753934AbeEaIBv (ORCPT ); Thu, 31 May 2018 04:01:51 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 May 2018 01:01:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,463,1520924400"; d="asc'?scan'208";a="45314351" Received: from pipin.fi.intel.com (HELO localhost) ([10.237.68.37]) by orsmga007.jf.intel.com with ESMTP; 31 May 2018 01:01:48 -0700 From: Felipe Balbi To: Roger Quadros , Tero Kristo , "Gerlach\, Dave" Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Nishanth Menon , "Nori\, Sekhar" Subject: Re: [PATCH 2/2] usb: dwc3: of_simple: don't call pm_runtime_set_active() In-Reply-To: References: <1527518174-27860-1-git-send-email-rogerq@ti.com> <1527518174-27860-2-git-send-email-rogerq@ti.com> <87k1rlcok2.fsf@linux.intel.com> Date: Thu, 31 May 2018 10:59:52 +0300 Message-ID: <87bmcwcl1j.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Roger Quadros writes: > On 30/05/18 15:31, Felipe Balbi wrote: >> Roger Quadros writes: >>=20 >>> Don't call pm_runtime_set_active() as it will prevent the device >>> from being activated in the next pm_runtime_get_sync() call. >>> >>> Also call pm_runtime_get_sync() before of_platform_populate(). >>> >>> Signed-off-by: Roger Quadros >>=20 >> This patch is wrong. >>=20 >>> --- >>> drivers/usb/dwc3/dwc3-of-simple.c | 7 +++---- >>> 1 file changed, 3 insertions(+), 4 deletions(-) >>> >>> diff --git a/drivers/usb/dwc3/dwc3-of-simple.c b/drivers/usb/dwc3/dwc3-= of-simple.c >>> index e98d221..2cbb5c0 100644 >>> --- a/drivers/usb/dwc3/dwc3-of-simple.c >>> +++ b/drivers/usb/dwc3/dwc3-of-simple.c >>> @@ -121,6 +121,9 @@ static int dwc3_of_simple_probe(struct platform_dev= ice *pdev) >>> if (ret) >>> goto err_resetc_assert; >>>=20=20 >>> + pm_runtime_enable(dev); >>> + pm_runtime_get_sync(dev); >>=20 >> No, this is the wrong way to do things. My device should be enabled >> already from probe, specially since I have already enabled clocks. > > As far as I understood just enabling clocks (which might not include bus = clock) > doesn't ensure device is enabled. > > Did you mean that I don't need to do a pm_runtime_get_sync() to enable my= device in probe? > Who is enabling by device for me then? Is device core supposed to do it? Not device core, but the bus code. Look at how PCI handles it. IIRC, only TI's omap_device behaves peculiarly WRT probe & pm runtime. > The issue I was facing is that without this patch my device wasn't being = enabled > as pm_runtime_set_active() is being done _before_ pm_runtime_get_sync(). > It could be an issue with the platform's PM domain code as well. Could be =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEElLzh7wn96CXwjh2IzL64meEamQYFAlsPq3gACgkQzL64meEa mQbNIxAAuy04aGRDNcfBLfnHTZc6SImdiuiGUNL8okbukSji03jWf3EN/8TSDjGd P+SbInnQeZ/VuPsdzR7wKbEoRudOrKJ5fbp/BSQuKJjjbj2NHBAnCepmzsfPYTf/ u6K+fKiROfgdH7UpwFkYQgCPSSHBxOYHuwwst++Px10V67VWOFYcVy6oY2MPBEmM Mh4Trc7rlb6A9mR9Ye7buCfWLX7O+XJLYES27+NOlbdRsegn5PEt0NmLulqSgch5 yF9fPlwM+9W5bIxDp8WVlxvcf7Ixd5P8JwrMkbP5Xp7Bar709MLAK6sCB3P8fK96 on6pzFkkFgK1hr3/6KDCpqTcXJNQR/fPRYB96o4I+Tvd8leFqGC6T204x6Ghn8uP pSQ652ObHGHjj/JuVaHWscN+YD+cAvs+gbjI4UwpHuU+caCrdNMsW3PzummZV8Km KEzZVBtU/CXZFuliJJ7oDiglw1/Hf6BFK1kH9ob/xrZsqZ8YLYRCcEPbhzouM3ta W3VFzNN+qEmMI8mu7yir/Xku3O2RtQG6MsrqwxceO6mBKvz5ToJGPsOq6g2LUXOy U3p94VjNNRo41viRMX1Z0ofdTJeyedA59FtOC5/KBgI5jdvM1hz+9Zfxxli+o3qS nf1TSNkcWcvc2SuniNvAnwgrGYzUSP0pkfxGbkUOQyLLSzVIQEM= =eyym -----END PGP SIGNATURE----- --=-=-=--