From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: linux-sh@vger.kernel.org, Magnus Damm <magnus.damm@gmail.com>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
Nobuhiro Iwamatsu <iwamatsu@nigauri.org>,
Yoshihiro Kaneko <ykaneko0929@gmail.com>,
Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>,
Koji Matsuoka <koji.matsuoka.xm@renesas.com>,
Wolfram Sang <wsa@the-dreams.de>,
Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
linux-serial@vger.kernel.org
Subject: Re: [PATCH/RFC v3 1/4] serial: sh-sci: Stop TX and RX on shutdown
Date: Sat, 22 Aug 2015 02:17:50 +0300 [thread overview]
Message-ID: <1780221.Xost2UeeDz@avalon> (raw)
In-Reply-To: <1440181546-7334-2-git-send-email-geert+renesas@glider.be>
Hi Geert,
Thank you for the patch.
On Friday 21 August 2015 20:25:43 Geert Uytterhoeven wrote:
> Make sure the transmitter and receiver are stopped when shutting down
> the port, to avoid new RX DMA requests to arrive.
>
> Inspired by a patch in the BSP by Koji Matsuoka
> <koji.matsuoka.xm@renesas.com>.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> v3:
> - No changes,
>
> v2:
> - New.
> ---
> drivers/tty/serial/sh-sci.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
> index d8b73e791a554823..0622cafaf1c71cab 100644
> --- a/drivers/tty/serial/sh-sci.c
> +++ b/drivers/tty/serial/sh-sci.c
> @@ -1820,12 +1820,16 @@ static void sci_shutdown(struct uart_port *port)
> {
> struct sci_port *s = to_sci_port(port);
> unsigned long flags;
> + u16 scscr;
>
> dev_dbg(port->dev, "%s(%d)\n", __func__, port->line);
>
> spin_lock_irqsave(&port->lock, flags);
> sci_stop_rx(port);
> sci_stop_tx(port);
> + scscr = serial_port_in(port, SCSCR);
> + scscr &= ~(SCSCR_TE | SCSCR_RE);
> + serial_port_out(port, SCSCR, scscr);
Given that the register contains lots of interrupt enable bits, would it make
sense to just write it to 0 to disable everything ? I don't think we need to
keep any of the SCSCR bits across shutdown/startup.
> spin_unlock_irqrestore(&port->lock, flags);
>
> sci_free_dma(port);
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2015-08-21 23:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-21 18:25 [PATCH/RFC v3 0/4] serial: sh-sci: Add DT DMA support Geert Uytterhoeven
2015-08-21 18:25 ` [PATCH/RFC v3 1/4] serial: sh-sci: Stop TX and RX on shutdown Geert Uytterhoeven
2015-08-21 23:17 ` Laurent Pinchart [this message]
2015-08-25 13:01 ` Geert Uytterhoeven
2015-08-21 18:25 ` [PATCH/RFC v3 2/4] serial: sh-sci: Get rid of the workqueue to handle receive DMA requests Geert Uytterhoeven
2015-08-21 18:25 ` [PATCH/RFC v3 3/4] serial: sh-sci: Submit RX DMA from RX interrupt on (H)SCIF Geert Uytterhoeven
2015-08-21 18:25 ` [PATCH/RFC v3 4/4] serial: sh-sci: Add DT support to DMA setup Geert Uytterhoeven
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=1780221.Xost2UeeDz@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=g.liakhovetski@gmx.de \
--cc=geert+renesas@glider.be \
--cc=iwamatsu@nigauri.org \
--cc=kazuya.mizuguchi.ks@renesas.com \
--cc=koji.matsuoka.xm@renesas.com \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=linux-serial@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=wsa@the-dreams.de \
--cc=ykaneko0929@gmail.com \
--cc=yoshihiro.shimoda.uh@renesas.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