From: Ian Abbott <abbotti@mev.co.uk>
To: "nios2-dev@sopc.et.ntust.edu.tw" <nios2-dev@sopc.et.ntust.edu.tw>
Cc: "sfr@canb.auug.org.au" <sfr@canb.auug.org.au>,
"gregkh@suse.de" <gregkh@suse.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"alan@lxorguk.ukuu.org.uk" <alan@lxorguk.ukuu.org.uk>
Subject: Re: [Nios2-dev] [PATCH 2/2] serial: Add driver for the Altera UART
Date: Thu, 6 May 2010 12:09:00 +0100 [thread overview]
Message-ID: <4BE2A34C.1040301@mev.co.uk> (raw)
In-Reply-To: <1273142684.3477.22.camel@gentoo-ija64.mev.local>
On 06/05/10 11:44, Ian Abbott wrote:
> On Wed, 2010-05-05 at 09:35 +0100, Tobias Klauser wrote:
>> Add an UART driver for the UART component available as a SOPC (System on
>> Programmable Chip) component for Altera FPGAs.
> [...]
>
>> +static void altera_uart_start_tx(struct uart_port *port)
>> +{
>> + struct altera_uart *pp = container_of(port, struct altera_uart, port);
>> + unsigned long flags;
>> +
>> + spin_lock_irqsave(&port->lock, flags);
>> + pp->imr |= ALTERA_UART_CONTROL_TRDY_MSK;
>> + writel(pp->imr, port->membase + ALTERA_UART_CONTROL_REG);
>> + spin_unlock_irqrestore(&port->lock, flags);
>> +}
>> +
>> +static void altera_uart_stop_tx(struct uart_port *port)
>> +{
>> + struct altera_uart *pp = container_of(port, struct altera_uart, port);
>> + unsigned long flags;
>> +
>> + spin_lock_irqsave(&port->lock, flags);
>> + pp->imr &= ~ALTERA_UART_CONTROL_TRDY_MSK;
>> + writel(pp->imr, port->membase + ALTERA_UART_CONTROL_REG);
>> + spin_unlock_irqrestore(&port->lock, flags);
>> +}
>> +
>> +static void altera_uart_stop_rx(struct uart_port *port)
>> +{
>> + struct altera_uart *pp = container_of(port, struct altera_uart, port);
>> + unsigned long flags;
>> +
>> + spin_lock_irqsave(&port->lock, flags);
>> + pp->imr &= ~ALTERA_UART_CONTROL_RRDY_MSK;
>> + writel(pp->imr, port->membase + ALTERA_UART_CONTROL_REG);
>> + spin_unlock_irqrestore(&port->lock, flags);
>> +}
>
> Those four functions shouldn't grab port->lock because the caller in
> serial_core.c grabs it before calling them.
Oh, and that also applies to altera_uart_set_mctrl() - the caller grabs
port->lock before calling it.
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@mev.co.uk> )=-
-=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
next prev parent reply other threads:[~2010-05-06 11:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-05 8:35 [PATCH v5 0/2] serial: Drivers for Altera UARTs Tobias Klauser
2010-05-05 8:35 ` [PATCH 1/2] serial: Add driver for the Altera JTAG UART Tobias Klauser
2010-05-06 10:59 ` [Nios2-dev] " Ian Abbott
2010-05-06 11:17 ` Alan Cox
2010-05-05 8:35 ` [PATCH 2/2] serial: Add driver for the Altera UART Tobias Klauser
2010-05-06 10:44 ` [Nios2-dev] " Ian Abbott
2010-05-06 11:09 ` Ian Abbott [this message]
2010-05-06 11:16 ` Ian Abbott
2010-05-06 12:03 ` Tobias Klauser
2010-05-06 12:47 ` Ian Abbott
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BE2A34C.1040301@mev.co.uk \
--to=abbotti@mev.co.uk \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=nios2-dev@sopc.et.ntust.edu.tw \
--cc=sfr@canb.auug.org.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.