From: Conor Dooley <conor@kernel.org>
To: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
Conor Dooley <conor.dooley@microchip.com>,
kernel test robot <lkp@intel.com>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
oe-kbuild-all@lists.linux.dev,
Linux Memory Management List <linux-mm@kvack.org>,
Palmer Dabbelt <palmer@rivosinc.com>
Subject: Re: [WARNING: ATTACHMENT UNSCANNED]Re: [linux-next:master 13230/13643] arch/riscv/errata/andes/errata.c:29:23: error: storage size of 'ret' isn't known
Date: Thu, 31 Aug 2023 17:36:05 +0100 [thread overview]
Message-ID: <20230831-nimble-rust-00821dccffdf@spud> (raw)
In-Reply-To: <CA+V-a8saBGu4t99k+7KD5o4g0p-Ou+ztFdwVAwmkRjFGFk_X3Q@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 4277 bytes --]
On Thu, Aug 31, 2023 at 03:59:37PM +0100, Lad, Prabhakar wrote:
> > > Currently ARCH_R9A07G043 selects DMA_GLOBAL_POOL and we have
> > > RISCV_DMA_NONCOHERENT selecting DMA_DIRECT_REMAP which causes below
> > > build issue when MMU is disabled:
> > >
> > > kernel/dma/pool.c: In function 'atomic_pool_expand':
> > > kernel/dma/pool.c:105:44: error: implicit declaration of function
> > > 'pgprot_dmacoherent' [-Werror=implicit-function-declaration]
> > > 105 |
> > > pgprot_dmacoherent(PAGE_KERNEL),
> > > | ^~~~~~~~~~~~~~~~~~
> > > kernel/dma/pool.c:105:44: error: incompatible type for argument 3 of
> > > 'dma_common_contiguous_remap'
> > > 105 |
> > > pgprot_dmacoherent(PAGE_KERNEL),
> > > |
> > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > | |
> > > | int
> > > In file included from kernel/dma/pool.c:8:
> >
> > Hmm, kernel/dma/mapping.c has its use of pgprot_dmacoherent() inside
> > an #ifdef CONFIG_MMU block.
> > kernel/dma/pool.c has it inside an #ifdef CONFIG_DMA_DIRECT_REMAP block.
> >
> > I guess that select should get a dependency on MMU:
> >
> > config RISCV_DMA_NONCOHERENT
> > select DMA_DIRECT_REMAP if MMU
> >
> > For comparison, m68k does take that into account:
> >
> > select DMA_DIRECT_REMAP if HAS_DMA && MMU && !COLDFIRE
> >
> Thanks for the pointer. With this changes we dont get an unmet
> dependencies warning.
>
> arch/riscv/errata/andes/errata.c: In function 'ax45mp_iocp_sw_workaround':
> arch/riscv/errata/andes/errata.c:29:23: error: storage size of 'ret' isn't known
> 29 | struct sbiret ret;
> | ^~~
> arch/riscv/errata/andes/errata.c:35:15: error: implicit declaration of
> function 'sbi_ecall' [-Werror=implicit-function-declaration]
> 35 | ret = sbi_ecall(ANDESTECH_SBI_EXT_ANDES,
> ANDES_SBI_EXT_IOCP_SW_WORKAROUND,
> | ^~~~~~~~~
> arch/riscv/errata/andes/errata.c:29:23: warning: unused variable 'ret'
> [-Wunused-variable]
> 29 | struct sbiret ret;
> | ^~~
> arch/riscv/errata/andes/errata.c:39:1: error: control reaches end of
> non-void function [-Werror=return-type]
> 39 | }
> | ^
> cc1: some warnings being treated as errors
>
> To fix the above build issue reported by the bot, adding a dependency
> for RISCV_SBI in ERRATA_ANDES won't help as ARCH_R9A07G043 is
> explicitly selecting it. To avoid imply should explicitly select based
> on dependency something like below?
>
> diff --git a/arch/riscv/Kconfig.errata b/arch/riscv/Kconfig.errata
> index 92c779764b27..566bcefeab50 100644
> --- a/arch/riscv/Kconfig.errata
> +++ b/arch/riscv/Kconfig.errata
> @@ -2,7 +2,7 @@ menu "CPU errata selection"
>
> config ERRATA_ANDES
> bool "Andes AX45MP errata"
> - depends on RISCV_ALTERNATIVE
> + depends on RISCV_ALTERNATIVE && RISCV_SBI
> help
> All Andes errata Kconfig depend on this Kconfig. Disabling
> this Kconfig will disable all Andes errata. Please say "Y"
> @@ -12,7 +12,7 @@ config ERRATA_ANDES
>
> config ERRATA_ANDES_CMO
> bool "Apply Andes cache management errata"
> - depends on ERRATA_ANDES && MMU && ARCH_R9A07G043
> + depends on ERRATA_ANDES && ARCH_R9A07G043
> select RISCV_DMA_NONCOHERENT
> default y
> help
> diff --git a/drivers/soc/renesas/Kconfig b/drivers/soc/renesas/Kconfig
> index 67604f24973e..543300fe9862 100644
> --- a/drivers/soc/renesas/Kconfig
> +++ b/drivers/soc/renesas/Kconfig
> @@ -334,10 +334,10 @@ if RISCV
> config ARCH_R9A07G043
> bool "RISC-V Platform support for RZ/Five"
> select ARCH_RZG2L
> - select AX45MP_L2_CACHE
> + select AX45MP_L2_CACHE if RISCV_DMA_NONCOHERENT
> select DMA_GLOBAL_POOL
> - select ERRATA_ANDES
> - select ERRATA_ANDES_CMO
> + select ERRATA_ANDES if RISCV_SBI
> + select ERRATA_ANDES_CMO if ERRATA_ANDES
> help
> This enables support for the Renesas RZ/Five SoC.
>
> Or am I missing a simpler way to fix this.
This seems reasonable to me at least /shrug
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2023-08-31 16:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-31 8:52 kernel test robot
2023-08-31 9:16 ` [WARNING: ATTACHMENT UNSCANNED]Re: " Conor Dooley
2023-08-31 11:22 ` Lad, Prabhakar
2023-08-31 11:33 ` Conor Dooley
2023-08-31 11:53 ` Lad, Prabhakar
2023-08-31 12:01 ` Geert Uytterhoeven
2023-08-31 13:01 ` Lad, Prabhakar
2023-08-31 13:24 ` Geert Uytterhoeven
2023-08-31 14:59 ` Lad, Prabhakar
2023-08-31 16:36 ` Conor Dooley [this message]
2023-09-01 8:34 ` Lad, Prabhakar
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=20230831-nimble-rust-00821dccffdf@spud \
--to=conor@kernel.org \
--cc=conor.dooley@microchip.com \
--cc=geert@linux-m68k.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=palmer@rivosinc.com \
--cc=prabhakar.csengg@gmail.com \
--cc=prabhakar.mahadev-lad.rj@bp.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