Skip to contentSkip to conversation

documentation typo

PATCH In review Diego Calleja 2 participants 8 messages Jan 5, 2006 – Jan 27, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 documentation typo

According to a bug reported in bugzilla...

Documentation/ide.txt renamed from Documentation/ide.txt.wrong +1 -1
@@ -244,7 +244,7 @@ Summary of ide driver parameters for ker
 
  "hdx=bswap"		: same as above..........
 
- "hdx=scsi"		: the return of the ide-scsi flag, this is useful for
+ "hdx=ide-scsi"		: the return of the ide-scsi flag, this is useful for
  			  allowing ide-floppy, ide-tape, and ide-cdrom|writers
  			  to use ide-scsi emulation on a device specific option.
 
#1 lore raw

Hi,

Documentation/ide.txt 2006-01-05 13:16:10.000000000 +0100 Summary of ide driver parameters for ker · line 249

Quoted 12 lines · Diego Calleja

According to a bug reported in bugzilla...

Documentation/ide.txt 2006-01-05 13:16:10.000000000 +0100 renamed from Documentation/ide.txt.wrong 2006-01-05 13:16:06.000000000 +0100 +1 -1
@@ -244,7 +244,7 @@ Summary of ide driver parameters for ker
 
  "hdx=bswap"           : same as above..........
 
- "hdx=scsi"            : the return of the ide-scsi flag, this is useful for
+ "hdx=ide-scsi"                : the return of the ide-scsi flag, this is useful for
                          allowing ide-floppy, ide-tape, and ide-cdrom|writers
                          to use ide-scsi emulation on a device specific option.

This is not quite correct: ide-scsi is a separate device driver and "hdx=ide-scsi" tells IDE core to try this driver first for device "hdx" (OTOH "ide=scsi" tells other device drivers to not bind to device "hdx"). Both options are confusing and IDE specific.

In recent kernels you can use generic sysfs interface to bind/unbind device to drivers _dynamically_ without using "hdx=scsi" and "hdx=ide-scsi" et all (these option can die):

[root@trik /]# cd /sys/bus/ide/drivers/
[root@trik drivers]# ls
ide-cdrom ide-disk ide-scsi
[root@trik drivers]# ls ide-cdrom ide-scsi
ide-cdrom:
1.0 bind module unbind

ide-scsi:
bind module unbind
[root@trik drivers]# echo -n "1.0">ide-cdrom/unbind [root@trik drivers]# ls ide-cdrom ide-scsi ide-cdrom:
bind module unbind

ide-scsi:
bind module unbind
[root@trik drivers]# echo -n "1.0">ide-scsi/bind
[root@trik drivers]# ls ide-cdrom ide-scsi
ide-cdrom:
bind module unbind

ide-scsi:
1.0 bind module unbind

I would greatly appreciate if you update ide.txt accordingly.

Thanks,
Bartlomiej

#2 lore raw
Quoted 1 line · Bartlomiej Zolnierkiewicz

I would greatly appreciate if you update ide.txt accordingly.

If this doesn't look OK (it's crappy to paste command examples instead of explaining the interface) I'll rewrite it after the weekend.

Documentation/ide.txt renamed from Documentation/ide.txt.old +35 -1
@@ -244,10 +244,44 @@ Summary of ide driver parameters for ker
 
  "hdx=bswap"		: same as above..........
 
- "hdx=scsi"		: the return of the ide-scsi flag, this is useful for
+ "hdx=ide-scsi" (*)	: the return of the ide-scsi flag, this is useful for
  			  allowing ide-floppy, ide-tape, and ide-cdrom|writers
  			  to use ide-scsi emulation on a device specific option.
 
