From patchwork Thu Feb 1 11:36:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 13540922 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2114.outbound.protection.outlook.com [40.107.247.114]) (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 9583D15CD6C; Thu, 1 Feb 2024 11:37:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.247.114 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706787457; cv=fail; b=sOkV9iK3KJRLtfd7Lc3WpCumS31yCx87wPo7l0uVPgKB4JfEQ9yxQvqyKW2V3Md/bacVo2J1mVsYzdSL810MJlIOcFvmFGOlf3qIfm77DCPjC4L3mtya+HTQUtYfoZ0zTuoJTK8GmLbcrSwe5b1D72Un6HJbbuoTz0GixycAGaU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706787457; c=relaxed/simple; bh=4TLzuUG+cD1ah0+jc3t9NcCQawuhHMyWz8z+IOJLiJo=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=tJP8UNsRG5m/VmG5pctzud9HjbYpA74WwunErLRbVYX7ys6vNiGmxl8EAolZ1GDGAi3mfci+75gQAz4aIzi/NGDOxJZzsBaKGABFMuCbUMirpFs7mu/uiSrV1N4Km67kNM025SuChEb6SCxgBUq48eiWBiIOwtEo1Wwg2n2FBl8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=kunbus.com; spf=pass smtp.mailfrom=kunbus.com; dkim=pass (1024-bit key) header.d=kunbus.com header.i=@kunbus.com header.b=LHkFL9FB; arc=fail smtp.client-ip=40.107.247.114 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=kunbus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kunbus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=kunbus.com header.i=@kunbus.com header.b="LHkFL9FB" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oV9xOpqPGyRtcZZvJdeJ6tMTTvWpjt4Y+8xJeLjFmhf80q9y5zHi9p/uCif6y1OXyNLNlLXLmwPqNi3775UrvU8VQWzELHEtATzRuT7iVo6bhsUL03MXMvtIDHxfvdFjtLfY0nE8+fWg2IX1HQHWBTNNS8yv17W3dc83fYEOlzY6XDJIVkY5r3ffr9N5hPM9bB+eF3dQw8rANVS7U6gOJeiA1fVcPbWHXa2D8B8Sp3R98wYfsO1+rgPpkFXeE749odqrmetFOZkLdgXfsyWVAVHJQ8DJM3FbK5hU6TYnHA9RkWdEiHLGkyN8bLhaH9sT/rNh4VR/jWl9gMYYfOtSaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4TLzuUG+cD1ah0+jc3t9NcCQawuhHMyWz8z+IOJLiJo=; b=TvLMCJ9b8EUHl2e+7ZwhRMGLnYA+NoJ9jo1TXe8jR6ygF5avijaDb09UYkoa1lEvC73ARw3bePv7+fZyKTO1y1+ihqsUtDEpKTqYf4sl9kTbe1qBAfHE1IX2Wa92lVX3H2Iw0neOKQsayCTXscCvBRkkaXbCC9g6uykWzB+6qK2ggnSbz8OZaUcyQJzSsbQX+ewI3QdakZq4S3CHRx8XJnksBcEkc1qVciD+Hv1qv0ulJVeSc0OSsZL3Nm+o9wVlf/l4leuKmk+iMhI+qxzu/H2MTOonEzQA2Kt9bBieEBi2vyLlqMYoK/M991RoqcMvUK/4JgzCEnYkSNIn0iulQg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=kunbus.com; dmarc=pass action=none header.from=kunbus.com; dkim=pass header.d=kunbus.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kunbus.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4TLzuUG+cD1ah0+jc3t9NcCQawuhHMyWz8z+IOJLiJo=; b=LHkFL9FB0fIrpBc1wp0fQlm/9qxMEzijiEvfViV7f3CCdvT5e2814WpYJYZDG3nS/XC3AG22nJ4hY05MOyCR/8KmPvy/vP3S3YovEDLTRSaRHbuV4AXxRGiU48LuKoVrPz+vubDXiw/dejQh15eIdDdwir9ovb+nxqWAP4iKO7M= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=kunbus.com; Received: from VI1P193MB0413.EURP193.PROD.OUTLOOK.COM (2603:10a6:803:4e::14) by AM8P193MB0804.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:1e2::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.26; Thu, 1 Feb 2024 11:37:28 +0000 Received: from VI1P193MB0413.EURP193.PROD.OUTLOOK.COM ([fe80::67b0:68bf:2582:19cb]) by VI1P193MB0413.EURP193.PROD.OUTLOOK.COM ([fe80::67b0:68bf:2582:19cb%7]) with mapi id 15.20.7228.029; Thu, 1 Feb 2024 11:37:28 +0000 From: Lino Sanfilippo To: jarkko@kernel.org, peterhuewe@gmx.de Cc: LinoSanfilippo@gmx.de, p.rosenberger@kunbus.com, lukas@wunner.de, jgg@ziepe.ca, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, Lino Sanfilippo , stable@vger.kernel.org Subject: [PATCH] tpm,tpm_tis: Avoid warning splat at shutdown Date: Thu, 1 Feb 2024 12:36:45 +0100 Message-ID: <20240201113646.31734-1-l.sanfilippo@kunbus.com> X-Mailer: git-send-email 2.43.0 X-ClientProxiedBy: FR5P281CA0011.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:f2::19) To VI1P193MB0413.EURP193.PROD.OUTLOOK.COM (2603:10a6:803:4e::14) Precedence: bulk X-Mailing-List: linux-integrity@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1P193MB0413:EE_|AM8P193MB0804:EE_ X-MS-Office365-Filtering-Correlation-Id: 5c7c2774-3134-4e84-a274-08dc231a2add X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0L2CdmkwvP3HSxC50oqgcme1DvJMXWfLdQNue7WGJ2T86oNC5s2Q5H3krHChgdEeYG/NlGbdZgp5BvvLaqTblFWDFGl4ai4mvKnxBoCnz249bnlzuyL3EoeFRdQv3dtrZNnRl4xVnDu8lGXAuOksFULezZFPcxUGoa7wdKkkMdgaViGkoyvJ8rzM5pI8iahjWoDVMCeH9x50tysygEVmBhLacVwCcsDMDEyThaWjNP/Z66Z29aXNwSnzJgvDZN8zmUOHJRwNZQrUKuOjPZ6i62XEiUPdDd6QgNRge8EN7Z7PndmzFUVNvtfkbRP7JZPzLO6Mq9XvEfLt2j0YrwqbrE2S9L5i6DzM3LokX6oWOyoKzA/YS7MhlzsCcsBR1kCakp6NkKP12pZZWudcXCIOo7biMNu2zxSetrET08SIoRuzjnFmL7tsp+oNILRqie5re/wn6q+BMNZQFpIK2xTHrrfXKiOZrbSKo8acdFuMUhmi0DEde6tY5nfmufEvWS9PRraVCqAMxQAZhlH75qaO4Wug/bkipJl/Hlw1blJfbt2TjeVyHoexyQvk0UipPJKETQVyN5u9Bcoq2UECk99b2afI9GKNtIT4PcoqhNRfE6hOk44bxhuWrdeIvlZx7Lf2 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1P193MB0413.EURP193.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230031)(136003)(396003)(366004)(39840400004)(376002)(346002)(230273577357003)(230922051799003)(230173577357003)(451199024)(64100799003)(186009)(1800799012)(478600001)(1076003)(6486002)(966005)(41300700001)(86362001)(52116002)(6666004)(6512007)(6506007)(38100700002)(2616005)(316002)(66946007)(66476007)(66556008)(8676002)(8936002)(4326008)(2906002)(36756003)(83380400001)(5660300002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: P3mMcsUJl8Z/r1fWnB3iv7riq/rYiCW/ob8aQQWYzL8mV+QpMuJ2Uvuye4VNGXkMtS01etlicLr9wUFfge0irzr7CBzcRkozfBp9f7QJSfp6dld88poTNvmmbFLLOeBvfwwfXo4RQEt4D1wnPkgtndnLwM126pPdFm5It8euKVh8mwr6BL9hFBpbTg3rrCpz/KYLWfhBwLGxHNhvwZ7N7/EdPOuBchClZV4ZjNthqcYXufZxr9fD/3fzAhz64sEk/HCynZ7MNRyf7A9GdVjSE7s8Tu50CX7zXzSMLKnVLHzEh2xybVDl1NlQnYmbHD4HaC5DazsRWdKMoCIalVJJ3JX3WL0bidHibcYnTymZrwuHNhER4EdwmJVc2gFHRu1R5Htn19h5l30FRpU+pXM4ggYEqu5e/WVp5CyyxLZzyRNmv/BoUoglQu6Z/RW9c40kjhAFcpV0mkxEM0bEgJfcxl5BiGW/MbEGZN1HRalHdaaZUXe3O13k537IbV1Ni2bp7S/qJ8Xf9T4j0pf1x+4fvH4QxELIh5sJNd82lseGegpe0FtqO8w57Npf2QwHtSlPX1a9M/5RV2HnNdzwg98x2UkWfI+eubBA3wecpLt5YXetx6ZxrGQ/6jC5KY+/n26UsntwusTghWB/IIQ4l/ZGW9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-3134-4e84-a274-08dc231a2add X-MS-Exchange-CrossTenant-AuthSource: VI1P193MB0413.EURP193.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2024 11:37:27.7172 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: aaa4d814-e659-4b0a-9698-1c671f11520b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hSvuP6o7mbP9rDAZjVqn24aPHLTavy2UitQUuTi6AWKlvmPE/L22T+h6AwEkEarcfqmxoEG8FCiBgG0fYD5PRQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8P193MB0804 If interrupts are not activated the work struct 'free_irq_work' is not initialized. This results in a warning splat at module shutdown. Fix this by always initializing the work regardless of whether interrupts are activated or not. cc: stable@vger.kernel.org Fixes: 481c2d14627d ("tpm,tpm_tis: Disable interrupts after 1000 unhandled IRQs") Reported-by: Jarkko Sakkinen Closes: https://lore.kernel.org/all/CX32RFOMJUQ0.3R4YCL9MDCB96@kernel.org/ Signed-off-by: Lino Sanfilippo Reviewed-by: Jarkko Sakkinen Tested-by: Paul Menzel --- drivers/char/tpm/tpm_tis_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) base-commit: 41bccc98fb7931d63d03f326a746ac4d429c1dd3 diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c index 1b350412d8a6..64c875657687 100644 --- a/drivers/char/tpm/tpm_tis_core.c +++ b/drivers/char/tpm/tpm_tis_core.c @@ -919,8 +919,6 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask, int rc; u32 int_status; - INIT_WORK(&priv->free_irq_work, tpm_tis_free_irq_func); - rc = devm_request_threaded_irq(chip->dev.parent, irq, NULL, tis_int_handler, IRQF_ONESHOT | flags, dev_name(&chip->dev), chip); @@ -1132,6 +1130,7 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq, priv->phy_ops = phy_ops; priv->locality_count = 0; mutex_init(&priv->locality_count_mutex); + INIT_WORK(&priv->free_irq_work, tpm_tis_free_irq_func); dev_set_drvdata(&chip->dev, priv);