Linux Hotplug development
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] cdrom_id: Fix empty drive detection for drives with an
Date: Sat, 17 Apr 2010 17:37:26 +0000	[thread overview]
Message-ID: <z2pac3eb2511004171037ne7a9c01fl3bee38f30c19fdc5@mail.gmail.com> (raw)
In-Reply-To: <o2x8911efe41004170926v32b8f421sffbd1a976a9b8f03@mail.gmail.com>

On Sat, Apr 17, 2010 at 18:26, Mike Brudevold <mike@brudevold.com> wrote:
> My CD-RW drive experiences a problem in that it automatically closes
> after opening if there is media in the drive.  This only happens if
> there was media in the drive when it was last closed (an empty drive
> stays open).  From what I can tell, this behavior is affected by the
> ID_CDROM_MEDIA variable.
>
> This is the output of cdrom_id:

> cd_profiles: current profile 0x02
> cd_profiles: profile 0x02 <ignored>

Right, this just means: "Removable disk" and we should ignore it.

> I attached a patch that only sets ID_CDROM_MEDIA if the "READ DISC
> INFORMATION" command is successful.  With this patch, the drive no
> longer automatically closes.

We need to set ID_CDROM_MEDIA for all cases where we set any type of
media. Your 0x02 profile should not set it in that case, right.

> /* exclude plain CDROM, some fake cdroms return 0 for "blank" media here */
> if (!cd_media_cd_rom && (header[2] & 3) < 4)
>       cd_media_state = media_status[header[2] & 3];
>
> First of all, ((header[2] & 3) < 4) is by definition always true, so
> I'm not sure what it is checking.

Yeah, the < 4 can be removed.

> But if somehow this is a valid
> check, perhaps we should set cd_media in here.

Yeah, we should set it there in any case.

I've committed a change, that hopefully covers all that now.

Thanks,
Kay

      reply	other threads:[~2010-04-17 17:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-17 16:26 [PATCH] cdrom_id: Fix empty drive detection for drives with an active Mike Brudevold
2010-04-17 17:37 ` Kay Sievers [this message]

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=z2pac3eb2511004171037ne7a9c01fl3bee38f30c19fdc5@mail.gmail.com \
    --to=kay.sievers@vrfy.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