RE: [PATCH 01/11] OMAP2/3: PM: push core PM code from linux-omap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> From: Kevin Hilman [mailto:khilman@xxxxxxxxxxxxxxxxxxx]
> Sent: Monday, May 18, 2009 12:09 PM
> To: Russell King - ARM Linux; Woodruff, Richard


> > There is a function which re-initializes the abort mode registers already -
> > cpu_init().  Please use that if possible instead.
>
> Upon a quick glance, using cpu_init() would not cover all the things
> that this code does.  cpu_init() only handles the init of sp for the
> various modes, where this code saves/resores all the banked registers:
> sp, lr and spsr as well as r8-r12 of FIQ mode.

cpu_init() is not yet accessible at the point this code is running.  You could reduce the context perhaps trying to optimize to what the Linux-ARM implementation is today or do a more generic save like is there now.

This code is copied into place from the .S code into SRAM.  Its position independent and is not linked for this address.  If you want to call functions outside of it you need to manually setup linkage.

Calling outside functions on the way _DOWN_ is ok.  For instance in current TI reference code all cache flush is calling to kernel functions.  This saves in space, duplication maintenance and is actually _much_ quicker as it executes from a cached address range.  The cache flush code takes 770uS from kernel area and takes 2.2mS from sram (non-cached map).

Calling functions on the way _UP_ from wake is NOT easy (like the one you propose) as the MMU is not yet enabled.  The MMU is enabled only below this.  Calling cpu_init() is not do able here.  Even if you dress up the calling pointer to the physical address, it won't work as cpu_init() makes a global variable dereferences (smp_processor_id & stacks[]).

Regards,
Richard W.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux