Upgrade to Pro — share decks privately, control downloads, hide ads and more …

電子辞書で学ぶ Linux のサスペンド

電子辞書で学ぶ Linux のサスペンド

情報科学若手の会 春の陣 2023 #wakate2023s

Takumi Sueda

March 11, 2023
Tweet

More Decks by Takumi Sueda

Other Decks in Technology

Transcript

  1. SHARP Brain SHARP Brain PW-SH 1 SHARP 2008 Windows CE

    2020 CE exe Brain 2ch Brain Windows CE Wikipedia matplotlib 
 5
  2. SHARP Brain 6 DRAM: LPDDR 128 MB eMMC: 8 GB

    SD Raspberry Pi LCD CPU: NXP i.MX 2 83 ARM 926 EJ-S, armv 5 tej 4 54 MHz LCD: 8 00 x 48 0 SD: SDXC :
  3. SHARP Brain SHARP Brain PW-SH 1 U-Boot Linux 2020 Brain

    U-Boot 
 Linux Raspberry Pi SD 
 Linux LCD SD / eMMC 
 etc ... 7
  4. 1 . Suspend-to-Idle 2 . Standby 😴 Userspace 😴 Timekeeping

    tick, 😴 I/O CPU CPU 😴 Suspend-to-Idle 😴 Non-boot CPU 3 . Suspend-to-RAM 😴 Standby 😴 CPU DRAM DRAM 4 . Hibernation 😴 CPU
  5. 1 . Suspend-to-Idle 2 . Standby 😴 Userspace 😴 Timekeeping

    😴 I/O CPU CPU 😴 Suspend-to-Idle 😴 Non-boot CPU 3 . Suspend-to-RAM 😴 Standby 😴 CPU DRAM DRAM 4 . Hibernation 😴 CPU 
 
 Suspend-to-RAM
  6. Suspend-to-RAM 1 . 2 . 3 . & 4 .

    Non-boot CPU CPU IRQ Boot CPU 5 . tick 6 . RAM 7 . Suspend-to-RAM 15
  7. Suspend-to-RAM 1 . 2 . CPU 3 . 4 .

    tick 5 . Non-boot CPU 6 . IRQ 7 . (thaw = ) 8 . Suspend-to-RAM 16
  8. Suspend-to-RAM Suspend-to-RAM 2 18 Brain SoC MOSFET GPIO SPI, I²C

    graceful dev_pm_ops Device Tree Power Management Subsystem 
 ISR Brain GPIO
  9. Suspend-to-RAM 20 Suspend-to-RAM 1. pm_wakeup_event PM subsystem 2 . suspend_enter

    CPU PC CPU /drivers/input/keyboard/gpio_keys.c L 44 3 (Linux 5 . 4 . 2 3 4 ) /kernel/power/suspend.c L 5 02 (Linux 5 . 4 . 2 34 )
  10. Brain ✅ Suspend-to-RAM ✅ GPIO ⬜ MCU I²C I²C ISR

    Windows ⬜ LCD FET ENABLE GPIO regulator Device Tree ⬜ ⬜ OS Suspend-to-RAM 22
  11. suspend_prepare suspend_freeze_processes [1] userspace [ 1 ] https://elixir.bootlin.com/linux/v 5 .

    4 . 23 4 /source/kernel/power/power.h#L 250 Q. kthread userspace 23 Q. 4 SoC Suspend-to-Idle Brain SoC 115mA 86 mA [1] Brain Standby Suspend-to-Idle Suspend-to-RAM LCD [ 1 ] https://twitter.com/puhitaku/status/ 1 62 984 98 629 24 6484 55
  12. Bootlin Elixir: https://elixir.bootlin.com/linux/v 5 . 4 . 2 34 /

    Mainline Linux /Documentation/admin-guide/pm/suspend- fl ows.rst /Documentation/admin-guide/pm/sleep-states.rst 24