Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2237237imm; Mon, 24 Sep 2018 00:14:52 -0700 (PDT) X-Google-Smtp-Source: ACcGV60/8Z/CLk3lBpr+l2er40nd3YU5wvSIroUiZAHtOCq0Hv++o262FvE6/r5RzZTMUI5Ip+ug X-Received: by 2002:a63:a362:: with SMTP id v34-v6mr8304144pgn.261.1537773292878; Mon, 24 Sep 2018 00:14:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537773292; cv=none; d=google.com; s=arc-20160816; b=bkbyJnthb7F86mATFK52KxqJJt3/A/Ta6LBTlvs50G/yTRppVuVH7p6Nw/NLE4IGpt fDX9Dn96LwtkkAB6QciUMnE+vldxGsn6Xr31Pu2t1Zfqwuwimdj18LBNo9weMcCaIe/U /rg4GKXANOhwwZ5DpgjlR5d9BpPQsCq9WPcCJhw6WJMui/xDzeG3IxozbZR6I+ze5n92 U3VUDUv+boPwaewNwE24RR3wWFC+ENEEKd0QjKOtmR6km7WDCF47KpD7t4AaCKs9b1eu DMwkuUQZzYgM3ATlkT/Ew9jnQ5GuAfAAVe19pDVtnlrJqLyi/gpmjBbiuXZfg9hTWQhW EMAw== 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; bh=WuG1X1M3KFSddiJgkJ0AwqTU/xMGLDpRyA5DOLC5w1U=; b=C6VmFFE2C1QcESOWUqmnfLkefnaKjjPgnySsF1fxKfGrX87L9d3iA+BIYUFaHNECbC LaWIf+u/3BuJQa16U2SLkj3lGRjc0DXi1dQglcHJyTHigiJD7GvATK+4C2zkf9lYUfi0 61n4FG4hRJLaFPJGVDTKrasz3wrokVOionPFOzYwy6o8Rz0Cr2HT66Sl4rDel692Q3h3 IgzUtBBy/xOZCR0Evz8naKFrm0xYh7oiRFThfD24K1JY/Paq3f8F0gCEw1yXFY0KxEgm Xg2nYdvwjU/gGnQBLpoKdTe16ND8cQBHhKXyA5vQxNIVFkPV/y6DC3QmNuU9ld3DZm9I ouGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S+o2Fv41; 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 m19-v6si33845673pgj.155.2018.09.24.00.14.37; Mon, 24 Sep 2018 00:14: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=S+o2Fv41; 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 S1727540AbeIXNPL (ORCPT + 99 others); Mon, 24 Sep 2018 09:15:11 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:42236 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726061AbeIXNPL (ORCPT ); Mon, 24 Sep 2018 09:15:11 -0400 Received: by mail-wr1-f67.google.com with SMTP id b11-v6so2310098wru.9 for ; Mon, 24 Sep 2018 00:14:29 -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=WuG1X1M3KFSddiJgkJ0AwqTU/xMGLDpRyA5DOLC5w1U=; b=S+o2Fv41yiCbgxZnkAkjHKlxTtIEptB915xs1gdcKJQ3uXDJvskK56BFGCRuopQQ2t gWLg0P3P8LXWegkr66xzTgMxPp8E3i9huZUKOGup/ehJb7LxiIqhZx1MkJ25C6FRWo/p KaqGgKbUCeup3TLkPgxlf/W1mRwj/ceywId9g= 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=WuG1X1M3KFSddiJgkJ0AwqTU/xMGLDpRyA5DOLC5w1U=; b=JMz+PYktjkHw41dCcJ0hr89yHcUOXgS2wDZchXT805yg1govZeC6KarFHxrR9NfBf4 RX+OfDJLDMomrNnrzmQM89fkPjT3kuuxgK2wc92dGCfH1PUevrU8sx5Ki4ANI+lpJtqn eDmHhq4bSW+bBzlrrZx3FRj+7ImqIcxFsCByyR5xqhj+3Ci9jqa0PRtCJZ7tTfx2DBg9 l8BQW8lxRERhsZMj13HjQHSwechxa73EG3yEQdyrZSxAfJZP57sZ6wJKAr/cNXeWNRZj HVYgDyfXXbUU5A6BoyxuYCJlSZttWguS/sV293DPmc8NWse8DirnNxuwBzAMtjGEFRhA oIDA== X-Gm-Message-State: ABuFfohhCGwV8lqdkeHbDhP6nidWxiYWw4fQhLXiumwxuLv1aIqI5udd ru0ZIcn3ew5GgUJBUhdNfErCjg== X-Received: by 2002:a5d:4b52:: with SMTP id w18-v6mr7202299wrs.87.1537773268575; Mon, 24 Sep 2018 00:14:28 -0700 (PDT) Received: from [192.168.0.41] (89.154.136.77.rev.sfr.net. [77.136.154.89]) by smtp.googlemail.com with ESMTPSA id l5sm838709wrx.69.2018.09.24.00.14.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Sep 2018 00:14:27 -0700 (PDT) Subject: Re: [PATCH v7 05/24] clocksource: Add a new timer-ingenic driver To: Paul Cercueil Cc: Mathieu Malaterre , Thomas Gleixner , Rob Herring , linux-doc@vger.kernel.org, linux-watchdog@vger.kernel.org, Jonathan Corbet , od@zcrc.me, linux-mips@linux-mips.org, Paul Burton , Mark Rutland , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Ralf Baechle , Thierry Reding , linux-pwm@vger.kernel.org References: <5ba88a1a.1c69fb81.2ba56.ccdaSMTPIN_ADDED_MISSING@mx.google.com> From: Daniel Lezcano Message-ID: Date: Mon, 24 Sep 2018 09:14:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <5ba88a1a.1c69fb81.2ba56.ccdaSMTPIN_ADDED_MISSING@mx.google.com> 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 24/09/2018 08:53, Paul Cercueil wrote: > > Le 24 sept. 2018 07:58, Daniel Lezcano a écrit : >> >> On 24/09/2018 07:49, Paul Cercueil wrote: >>> >>> Le 24 sept. 2018 07:35, Daniel Lezcano a >>> écrit : >>>> >>>> On 24/09/2018 07:24, Paul Cercueil wrote: >>>>> Hi Daniel, >>>>> >>>>> Le 24 sept. 2018 05:12, Daniel Lezcano >>>>> a écrit : >>>>>> >>>>>> On 21/08/2018 19:16, Paul Cercueil wrote: >>>>>>> This driver handles the TCU (Timer Counter Unit) present on >>>>>>> the Ingenic JZ47xx SoCs, and provides the kernel with a >>>>>>> system timer, and optionally with a clocksource and a >>>>>>> sched_clock. >>>>>>> >>>>>>> It also provides clocks and interrupt handling to client >>>>>>> drivers. >>>>>> >>>>>> Can you provide a much more complete description of the timer >>>>>> in order to make my life easier for the review of this patch? >>>>> >>>>> See patch [03/24], it adds a doc file that describes the >>>>> hardware. >>>> >>>> Thanks, I went through but it is incomplete to understand what the >>>> timer do. I will reverse-engineer the code but it would help if you >>>> can give the gross approach. Why multiple channels ? mutexes and >>>> completion ? >>> >>> Much of the complexity is because of the multi-purpose nature of the >>> TCU channels. Each one can be used as timer/clocksource, or PWM. >>> >>> The driver starts by using channels 0 and 1 as system timer and >>> clocksource, respectively, the other ones being unused for now. Then, >>> *if* the PWM driver requests one of the channels in use by the >>> timer/clocksource driver, say channel 0, the timer/clocksource driver >>> will dynamically reassign the system timer to a free channel, from >>> channel 0 to e.g. channel 2. Only in that case the completion/mutex >>> are actually used. >> >> Why do you need to do this? Can't be the channels dedicated and reserved >> for clocksource and clockevent? > > That's what I had in place (ingenic,timer-channel and ingenic,clocksource-channel DT properties), but Rob didn't want any linux-specific properties in the devicetree binding :( Isn't possible to specify the channel to use in the DT? like renesas16 ? -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog