1. Feb 27, 2023
  2. Feb 10, 2023
  3. Feb 09, 2023
  4. Feb 08, 2023
  5. Jan 27, 2023
  6. Jan 24, 2023
    • Samuel Holland's avatar
      platform: generic: allwinner: Advertise nonretentive suspend · c45992cc
      Samuel Holland authored
      
      
      Add D1's nonretentive suspend state to the devicetree so S-mode software
      knows about it and can use it.
      
      Latency and power measurements were taken on an Allwinner Nezha board:
       - Entry latency was measured from the beginning of sbi_ecall_handler()
         to before the call to wfi() in sun20i_d1_hart_suspend().
       - Exit latency was measured from the beginning of sbi_init() to before
         the call to sbi_hart_switch_mode() in init_warmboot().
       - There was a 17.5 mW benefit from non-retentive suspend compared to
         WFI, with a 170 mW cost during the 107 us entry/exit period. This
         provides a break-even point around 1040 us. Residency includes entry
         latency, so round this up to 1100 us.
       - The hardware power sequence latency (after the WFI) is assumed to be
         negligible, so set the wakeup latency to the exit latency.
      
      Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
      Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
      c45992cc
    • Samuel Holland's avatar
      lib: utils: Add fdt_add_cpu_idle_states() helper function · 33bf9174
      Samuel Holland authored
      
      
      Since the availability and latency properties of CPU idle states depend
      on the specific SBI HSM implementation, it is appropriate that the idle
      states are added to the devicetree at runtime by that implementation.
      
      This helper function adds a platform-provided array of idle states to
      the devicetree, following the SBI idle state binding.
      
      Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
      Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
      33bf9174
  7. Jan 23, 2023
  8. Jan 22, 2023
  9. Jan 13, 2023
    • Samuel Holland's avatar
      platform: generic: allwinner: Fix PLIC array bounds · da5594bf
      Samuel Holland authored
      The two referenced commits passed incorrect bounds to the PLIC save/
      restore functions, causing out-of-bounds memory access. The functions
      expect "num" to be the 1-based number of interrupt sources, equivalent
      to the "riscv,ndev" devicetree property. Thus, "num" must be strictly
      smaller than the 0-based size of the array storing the register values.
      
      However, the referenced commits incorrectly passed in the unmodified
      size of the array as "num". Fix this by reducing PLIC_SOURCES (matching
      "riscv,ndev" on this platform), while keeping the same array sizes.
      
      Addresses-Coverity-ID: 1530251 ("Out-of-bounds access")
      Addresses-Coverity-ID: 1530252 ("Out-of-bounds access")
      Fixes: 8509e46c ("lib: utils/irqchip: plic: Ensure no out-of-bound access in priority save/restore helpers")
      Fixes: 9a2eeb4a
      
       ("lib: utils/irqchip: plic: Ensure no out-of-bound access in context save/restore helpers")
      Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
      Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
      da5594bf
  10. Jan 09, 2023