linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: udev cdrom_id rules prevent unmounted CD from spinning down
Date: Wed, 19 May 2010 13:23:25 +0000	[thread overview]
Message-ID: <4BF3E64D.2040003@kernel.org> (raw)
In-Reply-To: <20100513153043.GA3966@elliptictech.com>

(cc'ing linux-ide and Jeff)
Hello,

For new comers: A cdrom is smart enough to actually raise AN but at
the same time dumb enough to raise it again on each open leading to
infinite loop involving the drive, kernel and udev.

On 05/18/2010 10:18 PM, Kay Sievers wrote:
> Tejun, the stuff in:
>   drivers/ata/libata-eh.c::sata_async_notification()
> seems to send events for this device, even when there is no changed
> media. Any ideas how to debug this? Or to check if these events are
> really events we should put out to userspace?

Hmmm... I've been looking through the standards and things look
somewhat dodgy.  ATA ACS continuously refers to SerialATA 2.6 for
details on AN and SerialATA 2.6 standard in turn claims that it
describes the AN mechanism but doesn't define all the events AN can be
raised for and for those one should refer to command standards (in
this case ACS), *but* both list media change event as a "yeah can be
used like that" example.  So, in the end, nobody clearly defines it.
Sweet.  :-)

That said, w/o issuing further commands, the driver can't tell what
the AN exactly means.  There's no further information at all.  It's a
simple notification from the device.  For ATAPI devices, it would be
safe to assume that checking media status is the right action to take
although both ATA and SATA standards haven't been brave enough to
actually define it precisely; however, exposing it directly to
userland as a media change event seems quite naive.

I think it's best to plug AN till we have proper media presence
detection inside kernel proper so that our behavior doesn't differ
from windows apparently is the only thing many vendors are verifying
their hardware against.

Thanks.

-- 
tejun

  parent reply	other threads:[~2010-05-19 13:23 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-13 15:30 udev cdrom_id rules prevent unmounted CD from spinning down Nick Bowler
2010-05-13 16:27 ` Marco d'Itri
2010-05-13 20:13 ` Nick Bowler
2010-05-13 21:27 ` Kay Sievers
2010-05-13 21:37 ` Nick Bowler
2010-05-14  7:36 ` Martin Pitt
2010-05-14 13:51 ` Nick Bowler
2010-05-14 14:41 ` Kay Sievers
2010-05-14 18:48 ` Nick Bowler
2010-05-17 10:06 ` Kay Sievers
2010-05-17 12:43 ` Nick Bowler
2010-05-17 16:27 ` Kay Sievers
2010-05-17 22:54 ` Nicolas Thomas Bowler
2010-05-18  5:08 ` Kay Sievers
2010-05-18 13:25 ` Nick Bowler
2010-05-18 14:21 ` Kay Sievers
2010-05-18 16:23 ` Nick Bowler
2010-05-18 17:53 ` Kay Sievers
2010-05-18 18:14 ` Tejun Heo
2010-05-18 18:20 ` Kay Sievers
2010-05-18 18:28 ` Tejun Heo
2010-05-18 18:53 ` Kay Sievers
2010-05-18 19:23 ` Nick Bowler
2010-05-18 20:18 ` Kay Sievers
2010-05-19 13:23 ` Tejun Heo [this message]
2010-05-19 13:38   ` [PATCH #upstream-fixes] libata: disable ATAPI AN by default Tejun Heo
2010-05-19 16:14     ` Jeff Garzik
2010-05-19 16:53       ` Tejun Heo
2010-05-21  4:49         ` Robert Hancock
2010-05-19 16:58     ` Nick Bowler
2010-05-25 23:41     ` Jeff Garzik
2010-05-19 13:55 ` udev cdrom_id rules prevent unmounted CD from spinning down Kay Sievers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BF3E64D.2040003@kernel.org \
    --to=tj@kernel.org \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).