From patchwork Wed Oct 19 08:27:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5579 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp352762wrs; Wed, 19 Oct 2022 07:17:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4BLhLS6FYLeOCnmT8Gra+nu+pje+uovxgHJof9AcK8fwUKSN3bj5XowK2+4EENKCBZ5/uO X-Received: by 2002:a17:906:cc0f:b0:78e:1208:8796 with SMTP id ml15-20020a170906cc0f00b0078e12088796mr6881028ejb.601.1666189046623; Wed, 19 Oct 2022 07:17:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666189046; cv=none; d=google.com; s=arc-20160816; b=emuFU16nEUMKfKBS7FeYreAeAFAxJvqxKVphhHxUJvTvGYiGZufujYbMcVZ0a3rUOf AeAqq10Nf6ssR9/2P+oarziK/XWfeXdyrtd/EDwZYg6+fsJfTcWdrpi7eFWKDjsVJWrk vSRXuYXSZ3RkfScj+n8fI7vgI3dSmzBtChZ6IDI37oi3L/bKh8hlrfuVeVx9s5fhwfKO 2+zfOkiTmWzf8t0CTM5Uqa4rm3RPODdUbTU9CjfgjSck4tZdD9GeYxn4VyXtL4g5n01C MO9PZqjMJPR9/cQO4B8b1vRseaogljTjFulNlnaatkxbmOj7xdQ1sU57PbLeX9lU2Emb TflQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tBtdbcsK+t0wOohTUHzEQT96sqhjLsrcaEN0zRpbzn8=; b=BvKXMZueXRS3/baTV8bRBU3fJHVWiLTQGnPUWOXsvdbw1vkruxrpow+R7TNRyjM+hB dNNfGAVIh3OFG4WCDKvJtLGJptm2AeWcnYpTlh0qDv7EjadOw0l/kADqx0cSZQ3G3IF7 ZONsJgP+WANZUwlQENlgNLFlcsVcrm21d8x++Fhg9NYOEKeshqvOx6NNI+rT2SiYw7wr kjjWNUrZiOTtOYWhM6oNn4BZHYX3idy9I6mnO6LcyYpcuG0RDyCBHHrSwgFjEfzSo7PM RJ1mxgt8kQfbhlBQQj01hrsEPLSBCDyqPAGOHe9zYDFXND6zgrR2Ve+7vu7GgqU+K8dU nYIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RsdyRXQF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw20-20020a1709066a1400b0078dad5e8d65si13035327ejc.68.2022.10.19.07.16.53; Wed, 19 Oct 2022 07:17:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RsdyRXQF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232323AbiJSOGy (ORCPT + 99 others); Wed, 19 Oct 2022 10:06:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232353AbiJSOGd (ORCPT ); Wed, 19 Oct 2022 10:06:33 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E31D172B64; Wed, 19 Oct 2022 06:48:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A6A8BB823AC; Wed, 19 Oct 2022 08:53:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D3DCC433D6; Wed, 19 Oct 2022 08:53:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169595; bh=0KkmT5SgT36Ll04Lwr9o7RYoOWeWFnvdMbc5wTRsvb0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RsdyRXQFU62y3KRlku0zMPRsg41cEw+uxanDm+pgSPdZ3+WFHP8lMLGAE7OyGXL1I rH8tFL8MwziEYU1kVYnFLd6fafw2Dyip2hqH84qn4JjOm4xbqUWjVNeDdZnFX/lX/y Tj+1o6Vy5pn6Y18UR31myAkMzUXUha6b+kM4CjcU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Luiz Augusto von Dentz , Tedd Ho-Jeong An , Sasha Levin Subject: [PATCH 6.0 334/862] Bluetooth: hci_sync: Fix not indicating power state Date: Wed, 19 Oct 2022 10:27:01 +0200 Message-Id: <20221019083304.805307471@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747125845508560540?= X-GMAIL-MSGID: =?utf-8?q?1747125845508560540?= From: Luiz Augusto von Dentz [ Upstream commit 6abf0dae8c3c927f54e62c46faf8aba580ba0d04 ] When setting power state using legacy/non-mgmt API (e.g hcitool hci0 up) the likes of mgmt_set_powered_complete won't be called causing clients of the MGMT API to not be notified of the change of the state. Fixes: cf75ad8b41d2 ("Bluetooth: hci_sync: Convert MGMT_SET_POWERED") Signed-off-by: Luiz Augusto von Dentz Tested-by: Tedd Ho-Jeong An Signed-off-by: Sasha Levin --- net/bluetooth/hci_sync.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index fbd5613eebfc..f70798589bf5 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -4355,6 +4355,7 @@ int hci_dev_open_sync(struct hci_dev *hdev) hci_dev_test_flag(hdev, HCI_MGMT) && hdev->dev_type == HCI_PRIMARY) { ret = hci_powered_update_sync(hdev); + mgmt_power_on(hdev, ret); } } else { /* Init failed, cleanup */