Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1311718ybh; Mon, 13 Jul 2020 15:26:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEBIyRjtqv+J9PVZaSxCHHwN7EteP9E/Rk+AAXVkcI6BQY2fnxU/UCpd4WWaHYlFRfMfv9 X-Received: by 2002:a17:906:c14f:: with SMTP id dp15mr1802544ejc.454.1594679170938; Mon, 13 Jul 2020 15:26:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594679170; cv=none; d=google.com; s=arc-20160816; b=K3rxRCtxCHtJtJOsV9qfpCjGf0ITSm1SJafQ2rhKehSfN8jyMl9AjsRQYrRnKwnWe6 lRZbsGYeH5S8GaCWN6TUlPB4I+tikNT0E7zmd95dkZjHFUaxsYuaLQwyQo82NlRxhpXd p5A/v9VJi388gtDSHoIUiPTR+Xw8G8EyIGRAK8sGGvDL0+ltO5z5IdzeTwvFGlc+A5UD FNemLS/Zhbp2H29J1+5xSllby8Rp5pH1odBSjxNgwU9thT5x7u5UQ1kRh02hYyiOcWme SoCLRI19FtohGlVpIHnAh5Lmq+1S4j16OPADo6ah8s9Ac9fDgxp/6MnVMb3ZmnKXf5Wn 8dOw== 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=QHfgfv2mP6dp6kaJTVFYuFviBEEN6wpOON6T0JxtLVk=; b=z128nCynGtoe7dM23oeW+3+ALcJLJIwAVd/5ELoH3fkZ56/IuuECQ9DrQF/zVCjPaH 7wHeNFdVnG7OPtRK8eDZ4QlBOUlZL7gz3sR3shPqvJknBPjgQ4j/TZ1mMRorh2tPiCbh 03bNMkWHrZw/proTi6q2cjU8Kv6cUy0F4kDk6ngPaBHUAzgtuIQofijg+QxqcQ86VQuo q2s2OzLcsl2ZDmebZ8dC+egOe8tmTTcPFWn+AwXjvSiboC3CKDjz6ex2Z5Itt8WT51un ysODE8K6Lx/mUlyVH0QnufsXiNpZS/dcSPC+9UqCNiCG2N3SkxEA8qR9j1W5r3AfFIWQ qj9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=cSeqsacE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p14si1682938edm.364.2020.07.13.15.25.47; Mon, 13 Jul 2020 15:26:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=cSeqsacE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726568AbgGMWZN (ORCPT + 99 others); Mon, 13 Jul 2020 18:25:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726358AbgGMWZM (ORCPT ); Mon, 13 Jul 2020 18:25:12 -0400 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62D0AC061755 for ; Mon, 13 Jul 2020 15:25:12 -0700 (PDT) Received: by mail-qt1-x843.google.com with SMTP id k18so11339252qtm.10 for ; Mon, 13 Jul 2020 15:25:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QHfgfv2mP6dp6kaJTVFYuFviBEEN6wpOON6T0JxtLVk=; b=cSeqsacEiX0VNBd7mC9bj3A8JzJZlyD3j4cmXLuYevvPoeKEk8W+U5HnPEomxpm5bo LRaqdmOo5RVCRntAP5RSqQ9O5u+EP+mswHCf4O+Kth2ygENQ1VWCkbAMFQ+01IILIQun O0GExOUmlRIqEf/OfFr3Ctc6cYjV3RMpNtbgU= 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=QHfgfv2mP6dp6kaJTVFYuFviBEEN6wpOON6T0JxtLVk=; b=MT95qihyQL5FANcr421MckKhSzLcD0IxT5caCGg35+bR28aO14GEAC4AwboTOwa4si kym+jpRR9S9WCcJqlspLpzLxAI3fz+WExiRQiHdlpPHCOfvG/LvXL3OFYWxAUowwj4gW YJih6tTXfqhaFHjBahSdVIpdOPF+y8AWL4ep8kQuKvPWX9S+uUs+BXUEpAQY92tfRI9l D9vVROL1uQN914DpFPgr7XDmyT+NmEhIeB65moio33ufkachJe+ArH1mW8PFjACsEM+9 fw7KQmO+aS1q7LbUApS92+olIaSGrS9y1EK8fN7ZDTBaNonehvBYFvV/JgV33QolflcC /TIg== X-Gm-Message-State: AOAM532mMnqRIg6KCVJpMWt7FL0oXkJg4vKNpO/KBLC9MKeDJRhBu6IA c2oqItmIc5PWq3DNijuxjvunZupf4Kw= X-Received: by 2002:ac8:7a69:: with SMTP id w9mr1654919qtt.179.1594679111392; Mon, 13 Jul 2020 15:25:11 -0700 (PDT) Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com. [209.85.219.51]) by smtp.gmail.com with ESMTPSA id i22sm19052158qki.4.2020.07.13.15.25.11 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Jul 2020 15:25:11 -0700 (PDT) Received: by mail-qv1-f51.google.com with SMTP id t11so6601089qvk.1 for ; Mon, 13 Jul 2020 15:25:11 -0700 (PDT) X-Received: by 2002:a67:e046:: with SMTP id n6mr1294693vsl.6.1594678686784; Mon, 13 Jul 2020 15:18:06 -0700 (PDT) MIME-Version: 1.0 References: <1592818308-23001-1-git-send-email-mkshah@codeaurora.org> <1592818308-23001-2-git-send-email-mkshah@codeaurora.org> In-Reply-To: <1592818308-23001-2-git-send-email-mkshah@codeaurora.org> From: Doug Anderson Date: Mon, 13 Jul 2020 15:17:55 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 1/5] pinctrl: qcom: Remove irq_disable callback from msmgpio irqchip To: Maulik Shah Cc: Bjorn Andersson , Marc Zyngier , LinusW , Stephen Boyd , Evan Green , Matthias Kaehlcke , LKML , linux-arm-msm , "open list:GPIO SUBSYSTEM" , Andy Gross , Thomas Gleixner , Jason Cooper , Rajendra Nayak , Lina Iyer , Srinivas Rao L 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, On Mon, Jun 22, 2020 at 2:32 AM Maulik Shah wrote: > > The gpio can be marked for wakeup and drivers can invoke disable_irq() > during suspend, in such cases unlazy approach will also disable at HW > and such gpios will not wakeup device from suspend to RAM. > > Remove irq_disable callback to allow gpio interrupts to lazy disabled. > The gpio interrupts will get disabled during irq_mask callback. > > Acked-by: Linus Walleij > Signed-off-by: Maulik Shah > --- > drivers/pinctrl/qcom/pinctrl-msm.c | 13 ------------- > 1 file changed, 13 deletions(-) While the code of this patch looks fairly correct to me (there's no need to implement the irq_disable callback and we can just rely on the masking), I'm slightly anxious about the description. It almost feels like you're somehow relying on the laziness to "fix" your issue here. ...but the laziness is supposed to just be an optimization. Specifically if an interrupt happens to fire at any point in time after a driver has called disable_irq() then it acts just like a non-lazy disable. Said another way, I think this is a valid thing for a driver to do and it should get woken up if the irq fires in suspend: disable_irq(); msleep(1000); enable_irq_wake() Specifically if an IRQ comes in during that sleep then it will be just like you had a non-lazy IRQ. So while I'm for this patch, I'd suggest a simpler description (assuming my understanding is correct): There is no reason to implement irq_disable() and irq_mask(). Let's just use irq_mask() and let the rest of the core handle it. Also: it feels really weird to me that you're getting rid of the irq_disable() but keeping irq_enable(). That seems like asking for trouble, though I'd have to do more research to see if I could figure out exactly what might go wrong. Could you remove your irq_enable() too? -Doug