Bart Van Assche
eb30b686a2
scsi: sr: Avoid that opening a CD-ROM hangs with runtime power management enabled
...
commit 1214fd7b49 upstream.
Surround scsi_execute() calls with scsi_autopm_get_device() and
scsi_autopm_put_device(). Note: removing sr_mutex protection from the
scsi_cd_get() and scsi_cd_put() calls is safe because the purpose of
sr_mutex is to serialize cdrom_*() calls.
This patch avoids that complaints similar to the following appear in the
kernel log if runtime power management is enabled:
INFO: task systemd-udevd:650 blocked for more than 120 seconds.
Not tainted 4.18.0-rc7-dbg+ #1
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
systemd-udevd D28176 650 513 0x00000104
Call Trace:
__schedule+0x444/0xfe0
schedule+0x4e/0xe0
schedule_preempt_disabled+0x18/0x30
__mutex_lock+0x41c/0xc70
mutex_lock_nested+0x1b/0x20
__blkdev_get+0x106/0x970
blkdev_get+0x22c/0x5a0
blkdev_open+0xe9/0x100
do_dentry_open.isra.19+0x33e/0x570
vfs_open+0x7c/0xd0
path_openat+0x6e3/0x1120
do_filp_open+0x11c/0x1c0
do_sys_open+0x208/0x2d0
__x64_sys_openat+0x59/0x70
do_syscall_64+0x77/0x230
entry_SYSCALL_64_after_hwframe+0x49/0xbe
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com >
Cc: Maurizio Lombardi <mlombard@redhat.com >
Cc: Johannes Thumshirn <jthumshirn@suse.de >
Cc: Alan Stern <stern@rowland.harvard.edu >
Cc: <stable@vger.kernel.org >
Tested-by: Johannes Thumshirn <jthumshirn@suse.de >
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-05-12 16:46:46 +09:00
..
2018-05-25 16:13:08 +02:00
2016-02-23 21:27:02 -05:00
2016-08-25 23:39:25 -04:00
2016-10-26 22:17:43 -04:00
2018-05-25 16:13:06 +02:00
2018-03-22 09:17:43 +01:00
2017-12-20 10:07:33 +01:00
2018-05-25 16:13:06 +02:00
2016-07-12 23:16:31 -04:00
2018-04-13 19:48:01 +02:00
2017-12-25 14:23:44 +01:00
2016-09-14 12:47:42 -04:00
2017-10-21 17:21:36 +02:00
2016-08-25 22:28:17 -04:00
2018-02-28 15:09:58 -08:00
2018-03-22 09:17:41 +01:00
2016-09-14 12:54:18 -04:00
2018-02-28 10:18:30 +01:00
2017-06-07 12:07:47 +02:00
2017-09-02 07:07:53 +02:00
2016-11-17 20:44:51 -05:00
2018-05-25 16:12:58 +02:00
2018-05-25 16:13:09 +02:00
2023-05-12 16:44:12 +09:00
2018-05-25 17:06:35 +02:00
2018-05-25 16:13:08 +02:00
2016-07-20 17:38:35 -06:00
2015-05-31 18:06:28 -07:00
2016-09-26 21:10:45 -04:00
2023-05-12 16:45:55 +09:00
2018-05-25 16:13:07 +02:00
2018-02-22 15:43:47 +01:00
2017-08-06 18:59:49 -07:00
2018-05-25 16:13:06 +02:00
2023-05-12 16:41:56 +09:00
2023-05-12 16:43:01 +09:00
2015-04-27 10:10:19 -07:00
2015-04-27 10:04:39 -07:00
2015-04-27 10:04:39 -07:00
2023-05-12 16:43:04 +09:00
2015-04-27 10:05:55 -07:00
2016-07-13 22:33:23 -04:00
2016-07-13 22:33:23 -04:00
2015-08-07 15:03:42 +02:00
2013-11-26 11:09:07 +01:00
2014-10-20 16:21:33 +02:00
2014-10-20 16:21:33 +02:00
2018-02-25 11:05:53 +01:00
2015-05-31 18:06:28 -07:00
2016-02-23 21:27:02 -05:00
2015-04-09 18:08:31 -07:00
2015-05-31 18:06:28 -07:00
2015-05-31 18:06:28 -07:00
2015-04-17 10:13:56 -07:00
2016-04-11 16:57:09 -04:00
2015-11-25 22:08:55 -05:00
2015-11-25 22:08:52 -05:00
2015-02-02 09:57:45 -08:00
2013-06-26 18:32:47 -07:00
2014-10-20 16:21:33 +02:00
2015-04-14 09:50:27 -07:00
2016-08-16 00:49:32 -04:00
2015-02-02 09:57:46 -08:00
2016-04-11 16:57:09 -04:00
2016-02-23 21:27:02 -05:00
2014-07-17 22:07:37 +02:00
2016-05-10 22:01:07 -04:00
2014-11-24 14:45:27 +01:00
2015-11-09 17:11:57 -08:00
2014-11-24 16:13:16 +01:00
2016-02-23 21:27:02 -05:00
2015-11-09 16:32:14 -08:00
2017-01-12 11:39:29 +01:00
2016-09-29 21:52:43 -04:00
2016-02-25 21:16:49 -05:00
2013-04-09 14:13:16 -04:00
2016-02-25 21:16:49 -05:00
2013-04-09 14:13:16 -04:00
2013-11-26 11:09:07 +01:00
2016-10-07 09:28:53 -07:00
2017-12-20 10:07:22 +01:00
2018-01-23 19:57:05 +01:00
2017-12-20 10:07:22 +01:00
2015-08-12 13:14:57 -07:00
2015-08-12 13:14:57 -07:00
2016-02-25 21:10:53 -05:00
2015-11-20 11:39:03 -05:00
2018-03-22 09:17:42 +01:00
2016-09-19 11:57:33 -04:00
2015-06-02 17:24:54 -07:00
2013-04-09 14:13:27 -04:00
2016-05-16 11:14:29 -04:00
2016-05-19 11:36:49 -07:00
2016-01-27 20:36:10 +08:00
2014-10-20 16:21:33 +02:00
2017-05-14 14:00:19 +02:00
2013-01-03 15:57:01 -08:00
2016-01-27 20:36:10 +08:00
2018-04-13 19:48:10 +02:00
2016-02-05 16:29:28 -06:00
2018-03-24 11:00:15 +01:00
2016-04-11 16:57:09 -04:00
2016-09-26 20:49:25 -04:00
2023-05-12 16:43:07 +09:00
2014-03-27 08:26:31 -07:00
2016-02-05 16:29:28 -06:00
2014-10-20 16:21:33 +02:00
2013-04-09 14:13:15 -04:00
2016-03-05 17:07:46 -05:00
2013-04-15 14:30:44 -06:00
2014-11-24 14:45:27 +01:00
2014-07-17 22:07:35 +02:00
2015-05-31 18:06:28 -07:00
2016-10-17 14:13:03 -04:00
2016-09-14 14:11:12 -04:00
2013-01-03 15:57:01 -08:00
2013-01-03 15:57:01 -08:00
2015-05-31 18:06:28 -07:00
2014-11-24 20:01:28 +01:00
2016-09-04 01:28:07 -04:00
2016-02-23 21:27:02 -05:00
2015-05-31 18:06:28 -07:00
2016-04-30 09:25:26 -07:00
2015-05-31 18:06:28 -07:00
2016-03-01 20:06:49 -05:00
2016-11-28 15:51:31 -05:00
2016-04-04 12:07:42 -04:00
2017-12-20 10:07:30 +01:00
2018-03-22 09:17:56 +01:00
2023-05-12 16:44:10 +09:00
2016-06-18 11:59:01 -07:00
2014-11-12 11:16:12 +01:00
2017-12-14 09:28:11 +01:00
2015-02-04 08:00:24 -08:00
2014-11-12 11:16:05 +01:00
2014-04-24 13:44:54 -04:00
2016-02-19 10:52:45 -05:00
2016-10-07 09:28:53 -07:00
2016-04-11 16:57:09 -04:00
2016-03-14 21:05:04 -04:00
2017-07-27 15:07:59 -07:00
2014-06-06 16:08:16 -07:00
2017-07-27 15:07:59 -07:00
2016-04-11 16:57:09 -04:00
2016-04-11 16:57:09 -04:00
2017-10-05 09:43:59 +02:00
2016-08-18 22:23:20 -04:00
2015-08-07 14:28:45 +02:00
2018-06-06 16:44:38 +02:00
2016-09-26 20:58:42 -04:00
2014-11-12 11:15:54 +01:00
2016-09-15 09:51:14 -04:00
2018-05-25 16:13:08 +02:00
2016-09-15 09:51:14 -04:00
2016-04-11 16:57:09 -04:00
2018-03-22 09:17:55 +01:00
2023-05-12 16:45:48 +09:00
2014-10-20 16:21:33 +02:00
2016-02-23 21:27:02 -05:00
2014-10-20 16:21:33 +02:00
2015-01-20 19:43:24 +01:00
2014-07-17 22:07:39 +02:00
2023-05-12 16:46:46 +09:00
2014-11-12 11:15:57 +01:00
2016-10-18 14:13:37 -07:00
2015-11-18 11:59:09 -05:00
2016-02-23 21:27:02 -05:00
2018-05-25 16:13:07 +02:00
2014-05-28 12:16:28 +02:00
2016-04-11 16:57:09 -04:00
2014-11-20 09:11:15 +01:00
2015-08-10 23:07:05 -04:00
2014-10-20 16:21:33 +02:00
2015-05-31 18:06:28 -07:00
2018-04-08 12:12:50 +02:00
2016-11-01 13:31:23 -04:00
2016-11-01 13:31:23 -04:00
2015-02-02 09:57:46 -08:00
2013-04-09 14:13:15 -04:00
2016-09-01 17:52:01 -07:00
2015-05-31 18:06:28 -07:00
2015-09-08 18:03:49 +01:00
2013-01-03 15:57:01 -08:00
2013-11-26 11:09:07 +01:00