Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1422063pxb; Wed, 12 Jan 2022 14:31:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJxW6z8HT7mSEuR3AVosnW88tcQccBqCe62oqMabFmeKJ7/R+0NNwEF94aiZs8OkCZxz4NjE X-Received: by 2002:a17:902:7603:b0:148:daa7:ed7e with SMTP id k3-20020a170902760300b00148daa7ed7emr1840120pll.150.1642026682652; Wed, 12 Jan 2022 14:31:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642026682; cv=none; d=google.com; s=arc-20160816; b=rytWcMXboKtiou5GHjTEjD25gRw3wH11dh+dgP6+Mlxz37j6/JGtTsZLKGx1iGcqbH SXpFFDk0YRuPG9WmRUCIjaBIgL2jB3RnGf/VDfqGXBFzJ14T+VpngfHqt13fjdvtYX0A 49w3bOZE2HrnSe/QAzULtRqctMOKcfqPzKeKp8mxSvRVBDnVfmwxdZfiL5FX1c0hq9z1 wYKdTikwK0mQN9/oePDZ7Sm4Ivxs5MQW/IhPQEDpQgzLNw3q7428AOqQFLbOw3mHDDmI kAfVjDyUpyIZ0Xj+gMn/a2Df4YAW9hNMPnurAtes0tRZF2Nn4rDYh95Tc23AA5nacR0A MtIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=GdKlWg29mhVRYPs5UrcTqpcLY5/fvkZQhAbPaf9PigA=; b=WSRd4psTxgAX42ur4gotM2V/RKP1KPRXB5KBFTFV0oHVne7yrKFT6VaEwDttJeXM0g jaWMgKAH4q84qHJYmLc5cUGzDq9857AXecfNJRUUiztmkA1VHYHg6Jqsyr/HBt0dz9p5 E8gSn7cuGj3Suujgm25RoCW8DaiVIdBVGNKytnGd4rgnYKLGH4ZA5jI2ooDzpchPebhB p3vNdNsHV9icbRllN+yA/r8YPdxczoAf1xiQ/xVH6zjU56aZYZSwuzgn/IbXogv1tjdw CvgZBPl/fpYZb2FNbU7udwQpTQnO0gh0lV1sBz5gGJikkNTYHPlV+fxOkzr/Mv52URL9 TBWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r193si1093747pgr.719.2022.01.12.14.31.09; Wed, 12 Jan 2022 14:31:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344426AbiALHja (ORCPT + 99 others); Wed, 12 Jan 2022 02:39:30 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:38144 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1351234AbiALHj2 (ORCPT ); Wed, 12 Jan 2022 02:39:28 -0500 X-UUID: e30dc72d7c7f4138b558c580c1861efd-20220112 X-UUID: e30dc72d7c7f4138b558c580c1861efd-20220112 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 739688083; Wed, 12 Jan 2022 15:39:25 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.3; Wed, 12 Jan 2022 15:39:23 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 12 Jan 2022 15:39:23 +0800 From: To: , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , Mark Chen Subject: [PATCH 3/7] Bluetooth: mt7921s: fix bus hang with wrong privilege Date: Wed, 12 Jan 2022 15:39:13 +0800 Message-ID: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Mark Chen According to chip hw flow, mt7921s need to re-acquire privilege again before normal running. Otherwise, the bus may be stuck in an abnormal status. Fixes: c603bf1f94d0 ("Bluetooth: btmtksdio: add MT7921s Bluetooth support") Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Mark Chen --- drivers/bluetooth/btmtksdio.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c index 8cbd49013d86..0951bb10d117 100644 --- a/drivers/bluetooth/btmtksdio.c +++ b/drivers/bluetooth/btmtksdio.c @@ -960,6 +960,14 @@ static int btmtksdio_setup(struct hci_dev *hdev) if (err < 0) return err; + err = btmtksdio_fw_pmctrl(bdev); + if (err < 0) + return err; + + err = btmtksdio_drv_pmctrl(bdev); + if (err < 0) + return err; + /* Enable SCO over I2S/PCM */ err = btmtksdio_sco_setting(hdev); if (err < 0) { -- 2.25.1