Received: by 2002:a05:7412:a9a3:b0:f9:327e:43ab with SMTP id o35csp31116rdh; Mon, 18 Dec 2023 03:33:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IFvAjVb9pyJwTUY17vzEJ4doDhD33Bt+BgudjjNyJVF409N1ZQpKI3wXgWfjmutx+Tdb0gw X-Received: by 2002:a17:902:aa46:b0:1d3:a68b:ee98 with SMTP id c6-20020a170902aa4600b001d3a68bee98mr667950plr.91.1702899206157; Mon, 18 Dec 2023 03:33:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702899206; cv=none; d=google.com; s=arc-20160816; b=ghXhx83k7N3f/mchbx80BHqIo94DyUgMhz/+xoEr+e052pA4OexSYRakWNZbHLyU5S ZLc/VSbTadcB/ZJzsyNedlmbGugogeutODK2yctJfjo+g08ScDqBloJgWR6ReRzhTCZj 6UjApMo2hIhgq78sdhwrQXE6Ur2ZWtM+pMMx+uW4AnU7PEw7xZXUC7caRAUG0vm8+VNo TbYxnGlL86IrUQ/l3vNA0fC6fnoAaV3G1g/+eX7ydZNASVtKpFOFQmsBBqsOWS6mo94z xEcPYN/NcHG0/xfBXSZxYMiBolPbPjI5Hy0W8CUwpJp+B94dqSZ3450m5WJ2No7Uokjp oHZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=organization:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=yDXbHnWhY8koF0j82pc3AAd1dV9bIO4LZTCc1d99rXQ=; fh=Pvtu6BqXdS9Yt5p77XF5y3Wjkm99vvY8vzDHWl1rvhA=; b=PtuD05XBoCPugDs6rsnDfOUEuMae95wT1NhEBaifG0QjZmV6fVJNqeMPDUztxxRRXV 1tBMyj3fLZS+Cf70QjJwsYVRqPDZKub/Mt8xXRU0Lf+ftoO1UyRFkozkOLkbQrrCMCw4 iAAJoCvxiRqV5Shx0PP1W1coqjWMUOGV6Cn5rbT5Q5RozraJHv9tDRrrtIHO7mSsZb7T IsrVK7jn1Yz4WYsfPPe6520E1s8QhI/Ny6b0eCfWLKW3CwSH8baitQKPn2kTBJiVpXps hGOpy+iuAOg7Qt3CH9nfPkQ2omkyl6ciDDS+Ko/zcpAYI2BnmbpEKMBO4bE9PoDYtdWh rvxA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-3435-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3435-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id i1-20020a17090332c100b001d3bf26fd7csi1274986plr.305.2023.12.18.03.33.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 03:33:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3435-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-3435-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3435-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 6BA89B21A7D for ; Mon, 18 Dec 2023 11:33:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 006E5199D9; Mon, 18 Dec 2023 11:33:15 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) (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 C8CCF19BD6; Mon, 18 Dec 2023 11:33:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=kernel.org X-IronPort-AV: E=McAfee;i="6600,9927,10927"; a="399324312" X-IronPort-AV: E=Sophos;i="6.04,285,1695711600"; d="scan'208";a="399324312" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Dec 2023 03:33:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10927"; a="841448115" X-IronPort-AV: E=Sophos;i="6.04,285,1695711600"; d="scan'208";a="841448115" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga008.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Dec 2023 03:33:08 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rFBrt-00000006uZd-1qHe; Mon, 18 Dec 2023 13:33:05 +0200 Date: Mon, 18 Dec 2023 13:33:05 +0200 From: Andy Shevchenko To: xiongxin Cc: fancer.lancer@gmail.com, hoan@os.amperecomputing.com, linus.walleij@linaro.org, brgl@bgdev.pl, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Riwen Lu Subject: Re: [v2] gpio: dwapb: mask/unmask IRQ when disable/enale it Message-ID: References: <20231218081246.1921152-1-xiongxin@kylinos.cn> 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: <20231218081246.1921152-1-xiongxin@kylinos.cn> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Mon, Dec 18, 2023 at 04:12:46PM +0800, xiongxin wrote: > In the hardware implementation of the i2c hid driver based on dwapb gpio > irq, when the user continues to use the i2c hid device in the suspend > process, the i2c hid interrupt will be masked after the resume process > is finished. > > This is because the disable_irq()/enable_irq() of the dwapb gpio driver > does not synchronize the irq mask register state. In normal use of the > i2c hid procedure, the gpio irq irq_mask()/irq_unmask() functions are > called in pairs. In case of an exception, i2c_hid_core_suspend() calls > disable_irq() to disable the gpio irq. With low probability, this causes > irq_unmask() to not be called, which causes the gpio irq to be masked > and not unmasked in enable_irq(), raising an exception. > > Add synchronization to the masked register state in the > dwapb_irq_enable()/dwapb_irq_disable() function. mask the gpio irq > before disabling it. After enabling the gpio irq, unmask the irq. > Fixes: 7779b3455697 ("gpio: add a driver for the Synopsys DesignWare APB GPIO block") > Signed-off-by: xiongxin Your SoB should go last. > Signed-off-by: Riwen Lu Then at all means what this SoB for? Either it's missing Co-developed-by, or simply wrong. > Tested-by: xiongxin This is assumed to be done by the contributor, but it's harmless to have it. With the above being sorted out, Reviewed-by: Andy Shevchenko ... To Serge, I give my vote to hwirq as it is aligned with the documentation. -- With Best Regards, Andy Shevchenko