lkml.org 
[lkml]   [2012]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 7/7] [SCSI] sr: adds Zero-power ODD support
On Thu, 5 Apr 2012, Aaron Lu wrote:

> Hi,
>
> On Thu, Apr 05, 2012 at 02:00:57PM +0800, Lin Ming wrote:
> > >
> > > Another thing to consider is, user might want to eject the tray by
> > > software like the
> > > eject /dev/sr0 command or some UI mouse clicks against the cdrom icon. I'm still
> > > thinking how to do this correctly.
> >
> > Assume eject /dev/sr0 is implemented as:
> >
> > int fd = open("/dev/sr0", ...)
> > ioctl(fd, CDROMEJECT)
> >
>
> Indeed, it is implemented as this :-)
>
> > We may need to resume ODD in the ioctl handler(scsi_cmd_ioctl).
> >
>
> I prefer we do this in sr_block_ioctl.
> Suppose the ODD is now runtime suspended and received an ioctl:
> if the ioctl's cmd is CDROMEJECT, resume it.
> For other cases, return an error code like EPERM.
> When done, according to the result of ioctl: if success, leave it resumed;
> if failed, put it back to sleep.

Alternatively, you may want to do the runtime resume in sr_open and
sr_block_open and the suspend in the corresponding release routines.
It's up to you.

Alan Stern



\
 
 \ /
  Last update: 2012-04-05 16:05    [W:0.073 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site