IBM ThinkPad R52 and linux

I upgraded my kernel from 2.6.21 to 2.6.22. But, somehow with the same .config from 2.6.21 didn’t work as I expected with 2.6.22. The model R52 comes with IDE CD-ROM drive. So I wanted to use the ide drivers with scsi emulation for CD-ROM. I compiled ide modules into the kernel so that it gets loaded first and detect my CD-ROM drive. But ide module probes for all IDE devices including my hard disk. I don’t want to use IDE driver for my hard disk instead I wanted to use ata drivers with scsi emulation. The option left is to pass module level parameters to ide asking not to probe for my hard disk. This can be achieved by passing hda=noprobe to ide. As per the following excerpt from Documentation/kernel-parameters.txt;

Module parameters for modules that are built into the kernel image
are specified on the kernel command line with the module name plus
‘.’ plus parameter name, with ‘=’ and value if appropriate, such as:

usbcore.blinkenlights=1

I can pass hda=noprobe to ide by appending ide.hda=noprobe to kernel command line. But this doesn’t work for me. I think that in drivers/ide/ide.c, the code for latest __setup() macro is incomplete. I read lots of code and tried to understand what exactly is happening, but I couldn’t find out how I can pass hda=noprobe to ide without doing the following changes to drivers/ide/ide.c. I added following piece of code in the function ide_init().

#ifndef MODULE  /* I dont want the below code to be compiled if I later compile this as a module */
ide_setup("hda=noprobe");
ide_setup("hdb=noprobe"); // I don't have second HDD, still I don't want it to probe.
#endif /* !MODULE */

The above code will ensure that, when the kernel loads ide drivers, it wont probe for my hard disk. And above piece of code helped me to achieve my goal. I still don’t know whether there is some way to pass hda=noprobe to ide without doing above code change. If someone know, how to do it, then let me know.

This entry was posted in Uncategorized and tagged , , , , , , , , , , . Bookmark the permalink. Follow any comments here with the RSS feed for this post. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>