[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <42c05eb47f17a2942cb107b5ddb2a6bd402b76e7.1516985620.git.msuchanek@suse.de>
Date: Fri, 26 Jan 2018 17:58:40 +0100
From: Michal Suchanek <msuchanek@...e.de>
To: Jens Axboe <axboe@...nel.dk>, Jonathan Corbet <corbet@....net>,
Borislav Petkov <bp@...en8.de>, Tim Waugh <tim@...erelk.net>,
"David S. Miller" <davem@...emloft.net>,
"James E.J. Bottomley" <jejb@...ux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Michal Suchanek <msuchanek@...e.de>,
Kees Cook <keescook@...omium.org>,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
Thomas Gleixner <tglx@...utronix.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Kate Stewart <kstewart@...uxfoundation.org>,
Philippe Ombredanne <pombredanne@...b.com>,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-ide@...r.kernel.org, linux-scsi@...r.kernel.org
Subject: [PATCH resend 6/6] cdrom: wait for drive to become ready
When the drive closes it can take tens of seconds until the disc is
analyzed. Wait for the drive to become ready or report an error.
Signed-off-by: Michal Suchanek <msuchanek@...e.de>
---
drivers/cdrom/cdrom.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index 69e85c902373..9994441f5041 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -1087,6 +1087,15 @@ int open_for_common(struct cdrom_device_info *cdi, tracktype *tracks)
}
cd_dbg(CD_OPEN, "the tray is now closed\n");
}
+ /* the door should be closed now, check for the disc */
+ if (ret == CDS_DRIVE_NOT_READY) {
+ int poll_res = poll_event_interruptible(
+ CDS_DRIVE_NOT_READY !=
+ (ret = cdo->drive_status(cdi, CDSL_CURRENT)),
+ 500);
+ if (poll_res == -ERESTARTSYS)
+ return poll_res;
+ }
if (ret != CDS_DISC_OK)
return -ENOMEDIUM;
}
--
2.13.6
Powered by blists - more mailing lists