Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pm: optimize resources #39397

Merged
merged 7 commits into from Nov 19, 2021
Merged

Commits on Nov 18, 2021

  1. drivers: interrupt_controller: i/loapic: use DEVICE_DEFINE

    Define the device using DEVICE_DEFINE macro, so that a single option can
    be used regardless of PM being enabled or not.
    
    Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
    gmarull committed Nov 18, 2021
    Copy the full SHA
    185ec9f View commit details
    Browse the repository at this point in the history
  2. device: remove PM capability from SYS_DEVICE_DEFINE

    The macro already mentions in the docstrings that PM is not supported:
    
    "Invokes DEVICE_DEFINE() with no power management support".
    
    This patch removed the PM entry from the macro and ajusts its uses.
    
    Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
    gmarull committed Nov 18, 2021
    Copy the full SHA
    b2c9e4a View commit details
    Browse the repository at this point in the history
  3. pm: optimize resource usage

    It is well known that PM subsystem has never been optimized in terms of
    resource usage. The situation is particularly bad in case the PM runtime
    API is enabled. What this patch does is to move the responsability of PM
    resource definition to the device like this:
    
    - Device is responsible to define PM resources, using a new set of
      macros: PM_DEVICE_*DEFINE().
    - DEVICE_*DEFINE macro accepts a reference to the device PM state, which
      can be obtained using PM_DEVICE_*REF() set of macros. This
      allows device to initialize the dev->pm reference.
    
    This method decouples a bit more PM from devices since devices just keep
    a reference to the device PM state. It also means that future PM changes
    will have less chances to impact all devices, but only devices that
    support PM.
    
    Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
    gmarull committed Nov 18, 2021
    Copy the full SHA
    dac2a3c View commit details
    Browse the repository at this point in the history
  4. drivers: use new PM macros

    Port some drivers to the recently introduced macros to showcase its
    usage and be able to do some initial testing (nRF52840).
    
    Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
    gmarull committed Nov 18, 2021
    Copy the full SHA
    abad930 View commit details
    Browse the repository at this point in the history
  5. tests: pm: use new PM macros

    Use PM_DEVICE_STATE_DEFINE to define PM state.
    
    Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
    gmarull committed Nov 18, 2021
    Copy the full SHA
    32c17c5 View commit details
    Browse the repository at this point in the history
  6. samples: pm: use new PM macros

    Use recently introduced PM macros to define device PM resources.
    
    Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
    gmarull committed Nov 18, 2021
    Copy the full SHA
    a93d7cd View commit details
    Browse the repository at this point in the history
  7. tests: posix: common: increase main stack for TLS tests

    Increase main stack size (in 128 bytes) to make these tests run
    successfully on qemu_x86 platform.
    
    Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
    gmarull committed Nov 18, 2021
    Copy the full SHA
    f128a7e View commit details
    Browse the repository at this point in the history