Received: by 10.213.65.68 with SMTP id h4csp430630imn; Sat, 31 Mar 2018 01:11:53 -0700 (PDT) X-Google-Smtp-Source: AIpwx492mWiGAIrd1idNsMtpo2I/0Y50lK3wMn4ubbAEuUmLSiiLcFiOo69LLUiUAtPKtPGUB5Dl X-Received: by 10.101.100.9 with SMTP id a9mr1352416pgv.209.1522483913004; Sat, 31 Mar 2018 01:11:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522483912; cv=none; d=google.com; s=arc-20160816; b=r+hM0ghCgW125UFx/9jm6/oppSrMFBI9NLG6vKgX+8pfiumpPj9xYEEqH40z6wBP+5 3EXnkkp9wgF8jKAQxmGwONyYK9LEeY+Q4YnUoANbk3Q4i0kH3euTIp29OJIWCsMWpci9 TU1c9Q9JE7gcl2cRAJT6IoA5XQpzh3p0UJji5BAVsomjVCNaCL1u2xy4OKQ1IL/aWJTN vKNGSyR8Kaf+gKyg1svbdID3PZTf8J+6y0J5rvysw1XTw08R0YSwwEdgVgle7+r658m1 U4XQsifEgfSbojmCE7zwXV77dlntEMoweSUrjrYeEIGjhMnO/yh9twK1RX8zKvLEm0Uc VdVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=fW0SEuK8scGBMA/m7lC76lqBtYQUJ2WAUA9NxgYsXUg=; b=BXYCtMRQMMvEmV3wK/G1pUgXX/oGOibz6YYum4rPN9n3dqmhT5uip2yMSTl1JvycxY Nr+6Ig6lzz7TNXHtF0rf5pMUjQf4zE/1NB0ZvGdx8ErESlT3W8gSXwvR5zqKBB4OpJGr 7yChpBvQZDETnpwfQabALxEe1RjGoSo4WnxFX3lXCVoPQ3wFc8jqKAfYygODBAS1fs70 Y/RPPzLIXRAndqBLpVsSNfouwwrpW26ypNfn879zNnUwuch34j4vhMLxelKHJAAHgkEB Epl8BGY3sJdG/YwNdsuXUqnJ7M8nwHadAdhW1MtdU+LkLcg7G/A8Yd2yH9TuXADoFUzQ 7ipA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gBTHZK2T; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p13-v6si10359391pll.416.2018.03.31.01.11.37; Sat, 31 Mar 2018 01:11:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gBTHZK2T; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752068AbeCaIKV (ORCPT + 99 others); Sat, 31 Mar 2018 04:10:21 -0400 Received: from mail-wm0-f53.google.com ([74.125.82.53]:37956 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751564AbeCaIKP (ORCPT ); Sat, 31 Mar 2018 04:10:15 -0400 Received: by mail-wm0-f53.google.com with SMTP id l16so19732956wmh.3 for ; Sat, 31 Mar 2018 01:10:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=fW0SEuK8scGBMA/m7lC76lqBtYQUJ2WAUA9NxgYsXUg=; b=gBTHZK2TATIKpZ0TAzJtmeSuFPSKq4IfeHVufeptcef8gtTjhmWL/SvhxivSWibu0l KjuYSk546jKaGUt61NIad6bIA03Y7tqvfGgNfX/AsbwfjZLYjC2uo5dvZBxetaYFkRJ+ FHiH4+j5fJfateHEG0s4ozMWKdwGXuoqwWHM4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=fW0SEuK8scGBMA/m7lC76lqBtYQUJ2WAUA9NxgYsXUg=; b=Zget4duYKnXBd9uV0kclv5odnI7z97Fj8eLqCC8TGJmH6TnvwaQTDO3ONNdOX8yY37 NpZ+m4fsliKWZYcIj78/SRxAE4pNqW2Ymot0rQ8EZHYrMCvLCbOTjYtmcdvXXpQLGcTv LVEV3og/NtRyeVbntiakux+WZpeTUPdtqiEze/b06WHBG1sKAMkYOF9Wg+E4YRXWT6hQ F5An+QwgZrmetLl5PpWeh/ccmPIayg0bLlrtc3SELJeDyIXoUS9YDzDXVO3aQ7hfwPQj zOH8WQF5nSp+RbOlX/sWnA9Kv3aQd8kWlpTTOZkpVhmYti9aq7OFp37pxEU8qhcifNLH LnQQ== X-Gm-Message-State: AElRT7E3bMgrbCVcAvtc2DAgiJhPRKyzELuQ2YAwIE+PsDbwo6VXLmNQ DOD3aPm5nkM3axuEJK+M6twdOg== X-Received: by 10.28.37.134 with SMTP id l128mr4405233wml.10.1522483814065; Sat, 31 Mar 2018 01:10:14 -0700 (PDT) Received: from [192.168.0.77] (135-224-190-109.dsl.ovh.fr. [109.190.224.135]) by smtp.googlemail.com with ESMTPSA id n29sm7303358wmi.32.2018.03.31.01.10.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 31 Mar 2018 01:10:13 -0700 (PDT) Subject: Re: [PATCH v4 7/8] clocksource: Add a new timer-ingenic driver To: Paul Cercueil Cc: Thomas Gleixner , Jason Cooper , Marc Zyngier , Lee Jones , Ralf Baechle , Rob Herring , Jonathan Corbet , Mark Rutland , James Hogan , Maarten ter Huurne , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org, linux-doc@vger.kernel.org References: <20180110224838.16711-2-paul@crapouillou.net> <20180317232901.14129-1-paul@crapouillou.net> <20180317232901.14129-8-paul@crapouillou.net> <06976e4ae275c4cc0bddacc5e0c0c9a9@crapouillou.net> <1522335149.1792.0@smtp.crapouillou.net> From: Daniel Lezcano Message-ID: <2234006b-30ff-d5a8-b14a-d6e307c06145@linaro.org> Date: Sat, 31 Mar 2018 10:10:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1522335149.1792.0@smtp.crapouillou.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29/03/2018 16:52, Paul Cercueil wrote: > > > Le mer. 28 mars 2018 à 18:25, Daniel Lezcano > a écrit : >> On 28/03/2018 17:15, Paul Cercueil wrote: >>>  Le 2018-03-24 07:26, Daniel Lezcano a écrit : >>>>  On 18/03/2018 00:29, Paul Cercueil wrote: >>>>>  This driver will use the TCU (Timer Counter Unit) present on the >>>>> Ingenic >>>>>  JZ47xx SoCs to provide the kernel with a clocksource and timers. >>>> >>>>  Please provide a more detailed description about the timer. >>> >>>  There's a doc file for that :) >> >> Usually, when there is a new driver I ask for a description in the >> changelog for reference. >> >>>>  Where is the clocksource ? >>> >>>  Right, there is no clocksource, just timers. >>> >>>>  I don't see the point of using channel idx and pwm checking here. >>>> >>>>  There is one clockevent, why create multiple channels ? Can't you >>>> stick >>>>  to the usual init routine for a timer. >>> >>>  So the idea is that we use all the TCU channels that won't be used >>> for PWM >>>  as timers. Hence the PWM checking. Why is this bad? >> >> It is not bad but arguable. By checking the channels used by the pwm in >> the code, you introduce an adherence between two subsystems even if it >> is just related to the DT parsing part. >> >> As it is not needed to have more than one timer in the time framework >> (at least with the same characteristics), the pwm channels check is >> pointless. We can assume the author of the DT file is smart enough to >> prevent conflicts and define a pwm and a timer properly instead of >> adding more code complexity. >> >> In addition, simplifying the code will allow you to use the timer-of >> code and reduce very significantly the init function. > > That's what I had in my V1 and V2, my DT node for the timer-ingenic driver > had a "timers" property (e.g. "timers = <4 5>;") to select the channels > that > should be used as timers. Then Rob told me I shouldn't do that, and instead > detect the channels that will be used for PWM. > [ ... ] How do you specify the channels used for PWM ? >>>>> >>>>>  +config INGENIC_TIMER >>>>>  +    bool "Clocksource/timer using the TCU in Ingenic JZ SoCs" >>>>>  +    depends on MACH_INGENIC || COMPILE_TEST >>>> >>>>  bool "Clocksource/timer using the TCU in Ingenic JZ SoCs" if >>>> COMPILE_TEST >>>> >>>>  Remove the depends MACH_INGENIC. >>> >>>  This driver is not useful on anything else than Ingenic SoCs, why >>> should I >>>  remove MACH_INGENIC then? >> >> For COMPILE_TEST on x86. > > Well that's a logical OR right here, so it will work... Right, I missed the second part of the condition. For consistency reason, we don't add a dependency on the platform. The platform will select it. Look the other timer options and you will see there is no MACH deps. I'm trying consolidating all these options to have same format and hopefully factor them out. -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog