From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 F0B7B3161A1; Sat, 12 Sep 2026 13:52:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789221169; cv=none; b=crgXvin7Xz39A/y0zKM0q83p8pA+AXfQ4preGjTJJspPHtjxZfGG+zs8Al303JkpQrddAW6eQ5g8O8ZnpDJDBo3QM5h5PIodBYxJhekIP4pvQ2IWWiIqE4/nyg841HmNV6/q11JXkj2dHSz3T3tJh/xo08oovp37gTCpR1Hv1gY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789221169; c=relaxed/simple; bh=wi9jRzG0vuKmAKEAHDBfGoOWGGHoTWYi5DYlZ4KnLR0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ig1N1DwpAnOb8eN6kw6d4kAwRNwQYCCcu0SMN66JibXm7aJwRn1lK1iEeeBJYhlz1jVMM+czSW/xSdpaJKudqq7DflJlj+769MUq9x+PfFD3+nKPf47oaQeSmO8AnYtBYzm8wmPRlIFOVoXy+FB9zF3hztpVOmk/YPeSsFq3VUI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=AXRBneJX; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="AXRBneJX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2A1D1F000FF; Sat, 12 Sep 2026 13:52:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789221167; bh=mgZwuK+ejY4ab6zb9mc8KCkE6RYdxZfm7JoKpw5+TPU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=AXRBneJX6xZ7bx5Td5qJKAG4+fIRPmARTN8jRsssmac/3J6w9jzweDBSt32UoMgqG 2h2wCI5FxHvdIE/OJIfXJPszJUn5d+RxPQtqwhFKH1fx/j1Wae8F9IG8OkhYU1sMR5 96tDwGzmByENykyNoZ2Tco/FJ+dbDuBzocwA9Vt0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ijae Kim , Myeonghun Pak , Jarkko Sakkinen Subject: [PATCH 6.6 0301/1424] tpm: tpm_i2c_nuvoton: disable IRQ on wait timeout Date: Sat, 12 Sep 2026 08:45:33 +0200 Message-ID: <20260912065614.026517808@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.279695368@linuxfoundation.org> References: <20260912065607.279695368@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Myeonghun Pak commit 705c4ed0643366963547b2616d53165f2519c81f upstream. i2c_nuvoton_wait_for_stat() enables the IRQ before waiting for the interrupt handler to report a status change. If the wait times out, or is interrupted before the handler runs, the function returns without balancing the enable_irq() call. Disable the IRQ before leaving the failed wait path. Also preserve an interrupted wait's original error code instead of converting it to -ETIMEDOUT inside the helper. Cc: stable@vger.kernel.org # v5.10+ Fixes: 4c336e4b1556 ("tpm: Add support for the Nuvoton NPCT501 I2C TPM") Co-developed-by: Ijae Kim Signed-off-by: Ijae Kim Signed-off-by: Myeonghun Pak Reviewed-by: Jarkko Sakkinen Link: https://lore.kernel.org/r/20260626091653.54929-1-mhun512@gmail.com Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman --- drivers/char/tpm/tpm_i2c_nuvoton.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/char/tpm/tpm_i2c_nuvoton.c +++ b/drivers/char/tpm/tpm_i2c_nuvoton.c @@ -181,8 +181,10 @@ static int i2c_nuvoton_wait_for_stat(str timeout); if (rc > 0) return 0; - /* At this point we know that the SINT pin is asserted, so we - * do not need to do i2c_nuvoton_check_status */ + + disable_irq(priv->irq); + if (rc < 0) + return rc; } else { unsigned long ten_msec, stop; bool status_valid;