From: "Arnd Bergmann" <arnd@arndb.de>
To: "Huacai Chen" <chenhuacai@kernel.org>
Cc: "Thomas Weißschuh" <thomas@t-8ch.de>,
"Huacai Chen" <chenhuacai@loongson.cn>,
loongarch@lists.linux.dev,
Linux-Arch <linux-arch@vger.kernel.org>,
"Xuefeng Li" <lixuefeng@loongson.cn>, guoren <guoren@kernel.org>,
"WANG Xuerui" <kernel@xen0n.name>,
"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH V3 13/14] LoongArch: Adjust default config files for 32BIT/64BIT
Date: Tue, 25 Nov 2025 18:54:47 +0100 [thread overview]
Message-ID: <4c58592d-224b-481c-a728-3c279f8e55cd@app.fastmail.com> (raw)
In-Reply-To: <CAAhV-H4Df+c47ocBn2SN3iHDbFWGg9-i2+wY27TvtcpBa=pp7Q@mail.gmail.com>
On Sat, Nov 22, 2025, at 15:13, Huacai Chen wrote:
> On Sat, Nov 22, 2025 at 7:57 PM Arnd Bergmann <arnd@arndb.de> wrote:
>> On Sat, Nov 22, 2025, at 10:45, Thomas Weißschuh wrote:
>> > On 2025-11-22 12:36:33+0800, Huacai Chen wrote:
>> >> diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile
>> >> index 96ca1a688984..cf9373786969 100644
>> >> --- a/arch/loongarch/Makefile
>> >> +++ b/arch/loongarch/Makefile
>> >> @@ -5,7 +5,12 @@
>> >>
>> >> boot := arch/loongarch/boot
>> >>
>> >> -KBUILD_DEFCONFIG := loongson3_defconfig
>> >> +ifdef CONFIG_32BIT
>> >
>> > Testing for CONFIG options here doesn't make sense, as the config is not yet
>> > created.
>>
>> > Either test for $(ARCH) or uname or just use one unconditionally.
>>
>> I don't really like the $(ARCH) hacks, nobody is going to build kernels
>> natively on loongarch32, and for the rest it's fine to set the option.
> OK, I will use 'uname -m' for checking. Though native builds on
> loongarch32 will hardly happen, we can give a small chance to use
> loongson32_defconfig, in all other cases, let's use
> loongson64_defconfig.
What I meant is not to guess the CONFIG_64BIT option from any
part of the build environment other than the actual .config settings.
$(ARCH) is initialized from 'uname -m' in scripts/subarch.include,
and I think this should stay unchanged.
>> > Also as mentioned before, snippets can reduce the duplication.
>> >
>> >> +KBUILD_DEFCONFIG := loongson32_defconfig
>> >> +else
>> >> +KBUILD_DEFCONFIG := loongson64_defconfig
>> >> +endif
>> >> +
>>
>> This is also not the change I had suggested in my review. I think this
>> should be a fragment along the lines of arch/mips/configs/generic/32r2.config
>> and arch/powerpc/configs/book3s_32.config.
>
> Sorry for that. I know that the default config file is usually
> generated by 'make savedefconfig', and the main purpose is
> significantly reducing file size. I did that, but manually add some
> lines such as CONFIG_LOONGARCH, CONFIG_32BIT/64BIT, CONFIG_ACPI,
> CONFIG_EFI, etc. My original goal of doing this is to let users easily
> know those fundamental options without reading Kconfig files (of
> course we should not increase the defconfig too much).
>
> Sorry again for not explaining about this in the previous version.
I don't mind having the extra options in the generic defconfig
file, that is unusual but I see your logic there.
My point here is that you should absolutely not duplicate the
contents but only put the differences into the new file, such
as
+++ arch/loongarch/configs/loongson32.config
CONFIG_32BIT=y
# CONFIG_64BIT is not set
CONFIG_32BIT_STANDARD=y
CONFIG_MACH_LOONGSON32=y
# CONFIG_SMP is not set
# CONFIG_LOONGSON3_CPUFREQ is not set
# CONFIG_IPMI_HANDLER is not set
# CONFIG_TCG_TPM is not set
# CONFIG_I2C_LS2X is not set
# CONFIG_PINCTRL_LOONGSON2 is not set
CONFIG_GPIO_LOONGSON1=y
# CONFIG_GPIO_LOONGSON is not set
CONFIG_WATCHDOG=y
CONFIG_LOONGSON1_WDT=m
# CONFIG_LOONGSON2_THERMAL=m is not set
# CONFIG_IOMMU_SUPPORT is not set
CONFIG_LOONGSON1_APB_DMA=y
# CONFIG_LOONGSON2_APB_DMA is not set
# CONFIG_PWM_LOONGSON is not set
This way, running 'make defconfig; make loongson32.config'
should produce the same output as your current
'make loongson32_defconfig', but it is much easier to keep
the two in sync because any future changes only
have to be done in the shared file.
Arnd
next prev parent reply other threads:[~2025-11-25 17:55 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-22 4:36 [PATCH V3 00/14] LoongArch: Add basic LoongArch32 support Huacai Chen
2025-11-22 4:36 ` [PATCH V3 01/14] LoongArch: Add atomic operations for 32BIT/64BIT Huacai Chen
2025-11-22 4:36 ` [PATCH V3 02/14] LoongArch: Add adaptive CSR accessors " Huacai Chen
2025-11-22 4:36 ` [PATCH V3 03/14] LoongArch: Adjust common macro definitions " Huacai Chen
2025-11-22 4:36 ` [PATCH V3 04/14] LoongArch: Adjust boot & setup " Huacai Chen
2025-11-22 4:36 ` [PATCH V3 05/14] LoongArch: Adjust memory management " Huacai Chen
2025-11-22 4:36 ` [PATCH V3 06/14] LoongArch: Adjust process " Huacai Chen
2025-11-22 4:36 ` [PATCH V3 07/14] LoongArch: Adjust time routines " Huacai Chen
2025-11-22 4:36 ` [PATCH V3 08/14] LoongArch: Adjust module loader " Huacai Chen
2025-11-22 4:36 ` [PATCH V3 09/14] LoongArch: Adjust system call " Huacai Chen
2025-11-22 4:36 ` [PATCH V3 10/14] LoongArch: Adjust user accessors " Huacai Chen
2025-11-22 4:36 ` [PATCH V3 11/14] LoongArch: Adjust misc routines " Huacai Chen
2025-11-22 4:36 ` [PATCH V3 12/14] LoongArch: Adjust VDSO/VSYSCALL " Huacai Chen
2025-11-22 4:36 ` [PATCH V3 13/14] LoongArch: Adjust default config files " Huacai Chen
2025-11-22 9:45 ` Thomas Weißschuh
2025-11-22 11:56 ` Arnd Bergmann
2025-11-22 14:13 ` Huacai Chen
2025-11-25 17:54 ` Arnd Bergmann [this message]
2025-11-26 8:02 ` Huacai Chen
2025-11-22 11:58 ` Huacai Chen
2025-11-22 12:24 ` Thomas Weißschuh
2025-11-22 4:36 ` [PATCH V3 14/14] LoongArch: Adjust build infrastructure " Huacai Chen
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=4c58592d-224b-481c-a728-3c279f8e55cd@app.fastmail.com \
--to=arnd@arndb.de \
--cc=chenhuacai@kernel.org \
--cc=chenhuacai@loongson.cn \
--cc=guoren@kernel.org \
--cc=jiaxun.yang@flygoat.com \
--cc=kernel@xen0n.name \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lixuefeng@loongson.cn \
--cc=loongarch@lists.linux.dev \
--cc=thomas@t-8ch.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
all inboxes | Powered by JetHome®