From: Bart Van Assche <Bart.VanAssche@wdc.com>
To: "corbet@lwn.net" <corbet@lwn.net>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>,
"keescook@chromium.org" <keescook@chromium.org>,
"msuchanek@suse.de" <msuchanek@suse.de>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
"axboe@kernel.dk" <axboe@kernel.dk>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"kstewart@linuxfoundation.org" <kstewart@linuxfoundation.org>,
"pombredanne@nexb.com" <pombredanne@nexb.com>,
"bp@alien8.de" <bp@alien8.de>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"jejb@linux.vnet.ibm.com" <jejb@linux.vnet.ibm.com>,
"christophe.jaillet@wanadoo.fr" <christophe.jaillet@wanadoo.fr>,
davem@davemlof
Subject: Re: [PATCH resend 6/6] cdrom: wait for drive to become ready
Date: Mon, 29 Jan 2018 17:11:20 +0000 [thread overview]
Message-ID: <1517245879.2687.19.camel@wdc.com> (raw)
In-Reply-To: <42c05eb47f17a2942cb107b5ddb2a6bd402b76e7.1516985620.git.msuchanek@suse.de>
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@suse.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.
next prev parent reply other threads:[~2018-01-29 17:11 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-14 15:13 [PATCH 0/6] Fix cdrom autoclose Michal Suchanek
2017-12-14 15:13 ` [PATCH 5/6] Documentetion: cdrom: introduce CDS_DRIVE_ERROR Michal Suchanek
2018-01-26 16:58 ` [PATCH resend 0/6] Fix cdrom autoclose Michal Suchanek
2018-01-26 16:58 ` [PATCH resend 1/6] delay: add poll_event_interruptible Michal Suchanek
2018-01-29 17:00 ` Bart Van Assche
2018-01-26 16:58 ` [PATCH resend 2/6] cdrom: factor out common open_for_* code Michal Suchanek
2018-01-29 17:02 ` Bart Van Assche
2018-01-26 16:58 ` [PATCH resend 3/6] cdrom: wait for tray to close Michal Suchanek
2018-01-29 17:05 ` Bart Van Assche
2018-01-31 18:20 ` Michal Suchánek
2019-10-23 12:19 ` Michal Suchánek
2018-01-26 16:58 ` [PATCH resend 4/6] cdrom: introduce CDS_DRIVE_ERROR Michal Suchanek
2018-01-26 16:58 ` [PATCH resend 5/6] Documentetion: " Michal Suchanek
2018-01-26 16:58 ` [PATCH resend 6/6] cdrom: wait for drive to become ready Michal Suchanek
2018-01-29 17:11 ` Bart Van Assche [this message]
2018-01-26 20:04 ` [PATCH resend 0/6] Fix cdrom autoclose James Bottomley
2018-01-27 22:53 ` Michal Suchánek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1517245879.2687.19.camel@wdc.com \
--to=bart.vanassche@wdc.com \
--cc=axboe@kernel.dk \
--cc=bp@alien8.de \
--cc=christophe.jaillet@wanadoo.fr \
--cc=corbet@lwn.net \
--cc=davem@davemlof \
--cc=gregkh@linuxfoundation.org \
--cc=jejb@linux.vnet.ibm.com \
--cc=keescook@chromium.org \
--cc=kstewart@linuxfoundation.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=msuchanek@suse.de \
--cc=pombredanne@nexb.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox