+Nishanth and Tero, On 08/14/2017 12:47 PM, Tony Lindgren wrote: > * Stefan Eichenberger <eichest@xxxxxxxxx> [170725 02:04]: >> I already did an RFC [1] that tried to do the same but I think this one is >> cleaner. If a hardware module is disabled in devicetree the address range >> will still be touched by omap_hwmod.c. If the corresponding module isn't >> powered this can lead to a crash of the kernel (for example rtc): > > Just to recap on this, we need to first fix up any related issues > and then applying this should be trivial. Mostly I'm worried about > what all hidden dependencies we have, mosty I want to see what > examples for problems Dave comes up for PM on am335x :) > > Meanwhile, the workaround is to set the problem devices with > status = "disabled" in the board specific dts file. > > In the long run, let's plan on making status = "disabled" mean > that Linux does not touch the device at all until it's state > changes to "okay" and a struct device is created for it. > And to recap the issue: The main problem to solve is that any IP should be idled at the end of boot if no driver was bound. That is what we will lose right now if we stop touching nodes with status="disabled". Today the idling is handled by omap hwmod. In order for hwmod to properly idle the IP it uses PRCM registers that are all in one place but must also touch the SYSCONFIG register present inside every IP, which allows the user to configure how it idles, to idle that specific IP. Because of that last requirement, we must know the register space of each IP. That is why the omap_hwmod framework touches all nodes, to get access to that SYSCONFIG register inside each IP. It programs the sysconfig register during normal operation with nodes marked "okay" but currently must touch the "disabled" nodes as well to be able to forcefully idle them to avoid leaving active nodes wasting power when not in use. All IPs rely on this sysconfig register programming from the hwmod layer in order to idle, although many have proper reset values that let them idle without this. This may not be a problem on all platforms apart from increased power consumption but specifically on am335x not all modules have proper SYSCONFIG values at hardware reset to allow them to idle enough for the system to reach suspend states. Without proper sysconfig programming certain modules will not idle, like USB, CPSW, or DMA on am335x which are some examples off the top of my head and possibly the only guilty modules. So if we do not touch these modules because they are marked disabled then the kernel will not be able to program the SYSCONFIG and the modules cannot idle, so suspend fails on am335x. If we choose to ignore all nodes marked disabled we need another way to describe IPs, or at the very least the address of their SYSCONFIG register, that are present but not in use so that even if we choose not to use them we can properly idle them. We should not have to depend on modules being in use to be able to have proper PM on a system. Regards, Dave > Regards, > > Tony > -- 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