Subject: Dropping "depends on SMP" for HAVE_ARM_TWD -- take 2

From: [email-masked] (Mason)
Date: Fri, 2 Oct 2015 20:50:35 +0200

On 02/10/2015 20:02, Stephen Boyd wrote:
> On 10/02, Mason wrote:
>> [ Adding original reporter ]
>>
>> On 02/10/2015 11:52, Mason wrote:
>>
>>> [ take 1 was sent on 2015-03-26 ]
>>>
>>> Hello everyone,
>>>
>>> In http://thread.gmane.org/gmane.linux.ports.arm.kernel/389931/focus=392348
>>> Stephen Boyd wrote:
>>>
>>>> I don't see any problem with the TWD dropping the dependency on SMP.
>>>> The code should work the same on a UP configuration [...]
>>>
>>> And Arnd recently said:
>>>
>>>> I think this has come up before and should be fixed. Could you
>>>> send a patch that allows using TWD in uniprocessor configurations?
>>>
>>> Basically, this means reverting Shawn Guo's 904464b91eca patch.
>>> and removing "depends on SMP" for HAVE_ARM_TWD.
>>>
>>> However, Shawn's patch fixed an issue, therefore it seems likely
>>> that simply reverting is not the proper solution?
>>>
>>> What should I do?
>>
>> For reference, the warning used to be:
>>
>>     ------------[ cut here ]------------
>>     WARNING: at arch/arm/kernel/smp_twd.c:345
>>     twd_local_timer_of_register+0x7c/0x90()
>>     twd_local_timer_of_register failed (-6)
>>     Modules linked in:
>>     Backtrace:
>>     [<80011f14>] (dump_backtrace+0x0/0x10c) from [<8044dd30>]
>>     (dump_stack+0x18/0x1c)
>>      r7:805e9f58 r6:805ba84c r5:80539331 r4:00000159
>>     [<8044dd18>] (dump_stack+0x0/0x1c) from [<80020fbc>]
>>     (warn_slowpath_common+0x54/0x6c)
>>     [<80020f68>] (warn_slowpath_common+0x0/0x6c) from [<80021078>]
>>     (warn_slowpath_fmt+0x38/0x40)
>>      r9:412fc09a r8:8fffffff r7:ffffffff r6:00000001 r5:80633b8c
>>     r4:80b32da8
>>     [<80021040>] (warn_slowpath_fmt+0x0/0x40) from [<805ba84]
>>     (twd_local_timer_of_register+0x7c/0x90)
>>      r3:fffffffa r2:8053934b
>>     [<805ba7d0>] (twd_local_timer_of_register+0x0/0x90) from [<805c0bec>]
>>     (imx6q_timer_init+0x18/0x4c)
>>      r5:80633800 r4:8053b701
>>     [<805c0bd4>] (imx6q_timer_init+0x0/0x4c) from [<805ba4e8>]
>>     (time_init+0x28/0x38)
>>      r5:80633800 r4:805dc0f4
>>     [<805ba4c0>] (time_init+0x0/0x38) from [<805b6854>]
>>     (start_kernel+0x1a0/0x310)
>>     [<805b66b4>] (start_kernel+0x0/0x310) from [<10008044>] (0x10008044)
>>      r8:1000406a r7:805f3f8c r6:805dc0c4 r5:805f0518 r4:10c5387d
>>     ---[ end trace 1b75b31a2719ed1c ]---
>>
>>
>> I cannot reproduce on v4.2 + my platform...
> 
> The warning has been removed in commit 5028090d1da1 (ARM: 8434/1:
> Revert "7655/1: smp_twd: make twd_local_timer_of_register() no-op
> for nosmp", 2015-09-14) sitting in linux-next.

Does that mean it will automatically make it into v4.3?

> Oddly, that commit doesn't remove the depends on SMP for the Kconfig.

Perhaps because the commit is just a revert, and the depends
statement has been here since the beginning (f32f4ce257452)

> So it seems that we can apply this patch and everyone is happy?
> We could also drop the "if SMP" part of most of the platform
> selects if anyone actually cares.

My port requires the TWD to function. So I'm using
select HAVE_ARM_TWD (no "if SMP") to have it work
even on MULTIPLATFORM UP configs.

> ---8<----
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 369791fb619c..be64d9d604c3 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -1389,7 +1389,6 @@ config HAVE_ARM_ARCH_TIMER
>  
>  config HAVE_ARM_TWD
>  	bool
> -	depends on SMP
>  	select CLKSRC_OF if OF
>  	help
>  	  This options enables support for the ARM timer and watchdog unit

Regards.