linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
	Artur Rojek <contact@artur-rojek.eu>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>,
	Rich Felker <dalias@libc.org>,
	Rafael Ignacio Zurita <rafaelignacio.zurita@gmail.com>,
	linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/3] sh: dma: Correct the number of DMA channels in SH7709
Date: Thu, 08 Jun 2023 11:54:33 +0200	[thread overview]
Message-ID: <f7b9ceb9739f8ae5cbee4f6073ce3af3921a2540.camel@physik.fu-berlin.de> (raw)
In-Reply-To: <CAMuHMdV3gn8g-gKam71K=WfT3CVNwvz5eKPSh2Fqi3wVg7ZwNw@mail.gmail.com>

Hi!

Sorry for being so late to the party.

On Wed, 2023-06-07 at 11:16 +0200, Geert Uytterhoeven wrote:
> Hi Artur,
> 
> On Sat, May 27, 2023 at 6:45 PM Artur Rojek <contact@artur-rojek.eu> wrote:
> > According to the hardware manual [1], the DMAC found in SH7709 features
> > only 4 channels.
> > 
> > While at it, also sort the existing targets and clarify that
> > NR_ONCHIP_DMA_CHANNELS must be a multiply of two.
> > 
> > [1] https://www.renesas.com/us/en/document/mah/sh7709s-group-hardware-manual (p. 373)
> > 
> > Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
> > ---
> > 
> > v2: - sort existing targets
> 
> Thanks for the update!
> 
> >     - clarify that the value must be a multiply of two
> 
> That's only true when there are two DMACs, right?
> 
> Even in that case, you could mitigate that by avoiding the division by
> 
>     #ifdef SH_DMAC_BASE1
>    -#define        SH_DMAC_NR_MD_CH        (CONFIG_NR_ONCHIP_DMA_CHANNELS / 2)
>    +#define        SH_DMAC_NR_MD_CH        6
>     #else
>     #define        SH_DMAC_NR_MD_CH        CONFIG_NR_ONCHIP_DMA_CHANNELS
>     #endif

Aren't we dropping SH_DMAC_BASE1 in the other patch anyway?

> That is actually safer, as the user can override NR_ONCHIP_DMA_CHANNELS
> when configuring his kernel, thus breaking DMA  due to an incorrect
> value of SH_DMAC_NR_MD_CH.
> 
> Unfortunately we cannot protect against that when using a single DMAC,
> as SH_DMAC_NR_MD_CH can be either 4, 6, or 8.
> 
> Perhaps this configuration should be moved from Kconfig to <cpu/dma.h>,
> to protect against a user overriding this value?

Isn't SH_DMAC_NR_MD_CH already hardwired to the SoC being used?

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

  reply	other threads:[~2023-06-08  9:55 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-27 16:44 [PATCH v2 0/3] SuperH DMAC fixes Artur Rojek
2023-05-27 16:44 ` [PATCH v2 1/3] sh: dma: Fix dma channel offset calculation Artur Rojek
2023-06-07  9:04   ` Geert Uytterhoeven
2023-07-04 20:30   ` John Paul Adrian Glaubitz
2023-05-27 16:44 ` [PATCH v2 2/3] sh: dma: Drop incorrect SH_DMAC_BASE1 for SH4 Artur Rojek
2023-06-07  9:05   ` Geert Uytterhoeven
2023-07-04 20:32   ` John Paul Adrian Glaubitz
2023-05-27 16:44 ` [PATCH v2 3/3] sh: dma: Correct the number of DMA channels in SH7709 Artur Rojek
2023-06-07  9:16   ` Geert Uytterhoeven
2023-06-08  9:54     ` John Paul Adrian Glaubitz [this message]
2023-06-08  9:58       ` Geert Uytterhoeven
2023-06-08 10:03         ` John Paul Adrian Glaubitz
2023-06-17  7:31           ` John Paul Adrian Glaubitz
2023-06-17 11:09             ` Geert Uytterhoeven
2023-07-04  5:45               ` John Paul Adrian Glaubitz
2023-07-04  7:32                 ` Geert Uytterhoeven
2023-07-04  7:43                   ` John Paul Adrian Glaubitz
2023-07-04  7:54                     ` Geert Uytterhoeven
2023-07-04 20:35   ` John Paul Adrian Glaubitz
2023-07-05 17:08 ` [PATCH v2 0/3] SuperH DMAC fixes John Paul Adrian Glaubitz

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=f7b9ceb9739f8ae5cbee4f6073ce3af3921a2540.camel@physik.fu-berlin.de \
    --to=glaubitz@physik.fu-berlin.de \
    --cc=contact@artur-rojek.eu \
    --cc=dalias@libc.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=rafaelignacio.zurita@gmail.com \
    --cc=ysato@users.sourceforge.jp \
    /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).