Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp443921imm; Wed, 26 Sep 2018 01:06:21 -0700 (PDT) X-Google-Smtp-Source: ACcGV62v4TKq6OIBzIokteahv0tAhrp3R48YX8TZ3N+fhjlM2RNKKXoGjI/UfQUgbO80pgQEP6+N X-Received: by 2002:a63:2a0b:: with SMTP id q11-v6mr4457687pgq.36.1537949181661; Wed, 26 Sep 2018 01:06:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537949181; cv=none; d=google.com; s=arc-20160816; b=sgjrB3Swm7TMQ1NCyyiz8LkC7L7ggalTiksWgYLdUOLmnhPd5uWAjKuyqKT3+u78rP OSvt3Rhj28a8ZJfJ5xADx/Hej7IHT54ACUsQKcilY1z1UysbZXmPrgyDrxCf+d4sBiW+ iUU/6uk+kTWYlD8o/XcCIwdqkcGM/h5fm7m7o5zF/dElUasfJF4pCcBckWl3fhCBRwgl 1KctqVbN3XeV4yI5kuz0tRolvMiOM36oh+PfqGSkkIx2a2+7JBENXJq6zVQi/dorz5WU fxzgbfIRhbA5mPRRSviDnx+ObcLqdCANJweIfCjQIi7PTa30s1+1Gx8rrwNjgRwdbYTB WwJg== 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=ONWisPtFURwS+Dv/RY9Ijg+ZXudgqyV5XWp/wD93EE4=; b=A2GbHN0lDEIkO07mb01CZr+HZJfKfknmmnYPAj0hN8XnCMZFNXa+usVQ9V2icmjoGC KFUnQlCWP1NH2/qL9D3npfbEY2QUo0Qr2NQeF6QkB+RsXYIMCxdXEN9i+cEfppXxHeWi vaicTsm9H53a1U41xkkywfhnzSQSQ87epoZ6TSSbhO4kEnTZVZIWXa+eTwxK2kF8DI3Z 1kT25pnZycpwxWIXuVk0T842WM7HRqjVJA0DKBWyHFYO5gtUywBe57fJSXaQ8GzyjPok S+0FIa8LTn3mH4Nv8K+4qsczPDvSBQ+3bWSCj289y4Tt27JNC11gbWCvOcGs6W/Yc157 an+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KDukd2yS; 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 23-v6si4471619pgs.356.2018.09.26.01.06.06; Wed, 26 Sep 2018 01:06:21 -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=KDukd2yS; 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 S1727472AbeIZOQ7 (ORCPT + 99 others); Wed, 26 Sep 2018 10:16:59 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:33340 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726436AbeIZOQ6 (ORCPT ); Wed, 26 Sep 2018 10:16:58 -0400 Received: by mail-wm1-f66.google.com with SMTP id r1-v6so14486609wmh.0 for ; Wed, 26 Sep 2018 01:05:16 -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=ONWisPtFURwS+Dv/RY9Ijg+ZXudgqyV5XWp/wD93EE4=; b=KDukd2ySxu3ajHjovgrOo8VKtSSAwHEUxFESObdGL6Gp9oEw5g8aXWSVu3aHB3ar5a 4GrQte6urNaoeZ4/7RB2JAyflTfF8kZHR/ksDpGVqNXl0nfznGnNOAYQN8YnCX84ROiO c14ErtmL52sfmrXmUbmK39VwmE55Rr07MRCSw= 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=ONWisPtFURwS+Dv/RY9Ijg+ZXudgqyV5XWp/wD93EE4=; b=k10ulA6Kq6rc9qrLFk3316x2ENKCrktlzAqQhCSXxoTHh2puF9uLKPngimUlZNofBJ 8OWGpYRDXkJnRfhr5oQrP5Tpbh5Kyjmx2MI7BR0UQmmDBesGgD71TQc83c/LSV+7QqCC SRG/DzFPGVHY5CoYwX8N9M84UuTxpoqyBxKYLfqY836yQ/2b4oePRwv4cXD9BUprfJSS m2r5ueYgkLY7RupnWDoVL+V1JJjM3jSkzfNgG7BV5Jgk690rK7/oGWPU5m7T1VigCCbX hfIIWqGXIxpgoENmCJrLYQ1/ohRxop4ynM6TAG6tX/rDsLIngON34Qw/8wfHQdsEaE43 7bYA== X-Gm-Message-State: ABuFfoj1jC7vpYQdYT/jfv8iLcW+45SLFi11RksXISMwtzJPEYpLBq6t HV3pSe24fC7SZx6KRhPkelDARw== X-Received: by 2002:a1c:b58e:: with SMTP id e136-v6mr3234019wmf.114.1537949115637; Wed, 26 Sep 2018 01:05:15 -0700 (PDT) Received: from [192.168.0.41] (42.168.88.92.rev.sfr.net. [92.88.168.42]) by smtp.googlemail.com with ESMTPSA id k7-v6sm4468535wmf.41.2018.09.26.01.05.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Sep 2018 01:05:14 -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: <5bab3024.1c69fb81.b6a71.9c38SMTPIN_ADDED_MISSING@mx.google.com> From: Daniel Lezcano Message-ID: <5af26854-0752-312b-6148-3ffa9abb2570@linaro.org> Date: Wed, 26 Sep 2018 10:05:13 +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: <5bab3024.1c69fb81.b6a71.9c38SMTPIN_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 26/09/2018 08:01, Paul Cercueil wrote: > > Le 25 sept. 2018 10:12 PM, Daniel Lezcano a écrit : >> >> On 25/09/2018 15:38, Paul Cercueil wrote: >>> >>> Le 24 sept. 2018 9:14 AM, Daniel Lezcano a écrit : >>>> >>>> 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 ? >>> >>> That's what I did in V6 (and before), but Rob did not want me to add properties for Linux-specific concepts such as clocksource. >> >> Hmm, I remember something like that, yes but I did a delete of the >> previous version when you posted the v7. Can you give a pointer to its >> answer ? > > Yes, this was his answer: > https://lkml.org/lkml/2018/7/25/508 > > Then mine: > https://lkml.org/lkml/2018/7/30/883 Thanks ! -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog