Re: [PATCH resend 3/6] cdrom: wait for tray to close

2019-10-23 Thread Michal Suchánek
On Mon, Jan 29, 2018 at 05:05:47PM +, Bart Van Assche wrote: > On Fri, 2018-01-26 at 17:58 +0100, Michal Suchanek wrote: > > +static int cdrom_tray_close(struct cdrom_device_info *cdi) > > +{ > > + int ret; > > + > > + ret = cdi->ops->tray_move(cdi, 0); > > + if (ret || !cdi->ops->drive_s

Re: [PATCH resend 3/6] cdrom: wait for tray to close

2018-01-31 Thread Michal Suchánek
On Mon, 29 Jan 2018 17:05:47 + Bart Van Assche wrote: > On Fri, 2018-01-26 at 17:58 +0100, Michal Suchanek wrote: > > +static int cdrom_tray_close(struct cdrom_device_info *cdi) > > +{ > > + int ret; > > + > > + ret = cdi->ops->tray_move(cdi, 0); > > + if (ret || !cdi->ops->drive_status

Re: [PATCH resend 3/6] cdrom: wait for tray to close

2018-01-29 Thread Bart Van Assche
On Fri, 2018-01-26 at 17:58 +0100, Michal Suchanek wrote: > +static int cdrom_tray_close(struct cdrom_device_info *cdi) > +{ > + int ret; > + > + ret = cdi->ops->tray_move(cdi, 0); > + if (ret || !cdi->ops->drive_status) > + return ret; > + > + return poll_event_interrup

[PATCH resend 3/6] cdrom: wait for tray to close

2018-01-27 Thread Michal Suchanek
The scsi command to close tray only starts the motor and does not wait for the tray to close. Wait until the state chages from TRAY_OPEN so users do not race with the tray closing. This looks like inifinte wait but unless the drive is broken it either closes the tray within a few seconds or report