devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lyra Zhang <zhang.lyra@gmail.com>
To: Baruch Siach <baruch@tkos.co.il>
Cc: "Mark Rutland" <mark.rutland@arm.com>,
	"andrew@lunn.ch" <andrew@lunn.ch>,
	"Heiko Stübner" <heiko@sntech.de>,
	"gnomes@lxorguk.ukuu.org.uk" <gnomes@lxorguk.ukuu.org.uk>,
	"jslaby@suse.cz" <jslaby@suse.cz>,
	"lanqing.liu@spreadtrum.com" <lanqing.liu@spreadtrum.com>,
	"Pawel Moll" <pawel.moll@arm.com>,
	"Chunyan Zhang" <chunyan.zhang@spreadtrum.com>,
	"zhizhou.zhang" <zhizhou.zhang@spreadtrum.com>,
	"geng.ren@spreadtrum.com" <geng.ren@spreadtrum.com>,
	"antonynpavlov@gmail.com" <antonynpavlov@gmail.com>,
	"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	"Grant Likely" <grant.likely@linaro.org>,
	"Orson Zhai" <orsonzhai@gmail.com>,
	"florian.vaussard@epfl.ch" <florian.vaussard@epfl.ch>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"jason@lakedaemon.net" <jason@lakedaemon.net>,
	"Arnd Bergmann" <arnd@arndb.de>
Subject: Re: [PATCH v9 2/2] tty/serial: Add Spreadtrum sc9836-uart driver support
Date: Wed, 28 Jan 2015 16:46:33 +0800	[thread overview]
Message-ID: <CAAfSe-v4FGpHL3N3utiDwcoc7qus1XZZszuXBqB6LeE1frAfeA@mail.gmail.com> (raw)
In-Reply-To: <20150128061250.GQ2555@sapphire.tkos.co.il>

Hi, Baruch

I'm sorry that I didn't receive your previous email.
and my explanations are below.

On Wed, Jan 28, 2015 at 2:12 PM, Baruch Siach <baruch@tkos.co.il> wrote:
> 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.
>

yes, there are two definitions in serial_core.h, and it returns 0 when
SUPPORT_SYSRQ is not defined.
so, I think my code behavior does not hurt, right?

>> +
>> +             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.
>

we have this part to been included under #ifdef
CONFIG_SERIAL_SPRD_CONSOLE which is selected with SERIAL_CORE_CONSOLE.

Thank you very much!

Chunyan

>> +     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 -

  reply	other threads:[~2015-01-28  8:46 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 driver support Chunyan Zhang
     [not found]   ` <1422413261-17184-1-git-send-email-chunyan.zhang-lxIno14LUO0EEoCn2XhGlw@public.gmane.org>
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
     [not found]       ` <1422413261-17184-3-git-send-email-chunyan.zhang-lxIno14LUO0EEoCn2XhGlw@public.gmane.org>
2015-01-28  3:59         ` Peter Hurley
2015-01-28  6:12         ` Baruch Siach
2015-01-28  8:46           ` Lyra Zhang [this message]
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=CAAfSe-v4FGpHL3N3utiDwcoc7qus1XZZszuXBqB6LeE1frAfeA@mail.gmail.com \
    --to=zhang.lyra@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=antonynpavlov@gmail.com \
    --cc=arnd@arndb.de \
    --cc=baruch@tkos.co.il \
    --cc=chunyan.zhang@spreadtrum.com \
    --cc=devicetree@vger.kernel.org \
    --cc=florian.vaussard@epfl.ch \
    --cc=geng.ren@spreadtrum.com \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=grant.likely@linaro.org \
    --cc=heiko@sntech.de \
    --cc=jason@lakedaemon.net \
    --cc=jslaby@suse.cz \
    --cc=lanqing.liu@spreadtrum.com \
    --cc=linux-serial@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=orsonzhai@gmail.com \
    --cc=pawel.moll@arm.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;
as well as URLs for NNTP newsgroup(s).