Received: by 2002:a05:7412:8d11:b0:fa:4934:9f with SMTP id bj17csp668153rdb; Mon, 15 Jan 2024 09:31:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IFtnHIUsJz6KWxse43p1Z+wLbAOrh07VddaJm8wZ9KJ9FW35uD9nW4EXzz4MXc5J5LTv65z X-Received: by 2002:a17:907:708:b0:a2b:42a:8e6 with SMTP id xb8-20020a170907070800b00a2b042a08e6mr7160942ejb.21.1705339906989; Mon, 15 Jan 2024 09:31:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705339906; cv=none; d=google.com; s=arc-20160816; b=D+x1FlGVCLi/TRvMcsTgDeAOmOH6iLoOxVMShPRiKQXSJT3UpfYGuFAwa/Yf8FNAvn 4Dw5K8eQdedKRBvqGjCHHR9i/A3NWj8ylYyys9Sk/foVwUS0KMmGaWMHzwKU8xoW60hB UtVm3hJb470V8lIlZsDZA+FSx2dUXnnec+re1olrYdoLNDAheWUk8LpZfZAtVK6Y+Iui VzxzfO7mmfPHA8Jot8hE6e/48a3+3oLHnQBW5MSeC+tmU1z6r87Nv8W+m9UftgDVnYqk rwXklXe24M1rv7Ker2AVX6PwO3trW3ULf3tT3zOLD/dsiUrNcdIPN1yBnF4Sl+5apPVn t3yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=JSQPHFV3GahZirYczjpX+yosk3f5jS7vLkBAlxLnwDU=; fh=3/iXxNo751qwD4Le/DZV6D5XdjEwUNOlCMB7mBTKPyQ=; b=iwIRP3hodIkCel3KbaLL7ACh9B3IH7aM2+x+nlEnDx3bPpKgm4kTUZF5p59/g/KtLv LgotzL0zvndFTmhjjQ/NPkmP5SiQ/KMxzza9aIzMhzmhuwoFTjfkoXYSFJhCO9nu0GxT eDX5RSLqB1KuIpqATssrLy8iliwiK8AkM8+2zY7XG3QeM8HsAnGk3IWBJvnTWGYntC++ gawx8uL7ixwbt+R2/NDohSfxDErJ7nLl1PvKtgnYV5Dc2V3dh9Exd2WCzo9xOpxxDaqz bMP+oYsCZI43TxJh/i3SCKOLAXhQ82ZKpwSR+dYswxgJD0lrclbMCrs0UsNx46e1MH4X zg8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-26318-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26318-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id lt3-20020a170906fa8300b00a23539f10e9si3972191ejb.356.2024.01.15.09.31.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 09:31:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26318-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-26318-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26318-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5A2DD1F23B9D for ; Mon, 15 Jan 2024 17:25:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 52F6B182B6; Mon, 15 Jan 2024 17:25:03 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0E39A182A1 for ; Mon, 15 Jan 2024 17:25:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 F2F412F4; Mon, 15 Jan 2024 09:25:46 -0800 (PST) Received: from [10.1.197.60] (eglon.cambridge.arm.com [10.1.197.60]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CE50F3F5A1; Mon, 15 Jan 2024 09:24:59 -0800 (PST) Message-ID: <29a13c04-f669-a6c3-4693-af7e44469ad2@arm.com> Date: Mon, 15 Jan 2024 17:24:58 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH] firmware/arm_sdei: Fix invalid argument to unregister private events. Content-Language: en-GB To: Pierre Gondois , Levi Yun Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20240110090107.26323-1-ppbuk5246@gmail.com> <21e77238-4884-40ca-bc01-b7e4774b9239@arm.com> From: James Morse In-Reply-To: <21e77238-4884-40ca-bc01-b7e4774b9239@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi Levi, Pierre, On 15/01/2024 13:01, Pierre Gondois wrote: > On 1/10/24 10:01, Levi Yun wrote: >> To unregister private events in device freeze, it should call >> cpuhp_remove_state with sdei_hp_state not sdei_entry_point. >> otherwise, it seems to fail on cpuhp_cb_check. Oops. Well caught! > I think you can also add: > Fixes: d2c48b2387eb ("firmware: arm_sdei: Fix sleep from invalid context BUG") >> diff --git a/drivers/firmware/arm_sdei.c b/drivers/firmware/arm_sdei.c >> index 285fe7ad490d..3e8051fe8296 100644 >> --- a/drivers/firmware/arm_sdei.c >> +++ b/drivers/firmware/arm_sdei.c >> @@ -763,7 +763,7 @@ 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); > > Maybe it would also be worth resetting 'sdei_hp_state': >   sdei_hp_state = 0; The next call should always be 'thaw', which doesn't check this, but it's good to cleanup stale values. Regardless: Reviewed-by: James Morse Thanks, James