Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2422063imu; Thu, 10 Jan 2019 14:03:47 -0800 (PST) X-Google-Smtp-Source: ALg8bN4AN64N+wI0SPCQWYDNVsq+73qjBPtkzMwUW1vHcZEp/6ROBTSkrH40ZT7g9Joxdho57Vtn X-Received: by 2002:a63:1a4b:: with SMTP id a11mr11045541pgm.254.1547157827386; Thu, 10 Jan 2019 14:03:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547157827; cv=none; d=google.com; s=arc-20160816; b=hDdMKvVDki+42t3UdJO1otePMNI5QKf6YPMk+VZnBP4h7fM1xk7Xs1wyIZd8+XJHdQ 5oD9G3cHwYvwXhBdoWyzTK5oWAbDgavotbsjsX4YUryAegaBLU1wwYvcZfGsIU4++E8b YGCVC9dzOxaaBYape7mZ6KnoqN2au4NNtJhS7pMdm8t5EPuTl/K9Ty0WOJPAFpfL1Dx6 wfbWKk0Sfi2nQbhD9RRYJaPNLBUzZMm5au5azkpsfYukvLYNAMCNzYBycYvU8jKVAhOr SFx5gmUhiJkrLF8zLOH7djoMJlQH08vvCxjg4MSfV8PxaudFoKf/FiEIzsAeZk2ahIT9 Wp3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:user-agent:cc:subject:references:to :from:message-id:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=5Ca+giYTOowQwvE/IYNggDIbq1m8J3g7CFwxZA8Q0ag=; b=q5qADhxhhPoR0ADNgvFksYrsBuiOuBawwfq4/C46R3BGpVJVY6q3Lh6uzegKqCvmDl RgX9Pou5mdaIn2uN/EAlUteIkGJ92F6EzPCEDI0F9foZaKn/FjJMgwtqBdn9ccUo0wjq c8RdnGFYU+4aaHfbD7RGwy5TkyfBfVVfB3I98zVlJnljd57ZYWWi34mw0jXZoeIdjtAZ IA5q7ZOAWDeYEwCzKfN/cvDdl6mBTmoXQtOFjuk/2vspwpSDWBRDw4sAnqgIFtpSWjAu m8EwBo431HEOI8b25MBbcYhPlZ8ihnIKCNSjSbd+XRILDHay4AY+EGXMKocYePQ+s3cv 4tsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CzDFKhlk; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c10si29360352pla.173.2019.01.10.14.03.31; Thu, 10 Jan 2019 14:03:47 -0800 (PST) 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=@chromium.org header.s=google header.b=CzDFKhlk; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728903AbfAJV2C (ORCPT + 99 others); Thu, 10 Jan 2019 16:28:02 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:37255 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728385AbfAJV17 (ORCPT ); Thu, 10 Jan 2019 16:27:59 -0500 Received: by mail-pf1-f195.google.com with SMTP id y126so5898626pfb.4 for ; Thu, 10 Jan 2019 13:27:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:content-transfer-encoding:in-reply-to:message-id:from :to:references:subject:cc:user-agent:date; bh=5Ca+giYTOowQwvE/IYNggDIbq1m8J3g7CFwxZA8Q0ag=; b=CzDFKhlk2/vTBwaFRoaf9vrKU+hbJyXFgKAoBWIZej2feOIXGQ11uVjRJdWMVAQMDz kxCu5CkKZjIgZNP5eqwHhvFsMxIOZEABqK5IMfQCt4tIDlaOlg3z9b82JWSSJ3959ZkZ iZkIaNwu+FfVTRBct7RB2ub9GwDmap6wwF2nM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding :in-reply-to:message-id:from:to:references:subject:cc:user-agent :date; bh=5Ca+giYTOowQwvE/IYNggDIbq1m8J3g7CFwxZA8Q0ag=; b=JSD/gSeu4cYN2j3GYaxQdz+SQdlGqP6J+a8Zbs7x3neJZZzBTM4k7oveFvxXycs+DN 6Nq1AYeMz6POl8FF6B2BsMKNmPh6i35e3bw1r7Yw4OLTPw8cSHxSVFQGrI7vg9qq9apt WcvoajJJ2n8v4gIqNv67F4yXF45PjNql24B7BJM16QDLpfNPHzHk/zHAaQx/UsMEMNhk /h/JwF+AU/VycEfuHFO25wHJMYJKf2GLlLY/2ONUu7qRwVCjRZThrSb4aOOXCPtSCH8o EE/FIsO9dly6uITaj6ZTvZvPBn1dBDu7Gea7/bi/Nr/KkByBcIaRIzPdRJvPjB6LIxC2 X2iw== X-Gm-Message-State: AJcUukfEPqG4XEuFeW3Ud6KzEDJ25sYuqa5+BOqDTii42d64U8m97aPb w8IVzvM6mrrW4NrBRA+SaGdb5A== X-Received: by 2002:a65:534b:: with SMTP id w11mr798087pgr.125.1547155678286; Thu, 10 Jan 2019 13:27:58 -0800 (PST) Received: from localhost ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id w136sm111267669pfd.169.2019.01.10.13.27.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 Jan 2019 13:27:57 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <3ae4bf87-88be-466d-0f1e-ff7bf5c4e816@codeaurora.org> Message-ID: <154715567680.19284.12367636883540337540@swboyd.mtv.corp.google.com> From: Stephen Boyd To: Raju P L S S S N , andy.gross@linaro.org, david.brown@linaro.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org References: <20181221115946.10095-1-rplsssn@codeaurora.org> <154546438942.179992.14851496143150245966@swboyd.mtv.corp.google.com> <504cae51-0f35-beb8-496b-a335863a9071@codeaurora.org> <154603310752.179992.9262815873457262616@swboyd.mtv.corp.google.com> <154655037205.15366.7302521016277534390@swboyd.mtv.corp.google.com> <6384bcac-634c-5e7e-b357-93982de6eafb@codeaurora.org> <93a4b632-5740-42a9-9552-b46dd599ad68@codeaurora.org> <154705600478.15366.3563482093409250809@swboyd.mtv.corp.google.com> <3ae4bf87-88be-466d-0f1e-ff7bf5c4e816@codeaurora.org> Subject: Re: [PATCH RFC 3/5] dt-bindings: Add PDC timer bindings for Qualcomm SoCs Cc: rnayak@codeaurora.org, bjorn.andersson@linaro.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, evgreen@chromium.org, dianders@chromium.org, mka@chromium.org, ilina@codeaurora.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org User-Agent: alot/0.8 Date: Thu, 10 Jan 2019 13:27:56 -0800 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Raju P L S S S N (2019-01-10 08:58:41) >=20 >=20 > On 1/9/2019 11:16 PM, Stephen Boyd wrote: > > That could be done by making a PDC clockevent that has some DT binding > > of a property pointing to an MMIO timer frame and then reimplementing > > the MMIO timer code in the PDC driver on top of the frame/register > > region it pulls out of there. Or it could be written in reverse by > > having the generic MMIO timer driver point to the PDC somehow and > > implement some platform specific API to pass that information to the > > real wakeup programming part in PDC. > >=20 > > I'm leaning toward the first approach where PDC is the clockevent and > > that uses the MMIO timer on the backend to do what it needs to program a > > wakeup. That way you can mandate the usage of the physical timer and > > keep this quirk away from the ARM timer driver. It also makes the idea > > of a qcom,pdc-timer-mode sort of useless because the PDC will have a > > property that points to the timer frame and that will mean "use this for > > broadcast wakeup". I'm not sure how the ARM folks feel about this > > though. It would probably require some sort of ARM timer API that lets > > us program the MMIO timer frame from the PDC driver. So exporting > > arch_timer_reg_write() and making that always inlined to optimize hot > > paths would be required. > >=20 >=20 > Regarding the first approach - > If PDC clk_evt_dev is created and registered to broadcast framework, it=20 > means it will replace MMIO timer event device in broadcast framework (as = > only one broadcast event timer can exist). So in registration phase, the = > tick broadcast framework would configure broadcat event handler for=20 > PDC(clk_evt_dev). Yes all the MMIO timer frames would need to be marked as "disabled" I suppose, or somehow we would need to tell the MMIO timer driver to not register the MMIO timer frame from there because it's used by the PDC now. Maybe that would require changing the MMIO timer's compatible string to be something different. >=20 > Even if we have some way of exporting arch_timer_reg_write() to program=20 > the wakeup for MMIO timer, the irq handler for MMIO timer is responsible = > to invoke event_handler. However, since MMIO timer is replaced by PDC=20 > timer event device, event handler will not be able to inform broadcast=20 > framework. What can be done about this? >=20 It sounds like you imagine that the MMIO timer frame will still be active and in use by the ARM architected timer driver? I wasn't thinking that would be the case. I was thinking that the PDC code would basically reimplement all of the ARM timer code again by calling some shared timer code so that we avoid code duplication. Including the irq handler that would be registered for by the PDC driver and flow from that piece of code instead of the ARM timer code.