Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54166
b: refs/heads/master
c: abb4a23
h: refs/heads/master
v: v3
  • Loading branch information
David Gibson authored and Linus Torvalds committed May 7, 2007
1 parent 41f51e5 commit 7b40ff2
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bd71c182d5a02337305fc381831c11029dd17d64
refs/heads/master: abb4a2390737867353ebafc012d45f2b03f3f944
3 changes: 2 additions & 1 deletion trunk/arch/powerpc/kernel/legacy_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ static int __init add_legacy_soc_port(struct device_node *np,
{
u64 addr;
const u32 *addrp;
upf_t flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ;
upf_t flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ
| UPF_FIXED_PORT;
struct device_node *tsi = of_get_parent(np);

/* We only support ports that have a clock frequency properly
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/serial/of_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ static int __devinit of_platform_serial_setup(struct of_device *ofdev,
port->iotype = UPIO_MEM;
port->type = type;
port->uartclk = *clk;
port->flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_IOREMAP;
port->flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_IOREMAP
| UPF_FIXED_PORT;
port->dev = &ofdev->dev;
port->custom_divisor = *clk / (16 * (*spd));

Expand Down
22 changes: 13 additions & 9 deletions trunk/drivers/serial/serial_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,19 +672,21 @@ static int uart_set_info(struct uart_state *state,
*/
mutex_lock(&state->mutex);

change_irq = new_serial.irq != port->irq;
change_irq = !(port->flags & UPF_FIXED_PORT)
&& new_serial.irq != port->irq;

/*
* Since changing the 'type' of the port changes its resource
* allocations, we should treat type changes the same as
* IO port changes.
*/
change_port = new_port != port->iobase ||
(unsigned long)new_serial.iomem_base != port->mapbase ||
new_serial.hub6 != port->hub6 ||
new_serial.io_type != port->iotype ||
new_serial.iomem_reg_shift != port->regshift ||
new_serial.type != port->type;
change_port = !(port->flags & UPF_FIXED_PORT)
&& (new_port != port->iobase ||
(unsigned long)new_serial.iomem_base != port->mapbase ||
new_serial.hub6 != port->hub6 ||
new_serial.io_type != port->iotype ||
new_serial.iomem_reg_shift != port->regshift ||
new_serial.type != port->type);

old_flags = port->flags;
new_flags = new_serial.flags;
Expand Down Expand Up @@ -796,8 +798,10 @@ static int uart_set_info(struct uart_state *state,
}
}

port->irq = new_serial.irq;
port->uartclk = new_serial.baud_base * 16;
if (change_irq)
port->irq = new_serial.irq;
if (!(port->flags & UPF_FIXED_PORT))
port->uartclk = new_serial.baud_base * 16;
port->flags = (port->flags & ~UPF_CHANGE_MASK) |
(new_flags & UPF_CHANGE_MASK);
port->custom_divisor = new_serial.custom_divisor;
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/serial_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ struct uart_port {
#define UPF_CONS_FLOW ((__force upf_t) (1 << 23))
#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24))
#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28))
#define UPF_FIXED_PORT ((__force upf_t) (1 << 29))
#define UPF_DEAD ((__force upf_t) (1 << 30))
#define UPF_IOREMAP ((__force upf_t) (1 << 31))

Expand Down

0 comments on commit 7b40ff2

Please sign in to comment.