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>,
	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 5/7] serial: 8250_dw: Add a dma_capable bit to the platform data
Date: Thu, 10 Mar 2022 20:13:51 +0100	[thread overview]
Message-ID: <20220310201351.1f15bf7e@xps13> (raw)
In-Reply-To: <Yio+IdeWn+G7xcNv@smile.fi.intel.com>

Hi Andy,

andriy.shevchenko@linux.intel.com wrote on Thu, 10 Mar 2022 20:06:25
+0200:

> On Thu, Mar 10, 2022 at 05:16:48PM +0100, Miquel Raynal wrote:
> > From: Phil Edworthy <phil.edworthy@renesas.com>
> > 
> > The CPR register can give the information whether the IP is DMA capable
> > or not. Let's extract this information and use it to discriminate when
> > the DMA can be hooked up or not.  
> 
> ...
> 
> > +	/* If we have a valid fifosize and DMA support, try hooking up DMA */
> > +	if (p->fifosize && data->dma_capable) {  
> 
> > +	if (reg & DW_UART_CPR_DMA_EXTRA)
> > +		data->dma_capable = 1;  
> 
> How many designs will be broken by this change?

My understanding was that CPR registers where always synthesized until
now even though it was not mandatory and that the RZN1 SoC was the
first one to not embed it. My hope was that people using this driver
would have brought "external" CPR support earlier if they needed it,
but I understand this assumption might be wrong.

Anyway, I also hesitated to do something more custom for the RZN1 I'll
try something else.

> 
> ...
> 
> > +	unsigned int		dma_capable:1;  
> 
> Note, we use up->dma == NULL for no-DMA, no additional flag is needed.
> Just make sure that for your platform you enable DMA by filling that.

dma_capable is just a capability the SoC has. It was discovered at
probe time and should be saved to know, later, if DMA can be hooked up
or not. At the time we look at the CPR register we don't yet have DMA
fields populated so its too early to set up->dma to NULL.

Thanks,
Miquèl

  reply	other threads:[~2022-03-10 19:14 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 [this message]
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
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=20220310201351.1f15bf7e@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).