Commit b947769
thermal: devfreq_cooling: use local ops instead of global ops
Fix access illegal address problem in following condition:
There are multiple devfreq cooling devices in system, some of them has
EM model but others do not. Energy model ops such as state2power will
append to global devfreq_cooling_ops when the cooling device with
EM model is registered. It makes the cooling device without EM model
also use devfreq_cooling_ops after appending when registered later by
of_devfreq_cooling_register_power() or of_devfreq_cooling_register().
The IPA governor regards the cooling devices without EM model as a power
actor, because they also have energy model ops, and will access illegal
address at dfc->em_pd when execute cdev->ops->get_requested_power,
cdev->ops->state2power or cdev->ops->power2state.
Fixes: 615510f ("thermal: devfreq_cooling: remove old power model and use EM")
Cc: 5.13+ <stable@vger.kernel.org> # 5.13+
Signed-off-by: Kant Fan <kant@allwinnertech.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>1 parent 7bb732f commit b947769
1 file changed
Lines changed: 18 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
| 361 | + | |
361 | 362 | | |
362 | 363 | | |
363 | 364 | | |
364 | | - | |
365 | | - | |
| 365 | + | |
| 366 | + | |
366 | 367 | | |
367 | 368 | | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
368 | 375 | | |
369 | 376 | | |
370 | 377 | | |
371 | 378 | | |
372 | | - | |
| 379 | + | |
373 | 380 | | |
374 | | - | |
375 | | - | |
| 381 | + | |
| 382 | + | |
376 | 383 | | |
377 | 384 | | |
378 | 385 | | |
| |||
407 | 414 | | |
408 | 415 | | |
409 | 416 | | |
410 | | - | |
411 | | - | |
| 417 | + | |
412 | 418 | | |
413 | 419 | | |
414 | 420 | | |
| |||
429 | 435 | | |
430 | 436 | | |
431 | 437 | | |
| 438 | + | |
| 439 | + | |
432 | 440 | | |
433 | 441 | | |
434 | 442 | | |
| |||
510 | 518 | | |
511 | 519 | | |
512 | 520 | | |
| 521 | + | |
513 | 522 | | |
514 | 523 | | |
515 | 524 | | |
516 | 525 | | |
517 | 526 | | |
| 527 | + | |
518 | 528 | | |
519 | 529 | | |
520 | 530 | | |
| |||
525 | 535 | | |
526 | 536 | | |
527 | 537 | | |
| 538 | + | |
528 | 539 | | |
529 | 540 | | |
0 commit comments