Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp710905pxv; Thu, 15 Jul 2021 14:08:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxibmSClP2YJ9RPwiKyz0FdUvhze3kZKMGY0PejconqygF672G0WjLQfnAK5G4YRkVREJsk X-Received: by 2002:a17:906:4f05:: with SMTP id t5mr7661391eju.351.1626383312543; Thu, 15 Jul 2021 14:08:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626383312; cv=none; d=google.com; s=arc-20160816; b=kKKMWgmS3IvcRw3C1+D4l1Vg/62hPVziWVMJT9FekL+A1ZbyI4x3gx7gq5THCVFDpt aK0vVuT182Q1QvNSXH51vAY5N5RyIyrwU+8H3flu6QzhzFuevQTnMRxzCNxLXqhgvAkL eFJpNpqtFGZKDm54t4V5I9jTvOpkXqJBfKmlR3UUh+OHZNUbCZgO0tBkbmiWeoDpOzyO BwyaMZwMcjMbyW2s8Okxkv6hnA7yxS8DXaCDKVtqnH1dqsWwlxw0gD2cEuqi4OZahLSt oeicjas7Z+FyEya18uoshVviWZVObhY9FQc4VpNrep81s22d0oEvMnwJ1/X5ddnBjDBA Gybg== 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=A9HEOCbyPLnZtw6eYpuT9NQDP19QwUMJx0hCNTN11Dc=; b=Kf+G6sV/2ZlB6Epvk9kV3PYEAhudhLjUh8dHcERdwvCgtQAM/9HVs0fbBn8BLDFhCR oNKSKGyFO5Mm8zJiGESBWDfmMHvjcYXjezKaUuTw38yfZsH+W4raonS3yAyUrP+8RBkA uLq54awyt6VKNf6kxTk9w1Hu3bRGQPOxJIcvsxfZF4bak37GbwcS25NnU0h5b1PpRN57 slxCwbNG6FXdYqLIVVVUAc0tYwxV+8gHBetc1Tn2GrADswvIKN7e9NgSjB2FAKZjFKS+ 2BgZ8tGc51PHwONkmQcRkidosjP9YQ5I9pfFlVixIiMbLycFpCtswV5DE0WnmywliCE8 rQiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jcdE2uQZ; 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 b15si8688209ede.586.2021.07.15.14.08.09; Thu, 15 Jul 2021 14:08:32 -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=jcdE2uQZ; 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 S244556AbhGOTSN (ORCPT + 99 others); Thu, 15 Jul 2021 15:18:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:38830 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242600AbhGOTC5 (ORCPT ); Thu, 15 Jul 2021 15:02:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6D8DB613E0; Thu, 15 Jul 2021 18:59:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375550; bh=e3dKGtKDjP2RJubC27CF+muWmmyyf6t8niXEfy2LrOI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jcdE2uQZLN9yoS8C5VITnDzx4dnFEWLBTNPBNdCyk9x3a9xont8KeBke5KGufjLqY Z+BcBmUWUb5Iz0XVxfrNU6yI7kOQMuopYaa5cu+ztHVPbC1tSJyYT477MvNo0R62eV FJfOKtD0Jqkpynu1I5WFqEDiSf01+wR4EHxMJPd8= 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.12 135/242] Bluetooth: btusb: Fixed too many in-token issue for Mediatek Chip. Date: Thu, 15 Jul 2021 20:38:17 +0200 Message-Id: <20210715182616.782295134@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@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 ddc7b86725cd..b3ba5a9dc5fc 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -3377,11 +3377,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) @@ -3407,6 +3402,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