Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp1005020ybs; Mon, 25 May 2020 05:01:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8ldLdpUexAFaV9OTLL46OlfO+HooOgF6AHIHZQNeG13xKkPnWpgzOG/t+Z+0e+NQPkZBS X-Received: by 2002:a17:906:2b8a:: with SMTP id m10mr19092139ejg.183.1590408063877; Mon, 25 May 2020 05:01:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590408063; cv=none; d=google.com; s=arc-20160816; b=hG1QYQOUUr+TBakgV91OBiVxyACg6yOogn7SYP4FjRC99slpvJc5rsYgZbLm+3/MFq My40eB5qSH/CIKNPR8URQFi2/IsWmDC3zZdSpM3u2eXiR7P5946FKJ2d0+gjMKD23+Nt wnYnO/kMFX3DzPD/EtUnTz8KzUUejIqetVm3r5JXXe+E7NOT91v5QANGxwmUD11VBdvs 6H7EDYb3lgKMsjVMlbr2G+TiLZjRXh+b0JO/89bH/TdHGDrQ1ym6KOdKqeFx5KAOyp8M R0mJAj5z/+0ckfQ3R/P6gAkElb4kaHh82kjxfjeifsV71eEfd0fGT+Sn3CtQ7FHePuqu epDw== 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=+mkEBPdVGpBGFyoI8j8HFLVKYs4hB0Ze1NrDN+H9//4=; b=XrteL0YpKsmqlcRIcZZ1Xrz0OhsT7n56uSmsCnxUnf1+FuQ7M5gtSxTXJbNXNMd+cT GS8tNhc/vcIs7PzFNWXCAiI45IfkjtGGlvCTecXblNTAePe212VXTrKACuPngX/gE7jB Ds0HZ0p9v8bM2vQ0w4dnmxs3N0Lv4/gF4eRzmobz0MBgLm+vQMN1qvg3SgCROsdyOWkh z/9Bry9zKM9g909BoUCnkJCnRCSFISw5kS9+sdAfkUBpzuyxn9H3UO4COzpT87oyh17+ TL8+MegC3NON03Y1jZtnmei5XQZTv/uFtFGZbuC9KesgIta18JNQ3d29QKW/qm6cI2rP hG9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Dl9TrwmQ; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nj4si9626499ejb.643.2020.05.25.05.00.41; Mon, 25 May 2020 05:01:03 -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=@linaro.org header.s=google header.b=Dl9TrwmQ; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390414AbgEYLzv (ORCPT + 99 others); Mon, 25 May 2020 07:55:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390169AbgEYLzv (ORCPT ); Mon, 25 May 2020 07:55:51 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C04D3C08C5C0 for ; Mon, 25 May 2020 04:55:49 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id w10so20516247ljo.0 for ; Mon, 25 May 2020 04:55:49 -0700 (PDT) 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=+mkEBPdVGpBGFyoI8j8HFLVKYs4hB0Ze1NrDN+H9//4=; b=Dl9TrwmQPeoE3jaUpcbhwTsZJCgQoRRdu4baaLsu04TpdTNzaqoI6O3YXQ+GOf6Sjp FB0MZ0UTIz1JjeI1Z2dk6xN2Fp9Fmkmep7JxkbmiabYb5gilLzb3dxM5Rrm8qBIsa7ku sPaakWkOAr6eIqCD+XlAJbUP3W0TuDCwK2BNkVndEMiBbKxXGomN4j7kaLJgKZwbWXc9 8jHHyW8egtFvlYcDOvqFxk4kjTXOovA6bT1z7CQKYB/RMjnSuSE9M8bzVT5c8PHdel3b zBhhIdRVdIa0/32PC73lIN8+gsj0wVNTOdl7Gg51WLQgMJB6sTWXu9c7Da+QEorLu53m dxMw== 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=+mkEBPdVGpBGFyoI8j8HFLVKYs4hB0Ze1NrDN+H9//4=; b=OV5poceYl88q8uTFmM84WNkyytN1at5y2YxU192tH0q5pIwZxc/lvxZU0jMwXwxFRs sJdwILZaGAO8QI1S+yTqfKOj6BvRisX6AhJ7u+hPBRp6S0LlwfyH6ffhGzGDkKWo7K0l RmV4tOekbjCOJGDV1bcKdtslMnsToOVr+o1EjpEpzrglGFN9WxaVppNU0fYzTxdF4NVh 4zdKCG2WTcBc2brT8BnLRhceg/YnzSBgsJuFDj35qciSMpAfX6xAWHVZtO4PuI1I65hx 9Qj2T414p/udV3iU6qO25jB8FYyLCUEHTLs6NWKYRMR5LUYNM7IwiqWOEK00516xyzxu CrtA== X-Gm-Message-State: AOAM532oL/kAMWnkUk8zjf6vJKJwhAQ90ns+8CMMJbfomQAC32lfkbZP xVTi/sI/fAiweDBrSuxr9GgXAUOVjKB4ksGqqlfh2g== X-Received: by 2002:a2e:8e91:: with SMTP id z17mr10762076ljk.144.1590407748281; Mon, 25 May 2020 04:55:48 -0700 (PDT) MIME-Version: 1.0 References: <1590253873-11556-1-git-send-email-mkshah@codeaurora.org> <1590253873-11556-2-git-send-email-mkshah@codeaurora.org> In-Reply-To: <1590253873-11556-2-git-send-email-mkshah@codeaurora.org> From: Linus Walleij Date: Mon, 25 May 2020 13:55:37 +0200 Message-ID: Subject: Re: [PATCH v2 1/4] gpio: gpiolib: Allow GPIO IRQs to lazy disable To: Maulik Shah , Hans Verkuil , Hans Verkuil Cc: Bjorn Andersson , Marc Zyngier , Stephen Boyd , Evan Green , Matthias Kaehlcke , "linux-kernel@vger.kernel.org" , MSM , "open list:GPIO SUBSYSTEM" , Andy Gross , Thomas Gleixner , Jason Cooper , Doug Anderson , Rajendra Nayak , Lina Iyer , lsrao@codeaurora.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 Sat, May 23, 2020 at 7:11 PM Maulik Shah wrote: > With 'commit 461c1a7d4733 ("gpiolib: override irq_enable/disable")' gpiolib > overrides irqchip's irq_enable and irq_disable callbacks. If irq_disable > callback is implemented then genirq takes unlazy path to disable irq. > > Underlying irqchip may not want to implement irq_disable callback to lazy > disable irq when client drivers invokes disable_irq(). By overriding > irq_disable callback, gpiolib ends up always unlazy disabling IRQ. > > Allow gpiolib to lazy disable IRQs by overriding irq_disable callback only > if irqchip implemented irq_disable. In cases where irq_disable is not > implemented irq_mask is overridden. Similarly override irq_enable callback > only if irqchip implemented irq_enable otherwise irq_unmask is overridden. > > Fixes: 461c1a7d47 (gpiolib: override irq_enable/disable) > Signed-off-by: Maulik Shah I definitely want Hans Verkuils test and review on this, since it is a usecase that he is really dependent on. Also the irqchip people preferredly. But it does seem to mop up my mistakes and fix this up properly! So with some testing I'll be happy to merge it, even this one patch separately if Hans can verify that it works. Yours, Linus Walleij