+ "hdx=scsi" (*)	: This option tells IDE drivers not to bind to device
+			  "hdx"
+
+ [(*) Notice that in current kernels you can use the generic sysfs interface
+  to bind/unbind devices to drivers dynamically without using "hdx=scsi"
+  and/or "hdx=ide-scsi", so those boot options may be deprecated in the future,
+  ej:
+
+   [root@trik /]# cd /sys/bus/ide/drivers/
+   [root@trik drivers]# ls
+   ide-cdrom  ide-disk  ide-scsi
+   [root@trik drivers]# ls ide-cdrom ide-scsi
+   ide-cdrom:
+   1.0  bind  module  unbind
+   
+   ide-scsi:
+   bind  module  unbind
+   [root@trik drivers]# echo -n "1.0">ide-cdrom/unbind
+   [root@trik drivers]# ls ide-cdrom ide-scsi
+   ide-cdrom:
+   bind  module  unbind
+   
+   ide-scsi:
+   bind  module  unbind
+   [root@trik drivers]# echo -n "1.0">ide-scsi/bind
+   [root@trik drivers]# ls ide-cdrom ide-scsi
+   ide-cdrom:
+   bind  module  unbind
+   
+   ide-scsi:
+   1.0  bind  module  unbind
+   [root@trik drivers]#
+   
+
  "idebus=xx"		: inform IDE driver of VESA/PCI bus speed in MHz,
 			  where "xx" is between 20 and 66 inclusive,
 			  used when tuning chipset PIO modes.
#3 lore raw
Quoted 9 lines · Diego Calleja
Quoted 1 line · Bartlomiej Zolnierkiewicz

I would greatly appreciate if you update ide.txt accordingly.

If this doesn't look OK (it's crappy to paste command examples instead of explaining the interface) I'll rewrite it after the weekend.

Well, examples are fine but some explanation would be needed. I'll wait for revised version (please also add that you need CONFIG_HOTPLUG=y for using sysfs interface - this is due one of the recent changes in the kernel driver core).

Thanks,
Bartlomiej

Quoted 49 lines
Documentation/ide.txt 2006-01-13 17:08:08.000000000 +0100 renamed from Documentation/ide.txt.old 2006-01-13 16:58:28.000000000 +0100 +35 -1
@@ -244,10 +244,44 @@ Summary of ide driver parameters for ker
 
  "hdx=bswap"           : same as above..........
 
- "hdx=scsi"            : the return of the ide-scsi flag, this is useful for
+ "hdx=ide-scsi" (*)    : the return of the ide-scsi flag, this is useful for
                          allowing ide-floppy, ide-tape, and ide-cdrom|writers
                          to use ide-scsi emulation on a device specific option.
 
