From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796387058; b=bdbgq75KhxUYptErlSt7t6k6cB54Y7HMa4BwQUJ37edVV/nSTNAW+3f3dOTmZBhUJc+O eHEnyEuEMFUNX+f6270BeC18rr9+5pULRAYbCudS+avK26Bv90cM0n7A9fTbvDwhnlAKc B+LED/Ey9pYCzujDcy43zkbvYEUmgmKOXyCOT/Wn8d2HXEBhMPQpQmw4mikB2UoKh9zQP fbvMYjTh0oO3bXsaQZWkJBv5ii2fGIwRqp1FpI/rin/kl4IKWtUporkoCwsSmZEFyvo4B nnhfOQdVx7DggvpAJn+UJ22Mm/4vd1FT3KpCG0nw6VGX8EZz1eiwefk+hYmLCaP3UNg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796387058; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=7pF1swL/FNgNtIr3qLY/FlMQ8MfQjSnNM49pSvfGze0=; b=IDOICbU8lPwOeGNOO0FiZWweKH1cWs2Jq8Xg/VxxSa5Bxywoobrte2ytS5FxoKvyuM65 yXNLTfJmziOuAlOIu7LqV82hjL0j9kV4zjaDtMiHeMZR4JNX7ugpKTKNJdPaywG2Ny0ju /v8qjqlVamAVqZs6o/BOrSi00jV/FzGlRQZ4ef/ooaZu9Qmo/wBvBInYhfRwtQzB3JA/J q2xsg3AzZMoo7oOkKvTMu5aOR2Z0UKTY9L73EMQpZYC6JdL3qWZiRqvc+JyXIcYxZEzXv g84cRV0mWv+3zz70sXU20OZWwIBFXzbPEB3NRuDQGQvFT98RrXCXAcN/bSPNt+5XR3A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=B4KmyiAM; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF8E5606A322; Fri, 4 Dec 2026 12:24:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=B4KmyiAM Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28B9E1F000C2; Fri, 4 Dec 2026 12:24:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796387058; bh=7pF1swL/FNgNtIr3qLY/FlMQ8MfQjSnNM49pSvfGze0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=B4KmyiAMDe6Ehp+i2TIVlml1eGQsO2OLEly4dsVJlr0lnn8Ms0tzzuCsGVeYh7Dwz BxRpvcIZvY5/5xqejz8dEhHfzgxlaiyplmntiL5cqE61sOdS2X8Wj3UfUzy5kTkW5d ehtx6cYgWtvwDuhY5gkFJ1WntaYWw3LbDFle1aV0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Rafael J. Wysocki" , Sasha Levin , "Rafael J. Wysocki" Subject: [PATCH 6.1 0117/1059] ACPI: scan: Print the offline failure message in acpi_bus_offline() Date: Fri, 4 Dec 2026 18:54:08 +0900 Message-ID: <20261204100647.250184186@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit b9ea1e921c2721546f53270cffdc6866e20576dd ] When a physical node of an ACPI device being hot-removed cannot be offlined, acpi_bus_offline() passes the physical device back to acpi_scan_try_to_offline() through ret_p and the latter prints "Offline failed." for it after the namespace walk. By then physical_node_lock is not held anymore, so the device may have been unbound from its ACPI companion and freed in the meantime. Print the message in acpi_bus_offline() when device_offline() fails in the second pass, while physical_node_lock keeps the device bound to its ACPI companion and so the reference taken by acpi_bind_one() is still held. acpi_scan_try_to_offline() only needs to know that something could not be offlined, so pass the ACPI device back through ret_p instead, like in the "Offline disabled." case. Fixes: 303bfdb1a14d ("ACPI / scan: Add second pass of companion offlining to hot-remove code") Suggested-by: Rafael J. Wysocki Signed-off-by: Sasha Levin Link: https://patch.msgid.link/20261029034507.2721580-2-sashal@kernel.org Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/scan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 14d1ded63f075..ad02525445d4a 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -165,8 +165,9 @@ static acpi_status acpi_bus_offline(acpi_handle handle, u32 lvl, void *data, if (ret >= 0) { pn->put_online = !ret; } else { - *ret_p = pn->dev; + *ret_p = &device->dev; if (second_pass) { + dev_warn(pn->dev, "Offline failed.\n"); status = AE_ERROR; break; } @@ -235,7 +236,6 @@ static int acpi_scan_try_to_offline(struct acpi_device *device) (void **)&errdev); if (errdev) { - dev_warn(errdev, "Offline failed.\n"); acpi_bus_online(handle, 0, NULL, NULL); acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX, acpi_bus_online, -- 2.53.0