linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: 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>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@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>,
	linux-serial@vger.kernel.org
Subject: Re: [PATCH v2 08/10] serial: 8250: dw: Add support for DMA flow controlling devices
Date: Tue, 29 Mar 2022 10:29:51 +0200	[thread overview]
Message-ID: <20220329102951.579e154d@xps13> (raw)
In-Reply-To: <YjSWM5ilahNBXF1b@smile.fi.intel.com>

Hi Andy,

andriy.shevchenko@linux.intel.com wrote on Fri, 18 Mar 2022 16:24:51
+0200:

> On Thu, Mar 17, 2022 at 06:46:25PM +0100, Miquel Raynal wrote:
> > From: Phil Edworthy <phil.edworthy@renesas.com>
> > 
> > DW based controllers like the one on Renesas RZ/N1 must be programmed as
> > flow controllers when using DMA.
> > 
> > * Table 11.45 of the system manual, "Flow Control Combinations", states
> >   that using UART with DMA requires setting the DMA in the peripheral
> >   flow controller mode regardless of the direction.
> > 
> > * Chapter 11.6.1.3 of the system manual, "Basic Interface Definitions",
> >   explains that the burst size in the above case must be configured in
> >   the peripheral's register DEST/SRC_BURST_SIZE.
> > 
> > Experiments shown that upon Rx timeout, the DMA transaction needed to be
> > manually cleared as well.  
> 
> ...
> 
> > +#define DW_UART_TDMACR	0x10c /* DMA Control Register Transmit Mode */
> > +#define DW_UART_RDMACR	0x110 /* DMA Control Register Receive Mode */  
> 
> These are not Synposys ones.

Ok

> ...
> 
> > +static u32 dw8250_rzn1_get_dmacr_burst(int max_burst)
> > +{
> > +	if (max_burst >= 8)
> > +		return DW_UART_xDMACR_8_WORD_BURST;
> > +	else if (max_burst >= 4)
> > +		return DW_UART_xDMACR_4_WORD_BURST;
> > +	else
> > +		return DW_UART_xDMACR_1_WORD_BURST;
> > +}  
> 
> Redundant 'else' in all cases.

I'm sorry but dropping the else statement here does not make any
sense. I find it much easier to the eyes the current way.

Thanks,
Miquèl

  reply	other threads:[~2022-03-29  8:30 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-17 17:46 [PATCH v2 00/10] serial: 8250: dw: RZN1 DMA support Miquel Raynal
2022-03-17 17:46 ` [PATCH v2 01/10] serial: 8250: dw: Move the per-device structure Miquel Raynal
2022-03-18 10:51   ` Andy Shevchenko
2022-03-29  8:10     ` Miquel Raynal
2022-03-29 11:11       ` Andy Shevchenko
2022-03-29 14:27         ` Miquel Raynal
2022-03-17 17:46 ` [PATCH v2 02/10] serial: 8250: dw: Use the device API Miquel Raynal
2022-03-18  8:05   ` Geert Uytterhoeven
2022-03-17 17:46 ` [PATCH v2 03/10] serial: 8250: dw: Create a more generic platform data structure Miquel Raynal
2022-03-18  8:07   ` Geert Uytterhoeven
2022-03-18 13:57   ` Andy Shevchenko
2022-03-17 17:46 ` [PATCH v2 04/10] serial: 8250: dw: Allow to use a fallback CPR value if not synthesized Miquel Raynal
2022-03-18 13:56   ` Andy Shevchenko
2022-03-17 17:46 ` [PATCH v2 05/10] serial: 8250: dw: Check when possible if DMA is effectively supported Miquel Raynal
2022-03-18 13:50   ` Andy Shevchenko
2022-03-18 14:33     ` Miquel Raynal
2022-03-17 17:46 ` [PATCH v2 06/10] serial: 8250: dma: Allow driver operations before starting DMA transfers Miquel Raynal
2022-03-17 17:46 ` [PATCH v2 07/10] serial: 8250: dw: Introduce an rx_timeout variable in the IRQ path Miquel Raynal
2022-03-17 17:46 ` [PATCH v2 08/10] serial: 8250: dw: Add support for DMA flow controlling devices Miquel Raynal
2022-03-18 14:24   ` Andy Shevchenko
2022-03-29  8:29     ` Miquel Raynal [this message]
2022-03-17 17:46 ` [PATCH v2 09/10] serial: 8250: dw: Improve RZN1 support Miquel Raynal
2022-03-17 17:46 ` [PATCH v2 10/10] 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=20220329102951.579e154d@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=clement.leger@bootlin.com \
    --cc=gareth.williams.jx@renesas.com \
    --cc=geert@linux-m68k.org \
    --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=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 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).