linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] 8250 resourse management fixes
@ 2006-09-09 18:23 Sergei Shtylyov
  0 siblings, 0 replies; only message in thread
From: Sergei Shtylyov @ 2006-09-09 18:23 UTC (permalink / raw)
  To: rmk+serial; +Cc: tie-fei.zang, linux-serial

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

I think register ranges obviously need to be claimed/released for all UARTs
including those with UPIO_MEM32 and UPIO_TSI iotype.

Also, serial8250_request_rsa_resources() returns false positives with
UPIO_MEM32, UPIO_AU, and UPIO_TSI iotype -- I don't think this makes any sense.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>



[-- Attachment #2: 8250-resource-management-fixes.patch --]
[-- Type: text/plain, Size: 1367 bytes --]

Index: linux-mips/drivers/serial/8250.c
===================================================================
--- linux-mips.orig/drivers/serial/8250.c
+++ linux-mips/drivers/serial/8250.c
@@ -1949,6 +1949,8 @@ static int serial8250_request_std_resour
 	case UPIO_AU:
 		size = 0x100000;
 		/* fall thru */
+	case UPIO_TSI:
+	case UPIO_MEM32:
 	case UPIO_MEM:
 		if (!up->port.mapbase)
 			break;
@@ -1984,6 +1986,8 @@ static void serial8250_release_std_resou
 	case UPIO_AU:
 		size = 0x100000;
 		/* fall thru */
+	case UPIO_TSI:
+	case UPIO_MEM32:
 	case UPIO_MEM:
 		if (!up->port.mapbase)
 			break;
@@ -2007,17 +2011,15 @@ static int serial8250_request_rsa_resour
 {
 	unsigned long start = UART_RSA_BASE << up->port.regshift;
 	unsigned int size = 8 << up->port.regshift;
-	int ret = 0;
+	int ret = -EINVAL;
 
 	switch (up->port.iotype) {
-	case UPIO_MEM:
-		ret = -EINVAL;
-		break;
-
 	case UPIO_HUB6:
 	case UPIO_PORT:
 		start += up->port.iobase;
-		if (!request_region(start, size, "serial-rsa"))
+		if (request_region(start, size, "serial-rsa"))
+			ret = 0;
+		else
 			ret = -EBUSY;
 		break;
 	}
@@ -2031,9 +2033,6 @@ static void serial8250_release_rsa_resou
 	unsigned int size = 8 << up->port.regshift;
 
 	switch (up->port.iotype) {
-	case UPIO_MEM:
-		break;
-
 	case UPIO_HUB6:
 	case UPIO_PORT:
 		release_region(up->port.iobase + offset, size);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-09-09 18:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-09 18:23 [PATCH] 8250 resourse management fixes Sergei Shtylyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).