Received: by 10.213.65.68 with SMTP id h4csp1382305imn; Wed, 21 Mar 2018 09:18:58 -0700 (PDT) X-Google-Smtp-Source: AG47ELtX27Ak95knOBb+JsJ10CVoObC13TxlZnYzFpZnwSNvFTt6oQ4/8+VPn321Fa/uZPH+KuHM X-Received: by 10.98.65.72 with SMTP id o69mr17333552pfa.97.1521649138861; Wed, 21 Mar 2018 09:18:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521649138; cv=none; d=google.com; s=arc-20160816; b=FlJL3Sb0O6Mfr1UGHiRtWgO7mxp0QRX5zj1vRoDHwJI6ANwRsFZ6w4YXlrBs8pScZg EVyaXU7f9ATs3g757ggVpDO3gZJNiqma57IPquPzux3BJoaHwkbbE+7tKKjp8RpdNibt /PlHi6DrYmwl6CSpPTwZOztbom+2BKNEYC/7wQYEavsinRRLRbS+6YqcaNJlnm0YTryB tRX4mtcIwHNLRb/7jyM3yWzinzRoKa96DPWpJovuVLCyUCIn9lc2+KvRZ7dSiUTLTJYa d5ix3Okq1wBRCZ/xNT7hzJy8cEfgI3+o3zlWSMSViBVflg2tSo2jCsEqEk9RtrKUV8q/ 1V/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=z/Q08W3js6b3d6YGo6JQD5stk8780A91VrmZDOHShPQ=; b=BxFwQxNwtGAVnQHrFSnUnpMkiBtogOkyg1mCCb0Lfds6BVCWSd2yHhnWZ0fkr7TpeJ llWwG/f1Itx2UBQD4utbvQFxqldT5UKt6P1o5FoMmyii8Ia2+scY7Jj7N9Wnxmqdvp+y HeTV9ABkkb6sc/w7JbLEiB4KPjq2bRhFrA2w5ZWFdjtPFZtDfo7l3CeAkADaS4gt9MZD H5eJDZ8k21Zu+v+Phl+yZ0dVNReDy1NvsCkEU0ALtmdtWPD4dawLtLaXoxKqJ4eg7gG9 BHS/shwgxJOW9NC8NZrjLGMe+Ex93d9VGYKlQqtAczIeriS6E+XpK9GCKTug44vo6GIy +zbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=fgZ9PU2P; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m61-v6si4200876plb.63.2018.03.21.09.18.44; Wed, 21 Mar 2018 09:18:58 -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=@lechnology.com header.s=default header.b=fgZ9PU2P; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751942AbeCUQRi (ORCPT + 99 others); Wed, 21 Mar 2018 12:17:38 -0400 Received: from vern.gendns.com ([206.190.152.46]:35464 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751604AbeCUQRe (ORCPT ); Wed, 21 Mar 2018 12:17:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=z/Q08W3js6b3d6YGo6JQD5stk8780A91VrmZDOHShPQ=; b=fgZ9PU2PznNPZtGPkL+1wZYRYs 1wsDUp/P6PWm0TN1zhsyL/XIDUEKZimXUoEy21XIZKEBZyAMXB9Bse6v3YVhqOgM053vDPIPr4aud uOXdMhYnLuPjOq6M7kUCMS0dEFXaTxSzdlMVpYL6yDE7GYRoWyT1eao9OEEuFl7cv48dMEY41ygm9 dRuC3NwqqWPb4HTh2MwF23+m7ldD+xk7hU4ZHzEl+Eck/5O4yqYdwJecmVtDw+JsI67Ln7kiLKUa6 Zfm9drWPjfKLxCcIwCerpSBYNQZZXxuGyo1WtyJqyqly2asXjE4EqtxXjHpeyHMqN4fm4QPfU5zbw GCSjqbhQ==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:59190 helo=[192.168.0.134]) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89_1) (envelope-from ) id 1eygOZ-002a8E-EW; Wed, 21 Mar 2018 12:15:23 -0400 Subject: Re: [PATCH 4/8] clk: davinci: add a reset lookup table for psc0 To: Bartosz Golaszewski Cc: Bartosz Golaszewski , Sekhar Nori , Kevin Hilman , Rob Herring , Mark Rutland , Russell King , Michael Turquette , Stephen Boyd , Ohad Ben-Cohen , Bjorn Andersson , Philipp Zabel , arm-soc , linux-devicetree , LKML , linux-clk@vger.kernel.org, linux-remoteproc@vger.kernel.org References: <20180321120807.18032-1-brgl@bgdev.pl> <20180321120807.18032-5-brgl@bgdev.pl> <4b985ed2-0db0-b4ad-8a9f-b8804e6d4db4@lechnology.com> From: David Lechner Message-ID: Date: Wed, 21 Mar 2018 11:17:35 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/21/2018 11:08 AM, Bartosz Golaszewski wrote: > 2018-03-21 17:01 GMT+01:00 David Lechner : >> On 03/21/2018 07:08 AM, Bartosz Golaszewski wrote: >>> >>> From: Bartosz Golaszewski >>> >>> In order to be able to use the reset framework in legacy boot mode as >>> well, add the reset lookup table to the psc driver for da850 variant. >>> >>> Signed-off-by: Bartosz Golaszewski >>> --- >>> drivers/clk/davinci/psc-da850.c | 8 ++++++++ >>> drivers/clk/davinci/psc.c | 1 + >>> 2 files changed, 9 insertions(+) >>> >>> diff --git a/drivers/clk/davinci/psc-da850.c >>> b/drivers/clk/davinci/psc-da850.c >>> index ccc7eb17bf3a..395db4b2c0ee 100644 >>> --- a/drivers/clk/davinci/psc-da850.c >>> +++ b/drivers/clk/davinci/psc-da850.c >>> @@ -6,6 +6,7 @@ >>> */ >>> #include >>> +#include >>> #include >>> #include >>> #include >>> @@ -66,8 +67,15 @@ LPSC_CLKDEV3(ecap_clkdev, "fck", "ecap.0", >>> "fck", "ecap.1", >>> "fck", "ecap.2"); >>> +static struct reset_control_lookup da850_psc0_reset_lookup_table[] = { >>> + RESET_LOOKUP("davinci-rproc.0", NULL, 15), >>> +}; >>> + >>> static int da850_psc0_init(struct device *dev, void __iomem *base) >>> { >>> + reset_controller_add_lookup("da850-psc0", >>> + da850_psc0_reset_lookup_table, >>> + >>> ARRAY_SIZE(da850_psc0_reset_lookup_table)); >> >> >> Could there be a race condition here since you are adding the lookup >> *before* >> you are adding the actual provider? It seems like >> reset_controller_add_lookup() >> should be after davinci_psc_register_clocks(). >> > > I don't think so, because reset_controller_add_lookup() only adds the > lookup structure to the list in reset/core.c. The actual reset > controller struct is only located and used when reset_control_get_*() > is called, so after probing the user. And it's all protected with > mutexes. > > This made me think though - maybe if we can't locate the controller, > we should return -EPROBE_DEFER from probe in davinci-rproc? > > Bart > Yes, especially since we know that the PSC driver itself does get deferred already.