Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2197467iof; Tue, 7 Jun 2022 22:56:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHfXVwDytR7mg+R2EE3JTQyGAuIFaJQFsrARxq8glJ0fwAHCJoAxl+kQlFRcVQz4UGSiK5 X-Received: by 2002:a17:902:e0c2:b0:167:6128:e63d with SMTP id e2-20020a170902e0c200b001676128e63dmr20962059pla.16.1654667797744; Tue, 07 Jun 2022 22:56:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654667797; cv=none; d=google.com; s=arc-20160816; b=NECD793hfprrFFApI7oNBdfkVund7ptIoeEvqizioNf6NjJxOYeYrjJ19JR4Irc1/o fVnaqY9I3REOnbjbxidM4Ey35AutTkNRqHlGX58g/1nqoJHx695puIiqBdj9EjPhXKkn a3B3Ic1jlHg0o0Mi8Psr/kyPItGTX7R1yxcPS1nb/qX8Ak2vulLee0xiCSqjwhFkKyiB RQcBw/xZSnnGCScEEWkBW3PYf1zQfz3t16yt1S5NhsEriyhiiM8JZbow7YCFn9z1ecsG UQaDt5SslDZH88heqz3ghivXZimQQBwV/ah4XxF+tZPMecxhvPBts8JlSJomUVTqdGHT tXFQ== 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=srPEWdWrnffSKFZfe7K6u6VURtn0ABTt7uMYJjNtB9Y=; b=WLRCdbGBudPpq2zBckAf8A4L465Q03DZF82xGxsV4PJQoz4B7Raj8whJP0I63plw6G 9uBVRub0Ixy/D2hukwegM7f2YTrPH0LM+eEVmMmrmW/UTBB8QUXA2UPesJun9Dkr49fk /CKp6aAmSutIQUAGUTud3KM456ifsE+Wk0dXslx+VWXEjMdDoC6J9hIV9w6U/admka06 aGIgJWhaGv3v5srxYstdufaipZxAKrfnnOc8tC410sPqkWxxiSI7tQ308dvS4GO+KvnH 8iY6elW/yC++lvzzG+njys4FnH/7Vc7a+9dFhhkb9fbxumFPBO7t0JC0GFrfVI27mfIl lapQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=g1Ya9Qwg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id hk11-20020a17090b224b00b001e68b44501esi27733699pjb.5.2022.06.07.22.56.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:56:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=g1Ya9Qwg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 2676E4B26DD; Tue, 7 Jun 2022 22:22:35 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443213AbiFHA5u (ORCPT + 99 others); Tue, 7 Jun 2022 20:57:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381745AbiFGVow (ORCPT ); Tue, 7 Jun 2022 17:44:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31697235118; Tue, 7 Jun 2022 12:07:28 -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 94C42B81F6D; Tue, 7 Jun 2022 19:07:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1D24C385A2; Tue, 7 Jun 2022 19:07:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628841; bh=74S82kLFV4attk0fZoUqvtIlkJyl4CWuDDsLRNHjqLw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g1Ya9QwgM6xbGXD1QsnTd70BDXXBqwUu2G1zIS7DQj3wGq12ymijsgdqXVRu5vCxa IvbwDU/zxEBE1z9UQ3oSVFLM/InxpSrPYMTEdIM1LcukNMdR6fMYmDqOjxG09PyRVy EKecRS8ZY/cRb7px1DWqm5arLuONMv9oUr26P9s4= 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 458/879] Bluetooth: btmtksdio: fix the reset takes too long Date: Tue, 7 Jun 2022 18:59:36 +0200 Message-Id: <20220607165016.166596385@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 baabb7f530e8a3f0085d12f4ea0bada4115515d3 ] Sending WMT command during the reset in progress is invalid and would get no response from firmware until the reset is complete, so we ignore the WMT command here to resolve the issue which causes the whole reset process taking too long. Fixes: 8fafe702253d ("Bluetooth: mt7921s: support bluetooth reset mechanism") 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c index 5d13c1f61bd3..d6700efcfe8c 100644 --- a/drivers/bluetooth/btmtksdio.c +++ b/drivers/bluetooth/btmtksdio.c @@ -1189,6 +1189,10 @@ static int btmtksdio_shutdown(struct hci_dev *hdev) */ pm_runtime_get_sync(bdev->dev); + /* wmt command only works until the reset is complete */ + if (test_bit(BTMTKSDIO_HW_RESET_ACTIVE, &bdev->tx_state)) + goto ignore_wmt_cmd; + /* Disable the device */ wmt_params.op = BTMTK_WMT_FUNC_CTRL; wmt_params.flag = 0; @@ -1202,6 +1206,7 @@ static int btmtksdio_shutdown(struct hci_dev *hdev) return err; } +ignore_wmt_cmd: pm_runtime_put_noidle(bdev->dev); pm_runtime_disable(bdev->dev); -- 2.35.1