Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1594198imj; Fri, 8 Feb 2019 04:12:15 -0800 (PST) X-Google-Smtp-Source: AHgI3IZfB4x1gFVVheCfT8ouNuVNtsIsLEwH1/tA223iS+TVrBVJLM8qOWad9685MjcwP7qtnNnI X-Received: by 2002:a17:902:22f:: with SMTP id 44mr22346011plc.137.1549627935800; Fri, 08 Feb 2019 04:12:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549627935; cv=none; d=google.com; s=arc-20160816; b=VmemOU0/CLBwODt+lVLJTFhZSq/AO24uGOAdXesnfeX6HSP46dy2QnNFvg9ojOzITL 7rqglv5E6cxsZuZknDXOfvtC6ec3AwrqavWR2CkiPnuizj/cZXGiO9PQBTp2/QFt1+L6 3zxoUFIB07qhrtIxLBaXeKMp3T78HWy29AT2HCVVATZkqYp/BegEcZZknopnh2TV/8Xe 4gXMnCZdpHsBx+masZzbLRy5DX6rnGf0imSdacRpge8+a9IgODaYhXhGorSZaWk6qgOW X6r5kiEmArz1gLcES7DTW15QKTnEEJE5zstGqfKvIJa4y8z8vKkYshC0iBcxn4c67vu5 A4kg== 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=wsA+dybxqi2ItNZsa8eWQdYwSQC3xyJqlm1pxWtB+50=; b=E+Nv3UuDx5kJePxF6HDrxI19Sl8tjrmmgWnpxPE/jrDxHpIVHzRH5+rxoF56JBZz5b IxprexiY/xUshqWZ6IKlfVn54GzzoKFVDWDlX2KkVb1VE7goKiQnh2TMgJ5hVuRZt+iV MOQpHlAODyinGAFTPWnMNJjaPuS5aEIOz9WHN3TzH976o1wxrMUAxA8z8e+cEeTp1ars Xskl/o2+/9uRAHYF7nNqqi0occAXHnBZCBcnBBx1QS4eohkH/y1hrkMVQ4+E/CrxxUzt XQLAqVu6Uo8Qh0cbh+Y4whpeAdik5zNSbLVwoPmgD3nFiS+218UZc/xj7x37jEMwFATo mXuQ== 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 b5si1904002pgw.377.2019.02.08.04.11.59; Fri, 08 Feb 2019 04:12:15 -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 S1726915AbfBHMLt (ORCPT + 99 others); Fri, 8 Feb 2019 07:11:49 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:41027 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726456AbfBHMLt (ORCPT ); Fri, 8 Feb 2019 07:11:49 -0500 Received: by mail-ot1-f65.google.com with SMTP id u16so5418061otk.8; Fri, 08 Feb 2019 04:11:48 -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=wsA+dybxqi2ItNZsa8eWQdYwSQC3xyJqlm1pxWtB+50=; b=gg7Fm+m0DTfcYaOO5U2nEMcwfs8dT1R3EPyyIzuLiR3ozV5UzJIhg4QGcijjlmmP+w kezt7H7992uxK/WjlZsRxpVJ4L24nrZvrsaa0HdUTtVQGTWVxXoA8UINlBCmQMP02OUC k6nc0RtAqRxOESpbQlESjSvLBxZht1TPub2bZ0KJIQbiRmwK+VqDCd1kiVqAGACkX7ki Fv73YKP0wbHvcuD1TqGtB6h7KkXvUm+WOYJtjrS9s4G45hHrH7LoCWn3kKrpiiKDk6uy kgedLoJWFe257QYDxjRYfOEv82ja3BEqj6P867EPtoRR0oZDydHujhAbxgwsUM9Tu8N9 xfWA== X-Gm-Message-State: AHQUAuao+5vYHH4cq/NtfkOZlbY3j19j4s0WVjGwRqaUf0J/D7audsop WtKbe8k8napwJ8yyaTX1a0N/WMcfTiLYRowKIyg= X-Received: by 2002:a9d:7990:: with SMTP id h16mr5532351otm.222.1549627906624; Fri, 08 Feb 2019 04:11:46 -0800 (PST) MIME-Version: 1.0 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> In-Reply-To: <66b33c07-4970-b60a-d924-d4baba79c836@samsung.com> From: "Rafael J. Wysocki" Date: Fri, 8 Feb 2019 13:11:35 +0100 Message-ID: Subject: Re: [PATCH 0/2] cpufreq/opp: rework regulator initialization To: Marek Szyprowski Cc: Sudeep Holla , Linux Kernel Mailing List , Linux PM , Linux Samsung SoC , Viresh Kumar , "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 1:04 PM 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. > 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? Well, adding a comment to that effect certainly won't hurt as that's how things work now. However, it looks like something needs to be done in addition to that.