From: "Jon Fraser" Subject: Re: [PATCH] xen/arm: copy cpu clock-frequency to CPU DT node. Date: Mon, 4 Nov 2013 13:35:20 -0500 Message-ID: <1383590120.2465.121.camel@chaos.and.broadcom.com> References: <1383339515-10472-1-git-send-email-jfraser@broadcom.com> <1383585129.8826.132.camel@kazak.uk.xensource.com> Reply-To: jfraser@broadcom.com Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1383585129.8826.132.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Julien Grall , jfraser@broadcom.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Mon, 2013-11-04 at 17:12 +0000, Ian Campbell wrote: > On Fri, 2013-11-01 at 16:58 -0400, Jon Fraser wrote: > > When creating the CPU DT node, copy the clock-frequency if present. > > ... > Julien's the expert but I think you need to use dt_property_read_u32 > here, to get the correct endianness conversion (as well as for pure > forms sake of using the correct API for the job). > I'll fix that. > > break; > > } > > } > > @@ -457,6 +459,12 @@ static int make_cpus_node(const struct domain *d, void *fdt, > > if ( res ) > > return res; > > > > + if (clock_frequency) { > > + res = fdt_property_cell(fdt, "clock-frequency", *(u32 *)clock_frequency); > > I suppose there ought to be some API for this side of things too, but I > can't see it right now... > > Note that fdt_property_cell contains a cpu_to_fdt32 so it is converting > while the read of the property not, so I think the code is broken as is? Yesss, it is broken. When I checked the property in /proc/device-tree, I failed to realize it was endian swapped.