Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp784715ybh; Sat, 3 Aug 2019 09:43:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqwEwc6cbI8jtvcoBYP2OpLqaHp4U0KbtH2Qxe/pzGNNHKDBOt3Nq66Olmfys7jooyinPIom X-Received: by 2002:a63:ff66:: with SMTP id s38mr131231056pgk.363.1564850609008; Sat, 03 Aug 2019 09:43:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564850609; cv=none; d=google.com; s=arc-20160816; b=NDF0/cHRPuXAVHBr0MI16IHGQ37iQqqfcv1Mpc9AUsq45B/orFRAJ5IahwESpsSFdW sHvNq7lPa5AmlbZU59Z1UFDlQ9jj4kLywh02dP56/8SNX4g1eRUNlSTmERRlqD3lppfy 6TBQbO5nukDWNvAHtm31ERuKVQGLDo7Tg/HFxc8MybMTzJ7aGu0SNM3M7azlTFY95Etf Zn3/kLT2GyQRqsxlt1U6rpT5RxYObaFR3PXoIHT8KDOIDzMYGKTIm2Oj7xGH0MiH4TGO cHi2IZ1o0hrpWRhYCrDcRtRWd6UjmwdEE8iuKTCYAOG+FWH42XEIG/nz1b0YT/DZzWvG optA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:user-agent:to:cc:from :subject:references:in-reply-to:content-transfer-encoding :mime-version:dkim-signature; bh=khpD6S32XLryQTWPY6MaNlqlYYAxW/nyOe/CxIuALW0=; b=uE8z+0tVEkUlFL187W9IaKqO9Ax7uJ32Jt6Yr3HZpN6g337bML+//g9byGRs0kSulx eAo4fqXBXbQdfq2YBfR99eWMQovi2bK3F1gMRCZvL7J+GTNzdqLSV67A5ein2q/+ULmY ZHj2Al6wjGr0QjaodaZbyQ2JQER4Ts5TxuzDLN3FBjPvPgYvkkaHXkP2CBw623anMZVS 0A1onNbs7rahM2WStHdKWj/kURFb+sWInS3/yfHQMfEdFd9GhY3HP0/zSmV8N6nCrIMU JH/bcje+1ixH7YdZUswChYAwjT7fmIDeIGWjGWmyV6YErtyA3gpZ5CYTmoCEQwHJ9aZs rbbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nVMzMboH; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m127si41040133pgm.100.2019.08.03.09.43.13; Sat, 03 Aug 2019 09:43:28 -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=@kernel.org header.s=default header.b=nVMzMboH; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436562AbfHBRvU (ORCPT + 99 others); Fri, 2 Aug 2019 13:51:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:52326 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405813AbfHBRvU (ORCPT ); Fri, 2 Aug 2019 13:51:20 -0400 Received: from kernel.org (unknown [104.132.0.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1E401217F5; Fri, 2 Aug 2019 17:51:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564768279; bh=khpD6S32XLryQTWPY6MaNlqlYYAxW/nyOe/CxIuALW0=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=nVMzMboHgX7MfU68J36ZEXxGcflYB3IxcBADYek55/bDOP0TvrlbwsWtm43Uib6VU 6ToxJ3+HaIUab5BjNhzKKK9UaZbWpk4/iSgR7ofeeaSqBRMzRNVRZCwUFjyWMae0h8 JFO9WCQuyom8dCf8+VvJeJ5xdeEcdWdVW+TIo4aI= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <8c259511-d8ea-51b2-0b1d-c85b964bc44c@gmail.com> References: <1563738060-30213-1-git-send-email-skomatineni@nvidia.com> <1563738060-30213-15-git-send-email-skomatineni@nvidia.com> <88da46d2-b90d-f57e-7611-b8653b56bdf6@nvidia.com> <5054f178-db27-9286-d123-3e2b2a885717@gmail.com> <8c259511-d8ea-51b2-0b1d-c85b964bc44c@gmail.com> Subject: Re: [PATCH V6 14/21] clk: tegra210: Add suspend and resume support From: Stephen Boyd Cc: pdeschrijver@nvidia.com, pgaikwad@nvidia.com, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, jckuo@nvidia.com, josephl@nvidia.com, talho@nvidia.com, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, mperttunen@nvidia.com, spatra@nvidia.com, robh+dt@kernel.org, devicetree@vger.kernel.org To: Dmitry Osipenko , Sowjanya Komatineni , jason@lakedaemon.net, jonathanh@nvidia.com, linus.walleij@linaro.org, marc.zyngier@arm.com, mark.rutland@arm.com, stefan@agner.ch, tglx@linutronix.de, thierry.reding@gmail.com User-Agent: alot/0.8.1 Date: Fri, 02 Aug 2019 10:51:18 -0700 Message-Id: <20190802175119.1E401217F5@mail.kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Dmitry Osipenko (2019-07-22 00:12:17) > 22.07.2019 10:09, Dmitry Osipenko =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > > 22.07.2019 9:52, Sowjanya Komatineni =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > >> > >> On 7/21/19 11:10 PM, Dmitry Osipenko wrote: > >>> 22.07.2019 1:45, Sowjanya Komatineni =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > >>>> On 7/21/19 2:38 PM, Dmitry Osipenko wrote: > >>>>> 21.07.2019 22:40, Sowjanya Komatineni =D0=BF=D0=B8=D1=88=D0=B5=D1= =82: > >>>>>> @@ -2853,9 +2859,8 @@ static int tegra210_enable_pllu(void) > >>>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 reg |=3D PLL_ENABLE; > >>>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 writel(reg, clk_base + PLLU_B= ASE); > >>>>>> =C2=A0=C2=A0 -=C2=A0=C2=A0=C2=A0 readl_relaxed_poll_timeout_atomic= (clk_base + PLLU_BASE, reg, > >>>>>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 reg & PLL_B= ASE_LOCK, 2, 1000); > >>>>>> -=C2=A0=C2=A0=C2=A0 if (!(reg & PLL_BASE_LOCK)) { > >>>>>> +=C2=A0=C2=A0=C2=A0 ret =3D tegra210_wait_for_mask(&pllu, PLLU_BAS= E, PLL_BASE_LOCK); > >>>>>> +=C2=A0=C2=A0=C2=A0 if (ret) { > >>>>> Why this is needed? Was there a bug? > >>>>> > >>>> during resume pllu init is needed and to use same terga210_init_pllu, > >>>> poll_timeout_atomic can't be used as its ony for atomic context. > >>>> > >>>> So changed to use wait_for_mask which should work in both cases. > >>> Atomic variant could be used from any context, not sure what do you > >>> mean. The 'atomic' part only means that function won't cause scheduli= ng > >>> and that's it. > >> > >> Sorry, replied incorrect. readx_poll_timeout_atomic uses ktime_get() a= nd > >> during resume timekeeping suspend/resume happens later than clock > >> suspend/resume. So using tegra210_wait_for_mask. > >> > >> both timekeeping and clk-tegra210 drivers are registered as syscore but > >> not ordered. > >=20 > > Okay, thank you for the clarification. > >=20 > > [snip] > >=20 >=20 > You should remove the 'iopoll.h' then, since it's not used anymore. And also add a comment to this location in the code because it's non-obvious that we can't use iopoll here.