Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

treewide: Remove redundant

Merge series from Sakari Ailus <sakari.ailus@linux.intel.com>:

Late last year I posted a set to switch to __pm_runtime_mark_last_busy()
and gradually get rid of explicit pm_runtime_mark_last_busy() calls in
drivers, embedding them in the appropriate pm_runtime_*autosuspend*()
calls. The overall feedback I got at the time was that this is an
unnecessary intermediate step, and removing the
pm_runtime_mark_last_busy() calls can be done after adding them to the
relevant Runtime PM autosuspend related functions.

Mark Brown 12826a49 571defe0

+186 -133
+23 -27
Documentation/power/runtime_pm.rst
··· 154 154 device in that case. If there is no idle callback, or if the callback returns 155 155 0, then the PM core will attempt to carry out a runtime suspend of the device, 156 156 also respecting devices configured for autosuspend. In essence this means a 157 - call to pm_runtime_autosuspend() (do note that drivers needs to update the 158 - device last busy mark, pm_runtime_mark_last_busy(), to control the delay under 159 - this circumstance). To prevent this (for example, if the callback routine has 160 - started a delayed suspend), the routine must return a non-zero value. Negative 161 - error return codes are ignored by the PM core. 157 + call to pm_runtime_autosuspend(). To prevent this (for example, if the callback 158 + routine has started a delayed suspend), the routine must return a non-zero 159 + value. Negative error return codes are ignored by the PM core. 162 160 163 161 The helper functions provided by the PM core, described in Section 4, guarantee 164 162 that the following constraints are met with respect to runtime PM callbacks for ··· 328 330 'power.disable_depth' is different from 0 329 331 330 332 `int pm_runtime_autosuspend(struct device *dev);` 331 - - same as pm_runtime_suspend() except that the autosuspend delay is taken 332 - `into account;` if pm_runtime_autosuspend_expiration() says the delay has 333 - not yet expired then an autosuspend is scheduled for the appropriate time 334 - and 0 is returned 333 + - same as pm_runtime_suspend() except that a call to 334 + pm_runtime_mark_last_busy() is made and an autosuspend is scheduled for 335 + the appropriate time and 0 is returned 335 336 336 337 `int pm_runtime_resume(struct device *dev);` 337 338 - execute the subsystem-level resume callback for the device; returns 0 on ··· 354 357 success or error code if the request has not been queued up 355 358 356 359 `int pm_request_autosuspend(struct device *dev);` 357 - - schedule the execution of the subsystem-level suspend callback for the 358 - device when the autosuspend delay has expired; if the delay has already 359 - expired then the work item is queued up immediately 360 + - Call pm_runtime_mark_last_busy() and schedule the execution of the 361 + subsystem-level suspend callback for the device when the autosuspend delay 362 + expires 360 363 361 364 `int pm_schedule_suspend(struct device *dev, unsigned int delay);` 362 365 - schedule the execution of the subsystem-level suspend callback for the ··· 408 411 pm_request_idle(dev) and return its result 409 412 410 413 `int pm_runtime_put_autosuspend(struct device *dev);` 411 - - does the same as __pm_runtime_put_autosuspend() for now, but in the 412 - future, will also call pm_runtime_mark_last_busy() as well, DO NOT USE! 414 + - set the power.last_busy field to the current time and decrement the 415 + device's usage counter; if the result is 0 then run 416 + pm_request_autosuspend(dev) and return its result 413 417 414 418 `int __pm_runtime_put_autosuspend(struct device *dev);` 415 419 - decrement the device's usage counter; if the result is 0 then run ··· 425 427 pm_runtime_suspend(dev) and return its result 426 428 427 429 `int pm_runtime_put_sync_autosuspend(struct device *dev);` 428 - - decrement the device's usage counter; if the result is 0 then run 430 + - set the power.last_busy field to the current time and decrement the 431 + device's usage counter; if the result is 0 then run 429 432 pm_runtime_autosuspend(dev) and return its result 430 433 431 434 `void pm_runtime_enable(struct device *dev);` ··· 869 870 the appropriate PM routines); rather it means that runtime suspends will 870 871 automatically be delayed until the desired period of inactivity has elapsed. 871 872 872 - Inactivity is determined based on the power.last_busy field. Drivers should 873 - call pm_runtime_mark_last_busy() to update this field after carrying out I/O, 874 - typically just before calling __pm_runtime_put_autosuspend(). The desired 875 - length of the inactivity period is a matter of policy. Subsystems can set this 876 - length initially by calling pm_runtime_set_autosuspend_delay(), but after device 873 + Inactivity is determined based on the power.last_busy field. The desired length 874 + of the inactivity period is a matter of policy. Subsystems can set this length 875 + initially by calling pm_runtime_set_autosuspend_delay(), but after device 877 876 registration the length should be controlled by user space, using the 878 877 /sys/devices/.../power/autosuspend_delay_ms attribute. 879 878 ··· 882 885 883 886 Instead of: pm_runtime_suspend use: pm_runtime_autosuspend; 884 887 Instead of: pm_schedule_suspend use: pm_request_autosuspend; 885 - Instead of: pm_runtime_put use: __pm_runtime_put_autosuspend; 888 + Instead of: pm_runtime_put use: pm_runtime_put_autosuspend; 886 889 Instead of: pm_runtime_put_sync use: pm_runtime_put_sync_autosuspend. 887 890 888 891 Drivers may also continue to use the non-autosuspend helper functions; they 889 892 will behave normally, which means sometimes taking the autosuspend delay into 890 - account (see pm_runtime_idle). 893 + account (see pm_runtime_idle). The autosuspend variants of the functions also 894 + call pm_runtime_mark_last_busy(). 891 895 892 896 Under some circumstances a driver or subsystem may want to prevent a device 893 897 from autosuspending immediately, even though the usage counter is zero and the ··· 920 922 foo_io_completion(struct foo_priv *foo, void *req) 921 923 { 922 924 lock(&foo->private_lock); 923 - if (--foo->num_pending_requests == 0) { 924 - pm_runtime_mark_last_busy(&foo->dev); 925 - __pm_runtime_put_autosuspend(&foo->dev); 926 - } else { 925 + if (--foo->num_pending_requests == 0) 926 + pm_runtime_put_autosuspend(&foo->dev); 927 + else 927 928 foo_process_next_request(foo); 928 - } 929 929 unlock(&foo->private_lock); 930 930 /* Send req result back to the user ... */ 931 931 }
+163 -24
include/linux/pm_runtime.h
··· 337 337 * Invoke the "idle check" callback of @dev and, depending on its return value, 338 338 * set up autosuspend of @dev or suspend it (depending on whether or not 339 339 * autosuspend has been enabled for it). 340 + * 341 + * Return: 342 + * * 0: Success. 343 + * * -EINVAL: Runtime PM error. 344 + * * -EACCES: Runtime PM disabled. 345 + * * -EAGAIN: Runtime PM usage_count non-zero, Runtime PM status change ongoing 346 + * or device not in %RPM_ACTIVE state. 347 + * * -EBUSY: Runtime PM child_count non-zero. 348 + * * -EPERM: Device PM QoS resume latency 0. 349 + * * -EINPROGRESS: Suspend already in progress. 350 + * * -ENOSYS: CONFIG_PM not enabled. 351 + * * 1: Device already suspended. 352 + * Other values and conditions for the above values are possible as returned by 353 + * Runtime PM idle and suspend callbacks. 340 354 */ 341 355 static inline int pm_runtime_idle(struct device *dev) 342 356 { ··· 360 346 /** 361 347 * pm_runtime_suspend - Suspend a device synchronously. 362 348 * @dev: Target device. 349 + * 350 + * Return: 351 + * * 0: Success. 352 + * * -EINVAL: Runtime PM error. 353 + * * -EACCES: Runtime PM disabled. 354 + * * -EAGAIN: Runtime PM usage_count non-zero or Runtime PM status change ongoing. 355 + * * -EBUSY: Runtime PM child_count non-zero. 356 + * * -EPERM: Device PM QoS resume latency 0. 357 + * * -ENOSYS: CONFIG_PM not enabled. 358 + * * 1: Device already suspended. 359 + * Other values and conditions for the above values are possible as returned by 360 + * Runtime PM suspend callbacks. 363 361 */ 364 362 static inline int pm_runtime_suspend(struct device *dev) 365 363 { ··· 379 353 } 380 354 381 355 /** 382 - * pm_runtime_autosuspend - Set up autosuspend of a device or suspend it. 356 + * pm_runtime_autosuspend - Update the last access time and set up autosuspend 357 + * of a device. 383 358 * @dev: Target device. 384 359 * 385 - * Set up autosuspend of @dev or suspend it (depending on whether or not 386 - * autosuspend is enabled for it) without engaging its "idle check" callback. 360 + * First update the last access time, then set up autosuspend of @dev or suspend 361 + * it (depending on whether or not autosuspend is enabled for it) without 362 + * engaging its "idle check" callback. 363 + * 364 + * Return: 365 + * * 0: Success. 366 + * * -EINVAL: Runtime PM error. 367 + * * -EACCES: Runtime PM disabled. 368 + * * -EAGAIN: Runtime PM usage_count non-zero or Runtime PM status change ongoing. 369 + * * -EBUSY: Runtime PM child_count non-zero. 370 + * * -EPERM: Device PM QoS resume latency 0. 371 + * * -ENOSYS: CONFIG_PM not enabled. 372 + * * 1: Device already suspended. 373 + * Other values and conditions for the above values are possible as returned by 374 + * Runtime PM suspend callbacks. 387 375 */ 388 376 static inline int pm_runtime_autosuspend(struct device *dev) 389 377 { 378 + pm_runtime_mark_last_busy(dev); 390 379 return __pm_runtime_suspend(dev, RPM_AUTO); 391 380 } 392 381 ··· 420 379 * 421 380 * Queue up a work item to run an equivalent of pm_runtime_idle() for @dev 422 381 * asynchronously. 382 + * 383 + * Return: 384 + * * 0: Success. 385 + * * -EINVAL: Runtime PM error. 386 + * * -EACCES: Runtime PM disabled. 387 + * * -EAGAIN: Runtime PM usage_count non-zero, Runtime PM status change ongoing 388 + * or device not in %RPM_ACTIVE state. 389 + * * -EBUSY: Runtime PM child_count non-zero. 390 + * * -EPERM: Device PM QoS resume latency 0. 391 + * * -EINPROGRESS: Suspend already in progress. 392 + * * -ENOSYS: CONFIG_PM not enabled. 393 + * * 1: Device already suspended. 423 394 */ 424 395 static inline int pm_request_idle(struct device *dev) 425 396 { ··· 448 395 } 449 396 450 397 /** 451 - * pm_request_autosuspend - Queue up autosuspend of a device. 398 + * pm_request_autosuspend - Update the last access time and queue up autosuspend 399 + * of a device. 452 400 * @dev: Target device. 453 401 * 454 - * Queue up a work item to run an equivalent pm_runtime_autosuspend() for @dev 455 - * asynchronously. 402 + * Update the last access time of a device and queue up a work item to run an 403 + * equivalent pm_runtime_autosuspend() for @dev asynchronously. 404 + * 405 + * Return: 406 + * * 0: Success. 407 + * * -EINVAL: Runtime PM error. 408 + * * -EACCES: Runtime PM disabled. 409 + * * -EAGAIN: Runtime PM usage_count non-zero or Runtime PM status change ongoing. 410 + * * -EBUSY: Runtime PM child_count non-zero. 411 + * * -EPERM: Device PM QoS resume latency 0. 412 + * * -EINPROGRESS: Suspend already in progress. 413 + * * -ENOSYS: CONFIG_PM not enabled. 414 + * * 1: Device already suspended. 456 415 */ 457 416 static inline int pm_request_autosuspend(struct device *dev) 458 417 { 418 + pm_runtime_mark_last_busy(dev); 459 419 return __pm_runtime_suspend(dev, RPM_ASYNC | RPM_AUTO); 460 420 } 461 421 ··· 530 464 * 531 465 * Decrement the runtime PM usage counter of @dev and if it turns out to be 532 466 * equal to 0, queue up a work item for @dev like in pm_request_idle(). 467 + * 468 + * Return: 469 + * * 0: Success. 470 + * * -EINVAL: Runtime PM error. 471 + * * -EACCES: Runtime PM disabled. 472 + * * -EAGAIN: Runtime PM usage_count non-zero or Runtime PM status change ongoing. 473 + * * -EBUSY: Runtime PM child_count non-zero. 474 + * * -EPERM: Device PM QoS resume latency 0. 475 + * * -EINPROGRESS: Suspend already in progress. 476 + * * -ENOSYS: CONFIG_PM not enabled. 477 + * * 1: Device already suspended. 533 478 */ 534 479 static inline int pm_runtime_put(struct device *dev) 535 480 { ··· 555 478 * 556 479 * Decrement the runtime PM usage counter of @dev and if it turns out to be 557 480 * equal to 0, queue up a work item for @dev like in pm_request_autosuspend(). 481 + * 482 + * Return: 483 + * * 0: Success. 484 + * * -EINVAL: Runtime PM error. 485 + * * -EACCES: Runtime PM disabled. 486 + * * -EAGAIN: Runtime PM usage_count non-zero or Runtime PM status change ongoing. 487 + * * -EBUSY: Runtime PM child_count non-zero. 488 + * * -EPERM: Device PM QoS resume latency 0. 489 + * * -EINPROGRESS: Suspend already in progress. 490 + * * -ENOSYS: CONFIG_PM not enabled. 491 + * * 1: Device already suspended. 558 492 */ 559 493 static inline int __pm_runtime_put_autosuspend(struct device *dev) 560 494 { ··· 573 485 } 574 486 575 487 /** 576 - * pm_runtime_put_autosuspend - Drop device usage counter and queue autosuspend if 0. 488 + * pm_runtime_put_autosuspend - Update the last access time of a device, drop 489 + * its usage counter and queue autosuspend if the usage counter becomes 0. 577 490 * @dev: Target device. 578 491 * 579 - * Decrement the runtime PM usage counter of @dev and if it turns out to be 580 - * equal to 0, queue up a work item for @dev like in pm_request_autosuspend(). 492 + * Update the last access time of @dev, decrement runtime PM usage counter of 493 + * @dev and if it turns out to be equal to 0, queue up a work item for @dev like 494 + * in pm_request_autosuspend(). 495 + * 496 + * Return: 497 + * * 0: Success. 498 + * * -EINVAL: Runtime PM error. 499 + * * -EACCES: Runtime PM disabled. 500 + * * -EAGAIN: Runtime PM usage_count non-zero or Runtime PM status change ongoing. 501 + * * -EBUSY: Runtime PM child_count non-zero. 502 + * * -EPERM: Device PM QoS resume latency 0. 503 + * * -EINPROGRESS: Suspend already in progress. 504 + * * -ENOSYS: CONFIG_PM not enabled. 505 + * * 1: Device already suspended. 581 506 */ 582 507 static inline int pm_runtime_put_autosuspend(struct device *dev) 583 508 { 584 - return __pm_runtime_suspend(dev, 585 - RPM_GET_PUT | RPM_ASYNC | RPM_AUTO); 509 + pm_runtime_mark_last_busy(dev); 510 + return __pm_runtime_put_autosuspend(dev); 586 511 } 587 512 588 513 /** ··· 607 506 * return value, set up autosuspend of @dev or suspend it (depending on whether 608 507 * or not autosuspend has been enabled for it). 609 508 * 610 - * The possible return values of this function are the same as for 611 - * pm_runtime_idle() and the runtime PM usage counter of @dev remains 612 - * decremented in all cases, even if it returns an error code. 509 + * The runtime PM usage counter of @dev remains decremented in all cases, even 510 + * if it returns an error code. 511 + * 512 + * Return: 513 + * * 0: Success. 514 + * * -EINVAL: Runtime PM error. 515 + * * -EACCES: Runtime PM disabled. 516 + * * -EAGAIN: Runtime PM usage_count non-zero or Runtime PM status change ongoing. 517 + * * -EBUSY: Runtime PM child_count non-zero. 518 + * * -EPERM: Device PM QoS resume latency 0. 519 + * * -ENOSYS: CONFIG_PM not enabled. 520 + * * 1: Device already suspended. 521 + * Other values and conditions for the above values are possible as returned by 522 + * Runtime PM suspend callbacks. 613 523 */ 614 524 static inline int pm_runtime_put_sync(struct device *dev) 615 525 { ··· 634 522 * Decrement the runtime PM usage counter of @dev and if it turns out to be 635 523 * equal to 0, carry out runtime-suspend of @dev synchronously. 636 524 * 637 - * The possible return values of this function are the same as for 638 - * pm_runtime_suspend() and the runtime PM usage counter of @dev remains 639 - * decremented in all cases, even if it returns an error code. 525 + * The runtime PM usage counter of @dev remains decremented in all cases, even 526 + * if it returns an error code. 527 + * 528 + * Return: 529 + * * 0: Success. 530 + * * -EINVAL: Runtime PM error. 531 + * * -EACCES: Runtime PM disabled. 532 + * * -EAGAIN: Runtime PM usage_count non-zero or Runtime PM status change ongoing. 533 + * * -EAGAIN: usage_count non-zero or Runtime PM status change ongoing. 534 + * * -EBUSY: Runtime PM child_count non-zero. 535 + * * -EPERM: Device PM QoS resume latency 0. 536 + * * -ENOSYS: CONFIG_PM not enabled. 537 + * * 1: Device already suspended. 538 + * Other values and conditions for the above values are possible as returned by 539 + * Runtime PM suspend callbacks. 640 540 */ 641 541 static inline int pm_runtime_put_sync_suspend(struct device *dev) 642 542 { ··· 656 532 } 657 533 658 534 /** 659 - * pm_runtime_put_sync_autosuspend - Drop device usage counter and autosuspend if 0. 535 + * pm_runtime_put_sync_autosuspend - Update the last access time of a device, 536 + * drop device usage counter and autosuspend if 0. 660 537 * @dev: Target device. 661 538 * 662 - * Decrement the runtime PM usage counter of @dev and if it turns out to be 663 - * equal to 0, set up autosuspend of @dev or suspend it synchronously (depending 664 - * on whether or not autosuspend has been enabled for it). 539 + * Update the last access time of @dev, decrement the runtime PM usage counter 540 + * of @dev and if it turns out to be equal to 0, set up autosuspend of @dev or 541 + * suspend it synchronously (depending on whether or not autosuspend has been 542 + * enabled for it). 665 543 * 666 - * The possible return values of this function are the same as for 667 - * pm_runtime_autosuspend() and the runtime PM usage counter of @dev remains 668 - * decremented in all cases, even if it returns an error code. 544 + * The runtime PM usage counter of @dev remains decremented in all cases, even 545 + * if it returns an error code. 546 + * 547 + * Return: 548 + * * 0: Success. 549 + * * -EINVAL: Runtime PM error. 550 + * * -EACCES: Runtime PM disabled. 551 + * * -EAGAIN: Runtime PM usage_count non-zero or Runtime PM status change ongoing. 552 + * * -EBUSY: Runtime PM child_count non-zero. 553 + * * -EPERM: Device PM QoS resume latency 0. 554 + * * -EINPROGRESS: Suspend already in progress. 555 + * * -ENOSYS: CONFIG_PM not enabled. 556 + * * 1: Device already suspended. 557 + * Other values and conditions for the above values are possible as returned by 558 + * Runtime PM suspend callbacks. 669 559 */ 670 560 static inline int pm_runtime_put_sync_autosuspend(struct device *dev) 671 561 { 562 + pm_runtime_mark_last_busy(dev); 672 563 return __pm_runtime_suspend(dev, RPM_GET_PUT | RPM_AUTO); 673 564 } 674 565
-6
sound/soc/atmel/mchp-spdifrx.c
··· 577 577 sizeof(ch_stat->data)); 578 578 579 579 pm_runtime_put: 580 - pm_runtime_mark_last_busy(dev->dev); 581 580 pm_runtime_put_autosuspend(dev->dev); 582 581 unlock: 583 582 mutex_unlock(&dev->mlock); ··· 659 660 sizeof(user_data->data)); 660 661 661 662 pm_runtime_put: 662 - pm_runtime_mark_last_busy(dev->dev); 663 663 pm_runtime_put_autosuspend(dev->dev); 664 664 unlock: 665 665 mutex_unlock(&dev->mlock); ··· 724 726 725 727 uvalue->value.integer.value[0] = ctrl->ulock; 726 728 727 - pm_runtime_mark_last_busy(dev->dev); 728 729 pm_runtime_put_autosuspend(dev->dev); 729 730 unlock: 730 731 mutex_unlock(&dev->mlock); ··· 759 762 ctrl->badf = 0; 760 763 } 761 764 762 - pm_runtime_mark_last_busy(dev->dev); 763 765 pm_runtime_put_autosuspend(dev->dev); 764 766 unlock: 765 767 mutex_unlock(&dev->mlock); ··· 807 811 regmap_read(dev->regmap, SPDIFRX_RSR, &val); 808 812 } 809 813 810 - pm_runtime_mark_last_busy(dev->dev); 811 814 pm_runtime_put_autosuspend(dev->dev); 812 815 813 816 unlock: ··· 870 875 ucontrol->value.integer.value[0] = rate / (32 * SPDIFRX_RSR_IFS(val)); 871 876 872 877 pm_runtime_put: 873 - pm_runtime_mark_last_busy(dev->dev); 874 878 pm_runtime_put_autosuspend(dev->dev); 875 879 unlock: 876 880 mutex_unlock(&dev->mlock);
-2
sound/soc/codecs/arizona-jack.c
··· 319 319 320 320 if (change) { 321 321 regulator_disable(info->micvdd); 322 - pm_runtime_mark_last_busy(arizona->dev); 323 322 pm_runtime_put_autosuspend(arizona->dev); 324 323 } 325 324 } ··· 1126 1127 1127 1128 mutex_unlock(&info->lock); 1128 1129 1129 - pm_runtime_mark_last_busy(arizona->dev); 1130 1130 pm_runtime_put_autosuspend(arizona->dev); 1131 1131 1132 1132 return IRQ_HANDLED;
-2
sound/soc/codecs/cs35l41.c
··· 483 483 } 484 484 485 485 done: 486 - pm_runtime_mark_last_busy(cs35l41->dev); 487 486 pm_runtime_put_autosuspend(cs35l41->dev); 488 487 489 488 return ret; ··· 1327 1328 1328 1329 pm_runtime_set_autosuspend_delay(cs35l41->dev, 3000); 1329 1330 pm_runtime_use_autosuspend(cs35l41->dev); 1330 - pm_runtime_mark_last_busy(cs35l41->dev); 1331 1331 pm_runtime_set_active(cs35l41->dev); 1332 1332 pm_runtime_get_noresume(cs35l41->dev); 1333 1333 pm_runtime_enable(cs35l41->dev);
-1
sound/soc/codecs/cs35l45.c
··· 1427 1427 1428 1428 pm_runtime_set_autosuspend_delay(cs35l45->dev, 3000); 1429 1429 pm_runtime_use_autosuspend(cs35l45->dev); 1430 - pm_runtime_mark_last_busy(cs35l45->dev); 1431 1430 pm_runtime_set_active(cs35l45->dev); 1432 1431 pm_runtime_get_noresume(cs35l45->dev); 1433 1432 pm_runtime_enable(cs35l45->dev);
-1
sound/soc/codecs/cs35l56-sdw.c
··· 283 283 } 284 284 285 285 out: 286 - pm_runtime_mark_last_busy(cs35l56->base.dev); 287 286 pm_runtime_put_autosuspend(cs35l56->base.dev); 288 287 } 289 288
-1
sound/soc/codecs/cs35l56.c
··· 871 871 872 872 cs35l56_log_tuning(&cs35l56->base, &cs35l56->dsp.cs_dsp); 873 873 err: 874 - pm_runtime_mark_last_busy(cs35l56->base.dev); 875 874 pm_runtime_put_autosuspend(cs35l56->base.dev); 876 875 } 877 876
-1
sound/soc/codecs/cs42l42.c
··· 1775 1775 } 1776 1776 1777 1777 mutex_unlock(&cs42l42->irq_lock); 1778 - pm_runtime_mark_last_busy(cs42l42->dev); 1779 1778 pm_runtime_put_autosuspend(cs42l42->dev); 1780 1779 1781 1780 return IRQ_HANDLED;
-5
sound/soc/codecs/cs42l43-jack.c
··· 242 242 error: 243 243 mutex_unlock(&priv->jack_lock); 244 244 245 - pm_runtime_mark_last_busy(priv->dev); 246 245 pm_runtime_put_autosuspend(priv->dev); 247 246 248 247 return ret; ··· 422 423 error: 423 424 mutex_unlock(&priv->jack_lock); 424 425 425 - pm_runtime_mark_last_busy(priv->dev); 426 426 pm_runtime_put_autosuspend(priv->dev); 427 427 } 428 428 ··· 460 462 461 463 mutex_unlock(&priv->jack_lock); 462 464 463 - pm_runtime_mark_last_busy(priv->dev); 464 465 pm_runtime_put_autosuspend(priv->dev); 465 466 } 466 467 ··· 501 504 502 505 mutex_unlock(&priv->jack_lock); 503 506 504 - pm_runtime_mark_last_busy(priv->dev); 505 507 pm_runtime_put_autosuspend(priv->dev); 506 508 } 507 509 ··· 772 776 773 777 priv->suspend_jack_debounce = false; 774 778 775 - pm_runtime_mark_last_busy(priv->dev); 776 779 pm_runtime_put_autosuspend(priv->dev); 777 780 } 778 781
-2
sound/soc/codecs/cs42l43.c
··· 1088 1088 ret ? "open" : "closed"); 1089 1089 1090 1090 error: 1091 - pm_runtime_mark_last_busy(priv->dev); 1092 1091 pm_runtime_put_autosuspend(priv->dev); 1093 1092 1094 1093 return ret; ··· 2369 2370 goto err_clk; 2370 2371 } 2371 2372 2372 - pm_runtime_mark_last_busy(priv->dev); 2373 2373 pm_runtime_put_autosuspend(priv->dev); 2374 2374 2375 2375 return 0;
-1
sound/soc/codecs/cs48l32.c
··· 1385 1385 result = IRQ_HANDLED; 1386 1386 1387 1387 out: 1388 - pm_runtime_mark_last_busy(cs48l32_codec->core.dev); 1389 1388 pm_runtime_put_autosuspend(cs48l32_codec->core.dev); 1390 1389 1391 1390 return result;
-3
sound/soc/codecs/hda.c
··· 162 162 snd_hda_codec_register(codec); 163 163 164 164 /* Complement pm_runtime_get_sync(bus) in probe */ 165 - pm_runtime_mark_last_busy(bus->dev); 166 165 pm_runtime_put_autosuspend(bus->dev); 167 166 168 167 return ret; ··· 261 262 262 263 snd_hdac_ext_bus_link_put(bus, hlink); 263 264 264 - pm_runtime_mark_last_busy(bus->dev); 265 265 pm_runtime_put_autosuspend(bus->dev); 266 266 return ret; 267 267 } ··· 298 300 * not be called due to early error, leaving bus uc unbalanced 299 301 */ 300 302 if (!was_registered) { 301 - pm_runtime_mark_last_busy(bus->dev); 302 303 pm_runtime_put_autosuspend(bus->dev); 303 304 } 304 305
-1
sound/soc/codecs/max98363.c
··· 188 188 max98363->hw_init = true; 189 189 190 190 out: 191 - pm_runtime_mark_last_busy(dev); 192 191 pm_runtime_put_autosuspend(dev); 193 192 194 193 return ret;
-1
sound/soc/codecs/max98373-sdw.c
··· 458 458 max98373->first_hw_init = true; 459 459 max98373->hw_init = true; 460 460 461 - pm_runtime_mark_last_busy(dev); 462 461 pm_runtime_put_autosuspend(dev); 463 462 464 463 return 0;
-1
sound/soc/codecs/rt1017-sdca-sdw.c
··· 362 362 /* Mark Slave initialization complete */ 363 363 rt1017->hw_init = true; 364 364 365 - pm_runtime_mark_last_busy(&slave->dev); 366 365 pm_runtime_put_autosuspend(&slave->dev); 367 366 368 367 dev_dbg(&slave->dev, "hw_init complete\n");
-1
sound/soc/codecs/rt1308-sdw.c
··· 291 291 /* Mark Slave initialization complete */ 292 292 rt1308->hw_init = true; 293 293 294 - pm_runtime_mark_last_busy(&slave->dev); 295 294 pm_runtime_put_autosuspend(&slave->dev); 296 295 297 296 dev_dbg(&slave->dev, "%s hw_init complete\n", __func__);
-1
sound/soc/codecs/rt1316-sdw.c
··· 302 302 /* Mark Slave initialization complete */ 303 303 rt1316->hw_init = true; 304 304 305 - pm_runtime_mark_last_busy(&slave->dev); 306 305 pm_runtime_put_autosuspend(&slave->dev); 307 306 308 307 dev_dbg(&slave->dev, "%s hw_init complete\n", __func__);
-1
sound/soc/codecs/rt1318-sdw.c
··· 434 434 rt1318->first_hw_init = true; 435 435 rt1318->hw_init = true; 436 436 437 - pm_runtime_mark_last_busy(&slave->dev); 438 437 pm_runtime_put_autosuspend(&slave->dev); 439 438 440 439 dev_dbg(&slave->dev, "%s hw_init complete\n", __func__);
-1
sound/soc/codecs/rt1320-sdw.c
··· 763 763 rt1320->first_hw_init = true; 764 764 rt1320->hw_init = true; 765 765 766 - pm_runtime_mark_last_busy(&slave->dev); 767 766 pm_runtime_put_autosuspend(&slave->dev); 768 767 769 768 dev_dbg(&slave->dev, "%s hw_init complete\n", __func__);
-1
sound/soc/codecs/rt5682-sdw.c
··· 474 474 rt5682->first_hw_init = true; 475 475 476 476 err_nodev: 477 - pm_runtime_mark_last_busy(&slave->dev); 478 477 pm_runtime_put_autosuspend(&slave->dev); 479 478 480 479 dev_dbg(&slave->dev, "%s hw_init complete: %d\n", __func__, ret);
-2
sound/soc/codecs/rt700.c
··· 338 338 339 339 rt700_jack_init(rt700); 340 340 341 - pm_runtime_mark_last_busy(component->dev); 342 341 pm_runtime_put_autosuspend(component->dev); 343 342 344 343 return 0; ··· 1229 1230 /* Mark Slave initialization complete */ 1230 1231 rt700->hw_init = true; 1231 1232 1232 - pm_runtime_mark_last_busy(&slave->dev); 1233 1233 pm_runtime_put_autosuspend(&slave->dev); 1234 1234 1235 1235 dev_dbg(&slave->dev, "%s hw_init complete\n", __func__);
-2
sound/soc/codecs/rt711-sdca.c
··· 545 545 546 546 rt711_sdca_jack_init(rt711); 547 547 548 - pm_runtime_mark_last_busy(component->dev); 549 548 pm_runtime_put_autosuspend(component->dev); 550 549 551 550 return 0; ··· 1661 1662 /* Mark Slave initialization complete */ 1662 1663 rt711->hw_init = true; 1663 1664 1664 - pm_runtime_mark_last_busy(&slave->dev); 1665 1665 pm_runtime_put_autosuspend(&slave->dev); 1666 1666 1667 1667 dev_dbg(&slave->dev, "%s hw_init complete\n", __func__);
-2
sound/soc/codecs/rt711.c
··· 480 480 481 481 rt711_jack_init(rt711); 482 482 483 - pm_runtime_mark_last_busy(component->dev); 484 483 pm_runtime_put_autosuspend(component->dev); 485 484 486 485 return 0; ··· 1330 1331 /* Mark Slave initialization complete */ 1331 1332 rt711->hw_init = true; 1332 1333 1333 - pm_runtime_mark_last_busy(&slave->dev); 1334 1334 pm_runtime_put_autosuspend(&slave->dev); 1335 1335 1336 1336 dev_dbg(&slave->dev, "%s hw_init complete\n", __func__);
-1
sound/soc/codecs/rt712-sdca-dmic.c
··· 236 236 /* Mark Slave initialization complete */ 237 237 rt712->hw_init = true; 238 238 239 - pm_runtime_mark_last_busy(&slave->dev); 240 239 pm_runtime_put_autosuspend(&slave->dev); 241 240 242 241 dev_dbg(&slave->dev, "%s hw_init complete\n", __func__);
-2
sound/soc/codecs/rt712-sdca.c
··· 479 479 480 480 rt712_sdca_jack_init(rt712); 481 481 482 - pm_runtime_mark_last_busy(component->dev); 483 482 pm_runtime_put_autosuspend(component->dev); 484 483 485 484 return 0; ··· 1924 1925 dev_dbg(&slave->dev, "%s hw_init complete\n", __func__); 1925 1926 1926 1927 suspend: 1927 - pm_runtime_mark_last_busy(&slave->dev); 1928 1928 pm_runtime_put_autosuspend(&slave->dev); 1929 1929 1930 1930 return 0;
-1
sound/soc/codecs/rt715-sdca.c
··· 1065 1065 /* Mark Slave initialization complete */ 1066 1066 rt715->hw_init = true; 1067 1067 1068 - pm_runtime_mark_last_busy(&slave->dev); 1069 1068 pm_runtime_put_autosuspend(&slave->dev); 1070 1069 1071 1070 return 0;
-1
sound/soc/codecs/rt715.c
··· 1129 1129 /* Mark Slave initialization complete */ 1130 1130 rt715->hw_init = true; 1131 1131 1132 - pm_runtime_mark_last_busy(&slave->dev); 1133 1132 pm_runtime_put_autosuspend(&slave->dev); 1134 1133 1135 1134 return 0;
-2
sound/soc/codecs/rt721-sdca.c
··· 327 327 328 328 rt721_sdca_jack_init(rt721); 329 329 330 - pm_runtime_mark_last_busy(component->dev); 331 330 pm_runtime_put_autosuspend(component->dev); 332 331 333 332 return 0; ··· 1532 1533 /* Mark Slave initialization complete */ 1533 1534 rt721->hw_init = true; 1534 1535 1535 - pm_runtime_mark_last_busy(&slave->dev); 1536 1536 pm_runtime_put_autosuspend(&slave->dev); 1537 1537 1538 1538 dev_dbg(&slave->dev, "%s hw_init complete\n", __func__);
-2
sound/soc/codecs/rt722-sdca.c
··· 339 339 340 340 rt722_sdca_jack_init(rt722); 341 341 342 - pm_runtime_mark_last_busy(component->dev); 343 342 pm_runtime_put_autosuspend(component->dev); 344 343 345 344 return 0; ··· 1558 1559 /* Mark Slave initialization complete */ 1559 1560 rt722->hw_init = true; 1560 1561 1561 - pm_runtime_mark_last_busy(&slave->dev); 1562 1562 pm_runtime_put_autosuspend(&slave->dev); 1563 1563 1564 1564 dev_dbg(&slave->dev, "%s hw_init complete\n", __func__);
-3
sound/soc/codecs/rt9123.c
··· 77 77 /* AMPON bit is located in volatile RG, use pm_runtime to guarantee the RG access */ 78 78 snd_soc_component_write_field(comp, RT9123_REG_AMPCTRL, RT9123_MASK_AMPON, enable); 79 79 80 - pm_runtime_mark_last_busy(dev); 81 80 pm_runtime_put_autosuspend(dev); 82 81 83 82 return 0; ··· 139 140 if (ret < 0) 140 141 dev_err(dev, "Failed to get control (%d)\n", ret); 141 142 142 - pm_runtime_mark_last_busy(dev); 143 143 pm_runtime_put_autosuspend(dev); 144 144 return ret; 145 145 } ··· 166 168 if (ret < 0) 167 169 dev_err(dev, "Failed to put control (%d)\n", ret); 168 170 169 - pm_runtime_mark_last_busy(dev); 170 171 pm_runtime_put_autosuspend(dev); 171 172 return ret; 172 173 }
-1
sound/soc/codecs/tas2552.c
··· 724 724 pm_runtime_set_autosuspend_delay(&client->dev, 1000); 725 725 pm_runtime_use_autosuspend(&client->dev); 726 726 pm_runtime_enable(&client->dev); 727 - pm_runtime_mark_last_busy(&client->dev); 728 727 pm_runtime_put_sync_autosuspend(&client->dev); 729 728 730 729 dev_set_drvdata(&client->dev, data);
-2
sound/soc/codecs/wcd-mbhc-v2.c
··· 825 825 826 826 mutex_unlock(&mbhc->lock); 827 827 828 - pm_runtime_mark_last_busy(component->dev); 829 828 pm_runtime_put_autosuspend(component->dev); 830 829 831 830 return 0; ··· 1318 1319 if (mbhc->mbhc_cb->hph_pull_down_ctrl) 1319 1320 mbhc->mbhc_cb->hph_pull_down_ctrl(component, true); 1320 1321 1321 - pm_runtime_mark_last_busy(component->dev); 1322 1322 pm_runtime_put_autosuspend(component->dev); 1323 1323 } 1324 1324
-1
sound/soc/codecs/wsa881x.c
··· 775 775 usleep_range(1000, 1010); 776 776 } 777 777 778 - pm_runtime_mark_last_busy(comp->dev); 779 778 pm_runtime_put_autosuspend(comp->dev); 780 779 781 780 return 1;
-1
sound/soc/codecs/wsa883x.c
··· 1491 1491 ret = -EAGAIN; 1492 1492 } 1493 1493 out: 1494 - pm_runtime_mark_last_busy(wsa883x->dev); 1495 1494 pm_runtime_put_autosuspend(wsa883x->dev); 1496 1495 1497 1496 return ret;
-1
sound/soc/codecs/wsa884x.c
··· 1941 1941 } 1942 1942 1943 1943 out: 1944 - pm_runtime_mark_last_busy(wsa884x->dev); 1945 1944 pm_runtime_put_autosuspend(wsa884x->dev); 1946 1945 1947 1946 return ret;
-1
sound/soc/intel/atom/sst/sst_pvt.c
··· 259 259 { 260 260 int ret; 261 261 262 - pm_runtime_mark_last_busy(sst_drv->dev); 263 262 ret = pm_runtime_put_autosuspend(sst_drv->dev); 264 263 if (ret < 0) 265 264 return ret;
-1
sound/soc/intel/avs/core.c
··· 231 231 /* configure PM */ 232 232 pm_runtime_set_autosuspend_delay(bus->dev, 2000); 233 233 pm_runtime_use_autosuspend(bus->dev); 234 - pm_runtime_mark_last_busy(bus->dev); 235 234 pm_runtime_put_autosuspend(bus->dev); 236 235 pm_runtime_allow(bus->dev); 237 236 }
-2
sound/soc/intel/avs/debugfs.c
··· 315 315 if (!adev->logged_resources) { 316 316 avs_dsp_enable_d0ix(adev); 317 317 err_d0ix: 318 - pm_runtime_mark_last_busy(adev->dev); 319 318 pm_runtime_put_autosuspend(adev->dev); 320 319 } 321 320 ··· 341 342 /* If that's the last resource, allow for D3. */ 342 343 if (!adev->logged_resources) { 343 344 avs_dsp_enable_d0ix(adev); 344 - pm_runtime_mark_last_busy(adev->dev); 345 345 pm_runtime_put_autosuspend(adev->dev); 346 346 } 347 347
-1
sound/soc/intel/avs/ipc.c
··· 141 141 if (ret < 0) 142 142 dev_err(adev->dev, "dsp reboot failed: %d\n", ret); 143 143 144 - pm_runtime_mark_last_busy(adev->dev); 145 144 pm_runtime_enable(adev->dev); 146 145 pm_request_autosuspend(adev->dev); 147 146
-1
sound/soc/intel/avs/pcm.c
··· 979 979 if (!ret) 980 980 ret = avs_module_info_init(adev, false); 981 981 982 - pm_runtime_mark_last_busy(adev->dev); 983 982 pm_runtime_put_autosuspend(adev->dev); 984 983 985 984 return ret;
-6
sound/soc/intel/catpt/pcm.c
··· 673 673 674 674 ret = catpt_ipc_set_device_format(cdev, &devfmt); 675 675 676 - pm_runtime_mark_last_busy(cdev->dev); 677 676 pm_runtime_put_autosuspend(cdev->dev); 678 677 679 678 if (ret) ··· 870 871 ucontrol->value.integer.value[i] = dspvol_to_ctlvol(dspvol); 871 872 } 872 873 873 - pm_runtime_mark_last_busy(cdev->dev); 874 874 pm_runtime_put_autosuspend(cdev->dev); 875 875 876 876 return 0; ··· 890 892 ret = catpt_set_dspvol(cdev, cdev->mixer.mixer_hw_id, 891 893 ucontrol->value.integer.value); 892 894 893 - pm_runtime_mark_last_busy(cdev->dev); 894 895 pm_runtime_put_autosuspend(cdev->dev); 895 896 896 897 return ret; ··· 924 927 ucontrol->value.integer.value[i] = dspvol_to_ctlvol(dspvol); 925 928 } 926 929 927 - pm_runtime_mark_last_busy(cdev->dev); 928 930 pm_runtime_put_autosuspend(cdev->dev); 929 931 930 932 return 0; ··· 954 958 ret = catpt_set_dspvol(cdev, stream->info.stream_hw_id, 955 959 ucontrol->value.integer.value); 956 960 957 - pm_runtime_mark_last_busy(cdev->dev); 958 961 pm_runtime_put_autosuspend(cdev->dev); 959 962 960 963 if (ret) ··· 1030 1035 1031 1036 ret = catpt_ipc_mute_loopback(cdev, stream->info.stream_hw_id, mute); 1032 1037 1033 - pm_runtime_mark_last_busy(cdev->dev); 1034 1038 pm_runtime_put_autosuspend(cdev->dev); 1035 1039 1036 1040 if (ret)
-1
sound/soc/intel/catpt/sysfs.c
··· 21 21 22 22 ret = catpt_ipc_get_fw_version(cdev, &version); 23 23 24 - pm_runtime_mark_last_busy(cdev->dev); 25 24 pm_runtime_put_autosuspend(cdev->dev); 26 25 27 26 if (ret)
-1
sound/soc/soc-component.c
··· 1278 1278 if (rollback && !soc_component_mark_match(component, stream, pm)) 1279 1279 continue; 1280 1280 1281 - pm_runtime_mark_last_busy(component->dev); 1282 1281 pm_runtime_put_autosuspend(component->dev); 1283 1282 1284 1283 /* remove marked stream */
-1
sound/soc/sof/control.c
··· 196 196 if (tplg_ops && tplg_ops->control && tplg_ops->control->bytes_ext_volatile_get) 197 197 ret = tplg_ops->control->bytes_ext_volatile_get(scontrol, binary_data, size); 198 198 199 - pm_runtime_mark_last_busy(scomp->dev); 200 199 err = pm_runtime_put_autosuspend(scomp->dev); 201 200 if (err < 0) 202 201 dev_err_ratelimited(scomp->dev, "%s: failed to idle %d\n", __func__, err);
-1
sound/soc/sof/debug.c
··· 217 217 } 218 218 219 219 ret = sof_ipc_tx_message(sdev->ipc, &msg, msg.size, reply, SOF_IPC_MSG_MAX_SIZE); 220 - pm_runtime_mark_last_busy(sdev->dev); 221 220 pm_runtime_put_autosuspend(sdev->dev); 222 221 if (ret < 0 || reply->rhdr.error < 0) { 223 222 ret = min(ret, reply->rhdr.error);
-1
sound/soc/sof/ipc3-dtrace.c
··· 172 172 goto error; 173 173 } 174 174 ret = sof_ipc_tx_message_no_reply(sdev->ipc, msg, msg->hdr.size); 175 - pm_runtime_mark_last_busy(sdev->dev); 176 175 pm_runtime_put_autosuspend(sdev->dev); 177 176 178 177 error:
-1
sound/soc/sof/ipc4-loader.c
··· 236 236 237 237 ret = ipc4_data->load_library(sdev, fw_lib, false); 238 238 239 - pm_runtime_mark_last_busy(sdev->dev); 240 239 err = pm_runtime_put_autosuspend(sdev->dev); 241 240 if (err < 0) 242 241 dev_err_ratelimited(sdev->dev, "%s: pm_runtime idle failed: %d\n",
-1
sound/soc/sof/pcm.c
··· 712 712 ret); 713 713 714 714 pm_error: 715 - pm_runtime_mark_last_busy(component->dev); 716 715 pm_runtime_put_autosuspend(component->dev); 717 716 718 717 return ret;
-1
sound/soc/sof/sof-client-ipc-flood-test.c
··· 223 223 ret = sof_debug_ipc_flood_test(cdev, flood_duration_test, 224 224 ipc_duration_ms, ipc_count); 225 225 226 - pm_runtime_mark_last_busy(dev); 227 226 err = pm_runtime_put_autosuspend(dev); 228 227 if (err < 0) 229 228 dev_err_ratelimited(dev, "debugfs write failed to idle %d\n", err);
-1
sound/soc/sof/sof-client-ipc-kernel-injector.c
··· 65 65 66 66 sof_client_ipc_rx_message(cdev, hdr, priv->kernel_buffer); 67 67 68 - pm_runtime_mark_last_busy(dev); 69 68 ret = pm_runtime_put_autosuspend(dev); 70 69 if (ret < 0) 71 70 dev_err_ratelimited(dev, "debugfs write failed to idle %d\n", ret);
-1
sound/soc/sof/sof-client-ipc-msg-injector.c
··· 137 137 if (ret) 138 138 dev_err(dev, "IPC message send failed: %d\n", ret); 139 139 140 - pm_runtime_mark_last_busy(dev); 141 140 err = pm_runtime_put_autosuspend(dev); 142 141 if (err < 0) 143 142 dev_err_ratelimited(dev, "debugfs write failed to idle %d\n", err);
-3
sound/soc/sof/sof-client-probes.c
··· 238 238 kfree(desc); 239 239 240 240 pm_error: 241 - pm_runtime_mark_last_busy(dev); 242 241 err = pm_runtime_put_autosuspend(dev); 243 242 if (err < 0) 244 243 dev_err_ratelimited(dev, "debugfs read failed to idle %d\n", err); ··· 288 289 if (!ret) 289 290 ret = count; 290 291 291 - pm_runtime_mark_last_busy(dev); 292 292 err = pm_runtime_put_autosuspend(dev); 293 293 if (err < 0) 294 294 dev_err_ratelimited(dev, "debugfs write failed to idle %d\n", err); ··· 335 337 if (!ret) 336 338 ret = count; 337 339 338 - pm_runtime_mark_last_busy(dev); 339 340 err = pm_runtime_put_autosuspend(dev); 340 341 if (err < 0) 341 342 dev_err_ratelimited(dev, "debugfs write failed to idle %d\n", err);