From patchwork Tue Mar 12 06:59:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yeo Reum Yun X-Patchwork-Id: 13589566 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 91B59C54E58 for ; Tue, 12 Mar 2024 06:59:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=UTYKjWXdhq5CCKyVB58oYIVAhuIvQmIkrCjgq/AkGCo=; b=ZbRsCAdSydmw0l BfOtHeBYHvSgbFqTezE0gJ4qOHKh7DDgzKe6tmGA1hJulL2zPvuMuIdCoTFM8yq5zzC9X6Ft0APyL bvb6oUrKotZW5m+hYBSUI4+aeXTlHKRPVNAojOjmSQfwwi0+TvxYPSIJznJNG1tRGbHokJV5TGaNt 6P18Ji/dLZnFDDqp82k4z4muJil7nLCCmt+Khyrb68IvQWxOObEPoZ6BUw0xwy+npM+HWvylnreOs gDzE2ItS4DJ7J4Ix+Xleesfxtj0dgvdBHBpdvdv8j8gxCiybCN3d+eiTYi8Ou9kR4mLhgtol9H6md eCiAd3CnlyGsIDlJE+zQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rjw6g-00000004enf-3q6b; Tue, 12 Mar 2024 06:59:26 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rjw6d-00000004elw-1rCp for linux-arm-kernel@lists.infradead.org; Tue, 12 Mar 2024 06:59:25 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3ED251007; Mon, 11 Mar 2024 23:59:54 -0700 (PDT) Received: from e129823.cambridge.arm.com (e129823.arm.com [10.1.197.6]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id E63B83F762; Mon, 11 Mar 2024 23:59:15 -0700 (PDT) From: "levi.yun" To: james.morse@arm.com, will@kernel.org, pierre.gondois@arm.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, nd@arm.com, "levi.yun" Subject: [PATCH RESEND] firmware/arm_sdei: Fix invalid argument to unregister private events. Date: Tue, 12 Mar 2024 06:59:08 +0000 Message-Id: <20240312065908.12194-1-yeoreum.yun@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240311_235923_691117_B1B3846A X-CRM114-Status: UNSURE ( 9.89 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org To unregister private events in device freeze, it should call cpuhp_remove_state() with sedi_hp_state not sdei_entry_point. otherwise, it seems to fail on cpuhp_cb_check(). Fixes: d2c48b2387eb ("firmware: arm_sdei: Fix sleep from invalid context BUG") Signed-off-by: levi.yun Reviewed-by: James Morse --- drivers/firmware/arm_sdei.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- LEVI:{C3F47F37-75D8-414A-A8BA-3980EC8A46D7} diff --git a/drivers/firmware/arm_sdei.c b/drivers/firmware/arm_sdei.c index 285fe7ad490d..973972d50287 100644 --- a/drivers/firmware/arm_sdei.c +++ b/drivers/firmware/arm_sdei.c @@ -763,7 +763,9 @@ static int sdei_device_freeze(struct device *dev) int err; /* unregister private events */ - cpuhp_remove_state(sdei_entry_point); + cpuhp_remove_state(sdei_hp_state); + + sdei_hp_state = 0; err = sdei_unregister_shared(); if (err)