Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6573662rdb; Fri, 15 Dec 2023 02:25:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IExPJoLZTCXWrC5eDTZ5PM+oRlgDEfN6lbw46m/10OeDhQQB7fYtdmLq9JKjT/IYyN9/rns X-Received: by 2002:a05:6e02:1bc6:b0:35d:690d:9996 with SMTP id x6-20020a056e021bc600b0035d690d9996mr15698391ilv.3.1702635905144; Fri, 15 Dec 2023 02:25:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702635905; cv=none; d=google.com; s=arc-20160816; b=CYAPchv8kVZEBOj7NNWX3VJQxcJMOAhzf+bURogzS8/Qg7SW7d/mqGXNzquJw0aLYR qHtKsWx1WujVxdCc32uf3L4WrKwMixrLuSu9851RtIT2DCflCyJ2rwrM1XNWaxvFk+a+ ehEqzFquW89l1MV1pr5IP24FJAClXZkslIOwqHPh44FE0cPDqyaDC6ipO/9XnyyTILXz hGIvM959ZmvK4PRRZzEeLpsEai9TibJWxSgCjpvhn2KfeO8BzKrP8KH06CIOx1sVNXAF IegGs1ZuwsIkN2Eavytp8KaR5OOD3E49GLcVLFSFTqBKUKtry8DRpb1xZVNxIC12VPNF uUqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=om+MewwPAHUnWXsD47rww5lBVph+7rgw3eM2axHBh94=; fh=DR2ZOgX8FC8M0HFnteBgd7f5T/CvyzN1mJJ3zO4wMRQ=; b=upvQ5nqCD7SVoocMfxmBp92gOA0Kp2xblbGPkMVMvj9KcVmzLAhAQwntttH1rXCubC 6KaDcfgFx7FPa5MIQ7qUKx1npgqAfsqvVRfwx5VksI8W4rQ3YBF3rGZAS/DhtjAiLV+7 S/mCAKkzZJGMBN+NY8moWD4FkD6H85TNzyTwMyXZlr6KYaDulD9nQnpqvRLDhBWtpp9R ulpRzH2PInndGNQn/3WcUrsJEWxw+QsHhLInVFf0w3GiFgtb+gXPcGkHZqWCh28UA5LL NwQBgatz7xwb3qNYe/YFQ3qcEjA7HU2vFu85LL2NtrCumCE+Ih4+3JJOCI0CIcne7FmX oAEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=F1Wwsq2E; spf=pass (google.com: domain of linux-kernel+bounces-748-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-748-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id f25-20020a656299000000b005c684e1f2ecsi12767641pgv.400.2023.12.15.02.25.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 02:25:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-748-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=F1Wwsq2E; spf=pass (google.com: domain of linux-kernel+bounces-748-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-748-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id B784B285753 for ; Fri, 15 Dec 2023 10:24:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B4C1F1947C; Fri, 15 Dec 2023 10:24:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="F1Wwsq2E" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5AC221A705; Fri, 15 Dec 2023 10:24:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-50e0daa57b3so438044e87.3; Fri, 15 Dec 2023 02:24:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702635868; x=1703240668; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=om+MewwPAHUnWXsD47rww5lBVph+7rgw3eM2axHBh94=; b=F1Wwsq2EI8iVcSBNzML20oTGhnIouEIE5x+d9ert8+ykuttu0m8j1NGbfPi61GMonD 8d9alQtv2e83BstDtUDa26K5DHV+3V8XYjxO6sXsj2F9P/iIFXBrBGXrwXNvjdKSCNOW VKAF0R9AM6XM8R3v4wsj9whlFTvygVEYDNM1HgAxVk6bS7dX4fghXjET5qu7XF52XBkt YzVxIu7+7OTSj5LPp0xVZ9VRf8ojotK2x0d5erdPuNMiasAV0jW2bhm0EijHfiFYWgAZ GY318PXhCDucbkBeoomz2b4RJzF7da/0kaDoOLyuPSQwnMw4z2Yujn3MtZynBUqek5wY 3IUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702635868; x=1703240668; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=om+MewwPAHUnWXsD47rww5lBVph+7rgw3eM2axHBh94=; b=TGm+a4TAf0sz1THGbacJV+pd/Q8hBDl0obcb12GtNZts/XUljVNIG16PGCZKMcXfF8 JOSoD6HV7DRYP4sojWFJdTbECxG1fzCiLScCRttHTlUNBuX13jkwJmQQrVLEjunBaZTD st/NjrGKuEnKqIzFNjAhZYn6ddtJ/yFER2kiEgbszajJ6dTY6sf2rkQFEsp+8GKK64wp +E3UILu4IH/jVjLYwt0u+wrnRFT9ImQ3MHzBaYS5tB0Z0qkhIRhwQLmEmEVAeBGgB/A2 x0bM+M3URmym65WCJFexFZEFM0/83A3c2DdhBPXNuhmVNQmu3NASaWMsYZweiLLHe564 v6jQ== X-Gm-Message-State: AOJu0Yye41lMG+FWDUiCj4lWAiSz0tvBWd6flgns99Pb0/SYeO/l1elY fI4nwRa7rNA1Ap48c9azHtk= X-Received: by 2002:ac2:4ec1:0:b0:50b:fe11:b2ca with SMTP id p1-20020ac24ec1000000b0050bfe11b2camr3396267lfr.42.1702635868008; Fri, 15 Dec 2023 02:24:28 -0800 (PST) Received: from mobilestation ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id f20-20020ac251b4000000b0050c0c850bc4sm2036732lfk.7.2023.12.15.02.24.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 02:24:27 -0800 (PST) Date: Fri, 15 Dec 2023 13:24:24 +0300 From: Serge Semin To: Thomas Gleixner Cc: Linus Walleij , Luo Jiaxing , Marc Zyngier , 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 Message-ID: References: <1606728979-44259-1-git-send-email-luojiaxing@huawei.com> <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; charset=us-ascii Content-Disposition: inline In-Reply-To: <87fs03opju.ffs@tglx> Hi Thomas On Fri, Dec 15, 2023 at 09:09:09AM +0100, Thomas Gleixner wrote: > 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. Just curious. Wouldn't that be more correct/portable for the core to call both callbacks when it's required and if both are provided? So the supersetness requirement would be no longer applied to the IRQ enable/disable callbacks implementation thus avoiding the code duplications in the low-level drivers. -Serge(y) > > Thanks, > > tglx >