Skip to content
Snippets Groups Projects
  1. Apr 22, 2024
  2. Apr 10, 2024
    • Jonathon Hall's avatar
      purism/common/power: Fix a rare race between AC plug and shutdown · 3bc05c15
      Jonathon Hall authored
      
      If AC is plugged in just as the EC is shutting down, the system would
      remain on but with SMC_SHUTDOWN_N cleared (the EC is no longer keeping
      the power latch on).  Unplugging AC later would cause the system to
      shut off suddenly.
      
      This is rare but reproducible.  Shutting down from PureBoot while on
      battery, the switching on AC (barrel jack adapter plugged into a
      switch) can reproduce this issue roughly 1/10 tries when using a
      stopwatch to try to get the proper timing.
      
      To solve the race, if we attempt to shut down the system, but it does
      not actually shut down, raise SMC_SHUTDOWN_N again.  This also
      eliminates I2C console device freezing due to the EC dropping out in
      the middle of an I2C transaction.
      
      Signed-off-by: default avatarJonathon Hall <jonathon.hall@puri.sm>
      3bc05c15
  3. Apr 04, 2024
  4. Mar 26, 2024