Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp377396imu; Fri, 11 Jan 2019 01:57:50 -0800 (PST) X-Google-Smtp-Source: ALg8bN4LYDmWGgmdqddvPD/3Z4Ol0kGY+mCe7xorrYzuSMRhD1joi9tGZUtLSdT8IE420jM5Io7M X-Received: by 2002:a63:7219:: with SMTP id n25mr12805265pgc.324.1547200670353; Fri, 11 Jan 2019 01:57:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547200670; cv=none; d=google.com; s=arc-20160816; b=GIdyYUWu+tBy9e8QlMGev+zQ3VU0dahUlyy+n9IeybGF1Yaxq1AHlXpnhnfv1Y24xZ x7stsKum9VOFXCR+eRQkFl03ngOX23KMZiLCfWDjrzwAIau19LPeT2qz8fQLaTE+gsAX YQaSSn84AO0YWiPDleTtK6p9VaQN65EkbQVD+1iPZ7p59ksGQKUOs3o9SoU4+zAdxuYR 4E8V6idG9nhmi2ySl8zBiViSRC4H7PnYep8sE8DP4sKOnmon+CJ7AyyoO5ZNWzLJ54hN JhAgnz+65TstFzpoRhH8F8HV+fXmf/y9EWPYPm273VarFCoToqRtFTPc6kpvSgMfIYW+ P0+g== 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=lDK1FAgxhgi3jXoNAQKdEfAbhO19e8mPHK/hUEQFr7I=; b=YWXK+G9KTw5qwK5VTYFu84BzfGgS3pmQUgH+DaDDz9Y+/fu2fLYUL4lOFhUlPAfKDp d9u30PB2YtKb4oE0/YVz/zXolciaEbu1XKV244A6j7lChw31lcxQ6l1XaPZOhEwpe9eQ y50s7je8bI8HZf8LTk+rkYxK+BaEXhVKQhGb8x/Xht/smx8BZC0UB9z8e0eYqVLH/0mZ Emjx2mAVYbbQ+EiW+YdndaqbqdbKZb4d7Ra48l+y0NinosFXIij8qvBCrApzBKoKcdYj kJ/UJ/J/tPqSk8ntnrl2v82rPhHgrGurbR2bg2gIzUcat3ltTQN1vRV8mS91b9kfmlRW mStg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WMLcjg+X; 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 x24si50887744plr.379.2019.01.11.01.57.35; Fri, 11 Jan 2019 01:57:50 -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; dkim=pass header.i=@linaro.org header.s=google header.b=WMLcjg+X; 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 S1731579AbfAKJye (ORCPT + 99 others); Fri, 11 Jan 2019 04:54:34 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:39200 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730166AbfAKJye (ORCPT ); Fri, 11 Jan 2019 04:54:34 -0500 Received: by mail-lj1-f196.google.com with SMTP id t9-v6so12397274ljh.6 for ; Fri, 11 Jan 2019 01:54:32 -0800 (PST) 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=lDK1FAgxhgi3jXoNAQKdEfAbhO19e8mPHK/hUEQFr7I=; b=WMLcjg+XD2sK/PkoIlRemJuRAMSvYdo+TPNeYthUtIN3L3VTbGLv/4nyi3pJgRXPim JCH6y179utuToP1Y9VDNa4Puv2WJRNu3Zp5U8is9gH3JL/Fxh2DDXIj4hol6dsO58VMz twEZgWSZwE6cD/ndgYA+UxT4XsV9YjZucb95g= 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=lDK1FAgxhgi3jXoNAQKdEfAbhO19e8mPHK/hUEQFr7I=; b=aaD5I8S/6dqG7Ju1FXdGO7vPI0zBMWFntZEyJlVCoDBOoaxk+2A+swkT0agHJ8hEfz wagjVu+RFnjQYOBUjPtI+lvVonpfdIfYeAmNbMEqhbWUNBQB+6xZfgSXt68DCAcsavKn +11kwtjEZSZ7Gcr4SBlr/8t48iQ+FhJY4MNptVE48ENfPHg2KKqxMgYdKtDdycbryU0t jDcI/dYqn088Lz10KGdcd84Ic0lYXZ3IVhXAfvPYeyCQIWsQvhYlXR8R/QvFEEWTAEh8 HlX5I0x0vvZqdf3+7LkPZVrOTYsTajxwZzofDX9vtAsXjD9a0i8XouCFKWPkrDF8XoG8 KZ8Q== X-Gm-Message-State: AJcUukfaIDTmM/k3cgLotoEnEb6TVuOKI4xstYWGRXOGvHyhLVRVsyMw LPWAJIynPVlVouFfS/bb69GrtcLHQVGrHTSIe2GD6A== X-Received: by 2002:a2e:9e16:: with SMTP id e22-v6mr8099680ljk.4.1547200471478; Fri, 11 Jan 2019 01:54:31 -0800 (PST) MIME-Version: 1.0 References: <72d3cd83bed792a23ab60cf9b6d51b618f5aa084.1502103715.git.michal.simek@xilinx.com> <6da5fd79-fbc8-b613-954f-dcbe2ef8d6c5@xilinx.com> <20190107164210.3ecf37e8@windsurf> In-Reply-To: <20190107164210.3ecf37e8@windsurf> From: Linus Walleij Date: Fri, 11 Jan 2019 10:54:20 +0100 Message-ID: Subject: Re: [PATCH 2/8] gpio: zynq: Wakeup gpio controller when it is used as IRQ controller To: Thomas Petazzoni Cc: Michal Simek , Nava kishore Manne , Josh Cartwright , "monstr@monstr.eu" , Peter Crosthwaite , Borsodi Petr , "linux-kernel@vger.kernel.org" , "linux-gpio@vger.kernel.org" , Rob Herring , "linux-arm-kernel@lists.infradead.org" , Steffen Trumtrar , =?UTF-8?Q?S=C3=B6ren_Brinkmann?= , Shubhrajyoti Datta 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 Mon, Jan 7, 2019 at 4:42 PM Thomas Petazzoni wrote: > This patch almost solves the problem. It doesn't work as-is, because it > assumes that runtime PM is used by all GPIO controllers, which is not > the case. When runtime PM is not enabled, pm_runtime_get_sync() fails > with -EACCES, and the whole gpiochip_irq_reqres() function aborts. (...) > However, I must say that from a design perspective, I am not a big fan > of this solution. Indeed for the normal GPIO ->request() and ->free() > hooks, it is currently the GPIO driver itself that is responsible for > runtime PM get/put, so it would be weird to have the runtime PM get/put > for the IRQ request/free be done by the GPIO core. > > I believe that either the GPIO core should be in charge of the entire > runtime PM interaction, or it should entirely be the responsibility of > each GPIO controller driver. Having a mixed solution seems very > confusing. My stance is that the driver is responsible of enabling and managing runtime PM for its hardware block(s). Runtime PM in the core should only be added if the core needs to be aware about it, such as is the case when e.g. a block device needs to drain its write buffer before going to runtime sleep. I fail so see why the GPIO core need to be aware about this. Yours, Linus Walleij