Commit 098dff7
committed
PM: Fix potential issue with failing asynchronous suspend
There is a potential issue with the asynchronous suspend code that
a device driver suspending asynchronously may not notice that it
should back off. There are two failing scenarions, (1) when the
driver is waiting for a driver suspending synchronously to complete
and that second driver returns error code, in which case async_error
won't be set and the waiting driver will continue suspending and (2)
after the driver has called device_pm_wait_for_dev() and the waited
for driver returns error code, in which case the caller of
device_pm_wait_for_dev() will not know that there was an error and
will continue suspending.
To fix this issue make __device_suspend() set async_error, so
async_suspend() doesn't need to set it any more, and make
device_pm_wait_for_dev() return async_error, so that its callers
can check whether or not they should continue suspending.
No more changes are necessary, since device_pm_wait_for_dev() is
not used by any drivers' suspend routines.
Reported-by: Colin Cross <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
Acked-by: Greg Kroah-Hartman <[email protected]>1 parent 074037e commit 098dff7
2 files changed
+14
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
| |||
602 | 604 | | |
603 | 605 | | |
604 | 606 | | |
| 607 | + | |
605 | 608 | | |
606 | 609 | | |
607 | 610 | | |
| |||
831 | 834 | | |
832 | 835 | | |
833 | 836 | | |
834 | | - | |
835 | | - | |
836 | 837 | | |
837 | 838 | | |
838 | 839 | | |
| |||
887 | 888 | | |
888 | 889 | | |
889 | 890 | | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
890 | 894 | | |
891 | 895 | | |
892 | 896 | | |
| |||
896 | 900 | | |
897 | 901 | | |
898 | 902 | | |
899 | | - | |
| 903 | + | |
900 | 904 | | |
901 | | - | |
902 | | - | |
903 | 905 | | |
904 | 906 | | |
905 | 907 | | |
| |||
1087 | 1089 | | |
1088 | 1090 | | |
1089 | 1091 | | |
1090 | | - | |
| 1092 | + | |
1091 | 1093 | | |
1092 | 1094 | | |
| 1095 | + | |
1093 | 1096 | | |
1094 | 1097 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
562 | | - | |
| 562 | + | |
563 | 563 | | |
564 | 564 | | |
565 | 565 | | |
| |||
572 | 572 | | |
573 | 573 | | |
574 | 574 | | |
575 | | - | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
576 | 579 | | |
577 | 580 | | |
578 | 581 | | |
| |||
0 commit comments