diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/firmware/pcdp.c | 24 | ||||
| -rw-r--r-- | drivers/firmware/pcdp.h | 33 | ||||
| -rw-r--r-- | drivers/i2c/chips/atxp1.c | 2 | ||||
| -rw-r--r-- | drivers/net/arm/etherh.c | 16 | ||||
| -rw-r--r-- | drivers/serial/8250.c | 33 | ||||
| -rw-r--r-- | drivers/serial/Kconfig | 2 | ||||
| -rw-r--r-- | drivers/serial/au1x00_uart.c | 3 | ||||
| -rw-r--r-- | drivers/serial/ip22zilog.c | 13 | ||||
| -rw-r--r-- | drivers/serial/mpsc.c | 3 | ||||
| -rw-r--r-- | drivers/serial/pmac_zilog.c | 4 | ||||
| -rw-r--r-- | drivers/serial/pxa.c | 3 | ||||
| -rw-r--r-- | drivers/serial/serial_core.c | 28 | ||||
| -rw-r--r-- | drivers/serial/serial_txx9.c | 3 | ||||
| -rw-r--r-- | drivers/serial/sunsab.c | 7 | ||||
| -rw-r--r-- | drivers/serial/sunsu.c | 3 | ||||
| -rw-r--r-- | drivers/serial/sunzilog.c | 13 | 
16 files changed, 120 insertions, 70 deletions
| diff --git a/drivers/firmware/pcdp.c b/drivers/firmware/pcdp.c index 839b44a7e08b..53c95c0bbf46 100644 --- a/drivers/firmware/pcdp.c +++ b/drivers/firmware/pcdp.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/console.h> | 16 | #include <linux/console.h> | 
| 17 | #include <linux/efi.h> | 17 | #include <linux/efi.h> | 
| 18 | #include <linux/serial.h> | 18 | #include <linux/serial.h> | 
| 19 | #include <asm/vga.h> | ||
| 19 | #include "pcdp.h" | 20 | #include "pcdp.h" | 
| 20 | 21 | ||
| 21 | static int __init | 22 | static int __init | 
| @@ -40,10 +41,27 @@ setup_serial_console(struct pcdp_uart *uart) | |||
| 40 | } | 41 | } | 
| 41 | 42 | ||
| 42 | static int __init | 43 | static int __init | 
| 43 | setup_vga_console(struct pcdp_vga *vga) | 44 | setup_vga_console(struct pcdp_device *dev) | 
| 44 | { | 45 | { | 
| 45 | #if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE) | 46 | #if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE) | 
| 46 | if (efi_mem_type(0xA0000) == EFI_CONVENTIONAL_MEMORY) { | 47 | u8 *if_ptr; | 
| 48 | |||
| 49 | if_ptr = ((u8 *)dev + sizeof(struct pcdp_device)); | ||
| 50 | if (if_ptr[0] == PCDP_IF_PCI) { | ||
| 51 | struct pcdp_if_pci if_pci; | ||
| 52 | |||
| 53 | /* struct copy since ifptr might not be correctly aligned */ | ||
| 54 | |||
| 55 | memcpy(&if_pci, if_ptr, sizeof(if_pci)); | ||
| 56 | |||
| 57 | if (if_pci.trans & PCDP_PCI_TRANS_IOPORT) | ||
| 58 | vga_console_iobase = if_pci.ioport_tra; | ||
| 59 | |||
| 60 | if (if_pci.trans & PCDP_PCI_TRANS_MMIO) | ||
| 61 | vga_console_membase = if_pci.mmio_tra; | ||
| 62 | } | ||
| 63 | |||
| 64 | if (efi_mem_type(vga_console_membase + 0xA0000) == EFI_CONVENTIONAL_MEMORY) { | ||
| 47 | printk(KERN_ERR "PCDP: VGA selected, but frame buffer is not MMIO!\n"); | 65 | printk(KERN_ERR "PCDP: VGA selected, but frame buffer is not MMIO!\n"); | 
| 48 | return -ENODEV; | 66 | return -ENODEV; | 
| 49 | } | 67 | } | 
| @@ -95,7 +113,7 @@ efi_setup_pcdp_console(char *cmdline) | |||
| 95 | dev = (struct pcdp_device *) ((u8 *) dev + dev->length)) { | 113 | dev = (struct pcdp_device *) ((u8 *) dev + dev->length)) { | 
| 96 | if (dev->flags & PCDP_PRIMARY_CONSOLE) { | 114 | if (dev->flags & PCDP_PRIMARY_CONSOLE) { | 
| 97 | if (dev->type == PCDP_CONSOLE_VGA) { | 115 | if (dev->type == PCDP_CONSOLE_VGA) { | 
| 98 | return setup_vga_console((struct pcdp_vga *) dev); | 116 | return setup_vga_console(dev); | 
| 99 | } | 117 | } | 
| 100 | } | 118 | } | 
| 101 | } | 119 | } | 
| diff --git a/drivers/firmware/pcdp.h b/drivers/firmware/pcdp.h index 1dc7c88b7b4d..e72cc47de33b 100644 --- a/drivers/firmware/pcdp.h +++ b/drivers/firmware/pcdp.h | |||
| @@ -52,11 +52,34 @@ struct pcdp_uart { | |||
| 52 | u32 clock_rate; | 52 | u32 clock_rate; | 
| 53 | u8 pci_prog_intfc; | 53 | u8 pci_prog_intfc; | 
| 54 | u8 flags; | 54 | u8 flags; | 
| 55 | }; | 55 | } __attribute__((packed)); | 
| 56 | |||
| 57 | #define PCDP_IF_PCI 1 | ||
| 58 | |||
| 59 | /* pcdp_if_pci.trans */ | ||
| 60 | #define PCDP_PCI_TRANS_IOPORT 0x02 | ||
| 61 | #define PCDP_PCI_TRANS_MMIO 0x01 | ||
| 62 | |||
| 63 | struct pcdp_if_pci { | ||
| 64 | u8 interconnect; | ||
| 65 | u8 reserved; | ||
| 66 | u16 length; | ||
| 67 | u8 segment; | ||
| 68 | u8 bus; | ||
| 69 | u8 dev; | ||
| 70 | u8 fun; | ||
| 71 | u16 dev_id; | ||
| 72 | u16 vendor_id; | ||
| 73 | u32 acpi_interrupt; | ||
| 74 | u64 mmio_tra; | ||
| 75 | u64 ioport_tra; | ||
| 76 | u8 flags; | ||
| 77 | u8 trans; | ||
| 78 | } __attribute__((packed)); | ||
| 56 | 79 | ||
| 57 | struct pcdp_vga { | 80 | struct pcdp_vga { | 
| 58 | u8 count; /* address space descriptors */ | 81 | u8 count; /* address space descriptors */ | 
| 59 | }; | 82 | } __attribute__((packed)); | 
| 60 | 83 | ||
| 61 | /* pcdp_device.flags */ | 84 | /* pcdp_device.flags */ | 
| 62 | #define PCDP_PRIMARY_CONSOLE 1 | 85 | #define PCDP_PRIMARY_CONSOLE 1 | 
| @@ -66,7 +89,9 @@ struct pcdp_device { | |||
| 66 | u8 flags; | 89 | u8 flags; | 
| 67 | u16 length; | 90 | u16 length; | 
| 68 | u16 efi_index; | 91 | u16 efi_index; | 
| 69 | }; | 92 | /* next data is pcdp_if_pci or pcdp_if_acpi (not yet supported) */ | 
| 93 | /* next data is device specific type (currently only pcdp_vga) */ | ||
| 94 | } __attribute__((packed)); | ||
| 70 | 95 | ||
| 71 | struct pcdp { | 96 | struct pcdp { | 
| 72 | u8 signature[4]; | 97 | u8 signature[4]; | 
| @@ -81,4 +106,4 @@ struct pcdp { | |||
| 81 | u32 num_uarts; | 106 | u32 num_uarts; | 
| 82 | struct pcdp_uart uart[0]; /* actual size is num_uarts */ | 107 | struct pcdp_uart uart[0]; /* actual size is num_uarts */ | 
| 83 | /* remainder of table is pcdp_device structures */ | 108 | /* remainder of table is pcdp_device structures */ | 
| 84 | }; | 109 | } __attribute__((packed)); | 
| diff --git a/drivers/i2c/chips/atxp1.c b/drivers/i2c/chips/atxp1.c index 5c6597aa2c7f..0bcf82b4c07b 100644 --- a/drivers/i2c/chips/atxp1.c +++ b/drivers/i2c/chips/atxp1.c | |||
| @@ -144,7 +144,7 @@ static ssize_t atxp1_storevcore(struct device *dev, struct device_attribute *att | |||
| 144 | if (vid == cvid) | 144 | if (vid == cvid) | 
| 145 | return count; | 145 | return count; | 
| 146 | 146 | ||
| 147 | dev_info(dev, "Setting VCore to %d mV (0x%02x)\n", vcore, vid); | 147 | dev_dbg(dev, "Setting VCore to %d mV (0x%02x)\n", vcore, vid); | 
| 148 | 148 | ||
| 149 | /* Write every 25 mV step to increase stability */ | 149 | /* Write every 25 mV step to increase stability */ | 
| 150 | if (cvid > vid) { | 150 | if (cvid > vid) { | 
| diff --git a/drivers/net/arm/etherh.c b/drivers/net/arm/etherh.c index 2e28c201dcc0..942a2819576c 100644 --- a/drivers/net/arm/etherh.c +++ b/drivers/net/arm/etherh.c | |||
| @@ -68,7 +68,6 @@ struct etherh_priv { | |||
| 68 | void __iomem *dma_base; | 68 | void __iomem *dma_base; | 
| 69 | unsigned int id; | 69 | unsigned int id; | 
| 70 | void __iomem *ctrl_port; | 70 | void __iomem *ctrl_port; | 
| 71 | void __iomem *base; | ||
| 72 | unsigned char ctrl; | 71 | unsigned char ctrl; | 
| 73 | u32 supported; | 72 | u32 supported; | 
| 74 | }; | 73 | }; | 
| @@ -178,7 +177,7 @@ etherh_setif(struct net_device *dev) | |||
| 178 | switch (etherh_priv(dev)->id) { | 177 | switch (etherh_priv(dev)->id) { | 
| 179 | case PROD_I3_ETHERLAN600: | 178 | case PROD_I3_ETHERLAN600: | 
| 180 | case PROD_I3_ETHERLAN600A: | 179 | case PROD_I3_ETHERLAN600A: | 
| 181 | addr = etherh_priv(dev)->base + EN0_RCNTHI; | 180 | addr = (void *)dev->base_addr + EN0_RCNTHI; | 
| 182 | 181 | ||
| 183 | switch (dev->if_port) { | 182 | switch (dev->if_port) { | 
| 184 | case IF_PORT_10BASE2: | 183 | case IF_PORT_10BASE2: | 
| @@ -219,7 +218,7 @@ etherh_getifstat(struct net_device *dev) | |||
| 219 | switch (etherh_priv(dev)->id) { | 218 | switch (etherh_priv(dev)->id) { | 
| 220 | case PROD_I3_ETHERLAN600: | 219 | case PROD_I3_ETHERLAN600: | 
| 221 | case PROD_I3_ETHERLAN600A: | 220 | case PROD_I3_ETHERLAN600A: | 
| 222 | addr = etherh_priv(dev)->base + EN0_RCNTHI; | 221 | addr = (void *)dev->base_addr + EN0_RCNTHI; | 
| 223 | switch (dev->if_port) { | 222 | switch (dev->if_port) { | 
| 224 | case IF_PORT_10BASE2: | 223 | case IF_PORT_10BASE2: | 
| 225 | stat = 1; | 224 | stat = 1; | 
| @@ -282,7 +281,7 @@ static void | |||
| 282 | etherh_reset(struct net_device *dev) | 281 | etherh_reset(struct net_device *dev) | 
| 283 | { | 282 | { | 
| 284 | struct ei_device *ei_local = netdev_priv(dev); | 283 | struct ei_device *ei_local = netdev_priv(dev); | 
| 285 | void __iomem *addr = etherh_priv(dev)->base; | 284 | void __iomem *addr = (void *)dev->base_addr; | 
| 286 | 285 | ||
| 287 | writeb(E8390_NODMA+E8390_PAGE0+E8390_STOP, addr); | 286 | writeb(E8390_NODMA+E8390_PAGE0+E8390_STOP, addr); | 
| 288 | 287 | ||
| @@ -328,7 +327,7 @@ etherh_block_output (struct net_device *dev, int count, const unsigned char *buf | |||
| 328 | 327 | ||
| 329 | ei_local->dmaing = 1; | 328 | ei_local->dmaing = 1; | 
| 330 | 329 | ||
| 331 | addr = etherh_priv(dev)->base; | 330 | addr = (void *)dev->base_addr; | 
| 332 | dma_base = etherh_priv(dev)->dma_base; | 331 | dma_base = etherh_priv(dev)->dma_base; | 
| 333 | 332 | ||
| 334 | count = (count + 1) & ~1; | 333 | count = (count + 1) & ~1; | 
| @@ -388,7 +387,7 @@ etherh_block_input (struct net_device *dev, int count, struct sk_buff *skb, int | |||
| 388 | 387 | ||
| 389 | ei_local->dmaing = 1; | 388 | ei_local->dmaing = 1; | 
| 390 | 389 | ||
| 391 | addr = etherh_priv(dev)->base; | 390 | addr = (void *)dev->base_addr; | 
| 392 | dma_base = etherh_priv(dev)->dma_base; | 391 | dma_base = etherh_priv(dev)->dma_base; | 
| 393 | 392 | ||
| 394 | buf = skb->data; | 393 | buf = skb->data; | 
| @@ -428,7 +427,7 @@ etherh_get_header (struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_p | |||
| 428 | 427 | ||
| 429 | ei_local->dmaing = 1; | 428 | ei_local->dmaing = 1; | 
| 430 | 429 | ||
| 431 | addr = etherh_priv(dev)->base; | 430 | addr = (void *)dev->base_addr; | 
| 432 | dma_base = etherh_priv(dev)->dma_base; | 431 | dma_base = etherh_priv(dev)->dma_base; | 
| 433 | 432 | ||
| 434 | writeb (E8390_NODMA | E8390_PAGE0 | E8390_START, addr + E8390_CMD); | 433 | writeb (E8390_NODMA | E8390_PAGE0 | E8390_START, addr + E8390_CMD); | 
| @@ -697,8 +696,7 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
| 697 | eh->ctrl_port = eh->ioc_fast; | 696 | eh->ctrl_port = eh->ioc_fast; | 
| 698 | } | 697 | } | 
| 699 | 698 | ||
| 700 | eh->base = eh->memc + data->ns8390_offset; | 699 | dev->base_addr = (unsigned long)eh->memc + data->ns8390_offset; | 
| 701 | dev->base_addr = (unsigned long)eh->base; | ||
| 702 | eh->dma_base = eh->memc + data->dataport_offset; | 700 | eh->dma_base = eh->memc + data->dataport_offset; | 
| 703 | eh->ctrl_port += data->ctrlport_offset; | 701 | eh->ctrl_port += data->ctrlport_offset; | 
| 704 | 702 | ||
| diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 34e75bc8f4cc..9224fc3184ea 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
| @@ -105,7 +105,7 @@ static struct old_serial_port old_serial_port[] = { | |||
| 105 | SERIAL_PORT_DFNS /* defined in asm/serial.h */ | 105 | SERIAL_PORT_DFNS /* defined in asm/serial.h */ | 
| 106 | }; | 106 | }; | 
| 107 | 107 | ||
| 108 | #define UART_NR (ARRAY_SIZE(old_serial_port) + CONFIG_SERIAL_8250_NR_UARTS) | 108 | #define UART_NR CONFIG_SERIAL_8250_NR_UARTS | 
| 109 | 109 | ||
| 110 | #ifdef CONFIG_SERIAL_8250_RSA | 110 | #ifdef CONFIG_SERIAL_8250_RSA | 
| 111 | 111 | ||
| @@ -993,21 +993,24 @@ static void autoconfig_irq(struct uart_8250_port *up) | |||
| 993 | up->port.irq = (irq > 0) ? irq : 0; | 993 | up->port.irq = (irq > 0) ? irq : 0; | 
| 994 | } | 994 | } | 
| 995 | 995 | ||
| 996 | static inline void __stop_tx(struct uart_8250_port *p) | ||
| 997 | { | ||
| 998 | if (p->ier & UART_IER_THRI) { | ||
| 999 | p->ier &= ~UART_IER_THRI; | ||
| 1000 | serial_out(p, UART_IER, p->ier); | ||
| 1001 | } | ||
| 1002 | } | ||
| 1003 | |||
| 996 | static void serial8250_stop_tx(struct uart_port *port, unsigned int tty_stop) | 1004 | static void serial8250_stop_tx(struct uart_port *port, unsigned int tty_stop) | 
| 997 | { | 1005 | { | 
| 998 | struct uart_8250_port *up = (struct uart_8250_port *)port; | 1006 | struct uart_8250_port *up = (struct uart_8250_port *)port; | 
| 999 | 1007 | ||
| 1000 | if (up->ier & UART_IER_THRI) { | 1008 | __stop_tx(up); | 
| 1001 | up->ier &= ~UART_IER_THRI; | ||
| 1002 | serial_out(up, UART_IER, up->ier); | ||
| 1003 | } | ||
| 1004 | 1009 | ||
| 1005 | /* | 1010 | /* | 
| 1006 | * We only do this from uart_stop - if we run out of | 1011 | * We really want to stop the transmitter from sending. | 
| 1007 | * characters to send, we don't want to prevent the | ||
| 1008 | * FIFO from emptying. | ||
| 1009 | */ | 1012 | */ | 
| 1010 | if (up->port.type == PORT_16C950 && tty_stop) { | 1013 | if (up->port.type == PORT_16C950) { | 
| 1011 | up->acr |= UART_ACR_TXDIS; | 1014 | up->acr |= UART_ACR_TXDIS; | 
| 1012 | serial_icr_write(up, UART_ACR, up->acr); | 1015 | serial_icr_write(up, UART_ACR, up->acr); | 
| 1013 | } | 1016 | } | 
| @@ -1031,10 +1034,11 @@ static void serial8250_start_tx(struct uart_port *port, unsigned int tty_start) | |||
| 1031 | transmit_chars(up); | 1034 | transmit_chars(up); | 
| 1032 | } | 1035 | } | 
| 1033 | } | 1036 | } | 
| 1037 | |||
| 1034 | /* | 1038 | /* | 
| 1035 | * We only do this from uart_start | 1039 | * Re-enable the transmitter if we disabled it. | 
| 1036 | */ | 1040 | */ | 
| 1037 | if (tty_start && up->port.type == PORT_16C950) { | 1041 | if (up->port.type == PORT_16C950 && up->acr & UART_ACR_TXDIS) { | 
| 1038 | up->acr &= ~UART_ACR_TXDIS; | 1042 | up->acr &= ~UART_ACR_TXDIS; | 
| 1039 | serial_icr_write(up, UART_ACR, up->acr); | 1043 | serial_icr_write(up, UART_ACR, up->acr); | 
| 1040 | } | 1044 | } | 
| @@ -1155,7 +1159,7 @@ static _INLINE_ void transmit_chars(struct uart_8250_port *up) | |||
| 1155 | return; | 1159 | return; | 
| 1156 | } | 1160 | } | 
| 1157 | if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) { | 1161 | if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) { | 
| 1158 | serial8250_stop_tx(&up->port, 0); | 1162 | __stop_tx(up); | 
| 1159 | return; | 1163 | return; | 
| 1160 | } | 1164 | } | 
| 1161 | 1165 | ||
| @@ -1174,7 +1178,7 @@ static _INLINE_ void transmit_chars(struct uart_8250_port *up) | |||
| 1174 | DEBUG_INTR("THRE..."); | 1178 | DEBUG_INTR("THRE..."); | 
| 1175 | 1179 | ||
| 1176 | if (uart_circ_empty(xmit)) | 1180 | if (uart_circ_empty(xmit)) | 
| 1177 | serial8250_stop_tx(&up->port, 0); | 1181 | __stop_tx(up); | 
| 1178 | } | 1182 | } | 
| 1179 | 1183 | ||
| 1180 | static _INLINE_ void check_modem_status(struct uart_8250_port *up) | 1184 | static _INLINE_ void check_modem_status(struct uart_8250_port *up) | 
| @@ -1376,13 +1380,10 @@ static unsigned int serial8250_tx_empty(struct uart_port *port) | |||
| 1376 | static unsigned int serial8250_get_mctrl(struct uart_port *port) | 1380 | static unsigned int serial8250_get_mctrl(struct uart_port *port) | 
| 1377 | { | 1381 | { | 
| 1378 | struct uart_8250_port *up = (struct uart_8250_port *)port; | 1382 | struct uart_8250_port *up = (struct uart_8250_port *)port; | 
| 1379 | unsigned long flags; | ||
| 1380 | unsigned char status; | 1383 | unsigned char status; | 
| 1381 | unsigned int ret; | 1384 | unsigned int ret; | 
| 1382 | 1385 | ||
| 1383 | spin_lock_irqsave(&up->port.lock, flags); | ||
| 1384 | status = serial_in(up, UART_MSR); | 1386 | status = serial_in(up, UART_MSR); | 
| 1385 | spin_unlock_irqrestore(&up->port.lock, flags); | ||
| 1386 | 1387 | ||
| 1387 | ret = 0; | 1388 | ret = 0; | 
| 1388 | if (status & UART_MSR_DCD) | 1389 | if (status & UART_MSR_DCD) | 
| diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index e879bce160df..e0d0a470ddfc 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig | |||
| @@ -86,7 +86,7 @@ config SERIAL_8250_ACPI | |||
| 86 | namespace, say Y here. If unsure, say N. | 86 | namespace, say Y here. If unsure, say N. | 
| 87 | 87 | ||
| 88 | config SERIAL_8250_NR_UARTS | 88 | config SERIAL_8250_NR_UARTS | 
| 89 | int "Maximum number of non-legacy 8250/16550 serial ports" | 89 | int "Maximum number of 8250/16550 serial ports" | 
| 90 | depends on SERIAL_8250 | 90 | depends on SERIAL_8250 | 
| 91 | default "4" | 91 | default "4" | 
| 92 | help | 92 | help | 
| diff --git a/drivers/serial/au1x00_uart.c b/drivers/serial/au1x00_uart.c index 5400dc2c087e..6104aeef1243 100644 --- a/drivers/serial/au1x00_uart.c +++ b/drivers/serial/au1x00_uart.c | |||
| @@ -556,13 +556,10 @@ static unsigned int serial8250_tx_empty(struct uart_port *port) | |||
| 556 | static unsigned int serial8250_get_mctrl(struct uart_port *port) | 556 | static unsigned int serial8250_get_mctrl(struct uart_port *port) | 
| 557 | { | 557 | { | 
| 558 | struct uart_8250_port *up = (struct uart_8250_port *)port; | 558 | struct uart_8250_port *up = (struct uart_8250_port *)port; | 
| 559 | unsigned long flags; | ||
| 560 | unsigned char status; | 559 | unsigned char status; | 
| 561 | unsigned int ret; | 560 | unsigned int ret; | 
| 562 | 561 | ||
| 563 | spin_lock_irqsave(&up->port.lock, flags); | ||
| 564 | status = serial_in(up, UART_MSR); | 562 | status = serial_in(up, UART_MSR); | 
| 565 | spin_unlock_irqrestore(&up->port.lock, flags); | ||
| 566 | 563 | ||
| 567 | ret = 0; | 564 | ret = 0; | 
| 568 | if (status & UART_MSR_DCD) | 565 | if (status & UART_MSR_DCD) | 
| diff --git a/drivers/serial/ip22zilog.c b/drivers/serial/ip22zilog.c index 3ea46c069f6f..ea5bf4d4daa3 100644 --- a/drivers/serial/ip22zilog.c +++ b/drivers/serial/ip22zilog.c | |||
| @@ -518,27 +518,28 @@ static irqreturn_t ip22zilog_interrupt(int irq, void *dev_id, struct pt_regs *re | |||
| 518 | static __inline__ unsigned char ip22zilog_read_channel_status(struct uart_port *port) | 518 | static __inline__ unsigned char ip22zilog_read_channel_status(struct uart_port *port) | 
| 519 | { | 519 | { | 
| 520 | struct zilog_channel *channel; | 520 | struct zilog_channel *channel; | 
| 521 | unsigned long flags; | ||
| 522 | unsigned char status; | 521 | unsigned char status; | 
| 523 | 522 | ||
| 524 | spin_lock_irqsave(&port->lock, flags); | ||
| 525 | |||
| 526 | channel = ZILOG_CHANNEL_FROM_PORT(port); | 523 | channel = ZILOG_CHANNEL_FROM_PORT(port); | 
| 527 | status = readb(&channel->control); | 524 | status = readb(&channel->control); | 
| 528 | ZSDELAY(); | 525 | ZSDELAY(); | 
| 529 | 526 | ||
| 530 | spin_unlock_irqrestore(&port->lock, flags); | ||
| 531 | |||
| 532 | return status; | 527 | return status; | 
| 533 | } | 528 | } | 
| 534 | 529 | ||
| 535 | /* The port lock is not held. */ | 530 | /* The port lock is not held. */ | 
| 536 | static unsigned int ip22zilog_tx_empty(struct uart_port *port) | 531 | static unsigned int ip22zilog_tx_empty(struct uart_port *port) | 
| 537 | { | 532 | { | 
| 533 | unsigned long flags; | ||
| 538 | unsigned char status; | 534 | unsigned char status; | 
| 539 | unsigned int ret; | 535 | unsigned int ret; | 
| 540 | 536 | ||
| 537 | spin_lock_irqsave(&port->lock, flags); | ||
| 538 | |||
| 541 | status = ip22zilog_read_channel_status(port); | 539 | status = ip22zilog_read_channel_status(port); | 
| 540 | |||
| 541 | spin_unlock_irqrestore(&port->lock, flags); | ||
| 542 | |||
| 542 | if (status & Tx_BUF_EMP) | 543 | if (status & Tx_BUF_EMP) | 
| 543 | ret = TIOCSER_TEMT; | 544 | ret = TIOCSER_TEMT; | 
| 544 | else | 545 | else | 
| @@ -547,7 +548,7 @@ static unsigned int ip22zilog_tx_empty(struct uart_port *port) | |||
| 547 | return ret; | 548 | return ret; | 
| 548 | } | 549 | } | 
| 549 | 550 | ||
| 550 | /* The port lock is not held. */ | 551 | /* The port lock is held and interrupts are disabled. */ | 
| 551 | static unsigned int ip22zilog_get_mctrl(struct uart_port *port) | 552 | static unsigned int ip22zilog_get_mctrl(struct uart_port *port) | 
| 552 | { | 553 | { | 
| 553 | unsigned char status; | 554 | unsigned char status; | 
| diff --git a/drivers/serial/mpsc.c b/drivers/serial/mpsc.c index a2a643318002..e43276c6a954 100644 --- a/drivers/serial/mpsc.c +++ b/drivers/serial/mpsc.c | |||
| @@ -1058,12 +1058,9 @@ mpsc_get_mctrl(struct uart_port *port) | |||
| 1058 | { | 1058 | { | 
| 1059 | struct mpsc_port_info *pi = (struct mpsc_port_info *)port; | 1059 | struct mpsc_port_info *pi = (struct mpsc_port_info *)port; | 
| 1060 | u32 mflags, status; | 1060 | u32 mflags, status; | 
| 1061 | ulong iflags; | ||
| 1062 | 1061 | ||
| 1063 | spin_lock_irqsave(&pi->port.lock, iflags); | ||
| 1064 | status = (pi->mirror_regs) ? pi->MPSC_CHR_10_m : | 1062 | status = (pi->mirror_regs) ? pi->MPSC_CHR_10_m : | 
| 1065 | readl(pi->mpsc_base + MPSC_CHR_10); | 1063 | readl(pi->mpsc_base + MPSC_CHR_10); | 
| 1066 | spin_unlock_irqrestore(&pi->port.lock, iflags); | ||
| 1067 | 1064 | ||
| 1068 | mflags = 0; | 1065 | mflags = 0; | 
| 1069 | if (status & 0x1) | 1066 | if (status & 0x1) | 
| diff --git a/drivers/serial/pmac_zilog.c b/drivers/serial/pmac_zilog.c index 85abd8a045e0..1c9f71617123 100644 --- a/drivers/serial/pmac_zilog.c +++ b/drivers/serial/pmac_zilog.c | |||
| @@ -604,7 +604,7 @@ static void pmz_set_mctrl(struct uart_port *port, unsigned int mctrl) | |||
| 604 | /* | 604 | /* | 
| 605 | * Get Modem Control bits (only the input ones, the core will | 605 | * Get Modem Control bits (only the input ones, the core will | 
| 606 | * or that with a cached value of the control ones) | 606 | * or that with a cached value of the control ones) | 
| 607 | * The port lock is not held. | 607 | * The port lock is held and interrupts are disabled. | 
| 608 | */ | 608 | */ | 
| 609 | static unsigned int pmz_get_mctrl(struct uart_port *port) | 609 | static unsigned int pmz_get_mctrl(struct uart_port *port) | 
| 610 | { | 610 | { | 
| @@ -615,7 +615,7 @@ static unsigned int pmz_get_mctrl(struct uart_port *port) | |||
| 615 | if (ZS_IS_ASLEEP(uap) || uap->node == NULL) | 615 | if (ZS_IS_ASLEEP(uap) || uap->node == NULL) | 
| 616 | return 0; | 616 | return 0; | 
| 617 | 617 | ||
| 618 | status = pmz_peek_status(to_pmz(port)); | 618 | status = read_zsreg(uap, R0); | 
| 619 | 619 | ||
| 620 | ret = 0; | 620 | ret = 0; | 
| 621 | if (status & DCD) | 621 | if (status & DCD) | 
| diff --git a/drivers/serial/pxa.c b/drivers/serial/pxa.c index 08b08d6ae904..461c81c93207 100644 --- a/drivers/serial/pxa.c +++ b/drivers/serial/pxa.c | |||
| @@ -274,14 +274,11 @@ static unsigned int serial_pxa_tx_empty(struct uart_port *port) | |||
| 274 | static unsigned int serial_pxa_get_mctrl(struct uart_port *port) | 274 | static unsigned int serial_pxa_get_mctrl(struct uart_port *port) | 
| 275 | { | 275 | { | 
| 276 | struct uart_pxa_port *up = (struct uart_pxa_port *)port; | 276 | struct uart_pxa_port *up = (struct uart_pxa_port *)port; | 
| 277 | unsigned long flags; | ||
| 278 | unsigned char status; | 277 | unsigned char status; | 
| 279 | unsigned int ret; | 278 | unsigned int ret; | 
| 280 | 279 | ||
| 281 | return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR; | 280 | return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR; | 
| 282 | spin_lock_irqsave(&up->port.lock, flags); | ||
| 283 | status = serial_in(up, UART_MSR); | 281 | status = serial_in(up, UART_MSR); | 
| 284 | spin_unlock_irqrestore(&up->port.lock, flags); | ||
| 285 | 282 | ||
| 286 | ret = 0; | 283 | ret = 0; | 
| 287 | if (status & UART_MSR_DCD) | 284 | if (status & UART_MSR_DCD) | 
| diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 36b1ae083fb7..139863a787f3 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c | |||
| @@ -182,6 +182,13 @@ static int uart_startup(struct uart_state *state, int init_hw) | |||
| 182 | uart_set_mctrl(port, TIOCM_RTS | TIOCM_DTR); | 182 | uart_set_mctrl(port, TIOCM_RTS | TIOCM_DTR); | 
| 183 | } | 183 | } | 
| 184 | 184 | ||
| 185 | if (info->flags & UIF_CTS_FLOW) { | ||
| 186 | spin_lock_irq(&port->lock); | ||
| 187 | if (!(port->ops->get_mctrl(port) & TIOCM_CTS)) | ||
| 188 | info->tty->hw_stopped = 1; | ||
| 189 | spin_unlock_irq(&port->lock); | ||
| 190 | } | ||
| 191 | |||
| 185 | info->flags |= UIF_INITIALIZED; | 192 | info->flags |= UIF_INITIALIZED; | 
| 186 | 193 | ||
| 187 | clear_bit(TTY_IO_ERROR, &info->tty->flags); | 194 | clear_bit(TTY_IO_ERROR, &info->tty->flags); | 
| @@ -828,7 +835,10 @@ static int uart_tiocmget(struct tty_struct *tty, struct file *file) | |||
| 828 | if ((!file || !tty_hung_up_p(file)) && | 835 | if ((!file || !tty_hung_up_p(file)) && | 
| 829 | !(tty->flags & (1 << TTY_IO_ERROR))) { | 836 | !(tty->flags & (1 << TTY_IO_ERROR))) { | 
| 830 | result = port->mctrl; | 837 | result = port->mctrl; | 
| 838 | |||
| 839 | spin_lock_irq(&port->lock); | ||
| 831 | result |= port->ops->get_mctrl(port); | 840 | result |= port->ops->get_mctrl(port); | 
| 841 | spin_unlock_irq(&port->lock); | ||
| 832 | } | 842 | } | 
| 833 | up(&state->sem); | 843 | up(&state->sem); | 
| 834 | 844 | ||
| @@ -1131,6 +1141,16 @@ static void uart_set_termios(struct tty_struct *tty, struct termios *old_termios | |||
| 1131 | spin_unlock_irqrestore(&state->port->lock, flags); | 1141 | spin_unlock_irqrestore(&state->port->lock, flags); | 
| 1132 | } | 1142 | } | 
| 1133 | 1143 | ||
| 1144 | /* Handle turning on CRTSCTS */ | ||
| 1145 | if (!(old_termios->c_cflag & CRTSCTS) && (cflag & CRTSCTS)) { | ||
| 1146 | spin_lock_irqsave(&state->port->lock, flags); | ||
| 1147 | if (!(state->port->ops->get_mctrl(state->port) & TIOCM_CTS)) { | ||
| 1148 | tty->hw_stopped = 1; | ||
| 1149 | state->port->ops->stop_tx(state->port, 0); | ||
| 1150 | } | ||
| 1151 | spin_unlock_irqrestore(&state->port->lock, flags); | ||
| 1152 | } | ||
| 1153 | |||
| 1134 | #if 0 | 1154 | #if 0 | 
| 1135 | /* | 1155 | /* | 
| 1136 | * No need to wake up processes in open wait, since they | 1156 | * No need to wake up processes in open wait, since they | 
| @@ -1369,6 +1389,7 @@ uart_block_til_ready(struct file *filp, struct uart_state *state) | |||
| 1369 | DECLARE_WAITQUEUE(wait, current); | 1389 | DECLARE_WAITQUEUE(wait, current); | 
| 1370 | struct uart_info *info = state->info; | 1390 | struct uart_info *info = state->info; | 
| 1371 | struct uart_port *port = state->port; | 1391 | struct uart_port *port = state->port; | 
| 1392 | unsigned int mctrl; | ||
| 1372 | 1393 | ||
| 1373 | info->blocked_open++; | 1394 | info->blocked_open++; | 
| 1374 | state->count--; | 1395 | state->count--; | 
| @@ -1416,7 +1437,10 @@ uart_block_til_ready(struct file *filp, struct uart_state *state) | |||
| 1416 | * and wait for the carrier to indicate that the | 1437 | * and wait for the carrier to indicate that the | 
| 1417 | * modem is ready for us. | 1438 | * modem is ready for us. | 
| 1418 | */ | 1439 | */ | 
| 1419 | if (port->ops->get_mctrl(port) & TIOCM_CAR) | 1440 | spin_lock_irq(&port->lock); | 
| 1441 | mctrl = port->ops->get_mctrl(port); | ||
| 1442 | spin_unlock_irq(&port->lock); | ||
| 1443 | if (mctrl & TIOCM_CAR) | ||
| 1420 | break; | 1444 | break; | 
| 1421 | 1445 | ||
| 1422 | up(&state->sem); | 1446 | up(&state->sem); | 
| @@ -1618,7 +1642,9 @@ static int uart_line_info(char *buf, struct uart_driver *drv, int i) | |||
| 1618 | 1642 | ||
| 1619 | if(capable(CAP_SYS_ADMIN)) | 1643 | if(capable(CAP_SYS_ADMIN)) | 
| 1620 | { | 1644 | { | 
| 1645 | spin_lock_irq(&port->lock); | ||
| 1621 | status = port->ops->get_mctrl(port); | 1646 | status = port->ops->get_mctrl(port); | 
| 1647 | spin_unlock_irq(&port->lock); | ||
| 1622 | 1648 | ||
| 1623 | ret += sprintf(buf + ret, " tx:%d rx:%d", | 1649 | ret += sprintf(buf + ret, " tx:%d rx:%d", | 
| 1624 | port->icount.tx, port->icount.rx); | 1650 | port->icount.tx, port->icount.rx); | 
| diff --git a/drivers/serial/serial_txx9.c b/drivers/serial/serial_txx9.c index 3f1051a4a13f..d085030df70b 100644 --- a/drivers/serial/serial_txx9.c +++ b/drivers/serial/serial_txx9.c | |||
| @@ -442,13 +442,10 @@ static unsigned int serial_txx9_tx_empty(struct uart_port *port) | |||
| 442 | static unsigned int serial_txx9_get_mctrl(struct uart_port *port) | 442 | static unsigned int serial_txx9_get_mctrl(struct uart_port *port) | 
| 443 | { | 443 | { | 
| 444 | struct uart_txx9_port *up = (struct uart_txx9_port *)port; | 444 | struct uart_txx9_port *up = (struct uart_txx9_port *)port; | 
| 445 | unsigned long flags; | ||
| 446 | unsigned int ret; | 445 | unsigned int ret; | 
| 447 | 446 | ||
| 448 | spin_lock_irqsave(&up->port.lock, flags); | ||
| 449 | ret = ((sio_in(up, TXX9_SIFLCR) & TXX9_SIFLCR_RTSSC) ? 0 : TIOCM_RTS) | 447 | ret = ((sio_in(up, TXX9_SIFLCR) & TXX9_SIFLCR_RTSSC) ? 0 : TIOCM_RTS) | 
| 450 | | ((sio_in(up, TXX9_SICISR) & TXX9_SICISR_CTSS) ? 0 : TIOCM_CTS); | 448 | | ((sio_in(up, TXX9_SICISR) & TXX9_SICISR_CTSS) ? 0 : TIOCM_CTS); | 
| 451 | spin_unlock_irqrestore(&up->port.lock, flags); | ||
| 452 | 449 | ||
| 453 | return ret; | 450 | return ret; | 
| 454 | } | 451 | } | 
| diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c index 10e2990a40d4..8d198880756a 100644 --- a/drivers/serial/sunsab.c +++ b/drivers/serial/sunsab.c | |||
| @@ -426,18 +426,15 @@ static void sunsab_set_mctrl(struct uart_port *port, unsigned int mctrl) | |||
| 426 | sunsab_tx_idle(up); | 426 | sunsab_tx_idle(up); | 
| 427 | } | 427 | } | 
| 428 | 428 | ||
| 429 | /* port->lock is not held. */ | 429 | /* port->lock is held by caller and interrupts are disabled. */ | 
| 430 | static unsigned int sunsab_get_mctrl(struct uart_port *port) | 430 | static unsigned int sunsab_get_mctrl(struct uart_port *port) | 
| 431 | { | 431 | { | 
| 432 | struct uart_sunsab_port *up = (struct uart_sunsab_port *) port; | 432 | struct uart_sunsab_port *up = (struct uart_sunsab_port *) port; | 
| 433 | unsigned long flags; | ||
| 434 | unsigned char val; | 433 | unsigned char val; | 
| 435 | unsigned int result; | 434 | unsigned int result; | 
| 436 | 435 | ||
| 437 | result = 0; | 436 | result = 0; | 
| 438 | 437 | ||
| 439 | spin_lock_irqsave(&up->port.lock, flags); | ||
| 440 | |||
| 441 | val = readb(&up->regs->r.pvr); | 438 | val = readb(&up->regs->r.pvr); | 
| 442 | result |= (val & up->pvr_dsr_bit) ? 0 : TIOCM_DSR; | 439 | result |= (val & up->pvr_dsr_bit) ? 0 : TIOCM_DSR; | 
| 443 | 440 | ||
| @@ -447,8 +444,6 @@ static unsigned int sunsab_get_mctrl(struct uart_port *port) | |||
| 447 | val = readb(&up->regs->r.star); | 444 | val = readb(&up->regs->r.star); | 
| 448 | result |= (val & SAB82532_STAR_CTS) ? TIOCM_CTS : 0; | 445 | result |= (val & SAB82532_STAR_CTS) ? TIOCM_CTS : 0; | 
| 449 | 446 | ||
| 450 | spin_unlock_irqrestore(&up->port.lock, flags); | ||
| 451 | |||
| 452 | return result; | 447 | return result; | 
| 453 | } | 448 | } | 
| 454 | 449 | ||
| diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c index ddc97c905e14..d57a3553aea3 100644 --- a/drivers/serial/sunsu.c +++ b/drivers/serial/sunsu.c | |||
| @@ -572,13 +572,10 @@ static unsigned int sunsu_tx_empty(struct uart_port *port) | |||
| 572 | static unsigned int sunsu_get_mctrl(struct uart_port *port) | 572 | static unsigned int sunsu_get_mctrl(struct uart_port *port) | 
| 573 | { | 573 | { | 
| 574 | struct uart_sunsu_port *up = (struct uart_sunsu_port *) port; | 574 | struct uart_sunsu_port *up = (struct uart_sunsu_port *) port; | 
| 575 | unsigned long flags; | ||
| 576 | unsigned char status; | 575 | unsigned char status; | 
| 577 | unsigned int ret; | 576 | unsigned int ret; | 
| 578 | 577 | ||
| 579 | spin_lock_irqsave(&up->port.lock, flags); | ||
| 580 | status = serial_in(up, UART_MSR); | 578 | status = serial_in(up, UART_MSR); | 
| 581 | spin_unlock_irqrestore(&up->port.lock, flags); | ||
| 582 | 579 | ||
| 583 | ret = 0; | 580 | ret = 0; | 
| 584 | if (status & UART_MSR_DCD) | 581 | if (status & UART_MSR_DCD) | 
| diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c index 8e65206d3d76..bff42a7b89d0 100644 --- a/drivers/serial/sunzilog.c +++ b/drivers/serial/sunzilog.c | |||
| @@ -610,27 +610,28 @@ static irqreturn_t sunzilog_interrupt(int irq, void *dev_id, struct pt_regs *reg | |||
| 610 | static __inline__ unsigned char sunzilog_read_channel_status(struct uart_port *port) | 610 | static __inline__ unsigned char sunzilog_read_channel_status(struct uart_port *port) | 
| 611 | { | 611 | { | 
| 612 | struct zilog_channel __iomem *channel; | 612 | struct zilog_channel __iomem *channel; | 
| 613 | unsigned long flags; | ||
| 614 | unsigned char status; | 613 | unsigned char status; | 
| 615 | 614 | ||
| 616 | spin_lock_irqsave(&port->lock, flags); | ||
| 617 | |||
| 618 | channel = ZILOG_CHANNEL_FROM_PORT(port); | 615 | channel = ZILOG_CHANNEL_FROM_PORT(port); | 
| 619 | status = sbus_readb(&channel->control); | 616 | status = sbus_readb(&channel->control); | 
| 620 | ZSDELAY(); | 617 | ZSDELAY(); | 
| 621 | 618 | ||
| 622 | spin_unlock_irqrestore(&port->lock, flags); | ||
| 623 | |||
| 624 | return status; | 619 | return status; | 
| 625 | } | 620 | } | 
| 626 | 621 | ||
| 627 | /* The port lock is not held. */ | 622 | /* The port lock is not held. */ | 
| 628 | static unsigned int sunzilog_tx_empty(struct uart_port *port) | 623 | static unsigned int sunzilog_tx_empty(struct uart_port *port) | 
| 629 | { | 624 | { | 
| 625 | unsigned long flags; | ||
| 630 | unsigned char status; | 626 | unsigned char status; | 
| 631 | unsigned int ret; | 627 | unsigned int ret; | 
| 632 | 628 | ||
| 629 | spin_lock_irqsave(&port->lock, flags); | ||
| 630 | |||
| 633 | status = sunzilog_read_channel_status(port); | 631 | status = sunzilog_read_channel_status(port); | 
| 632 | |||
| 633 | spin_unlock_irqrestore(&port->lock, flags); | ||
| 634 | |||
| 634 | if (status & Tx_BUF_EMP) | 635 | if (status & Tx_BUF_EMP) | 
| 635 | ret = TIOCSER_TEMT; | 636 | ret = TIOCSER_TEMT; | 
| 636 | else | 637 | else | 
| @@ -639,7 +640,7 @@ static unsigned int sunzilog_tx_empty(struct uart_port *port) | |||
| 639 | return ret; | 640 | return ret; | 
| 640 | } | 641 | } | 
| 641 | 642 | ||
| 642 | /* The port lock is not held. */ | 643 | /* The port lock is held and interrupts are disabled. */ | 
| 643 | static unsigned int sunzilog_get_mctrl(struct uart_port *port) | 644 | static unsigned int sunzilog_get_mctrl(struct uart_port *port) | 
| 644 | { | 645 | { | 
| 645 | unsigned char status; | 646 | unsigned char status; | 
