lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 5 Sep 2022 19:13:41 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Xiaowu Ding <xiaowu.ding@...uarmicro.com>
Cc:     "davem@...emloft.net" <davem@...emloft.net>,
        "edumazet@...gle.com" <edumazet@...gle.com>,
        "kuba@...nel.org" <kuba@...nel.org>,
        "pabeni@...hat.com" <pabeni@...hat.com>,
        "linux@...linux.org.uk" <linux@...linux.org.uk>,
        "nicolas.ferre@...rochip.com" <nicolas.ferre@...rochip.com>,
        "claudiu.beznea@...rochip.com" <claudiu.beznea@...rochip.com>,
        "palmer@...belt.com" <palmer@...belt.com>,
        "paul.walmsley@...ive.com" <paul.walmsley@...ive.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-riscv@...ts.infradead.org" <linux-riscv@...ts.infradead.org>
Subject: Re: 答复: [PATCH net-next] driver:
 cadence macb driver support acpi mode

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