Skip to content

Fix cdrom autoclose

Michal Suchanek linux-doc linux-ide linux-scsi lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v1 Latest posting 2/20 of 6 patches 2 repliesIn review
  2. v1 posting 1/26 patches 7 repliesSuperseded

Patches in v1 posting 2/2 No applies recorded yet

None of the 6 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH resend 0/6] Fix cdrom autoclose

Hello,

there is cdrom autoclose feature that is supposed to close the tray, wait for the disc to become ready, and then open the device.

This used to work in ancient times. Then in old times there was a hack in util-linux which worked around the breakage which probably resulted from switching to scsi emulation.

Currently util-linux maintainer refuses to merge another hack on the basis that kernel still has the feature so it should be fixed there. Indeed, to implement this feature effectively from userspace one would need to know when the CD-ROM is in the "drive becoming ready" state which is knowledge that never leaves the hardware-specific driver and is passed neither to userspace nor the generic cdrom driver.

So this patchset fixes the kernel autoclose implementation in cdrom.c and to do so reports the "drive becoming ready" state from the harware specific drivers.

First time I did not get any feedback for the patches. I found a defect in tray_close - it used status function without checking it exists. So resending with the defect corrected.

Michal Suchanek (6):
delay: add poll_event_interruptible
cdrom: factor out common open_for_* code
cdrom: wait for tray to close
cdrom: introduce CDS_DRIVE_ERROR
Documentetion: cdrom: introduce CDS_DRIVE_ERROR
cdrom: wait for drive to become ready

 Documentation/cdrom/cdrom-standard.tex |   8 ++-
 Documentation/cdrom/ide-cd             |   6 ++
 Documentation/ioctl/cdrom.txt          |   1 +
 drivers/block/paride/pcd.c             |   2 +-
 drivers/cdrom/cdrom.c                  | 124 ++++++++++++++++-----------------
 drivers/cdrom/gdrom.c                  |   2 +-
 drivers/ide/ide-cd_ioctl.c             |  12 ++--
 drivers/scsi/sr_ioctl.c                |   2 +-
 include/linux/delay.h                  |  12 ++++
 include/uapi/linux/cdrom.h             |   1 +
 10 files changed, 99 insertions(+), 71 deletions(-)
Signature · 1 line
2.13.6