Skip to contentSkip to conversation

Patch to get IDE CDROM working on MIPS

PATCH Hartvig Ekner 1 participant 1 message Aug 16, 2001 MIPS

lore
Share & tools
lore
#0 lore raw

I have gotten IDE CDROM support to work under MIPS now (tested on Malta both LE and BE with 2.4.3 kernel). It was broken due to a stack overwrite in the generic cdrom.c which for obscure reasons didn't kill an x86 kernel, but does kill a MIPS kernel, see the patch below.

The patch has been accepted by the CDROM maintainer, but in case somebody wants to experiment with IDE CDROM now, have fun!

/Hartvig

/home/hartvige/tmp/linux-2.4.3/drivers/cdrom> diff -u cdrom.c.ORG cdrom.c

cdrom.c Tue Aug 14 14:44:14 2001 renamed from cdrom.c.ORG Tue Aug 14 10:35:04 2001 +6 -1
@@ -2244,8 +2244,13 @@
        if ((ret = cdo->generic_packet(cdi, &cgc)))
                return ret;
 
-       cgc.cmd[8] = cgc.buflen = be16_to_cpu(ti->track_information_length) +
+       cgc.buflen = be16_to_cpu(ti->track_information_length) +
                     sizeof(ti->track_information_length);
+
+       if (cgc.buflen > sizeof(track_information))
+               cgc.buflen = sizeof(track_information);
+
+       cgc.cmd[8] = cgc.buflen;
        return cdo->generic_packet(cdi, &cgc);
 }