Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2595535imj; Mon, 11 Feb 2019 05:37:41 -0800 (PST) X-Google-Smtp-Source: AHgI3IZRvY1cc59Q2oX9aOoPmk1ZrgcpOziH8znwdhQmVlSZOjtpohb235Hc4vkn4BPtWEACfgB5 X-Received: by 2002:a63:e21:: with SMTP id d33mr19619927pgl.272.1549892261271; Mon, 11 Feb 2019 05:37:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549892261; cv=none; d=google.com; s=arc-20160816; b=Ol1JXtIco4wuIZAYAsPrc4kfNSXWjMfSB2EHbNNBmnpI43UpaXZRS+1DYWpPjnuVhI qToothifF71UoK3BiCyGbEpGDXerxPlujrwhPT5X6dHE8MDLnFYXYhs3KOi5GEvjxHqe bYCZPb7+mKfphz2c6IrnDowEBg9nIT5rYa+SOi+27uIJVCqPfbndurQspYxIk+yPyPs1 UtaiQtP4ECT1/k/bYWaD4AuQf/LL+AlsCOhp1ysEIbsZIa3m7uEJN8wTe1XJO5IBq3dR ZHXE5FwixJL6pNVjgtZlFJa08atwYW19Sg7e6l7US9RW/b6VDZcTle+Qr2OiRRCfUwZr jHsA== 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=oqBNnbIu4ogAFHQv0IkubaNotkX2xJx7RZvZ6dahxA0=; b=JFtRrFAfy7HJ2bW9b/AnRdfHETf2hph+A7/v3+AkNKH8viBq2JnGI/e0YPOJ5NxIkJ IXuZPOwz85Pfrb5PvPZVlao3YKFS2KgK6wtYjprnZrnzWrUxS1Ku1rYUS97VIXO6iFaN WiK410MpqY1xxpQJNc8QJqwnS3xwbdOAa68rkHZrJb0BlGgywcYBvrX8h+hi8gqL4vYu 36lhEfIPN0LuxlYJt4DN6QA86LaRBe+nkrgQPq7QgBSKWnB245yCRrRMv89HzXyLnNWx klEno+i8/wV3prDFKhkzz8mrAY43Ynw4vyo7JXaFdG3mYYwFtj6ThT6EQ5WzpgUQFZVq UhbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dWlBTld9; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 145si6514938pfu.218.2019.02.11.05.37.23; Mon, 11 Feb 2019 05:37:41 -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=@gmail.com header.s=20161025 header.b=dWlBTld9; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728252AbfBKNg4 (ORCPT + 99 others); Mon, 11 Feb 2019 08:36:56 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:56225 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728242AbfBKNgz (ORCPT ); Mon, 11 Feb 2019 08:36:55 -0500 Received: by mail-wm1-f65.google.com with SMTP id r17so17610786wmh.5; Mon, 11 Feb 2019 05:36:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oqBNnbIu4ogAFHQv0IkubaNotkX2xJx7RZvZ6dahxA0=; b=dWlBTld9j8T52lCHFf1Ji9Oq9JA3yqNuZYTfA0CidfToNWajVNFt+SqVtGK8FZGIGS dA7Zc26RNnFiDFZbMKadqPTEJvebkib38hlO0bTffDmt2zKmpj8YPtRVy3GyVWBSXRmn 5EknEw6wOsqXbSwRGAZURYB9Mh0VIxwYIRa+ViTmqxTOFxZGTu1rm8Fm5Vu1TFX3QNDO 32t/nYBTJiweu0/hYuvVvTWbnIxtk/BoZ+3jxcZ8RBGdqFeQKHEJB/llZQVJuknf6wHw bevQJtKjc1OKoCQ/wUNTU8UnPP1AMyOFmO9rBW7v5YbTFqAmdhz5tixs407i2QbTEXl0 JDkg== 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=oqBNnbIu4ogAFHQv0IkubaNotkX2xJx7RZvZ6dahxA0=; b=CjpQKkSj3HzDiD1yNeSE/336XwnvTCJ8/9t6EkNnAdvPpW4SBqbYCcngQ50okUK85N 0BhL6FJIpW/L4ZD6bz30tqqzEYmgOj8Tj9MWPuhaxKCyZi5cFvXNtFFnSj95RXuFvDRc XGfPt92xxgfN5fqvp14UGNVRRNQYziHX7CSoxT7+bHiz5iqWTXP+c6rxr7rmQR8fcb5N 2yRdzfwluS+XzgHL+7RoeFrEkFyxMypwaMf2E+fHnWrE79dQXOpaEd8S/LXyTmBLG5rr rM2eC2j2jqRhRnRqR5LagLle60u1par0clmg8TRB+iw1I9qqBSUHzsHKiDFAl4Ypvb/j UCHg== X-Gm-Message-State: AHQUAub2HA2GLTQ4O+QxOcFKqiAqSSI/MluB83yu4RLnWSA6frZj4Gen Mdzf9zWjVSL7H4bd6nfRO3f5x+F49bcJnT/BZUo= X-Received: by 2002:a05:600c:211a:: with SMTP id u26mr9215345wml.142.1549892213289; Mon, 11 Feb 2019 05:36:53 -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: Shubhrajyoti Datta Date: Mon, 11 Feb 2019 19:06:42 +0530 Message-ID: Subject: Re: [PATCH] gpio: zynq: properly support runtime PM for GPIO used as interrupts To: Thomas Petazzoni Cc: Linus Walleij , Bartosz Golaszewski , Michal Simek , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, 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 Hi Thomas, Thanks for the patch. On Fri, Feb 8, 2019 at 4:13 PM 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 > --- Reviewed-by: Shubhrajyoti Datta >