All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	Magnus Damm <magnus.damm@gmail.com>,
	Gareth Williams <gareth.williams.jx@renesas.com>,
	Phil Edworthy <phil.edworthy@renesas.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	"open list:SERIAL DRIVERS" <linux-serial@vger.kernel.org>,
	Milan Stevanovic <milan.stevanovic@se.com>,
	Jimmy Lalande <jimmy.lalande@se.com>,
	Pascal Eberhard <pascal.eberhard@se.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Herve Codina <herve.codina@bootlin.com>,
	Clement Leger <clement.leger@bootlin.com>
Subject: Re: [PATCH 6/7] serial: 8250_dw: Add support for RZ/N1 DMA
Date: Fri, 11 Mar 2022 10:39:57 +0100	[thread overview]
Message-ID: <CAMuHMdW0VZsx-zAFr__PPBqKBVyu4v7sAU_yV-ROcTLq10fE6g@mail.gmail.com> (raw)
In-Reply-To: <20220310161650.289387-7-miquel.raynal@bootlin.com>

Hi Miquel,

On Thu, Mar 10, 2022 at 5:17 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> From: Phil Edworthy <phil.edworthy@renesas.com>
>
> The Renesas RZ/N1 devices have a modified Synopsys DW UART. The
> modifications are mostly related to the DMA handlnig, and so this patch
> adds support for DMA.
>
> The RZ/N1 UART must be used with the peripheral as the flow
> controller. This means the DMA length should also be programmed into
> UART registers.
>
> Aside from this, there are some points to note about DMA burst sizes.
> First, DMA must not remove all of the data from the rx FIFO. Otherwise,
> we do not get a 'character timeout' interrupt, and so do not know that
> we should push data up the serial stack. Therefore, we have the rx
> threshold for generating an interrupt set to half the FIFO depth (this
> is the default for 16550A), and set the DMA burst size when reading the
> FIFO to a quarter of the FIFO depth.
>
> Second, when transmitting data using DMA, the burst size must be limited
> to 1 byte to handle then case when transmitting just 1 byte. Otherwise
> the DMA doesn't complete the burst, and nothing happens.
>
> Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

Thanks for your patch!

> --- a/drivers/tty/serial/8250/8250_dma.c
> +++ b/drivers/tty/serial/8250/8250_dma.c

> @@ -501,6 +589,8 @@ static int dw8250_probe(struct platform_device *pdev)
>                 data->msr_mask_off |= UART_MSR_TERI;
>         }
>
> +       data->is_rzn1 = of_device_is_compatible(dev->of_node, "renesas,rzn1-uart");

Explicit checks for compatible values are frowned upon if you have
a match table.
Please handle this through of_device.data, cfr. the various quirks.
Please rename "is_rzn1" to something that describes the feature.

> +
>         /* Always ask for fixed clock rate from a property. */
>         device_property_read_u32(dev, "clock-frequency", &p->uartclk);

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  parent reply	other threads:[~2022-03-11  9:40 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-10 16:16 [PATCH 0/7] RZN1 UART DMA support Miquel Raynal
2022-03-10 16:16 ` [PATCH 1/7] serial: 8250_dma: Use ->tx_dma function pointer to start next DMA Miquel Raynal
2022-03-10 17:59   ` Andy Shevchenko
2022-03-10 16:16 ` [PATCH 2/7] serial: 8250_dw: Move the per-device structure Miquel Raynal
2022-03-10 18:01   ` Andy Shevchenko
2022-03-10 16:16 ` [PATCH 3/7] serial: 8250_dw: Use a fallback CPR value if not synthesized Miquel Raynal
2022-03-10 18:02   ` Andy Shevchenko
2022-03-10 19:01     ` Miquel Raynal
2022-03-11 17:05       ` Andy Shevchenko
2022-03-10 16:16 ` [PATCH 4/7] serial: 8250_dw: Provide the RZN1 CPR register value Miquel Raynal
2022-03-10 16:16 ` [PATCH 5/7] serial: 8250_dw: Add a dma_capable bit to the platform data Miquel Raynal
2022-03-10 18:06   ` Andy Shevchenko
2022-03-10 19:13     ` Miquel Raynal
2022-03-11 17:09       ` Andy Shevchenko
2022-03-10 16:16 ` [PATCH 6/7] serial: 8250_dw: Add support for RZ/N1 DMA Miquel Raynal
2022-03-10 18:25   ` Andy Shevchenko
2022-03-10 19:27     ` Miquel Raynal
2022-03-11 17:14       ` Andy Shevchenko
2022-03-11  9:39   ` Geert Uytterhoeven [this message]
2022-03-11  9:51     ` Geert Uytterhoeven
2022-03-11  9:59       ` Miquel Raynal
2022-03-11 14:48         ` [PATCH] serial: 8250_dw: Use device tree match data Emil Renner Berthing
2022-03-11 17:27           ` Andy Shevchenko
2022-03-16 14:40           ` Miquel Raynal
2022-03-10 16:16 ` [PATCH 7/7] ARM: dts: r9a06g032: Fill the UART DMA properties Miquel Raynal

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=CAMuHMdW0VZsx-zAFr__PPBqKBVyu4v7sAU_yV-ROcTLq10fE6g@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=clement.leger@bootlin.com \
    --cc=gareth.williams.jx@renesas.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=herve.codina@bootlin.com \
    --cc=jimmy.lalande@se.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=milan.stevanovic@se.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=pascal.eberhard@se.com \
    --cc=phil.edworthy@renesas.com \
    --cc=thomas.petazzoni@bootlin.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 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.