+ "hdx=scsi" (*)        : This option tells IDE drivers not to bind to device
+                         "hdx"
+
+ [(*) Notice that in current kernels you can use the generic sysfs interface
+  to bind/unbind devices to drivers dynamically without using "hdx=scsi"
+  and/or "hdx=ide-scsi", so those boot options may be deprecated in the future,
+  ej:
+
+   [root@trik /]# cd /sys/bus/ide/drivers/
+   [root@trik drivers]# ls
+   ide-cdrom  ide-disk  ide-scsi
+   [root@trik drivers]# ls ide-cdrom ide-scsi
+   ide-cdrom:
+   1.0  bind  module  unbind
+
+   ide-scsi:
+   bind  module  unbind
+   [root@trik drivers]# echo -n "1.0">ide-cdrom/unbind
+   [root@trik drivers]# ls ide-cdrom ide-scsi
+   ide-cdrom:
+   bind  module  unbind
+
+   ide-scsi:
+   bind  module  unbind
+   [root@trik drivers]# echo -n "1.0">ide-scsi/bind
+   [root@trik drivers]# ls ide-cdrom ide-scsi
+   ide-cdrom:
+   bind  module  unbind
+
+   ide-scsi:
+   1.0  bind  module  unbind
+   [root@trik drivers]#
+
+
  "idebus=xx"           : inform IDE driver of VESA/PCI bus speed in MHz,
                          where "xx" is between 20 and 66 inclusive,
                          used when tuning chipset PIO modes.
#4 lore raw
Quoted 4 lines · Bartlomiej Zolnierkiewicz

Well, examples are fine but some explanation would be needed. I'll wait for revised version (please also add that you need CONFIG_HOTPLUG=y for using sysfs interface - this is due one of the recent changes in the kernel driver core).

Of, this is not 100% perfect but it's much better:

- I added a CONFIG_HOTPLUG dependeny for ide-scsi. If the sysfs interface is the Right Way of doing it and the boot parameters are going to be removed some day, it has sense no?

- I "deprecated" the boot parameters by adding a printk and a entry to feature-removal-schedule.txt. I don't know if this is what you want but I though it was the right thing

Documentation/ide.txt +43 -1
Index: test/Documentation/ide.txt
===================================================================
@@ -244,9 +244,15 @@
 
  "hdx=bswap"		: same as above..........
 
- "hdx=scsi"		: the return of the ide-scsi flag, this is useful for
+ "hdx=ide-scsi"		: the return of the ide-scsi flag, this is useful for
  			  allowing ide-floppy, ide-tape, and ide-cdrom|writers
  			  to use ide-scsi emulation on a device specific option.
+			  NOTE: This boot option is deprecated (*) and may be
+			  removed in the future
+
+ "hdx=scsi"		: This option tells IDE drivers not to bind to device
+			  "hdx". NOTE: This boot option is deprecated (*) and
+			  may be removed in the future.
 
  "idebus=xx"		: inform IDE driver of VESA/PCI bus speed in MHz,
 			  where "xx" is between 20 and 66 inclusive,
@@ -317,8 +323,44 @@
 
 Everything else is rejected with a "BAD OPTION" message.
 
+
+(*): hdx=ide-scsi and hdx=scsi boot options: These two boot options have been
+deprecated by a new sysfs interface, which allows to bind/unbind devices to
+drivers dinamically. Notice that you need to enable CONFIG_HOTPLUG (Hotplug
+support) to use this:
+
+For every IDE bus in the system, there's a /sys/devices/$PCIBUS/$PCIID/idex/
+subdirectory (where $PCIBUS is the identifier of the PCI bus, something like
+"pci0000:00", and $PCIID is the PCI ID of the ide bus device - the same you get
+when you run lspci - something like "0000:00:0f.1". idex is ide0, ide1, etc)
+
+In each one of those subdirectories, there's another subdirectory with a name
+like "0.0", "1.0", etc: The first number identifies the IDE bus (ide0, ide1
+etc) and the second one the device connected at that bus. That subdirectory
+has some information about your device and more subdirectories pointing to
+other places in the sysfs tree where you can find information related with
+that device. You can also get those names by running "systool -b ide".
+
+The ide-disk, ide-cdrom and ide-scsi drivers also have their own sysfs
+subdirectory at /sys/bus/ide/drivers/ide-disk/, /sys/bus/ide/drivers/ide-scsi/,
+etc. In each one of those subdirectories there's a bind and a unbind file. The
+way to bind/unbind a device to a driver dinamically is to write the "name"
+of those files; ej: echo "1.0" > /sys/bus/ide/drivers/ide-scsi/bind to bind
+the device 1.0 to the ide-scsi driver. A symlink named "1.0" will appear in the
+ide-scsi/ directory pointing to the /sys/devices/$PCIBUS/$PCIID/ide1/1.0/
+directory. In that directory, you'll also "driver" symlink pointing back
+to the ide-scsi subdirectory. Alternatively, you can see the current state
+of all the ide interfaces by running "systools -b ide -D"
+
+While this is more complex than adding a boot parameter, this allows to
+change the device/driver bindings dynamically so no static boot parameters
+are needed (which is useful for distros so they can run in different
+hardware configurations where devices are detected dinamically and
+binded/unbinded to different interfaces dinamically)
+
 ================================================================================
 
+
 IDE ATAPI streaming tape driver
 -------------------------------
 
drivers/ide/ide.c +7 -0
Index: test/drivers/ide/ide.c
===================================================================
@@ -1554,6 +1554,9 @@
 		hwif = &ide_hwifs[hw];
 		drive = &hwif->drives[unit];
 		if (strncmp(s + 4, "ide-", 4) == 0) {
+			printk("hd%c: \"hdx=ide-scsi\" boot parameter has been
+			    obsoleted by a better mechanism and may be removed
+			    in the future, check Documentation/ide.txt\n", unit);
 			strlcpy(drive->driver_req, s + 4, sizeof(drive->driver_req));
 			goto done;
 		}
@@ -1593,6 +1596,10 @@
 				drive->sect0 = 63;
 				goto done;
 			case -14: /* "scsi" */
+				printk("hd%c: \"hdx=scsi\" boot parameter has
+				    been obsoleted by a better mechanism and may
+				    be removed in the future, check
+				    Documentation/ide.txt\n", unit);
 				drive->scsi = 1;
 				goto done;
 			case 3: /* cyl,head,sect */
Documentation/feature-removal-schedule.txt +9 -0
Index: test/Documentation/feature-removal-schedule.txt
===================================================================
@@ -139,3 +139,12 @@
 	brother on Alchemy SOCs.  The loss of features is not considered an
 	issue.
 Who:	Ralf Baechle <[email protected]>
+
+---------------------------
+
+What:	hdx=ide-scsi/hdx=scsi boot parameters
+When:	June 2006
+Why:	In current kernels there's a sysfs interface to bind/unbind devices
+	to drivers dynamically which replaces those parameters, see
+	Documentation/ide.txt
+Who:	Bartlomiej Zolnierkiewicz <[email protected]>
drivers/ide/Kconfig +5 -7
Index: test/drivers/ide/Kconfig
===================================================================
@@ -234,7 +234,7 @@
 
 config BLK_DEV_IDESCSI
 	tristate "SCSI emulation support"
-	depends on SCSI
+	depends on SCSI && HOTPLUG
 	---help---
 	  WARNING: ide-scsi is no longer needed for cd writing applications!
 	  The 2.6 kernel supports direct writing to ide-cd, which eliminates
@@ -249,12 +249,10 @@
 	  driver has been written (for example, an ATAPI PD-CD drive);
 	  you can then use this emulation together with an appropriate SCSI
 	  device driver. In order to do this, say Y here and to "SCSI support"
-	  and "SCSI generic support", below. You must then provide the kernel
-	  command line "hdx=ide-scsi" (try "man bootparam" or see the
-	  documentation of your boot loader (lilo or loadlin) about how to
-	  pass options to the kernel at boot time) for devices if you want the
-	  native EIDE sub-drivers to skip over the native support, so that
-	  this SCSI emulation can be used instead.
+	  and "SCSI generic support", below. To force a device to use this
+	  SCSI emulation interface you can use sysfs to do it at runtime as
+	  explained in <file:Documentation/ide.txt> (notice that this needs
+	  CONFIG_HOTPLUG)
 
 	  Note that this option does NOT allow you to attach SCSI devices to a
 	  box that doesn't have a SCSI host adapter installed.
#5 lore raw

El Sun, 15 Jan 2006 23:24:03 +0100,
Diego Calleja <[email protected]> escribió:

Did you like the patch? I can remove everything but the documentation if you want

#6 lore raw
In reply to Diego Calleja

Hi,

Quoted 8 lines · Diego Calleja
Quoted 4 lines · Bartlomiej Zolnierkiewicz

Well, examples are fine but some explanation would be needed. I'll wait for revised version (please also add that you need CONFIG_HOTPLUG=y for using sysfs interface - this is due one of the recent changes in the kernel driver core).

Quoted 5 lines

Of, this is not 100% perfect but it's much better:

- I added a CONFIG_HOTPLUG dependeny for ide-scsi. If the sysfs interface is the Right Way of doing it and the boot parameters are going to be removed some day, it has sense no?

Hmm, ide-scsi works just fine without CONFIG_HOTPLUG.

IMO "select CONFIG_HOTPLUG" is better but I think that we can drop CONFIG_HOTPLUG dependency entirely and see if anybody complains during transition period (unlikely).

Quoted 3 lines

- I "deprecated" the boot parameters by adding a printk and a entry to feature-removal-schedule.txt. I don't know if this is what you want but I though it was the right thing

Cool.

drivers/ide/ide.c 2006-01-15 22:00:14.000000000 +0100 line 1559

Quoted 9 lines
drivers/ide/ide.c 2006-01-15 22:00:14.000000000 +0100 renamed from drivers/ide/ide.c 2006-01-13 02:40:44.000000000 +0100 +3 -0
@@ -1554,6 +1554,9 @@
                hwif = &ide_hwifs[hw];
                drive = &hwif->drives[unit];
                if (strncmp(s + 4, "ide-", 4) == 0) {
+                       printk("hd%c: \"hdx=ide-scsi\" boot parameter has been
+                           obsoleted by a better mechanism and may be removed
+                           in the future, check Documentation/ide.txt\n", unit);

please add KERN_WARNING

drivers/ide/ide.c 2006-01-15 22:00:14.000000000 +0100 line 1602

Quoted 11 lines
drivers/ide/ide.c 2006-01-15 22:00:14.000000000 +0100 renamed from drivers/ide/ide.c 2006-01-13 02:40:44.000000000 +0100 +4 -0
                        strlcpy(drive->driver_req, s + 4, sizeof(drive->driver_req));
                        goto done;
                }
@@ -1593,6 +1596,10 @@
                                drive->sect0 = 63;
                                goto done;
                        case -14: /* "scsi" */
+                               printk("hd%c: \"hdx=scsi\" boot parameter has
+                                   been obsoleted by a better mechanism and may
+                                   be removed in the future, check
+                                   Documentation/ide.txt\n", unit);

ditto

Rest of the patch is perfectly fine.

Thanks and sorry for the delay,
Bartlomiej

#7 lore raw
Quoted 3 lines · Bartlomiej Zolnierkiewicz

IMO "select CONFIG_HOTPLUG" is better but I think that we can drop CONFIG_HOTPLUG dependency entirely and see if anybody complains during transition period (unlikely).

OK, removed

Quoted 1 line

please add KERN_WARNING

done

Documentation/feature-removal-schedule.txt +9 -0
Index: test/Documentation/feature-removal-schedule.txt
===================================================================
@@ -148,3 +148,12 @@
 	brother on Alchemy SOCs.  The loss of features is not considered an
 	issue.
 Who:	Ralf Baechle <[email protected]>
+
+---------------------------
+
+What:	hdx=ide-scsi and hdx=scsi boot parameters
+When:	June 2006
+Why:	In current kernels there's a sysfs interface to bind/unbind devices
+	to drivers dynamically which replaces those parameters, see
+	Documentation/ide.txt
+Who:	Bartlomiej Zolnierkiewicz <[email protected]>
Documentation/ide.txt +41 -0

53 lines not on this page · raw message

drivers/ide/Kconfig +4 -6
Index: test/drivers/ide/Kconfig
===================================================================
@@ -249,12 +249,10 @@
 	  driver has been written (for example, an ATAPI PD-CD drive);
 	  you can then use this emulation together with an appropriate SCSI
 	  device driver. In order to do this, say Y here and to "SCSI support"
-	  and "SCSI generic support", below. You must then provide the kernel
-	  command line "hdx=ide-scsi" (try "man bootparam" or see the
-	  documentation of your boot loader (lilo or loadlin) about how to
-	  pass options to the kernel at boot time) for devices if you want the
-	  native EIDE sub-drivers to skip over the native support, so that
-	  this SCSI emulation can be used instead.
+	  and "SCSI generic support", below. To force a device to use this
+	  SCSI emulation interface you can use sysfs to do it at runtime as
+	  explained in <file:Documentation/ide.txt> (notice that this interface
+	  needs CONFIG_HOTPLUG)
 
 	  Note that this option does NOT allow you to attach SCSI devices to a
 	  box that doesn't have a SCSI host adapter installed.
drivers/ide/ide.c +8 -0
Index: test/drivers/ide/ide.c
===================================================================
@@ -1554,6 +1554,10 @@
 		hwif = &ide_hwifs[hw];
 		drive = &hwif->drives[unit];
 		if (strncmp(s + 4, "ide-", 4) == 0) {
+			printk(KERN_WARNING "hd%c: \"hdx=ide-scsi\" boot
+			    parameter has been obsoleted by a better mechanism
+			    and will be removed in the future, read
+			    Documentation/ide.txt\n", unit);
 			strlcpy(drive->driver_req, s + 4, sizeof(drive->driver_req));
 			goto done;
 		}
@@ -1593,6 +1597,10 @@
 				drive->sect0 = 63;
 				goto done;
 			case -14: /* "scsi" */
+				printk(KERN_WARNING "hd%c: \"hdx=scsi\" boot
+				    parameter has been obsoleted by a better
+				    mechanism and may be removed in the future,
+				    read Documentation/ide.txt\n", unit);
 				drive->scsi = 1;
 				goto done;
 			case 3: /* cyl,head,sect */