~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to arch/mn10300/kernel/mn10300-serial.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno
  • Date: 2011-06-07 12:14:05 UTC
  • mfrom: (43.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110607121405-i3h1rd7nrnd2b73h
Tags: 2.6.39-2
[ Ben Hutchings ]
* [x86] Enable BACKLIGHT_APPLE, replacing BACKLIGHT_MBP_NVIDIA
  (Closes: #627492)
* cgroups: Disable memory resource controller by default. Allow it
  to be enabled using kernel parameter 'cgroup_enable=memory'.
* rt2800usb: Enable support for more USB devices including
  Linksys WUSB600N (Closes: #596626) (this change was accidentally
  omitted from 2.6.39-1)
* [x86] Remove Celeron from list of processors supporting PAE. Most
  'Celeron M' models do not.
* Update debconf template translations:
  - Swedish (Martin Bagge) (Closes: #628932)
  - French (David Prévot) (Closes: #628191)
* aufs: Update for 2.6.39 (Closes: #627837)
* Add stable 2.6.39.1, including:
  - ext4: dont set PageUptodate in ext4_end_bio()
  - pata_cmd64x: fix boot crash on parisc (Closes: #622997, #622745)
  - ext3: Fix fs corruption when make_indexed_dir() fails
  - netfilter: nf_ct_sip: validate Content-Length in TCP SIP messages
  - sctp: fix race between sctp_bind_addr_free() and
    sctp_bind_addr_conflict()
  - sctp: fix memory leak of the ASCONF queue when free asoc
  - md/bitmap: fix saving of events_cleared and other state
  - cdc_acm: Fix oops when Droids MuIn LCD is connected
  - cx88: Fix conversion from BKL to fine-grained locks (Closes: #619827)
  - keys: Set cred->user_ns in key_replace_session_keyring (CVE-2011-2184)
  - tmpfs: fix race between truncate and writepage
  - nfs41: Correct offset for LAYOUTCOMMIT
  - xen/mmu: fix a race window causing leave_mm BUG()
  - ext4: fix possible use-after-free in ext4_remove_li_request()
  For the complete list of changes, see:
   http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.39.1
* Bump ABI to 2
* netfilter: Enable IP_SET, IP_SET_BITMAP_IP, IP_SET_BITMAP_IPMAC,
  IP_SET_BITMAP_PORT, IP_SET_HASH_IP, IP_SET_HASH_IPPORT,
  IP_SET_HASH_IPPORTIP, IP_SET_HASH_IPPORTNET, IP_SET_HASH_NET,
  IP_SET_HASH_NETPORT, IP_SET_LIST_SET, NETFILTER_XT_SET as modules
  (Closes: #629401)

[ Aurelien Jarno ]
* [mipsel/loongson-2f] Disable_SCSI_LPFC to workaround GCC ICE.

Show diffs side-by-side

added added

removed removed

Lines of Context:
119
119
static void mn10300_serial_config_port(struct uart_port *, int);
120
120
static int mn10300_serial_verify_port(struct uart_port *,
121
121
                                        struct serial_struct *);
 
122
#ifdef CONFIG_CONSOLE_POLL
 
123
static void mn10300_serial_poll_put_char(struct uart_port *, unsigned char);
 
124
static int mn10300_serial_poll_get_char(struct uart_port *);
 
125
#endif
122
126
 
123
127
static const struct uart_ops mn10300_serial_ops = {
124
128
        .tx_empty       = mn10300_serial_tx_empty,
138
142
        .request_port   = mn10300_serial_request_port,
139
143
        .config_port    = mn10300_serial_config_port,
140
144
        .verify_port    = mn10300_serial_verify_port,
 
145
#ifdef CONFIG_CONSOLE_POLL
 
146
        .poll_put_char  = mn10300_serial_poll_put_char,
 
147
        .poll_get_char  = mn10300_serial_poll_get_char,
 
148
#endif
141
149
};
142
150
 
143
151
static irqreturn_t mn10300_serial_interrupt(int irq, void *dev_id);
384
392
        arch_local_irq_restore(flags);
385
393
}
386
394
 
387
 
static void mn10300_serial_nop(unsigned int irq)
 
395
static void mn10300_serial_chip_mask_ack(struct irq_data *d)
 
396
{
 
397
        mn10300_serial_mask_ack(d->irq);
 
398
}
 
399
 
 
400
static void mn10300_serial_nop(struct irq_data *d)
388
401
{
389
402
}
390
403
 
391
404
static struct irq_chip mn10300_serial_pic = {
392
405
        .name           = "mnserial",
393
 
        .ack            = mn10300_serial_mask_ack,
394
 
        .mask           = mn10300_serial_mask_ack,
395
 
        .mask_ack       = mn10300_serial_mask_ack,
396
 
        .unmask         = mn10300_serial_nop,
397
 
        .end            = mn10300_serial_nop,
 
406
        .irq_ack        = mn10300_serial_chip_mask_ack,
 
407
        .irq_mask       = mn10300_serial_chip_mask_ack,
 
408
        .irq_mask_ack   = mn10300_serial_chip_mask_ack,
 
409
        .irq_unmask     = mn10300_serial_nop,
398
410
};
399
411
 
400
412
 
921
933
                NUM2GxICR_LEVEL(CONFIG_MN10300_SERIAL_IRQ_LEVEL));
922
934
        set_intr_level(port->tx_irq,
923
935
                NUM2GxICR_LEVEL(CONFIG_MN10300_SERIAL_IRQ_LEVEL));
924
 
        set_irq_chip(port->tm_irq, &mn10300_serial_pic);
 
936
        irq_set_chip(port->tm_irq, &mn10300_serial_pic);
925
937
 
926
938
        if (request_irq(port->rx_irq, mn10300_serial_interrupt,
927
939
                        IRQF_DISABLED, port->rx_name, port) < 0)
1630
1642
 
1631
1643
console_initcall(mn10300_serial_console_init);
1632
1644
#endif
 
1645
 
 
1646
#ifdef CONFIG_CONSOLE_POLL
 
1647
/*
 
1648
 * Polled character reception for the kernel debugger
 
1649
 */
 
1650
static int mn10300_serial_poll_get_char(struct uart_port *_port)
 
1651
{
 
1652
        struct mn10300_serial_port *port =
 
1653
                container_of(_port, struct mn10300_serial_port, uart);
 
1654
        unsigned ix;
 
1655
        u8 st, ch;
 
1656
 
 
1657
        _enter("%s", port->name);
 
1658
 
 
1659
        do {
 
1660
                /* pull chars out of the hat */
 
1661
                ix = port->rx_outp;
 
1662
                if (ix == port->rx_inp)
 
1663
                        return NO_POLL_CHAR;
 
1664
 
 
1665
                ch = port->rx_buffer[ix++];
 
1666
                st = port->rx_buffer[ix++];
 
1667
                smp_rmb();
 
1668
                port->rx_outp = ix & (MNSC_BUFFER_SIZE - 1);
 
1669
 
 
1670
        } while (st & (SC01STR_FEF | SC01STR_PEF | SC01STR_OEF));
 
1671
 
 
1672
        return ch;
 
1673
}
 
1674
 
 
1675
 
 
1676
/*
 
1677
 * Polled character transmission for the kernel debugger
 
1678
 */
 
1679
static void mn10300_serial_poll_put_char(struct uart_port *_port,
 
1680
                                         unsigned char ch)
 
1681
{
 
1682
        struct mn10300_serial_port *port =
 
1683
                container_of(_port, struct mn10300_serial_port, uart);
 
1684
        u8 intr, tmp;
 
1685
 
 
1686
        /* wait for the transmitter to finish anything it might be doing (and
 
1687
         * this includes the virtual DMA handler, so it might take a while) */
 
1688
        while (*port->_status & (SC01STR_TBF | SC01STR_TXF))
 
1689
                continue;
 
1690
 
 
1691
        /* disable the Tx ready interrupt */
 
1692
        intr = *port->_intr;
 
1693
        *port->_intr = intr & ~SC01ICR_TI;
 
1694
        tmp = *port->_intr;
 
1695
 
 
1696
        if (ch == 0x0a) {
 
1697
                *(u8 *) port->_txb = 0x0d;
 
1698
                while (*port->_status & SC01STR_TBF)
 
1699
                        continue;
 
1700
        }
 
1701
 
 
1702
        *(u8 *) port->_txb = ch;
 
1703
        while (*port->_status & SC01STR_TBF)
 
1704
                continue;
 
1705
 
 
1706
        /* restore the Tx interrupt flag */
 
1707
        *port->_intr = intr;
 
1708
        tmp = *port->_intr;
 
1709
}
 
1710
 
 
1711
#endif /* CONFIG_CONSOLE_POLL */