Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1211807lqh; Sun, 5 May 2024 23:43:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXQSGNpTIAj8MSwWIyn9gwr9aadbz79xAdHDWVYkL7ag0mZOdFMTvF7xTJZar9OG25U9GFk7bA2YP0zDdnLpBhsaU73ffsL9fICk6xgZA== X-Google-Smtp-Source: AGHT+IHCf87Ya/MtvACHxNKt7hWZuCY4v61NZHvAhv9UlV/sQUzrCt1CY6OBSqKEzXw4+g5ZahcM X-Received: by 2002:a54:400b:0:b0:3c9:68c4:d69 with SMTP id x11-20020a54400b000000b003c968c40d69mr3991780oie.34.1714977823351; Sun, 05 May 2024 23:43:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714977823; cv=pass; d=google.com; s=arc-20160816; b=gfxGBTF+g3Az9WDlmyqTDbW5NPYV2AMDx8WiSql+Vqp2UVBkYGf5P14ZnP/kdFEfqU v9NlYkdZOeeQC9U+KNuUHi6vZcwNeyvkdAIK8cycxfYFmJHDXsCYb2hzD61caybJ+WuF QGI/cSojEUXViFLcGEafOvXlu579bOSIxOwJf1fnMrklOkjqbsYxMiarMq+LRmJD4mVF 0fD+NN/iu2yH2oSVvhhKs3fzWRFrStpfVVhgfV+S5AVlzhUTWwCyU4itl5zU2ldDQdtD 80w8w00HZe+SxrYlKNyXqPXlsbQmuYK/Fk3QL+bsCxKHPDJRqybyZoa50tCNln5KYLkz 6H3A== 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=alx1vGLK4Nn7gqqZZSreCoEN1bAw1gLW3wJCKjtuMCQ=; fh=V55VoM6Gj3Jp+IPuJW7wTqi3OIP0wFrpj+lnfDbmNWE=; b=pea//3RrHIa5m0VHMTDLhJlfZpyPHWKm1FzPtlmtLfHosaIvb5dAsiMf+tJqb9nowG 4YVkLrg0B7fbUZ/G3MqmaaB1mL0UTKQvsplV/ghYcLxDprE97WhX7gAZAAd9+hwHlPgc lfv4TZvngmn/RKf2wmPoQMa9mF/vtvaUSAPi5wfjo+hLBCiAB3uwnQe/TaIhwBPqlXaP q6kXgM9BxUJdNDQhB4UQbiqj6AElR3QG7EGzFir3FHYDh6pCKSUgYL3+UPD70Ji5gKgl Wsr13snlY6Si4q6WfQXGI5yAayBgWSXcKfcnAz3ayRcrOnXdSn80SAY4lqqIWJ10PS4i IhEw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=KSZfBus7; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-169370-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169370-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id w18-20020a639352000000b0061a6efa2c93si7176394pgm.74.2024.05.05.23.43.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 May 2024 23:43:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-169370-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; dkim=pass header.i=@gmail.com header.s=20230601 header.b=KSZfBus7; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-169370-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169370-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 096B4B20E73 for ; Mon, 6 May 2024 06:43:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 65CD14DA06; Mon, 6 May 2024 06:43:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KSZfBus7" Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) (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 473F53BBE8; Mon, 6 May 2024 06:43:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714977811; cv=none; b=ow2AZfyxBSYPAsufgxAgrymeLU1ASH4uGauRNxxbg314zxh4zkcgGHWmRIfMQdHv40Oh+U8bVKpLHVY++vRKkEYBMQh5ILPkoR8dse1ieAt3SQFarK0ZGkZjS6CV3WmmeAAlyfKO5f3EwvLNmDGuKhDggwkkL0VGGiUt1lgAVSQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714977811; c=relaxed/simple; bh=cHcYODpyX5cPBwr6W7tusxLoH0Z9u7FCNY5rMLy27es=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=UBY17/+y9qEGlaPdpqDRTG2kI3SyevHMtW3DjopWHK6V08h4oKR/op21BA0cvpnORXgicbKrZr/pm2g8GZA2LBUqKj7DoJkSXQjZdwdsiJMKgEOn1zW6KGa0C3Anz/73IpQIvesooYcBkIL4hicISt3ov5h9S0F0wnlwCyI4EEU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KSZfBus7; arc=none smtp.client-ip=209.85.215.171 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-pg1-f171.google.com with SMTP id 41be03b00d2f7-5f415fd71f8so1226495a12.3; Sun, 05 May 2024 23:43:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714977809; x=1715582609; 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=alx1vGLK4Nn7gqqZZSreCoEN1bAw1gLW3wJCKjtuMCQ=; b=KSZfBus7XPksTXXx9knZfHIbU/lEmRdbShJ2hs4swFqNv2VNmRKmZ1PYSADfQH7VBI IzzE0Fw67ZDtD3IDw5qpWV5YTXA9L7DlY+lrS0G6NYAvexJKf81H8DOujHBx7NkNRHk3 B03q/NakBrTaLbu2WBPdqNLfyeVoDr/KPyeO/SJBQqBcuC3XlhRpWvcd15/cq4SR99wc hbb/8ILOV+Gtj9tsL7p4LRwakcmz7uYkwf9JobxAlawlbnhqXLcjfWhxT2x8DdZqqrho 3qNNvDg50rCIH6KeyXbSdGPmGln2nY0fllBpcvwIXzUZllldXrM0YPBgUYRuU29S3UDP HhKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714977809; x=1715582609; 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=alx1vGLK4Nn7gqqZZSreCoEN1bAw1gLW3wJCKjtuMCQ=; b=YPcw31KJNOVl5jcIbVIUDAFPTOezYsmJJU7ba6f3dGBVYrgAmwq1Ebwdeq6Xr6/Qk6 x0ro18l05ilNHlX1trrBNKGdRbXg1lehISlm8DrUS5W1Uwk77SjpuNLjEL8r/3Dr+5gU AyLYJ0fLGPshw7kLngy2gJri7PQKue/irTFzihriXz0fj7rUDf3wTDWRbVCX4s5jm76P mMLI8rEdzBPeuLhDhNAagsWEA9MdC4NWfqf1byT7C42iXDXm1ZICJ87MTOZYa0nv1wwJ SjaDp40XBsXkuDcrNEO+Dma+/L2quCPuOL6ZZnrLU3YNzUiYuey0OgdkVyouqenURGQf O4hg== X-Forwarded-Encrypted: i=1; AJvYcCV09ALB/G55SGsxmte+4NAuhrER7TEqMpARZYFFAmiWEn0VffeU+M5NFL//uUuRkOLJ60RsEXmG0yakcyTIluek9iRXu9NgP4tcjDW6 X-Gm-Message-State: AOJu0YyJnmotzsmF6vGaCiL8wWw8VkgDBlfPkQI5gViIEBJeiZepkmBt lcx6VVWwNK+p1rfToq6ET2pW0Gmh8u4+9y2W3mtaaOV0bgggVPuH X-Received: by 2002:a17:90a:c697:b0:2b2:d086:6f84 with SMTP id n23-20020a17090ac69700b002b2d0866f84mr7584028pjt.7.1714977809393; Sun, 05 May 2024 23:43:29 -0700 (PDT) Received: from localhost.localdomain ([180.217.157.40]) by smtp.gmail.com with ESMTPSA id r8-20020a17090a2e8800b002a2a3aebb38sm7322415pjd.48.2024.05.05.23.43.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 May 2024 23:43:28 -0700 (PDT) From: Jim Liu X-Google-Original-From: Jim Liu To: JJLIU0@nuvoton.com, KWLIU@nuvoton.com, linus.walleij@linaro.org, brgl@bgdev.pl, dan.carpenter@linaro.org, jim.t90615@gmail.com, elfring@users.sourceforge.net Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org Subject: [PATCH v4] gpio: nuvoton: Fix sgpio irq handle error Date: Mon, 6 May 2024 14:42:44 +0800 Message-Id: <20240506064244.1645922-1-JJLIU0@nuvoton.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The generic_handle_domain_irq() function calls irq_resolve_mapping(). Thus delete a duplicative irq_find_mapping() call so that a stack trace and an RCU stall will be avoided. Fixes: c4f8457d17ce ("gpio: nuvoton: Add Nuvoton NPCM sgpio driver") Signed-off-by: Jim Liu Reviewed-by: Linus Walleij Reviewed-by: Dan Carpenter --- Changes for v4: - modify commit description Changes for v3: - remove unused variable Changes for v2: - add more description --- drivers/gpio/gpio-npcm-sgpio.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/gpio/gpio-npcm-sgpio.c b/drivers/gpio/gpio-npcm-sgpio.c index d31788b43abc..260570614543 100644 --- a/drivers/gpio/gpio-npcm-sgpio.c +++ b/drivers/gpio/gpio-npcm-sgpio.c @@ -434,7 +434,7 @@ static void npcm_sgpio_irq_handler(struct irq_desc *desc) struct gpio_chip *gc = irq_desc_get_handler_data(desc); struct irq_chip *ic = irq_desc_get_chip(desc); struct npcm_sgpio *gpio = gpiochip_get_data(gc); - unsigned int i, j, girq; + unsigned int i, j; unsigned long reg; chained_irq_enter(ic, desc); @@ -443,11 +443,9 @@ static void npcm_sgpio_irq_handler(struct irq_desc *desc) const struct npcm_sgpio_bank *bank = &npcm_sgpio_banks[i]; reg = ioread8(bank_reg(gpio, bank, EVENT_STS)); - for_each_set_bit(j, ®, 8) { - girq = irq_find_mapping(gc->irq.domain, - i * 8 + gpio->nout_sgpio + j); - generic_handle_domain_irq(gc->irq.domain, girq); - } + for_each_set_bit(j, ®, 8) + generic_handle_domain_irq(gc->irq.domain, + i * 8 + gpio->nout_sgpio + j); } chained_irq_exit(ic, desc); -- 2.34.1