Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6515765rdb; Fri, 15 Dec 2023 00:09:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IEELjGmYrx8bwXfNH+FyXsFJkNsXHoCIMf84brjhZ3xFZYC2Puz2XKUSXwIh+iQZ+6159Sn X-Received: by 2002:ad4:5347:0:b0:67a:e577:9dfe with SMTP id v7-20020ad45347000000b0067ae5779dfemr10502413qvs.81.1702627764664; Fri, 15 Dec 2023 00:09:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702627764; cv=none; d=google.com; s=arc-20160816; b=HH/eM4Q0ZESeKoWbl90OFxJWXxyDIDjrYMEMchKp8GPnErCiZhr6mr4GjPbdCLhOiT aWgXLBlZZ4X/VigYpEbmgDyGgo3stlK+skFjvSQbiGAmwA8wBW572kc3nO8OvEtuFYYV Eiao5MmcYX3Um9UmeJ2HGgyz0xESpXIDqT+B3Z3pj1ipJ0KmDljK2O3/xATmQGIMtaJ7 DXwGuBYGjuYd1ggQBSsZEI9OquaH32N7epaYG+qjHteUyVcu6bdSR0zeCiJJsMq5ph6h pyAz1CZ7JmhFiaB5le6LFGr0oNUrvsY18Guq5IA3V/z8OnmQEigLaCWuiC/2RyjTC1yK PEEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=4AKmof5pAW7TygmISaKPbmc1WQ+QTmQUNzaEDz3+MJQ=; fh=m4qR3BasxnPLMZbrj6UKhC+5A81FuoCLnIeAWU8yaJA=; b=Kh8w0JqTbnkh13YW5DzLcb0AbNNMb3suo/hgD8JubMaj/9LHIr5SjP/Tw3iw+TeKlC ZfxzkAp0bMwLz/uj5I5Zd92EmMUZ+e4PXW3OJB7aOq6eqLfmxM7GrJZi4o5dUWmGOnO6 g0pKx5PIW1PKrB/KDxZxK1fak18/+HaGTRDi42EV2F1UDP+pUE/NLFh/G1NDT6s4d4S4 4x6xMjyCyGr750JiEmUNk4UtwfW/ys6Z0Eh8F6ffARGjytMfrbIVXa83HjtWTWHr0EOj SIJmki0/iasraDHffe1Xk8hkzVNX2SziUrnz8Lnm8fP83CUjx50aDK3N5MaX0ShImDRz F8EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=iwBKYcOe; dkim=neutral (no key) header.i=@linutronix.de header.b=9hEZ2LQE; spf=pass (google.com: domain of linux-kernel+bounces-588-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-588-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id h10-20020a0cf44a000000b0067a97e5817dsi3078314qvm.557.2023.12.15.00.09.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 00:09:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-588-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=iwBKYcOe; dkim=neutral (no key) header.i=@linutronix.de header.b=9hEZ2LQE; spf=pass (google.com: domain of linux-kernel+bounces-588-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-588-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 697141C22570 for ; Fri, 15 Dec 2023 08:09:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 09BF411C8D; Fri, 15 Dec 2023 08:09:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="iwBKYcOe"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="9hEZ2LQE" X-Original-To: linux-kernel@vger.kernel.org Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59CDB111AC; Fri, 15 Dec 2023 08:09:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1702627750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4AKmof5pAW7TygmISaKPbmc1WQ+QTmQUNzaEDz3+MJQ=; b=iwBKYcOePY/PIKs2unMPsHlz3R+dUDYoLE1figBqNWbfWsOoCzF30QnfsVjQRzxF8T6shR w53E318yFG+DcehygZ8me4hJ2eo5+mcoJx6/0Fssn+HFeD/X5V/AeTP8iyk2vDcD7tklK4 vT9DjjugLCv6bGF1dzUelKDMTucw26MFIxsNwHDwbD/wMk7Jqu+kjKcUzUnO8Z4MdqUEPd lHuQ3nMWpwmWSGM3AIsX81J6j185VGswW42GrtI4hjQwtQq1wvyyEYTovwLMZDWILkyCge EzRM4+7Z2dQj65xTgpdcbmgJIcnCSioXr3Y+exhXnoiikd6I/knuOqN4ovhTpA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1702627750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4AKmof5pAW7TygmISaKPbmc1WQ+QTmQUNzaEDz3+MJQ=; b=9hEZ2LQEPvY+/KJlITL6lVCiFbwgmlZsjemy/hqdRAb0ph0FMAfUYs+0+o56YKqTHn6yds 3uNN7p3K4AO0UHBQ== To: Linus Walleij , Luo Jiaxing , Marc Zyngier Cc: Bartosz Golaszewski , Serge Semin , Andy Shevchenko , Andy Shevchenko , "open list:GPIO SUBSYSTEM" , "linux-kernel@vger.kernel.org" , Linuxarm Subject: Re: [PATCH v1] gpio: dwapb: mask/unmask IRQ when disable/enable it In-Reply-To: References: <1606728979-44259-1-git-send-email-luojiaxing@huawei.com> Date: Fri, 15 Dec 2023 09:09:09 +0100 Message-ID: <87fs03opju.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Sat, Dec 05 2020 at 22:58, Linus Walleij wrote: > Sorry for top posting but I need the help of the irqchip maintainer > Marc Z to hash this out. > > The mask/unmask/disable/enable semantics is something that > you need to work with every day to understand right. The patch is correct. The irq_enable() callback is required to be a superset of irq_unmask(). I.e. the core code expects it to do: 1) Some preparatory work to enable the interrupt line 2) Unmask the interrupt, which is why the masked state is cleared by the core after invoking the irq_enable() callback. #2 is pretty obvious because if an interrupt chip does not implement the irq_enable() callback the core defaults to irq_unmask() Correspondingly the core expects from the irq_disable() callback: 1) To mask the interrupt 2) To do some extra work to disable the interrupt line Same reasoning as above vs. #1 as the core fallback is to invoke the irq_unmask() callback when the irq_disable() callback is not implemented. Thanks, tglx