Received: by 10.192.165.156 with SMTP id m28csp2037672imm; Thu, 12 Apr 2018 07:38:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx48bupGWOIygxbwwv1y92VJm9DDOjsziXs09s2TT1uPHEAg7irIq1q2yRWWhDzo9UqravHzC X-Received: by 10.98.224.215 with SMTP id d84mr7843756pfm.23.1523543893745; Thu, 12 Apr 2018 07:38:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523543893; cv=none; d=google.com; s=arc-20160816; b=S9KQzR6iiZCgAi9DibmRNErgnaXOcBEEmgKHFDXh0wWLTrnVCbjmruxkOAy2Hw8F++ zMixJXagbxqKRjs88946X3of0XCAatOEGZd0zYArXG5ztlx49xfTR1cmYmJufQuKyeH9 2Bh+Cr4oz6H+4k6VVQRNXX69rlqxYBLvcW97cJpx6a/Ma50rFaNA4raRTmzeAuqMezP/ 94RvhRsegV14Rq8ytRaTvL2TTBbu3AB7WAV7wCDFnt/i0NKaLnAXvh6j4G/Wm8QszBU4 D0QKI/q+W6WuZZXLI5FwSf6+pX8mwyF63IdPGTn6sN2DNWH5G2XuSgJWqzaCtCqIFNMP yJNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=nEIRCJdDUkRE0m/OWm7FC4Qs8rRjA2xszpuW7dT6tyI=; b=ZbBbPrIeZSvyjZs0YiR/wmvJE4Ueh+DxRPnG28oHEkZr7uMNXrSPfBOa77g4B61djf xoo6sXQRCHjtORV6qwWF5mrzAoXfQf+8p5riOX3w3bNyx9yD8aO1JYDCtrlzB26X9VGx H4EiYNKYszOlx2juWXjWcvOBWSzel5dFpsnPebbysD7Wc9XqxIhGmM7YSaCj6cenhq7d tklQ1fJwET87PEx0UM2fBZElM0tJy+5eFFD98MOFn29490U1DEpzbZbx71Zr3vF6xJTV wT5lzOaM2viX9eX+OgahuNRq8uBMEMEUYT0B5aL6QtyYrsfxt0r1Wkmjop6SSCYW5qMN yw8w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c5-v6si3545463plo.739.2018.04.12.07.37.37; Thu, 12 Apr 2018 07:38:13 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753180AbeDLOeL (ORCPT + 99 others); Thu, 12 Apr 2018 10:34:11 -0400 Received: from muru.com ([72.249.23.125]:36442 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753122AbeDLOeJ (ORCPT ); Thu, 12 Apr 2018 10:34:09 -0400 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id D83D18081; Thu, 12 Apr 2018 14:35:40 +0000 (UTC) Date: Thu, 12 Apr 2018 07:34:04 -0700 From: Tony Lindgren To: Keerthy Cc: linus.walleij@linaro.org, grygorii.strashko@ti.com, t-kristo@ti.com, Russ.Dill@ti.com, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, ssantosh@kernel.org, haojian.zhuang@linaro.org, linux-arm-kernel@lists.infradead.org, d-gerlach@ti.com Subject: Re: [PATCH 03/14] ARM: OMAP2+: omap_hwmod: Introduce HWMOD_NEEDS_REIDLE Message-ID: <20180412143404.GY5700@atomide.com> References: <1523505239-16229-1-git-send-email-j-keerthy@ti.com> <1523505239-16229-4-git-send-email-j-keerthy@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1523505239-16229-4-git-send-email-j-keerthy@ti.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Keerthy [180412 03:56]: > From: Dave Gerlach > --- a/arch/arm/mach-omap2/omap_device.c > +++ b/arch/arm/mach-omap2/omap_device.c > @@ -208,6 +208,27 @@ static int omap_device_build_from_dt(struct platform_device *pdev) > return ret; > } > > +/** > + * _omap_device_check_reidle_hwmods - check all hwmods in device for reidle flag > + * @od: struct omap_device *od > + * > + * Checks underlying hwmods for reidle flag, if present, remove from hwmod > + * list and set flag in omap_device to keep track. Returns 0. > + */ > +static int _omap_device_check_reidle_hwmods(struct omap_device *od) > +{ > + int i; > + > + for (i = 0; i < od->hwmods_cnt; i++) { > + if (od->hwmods[i]->flags & HWMOD_NEEDS_REIDLE) { > + od->flags |= OMAP_DEVICE_HAS_REIDLE_HWMODS; > + omap_hwmod_disable_reidle(od->hwmods[i]); > + } > + } > + > + return 0; > +} Let's not add any more dependencies to omap_device stuff, this will go away anyways with ti-sysc. > --- a/arch/arm/mach-omap2/omap_hwmod.c > +++ b/arch/arm/mach-omap2/omap_hwmod.c > +static int _omap_device_pm_notifier(struct notifier_block *self, > + unsigned long action, void *dev) > +{ > + switch (action) { > + case PM_POST_SUSPEND: > + _reidle_all(); > + } > + > + return NOTIFY_DONE; > +} > + > +static struct notifier_block pm_nb = { > + .notifier_call = _omap_device_pm_notifier, > +}; This seems like the right place to do it :) So for places where I suggested cpu_pm notifiers, maybe this is actually what you want to do for pinctrl and gpio etc. Please keep in mind that for gpio we do save and restore context it dynamically too during idle, so it's not just suspend and resume. That's why I was thinking cpu_pm notifiers, but maybe there's a better solution that covers both PM runtime and suspend. Regards, Tony