From: Baruch Siach <baruch@tkos.co.il>
To: Chunyan Zhang <chunyan.zhang@spreadtrum.com>
Cc: gregkh@linuxfoundation.org, mark.rutland@arm.com,
gnomes@lxorguk.ukuu.org.uk, heiko@sntech.de, andrew@lunn.ch,
jslaby@suse.cz, lanqing.liu@spreadtrum.com, arnd@arndb.de,
zhang.lyra@gmail.com, zhizhou.zhang@spreadtrum.com,
geng.ren@spreadtrum.com, antonynpavlov@gmail.com,
linux-serial@vger.kernel.org, grant.likely@linaro.org,
orsonzhai@gmail.com, florian.vaussard@epfl.ch,
devicetree@vger.kernel.org, jason@lakedaemon.net,
pawel.moll@arm.com, ijc+devicetree@hellion.org.uk,
hytszk@gmail.com, robh+dt@kernel.org, wei.qiao@spreadtrum.com,
linux-arm-kernel@lists.infradead.org, peter@hurleysoftware.com,
linux-api@vger.kernel.org, linux-kernel@vger.kernel.org,
galak@codeaurora.org, shawn.guo@linaro.org
Subject: Re: [PATCH v9 2/2] tty/serial: Add Spreadtrum sc9836-uart driver support
Date: Wed, 28 Jan 2015 08:12:50 +0200 [thread overview]
Message-ID: <20150128061250.GQ2555@sapphire.tkos.co.il> (raw)
In-Reply-To: <1422413261-17184-3-git-send-email-chunyan.zhang@spreadtrum.com>
Hi Chunyan Zhang,
On Wed, Jan 28, 2015 at 10:47:41AM +0800, Chunyan Zhang wrote:
[...]
> +static inline void sprd_rx(struct uart_port *port)
> +{
> + struct tty_port *tty = &port->state->port;
> + unsigned int ch, flag, lsr, max_count = SPRD_TIMEOUT;
> +
> + while ((serial_in(port, SPRD_STS1) & 0x00ff) && max_count--) {
> + lsr = serial_in(port, SPRD_LSR);
> + ch = serial_in(port, SPRD_RXD);
> + flag = TTY_NORMAL;
> + port->icount.rx++;
> +
> + if (lsr & (SPRD_LSR_BI | SPRD_LSR_PE |
> + SPRD_LSR_FE | SPRD_LSR_OE))
> + if (handle_lsr_errors(port, &lsr, &flag))
> + continue;
> + if (uart_handle_sysrq_char(port, ch))
> + continue;
My comment[1] on a previous version of this patch still stands.
uart_handle_sysrq_char is a NOP when SUPPORT_SYSRQ is not defined.
> +
> + uart_insert_char(port, lsr, SPRD_LSR_OE, ch, flag);
> + }
> +
> + tty_flip_buffer_push(tty);
> +}
[...]
> +static void sprd_console_write(struct console *co, const char *s,
> + unsigned int count)
> +{
> + struct uart_port *port = &sprd_port[co->index]->port;
> + int locked = 1;
> + unsigned long flags;
> +
> + if (port->sysrq)
> + locked = 0;
The sysrq field of struct uart_port is only defined when
CONFIG_SERIAL_CORE_CONSOLE or SUPPORT_SYSRQ are defined. You should #ifdef
this part accordingly to avoid build breakage.
> + else if (oops_in_progress)
> + locked = spin_trylock_irqsave(&port->lock, flags);
> + else
> + spin_lock_irqsave(&port->lock, flags);
> +
> + uart_console_write(port, s, count, sprd_console_putchar);
> +
> + /* wait for transmitter to become empty */
> + wait_for_xmitr(port);
> +
> + if (locked)
> + spin_unlock_irqrestore(&port->lock, flags);
> +}
[1]
http://article.gmane.org/gmane.linux.drivers.devicetree/106483
baruch
--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch@tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
next prev parent reply other threads:[~2015-01-28 6:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <sc9836-serial-v9>
2015-01-28 2:47 ` [PATCH v9 0/2] Add Spreadtrum SoC bindings and serial " Chunyan Zhang
2015-01-28 2:47 ` [PATCH v9 1/2] Documentation: DT: Add bindings for Spreadtrum SoC Platform Chunyan Zhang
2015-01-28 2:47 ` [PATCH v9 2/2] tty/serial: Add Spreadtrum sc9836-uart driver support Chunyan Zhang
2015-01-28 3:59 ` Peter Hurley
2015-01-28 6:12 ` Baruch Siach [this message]
2015-01-28 8:46 ` Lyra Zhang
2015-01-28 9:54 ` Baruch Siach
2015-01-28 10:46 ` Lyra Zhang
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=20150128061250.GQ2555@sapphire.tkos.co.il \
--to=baruch@tkos.co.il \
--cc=andrew@lunn.ch \
--cc=antonynpavlov@gmail.com \
--cc=arnd@arndb.de \
--cc=chunyan.zhang@spreadtrum.com \
--cc=devicetree@vger.kernel.org \
--cc=florian.vaussard@epfl.ch \
--cc=galak@codeaurora.org \
--cc=geng.ren@spreadtrum.com \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=grant.likely@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=heiko@sntech.de \
--cc=hytszk@gmail.com \
--cc=ijc+devicetree@hellion.org.uk \
--cc=jason@lakedaemon.net \
--cc=jslaby@suse.cz \
--cc=lanqing.liu@spreadtrum.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=orsonzhai@gmail.com \
--cc=pawel.moll@arm.com \
--cc=peter@hurleysoftware.com \
--cc=robh+dt@kernel.org \
--cc=shawn.guo@linaro.org \
--cc=wei.qiao@spreadtrum.com \
--cc=zhang.lyra@gmail.com \
--cc=zhizhou.zhang@spreadtrum.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®