Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp441488lqt; Thu, 18 Apr 2024 23:39:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU6YvHHszGaCcRXf74IJNsUkebIk9Zh/oourMziusmumD9f4/65f+U6jxRSMUw07Lw1CH13G2XZtFXtPtBPyAXSp4Im8wZwjNSUscL9Hw== X-Google-Smtp-Source: AGHT+IGUbk6b5ctlVnwC7i/5VWhzVDIQKuUljgEz+HgQXFRrtal/NXm1lmS9lFaiEyfAJt/lWlfN X-Received: by 2002:a05:620a:d48:b0:78d:646d:e2e7 with SMTP id o8-20020a05620a0d4800b0078d646de2e7mr1351343qkl.66.1713508743193; Thu, 18 Apr 2024 23:39:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713508743; cv=pass; d=google.com; s=arc-20160816; b=HtwDgy6cTrAui9cdzAaToFzv0AXKNJi16NH+zuP9Ci+yezmJeaaGhR6QcZcW/Apet1 ySv0ehWmG/soZ3U5zqiqfdCC/orHc/Be5GhhUygG/fp+fPGhBtOm8C28I5X/Er6pUZhq 77R197Umufyp/LrQu6YAHaF0RQzKAG2r5NVZA+zijygRdG8CwcrLCt13YcyKtLidfrGo 6bYEUVj0vxdRWLRv1MrkKmsPcuRAQajJUR2sBmt8XKeWbm0zo/VnU+csOvkI6OkTz0vA Txg6IGMTVASb2rKxLF3bpaWuRh3B4oHDheSo/x8agd32PBI+LcGIc8b4jPv1hR/VxItZ tMAA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=K2Mx24L3N0RW14qQUkoJvbTo91HHgAXzvzpRIQqaSQY=; fh=vhbLbrWw9RUyCXumVLGd8+d2vWTFXKKTau+xli5vGmg=; b=VnzlOCfb6OYoY6YTe2srdFsLjyXTdVbFZN7Qt+NdcJj69Kec6CpikG44An2h/okcZL 0XIyFGEiRXUt83wKlvY4jzLE4RBWSdrjccIE+X5Qt8I45pY3naCEMZMdowGL1wXLCCEq eJXQof3jPxRnHuh+VuNnADZo5pzTKkJUvHdBXlB5R/9NxWsBYOXSQZbc+REJeErJYCpT Kp89Z1+lObCOMXabS2oUMAw4BuXcR7HhoQRoVZnrJhamdh6AscRdx7j9UbxATWwJxkwV v4Wmq7fi0cXSGJ0wnmB7YwwH33QdWTBNb/wFslTnpt7lrLYDCPW4EYdYxPjgU3SZDlZy Cwfw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=bZy9nPsb; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-151062-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151062-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id os41-20020a05620a812900b0078a5eeb5611si1228067qkn.461.2024.04.18.23.39.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 23:39:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151062-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=bZy9nPsb; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-151062-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151062-linux.lists.archive=gmail.com@vger.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id E7A5C1C2108E for ; Fri, 19 Apr 2024 06:39:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8236F381C8; Fri, 19 Apr 2024 06:38:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="bZy9nPsb" Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (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 5B95FC8FF for ; Fri, 19 Apr 2024 06:38:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713508736; cv=none; b=mCdS8EUdUq/gxAuWbQedybANYcXfwA0PM+27vI0DXov8X0Xwk4EUUiMCun3oDpEFHlemz+nToPNJh2Afp7VAPyrZzb2+/GrE/+f9uGzgl0HLrEmSdXge8L0hiEm5Wp3CpOtkLW2YXOpTqTr6NcpUzKspQspF7V7QfA0nDUu22aM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713508736; c=relaxed/simple; bh=ELosVufvt3J8r8VoFCclmgHzRzoTIWsDwCk5v8O+W+c=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=ck/pyVObNFX9pPOkxK+7HVM1itsuGsQOYPkOPEhfNoBt1EizWzxM3GTEb1cNgClSxZHJAoL7VD+/SnNViYD0xVkJVPpBSVuZ6XAJ303wYgAtNVrBknwHhl0qXfpl87viXAJgFc3OK06byslaEPC/SIbgskDNh8MJrwGLK7MsSA0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=bZy9nPsb; arc=none smtp.client-ip=209.85.218.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a52582ecde4so151366966b.0 for ; Thu, 18 Apr 2024 23:38:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1713508733; x=1714113533; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=K2Mx24L3N0RW14qQUkoJvbTo91HHgAXzvzpRIQqaSQY=; b=bZy9nPsbyAcHA1xhIestMc6gaPCxk/uV59TJmeJz0ZmEy++KsWeFRBEJZDEBpp7JLr zDaEtunr1q8JXQ9boF8R1hiDe28rGamk7uvJ6jvPH4YLfnNbcEBz9QJXe7j+xJXt1WoW ER5cMp7lNhImD4ojv6Y8lLiIA5nofaRJj1Ns0Joc26vwE90grz6btyONUs/IxsFykp+W 8kqTSAqAfNuh553Acc93/cEHppnQiBout33qVrH8MmkOsXpv8ARiM1laI4eeyp2RjEn4 cQpMGL5ZnScAaYOdN9PViKKvtNT72u6MBfwTksVE+o0WrcyV6bLTvlko0SZTwx6oL84T iZeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713508733; x=1714113533; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=K2Mx24L3N0RW14qQUkoJvbTo91HHgAXzvzpRIQqaSQY=; b=bUVAoSbrjG1d7bvCO/40l4T1cpt/t/WKl8FSDg5uJBevE+PzODjbjsYkIcf0SgIePd Q234EYBnUqF/rAzLhpD9XVQi79LE4M8TFwbh77uuwFvWHKoK0FeiqHHo+loPSOje9Zh6 1BKjjy6UkdEzk2iNEHQbdPlN4d2DjhFYeRSrm7qQZu22a+GIYxY7qtab1cL3kQE35plt RIh6HgNysqdlrG5Vn2x6C9AA+wPZbFAtaLR/O+s3TN3n6kUhj7sNPXKKfcF89yAm1BH9 3QsrjZEOYFqqC8d5r51bqNnJKTZFB6JLrzoD7IYCzEu3cxqXJscafiX/d1y5npseGtSq hqXQ== X-Forwarded-Encrypted: i=1; AJvYcCX8igKXiSHVM0TKqavLYG1P4y5qL0GO7jkdpMyZK0s8mtgEzqOIdmdb9wO6114RBOgp8RQ3s+Hv1D/GZyEdq9hm7cuszT4+Bmj1ek3R X-Gm-Message-State: AOJu0YxN+kuX1DM8NEYTvnWcWH5LpW0/NrVEGNfDN2Fftlf+gKip8cdY 637vaN+pfF6beAnbskQmFX3CCC/wZjl7gzxz9ryI/ohRkk254CYvmfWQjpEGvVU= X-Received: by 2002:a17:907:7288:b0:a54:e183:6248 with SMTP id dt8-20020a170907728800b00a54e1836248mr941953ejc.0.1713508732584; Thu, 18 Apr 2024 23:38:52 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.185]) by smtp.gmail.com with ESMTPSA id m16-20020a1709061ed000b00a51c0c0cb86sm1797440ejj.22.2024.04.18.23.38.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 23:38:52 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: geert+renesas@glider.be, linus.walleij@linaro.org, biju.das.jz@bp.renesas.com, tglx@linutronix.de Cc: linux-renesas-soc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH v4] pinctrl: renesas: rzg2l: Configure the interrupt type on resume Date: Fri, 19 Apr 2024 09:38:22 +0300 Message-Id: <20240419063822.3467424-1-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Claudiu Beznea Commit dce0919c83c3 ("irqchip/renesas-rzg2l: Do not set TIEN and TINT source at the same time") removed the setup of TINT from rzg2l_irqc_irq_enable(). To address the spourious interrupt issue the setup of TINT has been moved in rzg2l_tint_set_edge() though rzg2l_disable_tint_and_set_tint_source(). With this, the interrupts are not properly re-configured after a suspend-to-RAM cycle. To address this issue and avoid spurious interrupts while resumming set the interrupt type before enabling it. Fixes: dce0919c83c3 ("irqchip/renesas-rzg2l: Do not set TIEN and TINT source at the same time") Signed-off-by: Claudiu Beznea --- Changes in v4: - moved dev_crit() out of critical section Changes in v3: - none; this patch was part of series at [1] and added in v3 of that series Changes in v2: - none [1] https://lore.kernel.org/all/20240320104230.446400-1-claudiu.beznea.uj@bp.renesas.com/ drivers/pinctrl/renesas/pinctrl-rzg2l.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c index 93916553bcc7..20425afc6b33 100644 --- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c +++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c @@ -2045,7 +2045,9 @@ static void rzg2l_gpio_irq_restore(struct rzg2l_pinctrl *pctrl) for (unsigned int i = 0; i < RZG2L_TINT_MAX_INTERRUPT; i++) { struct irq_data *data; + unsigned long flags; unsigned int virq; + int ret; if (!pctrl->hwirq[i]) continue; @@ -2063,17 +2065,18 @@ static void rzg2l_gpio_irq_restore(struct rzg2l_pinctrl *pctrl) continue; } - if (!irqd_irq_disabled(data)) { - unsigned long flags; - - /* - * This has to be atomically executed to protect against a concurrent - * interrupt. - */ - raw_spin_lock_irqsave(&pctrl->lock.rlock, flags); + /* + * This has to be atomically executed to protect against a concurrent + * interrupt. + */ + raw_spin_lock_irqsave(&pctrl->lock.rlock, flags); + ret = rzg2l_gpio_irq_set_type(data, irqd_get_trigger_type(data)); + if (!ret && !irqd_irq_disabled(data)) rzg2l_gpio_irq_enable(data); - raw_spin_unlock_irqrestore(&pctrl->lock.rlock, flags); - } + raw_spin_unlock_irqrestore(&pctrl->lock.rlock, flags); + + if (ret) + dev_crit(pctrl->dev, "Failed to set IRQ type for virq=%u\n", virq); } } -- 2.39.2