public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Serial.c Bug
@ 2001-11-14 10:02 Roman Kurakin
  2001-11-14 23:59 ` Russell King
  0 siblings, 1 reply; 3+ messages in thread
From: Roman Kurakin @ 2001-11-14 10:02 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 368 bytes --]

  Hi,

    I have found a bug. It is in support of serial cards which uses 
memory for I/O
insted of ports. I made a patch for serial.c and fix one place, but 
probably the
problem like this one could be somewhere else.

    If you try to use setserial with such cards you will get "Address in 
use" (-EADDRINUSE)

Best regards,
                        Kurakin Roman


[-- Attachment #2: serial.pch --]
[-- Type: text/plain, Size: 841 bytes --]

--- serial.c.orig	Tue Nov 13 20:50:16 2001
+++ serial.c	Tue Nov 13 20:52:28 2001
@@ -2077,6 +2077,7 @@
 	unsigned int		i,change_irq,change_port;
 	int 			retval = 0;
 	unsigned long		new_port;
+	unsigned long           new_mem;
 
 	if (copy_from_user(&new_serial,new_info,sizeof(new_serial)))
 		return -EFAULT;
@@ -2087,6 +2088,8 @@
 	if (HIGH_BITS_OFFSET)
 		new_port += (unsigned long) new_serial.port_high << HIGH_BITS_OFFSET;
 
+	new_mem = new_serial.iomem_base;
+
 	change_irq = new_serial.irq != state->irq;
 	change_port = (new_port != ((int) state->port)) ||
 		(new_serial.hub6 != state->hub6);
@@ -2127,6 +2130,7 @@
 		for (i = 0 ; i < NR_PORTS; i++)
 			if ((state != &rs_table[i]) &&
 			    (rs_table[i].port == new_port) &&
+			    (rs_table[i].iomem_base == new_mem) &&
 			    rs_table[i].type)
 				return -EADDRINUSE;
 	}

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Serial.c Bug
  2001-11-14 10:02 Serial.c Bug Roman Kurakin
@ 2001-11-14 23:59 ` Russell King
  2001-11-15 13:34   ` Roman Kurakin
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King @ 2001-11-14 23:59 UTC (permalink / raw)
  To: Roman Kurakin; +Cc: linux-kernel

On Wed, Nov 14, 2001 at 01:02:47PM +0300, Roman Kurakin wrote:
>     I have found a bug. It is in support of serial cards which uses 
> memory for I/O insted of ports. I made a patch for serial.c and fix
> one place, but probably the problem like this one could be somewhere
> else.

I've got this fish caught in the my serial driver rewrite - the driver
always handles the requesting and freeing of the resources.  If it is
unable to request the resources, then you will receive a suitable error
when trying to configure two ports.

Please note that I'm not about to take on maintainence of the current
serial.c driver, except where I spot obvious bugs.

I'd recommend that you pass this one to Marcelo to incorporate (only
after he's got his feet on the ground again. 8))  It looks sensible.

--
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Serial.c Bug
  2001-11-14 23:59 ` Russell King
@ 2001-11-15 13:34   ` Roman Kurakin
  0 siblings, 0 replies; 3+ messages in thread
From: Roman Kurakin @ 2001-11-15 13:34 UTC (permalink / raw)
  To: Russell King; +Cc: linux-kernel

Thanks

Russell King wrote:

>On Wed, Nov 14, 2001 at 01:02:47PM +0300, Roman Kurakin wrote:
>
>>    I have found a bug. It is in support of serial cards which uses 
>>memory for I/O insted of ports. I made a patch for serial.c and fix
>>one place, but probably the problem like this one could be somewhere
>>else.
>>
>
>I've got this fish caught in the my serial driver rewrite - the driver
>always handles the requesting and freeing of the resources.  If it is
>unable to request the resources, then you will receive a suitable error
>when trying to configure two ports.
>
>Please note that I'm not about to take on maintainence of the current
>serial.c driver, except where I spot obvious bugs.
>
>I'd recommend that you pass this one to Marcelo to incorporate (only
>after he's got his feet on the ground again. 8))  It looks sensible.
>
>--
>Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
>             http://www.arm.linux.org.uk/personal/aboutme.html
>
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at  http://www.tux.org/lkml/
>
>





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-11-15 13:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-11-14 10:02 Serial.c Bug Roman Kurakin
2001-11-14 23:59 ` Russell King
2001-11-15 13:34   ` Roman Kurakin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox