Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1631230imm; Thu, 14 Jun 2018 00:59:00 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLv8nHvjq/ErRqlncQGGmA25I0Iq6hgt143CDVqFJoZeIofWrh1rS4GqmiBx+Sb2j7aLOLo X-Received: by 2002:a65:602c:: with SMTP id p12-v6mr1353805pgu.209.1528963139975; Thu, 14 Jun 2018 00:58:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528963139; cv=none; d=google.com; s=arc-20160816; b=Mey749IfTbVL89hEwm+381UZjY3tor+nwWRl8uK+Oo7w1mYS0/Q1zEVkAXtnZLkSf9 DHRtPu30fB4vnt1lXTje5Gzj50DP1ZKs7kjjapq6GDU0Dc4IzDACHQA1vqAAjEP3Q4BC pHvxaAAcFNyp2rcliZyDfLxqXjJfo+64fFwIKk/Ic2nG0xBuX1DGw9DNToQCq+4GXnwl p2bvHZTZWzxQrmCqBM9RxKimPxnuwh0gqniQNxixzYQsoURHn3RjQB27yxA/ccpUd6pT B6ilRpJlfuFI3Lt7pGgeWFpKxiWpGgINo/yxEBtyIa/mpbEZoitPAdM1GtUwKWekz5jG dLmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=m66ozvjXS1bhpyzjxuKLPdcWUZiSarME8fwDzGG9uuo=; b=tdQGo8/C+z9OkUuh68fRMnBh0Ucw7lkAmrAinfvVZB0luuw67bsjiqvsPKrkYbEfhG aruTeeh+krUc55jpPqAQ48972Q7T9mpttolTBbUZNtwstfGOGoZ62mcnLB07e5voObcB 4YhoDngJhM2YPqpnsGkzZ69626ccgpeCgCKCIkCU3d2VS84bye+GwvYsv40t7/j6JCUS 4OzUPnsBrMIvIlYqR13VCilWcuydRRobipU/oojXlC6V6ruF7E7X4TfZXJtPlFatIGXg y44AVOt1x73ge8uAdQlZzfqK+Gwea0lCrQG4GmCWYCb0y2UnJEKsv8NR1bQ+uSbSqC0+ ciIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=DxyY6477; 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 e88-v6si5026165pfk.198.2018.06.14.00.58.44; Thu, 14 Jun 2018 00:58:59 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=DxyY6477; 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 S1754631AbeFNH6S (ORCPT + 99 others); Thu, 14 Jun 2018 03:58:18 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:37892 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752833AbeFNH6Q (ORCPT ); Thu, 14 Jun 2018 03:58:16 -0400 Received: by mail-lf0-f67.google.com with SMTP id i83-v6so7937657lfh.5; Thu, 14 Jun 2018 00:58:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=m66ozvjXS1bhpyzjxuKLPdcWUZiSarME8fwDzGG9uuo=; b=DxyY6477nLx+hCPhe+puYnneMUHnaNYZlNDVF5RNbZ1X1YzqcLHlKKPM8IeisHeZ+3 eeFHY7gME3ONMhsWNpkvkooSBQvkFoVR/Jc5hprbGQj68X3vnWwhvB4xK6r/94FXsylB Ts8vL6ZTgJwYnVaeBJj6KN5/286imU0XTnlC3Pm0Z/lgFjEAS5jKbRT0LSueyLwifTz9 7IiiIkFwh5d752ssd8mStb7cJs6AH1FLu/MrSxqQYlOKR+cZ5sUL/buaPI+0TAJLG35M MiOihdDoMWvcfMurUp7krwNYzu0MQhBM+1mO9hP/oPnBZkDZ6SEKPLno3lNkp1ysnpQ+ dUUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=m66ozvjXS1bhpyzjxuKLPdcWUZiSarME8fwDzGG9uuo=; b=hh2+vxR7FStSiuoyvBWA2PA6z71qSrViUdGR0PN03k0t1omZfFSAAD2WGfrTSBE/xd OQTxIXPqJ34KDRj3FZNQ164CsJ3boGsscf8TyLYk/23LU04rJGAIN2RzLSXzpzgjkwdX RsBJh+iEO/WTR52A8f5lmcc9eMSGLeJRnU+ABAdXnhVjUADYqdU4X0giJkLEcHCkte7O LNkYR3M+6N6Zb/a4lcy6MjMD4921Y91zfuuBXhKOZhJnSJeLg7MlXmFkEzPsA+iopIUl TYtAV2R9Sxkp2RhsA593QrWxv6652t/0D+nM51hZxY9Gc8YtxnacS362J5XH1cyrsI4m +Vcw== X-Gm-Message-State: APt69E1rGvZEvVMdzC0g2O1+lmr/KksC0FsIMQ/1E7MefM7exTqYzFWf g5YGQVY3OudS5N2JCe14RX7n3vOy X-Received: by 2002:a19:cc4b:: with SMTP id c72-v6mr5478528lfg.30.1528963095305; Thu, 14 Jun 2018 00:58:15 -0700 (PDT) Received: from xi.terra (c-8bb2e655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.178.139]) by smtp.gmail.com with ESMTPSA id r84-v6sm840564ljb.24.2018.06.14.00.58.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jun 2018 00:58:14 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.90_1) (envelope-from ) id 1fTN8i-0005oP-59; Thu, 14 Jun 2018 09:57:52 +0200 Date: Thu, 14 Jun 2018 09:57:52 +0200 From: Johan Hovold To: Roger Quadros Cc: Felipe Balbi , Tero Kristo , "Gerlach, Dave" , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Nishanth Menon , "Nori, Sekhar" , Alan Stern , Johan Hovold , Greg Kroah-Hartman Subject: Re: [PATCH 2/2] usb: dwc3: of_simple: don't call pm_runtime_set_active() Message-ID: <20180614075752.GB32411@localhost> References: <1527518174-27860-1-git-send-email-rogerq@ti.com> <1527518174-27860-2-git-send-email-rogerq@ti.com> <87k1rlcok2.fsf@linux.intel.com> <87bmcwcl1j.fsf@linux.intel.com> <4a4fd59c-84a6-61c6-5567-50660b07302a@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4a4fd59c-84a6-61c6-5567-50660b07302a@ti.com> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 13, 2018 at 02:15:11PM +0300, Roger Quadros wrote: > On 31/05/18 10:59, Felipe Balbi wrote: > > > > Hi, > > > > Roger Quadros writes: > > > >> On 30/05/18 15:31, Felipe Balbi wrote: > >>> Roger Quadros writes: > >>> > >>>> 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 > >>> > >>> This patch is wrong. > >>> > >>>> --- > >>>> 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_device *pdev) > >>>> if (ret) > >>>> goto err_resetc_assert; > >>>> > >>>> + pm_runtime_enable(dev); > >>>> + pm_runtime_get_sync(dev); > >>> > >>> 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. In general, that cannot be assumed no. Specifically, this cannot currently be assumed for OMAP due to how its power domain has been implemented. > >> 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? Driver core calls the power domain activate() callback before probe, but OMAP does not implement that callback. So you're right that you currently need a pm_runtime_get_sync() in probe instead of setting status active explicitly as the OMAP pm domain will not enable the bus clock otherwise. You still need to deal with the current driver explicit clock enable if you want to change this, though. Johan