Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1021318yba; Thu, 4 Apr 2019 02:36:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxCNWJpNOdqueOMUCzE+lgTwDHnf8DdMcUJ1fhVw5EITMyPG/bWAWX7ovL2dgt2CW+M3jn2 X-Received: by 2002:a62:5797:: with SMTP id i23mr4721167pfj.12.1554370593354; Thu, 04 Apr 2019 02:36:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554370593; cv=none; d=google.com; s=arc-20160816; b=DW2kZEhU/jcRETflDGvA/eUYvS+ScTvg8GXqbrBLuJEEA0yXtZGM6REa9NA04YuOXg Re1kLTIGTAqBSQ03Hfcl9oJnGdkzpw8s4QC/DwyBuesPI9aTsQ62NzO36tRyH7pAW4Fx eIvqsdHAAkvGyHVFk4SYoh2Jqz6Cb+JRdzrbDixqaOYXatLHm07/7PIXgUOsa1pXDdPz NbT+kwCtVtrjTEvwomZdJZo6z6oVZ7Jyl+9XhyAWyu4DxU/qRRburBLS38+KaS4GAh+r Nn8u2/ocDQI0/lBG//LSiSgVT3xjy3776YTP/PdZxIaAja1qc9nUQjUG2V/6PEIRcAhs Flwg== 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=4+XzHk+jpTGxDGVqwa4dg4gvQjQHJPUEUNt3UVVTA0M=; b=lJyOTtvX/T7wfVvecqkqaHciGrwSm9FkaAe8DcmiWDq6CW+ds6EBDZkQHsjgsZZKrQ NwNZacVPnEYx167d4bOLTStKu4DW8idDD+4TvRLCajPYKXFJVymrY5Sd2SOQRVXSTHwG HVR8/KdH4wKNXCnkF6RzWXK3GFh1JaCKgXw4jjipvHUgd/lfVYrN725vws35zBYdt4Ba RN0e5TYVy1xAxCpyfLjtI84iygeqpHhpsFcr9PC6Co+IlfcmS7FcfnigBZJPZJRUkG1a euQx8TPzZqYGRnX0nwzbvTh1QVFNr0USriS06LIchqFg/Cg+jIUDBznA6dJsLB/0nK9G GInQ== 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 o61si16280610pld.280.2019.04.04.02.36.18; Thu, 04 Apr 2019 02:36:33 -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; 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 S1732443AbfDDJe7 (ORCPT + 99 others); Thu, 4 Apr 2019 05:34:59 -0400 Received: from mail-vs1-f68.google.com ([209.85.217.68]:44308 "EHLO mail-vs1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731940AbfDDJGs (ORCPT ); Thu, 4 Apr 2019 05:06:48 -0400 Received: by mail-vs1-f68.google.com with SMTP id j184so890198vsd.11; Thu, 04 Apr 2019 02:06:47 -0700 (PDT) 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=4+XzHk+jpTGxDGVqwa4dg4gvQjQHJPUEUNt3UVVTA0M=; b=TIxcxsAHP0ztxYQnoDKdJhgktWvXsEVcp7F4z5b40lX0LVZTavA1jqtUNAjkTchRk+ oEK5pwm0IYdoWuFqXSSOjBsquK87AW8I9aMRiL7tT1zTU9HsBeSE8ktlPvFIma5JKuue 0WynQMnh4mfkYDJ37Q3qvKW/zLlavfBNSr+iPfLE4P+INXt2itXDiPdkWq2i8ZYZaHbo D8WRaAGsMe7DjrE8e8qVrZUIuc0MyJeQKadWhhELgWSxmZSo+Imf/z4jhl80ZzRtGGG+ yhJo1kwUqhBuQk5pz8LtnYmxmFQE6YsGc8cVkfy+mnII7ZbNQtlqIFLJyULQDkrELT3Z W+Yw== X-Gm-Message-State: APjAAAXfmUcAAo5whrs4v2VLCxpzpN/qxlYupOlfcd1PzxX2RrfawxeN EBTu8M35TyNlfjupYjYe3a0McSyLqusNsisZ8m0= X-Received: by 2002:a67:fbcc:: with SMTP id o12mr3473975vsr.60.1554368807334; Thu, 04 Apr 2019 02:06:47 -0700 (PDT) MIME-Version: 1.0 References: <20190320103927.21227-1-geert+renesas@glider.be> In-Reply-To: From: Geert Uytterhoeven Date: Thu, 4 Apr 2019 11:06:35 +0200 Message-ID: Subject: Re: [PATCH RFC] gpio: pca953x: Configure wake-up path when wake-up is enabled To: Ulf Hansson Cc: Geert Uytterhoeven , Linus Walleij , Bartosz Golaszewski , "Rafael J . Wysocki" , Kevin Hilman , Laurent Pinchart , "open list:GPIO SUBSYSTEM" , Linux PM , Linux-Renesas , Linux Kernel Mailing List 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 Hi Ulf, On Thu, Apr 4, 2019 at 10:55 AM Ulf Hansson wrote: > On Wed, 20 Mar 2019 at 11:39, 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. > > All above makes perfect sense to me. > Reviewed-by: Ulf Hansson Thanks! > > 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. > > Right. > > > > > However, gpio-keys is suspended _after_ gpio-pca953x, breaking the > > scheme :-( > > Would it make sense to fixup the ordering issue via creating a > parent/child relationship or setting up a device link? Could that be due to gpio_keys not having rudimentary Runtime PM support? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds