Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Randy Dunlap <rdunlap@infradead.org>, linux-kernel@vger.kernel.org
Cc: kernel test robot <lkp@intel.com>,
	Dengcheng Zhu <dzhu@wavecomp.com>,
	John Crispin <john@phrozen.org>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	linux-mips@vger.kernel.org, Qais Yousef <qyousef@layalina.io>
Subject: Re: [PATCH] MIPS: vpe-mt: provide a default 'physical_memsize'
Date: Tue, 14 Feb 2023 08:40:01 +0100	[thread overview]
Message-ID: <7a2eca01-8420-dd98-9d4d-edf192f099fb@linaro.org> (raw)
In-Reply-To: <20230214010942.25143-1-rdunlap@infradead.org>

Hi Randy,

On 14/2/23 02:09, Randy Dunlap wrote:
> When neither LANTIQ nor MIPS_MALTA is set, 'physical_memsize' is not
> declared. This causes the build to fail with:
> 
> mips-linux-ld: arch/mips/kernel/vpe-mt.o: in function `vpe_run':
> arch/mips/kernel/vpe-mt.c:(.text.vpe_run+0x280): undefined reference to `physical_memsize'
> 
> Fix this by declaring a 0-value physical_memsize with neither LANTIQ
> nor MIPS_MALTA is set, like LANTIQ does.
> 
> Fixes: 1a2a6d7e8816 ("MIPS: APRP: Split VPE loader into separate files.")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Reported-by: kernel test robot <lkp@intel.com>
> Link: https://lore.kernel.org/all/202302030625.2g3E98sY-lkp@intel.com/
> Cc: Dengcheng Zhu <dzhu@wavecomp.com>
> Cc: John Crispin <john@phrozen.org>
> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> Cc: linux-mips@vger.kernel.org
> ---
> How has this build error not been detected for 10 years?
> 
>   arch/mips/kernel/vpe-mt.c |    9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff -- a/arch/mips/kernel/vpe-mt.c b/arch/mips/kernel/vpe-mt.c
> --- a/arch/mips/kernel/vpe-mt.c
> +++ b/arch/mips/kernel/vpe-mt.c
> @@ -22,6 +22,15 @@ static int major;
>   /* The number of TCs and VPEs physically available on the core */
>   static int hw_tcs, hw_vpes;
>   
> +#if !defined(CONFIG_MIPS_MALTA) && !defined(CONFIG_LANTIQ)
> +/* The 2 above provide their own 'physical_memsize' variable. */

Which seems dubious. The variable should be defined once, likely in
arch/mips/kernel/vpe-mt.c, since arch/mips/include/asm/vpe.h declares
it.

I'm surprised CONFIG_MIPS_MALTA always links malta-dtshim.o, but
malta-dtshim.o depends on MIPS_VPE_LOADER_MT, and I can't find a
CONFIG_MIPS_MALTA -> MIPS_VPE_LOADER_MT Kconfig dep.

> +/*
> + * This is needed by the vpe-mt loader code, just set it to 0 and assume
> + * that the firmware hardcodes this value to something useful.
> + */
> +unsigned long physical_memsize = 0L;

I agree this is where this variable has be be declared / initialized,
but having this dependent on CONFIG_MIPS_MALTA/CONFIG_LANTIQ machines
doesn't seem right.

> +#endif
> +
>   /* We are prepared so configure and start the VPE... */
>   int vpe_run(struct vpe *v)
>   {

Regards,

Phil.

  reply	other threads:[~2023-02-14  7:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-14  1:09 [PATCH] MIPS: vpe-mt: provide a default 'physical_memsize' Randy Dunlap
2023-02-14  7:40 ` Philippe Mathieu-Daudé [this message]
2023-02-14 18:29   ` Randy Dunlap
2023-02-16  6:59   ` Randy Dunlap
2023-02-17 11:57     ` Thomas Bogendoerfer
2023-02-17 20:04       ` Randy Dunlap
2023-02-17 23:24       ` Randy Dunlap
2023-02-19  8:40         ` Thomas Bogendoerfer

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=7a2eca01-8420-dd98-9d4d-edf192f099fb@linaro.org \
    --to=philmd@linaro.org \
    --cc=dzhu@wavecomp.com \
    --cc=john@phrozen.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=qyousef@layalina.io \
    --cc=rdunlap@infradead.org \
    --cc=tsbogend@alpha.franken.de \
    /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