All of lore.kernel.org
 help / color / mirror / Atom feed
From: Niklas Cassel <niklas.cassel@axis.com>
To: Fabio Estevam <festevam@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"johan@kernel.org" <johan@kernel.org>
Subject: Re: [PATCH] net: phy: micrel: support !CONFIG_HAVE_CLK
Date: Mon, 4 May 2015 13:30:58 +0200	[thread overview]
Message-ID: <55475872.8020004@axis.com> (raw)
In-Reply-To: <CAOMZO5Dg9FkGkSS7mygv3OdfdF4jOK_nbTvx8eUTGD+EMmRs0g@mail.gmail.com>

On 04/27/2015 07:59 PM, Fabio Estevam wrote:
> On Mon, Apr 27, 2015 at 8:00 AM, Niklas Cassel <niklas.cassel@axis.com> wrote:
> 
>> Since NULL is a valid clock, we shouldn't use
>> IS_ERR_OR_NULL.
> 
> Yes, but this code is not using IS_ERR_OR_NULL.
> 
> It seems that you are not describing the problem you are trying to solve.
> 
> What is the exact issue you are seeing?
> 
>>         clk = devm_clk_get(&phydev->dev, "rmii-ref");
> 
> You need to provide the 'rmii-ref' in your board file or dts.
> 
> Are you doing this?
> 

I'm sorry, my commit message didn't really describe the problem properly.

When you compile your kernel without the clk.h API (CONFIG_HAVE_CLK),
devm_clk_get returns NULL (which also happens to be a valid clock in the clk.h API).
So it's not a matter of DT or board-files. This is on a mips platform without DT support.

I simply want the drivers/net/phy/micrel.c driver to also work without CONFIG_HAVE_CLK,
like it did before commit

63f44b2bfccdd98193bbd602747f780c0fae0f02
net: phy: micrel: add generic clock-mode-select support

Now I get an error every time I boot with "Clock rate out of range: 0",
since clk_get_rate returns 0 when compiling with !CONFIG_HAVE_CLK.


It is confusing that devm_clk_get returns a valid clock in the clk.h API (NULL),
when compiling with !CONFIG_HAVE_CLK, but according to Russell King in:

http://lkml.kernel.org/r/20150207172949.GE8656@n2100.arm.linux.org.uk

this was intentional. (explained in the lkml mail above.)

In the same mail Russell King also suggests how a driver can support both
!CONFIG_HAVE_CLK and CONFIG_HAVE_CLK.

This is the suggestion I followed when writing my patch.

  reply	other threads:[~2015-05-04 11:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-27 11:00 [PATCH] net: phy: micrel: support !CONFIG_HAVE_CLK Niklas Cassel
2015-04-27 11:05 ` Johan Hovold
2015-04-27 11:08   ` Johan Hovold
2015-04-27 17:40     ` David Miller
2015-04-27 17:59 ` Fabio Estevam
2015-05-04 11:30   ` Niklas Cassel [this message]
2015-05-08 14:32     ` Johan Hovold

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=55475872.8020004@axis.com \
    --to=niklas.cassel@axis.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=festevam@gmail.com \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.