Skip to contentSkip to conversation

iio: light: apds9960: correct ->last_busy count

PATCH In review Matt Ranostay 2 participants 4 messages Nov 8, 2015 – Nov 15, 2015 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: light: apds9960: correct ->last_busy count

Add missing pm_runtime_mark_last_busy to apds9960_set_power_state function.

---
 drivers/iio/light/apds9960.c | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/light/apds9960.c +1 -0
index 7d269ef..f6a07dc 100644
@@ -453,6 +453,7 @@ static int apds9960_set_power_state(struct apds9960_data *data, bool on)
 			usleep_range(data->als_adc_int_us,
 				     APDS9960_MAX_INT_TIME_IN_US);
 	} else {
+		pm_runtime_mark_last_busy(dev);
 		ret = pm_runtime_put_autosuspend(dev);
 	}
 
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 4 lines · Matt Ranostay

Add missing pm_runtime_mark_last_busy to apds9960_set_power_state function.

Hi Matt,

Could you elaborate on what the result of this not being there is? My first thought is that this probably wants to go as a fix, but for that I need details of what the effects of the 'bug' are.

Jonathan

Quoted 17 lines
---
 drivers/iio/light/apds9960.c | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/light/apds9960.c +1 -0
index 7d269ef..f6a07dc 100644
@@ -453,6 +453,7 @@ static int apds9960_set_power_state(struct apds9960_data *data, bool on)
 			usleep_range(data->als_adc_int_us,
 				     APDS9960_MAX_INT_TIME_IN_US);
 	} else {
+		pm_runtime_mark_last_busy(dev);
 		ret = pm_runtime_put_autosuspend(dev);
 	}
 
#2 lore raw
Quoted 10 lines · Jonathan Cameron
Quoted 4 lines · Matt Ranostay

Add missing pm_runtime_mark_last_busy to apds9960_set_power_state function.

Hi Matt,

Could you elaborate on what the result of this not being there is? My first thought is that this probably wants to go as a fix, but for that I need details of what the effects of the 'bug' are.

Unless pm_runtime_mark_last_busy is called the pm_runtime_put_autosuspend may put the device into suspend before the delay time requested.

Thanks,

Matt

Quoted 20 lines

Jonathan

Quoted 17 lines
---
 drivers/iio/light/apds9960.c | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/light/apds9960.c +1 -0
index 7d269ef..f6a07dc 100644
@@ -453,6 +453,7 @@ static int apds9960_set_power_state(struct apds9960_data *data, bool on)
                      usleep_range(data->als_adc_int_us,
                                   APDS9960_MAX_INT_TIME_IN_US);
      } else {
+             pm_runtime_mark_last_busy(dev);
              ret = pm_runtime_put_autosuspend(dev);
      }
 
maintainer
#3 lore raw
Quoted 8 lines · Matt Ranostay
Quoted 7 lines · Jonathan Cameron
Quoted 4 lines · Matt Ranostay

Add missing pm_runtime_mark_last_busy to apds9960_set_power_state function.

Hi Matt,

Quoted 7 lines
Quoted 3 lines

Could you elaborate on what the result of this not being there is? My first thought is that this probably wants to go as a fix, but for that I need details of what the effects of the 'bug' are.

Unless pm_runtime_mark_last_busy is called the pm_runtime_put_autosuspend may put the device into suspend before the delay time requested.

Have added this text to the commit message and applied to the temporary branch
fixes-togreg-post-rc1 which should go out in a few days.

Jonathan

Quoted 27 lines

Thanks,

Matt

Quoted 20 lines

Jonathan

Quoted 17 lines
---
 drivers/iio/light/apds9960.c | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/light/apds9960.c +1 -0
index 7d269ef..f6a07dc 100644
@@ -453,6 +453,7 @@ static int apds9960_set_power_state(struct apds9960_data *data, bool on)
                      usleep_range(data->als_adc_int_us,
                                   APDS9960_MAX_INT_TIME_IN_US);
      } else {
+             pm_runtime_mark_last_busy(dev);
              ret = pm_runtime_put_autosuspend(dev);
      }