Netdev List
 help / color / mirror / Atom feed
From: Sekhar Nori <nsekhar@ti.com>
To: Franklin Cooper <fcooper@ti.com>, <linux-kernel@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <netdev@vger.kernel.org>,
	<linux-can@vger.kernel.org>, <wg@grandegger.com>,
	<mkl@pengutronix.de>, <robh+dt@kernel.org>,
	<quentin.schulz@free-electrons.com>
Cc: "Kristo, Tero" <t-kristo@ti.com>,
	Tony Lindgren <tony@atomide.com>,
	Linux OMAP List <linux-omap@vger.kernel.org>
Subject: Re: [v2,1/3] can: m_can: Make hclk optional
Date: Thu, 24 Aug 2017 13:30:30 +0530	[thread overview]
Message-ID: <6f574628-51cd-0db8-e5aa-e7ae4a9cf79a@ti.com> (raw)
In-Reply-To: <20170724225142.19975-2-fcooper@ti.com>

+ some OMAP folks and Linux OMAP list

On Tuesday 25 July 2017 04:21 AM, Franklin Cooper wrote:
> Hclk is the MCAN's interface clock. However, for OMAP based devices such as
> DRA7 SoC family the interface clock is handled by hwmod. Therefore, this
> interface clock is managed by hwmod driver via pm_runtime_get and
> pm_runtime_put calls. Therefore, this interface clock isn't defined in DT
> and thus the driver shouldn't fail if this clock isn't found.

I agree that hclk is defined as interface clock for M_CAN IP on DRA76x.

However, there may be a need for the driver to know the value of hclk to
properly configure the RAM watchdog register which has a counter
counting down using hclk. Looks like the driver does not use the RAM
watchdog today. But if there is a need to configure it in future, it
might be a problem.

Is there a restriction in OMAP architecture against passing the
interface clock also in the 'clocks' property in DT. I have not tried it
myself, but wonder if you hit an issue that led to this patch.

> 
> Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
> ---
> Version 2 changes:
> Used NULL instead of 0 for unused hclk handle
> 
>  drivers/net/can/m_can/m_can.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
> index f4947a7..ea48e59 100644
> --- a/drivers/net/can/m_can/m_can.c
> +++ b/drivers/net/can/m_can/m_can.c
> @@ -1568,8 +1568,13 @@ static int m_can_plat_probe(struct platform_device *pdev)
>  	hclk = devm_clk_get(&pdev->dev, "hclk");
>  	cclk = devm_clk_get(&pdev->dev, "cclk");
>  
> -	if (IS_ERR(hclk) || IS_ERR(cclk)) {
> -		dev_err(&pdev->dev, "no clock found\n");
> +	if (IS_ERR(hclk)) {
> +		dev_warn(&pdev->dev, "hclk could not be found\n");
> +		hclk = NULL;

What is the purpose of NULL setting the clock. I think this is taking it
into a very implementation defined territory and the result could be
different on different architectures. See Russell's explanation here:
https://lkml.org/lkml/2016/11/10/799

Thanks,
Sekhar

> +	}
> +
> +	if (IS_ERR(cclk)) {
> +		dev_err(&pdev->dev, "cclk could not be found\n");
>  		ret = -ENODEV;
>  		goto failed_ret;
>  	}
> 

  reply	other threads:[~2017-08-24  8:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-24 22:51 [PATCH v2 0/3] can: m_can: Add PM Runtime Support Franklin S Cooper Jr
     [not found] ` <20170724225142.19975-1-fcooper-l0cyMroinI0@public.gmane.org>
2017-07-24 22:51   ` [PATCH v2 1/3] can: m_can: Make hclk optional Franklin S Cooper Jr
2017-08-24  8:00     ` Sekhar Nori [this message]
     [not found]       ` <6f574628-51cd-0db8-e5aa-e7ae4a9cf79a-l0cyMroinI0@public.gmane.org>
2017-09-21  0:31         ` [v2,1/3] " Franklin S Cooper Jr
2017-09-21 14:08           ` Sekhar Nori
2017-09-21 19:35             ` Franklin S Cooper Jr
2017-09-20 22:00     ` [PATCH v2 1/3] " Mario Hüttel
2017-09-20 23:29       ` Franklin S Cooper Jr
2017-07-24 22:51 ` [PATCH v2 2/3] can: m_can: Update documentation to indicate that hclk may be optional Franklin S Cooper Jr
2017-07-24 22:51 ` [PATCH v2 3/3] can: m_can: Add PM Runtime Franklin S Cooper Jr
2017-08-24  8:30   ` [v2,3/3] " Sekhar Nori
     [not found]     ` <8037f5f9-d51f-99c3-f2e8-62c90e56a6fa-l0cyMroinI0@public.gmane.org>
2017-09-21  0:36       ` Franklin S Cooper Jr
2017-09-22  1:54         ` Yang, Wenyou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6f574628-51cd-0db8-e5aa-e7ae4a9cf79a@ti.com \
    --to=nsekhar@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=fcooper@ti.com \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=quentin.schulz@free-electrons.com \
    --cc=robh+dt@kernel.org \
    --cc=t-kristo@ti.com \
    --cc=tony@atomide.com \
    --cc=wg@grandegger.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox