Received: by 10.223.176.46 with SMTP id f43csp1098940wra; Fri, 26 Jan 2018 11:51:40 -0800 (PST) X-Google-Smtp-Source: AH8x225yq6MRvmiGFZF5uuH7S0lpDeGEoAm5mopjw6Q0r0olxFPF68nbc/XvbkC73oe3fi101GSL X-Received: by 2002:a17:902:8d85:: with SMTP id v5-v6mr15067643plo.37.1516996300245; Fri, 26 Jan 2018 11:51:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516996300; cv=none; d=google.com; s=arc-20160816; b=PuHBa1wLN2RLQLVvf8zsYt/vRcgk1dbCYX30GHuV1s7NTMrpu/gMIaGfIKnVFhpsgv kUrLIyeHmYgnYcSYQMOPxmh9rLEt3IAVx+q/QXHjekwjU27q7Px4+eZyIts2w44H3ezP GkbGQj36nbUwT2CPgKh2rmkGuvwYtDhMq83zOpSwO+k8675/OLGEiQbRxthUlNTKfwlT JxDZhRbU2x85aKcGfn4nviKOo9qFSofFGonhbdrMxC/eOBU+k0Qr1oE2s4nUiYV0sQJD 4M16Oz7beJ7pUnaVWwfpXCusH04UmVSUfu+7Os19PY3zkCWWo9cY7KH0FWJo6YPj5BUp qZhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:to:from:arc-authentication-results; bh=r1dFSfnfx7h2rVUjH25AWxqS+PkUaJ63k+isVAfTm48=; b=kJeG6/rKpTtRtPO1sbcLtuj54HfA0U/WPCJOidGkmNbxxdSdo6UEJlEQ5Qa3p0QuUU GbUF1sF/D5Qs6uIFetWb1WavuuVexG25xoTEIzhp5Eb8e3aM6i8D9v+PVY2uaOkhw1UW HozSeEDafa3M6YMUSSCfDOkB2qrO72YVHKhHcSHF0hfX9PtxYO6kMozCGSddJYN0xM1g vkAW9IgnDX/ygLL6GV3i8DIF8BPBNUpBv0IUS5omyOXCU0Wg+f8TSjG/aydtJP8CinIk B7+ato2i2yaOV0hew4WLu+4m0Tl9bOLfowwPBDNPGN3dlsCLH2au3egFeNYfobNEudFf spGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si2668009pfb.313.2018.01.26.11.51.25; Fri, 26 Jan 2018 11:51:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751824AbeAZTul (ORCPT + 99 others); Fri, 26 Jan 2018 14:50:41 -0500 Received: from mx2.suse.de ([195.135.220.15]:40616 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751498AbeAZTuj (ORCPT ); Fri, 26 Jan 2018 14:50:39 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 842F8B00C; Fri, 26 Jan 2018 19:43:51 +0000 (UTC) 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: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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