You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2021/02/23 09:44:49 UTC

[mynewt-core] branch master updated: hw/bus: Fix inactivity timeout usage

This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 5689a5c  hw/bus: Fix inactivity timeout usage
5689a5c is described below

commit 5689a5c35a631d585a56f50a2090c00a2a2a78f3
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Tue Feb 23 09:29:50 2021 +0100

    hw/bus: Fix inactivity timeout usage
    
    Inactivity timeout used for power management was not really using
    time value.
    - if timeout was greater then 0 it was ignored and device was disabled
      at once instead of later.
    - if timeout was 0 device should be disabled at once but it was scheduled
      to be run 1 tick later according to os_callout_reset way
    
    Now checking timeout condition is reversed that seems to be intended
    behavior.
---
 hw/bus/src/bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/bus/src/bus.c b/hw/bus/src/bus.c
index 149a8da..265cf02 100644
--- a/hw/bus/src/bus.c
+++ b/hw/bus/src/bus.c
@@ -512,7 +512,7 @@ bus_node_unlock(struct os_dev *node)
     /* In auto PM we should disable bus device on last unlock */
     if ((bdev->pm_mode == BUS_PM_MODE_AUTO) &&
         (os_mutex_get_level(&bdev->lock) == 1)) {
-        if (bdev->pm_opts.pm_mode_auto.disable_tmo) {
+        if (bdev->pm_opts.pm_mode_auto.disable_tmo == 0) {
             bus_dev_disable(bdev);
         } else {
             os_callout_reset(&bdev->inactivity_tmo,