diff options
-rw-r--r-- | arch/powerpc/kernel/legacy_serial.c | 3 | ||||
-rw-r--r-- | drivers/serial/of_serial.c | 3 | ||||
-rw-r--r-- | drivers/serial/serial_core.c | 22 | ||||
-rw-r--r-- | include/linux/serial_core.h | 1 |
4 files changed, 18 insertions, 11 deletions
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c index 63dd2c3ad95e..ae4836ea7442 100644 --- a/arch/powerpc/kernel/legacy_serial.c +++ b/arch/powerpc/kernel/legacy_serial.c | |||
@@ -115,7 +115,8 @@ static int __init add_legacy_soc_port(struct device_node *np, | |||
115 | { | 115 | { |
116 | u64 addr; | 116 | u64 addr; |
117 | const u32 *addrp; | 117 | const u32 *addrp; |
118 | upf_t flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ; | 118 | upf_t flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ |
119 | | UPF_FIXED_PORT; | ||
119 | struct device_node *tsi = of_get_parent(np); | 120 | struct device_node *tsi = of_get_parent(np); |
120 | 121 | ||
121 | /* We only support ports that have a clock frequency properly | 122 | /* We only support ports that have a clock frequency properly |
diff --git a/drivers/serial/of_serial.c b/drivers/serial/of_serial.c index 09b0b736a751..336d0f4580d9 100644 --- a/drivers/serial/of_serial.c +++ b/drivers/serial/of_serial.c | |||
@@ -48,7 +48,8 @@ static int __devinit of_platform_serial_setup(struct of_device *ofdev, | |||
48 | port->iotype = UPIO_MEM; | 48 | port->iotype = UPIO_MEM; |
49 | port->type = type; | 49 | port->type = type; |
50 | port->uartclk = *clk; | 50 | port->uartclk = *clk; |
51 | port->flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_IOREMAP; | 51 | port->flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_IOREMAP |
52 | | UPF_FIXED_PORT; | ||
52 | port->dev = &ofdev->dev; | 53 | port->dev = &ofdev->dev; |
53 | port->custom_divisor = *clk / (16 * (*spd)); | 54 | port->custom_divisor = *clk / (16 * (*spd)); |
54 | 55 | ||
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index a677133ab2d4..f409be37b62f 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c | |||
@@ -672,19 +672,21 @@ static int uart_set_info(struct uart_state *state, | |||
672 | */ | 672 | */ |
673 | mutex_lock(&state->mutex); | 673 | mutex_lock(&state->mutex); |
674 | 674 | ||
675 | change_irq = new_serial.irq != port->irq; | 675 | change_irq = !(port->flags & UPF_FIXED_PORT) |
676 | && new_serial.irq != port->irq; | ||
676 | 677 | ||
677 | /* | 678 | /* |
678 | * Since changing the 'type' of the port changes its resource | 679 | * Since changing the 'type' of the port changes its resource |
679 | * allocations, we should treat type changes the same as | 680 | * allocations, we should treat type changes the same as |
680 | * IO port changes. | 681 | * IO port changes. |
681 | */ | 682 | */ |
682 | change_port = new_port != port->iobase || | 683 | change_port = !(port->flags & UPF_FIXED_PORT) |
683 | (unsigned long)new_serial.iomem_base != port->mapbase || | 684 | && (new_port != port->iobase || |
684 | new_serial.hub6 != port->hub6 || | 685 | (unsigned long)new_serial.iomem_base != port->mapbase || |
685 | new_serial.io_type != port->iotype || | 686 | new_serial.hub6 != port->hub6 || |
686 | new_serial.iomem_reg_shift != port->regshift || | 687 | new_serial.io_type != port->iotype || |
687 | new_serial.type != port->type; | 688 | new_serial.iomem_reg_shift != port->regshift || |
689 | new_serial.type != port->type); | ||
688 | 690 | ||
689 | old_flags = port->flags; | 691 | old_flags = port->flags; |
690 | new_flags = new_serial.flags; | 692 | new_flags = new_serial.flags; |
@@ -796,8 +798,10 @@ static int uart_set_info(struct uart_state *state, | |||
796 | } | 798 | } |
797 | } | 799 | } |
798 | 800 | ||
799 | port->irq = new_serial.irq; | 801 | if (change_irq) |
800 | port->uartclk = new_serial.baud_base * 16; | 802 | port->irq = new_serial.irq; |
803 | if (!(port->flags & UPF_FIXED_PORT)) | ||
804 | port->uartclk = new_serial.baud_base * 16; | ||
801 | port->flags = (port->flags & ~UPF_CHANGE_MASK) | | 805 | port->flags = (port->flags & ~UPF_CHANGE_MASK) | |
802 | (new_flags & UPF_CHANGE_MASK); | 806 | (new_flags & UPF_CHANGE_MASK); |
803 | port->custom_divisor = new_serial.custom_divisor; | 807 | port->custom_divisor = new_serial.custom_divisor; |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index d242c731491f..aadbfd30763f 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -263,6 +263,7 @@ struct uart_port { | |||
263 | #define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) | 263 | #define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) |
264 | #define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) | 264 | #define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) |
265 | #define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) | 265 | #define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) |
266 | #define UPF_FIXED_PORT ((__force upf_t) (1 << 29)) | ||
266 | #define UPF_DEAD ((__force upf_t) (1 << 30)) | 267 | #define UPF_DEAD ((__force upf_t) (1 << 30)) |
267 | #define UPF_IOREMAP ((__force upf_t) (1 << 31)) | 268 | #define UPF_IOREMAP ((__force upf_t) (1 << 31)) |
268 | 269 | ||