Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1490577imj; Fri, 8 Feb 2019 02:18:45 -0800 (PST) X-Google-Smtp-Source: AHgI3IagUkTgGHcKgARuun/wc8Q9LUE/aOquR2liU+3MpeWdw0lhjsNAdbrhBLLltcLMP2c5ZzAL X-Received: by 2002:a17:902:7791:: with SMTP id o17mr21713415pll.60.1549621125588; Fri, 08 Feb 2019 02:18:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549621125; cv=none; d=google.com; s=arc-20160816; b=CUobZypF6OCf8K/pEI6OD+3Ru4lPQVjx8FGobsME5FI7pqcj7OtxxZTIoV3EXkUxP1 yTAMl/pB0oIu6Sxs+yRuS7aA1cI818DJN3TCux8wHfKUKJoE7jz2mACuFmNSGIrTEnWz KPceGtQX05XMcGE5d70wE9U5+RKFYD1EABzy19fhaaJOMuR3hY1N4wQHiGrOEtmw8g7y hIBrOXCiIbVisCb2/iUhf0104VyQH1ouW1ouQijPz3TB6S1nna60fCoDRn6yO+3cfIH6 NHa7NlUYrjBscxp72kSARafkl8grRWq8PQ17IFBuccbUPM5tpbNnNP4PUYAOQLv9QAdh wNsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=4ifLVWqjLbcOMuaR9AbjVyw36idURwba8qrIFJ19wdk=; b=oiwhtGEQ6H14WNvLP4pQ89zivOSwOUL4fTQYmRX03/67RZtb7lPNPJ2yHqBrRRv+kv 5q7DN00pOLWwvuNHqi9W6H/XYFrbQa0xDsFdiAe56YiUnq+tHaSwERs4E0f0IAHqOpt+ p0KVjk7YeP7YNJraCjN5I8KNdUT3J9NY4qoR4zShhIeIWscwhbJxF0Wyp/DSGQW3NB25 g6xyG7t7cVopFlnKRaFBB+CQGJ9+/LFelz7K4GT3u1IYLwkSV3giXQbEnJBGvEYAntYZ qYlDbqByF3JUtsDjsRJ6676Qk8g6Zgh0O663TWxw+klBJfqvVF0o9Sf9GBjUrrLpJSFP E61w== 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; dmarc=fail (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 b74si1384193pfe.47.2019.02.08.02.18.28; Fri, 08 Feb 2019 02:18:45 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726655AbfBHKSY (ORCPT + 99 others); Fri, 8 Feb 2019 05:18:24 -0500 Received: from mail-ot1-f66.google.com ([209.85.210.66]:43399 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbfBHKSX (ORCPT ); Fri, 8 Feb 2019 05:18:23 -0500 Received: by mail-ot1-f66.google.com with SMTP id a11so4935184otr.10; Fri, 08 Feb 2019 02:18:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4ifLVWqjLbcOMuaR9AbjVyw36idURwba8qrIFJ19wdk=; b=NgIlXnkfPouWmj3/hdOM9h+voUI2/1In5OZPhIkV7+S/gJjNQqwZug5enDgru8zEfe g2ADCe0WNw8SdPVxZf7ugxbOvGKzkBceNgfUXI3Z08oHsFMLzDuJmw2N2l2zIy/q3cfe BFOdTYqjK2WI1CcPHCaPVFRhq1/jxxS/gGuptVGvkgtifyAPX8w4PsRSDEEMSEQF3p+i CleBNsBqPBftRfrVqOsOYy6jgjXPAiSOis/FIpGaqw8sYn5mnBqNgEj95zq4BwmOJiL7 ds0xDnAf94lj5yfvr9sJODiYEYkrkpQflJ9c/pDXb+Ii8tANk9h9djUqN433eCYUjtr7 O7dg== X-Gm-Message-State: AHQUAuYgvnhwbgcOrNf1/FMlKlszaSCHmqFC6c889AXIcH66OuIYyzF5 15wk+ECb9MPITFsEjyNFyb7DJvhgH4p4ByVDQ7E= X-Received: by 2002:a9d:5f06:: with SMTP id f6mr12552484oti.258.1549621102789; Fri, 08 Feb 2019 02:18:22 -0800 (PST) MIME-Version: 1.0 References: <20190207122227.19873-1-m.szyprowski@samsung.com> <20190208064957.zhyue42kpgaoslwm@vireshk-i7> <20190208085544.vqkebcgg7jpbv2a6@vireshk-i7> In-Reply-To: <20190208085544.vqkebcgg7jpbv2a6@vireshk-i7> From: "Rafael J. Wysocki" Date: Fri, 8 Feb 2019 11:18:11 +0100 Message-ID: Subject: Re: [PATCH 0/2] cpufreq/opp: rework regulator initialization To: Viresh Kumar Cc: Marek Szyprowski , Linux Kernel Mailing List , Linux PM , Linux Samsung SoC , "Rafael J . Wysocki" , Nishanth Menon , Stephen Boyd , Bartlomiej Zolnierkiewicz , Dave Gerlach , Wolfram Sang Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 8, 2019 at 9:55 AM Viresh Kumar wrote: > > On 08-02-19, 09:12, Marek Szyprowski wrote: > > On 2019-02-08 07:49, Viresh Kumar wrote: > > > Why don't you get similar problem during suspend? I think you can get > > > it when the CPUs are offlined as I2C would have gone by then. The > > > cpufreq or OPP core can try and run some regulator or genpd or clk > > > calls to disable resources, etc. Even if doesn't happen, it certainly > > > can. > > > > CPUfreq is suspended very early during system suspend and thus it does > > nothing when CPUs are being offlined. > > > > Also at resume the cpufreq core may try to change the frequency right > > > from ->init() on certain cases, though not everytime and so the > > > problem can come despite of this series. > > > > cpufreq is still in suspended state (it is being 'resume' very late in > > the system resume procedure), so if driver doesn't explicitly change any > > opp in ->init(), then cpufreq core waits until everything is resumed. To > > sum up, this seems to be fine, beside the issue with regulator > > initialization I've addressed in this patchset. > > Yeah, the governors are suspended very soon, but any frequency change > starting from cpufreq core can still happen. There are at least two > points in cpufreq_online() where we may end up changing the frequency, > but that is conditional and may not be getting hit. > > > > We guarantee that the resources are available during probe but not > > > during resume, that's where the problem is. > > > > Yes, so I've changed cpufreq-dt to the common approach, in which the > > driver keeps all needed resources for the whole lifetime of the device. > > That's not what I was saying actually. I was saying that it should be > fine to do a I2C transfer during resume, Surely not before resuming the I2C controller involved? > else we will always have > problems and have to fix them with hacks like the one you proposed > where you acquire resources for all the possible CPUs. Maybe we can > fix it once and for all. Obviously, all I2C transfers need to take place either before suspending the I2C controller or after resuming it.