Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp856364yba; Wed, 3 Apr 2019 22:26:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqz8987Wpmp6EFXe+n+7QIyMDyzbQP+plIKSq1yNFQ4t7Y1/ZX1peUjRYbHMNW+JO4zEHx X-Received: by 2002:a65:51c8:: with SMTP id i8mr3804012pgq.175.1554355564868; Wed, 03 Apr 2019 22:26:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554355564; cv=none; d=google.com; s=arc-20160816; b=zMNp7bUZCkrzz3po/sc07K0P+w2f2kBAc3A80F1IcIpjEsnYYcFprW4Mr9MMigdmXh kcsqUE1YqO427z6nH5T66JRr1/ykAI2wYMFz5VHXIAuq32zylvm7StdTBO+4VKxtJAtg 9B2EBii4oqqXtZzrjgVt3YNkWBfyCrWzO86c9gnbeMycCjj9StVEIdZIfEd9kMacx2kD QMrKSxtMjQKOXvpYsTsTHAyw0el7VkLCDkPhwTzv8O3zGHeJLNHYorlzXsV6cTEsxp8i pK17IruB3hePgC4sEns5X8GRxK8F154JYMT4k/E4qpJNkBre4I5i89yJD6iJOlg5mJ9i k3Ww== 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:dkim-signature; bh=ZBfACO2yvbKXYcntcMy9iuJl3GZkSswa+DWpJE7auzA=; b=brE7zx5d857MSRbcn7mMRSgAOCqW43e8+caYHkdA334AgLMW3/H92aHPsiFqmbWBRR RsGHoT5TmFNumTru5HheraLpj5MFHsRvsz028f1qlVs12ApipzGv2Hv5pO0Fs1FMrKIb ilaQQcZhdf4/Lua0YEAROlW+pY15C3HtLwmztURnteGyzlmI5C5rcPCoPnbQ7RoVnoNC oEc+gB4AZc8l+ji0wx/rz+nb0zJ4vazwTWm9ZMVCswzx+1CxR3r1iavy/vbhOO5CH0ZU 2nOPQgOEtq8Jj2lFr5EkP4mx3Hnb8UAAXp1P3iEoQ2q9IYtQjyzN6L3yagI4+Ac0g0Zs MOEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nOPdseXM; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b12si15409966pgl.264.2019.04.03.22.25.48; Wed, 03 Apr 2019 22:26:04 -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=@linaro.org header.s=google header.b=nOPdseXM; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726427AbfDDFZN (ORCPT + 99 others); Thu, 4 Apr 2019 01:25:13 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:45934 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725946AbfDDFZN (ORCPT ); Thu, 4 Apr 2019 01:25:13 -0400 Received: by mail-lj1-f196.google.com with SMTP id y6so856561ljd.12 for ; Wed, 03 Apr 2019 22:25:12 -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=ZBfACO2yvbKXYcntcMy9iuJl3GZkSswa+DWpJE7auzA=; b=nOPdseXMFBCJp1tkbrp9k6j7T/+kehHRD681BNID3DofIJupuh7h4v75uO1jIzwfO1 Fh+/3wvjyAY0veeY18fkfcWY46cKwUPlLMPVtD991jxKp2/sY4YibI5dF2zuwa4/S1e5 +0dL0JZDZ7Dqww3Hobum4MFiOgu6+zhkzGkgYJns1koPSgBNQwoP39YD6TiYkT63QP8R fj8UQL7Ladk4Px6E5kkuNFZImVpJZv3D2Fgf7du5DevyZnCcB3ndBLd0qPQf47ajXe/+ QK/e9uQnyeuAFzzhW4RWCSGDGGp/Zf//eGA8F3r78EtsvAnoUAaQYabOrVHNTQIO9po4 /GoQ== 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=ZBfACO2yvbKXYcntcMy9iuJl3GZkSswa+DWpJE7auzA=; b=fTReOgJv5TdEwbysVJiBnhVgUMjeEjqJImszkD3ud0k+ofwGgDUuYLFt8RjKwA3zFL VgBAYHO17YQXq+CDnApJe22mtqiu5YP1QfkvaaM9h0nqRzGgUhDRdqiXVLrQSBtBJF/q jPtJDtyYZRcG9J/q8H4wsEUNuq+PW4/nGZuxdmNDU6IWkIDkSSp+oFWa2BVBCQXyywKK IpcLeJKp+WWLPK33T71om0r6VrOyVSqjIC5La1k1H9zXjclarGPpDpDI4UM9v3NZxoUb RXSeUGYTARIMalrm9S4sT1UgkF/p38ofnAEigzJ7cQ0hv7s+0f1Hg4h5HjVNgZLBZX7G aC/A== X-Gm-Message-State: APjAAAWmkkKdL8EWxBQill3CiCTAdwDsnEyRp5Gcj07lPnBlIHvhkN7Z niqx6rkZ56Lj3dKNYHC0p6g9GLjSuDlK27k/ja2t3Q== X-Received: by 2002:a2e:4a1a:: with SMTP id x26mr2023102lja.49.1554355511291; Wed, 03 Apr 2019 22:25:11 -0700 (PDT) MIME-Version: 1.0 References: <20190320103927.21227-1-geert+renesas@glider.be> In-Reply-To: <20190320103927.21227-1-geert+renesas@glider.be> From: Linus Walleij Date: Thu, 4 Apr 2019 12:24:59 +0700 Message-ID: Subject: Re: [PATCH RFC] gpio: pca953x: Configure wake-up path when wake-up is enabled To: Geert Uytterhoeven Cc: Bartosz Golaszewski , "Rafael J . Wysocki" , Ulf Hansson , Kevin Hilman , Laurent Pinchart , "open list:GPIO SUBSYSTEM" , Linux PM list , Linux-Renesas , "linux-kernel@vger.kernel.org" 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 Wed, Mar 20, 2019 at 5:39 PM Geert Uytterhoeven wrote: > If a device is part of the wake-up path, it should indicate this by > setting its power.wakeup_path field. This allows the genpd core code to > keep the device enabled during system suspend when needed. > > As regulators powering devices are not handled by genpd, the driver > handles these itself, and thus must skip regulator control when the > device is part of the wake-up path. > > Signed-off-by: Geert Uytterhoeven > --- > Note that I don't really need this on the Renesas Ebisu-4D board, as > there is no regulator or PM Domain controlling power to the GPIO > expander on that board. I did want to have all wake-up path processing > implemented in the driver for completeness, and did test its behavior > with gpio-keys configured as a wake-up source. > > However, while this approach is known to work fine on other boards, with > other GPIO and interrupt controllers (gpio-rcar, irq-renesas-irqc, > irq-renesas-intc-irqpin), it wouldn't work on Ebisu-4D, due to different > device suspend ordering. > > The proper ordering is: > 1. When gpio-keys is suspended, its suspend handler calls > enable_irq_wake(), invoking pca953x_irq_set_wake(), and causing > pca953x_chip.wakeup_path to be incremented, > 2. When gpio-pca953x is suspended, it checks pca953x_chip.wakeup_path, > and marks the device to be part of the wake-up path. > > However, gpio-keys is suspended _after_ gpio-pca953x, breaking the > scheme :-( > > So depending on topology, this may work, or not... This looks like the right way to do it to me. Ulf/Rafael: could either of you confirm that this is the right way to handle it when we have an optional external regulator cutting power to the chip providing the wakeup like this? Yours, Linus Walleij