From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 123CBC433F5 for ; Thu, 21 Oct 2021 18:49:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BF8D660D07 for ; Thu, 21 Oct 2021 18:49:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BF8D660D07 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TOYiVBtkkkP8/SMvCS4lHced/GpiyzG9iqmsI+G2uGk=; b=2oFlN9gVLZMC+x 9AgZvZ+JHZoRMMb+4bRReE/x7A2hgoIq7PF7BUl9Qi/GzN9MXvZIIXIWIC++eX6tV6nivSJkN3aUU kFQiiVxcexc2moKG/KI5tiKJAapJXFZnZq248Pxjb7fksSr0zfLPcfJRgu2c05JJvpg/+fzFMmPHr zn5mLWXIbIHsuAzmCOt3w1Z1jfaxJ/aVWUiRRp1ogOjf+cE1e9lVp7AABCBReR4gZzo2nnC0WGqSQ o14hjGif94YvMUVbOkwYW3eaOyPWkzJylRZJrZgC4HNcyIeEn/kKEyiDZx7CW8l4oeWVe11C2r28z fAjmLreqgeHD7ZYiDJ0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdd6J-008t60-3Q; Thu, 21 Oct 2021 18:47:39 +0000 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdcvo-008oUj-2B for linux-arm-kernel@lists.infradead.org; Thu, 21 Oct 2021 18:36:49 +0000 Received: by mail-lj1-x22d.google.com with SMTP id 204so1453635ljf.9 for ; Thu, 21 Oct 2021 11:36:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KFwenL5XcnRNpptcSA2cgOLSm+ikdKJzsWm5PgT8Ins=; b=OJyAvfRJ5jZ79JXyHWkRZUCQ6cXZuVSfYnKgESe+bsyL3wQqD44nkm0/2lfr5lcyFf VBb3ct4DjtXApDhsHmiFbZIHXzj9yPNKlyqvtrQP5QKGGBzf+zqOAtdOq7ld5PYn0Y1c YsXdIBJEDq1Xo89E6wOO3IoCxmPrioKOp4gyOTLLNYSc/n2tmPwxilfBXEsL1/E9n9t1 7E9oP7oOqWi4oLQCtK3dS7vc/N4iJhAgISb6/VYI4OSFChBnOFPYVnRLhdIJUn9zPAGU PWHJW6RifcIdWE2vOhl1qflAZ7Zt7nPeVLqK9gme/u+y2fp8GzTxELWCpxwEyaO1xdBv lNxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KFwenL5XcnRNpptcSA2cgOLSm+ikdKJzsWm5PgT8Ins=; b=OhxILbIM0Gxc4TKhh/8be07pAp+T4T6MrBABIItsPF+TIMdD/LTbsPEiT3tKKSuDEu Sqd2G0pUBOEY+QHoGfajEeulQG4Nq2Dj3wkkv+7NPXPVWJZtCqaLLCu83xsLSBXbEAaG 2StMYWMT78hXFGJ55KALdjvaDGbLoFyzVjDm1gxbJxIt/gCWEj4tHrZ+6fg5ag7wmy0s I/GptzWcWD6BrirtR5uu9QvMOOmxRGsIn+GeZcIotbemAPJypMgewF2C/PSXuEZ5V0n4 DL7uGs2NNwNib8DRtXGeX1AstvM/DguhZmi0FDx7Zqh4JvclcastDXYMEGu0NLUXXvJc TCRA== X-Gm-Message-State: AOAM530VhJjtJ9rC9XV6uPi7+9VNjjy6U+npyRIgF0GAICJ0xFwZ6dYf VoaXkZgbgEuPMRrhnZl65pSV4bpfAc4nWGGN30ZVIA== X-Google-Smtp-Source: ABdhPJwGOsMz5QFRlmpb6JZFAIgHv9elGXxwNYz7PZKIiQHm8PfGg/+RNbZ53CiJ/VwESknIgbQm0+6A0ALPFlGANwg= X-Received: by 2002:a2e:a5c8:: with SMTP id n8mr7921763ljp.367.1634841406007; Thu, 21 Oct 2021 11:36:46 -0700 (PDT) MIME-Version: 1.0 References: <20210929144451.113334-1-ulf.hansson@linaro.org> <20210929144451.113334-3-ulf.hansson@linaro.org> In-Reply-To: From: Ulf Hansson Date: Thu, 21 Oct 2021 20:36:08 +0200 Message-ID: Subject: Re: [PATCH 2/2] PM: sleep: Fix runtime PM based cpuidle support To: "Rafael J. Wysocki" Cc: Daniel Lezcano , Linux PM , Maulik Shah , Peter Zijlstra , Vincent Guittot , Len Brown , Bjorn Andersson , Linux ARM , Linux Kernel Mailing List X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211021_113648_221162_C2D1A79B X-CRM114-Status: GOOD ( 42.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org [...] > > > > > > > > > > > > > Additionally, since find_deepest_state() is being called for > > > > > > > cpuidle_enter_s2idle() too, we would need to treat the new > > > > > > > CPUIDLE_STATE_DISABLED_ flag in a special way, right? > > > > > > > > > > > > No, it already checks "disabled". > > > > > > > > > > Yes, but that would be wrong. > > > > > > > > Hmmm. > > > > > > > > > The use case I want to support, for cpuidle-psci, is to allow all idle > > > > > states in suspend-to-idle, > > > > > > > > So does PM-runtime work in suspend-to-idle? How? > > > > > > > > > but prevent those that rely on runtime PM > > > > > (after it has been disabled) for the regular idle path. > > > > > > > > Do you have a special suspend-to-idle handling of those states that > > > > doesn't require PM-runtime? > > > > > > Regardless, pausing cpuidle in the suspend-to-idle path simply doesn't > > > make sense at all, so this needs to be taken care of in the first > > > place. > > > > Right, I do agree, don't get me wrong. But, do we really want to treat > > s2-to-idle differently, compared to s2-to-ram in regards to this? > > > > Wouldn't it be a lot easier to let cpuidle drivers to opt-out for > > cpuidle_pause|resume(), no matter whether it's for s2-to-idle or > > s2-to-ram? > > I don't think so. > > Suspend-to-idle resume cpuidle after pausing it which is just plain > confusing and waste of energy and the fact that the system-wide > suspend flow interferes with using PM-runtime for implementing cpuidle > callbacks at the low level really is an orthogonal problem. It's certainly an orthogonal problem, I agree. However, trying to solve it in two different ways, may not really be worth the effort, in my opinion. As I kind of pointed out in the earlier reply, I am not sure there are any other relatively easy solutions available, to fix the problem for runtime PM based cpuidle drivers. We probably need to call cpuidle_pause() (or similar) in some way. > > > > > > > The problem with PM-runtime being unavailable after dpm_suspend() > > > needs to be addressed in a different way IMO, because it only affects > > > one specific use case. > > > > It's one specific case so far, but we have the riscv driver on its > > way, which would suffer from the same problem. > > So perhaps they should be advised about this issue. Yes, I will let them know - and hopefully I will soon also be able to provide them with a fix. :-) > > > Anyway, an option is to figure out what platforms and cpuidle drivers, > > that really needs cpuidle_pause|resume() at this point and make an > > opt-in solution instead. > > None of them need to pause cpuidle for suspend-to-idle AFAICS. I assume so too, otherwise things would have been broken when cpuidle_resume() is called in s2idle_enter(). But, it's still a bit unclear. > > Some may want it in the non-s2idle suspend path, but I'm not sure > about the exact point where cpuidle needs to be paused in this case. > Possibly before offlining the nonboot CPUs. Okay. Note that, I assume it would be okay to also pause cpuidle a bit earlier in these cases, like in dpm_suspend() for example. The point is, it's really a limited short period of time for when cpuidle would be paused, so I doubt it would have any impact on the consumed energy. Right? > > > This could then be used by runtime PM based > > cpuidle drivers as well. Would that be a way forward? > > The PM-runtime case should be addressed directly IMO, we only need to > figure out how to do that. If you have any other suggestions, I am listening. :-) > > I'm wondering how you are dealing with the case when user space > prevents pd_dev from suspending via sysfs, for that matter. That should work fine during runtime - because runtime PM is enabled for the device. Kind regards Uffe _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel