Re: [PATCH] cdrom_id: Fix empty drive detection for drives with an active profile when empty.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Apr 17, 2010 at 18:26, Mike Brudevold <mike@xxxxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux