Skip to contentSkip to conversation

a bug in 8250.c

PATCH Hu Gang 2 participants 2 messages Sep 29, 2002

lore
Share & tools
lore

Hu Gang

author
#0 lore raw

Hi Russell King:

In [email protected], if all is pass it return 0, or failed return -XX, But you use

        ret = serial8250_request_std_resource(up, &res_std);
->      if (ret)
                return;

I'm guess it use as .
-> if (ret == 0)

After change code, 2.5.39 Can found my modem.
Please check, If not proble, Please apply.
--------------
Here is the patch.

8250.c~fix renamed from 8250.c +3 -3
@@ -1564,7 +1564,7 @@
 
 	if (up->port.type == PORT_RSA) {
 		ret = serial8250_request_rsa_resource(up, &res_rsa);
-		if (ret)
+		if (ret == 0)
 			return ret;
 	}
 
@@ -1611,11 +1611,11 @@
 	 * tells us whether we can probe for the type of port.
 	 */
 	ret = serial8250_request_std_resource(up, &res_std);
-	if (ret)
+	if (ret == 0)
 		return;
 
 	ret = serial8250_request_rsa_resource(up, &res_rsa);
-	if (ret)
+	if (ret == 0)
 		probeflags &= ~PROBE_RSA;
 
 	if (flags & UART_CONFIG_TYPE)
Signature · 1 line
		- Hu Gang
#1 lore raw
Quoted 6 lines · Hu Gang

In [email protected], if all is pass it return 0, or failed return -XX, But you use

        ret = serial8250_request_std_resource(up, &res_std);
->      if (ret)
                return;

I'm guess it use as .
-> if (ret == 0)

This is very wrong.

If we claim the resource, we fail in this function. If we don't claim, we succeed.

Quoted 1 line

After change code, 2.5.39 Can found my modem.

I guess you've got a resource clash. Can you remove this patch from your system, and then send the kernel boot messages, and the contents of /proc/iomem and /proc/ioports please.

Signature · 2 lines
Russell King ([email protected])                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html