lkml.org 
[lkml]   [2001]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectSerial.c Bug
  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

--- 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;
}
\
 
 \ /
  Last update: 2005-03-22 13:13    [W:0.055 / U:7.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site