[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAfSe-v4FGpHL3N3utiDwcoc7qus1XZZszuXBqB6LeE1frAfeA@mail.gmail.com>
Date: Wed, 28 Jan 2015 16:46:33 +0800
From: Lyra Zhang <zhang.lyra@...il.com>
To: Baruch Siach <baruch@...s.co.il>
Cc: Chunyan Zhang <chunyan.zhang@...eadtrum.com>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
Mark Rutland <mark.rutland@....com>,
"gnomes@...rguk.ukuu.org.uk" <gnomes@...rguk.ukuu.org.uk>,
Heiko Stübner <heiko@...ech.de>,
"andrew@...n.ch" <andrew@...n.ch>,
"jslaby@...e.cz" <jslaby@...e.cz>,
"lanqing.liu@...eadtrum.com" <lanqing.liu@...eadtrum.com>,
Arnd Bergmann <arnd@...db.de>,
"zhizhou.zhang" <zhizhou.zhang@...eadtrum.com>,
"geng.ren@...eadtrum.com" <geng.ren@...eadtrum.com>,
"antonynpavlov@...il.com" <antonynpavlov@...il.com>,
"linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
Grant Likely <grant.likely@...aro.org>,
Orson Zhai <orsonzhai@...il.com>,
"florian.vaussard@...l.ch" <florian.vaussard@...l.ch>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"jason@...edaemon.net" <jason@...edaemon.net>,
Pawel Moll <pawel.moll@....com>,
"ijc+devicetree@...lion.org.uk" <ijc+devicetree@...lion.org.uk>,
Hayato Suzuki <hytszk@...il.com>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
Wei Qiao (乔伟) <wei.qiao@...eadtrum.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
Peter Hurley <peter@...leysoftware.com>,
"linux-api@...r.kernel.org" <linux-api@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Kumar Gala <galak@...eaurora.org>,
Shawn Guo <shawn.guo@...aro.org>
Subject: Re: [PATCH v9 2/2] tty/serial: Add Spreadtrum sc9836-uart driver support
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@...s.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@...s.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists