From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x224rnUaUem7t1vWp90NStVK/s7s4ais8A3rxAHYMhAaw4NkSTv/jqnv14N7NcbGnxJv6mE+n ARC-Seal: i=1; a=rsa-sha256; t=1516996238; cv=none; d=google.com; s=arc-20160816; b=nvJJrpMM1ThkqNc09GW488yBTwCxqdmmzYScgn4G0exag1QQdcZQky0K2pGnkELsP6 UwqHmBblEadbDLsMNcSPp/AKaKgksinpV02RumZJUM9RQtw92QeWLk5N0o+dpth07bYh 0Q9dpRI3pvQExg3e7QCytasLxAuiM/c3XZGlMjP5AA7QCOHl+5E4DIhjpKwlSP3u4sbM GdfAfEBkofsP33iforyxHiPP7mm/Omt4p7sk0utvM+x/wRfZ6TZVv+oLfiIM/nKBpr4p XW5iEajGyXNPTSnVCgajav+Gb3JN4RLl7UQd6hexTmC8qsHjnzY8hr1VnvPxhqlvMYdh ynTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from :arc-authentication-results; bh=r1dFSfnfx7h2rVUjH25AWxqS+PkUaJ63k+isVAfTm48=; b=MGpscfPDGt4szhSbxlnRKRtUApwaWZCK6MxiExgOEIX62i+T/EB+5fal6lo3zrDFVL yQ9bj45kVobu4hk2Y6QwPwx3McFyJ6AMcfYCrF2KnHdBG/D4W3nMYdMf/0MNJqXin6qq /3N6rEZCnuKU1fSrGog6pfEC+77yQj7km9nlNA9HJDjl8yW2kNLYLgpKZFTbiU/vlmgj BLJK4aik+y4Wz/04xA4UPrBSqrxEuaPhazRBVb7QL2QReB2B2udR1TsweKm6lkoy7H67 ulA27qwlbsrW787TLHvLAfU6ooshwarTlaK91n23bAZsPQm+6SBaO3MzCT7/Y72eNI+0 b1dQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of msuchanek@suse.de designates 195.135.220.15 as permitted sender) smtp.mailfrom=msuchanek@suse.de Authentication-Results: mx.google.com; spf=pass (google.com: domain of msuchanek@suse.de designates 195.135.220.15 as permitted sender) smtp.mailfrom=msuchanek@suse.de From: Michal Suchanek To: Jens Axboe , Jonathan Corbet , Borislav Petkov , Tim Waugh , "David S. Miller" , "James E.J. Bottomley" , "Martin K. Petersen" , Michal Suchanek , Kees Cook , Christophe JAILLET , Thomas Gleixner , Greg Kroah-Hartman , Kate Stewart , Philippe Ombredanne , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org Subject: [PATCH resend 0/6] Fix cdrom autoclose Date: Fri, 26 Jan 2018 17:58:34 +0100 Message-Id: X-Mailer: git-send-email 2.13.6 In-Reply-To: References: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1586772784622065528?= X-GMAIL-MSGID: =?utf-8?q?1590685847962631566?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 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(-) -- 2.13.6