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=1796386994; b=RmYQ+istZI0+GHnXndN2crj0sZbuYme+AH33Dr0yBIOPf0O8MDbv1dONwrpZifcyStfk giIXBlGV3bdnPlDoBSjJMYuAGRxTUstyUEylmreWkAbKwcEtXplyWzcB1ZcZR3NfeJ0sq eh5hSYD6GlZo47xxRGIx4yi5Gr1o9J0Zy7Lm9PEfkntI+kaOBYUl+NZbzyUZrt+fiNrQx E8dXxWN1neoqyPlfGusNY/wHQeLEqsLDTBfXfANQAS/br5Nh8my3tNKc+Z8UJiVUEnczG 3omdNUTYOnSzCYE5QQOOh3bsJDz8Bf+UbU4ENTmFFOWPT37FySb5eS8S5g43Y8Rtinw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796386994; 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=ypTEcARk2D3CtUTqNSro3D1db6t5Qy6C53IkQArTqpI=; b=bD31/1o3eyw7+ZgMGNrmke4vcBx42FHO+Ok/ZSvwJq7Jei9IpZ7SmgVYoqaWSODf8p7e 0KLA8pehIJzOAIr41DK8OGQ7R9TP9/huRxHhVfPPF5ji1bwrb0nn3N+AZCbZ9echPb49a oin1AGYlDkOmNSRwTfcHrgbr+5YcI73K0a7OCKM27xXS9R8IvMpALyCTQn8cf38EiJZxL 3yt96xNn9ISEc+fFc4l+ZNAoT+DcwbyE1kV/C/+aAAsBnuTNxkpGnQLJDb7hC1mR/0kQ8 4pM0waDfyP2OlYlsSaQ37iGzPp+GjoO9Qtlh5xwcT+1zBamfdM+axpGLqxoaWnf2F3A== 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=hZwTHuqT; 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 3B8CF606A322; Fri, 4 Dec 2026 12:23:14 +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=hZwTHuqT Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD9191F000CE; Fri, 4 Dec 2026 12:23:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796386994; bh=ypTEcARk2D3CtUTqNSro3D1db6t5Qy6C53IkQArTqpI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hZwTHuqTRc7bV1hb+KUf8lL6J8Yo8KYjPZYiBHHvmx0KxWpWp1BkPfWdc79TZUt/M HVjImzLRGiYQL3rNwyF0AaT5R0FUli603rx6/k+Tatt0JLCQSX9SX4AFv81JGVwUkm NmzuRWFbamCCluKtxZwPzjk9AOC62J+Lpr0PvqFw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tobias Wilken , Luiz Augusto von Dentz , Sasha Levin Subject: [PATCH 6.1 0088/1059] Bluetooth: MGMT: Return RFKILLED for Set Powered on a blocked controller Date: Fri, 4 Dec 2026 18:53:39 +0900 Message-ID: <20261204100646.393680612@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: stable@vger.kernel.org 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. ------------------ From: Tobias Wilken [ Upstream commit 7eac80614300563470cffabf4df2b63616787ee7 ] Since MGMT_OP_SET_POWERED runs through hci_cmd_sync, powering on a controller that is blocked by rfkill fails with -ERFKILL from hci_dev_open_sync(), and mgmt_set_powered_complete() reports it with mgmt_status(err). mgmt_errno_status() has no case for -ERFKILL, so userspace gets MGMT_STATUS_FAILED instead of MGMT_STATUS_RFKILLED. Before that conversion, power on went through hci_power_on(), whose error path mgmt_set_powered_failed() still maps -ERFKILL to MGMT_STATUS_RFKILLED. bluetoothd relies on that status: for RFKILLED it sets the adapter PowerState to "off-blocked" and returns org.bluez.Error.Blocked for the Powered property, for any other status it returns org.bluez.Error.Failed. With the controller soft blocked, "bluetoothctl power on" printed "Failed to set power on: org.bluez.Error.Failed" and btmon showed "Set Powered (0x0005) Status: Failed (0x03)". With this change it prints org.bluez.Error.Blocked and btmon shows "Status: RFKilled (0x12)". Map -ERFKILL to MGMT_STATUS_RFKILLED in mgmt_errno_status(). Fixes: cf75ad8b41d2 ("Bluetooth: hci_sync: Convert MGMT_SET_POWERED") Assisted-by: LLM Signed-off-by: Tobias Wilken Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin --- net/bluetooth/mgmt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index e4f78685fb6d1..8bc08445b57ce 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -306,6 +306,8 @@ static u8 mgmt_errno_status(int err) return MGMT_STATUS_DISCONNECTED; case -ECANCELED: return MGMT_STATUS_CANCELLED; + case -ERFKILL: + return MGMT_STATUS_RFKILLED; } return MGMT_STATUS_FAILED; -- 2.53.0