@@ -78,6 +78,8 @@ fw_domain_reset(const struct intel_uncore_forcewake_domain *d)
78
78
static inline void
79
79
fw_domain_arm_timer (struct intel_uncore_forcewake_domain * d )
80
80
{
81
+ GEM_BUG_ON (d -> uncore -> fw_domains_timer & d -> mask );
82
+ d -> uncore -> fw_domains_timer |= d -> mask ;
81
83
d -> wake_count ++ ;
82
84
hrtimer_start_range_ns (& d -> timer ,
83
85
NSEC_PER_MSEC ,
@@ -353,9 +355,10 @@ intel_uncore_fw_release_timer(struct hrtimer *timer)
353
355
return HRTIMER_RESTART ;
354
356
355
357
spin_lock_irqsave (& uncore -> lock , irqflags );
356
- if (WARN_ON (domain -> wake_count == 0 ))
357
- domain -> wake_count ++ ;
358
358
359
+ uncore -> fw_domains_timer &= ~domain -> mask ;
360
+
361
+ GEM_BUG_ON (!domain -> wake_count );
359
362
if (-- domain -> wake_count == 0 )
360
363
uncore -> funcs .force_wake_put (uncore , domain -> mask );
361
364
@@ -673,8 +676,7 @@ static void __intel_uncore_forcewake_put(struct intel_uncore *uncore,
673
676
fw_domains &= uncore -> fw_domains ;
674
677
675
678
for_each_fw_domain_masked (domain , fw_domains , uncore , tmp ) {
676
- if (WARN_ON (domain -> wake_count == 0 ))
677
- continue ;
679
+ GEM_BUG_ON (!domain -> wake_count );
678
680
679
681
if (-- domain -> wake_count ) {
680
682
domain -> active = true;
@@ -764,7 +766,7 @@ void assert_forcewakes_active(struct intel_uncore *uncore,
764
766
unsigned int actual = READ_ONCE (domain -> wake_count );
765
767
unsigned int expect = 1 ;
766
768
767
- if (hrtimer_active ( & domain -> timer ) && READ_ONCE ( domain -> active ) )
769
+ if (uncore -> fw_domains_timer & domain -> mask )
768
770
expect ++ ; /* pending automatic release */
769
771
770
772
if (WARN (actual < expect ,
@@ -1160,8 +1162,7 @@ static noinline void ___force_wake_auto(struct intel_uncore *uncore,
1160
1162
static inline void __force_wake_auto (struct intel_uncore * uncore ,
1161
1163
enum forcewake_domains fw_domains )
1162
1164
{
1163
- if (WARN_ON (!fw_domains ))
1164
- return ;
1165
+ GEM_BUG_ON (!fw_domains );
1165
1166
1166
1167
/* Turn on all requested but inactive supported forcewake domains. */
1167
1168
fw_domains &= uncore -> fw_domains ;
0 commit comments