From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E9D3C433EF for ; Fri, 8 Apr 2022 11:38:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234870AbiDHLkP (ORCPT ); Fri, 8 Apr 2022 07:40:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230312AbiDHLkP (ORCPT ); Fri, 8 Apr 2022 07:40:15 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 093FB3EF0F; Fri, 8 Apr 2022 04:38:12 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id i27so16726876ejd.9; Fri, 08 Apr 2022 04:38:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aQTMkqSfFhl91Cc0GUZ1r40OnFQa6gJ5Xa9eGXPe3QY=; b=ay22Mzf7xEG4Xo6lXaOF5bzT6fbmSM7LljcZeltTGhjVGqTp0+GhNQBQWNiOksmy1Z 0dECOKMK53lDKH4LXjY8F2YWN1YPml4hzRccRepsMw0FZkypuf/vBfwiH1hd/Ncw7bHN rYNw9plPjJhn2AIHbxARkkXQP5f7ux+pm2bQjGq4g7KyNUabsvLnOQa85Ksn3L2nFxC8 eToU8uqYqBecK99X32eGYvcmBe42Kk6VtDHXnLZojqYRYj6198nODbWbSunP5PBlZKPu j1pyYi6hJWlnlBcDcQnxzkxOkrzz0I4OjshpGH1WVtaAjrhBDVn2bnS1WTNkIjY8fe04 pJ+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aQTMkqSfFhl91Cc0GUZ1r40OnFQa6gJ5Xa9eGXPe3QY=; b=HrDCYUYZenl3XNlQBPMtd75LEaK84tmaCR7Rb9w6jI7zmW4AGPxoewydQCol9r+UqV rB4vHPpTEgvNy1nkWwDyJ5Uc+ETxwzxvLhDv6ImOh6KplTi/OZ2pmIsrGlVc/e7hzT0c n5BIfE2msQ+eII28XnRpUvWWGElCoTA4Y9ZKW/Kr0dSdW2uyraRTsBuigKytTA5Jy9Sq GMfYvkz7qGUPTAOIv4gWfPLMk4dIPQ72YqJXgnT1eTe6GDS6iPSMNkcAcNiIt5jX4pMs 83E8vgtaruKbaiKY01hWyItDZwIgAshCuRROzOxZmkFanf5IAmmE3kZfC4FGtH7Re5ut fY6Q== X-Gm-Message-State: AOAM531s0HLADWz5eRuebI/axcdjDIIOHPr73XpPNeytPeRWhWw2YWWD PXmiC2JBOT/ZUXhwey+WHW1ZyDcuhMc0qcVKSH0= X-Google-Smtp-Source: ABdhPJzfswmEDudd532KIvJjC3KNAd22CqiWCt9MqgTK7JU06acMZpBdYDNh1a6YlRxJJaqA4bX5LVjm6tPgCUOuB2I= X-Received: by 2002:a17:907:a411:b0:6e1:2084:99d2 with SMTP id sg17-20020a170907a41100b006e1208499d2mr1045774ejc.639.1649417890559; Fri, 08 Apr 2022 04:38:10 -0700 (PDT) MIME-Version: 1.0 References: <20220405135444.199295-1-maz@kernel.org> <20220405135444.199295-11-maz@kernel.org> In-Reply-To: <20220405135444.199295-11-maz@kernel.org> From: Andy Shevchenko Date: Fri, 8 Apr 2022 14:33:56 +0300 Message-ID: Subject: Re: [PATCH v2 10/10] Documentation: Update the recommended pattern for GPIO irqchips To: Marc Zyngier Cc: Linux Kernel Mailing List , Linus Walleij , Bartosz Golaszewski , Thierry Reding , Joey Gouly , Jonathan Hunter , Hector Martin , Sven Peter , Alyssa Rosenzweig , Bjorn Andersson , Andy Gross , Jeffrey Hugo , Thomas Gleixner , Basavaraj Natikar , Shyam Sundar S K , "open list:GPIO SUBSYSTEM" , linux-tegra , linux-arm Mailing List , linux-arm-msm@vger.kernel.org, Android Kernel Team Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org On Wed, Apr 6, 2022 at 1:57 PM Marc Zyngier wrote: > > Update the documentation to get rid of the per-gpio_irq_chip > irq_chip structure, and give examples of the new pattern. ... > + static void my_gpio_mask_irq(struct irq_data *d) > + { > + struct gpio_chip *gc = irq_desc_get_handler_data(d); > + > + /* > + * Perform any necessary action to mask the interrupt, > + * and then call into the core code to synchronise the > + * state. > + */ > + > + gpiochip_disable_irq(gc, d->hwirq); (1) > + } > + > + static void my_gpio_unmask_irq(struct irq_data *d) > + { > + struct gpio_chip *gc = irq_desc_get_handler_data(d); > + gpiochip_disable_irq(gc, d->hwirq); (2) > + /* > + * Perform any necessary action to unmask the interrupt, > + * after having called into the core code to synchronise > + * the state. > + */ > + } If (1) and (2) being the same is not a mistake (typo) it probably needs additional explanation. ... > + static void my_gpio_mask_irq(struct irq_data *d) > + { > + struct gpio_chip *gc = irq_desc_get_handler_data(d); > + > + /* > + * Perform any necessary action to mask the interrupt, > + * and then call into the core code to synchronise the > + * state. > + */ > + gpiochip_disable_irq(gc, d->hwirq); (3) > + } > + > + static void my_gpio_unmask_irq(struct irq_data *d) > + { > + struct gpio_chip *gc = irq_desc_get_handler_data(d); > + gpiochip_disable_irq(gc, d->hwirq); (4) > + /* > + * Perform any necessary action to unmask the interrupt, > + * after having called into the core code to synchronise > + * the state. > + */ > + } Ditto for (3) & (4). ... > + static void my_gpio_mask_irq(struct irq_data *d) > + { > + struct gpio_chip *gc = irq_desc_get_handler_data(d); > + > + /* > + * Perform any necessary action to mask the interrupt, > + * and then call into the core code to synchronise the > + * state. > + */ > + > + gpiochip_disable_irq(gc, d->hwirq); (5) > + irq_mask_mask_parent(d); > + } > + > + static void my_gpio_unmask_irq(struct irq_data *d) > + { > + struct gpio_chip *gc = irq_desc_get_handler_data(d); > + gpiochip_disable_irq(gc, d->hwirq); (6) > + /* > + * Perform any necessary action to unmask the interrupt, > + * after having called into the core code to synchronise > + * the state. > + */ > + > + irq_mask_unmask_parent(d); > + } Ditto for (5) & (6). -- With Best Regards, Andy Shevchenko From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 193CBC433F5 for ; Fri, 8 Apr 2022 11:40:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=e59t2wFEURfKesk9qUDRqUqGGHfMhBg4zu3KKD/p2MI=; b=SdOjwmAJW4TgMI ymuBLopA3ovy6jnjjWv92ChHWlcuKtbAfLXdl5PjIBQTVPgnAggUyvyH+gZlmGji5mRCIIqUnT+wi UUJlxIeM9nZoL/KQXbA8mccYD3OkHgoRpPRnkzEiJNkEJvvEj2xhJNLbxIXzy7nt8pERqBhta/QXx RD8Hmr/BgBQ7+c+5FIaRCqx8tN/uv8UKDggJAtLUe0JDd5/CGUp2ZHbw41iqZanT+6uzf8/p/sIiq ig4rpMtm+H2AB4OVTtNl9w9HUdvcBOfg0dPB3D/0kYx/u1VR5l4mNDn7lXwAFAcOtm5uiSkWpWRMm YEP6QCmlneC4Igb7NtNg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ncmxN-00Ggjz-Iv; Fri, 08 Apr 2022 11:39:15 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ncmwP-00GgKC-Pp for linux-arm-kernel@lists.infradead.org; Fri, 08 Apr 2022 11:38:15 +0000 Received: by mail-ej1-x62d.google.com with SMTP id bh17so16720328ejb.8 for ; Fri, 08 Apr 2022 04:38:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aQTMkqSfFhl91Cc0GUZ1r40OnFQa6gJ5Xa9eGXPe3QY=; b=ay22Mzf7xEG4Xo6lXaOF5bzT6fbmSM7LljcZeltTGhjVGqTp0+GhNQBQWNiOksmy1Z 0dECOKMK53lDKH4LXjY8F2YWN1YPml4hzRccRepsMw0FZkypuf/vBfwiH1hd/Ncw7bHN rYNw9plPjJhn2AIHbxARkkXQP5f7ux+pm2bQjGq4g7KyNUabsvLnOQa85Ksn3L2nFxC8 eToU8uqYqBecK99X32eGYvcmBe42Kk6VtDHXnLZojqYRYj6198nODbWbSunP5PBlZKPu j1pyYi6hJWlnlBcDcQnxzkxOkrzz0I4OjshpGH1WVtaAjrhBDVn2bnS1WTNkIjY8fe04 pJ+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aQTMkqSfFhl91Cc0GUZ1r40OnFQa6gJ5Xa9eGXPe3QY=; b=rusgboUJdKkMvpGY6V7hfjqvRoZXWR8nq8+h20jueLPfdh47hZeQ90bZTLRGM4h6RS xlB3uyLp8/gKhdhvnQ+UcJSvdvZQwLhqjg0CGHVzDdVIe6wbys3QacV2sWaAuUHlHTrZ R6d1CkEQVQLMP65BguiBjmip7Zu/t9r4EoXE0sliGpsgvVCJcU3fZEfhu7RfhFiT0ZWe Y0p1+jmkbKVDU4lc4B7l4mF0dyuJ5OptYWLy3fdigBIpccMHLyUaI3xOLW0XsB848XQ6 fj/Q4jUlyyesbMjGm5xHmr8uB1tKW6Q5ioI8OCt2ulD/VkQwhuTrWnUJQ5zs6GB7y8Sm rQDA== X-Gm-Message-State: AOAM533fbIp0VqOBMJ0blojq3KW/sy/Dg2TNiAw8pbcckGRs6tCspprY I5Z9eUP6w0A4pnHLd4oXXtddHKueat00duYCyNs= X-Google-Smtp-Source: ABdhPJzfswmEDudd532KIvJjC3KNAd22CqiWCt9MqgTK7JU06acMZpBdYDNh1a6YlRxJJaqA4bX5LVjm6tPgCUOuB2I= X-Received: by 2002:a17:907:a411:b0:6e1:2084:99d2 with SMTP id sg17-20020a170907a41100b006e1208499d2mr1045774ejc.639.1649417890559; Fri, 08 Apr 2022 04:38:10 -0700 (PDT) MIME-Version: 1.0 References: <20220405135444.199295-1-maz@kernel.org> <20220405135444.199295-11-maz@kernel.org> In-Reply-To: <20220405135444.199295-11-maz@kernel.org> From: Andy Shevchenko Date: Fri, 8 Apr 2022 14:33:56 +0300 Message-ID: Subject: Re: [PATCH v2 10/10] Documentation: Update the recommended pattern for GPIO irqchips To: Marc Zyngier Cc: Linux Kernel Mailing List , Linus Walleij , Bartosz Golaszewski , Thierry Reding , Joey Gouly , Jonathan Hunter , Hector Martin , Sven Peter , Alyssa Rosenzweig , Bjorn Andersson , Andy Gross , Jeffrey Hugo , Thomas Gleixner , Basavaraj Natikar , Shyam Sundar S K , "open list:GPIO SUBSYSTEM" , linux-tegra , linux-arm Mailing List , linux-arm-msm@vger.kernel.org, Android Kernel Team X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220408_043813_912882_A83AD43B X-CRM114-Status: GOOD ( 16.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Apr 6, 2022 at 1:57 PM Marc Zyngier wrote: > > Update the documentation to get rid of the per-gpio_irq_chip > irq_chip structure, and give examples of the new pattern. ... > + static void my_gpio_mask_irq(struct irq_data *d) > + { > + struct gpio_chip *gc = irq_desc_get_handler_data(d); > + > + /* > + * Perform any necessary action to mask the interrupt, > + * and then call into the core code to synchronise the > + * state. > + */ > + > + gpiochip_disable_irq(gc, d->hwirq); (1) > + } > + > + static void my_gpio_unmask_irq(struct irq_data *d) > + { > + struct gpio_chip *gc = irq_desc_get_handler_data(d); > + gpiochip_disable_irq(gc, d->hwirq); (2) > + /* > + * Perform any necessary action to unmask the interrupt, > + * after having called into the core code to synchronise > + * the state. > + */ > + } If (1) and (2) being the same is not a mistake (typo) it probably needs additional explanation. ... > + static void my_gpio_mask_irq(struct irq_data *d) > + { > + struct gpio_chip *gc = irq_desc_get_handler_data(d); > + > + /* > + * Perform any necessary action to mask the interrupt, > + * and then call into the core code to synchronise the > + * state. > + */ > + gpiochip_disable_irq(gc, d->hwirq); (3) > + } > + > + static void my_gpio_unmask_irq(struct irq_data *d) > + { > + struct gpio_chip *gc = irq_desc_get_handler_data(d); > + gpiochip_disable_irq(gc, d->hwirq); (4) > + /* > + * Perform any necessary action to unmask the interrupt, > + * after having called into the core code to synchronise > + * the state. > + */ > + } Ditto for (3) & (4). ... > + static void my_gpio_mask_irq(struct irq_data *d) > + { > + struct gpio_chip *gc = irq_desc_get_handler_data(d); > + > + /* > + * Perform any necessary action to mask the interrupt, > + * and then call into the core code to synchronise the > + * state. > + */ > + > + gpiochip_disable_irq(gc, d->hwirq); (5) > + irq_mask_mask_parent(d); > + } > + > + static void my_gpio_unmask_irq(struct irq_data *d) > + { > + struct gpio_chip *gc = irq_desc_get_handler_data(d); > + gpiochip_disable_irq(gc, d->hwirq); (6) > + /* > + * Perform any necessary action to unmask the interrupt, > + * after having called into the core code to synchronise > + * the state. > + */ > + > + irq_mask_unmask_parent(d); > + } Ditto for (5) & (6). -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel