Received: by 10.213.65.68 with SMTP id h4csp1375808imn; Wed, 21 Mar 2018 09:09:28 -0700 (PDT) X-Google-Smtp-Source: AG47ELvO34OYZD+WAgSbB3jB6oJNA6agOUgZ2+Ci6MiVg7TOsyFw1VDp+O7tFwqMeqAh9RZYWvxH X-Received: by 10.99.124.7 with SMTP id x7mr15285509pgc.356.1521648568402; Wed, 21 Mar 2018 09:09:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521648568; cv=none; d=google.com; s=arc-20160816; b=F5em5x8KJSqYqr3UtigKAPrVbU7xVtFjbox97YiD5VYYSNiLWi7xxnqAX2O5+vC/bg Em0nMRq72AqDecZ+th3Qe4yaloIJmQgIGCMGyrkfd0QkRbM6at6Ap7PYpMNNzciah93i GfgkVkx9EQWN3XT/bIDVYo5OOZymBZDqNXyh1fpw1AzSIpW/dedOTEzg8GyuF86FK6gg S/K8HGcRMGZMGmVgt+4qrj5G+GRfs8ocqaRV3dCtcnhog1gEwH6WgZU5JpM7rkBCPfOG 4ltPRYoZ7OyQz3vNVaz2x7VhVN58hzMJkJ0ce8FG3nXF/lSRmx3M1OuKeIphCbFy6FWl Srhg== 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=5r2YBLte5SPPC+u94AmqcyrXmRvxi4rorZHP9jBD370=; b=Y4GnqSXDC8QojXtxy7Olz0+BL46yzI0qCLRqGM2Khd2nkxqxgBvm5SDAP49TZ+7/+W Lfm0hhQ+Ns7d86cCbr6h23asFo1jLjleTKBQ9VrrDnhEYDjZY4HMZu2MeHw6XxIaIdG+ aCvoBosD8RJcQTEfq8sodOtLD6B5L5TPPI5etobVHqpXT1rBust5fhkJYTL8nF0ve+xA HrEdPKt8rBeuijSBR4+z388WZbmoXftxZSaLAA0A/hvDAJA8fFjCCzSwawrgMPWXMZD9 PXwL1DFzNok00Ps74bp/iZ5oHV0Nulpp0tPYD4G+dX6Pesft8AtLbu0J2Dsv/niYpzBH Vjow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=qaplU2bx; 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 w186si3049667pgd.573.2018.03.21.09.09.13; Wed, 21 Mar 2018 09:09:28 -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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=qaplU2bx; 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 S1752605AbeCUQIO (ORCPT + 99 others); Wed, 21 Mar 2018 12:08:14 -0400 Received: from mail-ot0-f195.google.com ([74.125.82.195]:38973 "EHLO mail-ot0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752437AbeCUQIG (ORCPT ); Wed, 21 Mar 2018 12:08:06 -0400 Received: by mail-ot0-f195.google.com with SMTP id h8-v6so6165129oti.6 for ; Wed, 21 Mar 2018 09:08:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=5r2YBLte5SPPC+u94AmqcyrXmRvxi4rorZHP9jBD370=; b=qaplU2bxoCKGb5ixGh2btSRhhzbNKDIwdzdcVEBeirag03jlsnlh8rG5UJ4i4YbKBy LOkQQ7HBOGNsKnKfGdU1/+wsbbdPyZZBwpSIq6dLPvur11xCzsTcIDheOvIQ38dHAw5f rmqq7URhKWp5EskYxW+mbUVIxyQTX9d5QaaFnPi6PbAepoqCCpJquaXV1Zhr9qCgX/FK J57Uqc3Bg4RZpZ3Ih4KYAEIfgVdl5u/vd5OHf0plr/L1X2tKgK3b76NZGQRp0vCQcpqj whTQNqL2SQmIaK3xleo3BR6Lq4NLLSMMK00bj2yg+rRsm6gJnvXf9ifr8qK5d4iM61Td xmKw== 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=5r2YBLte5SPPC+u94AmqcyrXmRvxi4rorZHP9jBD370=; b=Sm1C7irlmQur3yfkl4WrhcG+Wq+rRgxOEZE2zkmw1e+q/V4ljlliYQj2e0DKiO1s0t qY0uWfTKm+pSoE5UmXLfU+eOOOMHzRcdsKuCFMVtcoXi7migjUw3LFHwPjqjLYak1TI9 MC7G6zjotlzEU5VoT8jT7Hho6x3kyEdfQIvaOLh0UBORXMyHSFPbgPTz30UnPV/9h75s q/xVxmMddn9LuNGKTARQvKo3PNntAKoKRjNJYE5L7Uec06WEyOckPu2tXSPrixnyzH8m 9yHhotMDQDbCr10YQ0vbYLc+d5s/2kwRYXatwODDk/nAj7GzN9azsa6epNd4HQy+ziRb g5iw== X-Gm-Message-State: AElRT7E9j8c0i27RmkgIHRYVnMnOtaxxi+25VEUKlOqT6xoRzv0rOwk+ RXGeMocJeocMEI92lzJdUgPoDYPBWFmc7FYnhFt0nQ== X-Received: by 2002:a9d:6244:: with SMTP id i4-v6mr3018886otk.122.1521648485175; Wed, 21 Mar 2018 09:08:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.208.36 with HTTP; Wed, 21 Mar 2018 09:08:04 -0700 (PDT) In-Reply-To: <4b985ed2-0db0-b4ad-8a9f-b8804e6d4db4@lechnology.com> References: <20180321120807.18032-1-brgl@bgdev.pl> <20180321120807.18032-5-brgl@bgdev.pl> <4b985ed2-0db0-b4ad-8a9f-b8804e6d4db4@lechnology.com> From: Bartosz Golaszewski Date: Wed, 21 Mar 2018 17:08:04 +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: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