[Galaxy S II Original Android Development] Entropy512:
Yeah, it's weird.

I haven't touched the clock code yet as I wanted to get stock stable without this issue. So it's the standard code - 1400 MHz is defined in the tables, but it's disabled on I9100/I777. Samsung appears to have merged their Note/GSII code, so instead of using a completely different file, CONFIG_HI_ARMCLK_THAN_1.2GHZ or whatever it is only enables the extra step.

I haven't seen evidence of locks higher than 1200 - but that often happens if you add extra clock levels and forget to find all the locks and change them. I know you fixed the TMU in Gingerbread, and I went and fixed them all eventually. It's one of the things that I now focus on whenever adding OC.

There's an application lock, I think in kernel/power/main.c - but last I checked that requested a frequency not a level.

hmm wait a second - that could have the same bug in terms of table lookup.

So far:

Screen-off max limits of 500 and 800 cause "faint of death" for me (it won't wake up but answers pings), no screen-off profile is fine.

<1>[ 2181.813886] PM: SLEEP
<6>[ 2199.002222] WAKEUP_STAT: 0x80000001
<6>[ 2199.002222] WAKEUP_INTx_PEND: 0x0, 0x0, 0x20, 0x0
<6>[ 2181.814517] PM: early resume of devices complete after 0.754 msecs
<6>[ 2181.815477] wakeup wake lock: wlan_wake
<6>[ 2181.815717] u1_enable_regulator_for_usb_mipi: enable LDOs
<6>[ 2181.818114] exynos4_setup_mshci_set_power : internal MMC Card ON samsung-mshc.
<6>[ 2181.818385] mmc0: FIFO WMARK FOR RX 0x20 WX 0x10. ###########
<6>[ 2182.207641] wake disabled for irq 375
<6>[ 2182.207676] s3c-rtc s3c64xx-rtc: rtc disabled, re-enabling
<6>[ 2182.209356] sec_jack_resume: disable_irq_wake(0)
<6>[ 2182.212013] max17042 9-0036: max17042_get_soc : soc(5836)
<6>[ 2182.212047] max17042_need_soc_recal: HW(0xe)
<6>[ 2182.212078] max17042 9-0036: max17042_get_soc : use raw (88), soc (90)
<6>[ 2182.212937] wake disabled for irq 359
<7>[ 2182.224233] mif: : set_hsic_lpa_states: 250: called(s5p_usb_phy_init+0x94/0x428):
<6>[ 2182.224278] mif: set hsic lpa phy init: slave wake-up (1)
<4>[ 2182.224438] usb usb1: root hub lost power or was reset
<6>[ 2182.249141] [MODEM_IF]Slave Wake
<3>[ 2182.477915] [MODEM_IF]Active States =1, s5p-ehci
<7>[ 2182.504165] s5p_wait_for_cp_resume: retry_cnt = 2
<3>[ 2182.519887] [MIF] gpio [HWK] get [0]
<3>[ 2182.519911] [MIF] ignore request by suspending
<6>[ 2182.719154] usb 1-2: reset high speed USB device number 2 using s5p-ehci
<3>[ 2182.753524] [MIF] gpio [HWK] get [1]
<3>[ 2182.753548] [MIF] ignore request by suspending
<6>[ 2182.754261] [if_usb_resumed]
<6>[ 2182.754343] link_pm_runtime_start: rpm_status: 0
<6>[ 2182.754785] PM: resume of devices complete after 939.977 msecs
<6>[ 2182.754881] [MODEM_IF] flowctl CMD_RESUME(00CB): 21 2a 2b 2c 39 3f
<4>[ 2182.755947] Restarting tasks ...
<6>[ 2182.759338] sec-battery sec-battery: sec_bat_check_temper: recovery count = 0
<6>[ 2182.759888] sec-battery sec-battery: sec_bat_check_temper: temp=260, adc=958
<6>[ 2182.759940] sec-battery sec-battery: sec_bat_charging_time_management: charging_start_time has never been used since initializing
<6>[ 2182.760011] max8922-charger max8922-charger: max8922_is_charging: charging state = 0x3
<6>[ 2182.760060] sec-battery sec-battery: soc(90), vfocv(4063), vcell(3991), temp(26), charging(2), health(1), chg_adc(0)
<4>[ 2182.782503] done.
<6>[ 2182.783278] exynos4_pm_hotplug_notifier_event: restoring pm_hotplug lock 0
<6>[ 2182.783318] link_pm_notifier_event : dpm suspending set to false
<6>[ 2182.783362] suspend: exit suspend, ret = 0 (2012-04-01 23:00:33.569402583 UTC)
<4>[ 2182.889308] CPU1: Booted secondary processor
<6>[ 2182.889648] cpu0 turnning off!
<6>[ 2182.894213] Switched to NOHz mode on CPU #1
<6>[ 2182.955843] [if_usb_suspended]
<6>[ 2184.274251] wake lock wlan_rx_wake, expired
<6>[ 2184.306427] suspend: enter suspend
<6>[ 2184.306548] suspend: enter suspend, (2012-04-01 23:00:35.3785211904 UTC)
<6>[ 2184.306673] PM: Syncing filesystems ... done.
<6>[ 2187.804254] wake lock wlan_rx_wake, expired
<6>[ 2192.303578] max17042 9-0036: max17042_get_soc : soc(5836)
<6>[ 2192.303707] max17042_need_soc_recal: HW(0xe)
<6>[ 2192.303804] max17042 9-0036: max17042_get_soc : use raw (88), soc (90)
<6>[ 2192.305097] sec-battery sec-battery: sec_bat_check_vf: Battery Health (1)
<6>[ 2192.619236] wake lock wlan_rx_wake, expired
<6>[ 2197.739246] wake lock wlan_rx_wake, expired
<6>[ 2202.403305] max17042 9-0036: max17042_get_soc : soc(5836)
<6>[ 2202.403419] max17042_need_soc_recal: HW(0xe)
<6>[ 2202.403520] max17042 9-0036: max17042_get_soc : use raw (88), soc (90)
<6>[ 2202.405192] sec-battery sec-battery: sec_bat_check_vf: Battery Health (1)
<6>[ 2202.549241] wake lock wlan_rx_wake, expired
<6>[ 2207.669251] wake lock wlan_rx_wake, expired
<6>[ 2212.304934] sec-thermistor sec-thermistor: notify_change_of_temperature: uevent: TEMPERATURE=290
<6>[ 2212.508319] max17042 9-0036: max17042_get_soc : soc(5836)
<6>[ 2212.508434] max17042_need_soc_recal: HW(0xe)
<6>[ 2212.508532] max17042 9-0036: max17042_get_soc : use raw (88), soc (90)
<6>[ 2212.510222] sec-battery sec-battery: sec_bat_check_vf: Battery Health (1)
<6>[ 2212.789204] wake lock wlan_rx_wake, expired
<6>[ 2217.814251] wake lock wlan_rx_wake, expired
<6>[ 2222.310026] sec-battery sec-battery: sec_bat_check_temper: recovery count = 0
<6>[ 2222.311028] sec-battery sec-battery: sec_bat_check_temper: temp=260, adc=948
<6>[ 2222.311212] sec-battery sec-battery: sec_bat_charging_time_management: charging_start_time has never been used since initializing
<6>[ 2222.311449] max8922-charger max8922-charger: max8922_is_charging: charging state = 0x3
<6>[ 2222.311633] sec-battery sec-battery: soc(90), vfocv(4062), vcell(4041), temp(26), charging(2), health(1), chg_adc(0)
<6>[ 2222.533278] max17042 9-0036: max17042_get_soc : soc(5836)
<6>[ 2222.533410] max17042_need_soc_recal: HW(0xe)
<6>[ 2222.533515] max17042 9-0036: max17042_get_soc : use raw (88), soc (90)
<6>[ 2222.535287] sec-battery sec-battery: sec_bat_check_vf: Battery Health (1)
<6>[ 2222.624242] wake lock wlan_rx_wake, expired
<6>[ 2227.744251] wake lock wlan_rx_wake, expired
<6>[ 2232.613305] max17042 9-0036: max17042_get_soc : soc(5836)
<6>[ 2232.613420] max17042_need_soc_recal: HW(0xe)
<6>[ 2232.613518] max17042 9-0036: max17042_get_soc : use raw (88), soc (90)
<6>[ 2232.615185] sec-battery sec-battery: sec_bat_check_vf: Battery Health (1)
<6>[ 2232.859232] wake lock wlan_rx_wake, expired
<6>[ 2237.674243] wake lock wlan_rx_wake, expired

THIS one looks like it might be a hotplug bug - when it happens, there's a resume and then "cpu0 turnning off!"

WEIRD.

I think what happened is CPU0 turned off and CPU1 remained on, and that's la la land. I think some interrupts only go to CPU0.

You may not be encountering this if you've got a higher freq_min (I see that you've enabled setting it)

Looks like we may have found our first hotplug bug.

making sure it never hotplugs out CPU0 seems to work for now - curse you samsung