Received: by 10.213.65.68 with SMTP id h4csp179781imn; Fri, 23 Mar 2018 02:08:47 -0700 (PDT) X-Google-Smtp-Source: AG47ELskaDAFRAxxwx8PKMGbdV+3AyH2AqIrW//8t1wJjSiHeFL8jXZ1a9mX4Kd0uO+E6F7NFtLw X-Received: by 10.98.93.141 with SMTP id n13mr17787321pfj.10.1521796127674; Fri, 23 Mar 2018 02:08:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521796127; cv=none; d=google.com; s=arc-20160816; b=ssZjLAdCSd6T7qdN3j9vyvVnBKzVgmQf/IqZRw2b6DP3i9mXKE3nyjaStFeNKLH6eI yy1lnC0OAenoNP9n49YDZQEE7XI1dvOoRbZYMYaOS6Hz8aJkAkJGXLvgkW71XXV6jOt+ CeOd6phrAeLMRRxPo11iLx9Uo3kmEzlaQS1hwwlm3PpqexVhRFhb7hD5CLQQdU1TQ+Kp G+hSxE4257WY0Di+CIqneLPptHKGXM2pjQsMwP/sa3P/DAA8l5LfLp6oFxeeq23g6+5/ 6qbJvPYsBhSDvfNGAbrooQnpSIWIr0UTaaHOh3BvqH0tEyJwgmpnoYoAM7ncadSLQuIL H/OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=nMfVWjhsefNfFnOZYc4ObRNd/CpyRE6hJFDHgRj7ugI=; b=p7a6nIPSzstnO/IBngivF1hWW4qixmUvgb/9l5ZFMgK+JpN/4pV49esq5e+X+64Lac FgSS48VicL14uAXP74kOW6+viUMzwSomZEqKAfVkVuLLr1FFuss0ztU7IMPf0989S0Fj KrR/tH5FX4sUia8Z/PRuoP4M/kMsBfg9MXI9RUSN41KBrjV8jtJfxnfVyjyJqYKkkYJk GjiCS4dyWV40uIX9I4f4Tjg1fz4YTQm8sr3zQ3rlHlBzOiPERpjTAFBN9JPhUT+Suejn byyjq+mQBbFDSmYZUrkQOIk/BBddQYwyopbGyNrV/L1FemmookLN8BSjUKeyG31UOaVQ 1JbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=yROAv1xn; 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 u7-v6si7821265plq.460.2018.03.23.02.08.33; Fri, 23 Mar 2018 02:08:47 -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=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=yROAv1xn; 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 S1751972AbeCWJHe (ORCPT + 99 others); Fri, 23 Mar 2018 05:07:34 -0400 Received: from mail-ot0-f193.google.com ([74.125.82.193]:45277 "EHLO mail-ot0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751689AbeCWJHb (ORCPT ); Fri, 23 Mar 2018 05:07:31 -0400 Received: by mail-ot0-f193.google.com with SMTP id h26-v6so5045713otj.12 for ; Fri, 23 Mar 2018 02:07:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=nMfVWjhsefNfFnOZYc4ObRNd/CpyRE6hJFDHgRj7ugI=; b=yROAv1xnpiTJiV/9yarNo79tjm8NQaP8KbqRRouTymUq7xW2tKYfMDfRB1IIob/SC9 Hvn5w6/1YxZpC9PLRvbWF+pBAny2nePxdMX18BREDf7I05+1jOdGC6xu2zHOL79bE+2D xuers3Gt8cjhzz7YNEJTFNObXlLdy9GZ2CFoDluFGFNjMBHMn9FPuKvoH3yiZdBAmFun j7lu8NefYx8RvBiIHZa4J5oRuxuUoD+0c8SQ4UwbQFi0ntWQXDuptITfS1MAtjM+e64m m6BDbZPycohbrlC75PopY9YVU2dTcV97l6YwPBC+mXRqJpjCrS6I3zed1VyKyQ56RaEl zwzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=nMfVWjhsefNfFnOZYc4ObRNd/CpyRE6hJFDHgRj7ugI=; b=A/qrugiueZC/4Zw/AoiFb90D0dKCr1NGPyPXDdctc3y1ifTjfcRVkOOKyF/kBzZD/R GC/YU6nqlU4ENr+PYUezuhzFC/Rs4hZF06FQZfXuJQhg0K+GfMKdeoc5UNIYFfoUJS0O q/h2aPa3xoXLdB282H1y7cRECYHBA79rNzCZPbtDgRRVTHw5rXyLWtKfGNKPaUyWunVV J8SnWxAz5fMEu7KwDJlnAPJSQ/UKQGAFH7RPoF0WUI61scM/JATZ4rgYq5WGDwqV/lY7 snWcKqQZR7Yn9XucDDMu7llbnm/GhwcvTFgFFJeNB9zNxIjBHlTWOOtpER/HYFznfKAp vmbg== X-Gm-Message-State: AElRT7E+l9JRf+wFbU8uyAoCZ4NWY6LZrhLawwNxV/sY8CSCP1T5N01h D6zWWg6GAz2g5Ee87ifjgq2FAE4gtANYkdag3t/hdw== X-Received: by 2002:a9d:5220:: with SMTP id e32-v6mr18931483oth.211.1521796050903; Fri, 23 Mar 2018 02:07:30 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:1426:0:0:0:0:0 with HTTP; Fri, 23 Mar 2018 02:07:30 -0700 (PDT) In-Reply-To: References: <20180321120807.18032-1-brgl@bgdev.pl> <20180321120807.18032-5-brgl@bgdev.pl> <4b985ed2-0db0-b4ad-8a9f-b8804e6d4db4@lechnology.com> From: Bartosz Golaszewski Date: Fri, 23 Mar 2018 10:07:30 +0100 Message-ID: Subject: Re: [PATCH 4/8] clk: davinci: add a reset lookup table for psc0 To: David Lechner 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-03-21 17:17 GMT+01:00 David Lechner : > 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. On the other hand if clk_get() succeeded, than the psc driver is already initialized and the subsequent call to reset_control_get() must succeed. But this is probably too machine-specific for a driver. Bart