netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Xiaowu Ding <xiaowu.ding@jaguarmicro.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"linux@armlinux.org.uk" <linux@armlinux.org.uk>,
	"nicolas.ferre@microchip.com" <nicolas.ferre@microchip.com>,
	"claudiu.beznea@microchip.com" <claudiu.beznea@microchip.com>,
	"palmer@dabbelt.com" <palmer@dabbelt.com>,
	"paul.walmsley@sifive.com" <paul.walmsley@sifive.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-riscv@lists.infradead.org"
	<linux-riscv@lists.infradead.org>
Subject: Re: 答复: [PATCH net-next] driver: cadence macb driver support acpi mode
Date: Mon, 5 Sep 2022 19:13:41 +0200	[thread overview]
Message-ID: <YxYuRaXxtyMIF/A6@lunn.ch> (raw)
In-Reply-To: <PS2PR06MB343298952D34545A7372FEFAF27F9@PS2PR06MB3432.apcprd06.prod.outlook.com>

On Mon, Sep 05, 2022 at 02:25:06AM +0000, Xiaowu Ding wrote:
> Hi Andrew:
> 	Thank you very much for your advices.
>  
> 	There will be some problems with the clk_hw_register_fixed_rate interface in the acpi mode.
> 	It seems that the kernel common clock framework can not support the acpi mode,just support the dt mode.

It has two modes:

https://elixir.bootlin.com/linux/v6.0-rc4/source/drivers/clk/clkdev.c#L100
struct clk *clk_get(struct device *dev, const char *con_id)
{
	const char *dev_id = dev ? dev_name(dev) : NULL;
	struct clk_hw *hw;

	if (dev && dev->of_node) {
		hw = of_clk_get_hw(dev->of_node, 0, con_id);
		if (!IS_ERR(hw) || PTR_ERR(hw) == -EPROBE_DEFER)
			return clk_hw_create_clk(dev, hw, dev_id, con_id);
	}

	return __clk_get_sys(dev, dev_id, con_id);
}

If dev has an of_node, it uses of_clk_get_hw().

If dev does not have an of node, it uses __clk_get_sys(), which looks
purely using the clock name.

The common clock framework is older than DT, and so does not force you
to use DT. Please look at making __clk_get_sys() work for you
scenario. You should just need to register the fixed clock using the
correct name. Look at some of the very old boards which have not been
converted to DT.

   Andrew

  reply	other threads:[~2022-09-05 17:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-24 12:13 [PATCH net-next] driver: cadence macb driver support acpi mode xiaowu.ding
2022-08-24 13:10 ` Russell King (Oracle)
2022-08-24 15:17 ` Andrew Lunn
2022-09-05  2:25   ` 答复: " Xiaowu Ding
2022-09-05 17:13     ` Andrew Lunn [this message]
2022-11-14 11:41       ` [PATCH v2] net:macb: " xiaowu.ding
2022-11-16 17:15         ` Jakub Kicinski
2022-08-24 15:25 ` [PATCH net-next] driver: cadence macb " Andrew Lunn

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=YxYuRaXxtyMIF/A6@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=claudiu.beznea@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=pabeni@redhat.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=xiaowu.ding@jaguarmicro.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;
as well as URLs for NNTP newsgroup(s).