Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2150415iof; Tue, 7 Jun 2022 21:25:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8cwp2nWlUNXEdeQJSC9Z9c2zKTk/DPJpH5uIbOP57qKWSY1+yjV1xxNZMD6BvD4yFz/OV X-Received: by 2002:a17:90a:dd46:b0:1b8:8:7303 with SMTP id u6-20020a17090add4600b001b800087303mr70931203pjv.197.1654662357873; Tue, 07 Jun 2022 21:25:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654662357; cv=none; d=google.com; s=arc-20160816; b=K7S/3Mlyq/LqynB1WFPXiodXRfto/xvDQyfQN9Zful+nIGkFuhDZqDbQyIOG/7TAxG co3YOPGiP/SU7AgjRYdSOPBiz+X7Z4E+dU8+HI5N/uPTDYPbCrp88hU29azE9MzNb/CH 9PB15HckNP1rWEwVf4qkKng6Mwggfi14pceXxDeeLsmVSbk69sPOsnZuWSnLfywxqfni dGB8nLhlbaMPF9QCzfao//AaMX8PElvsmjrwGtdCKlwlPkp9hfM8bxU+wtOmDre0SHau Z/Pb1inpj0VAU+yX4ZxAsap/jktxZPJQhjCiCiR5pzqWvV7tmW97Ykp7FXZWPus5YuO3 98Iw== 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=QotznEt48Z3kfHclicbUZO290ke5Wbw2AUF/h4+NxCk=; b=QWoATgsB2JqJit1/jj0r0tdinQfBzulxB7iq1x1+vx3KiraibWHPB3iO0j5SyolTzH aVMsCS+pvP1NQQOkoSdaR1Us6MKTlDGHwm6K/Tg+F/Mb9MAcLk0kj52npbgTc4ld3e5O BZ7MkkoAuQotsCFE+YuMLBTte7ysAu+MqcR/TukSN3NUjT5ZpP2FTp0UK585kTsOAozY rE0opkSsMQiCv4FFQZWiQYj3W/fMB1UcBsE3yMg7VfVvOM0rFU4FxHVL55RuBYJ/zyaN wQf1MevWasd720ajLLtcS7LulHNgai0NFQST6QprNX/sSaXfXu9rpiKO7C2hLZnq7zVe Gp4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ws5kc7Dw; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 84-20020a630657000000b003c606c79e4csi26535442pgg.522.2022.06.07.21.25.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:25:57 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ws5kc7Dw; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8A83B4272C7; Tue, 7 Jun 2022 21:00:24 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387008AbiFGWtl (ORCPT + 99 others); Tue, 7 Jun 2022 18:49:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381413AbiFGVkm (ORCPT ); Tue, 7 Jun 2022 17:40:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79B8E23281B; Tue, 7 Jun 2022 12:06:52 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 7BA9A6184D; Tue, 7 Jun 2022 19:06:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 811E4C385A2; Tue, 7 Jun 2022 19:06:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628810; bh=WEl8kOHUEiPWdwBDQUAps0GyCtZmVnhXRwz9neMn+oc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ws5kc7DwCwjMiztbcTMwetGxL1v/Ez5RQ4z57KLarbf7mDC355H7Tfz8SDahrVmzD m6Icd2UOmYfA01XjO0Nyuj0GVkakOIBKOlcAezyznbqaWtwqVCtH7cshbnTI7itIX2 BvnQLtPkQo3O8j6cMsZVV6jALcfaKiBUbQtOJYf0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yake Yang , Sean Wang , Marcel Holtmann , Sasha Levin Subject: [PATCH 5.18 457/879] Bluetooth: btmtksdio: fix possible FW initialization failure Date: Tue, 7 Jun 2022 18:59:35 +0200 Message-Id: <20220607165016.136929533@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: Sean Wang [ Upstream commit 7469720563e01f479ec5afe06bd6f440f965d523 ] According to FW advised sequence, mt7921s need to re-acquire privilege immediately after the firmware download is complete before normal running. Otherwise, it is still possible the bus may be stuck in an abnormal status that causes FW initialization failure in the current driver. Fixes: 752aea58489f ("Bluetooth: mt7921s: fix bus hang with wrong privilege") Co-developed-by: Yake Yang Signed-off-by: Yake Yang Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- drivers/bluetooth/btmtksdio.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c index 4ae6631a7c29..5d13c1f61bd3 100644 --- a/drivers/bluetooth/btmtksdio.c +++ b/drivers/bluetooth/btmtksdio.c @@ -864,6 +864,14 @@ static int mt79xx_setup(struct hci_dev *hdev, const char *fwname) return err; } + err = btmtksdio_fw_pmctrl(bdev); + if (err < 0) + return err; + + err = btmtksdio_drv_pmctrl(bdev); + if (err < 0) + return err; + /* Enable Bluetooth protocol */ wmt_params.op = BTMTK_WMT_FUNC_CTRL; wmt_params.flag = 0; @@ -1109,14 +1117,6 @@ 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.35.1