Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1600515imj; Fri, 8 Feb 2019 04:18:43 -0800 (PST) X-Google-Smtp-Source: AHgI3IY29rjVrs8/mjsClqHzXGKpAQifXEvSh/1ymNYzsi2wkKPXz6vbjpPNj1DLhqsY5nvCpx3m X-Received: by 2002:a65:62d4:: with SMTP id m20mr19247868pgv.215.1549628323453; Fri, 08 Feb 2019 04:18:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549628323; cv=none; d=google.com; s=arc-20160816; b=hBRDt1LvoHi33Lmbw475/xRT3Wz4tLqG+BIQGslZLL9bdBZ9GuO0+FUML77XtZlQEC eF2abQCWZXS02xt/7ABKOuDEl0wYi4Yu/fkmI1QJONhW/kqqp4lZ2oDHUQzQs7spllYI Lhi4NpM0vGb5DCmtYJ0eJPpKtewYFW8He3jOGgvcZv/4Hdz288si5ovMmjRm36nFfysS bHftaFwYfJqR2qT6GRieMHe8o9ENyC6sVOzaLQhPHd1UTP/GQYphPnwVRxlsm3ujukYp PQNX/Yp/uDluq0/TlZCDWICTO4wdmcAWJNj4bKb8bcRJ5psrTi4mI4b78sPAOHOkh+Du OVHw== 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; bh=C7t/P7+bvyR2S9JlG7QlCGqjWdW/ArHGA1Z08nQOAps=; b=ywgMbIobn8+BN7QZdN9E1abYYaD20YEsOtnhVYxdOe5oQJzKN7funRndGYgTdgIGxP 9/SsFgyaaQCJBKoxAQpOoON4OuI9AOwU289BqIaGX19uHl2hNjcU+KP3E0Gx165DAJIq nY8KfuJd0wauLo3EawCa7sUSlfAeO7B8xQjq0STsRHes29BRfDjoUWK2O8v2qPTgBzbr 3FI4wp5heHtoS/YGAdld/sS+Hax4sYJTvsV14KZCtFcqAgm8BG0O8hbr3Jo9J3sfG5ay aPKmyYIBA9CMJJ8xJQXNcq0po+OpObUKJPZXyrA4ts/RCNLpV762jXrUxxbsHGC7xnrd b6Jw== 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 a124si2243596pfb.263.2019.02.08.04.18.27; Fri, 08 Feb 2019 04:18:43 -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; 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 S1727203AbfBHMQ7 (ORCPT + 99 others); Fri, 8 Feb 2019 07:16:59 -0500 Received: from foss.arm.com ([217.140.101.70]:50016 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726230AbfBHMQ6 (ORCPT ); Fri, 8 Feb 2019 07:16:58 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 708CC80D; Fri, 8 Feb 2019 04:16:58 -0800 (PST) Received: from e107155-lin (e107155-lin.cambridge.arm.com [10.1.196.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 802F53F719; Fri, 8 Feb 2019 04:16:56 -0800 (PST) Date: Fri, 8 Feb 2019 12:16:53 +0000 From: Sudeep Holla To: Marek Szyprowski Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Viresh Kumar , "Rafael J . Wysocki" , Nishanth Menon , Stephen Boyd , Bartlomiej Zolnierkiewicz , Dave Gerlach , Wolfram Sang Subject: Re: [PATCH 0/2] cpufreq/opp: rework regulator initialization Message-ID: <20190208121653.GC13043@e107155-lin> References: <20190207122227.19873-1-m.szyprowski@samsung.com> <20190208110053.GA7913@e107155-lin> <87302853-74cc-8eeb-6bd4-6338746e0738@samsung.com> <20190208115122.GA13043@e107155-lin> <66b33c07-4970-b60a-d924-d4baba79c836@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <66b33c07-4970-b60a-d924-d4baba79c836@samsung.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 On Fri, Feb 08, 2019 at 01:04:18PM +0100, Marek Szyprowski wrote: > Hi Sudeep, > > On 2019-02-08 12:51, Sudeep Holla wrote: > > On Fri, Feb 08, 2019 at 12:47:06PM +0100, Marek Szyprowski wrote: > >> On 2019-02-08 12:00, Sudeep Holla wrote: > >>> On Thu, Feb 07, 2019 at 01:22:25PM +0100, Marek Szyprowski wrote: > >>>> Dear All, > >>>> > >>>> This is a scenario that triggers the above issue: > >>> [...] > >>>> 1. system disables non-boot cpu's at the end of system suspend procedure, > >>>> 2. this in turn deinitializes cpufreq drivers for the disabled cpus, > >>>> 3. early in the system resume procedure all cpus are got back to online > >>>> state, > >>>> 4. this in turn causes cpufreq to be initialized for the newly onlined > >>>> cpus, > >>>> 5. cpufreq-dt acquires all its resources (clocks, regulators) during > >>>> ->init() callback, > >>> This is strictly not just restricted to cpufreq-dt, but to any driver > >>> supporting multiple policies. So we need a generic fix not just > >>> cpufreq-dt specific. > >> Could you point which other driver needs similar fix? Here in cpufreq-dt > >> the problem was caused by using regulator api (indirectly) from > >> ->init(). All other drivers, which have regulators support, are for old, > >> obsolete, uni-processor systems, which don't have the problem of > >> secondary cpu suspend during system suspend/resume cycle. > >> > > scmi_cpufreq for instance. We can fix that in driver my moving to polling > > to get cpufreq_get_rate, but we support both polling and interrupt based. > > We may wait for remote processor interrupt in get_rate. > > Frankly, I don't feel I know enough to touch this driver and I don't > think that this can even be fixed in a generic way in the cpufreq core. Why not ? IIUC it's only to get/set the frequency you would need to talk to remote processor or external chip over I2C which can be deferred until resume. Rafael has valid concerns on messed up init implementations, still wondering if there's any chance to solve this in the core. > Maybe a comment somewhere is needed that ->init() might be called during > early system resume with irqs off and driver is responsible for handling > such case until the proper resume? > I agree and +1 for comment, but every driver needs to deal with that, which is fine. Just trying to see if we can avoid it. -- Regards, Sudeep