[SERIAL] 8250 resourse management fixes
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> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
f3d106881b
commit
0b30d668a2
1 changed files with 8 additions and 9 deletions
|
@ -1949,6 +1949,8 @@ static int serial8250_request_std_resource(struct uart_8250_port *up)
|
||||||
case UPIO_AU:
|
case UPIO_AU:
|
||||||
size = 0x100000;
|
size = 0x100000;
|
||||||
/* fall thru */
|
/* fall thru */
|
||||||
|
case UPIO_TSI:
|
||||||
|
case UPIO_MEM32:
|
||||||
case UPIO_MEM:
|
case UPIO_MEM:
|
||||||
if (!up->port.mapbase)
|
if (!up->port.mapbase)
|
||||||
break;
|
break;
|
||||||
|
@ -1984,6 +1986,8 @@ static void serial8250_release_std_resource(struct uart_8250_port *up)
|
||||||
case UPIO_AU:
|
case UPIO_AU:
|
||||||
size = 0x100000;
|
size = 0x100000;
|
||||||
/* fall thru */
|
/* fall thru */
|
||||||
|
case UPIO_TSI:
|
||||||
|
case UPIO_MEM32:
|
||||||
case UPIO_MEM:
|
case UPIO_MEM:
|
||||||
if (!up->port.mapbase)
|
if (!up->port.mapbase)
|
||||||
break;
|
break;
|
||||||
|
@ -2007,17 +2011,15 @@ static int serial8250_request_rsa_resource(struct uart_8250_port *up)
|
||||||
{
|
{
|
||||||
unsigned long start = UART_RSA_BASE << up->port.regshift;
|
unsigned long start = UART_RSA_BASE << up->port.regshift;
|
||||||
unsigned int size = 8 << up->port.regshift;
|
unsigned int size = 8 << up->port.regshift;
|
||||||
int ret = 0;
|
int ret = -EINVAL;
|
||||||
|
|
||||||
switch (up->port.iotype) {
|
switch (up->port.iotype) {
|
||||||
case UPIO_MEM:
|
|
||||||
ret = -EINVAL;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case UPIO_HUB6:
|
case UPIO_HUB6:
|
||||||
case UPIO_PORT:
|
case UPIO_PORT:
|
||||||
start += up->port.iobase;
|
start += up->port.iobase;
|
||||||
if (!request_region(start, size, "serial-rsa"))
|
if (request_region(start, size, "serial-rsa"))
|
||||||
|
ret = 0;
|
||||||
|
else
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2031,9 +2033,6 @@ static void serial8250_release_rsa_resource(struct uart_8250_port *up)
|
||||||
unsigned int size = 8 << up->port.regshift;
|
unsigned int size = 8 << up->port.regshift;
|
||||||
|
|
||||||
switch (up->port.iotype) {
|
switch (up->port.iotype) {
|
||||||
case UPIO_MEM:
|
|
||||||
break;
|
|
||||||
|
|
||||||
case UPIO_HUB6:
|
case UPIO_HUB6:
|
||||||
case UPIO_PORT:
|
case UPIO_PORT:
|
||||||
release_region(up->port.iobase + offset, size);
|
release_region(up->port.iobase + offset, size);
|
||||||
|
|
Loading…
Reference in a new issue