[Bug 11602] cdrom drive cannot open the tray, but reported this badly in /proc/sys/dev/cdrom/info

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

 



http://bugzilla.kernel.org/show_bug.cgi?id=11602


bbpetkov@xxxxxxxx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bbpetkov@xxxxxxxx




------- Comment #3 from bbpetkov@xxxxxxxx  2008-09-20 22:34 -------
On a first look, your check is wrong:

        cdinfo(CD_REG_UNREG, "drive \"/dev/%s\" registered\n", cdi->name);
+       printk(KERN_DEBUG "%s:%u: cdi->mask=0x%X, (cdi->mask &
CDC_CLOSE_TRAY)=%s\n",
+               __FILE__, __LINE__, cdi->mask, (cdi->mask & CDC_CLOSE_TRAY) ?
"TRUE" : "FALSE");

you're checking against cdi->mask but if you see how CDROM_CAN is defined:

#define CDROM_CAN(type) (cdi->ops->capability & ~cdi->mask & (type))

you see that the mask is negated and also cdi->ops->capability comes into play.

However, the problem is that the CDC_CLOSE_TRAY is turned on (i.e. is going to
be off in the final check and yes, it _IS_ confusing :)) in the cdi->mask only
for devices with caddy and popup loading mechanisms. I don't think we can
reliably detect whether the drive can close its tray now on a drive-by-drive
basis - from what i see in your dmesg output, your drive is mechtype_tray and
such drives normally can close the tray. Alternatively, we could make another
list :( of drive model names which cannot close its mechanism but this is kinda
overkill imho. Jens, Bart?


-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux