Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp109994imj; Wed, 13 Feb 2019 05:33:46 -0800 (PST) X-Google-Smtp-Source: AHgI3IbOPGZc/dViS/sexVgSB8TAsis2RWPF8yn74UmXsHBDDXuIUKkRHpXt6ECcdbPbrmqtctPe X-Received: by 2002:a17:902:e307:: with SMTP id cg7mr540385plb.255.1550064826757; Wed, 13 Feb 2019 05:33:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550064826; cv=none; d=google.com; s=arc-20160816; b=hMvZMd+t+nxf/1UiPCZPHLM7TpLwA8TIGhPbIWtYYRWOcGjLFllOFF3fHlhMWCj7gW tlmJvuekqIVf2HMP5pBtOqCum4zI66AhxaN0gigx3aFnY2wFpeKKn1wldws1+/SrZ5Ar Jf1KG0EoMZqKZasiZGqIOc7vkLdYy/xmMIM6cCYN+BzkGHeRvKUXvaYO793hr1pemYTO lAf5lzv9xckyVRPELWm/wGhqUz8xEK1HNjo2sUHJwv8RVjeNIBVWV3vFmfxJUMU3djMH KalR/ZzYeqnz36z7ABwP/dgIdHFPCOEEhSB3H4goqOZ9eFUM7Z+hykU9E15ozbcmQpWS WzkA== 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=diTfoAa5QUfTzyCKudm3waVERUH6mf8lPhS8olEIfwA=; b=0q0hvJsd+RjRtSq5t3Xff0RI2d214TfiTk+K+BTbiqDdIlMdkS3PKJIbBvpRFrHgnV Ey00QYXzs/T/PkRyXRFrMNQsRz/Gx924845aX+z64Zcx84WwA4mNiFHfd35Xch8dQqV6 1K33Gr76A8dbJoCizjqu+aFd8yR0fSVICeIgAWCJQUiWFQywAz052AKczXJPhqn0xVGd twSOD/3gK3AqrcArof0UAkdtHX3HUv3aMmZcj7vNs00fTetez4PZz9sCFfkSe++q25uH /rfL2lgXrswobeYzdxKlKWhYOV09IpNN6Tt4wM+DyFhe3ACH/Vt0Qk0qnEMKAT0D6+Ig Mzuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GWnjly4m; 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 o8si421303pgn.469.2019.02.13.05.33.30; Wed, 13 Feb 2019 05:33:46 -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=GWnjly4m; 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 S2387780AbfBMJiJ (ORCPT + 99 others); Wed, 13 Feb 2019 04:38:09 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:42287 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728873AbfBMJiJ (ORCPT ); Wed, 13 Feb 2019 04:38:09 -0500 Received: by mail-lj1-f195.google.com with SMTP id l7-v6so1391990ljg.9 for ; Wed, 13 Feb 2019 01:38:07 -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=diTfoAa5QUfTzyCKudm3waVERUH6mf8lPhS8olEIfwA=; b=GWnjly4m3L0IPD8SDnUMVRj095jutzkbt+WpZ4AyR75rL3aN1aeilvTWTZknhajSTO +exUHWeBQE4QHYcCwzlJQbUnHfYteFTcOLvIVyVUmqNv2mbJZ8CO5B+Aeoj9Tr/cycRm JKqxvK+fRwkn5FWypypefqhiNarWhMvklhU03TI4sgoUxW0X3sTP9EQ3LVkLq7TJvNXy 2KawqSEBABa3QDDw7unRB/p2zuFivYfS7qTCwUraKb+06dzISxdpgUDOQ6RobeEgjT6h 6+BEs/vTUVi6l4ZUrWyxMhIV2wlFpEiN9BT6zGvQkY8kKKoSM3XBqPzK2t63eChCL1EE vmxw== 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=diTfoAa5QUfTzyCKudm3waVERUH6mf8lPhS8olEIfwA=; b=Ur1uzMYlN/Fc4HAjy/LNLD0zm5HCfjmUsH2fk8PfFBNONWXIWcy9PPhZH9FY9MNByG LXILXM4oVG0fmqszVw692+7/88D1N1kSfYMOFH24Zw6z3CJO/qF5Y3CPE21XReIFU8E7 2KR+tekrsmjtLIAaAzj58QC6/E4vE5PbOHefVhGNUFQBIgjyC7M2SDCZnib7oKkHHPhw 8PZid4OP4xCG64yG/pIHsaw7N3z3J99F5j2FHCn++a/hHL8SOufHEN3LsR6li6f7BjcE 0ZlS2OVkrD3whEjLcy3u765cVDDxU18SMKnbDlX62rlfSr7SnH52zV7DpejVDaW6Pxa1 L46A== X-Gm-Message-State: AHQUAuaJ6WAB4JHFwPzNebRo+X3p5lLaSfWCMd74hlZhkG7VKTMxsWOu O8lWKc5oD0MKs5SlY9fF8H+EsWtHFfyYHIXsqMexTg== X-Received: by 2002:a2e:6a18:: with SMTP id f24mr582828ljc.97.1550050687163; Wed, 13 Feb 2019 01:38:07 -0800 (PST) MIME-Version: 1.0 References: <20190208104046.21817-1-thomas.petazzoni@bootlin.com> In-Reply-To: <20190208104046.21817-1-thomas.petazzoni@bootlin.com> From: Linus Walleij Date: Wed, 13 Feb 2019 10:37:55 +0100 Message-ID: Subject: Re: [PATCH] gpio: zynq: properly support runtime PM for GPIO used as interrupts To: Thomas Petazzoni Cc: Bartosz Golaszewski , Michal Simek , "open list:GPIO SUBSYSTEM" , Linux ARM , "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 Fri, Feb 8, 2019 at 11:40 AM Thomas Petazzoni wrote: > The Zynq GPIO driver currently implements runtime PM by: > > - Enabling runtime PM support in ->probe() and letting the runtime PM > reference counter drop to zero at the end of ->probe(). > > - Increasing the runtime PM reference counter in ->request() and > decreasing it in ->free(). > > However, the latter is not sufficient: when a GPIO is used as an > interrupt, ->request() and ->free() are not called. Due to this, the > runtime PM counter remains to zero when the only GPIOs in use are used > as interrupts, causing them to simply not work. > > To address this problem, this commit implement the > ->irq_request_resources() and ->irq_release_resources() hooks, > ensuring that the runtime PM counter is properly > incremented/decremented. Since we override the default hooks, we keep > the existing behavior by making sure they call gpiochip_reqres_irq() / > gpiochip_relres_irq() respectively. > > Signed-off-by: Thomas Petazzoni Patch applied with Shubhrajyoti's review tag. Yours, Linus Walleij