Skip to contentSkip to conversation

usb-snd-audio breakage

DISCUSSION Jon Smirl 3 participants 7 messages Sep 26, 2005 – Sep 27, 2005

lore
Share & tools
lore

Jon Smirl

author
#0 lore raw

usb-snd-audio broke in the last 24hrs in Linus' git tree. modprobe of the module fails. I have a PSC805 USB audio device.

modprobe snd-usb-audio
err -> snd_usb_audio: Unknown parameter `'

--
Jon Smirl
[email protected]

author
#1 lore raw

The Redhat FC4 installer is adds index=0 in modprobe.conf. The index parameter appears to have been removed fron snd-usb-audio.

There are two issues:
1) should index have been left as a non-functioning param so that existing installs won't break.
2) Why didn't I get a decent error message about index being the problem instead of the message about `'

Quoted 10 lines · Jon Smirl

usb-snd-audio broke in the last 24hrs in Linus' git tree. modprobe of the module fails. I have a PSC805 USB audio device.

modprobe snd-usb-audio
err -> snd_usb_audio: Unknown parameter `'

--
Jon Smirl
[email protected]

--
Jon Smirl
[email protected]

#2 lore raw
Quoted 8 lines · Jon Smirl

The Redhat FC4 installer is adds index=0 in modprobe.conf. The index parameter appears to have been removed fron snd-usb-audio.

There are two issues:
1) should index have been left as a non-functioning param so that existing installs won't break.
2) Why didn't I get a decent error message about index being the problem instead of the message about `'

This patch really should have been merged for 2.6.13 but somehow fell through the cracks. I don't think it even landed in -mm

Dave

Name: Ignore trailing whitespace on kernel parameters correctly: Fixed version

Dave Jones says:

... if the modprobe.conf has trailing whitespace, modules fail to load with the following helpful message..

snd_intel8x0: Unknown parameter `'

Previous version truncated last argument.

kernel/params.c +6 -2
Index: linux-2.6.13-rc6-git7-Module/kernel/params.c
===================================================================
@@ -80,8 +80,6 @@
 	int in_quote = 0, quoted = 0;
 	char *next;
 
-	/* Chew any extra spaces */
-	while (*args == ' ') args++;
 	if (*args == '"') {
 		args++;
 		in_quote = 1;
@@ -121,6 +119,9 @@
 		next = args + i + 1;
 	} else
 		next = args + i;
+
+	/* Chew up trailing spaces. */
+	while (*next == ' ') next++;
 	return next;
 }
 
@@ -134,6 +135,9 @@
 	char *param, *val;
 
 	DEBUGP("Parsing ARGS: %s\n", args);
+	
+	/* Chew leading spaces */
+	while (*args == ' ') args++;
 
 	while (*args) {
 		int ret;
author
#3 lore raw

So module and proc code will strip white space, but sysfs won't strip white space. Where is the consistency?

Quoted 57 lines · Dave Jones
Quoted 8 lines · Jon Smirl

The Redhat FC4 installer is adds index=0 in modprobe.conf. The index parameter appears to have been removed fron snd-usb-audio.

There are two issues:
1) should index have been left as a non-functioning param so that existing installs won't break.
2) Why didn't I get a decent error message about index being the problem instead of the message about `'

This patch really should have been merged for 2.6.13 but somehow fell through the cracks. I don't think it even landed in -mm

Dave

Name: Ignore trailing whitespace on kernel parameters correctly: Fixed version

Dave Jones says:

... if the modprobe.conf has trailing whitespace, modules fail to load with the following helpful message..

snd_intel8x0: Unknown parameter `'

Previous version truncated last argument.

Index: linux-2.6.13-rc6-git7-Module/kernel/params.c
===================================================================

kernel/params.c 2005-08-16 14:31:16.000000000 +1000 renamed from kernel/params.c 2005-08-10 16:12:45.000000000 +1000 +3 -2
@@ -80,8 +80,6 @@
        int in_quote = 0, quoted = 0;
        char *next;
 
-       /* Chew any extra spaces */
-       while (*args == ' ') args++;
        if (*args == '"') {
                args++;
                in_quote = 1;
@@ -121,6 +119,9 @@
                next = args + i + 1;
        } else
                next = args + i;
+
+       /* Chew up trailing spaces. */
+       while (*next == ' ') next++;
        return next;
 }
 

kernel/params.c 2005-08-16 14:31:16.000000000 +1000 line 143

Quoted 9 lines
kernel/params.c 2005-08-16 14:31:16.000000000 +1000 renamed from kernel/params.c 2005-08-10 16:12:45.000000000 +1000 +3 -0
@@ -134,6 +135,9 @@
        char *param, *val;
 
        DEBUGP("Parsing ARGS: %s\n", args);
+
+       /* Chew leading spaces */
+       while (*args == ' ') args++;
 
        while (*args) {
                int ret;

--
Jon Smirl
[email protected]

#4 lore raw
Quoted 1 line · Jon Smirl

So module

That's up to that maintainer.

Quoted 1 line

and proc code

That is not true at all.

Quoted 2 lines

will strip white space, but sysfs won't strip white space. Where is the consistency?

If you want to strip whitespace for all of your subsystem's sysfs files, a single function call will do this.

After thinking about this for a while, and seeing all of the different iterations that the sysfs-whitespace-cleanup patch went through, I do not want to add this to sysfs. It is very easy to add this to a subsystem, or even provide a generic function to do this if you want to (I'd be glad to add that to the sysfs core) but it's not for the core of sysfs to do for all files.

thanks,

greg k-h

author
#5 lore raw
Quoted 8 lines · Greg KH
Quoted 1 line · Jon Smirl

So module

That's up to that maintainer.

Quoted 1 line

and proc code

That is not true at all.

In one of the older threads about this someone pointed out two places in /proc where it is done too. I tried searching for the message but I can't find it.

Quoted 6 lines
Quoted 2 lines

will strip white space, but sysfs won't strip white space. Where is the consistency?

If you want to strip whitespace for all of your subsystem's sysfs files, a single function call will do this.

Quoted 6 lines

After thinking about this for a while, and seeing all of the different iterations that the sysfs-whitespace-cleanup patch went through, I do not want to add this to sysfs. It is very easy to add this to a subsystem, or even provide a generic function to do this if you want to (I'd be glad to add that to the sysfs core) but it's not for the core of sysfs to do for all files.

I went through the iterations because I hadn't thought about the case where people were assigning multi-line CR terminated values to sysfs attributes and then using multiple reads to process the assignments one line at a time. I had thought that sysfs was only supposed to allow the assignment of single values.

--
Jon Smirl
[email protected]

#6 lore raw
Quoted 8 lines · Jon Smirl
Quoted 6 lines · Greg KH

After thinking about this for a while, and seeing all of the different iterations that the sysfs-whitespace-cleanup patch went through, I do not want to add this to sysfs. It is very easy to add this to a subsystem, or even provide a generic function to do this if you want to (I'd be glad to add that to the sysfs core) but it's not for the core of sysfs to do for all files.

Quoted 5 lines

I went through the iterations because I hadn't thought about the case where people were assigning multi-line CR terminated values to sysfs attributes and then using multiple reads to process the assignments one line at a time. I had thought that sysfs was only supposed to allow the assignment of single values.

Yes, that is "heavily encouraged" to be the case. But as you found out...

thanks,

greg k-h