|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] xen/arm: register clocks used by the hypervisor
Hi Julien, On 22.06.2016 17:26, Julien Grall wrote: Hello Dirk, On 21/06/16 11:16, Dirk Behme wrote:Some clocks might be used by the Xen hypervisor and not by the Linux kernel. If these are not registered by the Linux kernel, they might be disabled by clk_disable_unused() as the kernel doesn't know that they are used. The clock of the serial console handled by Xen is one example for this. It might be disabled by clk_disable_unused() which stops the whole serial output, even from Xen, then. Up to now, the workaround for this has been to use the Linux kernel command line parameter 'clk_ignore_unused'. See Xen bug http://bugs.xenproject.org/xen/bug/45 too. To fix this, we will add the "unused" clocks in Xen to the hypervisor node. The Linux kernel has to register the clocks from the hypervisor node, then. Therefore, check if there is a "clocks" entry in the hypervisor node and if so register the given clocks to the Linux kernel clock framework and with this mark them as used. This prevents the clocks from being disabled.This new property would need to be documented in: - linux/Documentation/devicetree/bindings/arm/xen.txt - xen/docs/misc/arm/device-tree/guest.txt Yes, as already discussed, I'll have a look to that.
I'll have a look to that, too. Thanks! Hopefully it won't be too complicated to rebase ;)
After having a closer look to that, my understanding:We have to call clk_prepare(clk) and clk_enable(clk) in this order (and clk_prepare_enable() does this in one call) to get the enable count incremented http://lxr.free-electrons.com/source/drivers/clk/clk.c#L751 to prevent clk_disable_unused() to disable this clock.That does mean that yes, you are right, the (hw-) clock itself is already enabled by the firmware or Xen. But we are not really interested in enabling the clock, here, but get the Linux kernel's enable_count incremented. Would it be possible to use the flags CLK_IGNORE_UNUSED instead? So the clock will be ignored by clk_disable_unused_subtree. Yes, using CLK_IGNORE_UNUSED is an option. But ;)But we can't set it directly in enlighten.c as we can't access the flags part of the clock structs from outside the core clock code. That would mean that we have to to set the clock flags in the device tree. What would mean that for each clock we don't want to be disabled we have to manipulate the root clock entry of that clock in the device tree. While that would be possible, it doesn't sound that easy and I wonder if that wouldn't be too complicated to be done in Xen (?) You will correct me if I'm wrong ;) Many thanks! Dirk _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |