Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934446AbeAHQJB (ORCPT + 1 other); Mon, 8 Jan 2018 11:09:01 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:37952 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934414AbeAHQIz (ORCPT ); Mon, 8 Jan 2018 11:08:55 -0500 X-Google-Smtp-Source: ACJfBot4xfEEq3+4vuw27wH/TEgm9N9emJtgvoPGaA+6C8Ue+vyMfIaHP0tykqcubYSxB994Bgf9sg== Subject: Re: [PATCH v5 1/3] clocksource/drivers/atcpit100: Add andestech atcpit100 timer To: Arnd Bergmann Cc: Greentime Hu , Greentime , Rick Chen , Rick Chen , Linux Kernel Mailing List , Linus Walleij , linux-arch , Thomas Gleixner , Jason Cooper , Marc Zyngier , Rob Herring , netdev , Vincent Chen , DTML , Al Viro , David Howells , Will Deacon , linux-serial@vger.kernel.org, John Stultz References: <1513057621-19084-1-git-send-email-rickchen36@gmail.com> <1513057621-19084-2-git-send-email-rickchen36@gmail.com> <1e75edb3-8f7b-796c-6871-1612b027050e@linaro.org> From: Daniel Lezcano Message-ID: <78dc7813-524d-c108-0e3d-516f8f4dabfe@linaro.org> Date: Mon, 8 Jan 2018 17:08:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 08/01/2018 16:26, Arnd Bergmann wrote: > On Fri, Jan 5, 2018 at 10:31 AM, Daniel Lezcano > wrote: >>>> No. Can't you add in arch/ndis32/Kconfig ? >>>> >>>> +select TIMER_ATCPIT100 >>>> >>>> Like: >>>> >>>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/Kconfig#n50 >>> >>> IMHO, it might be a little bit wierd if we select TIMER_ATCPIT100 in >>> arch/nds32/Kconfig because it is part of SoC instead of CPU. >>> If we change to another SoC with another timer, we need to select >>> another TIMER in arch/nds32/Kconfig and delete TIMER_ATCPIT100. >>> It seems more flexible to be selected in driver layer. >>> >>> It seems to be the timer is part of the arch to be selected in arch's Kconfig. >>> arch/arc/Kconfig: select ARC_TIMERS >>> arch/arc/Kconfig: select ARC_TIMERS_64BIT >>> arch/arm/Kconfig: select ARM_ARCH_TIMER >>> arch/arm64/Kconfig: select ARM_ARCH_TIMER >>> arch/blackfin/Kconfig: select BFIN_GPTIMERS >> >> No, the timer must be selected from the arch/soc's or whatever Kconfig. >> Not in the clocksource's Kconfig. >> >> eg. >> >> on ARM: >> >> arch/arm/mach-vt8500/Kconfig: select VT8500_TIMER >> arch/arm/mach-bcm/Kconfig: select BCM_KONA_TIMER >> arch/arm/mach-actions/Kconfig: select OWL_TIMER >> arch/arm/mach-digicolor/Kconfig: select DIGICOLOR_TIMER >> >> etc ... >> >> on ARM64: >> >> arch/arm64/Kconfig.platforms: select OWL_TIMER >> arch/arm64/Kconfig.platforms: select ARM_TIMER_SP804 >> arch/arm64/Kconfig.platforms: select MTK_TIMER >> >> etc ... > > I'd actually prefer to not do it for ARM either: Most other subsystems > don't do that, and I don't see a strong reason why clocksource should > be special here. The majority doing the opposite does not mean it is right. Do you know which clock belongs to which board ? Who will unselect a clock ? I'm pretty sure nobody. Everyone relies on the platform Kconfig and expect it to select the right drivers. We don't expect the hackers to have a deep knowledge of the hardware and the driver dependencies. It is very convenient to not care about that and let the platform's Kconfig to select the right drivers. And that is the behavior I would like to keep. > Selecting 'TIMER_OF' from the individual drivers that need it (as you > suggest) makes sense, but I think for ARM we treat SoC families > as a bit too special, in the end they are for the most part collections > of individual hardware blocks that may or may not be present on > some chip. > > In case of risc-v and nds32, I expect that the separation will be > even less visibile in the hardware, as a typical model here is > that one company designs SoCs for multiple customers that each > have different requirements. Some of them may have one > timer and some have another timer or multiple timers, but there > is no strict separation between SoC families as I understand. > Here we'd be better off not having a per-SoC Kconfig option at > all, just a generic defconfig that enables all the drivers that might > be used, and integrators can have a defconfig file that only > enables the stuff they actually use on a given chip. Yes, the result is the same, the option is not showed in the menu. However, I can understand it could be interesting to have the ability to unselect a driver for experts. I'm wondering if we can create a bool_expert which shows up only when CONFIG_EXPERT is set. -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog