Re: [PATCH v2] x86: Add a prompt for HPET_EMULATE_RTC

From: Thomas Gleixner
Date: Tue May 04 2021 - 03:55:20 EST

On Tue, May 04 2021 at 11:21, Anand K. Mistry wrote:
> On Mon, 3 May 2021 at 17:38, Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
>> On Thu, Apr 29 2021 at 16:00, Anand K. Mistry wrote:
>> > This does two things:
>> > 1. Makes the option visible in menuconfig, allowing the user to easily
>> > disable this option
>> > 2. Allows olddefconfig to respect the option if it is set in the old
>> > .config file
>> Well, it's pretty clear WHAT it does, but there is absolutely no
>> reasoning WHY this knob is needed in the first place.
> Without this option, 'make oldolddefconfig' ignores the option in the
> old .confg file and just sets it to the calculated default for the
> platform. An easy way to test this is to do 'make defconfig' on
> x86-64, set CONFIG_HPET_EMULATE_RTC=n in the generated .config, and
> run 'make olddefconfig'. Without this patch, olddefconfig will ignore
> the set option and overwrite it with CONFIG_HPET_EMULATE_RTC=y.

Rightfully so because it's a functional correctness issue. When HPET is
enabled in legacy mode it takes over the RTC interrupt line, which makes
RTC alarms disfunctional and therefore we have to emulate it.

So, no.

> So, part of the why is that this enables the use of olddefconfig with
> the CONFIG_HPET_EMULATE_RTC option. The other part of why is that my
> team uses 'make olddefconfig' by providing a base config and then
> using olddefconfig to fill in the unset values with defaults to make a
> complete config file for a kernel build. I'd like to disable RTC
> emulation on a particular platform, but I can't use a config option to
> do it without this patch because 'make olddefconfig' will just ignore
> the option.

You can like to disable it, but that does not make it more correct. See
above. If your platform does not have RTC_DRV_CMOS then you have to
disable that which will also clear CONFIG_HPET_EMULATE_RTC.