Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp658958pxv; Thu, 15 Jul 2021 12:43:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxbwVUED1CmD4c/7DE6ew3NoLnmfJT9vzJdlDe3/UAwN2j80kfEydE+A1VXZp6/KJCwp79 X-Received: by 2002:a17:906:8808:: with SMTP id zh8mr5516080ejb.213.1626378198307; Thu, 15 Jul 2021 12:43:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626378198; cv=none; d=google.com; s=arc-20160816; b=SPQegNSLxxtbtA0t9ZKiXB+c2MzA7c3wwdND3ygLYb0sfb4UuB+sgZ6VqguyyB0s9n o0oRhOdZke/WWWADOmrD2tLeqSj2csU368IzYgn/hij0KVwM0fAXf10cOMRGBVRqsurZ xy0dVSMDKgNBPOsp8ueIcvw62HCrUX5ZHzQ0I3Z+t7s6aOvNksg/h6wGkwCH1PliF/PK o6cojPeNoSlR9qy2z+FJ0bFX3HeMv6smxBdyiO5PPwwfn2VX5m+OANPmy88yZZa4SvyP 8SnFTzml+S7s41Xaq19LZc6qaFzcM7J8PvMFnkzk6/VbIx5m3L6t4piMcBkQ/GEXR+ri IDuQ== 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=0FWQaFqkOtwlsQUdvN7sDjoGCHkBycaAynB67EdQ1mk=; b=0igMGiDx2Xqmd4eVQs6O3AjoUcWaLMe5hCeyAO327Xqhd96FklFZ4m0ZaV5903ZRwy R3bF6fX08Ao3w0kPqtrZPmk3iRVGPScZOSE77eisKaNaf3XcCjLxT3c4a77yKDAQLpjx s/AeLE87Fue5HGmdfZkI02fWl+9hDQbgnOlsZrZbVO1YdDutFsTfiMPAV5EGbdj1KYPX nrJXv54wXRfzeEPjt52FNBmc4RAC/ydmdkhLjI+ZSSL1CF604Vm+msBL25d3L+JJQKE6 jOsl/nHUE7tiwaj8pMWzU5qI5s4onPJCdClVMjIlrm/qjow9DE6HwhX2esQNun4OOi0V /F3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=da9+kJzV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kv11si9015875ejc.524.2021.07.15.12.42.52; Thu, 15 Jul 2021 12:43:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=da9+kJzV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235562AbhGOTnx (ORCPT + 99 others); Thu, 15 Jul 2021 15:43:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:51470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242396AbhGOTNG (ORCPT ); Thu, 15 Jul 2021 15:13:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7B3A56127C; Thu, 15 Jul 2021 19:09:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626376176; bh=gGn7zvcLut9IXufFPycpXKfqX+pe4Sh2n5DXNEEy2Pc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=da9+kJzVDwzIpCtSVV8fOC6dTg3iWKL02GR5rIXGl8YI14SkDLbYx9sKARBz0isrm IjJiD6eAPaOYEeIPnPF/AqxapYUMPOsRkjTZkdsEfNclHbwIxhVv0WZb5oecQdKlIq a8g7wYzMVIaCN0d2czLuDNJtA2Wde5DXroVOAQxM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "mark-yw.chen" , Marcel Holtmann , Sasha Levin Subject: [PATCH 5.13 157/266] Bluetooth: btusb: Fixed too many in-token issue for Mediatek Chip. Date: Thu, 15 Jul 2021 20:38:32 +0200 Message-Id: <20210715182640.644288988@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182613.933608881@linuxfoundation.org> References: <20210715182613.933608881@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: mark-yw.chen [ Upstream commit 8454ed9ff9647e31e061fb5eb2e39ce79bc5e960 ] This patch reduce in-token during download patch procedure. Don't submit urb for polling event before sending hci command. Signed-off-by: mark-yw.chen Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- drivers/bluetooth/btusb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 7f6ba2c975ed..99fd88f7653d 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -3312,11 +3312,6 @@ static int btusb_mtk_hci_wmt_sync(struct hci_dev *hdev, struct btmtk_wmt_hdr *hdr; int err; - /* Submit control IN URB on demand to process the WMT event */ - err = btusb_mtk_submit_wmt_recv_urb(hdev); - if (err < 0) - return err; - /* Send the WMT command and wait until the WMT event returns */ hlen = sizeof(*hdr) + wmt_params->dlen; if (hlen > 255) @@ -3342,6 +3337,11 @@ static int btusb_mtk_hci_wmt_sync(struct hci_dev *hdev, goto err_free_wc; } + /* Submit control IN URB on demand to process the WMT event */ + err = btusb_mtk_submit_wmt_recv_urb(hdev); + if (err < 0) + return err; + /* The vendor specific WMT commands are all answered by a vendor * specific event and will have the Command Status or Command * Complete as with usual HCI command flow control. -- 2.30.2