[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1517245879.2687.19.camel@wdc.com>
Date: Mon, 29 Jan 2018 17:11:20 +0000
From: Bart Van Assche <Bart.VanAssche@....com>
To: "corbet@....net" <corbet@....net>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-ide@...r.kernel.org" <linux-ide@...r.kernel.org>,
"keescook@...omium.org" <keescook@...omium.org>,
"msuchanek@...e.de" <msuchanek@...e.de>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"martin.petersen@...cle.com" <martin.petersen@...cle.com>,
"axboe@...nel.dk" <axboe@...nel.dk>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"kstewart@...uxfoundation.org" <kstewart@...uxfoundation.org>,
"pombredanne@...b.com" <pombredanne@...b.com>,
"bp@...en8.de" <bp@...en8.de>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"jejb@...ux.vnet.ibm.com" <jejb@...ux.vnet.ibm.com>,
"christophe.jaillet@...adoo.fr" <christophe.jaillet@...adoo.fr>,
"davem@...emloft.net" <davem@...emloft.net>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
"tim@...erelk.net" <tim@...erelk.net>
Subject: Re: [PATCH resend 6/6] cdrom: wait for drive to become ready
On Fri, 2018-01-26 at 17:58 +0100, Michal Suchanek wrote:
> 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;
> }
Same comment here as for a previous patch: although interruptible by a signal,
I'm not sure potentially infinite loops inside the kernel are really welcome.
Thanks,
Bart.
Powered by blists - more mailing lists