Skip to contentSkip to conversation

cdrom: don't check CDC_PLAY_AUDIO in cdrom_count_tracks()

PATCH In review Tejun Heo 3 participants 3 messages Jun 17, 2008

Subsystems (2)
lore
Share & tools
lore

Tejun Heo

author
#0 lore raw

PATCH 1/1 cdrom: don't check CDC_PLAY_AUDIO in cdrom_count_tracks()

According to MMC-3 (or any later versions) READ TOCs are mandatory commands and have nothing to do with CDC_PLAY_AUDIO. I have no idea why the check was put there in the first place but it now only breaks automatic actions on certain drives.

Note that this test was only effective when ide-cdrom was being used as sr didn't mask CDC_PLAY_AUDIO according to the capabilities.

---
 drivers/cdrom/cdrom.c |    4 ----
 1 file changed, 4 deletions(-)
drivers/cdrom/cdrom.c +0 -4
index 69f26eb..11574c5 100644
@@ -1491,10 +1491,6 @@ static void cdrom_count_tracks(struct cdrom_device_info *cdi, tracktype* tracks)
 	tracks->xa=0;
 	tracks->error=0;
 	cdinfo(CD_COUNT_TRACKS, "entering cdrom_count_tracks\n"); 
-        if (!CDROM_CAN(CDC_PLAY_AUDIO)) { 
-                tracks->error=CDS_NO_INFO;
-                return;
-        }        
 	/* Grab the TOC header so we can see how many tracks there are */
 	if ((ret = cdi->ops->audio_ioctl(cdi, CDROMREADTOCHDR, &header))) {
 		if (ret == -ENOMEDIUM)
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Tejun Heo

According to MMC-3 (or any later versions) READ TOCs are mandatory commands and have nothing to do with CDC_PLAY_AUDIO. I have no idea why the check was put there in the first place but it now only breaks automatic actions on certain drives.

Note that this test was only effective when ide-cdrom was being used as sr didn't mask CDC_PLAY_AUDIO according to the capabilities.

Quoted 19 lines
---
 drivers/cdrom/cdrom.c |    4 ----
 1 file changed, 4 deletions(-)
drivers/cdrom/cdrom.c +0 -4
index 69f26eb..11574c5 100644
@@ -1491,10 +1491,6 @@ static void cdrom_count_tracks(struct cdrom_device_info *cdi, tracktype* tracks)
 	tracks->xa=0;
 	tracks->error=0;
 	cdinfo(CD_COUNT_TRACKS, "entering cdrom_count_tracks\n"); 
-        if (!CDROM_CAN(CDC_PLAY_AUDIO)) { 
-                tracks->error=CDS_NO_INFO;
-                return;
-        }        
 	/* Grab the TOC header so we can see how many tracks there are */
 	if ((ret = cdi->ops->audio_ioctl(cdi, CDROMREADTOCHDR, &header))) {
 		if (ret == -ENOMEDIUM)
Signature · 1 line
Jens Axboe
#2 lore raw
In reply to Tejun Heo
Quoted 6 lines · Tejun Heo

According to MMC-3 (or any later versions) READ TOCs are mandatory commands and have nothing to do with CDC_PLAY_AUDIO. I have no idea why the check was put there in the first place but it now only breaks automatic actions on certain drives.

Note that this test was only effective when ide-cdrom was being used

cc ing Borislav
Quoted 22 lines

as sr didn't mask CDC_PLAY_AUDIO according to the capabilities.

---
 drivers/cdrom/cdrom.c |    4 ----
 1 file changed, 4 deletions(-)
drivers/cdrom/cdrom.c +0 -4
index 69f26eb..11574c5 100644
@@ -1491,10 +1491,6 @@ static void cdrom_count_tracks(struct cdrom_device_info *cdi, tracktype* tracks)
 	tracks->xa=0;
 	tracks->error=0;
 	cdinfo(CD_COUNT_TRACKS, "entering cdrom_count_tracks\n"); 
-        if (!CDROM_CAN(CDC_PLAY_AUDIO)) { 
-                tracks->error=CDS_NO_INFO;
-                return;
-        }        
 	/* Grab the TOC header so we can see how many tracks there are */
 	if ((ret = cdi->ops->audio_ioctl(cdi, CDROMREADTOCHDR, &header))) {
 		if (ret == -ENOMEDIUM)