Stanley Chu
0746b2f501
scsi: ufs: Avoid runtime suspend possibly being blocked forever
...
commit 24e2e7a19f upstream.
UFS runtime suspend can be triggered after pm_runtime_enable() is invoked
in ufshcd_pltfrm_init(). However if the first runtime suspend is triggered
before binding ufs_hba structure to ufs device structure via
platform_set_drvdata(), then UFS runtime suspend will be no longer
triggered in the future because its dev->power.runtime_error was set in the
first triggering and does not have any chance to be cleared.
To be more clear, dev->power.runtime_error is set if hba is NULL in
ufshcd_runtime_suspend() which returns -EINVAL to rpm_callback() where
dev->power.runtime_error is set as -EINVAL. In this case, any future
rpm_suspend() for UFS device fails because rpm_check_suspend_allowed()
fails due to non-zero
dev->power.runtime_error.
To resolve this issue, make sure the first UFS runtime suspend get valid
"hba" in ufshcd_runtime_suspend(): Enable UFS runtime PM only after hba is
successfully bound to UFS device structure.
Fixes: 62694735ca ([SCSI] ufs: Add runtime PM support for UFS host controller driver)
Cc: stable@vger.kernel.org
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com >
Reviewed-by: Avri Altman <avri.altman@wdc.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2019-06-25 11:35:53 +08:00
..
2019-05-04 09:20:20 +02:00
2019-05-16 19:41:23 +02:00
2019-02-12 19:47:25 +01:00
2018-07-12 22:34:59 -04:00
2018-06-12 16:19:22 -07:00
2018-06-19 22:02:25 -04:00
2018-07-10 22:42:47 -04:00
2019-06-19 08:18:03 +02:00
2018-06-19 22:02:25 -04:00
2019-05-10 17:54:09 +02:00
2019-06-22 08:15:20 +02:00
2019-02-12 19:47:25 +01:00
2019-06-22 08:15:21 +02:00
2018-06-12 16:19:22 -07:00
2019-04-05 22:33:04 +02:00
2018-06-12 16:19:22 -07:00
2019-04-05 22:32:57 +02:00
2019-03-27 14:14:40 +09:00
2018-09-17 02:50:37 -04:00
2019-02-27 10:08:53 +01:00
2019-04-27 09:36:36 +02:00
2019-06-22 08:15:21 +02:00
2019-06-19 08:18:02 +02:00
2019-04-05 22:33:04 +02:00
2019-05-04 09:20:20 +02:00
2018-03-01 21:07:48 -05:00
2018-08-21 23:54:17 -04:00
2018-03-19 22:54:47 -04:00
2018-06-12 16:19:22 -07:00
2019-05-31 06:46:29 -07:00
2019-06-19 08:18:02 +02:00
2019-06-15 11:54:09 +02:00
2019-05-31 06:46:30 -07:00
2019-06-22 08:15:21 +02:00
2018-07-12 23:01:16 -04:00
2018-08-02 16:23:26 -04:00
2019-06-25 11:35:53 +08:00
2017-10-25 05:40:22 -04:00
2018-07-30 23:17:53 -04:00
2017-12-04 20:32:53 -05:00
2018-07-30 23:17:53 -04:00
2018-07-30 23:17:53 -04:00
2019-03-13 14:02:31 -07:00
2017-11-02 11:10:55 +01:00
2018-07-30 23:17:53 -04:00
2017-08-25 17:21:10 -04:00
2017-11-02 11:10:55 +01:00
2017-08-25 17:21:10 -04:00
2017-11-02 11:10:55 +01:00
2018-06-26 12:53:26 -04:00
2018-06-19 22:02:25 -04:00
2017-11-02 11:10:55 +01:00
2018-06-12 16:19:22 -07:00
2017-11-02 11:10:55 +01:00
2018-06-19 22:02:25 -04:00
2018-06-19 22:02:25 -04:00
2018-05-01 23:29:41 -04:00
2017-08-25 17:21:11 -04:00
2018-07-30 23:17:53 -04:00
2017-11-02 11:10:55 +01:00
2018-06-12 16:19:22 -07:00
2018-06-26 12:27:06 -04:00
2017-11-02 11:10:55 +01:00
2018-06-26 12:27:06 -04:00
2017-11-02 11:10:55 +01:00
2017-08-25 17:21:11 -04:00
2018-05-18 12:03:51 -04:00
2018-03-15 00:25:37 -04:00
2018-11-13 11:08:32 -08:00
2018-11-13 11:08:32 -08:00
2017-08-25 17:21:11 -04:00
2017-11-02 11:10:55 +01:00
2018-06-19 22:02:25 -04:00
2017-11-02 11:10:55 +01:00
2018-06-19 22:02:25 -04:00
2018-06-19 22:02:25 -04:00
2017-08-25 17:21:10 -04:00
2017-11-02 11:10:55 +01:00
2018-08-27 13:17:00 -04:00
2017-10-25 04:55:18 -04:00
2018-08-27 12:26:10 -04:00
2018-07-10 22:25:03 -04:00
2017-08-25 17:21:10 -04:00
2018-06-26 12:27:07 -04:00
2017-11-02 11:10:55 +01:00
2018-09-21 12:35:39 -04:00
2018-09-21 12:35:39 -04:00
2018-04-20 19:40:17 -04:00
2018-04-20 19:40:17 -04:00
2018-04-19 00:00:44 -04:00
2018-03-12 22:05:43 -04:00
2018-08-27 12:26:10 -04:00
2017-08-22 16:34:36 +02:00
2018-06-19 22:02:25 -04:00
2019-03-23 20:09:48 +01:00
2018-06-12 16:19:22 -07:00
2017-11-02 11:10:55 +01:00
2018-11-13 11:08:32 -08:00
2017-08-25 17:21:11 -04:00
2018-08-15 22:06:26 -07:00
2018-06-19 22:02:25 -04:00
2018-06-19 22:02:25 -04:00
2018-06-26 12:27:07 -04:00
2017-11-02 11:10:55 +01:00
2018-03-19 22:54:47 -04:00
2017-11-02 11:10:55 +01:00
2018-06-10 13:01:12 -07:00
2018-07-10 22:42:47 -04:00
2017-11-14 16:23:44 -08:00
2017-11-02 11:10:55 +01:00
2018-06-19 22:02:25 -04:00
2017-10-16 22:38:44 -04:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-06-12 16:19:22 -07:00
2017-11-02 11:10:55 +01:00
2018-06-12 16:19:22 -07:00
2018-02-13 21:49:15 -05:00
2017-12-04 20:32:52 -05:00
2017-11-02 11:10:55 +01:00
2017-10-05 15:01:17 +02:00
2017-10-05 15:01:17 +02:00
2017-08-25 17:21:11 -04:00
2017-11-02 11:10:55 +01:00
2017-08-25 17:21:11 -04:00
2018-06-26 12:53:26 -04:00
2017-11-02 11:10:55 +01:00
2018-12-19 19:19:49 +01:00
2017-12-11 21:39:39 -05:00
2019-03-13 14:02:30 -07:00
2018-04-20 19:14:28 -04:00
2019-05-08 07:21:49 +02:00
2019-05-08 07:21:49 +02:00
2018-08-15 22:06:26 -07:00
2018-06-26 12:27:06 -04:00
2017-11-02 11:10:55 +01:00
2019-04-27 09:36:36 +02:00
2017-11-14 16:23:44 -08:00
2019-01-22 21:40:32 +01:00
2017-12-07 21:13:45 -05:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-04-05 22:33:01 +02:00
2018-08-02 15:53:36 -04:00
2017-11-02 11:10:55 +01:00
2018-08-15 22:06:26 -07:00
2019-04-20 09:15:56 +02:00
2018-06-10 13:01:12 -07:00
2018-06-26 12:27:06 -04:00
2018-06-04 07:58:06 -07:00
2018-06-26 12:53:26 -04:00
2018-06-19 22:02:25 -04:00
2017-11-02 11:10:55 +01:00
2018-07-30 08:27:02 -06:00
2018-08-15 22:06:26 -07:00
2019-05-31 06:46:01 -07:00
2018-07-30 08:27:02 -06:00
2017-11-02 11:10:55 +01:00
2018-06-12 16:19:22 -07:00
2018-08-15 22:06:26 -07:00
2017-08-25 17:21:10 -04:00
2018-08-02 15:22:13 -06:00
2017-11-02 11:10:55 +01:00
2018-08-03 13:53:51 -04:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-08-08 21:15:54 -04:00
2017-11-02 11:10:55 +01:00
2019-05-08 07:21:49 +02:00
2017-08-25 17:21:11 -04:00
2018-03-12 22:05:43 -04:00
2019-03-23 20:09:59 +01:00
2018-12-21 14:15:13 +01:00
2017-08-25 17:21:10 -04:00
2018-05-01 23:30:12 -04:00
2017-11-02 11:10:55 +01:00
2018-06-19 14:54:41 +02:00
2017-08-22 16:34:36 +02:00
2018-04-19 00:00:44 -04:00