Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5220751imb; Thu, 7 Mar 2019 10:20:59 -0800 (PST) X-Google-Smtp-Source: APXvYqykgIQpqMhSiFE8EpAsNN+3BLx4VBZLxC0gvJniz3/ODkWD6YSYXO+7oR51qOZBwAcHATDb X-Received: by 2002:a62:45da:: with SMTP id n87mr7485071pfi.160.1551982859626; Thu, 07 Mar 2019 10:20:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551982859; cv=none; d=google.com; s=arc-20160816; b=w75v99hfGpFfVjDlhKzVdNCPD6MQ+3MAxEcOs+dVrRmEelYRUMoYQmIOZ//fJSobaG PG49wis0w5Vm+cOECOCBiaVYFc1Q2AkO0d1dt/8sEQNC8dIZkZJd17JtRS6didapwaJU S5CjjEpfa7Di1ei6dFsJ9aq8vrpP3OTSMdEWQGm6nnllket2MWkTuRmJD28tckjAk54R z6iMLBT0AUqqDU3h5H84kauGyxleGw3LrjL1fehEj+CYMBlh86ZPtU59dkkyc/XPLqkr 6W1sWn30AKu8xNmocYskTHv0WyMdbmc0mkmBEO2ophSkd5ghD+ZYoB0dg8Hbgt3vm//q IOYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=n8wSLJh3GXdY5a0oY98XTXZmgoXX8BLFR1DAUT44FVc=; b=iBz4tl3u8Y4bsfUatlFDaj4angrUXGC0DGz1eScWE/F1296mNfc5dYlGSkTUA22bcI EpwRjbIVl12u5uymowMp4bVyJdIP75OBMza6Hv9waD8AMSZx1ZKai7GdFkfWZF/BL27F waGxtklhOALBFLlnRY7WBHahOCMxW2YT64mEWjmuXbj1naepkeXSfi+LQQL9V1/ZPOuw M3EdR6X31s1yvMThAI0Z/sdObVYyaehOdSBHuyZkH0nwj/Bx/2nQOKewQzilLVI57TAh PY7P1ylnSDtZ0afN9ocpTPHfmD4jJ9VmY657MdjlLEADsrU8QQoABgnCND2bzVibr0h3 i9sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YpArZAGF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g127si4301423pgc.313.2019.03.07.10.20.44; Thu, 07 Mar 2019 10:20:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YpArZAGF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726413AbfCGSUM (ORCPT + 99 others); Thu, 7 Mar 2019 13:20:12 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:36962 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726127AbfCGSUM (ORCPT ); Thu, 7 Mar 2019 13:20:12 -0500 Received: by mail-pf1-f195.google.com with SMTP id s22so12058092pfh.4 for ; Thu, 07 Mar 2019 10:20:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=n8wSLJh3GXdY5a0oY98XTXZmgoXX8BLFR1DAUT44FVc=; b=YpArZAGF2rkH+wl8ZqI3DxIhYtHR6yMZ7TB03z/egkTW+6e/WGDbHZtXl7oWJ+S4uQ +ZpJFwKZxpA/czdyIbbqV8KTN5iJMozcuBteCoRYDnbE+WXT0pwii/Ndb8FwG50Xrenn 9+/e9i753OmYF45snSFF612oGQ66pDAftMR8g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=n8wSLJh3GXdY5a0oY98XTXZmgoXX8BLFR1DAUT44FVc=; b=SYuRHsR1znszvjuK9frhe/tMseuq2WQPGVZbkHQIFZJCD9D4D+Tqy3NqqFIGVqSAXJ JIpHakeaVw5BBFdJm5FARmvZ7UpTrYEr0BiFwhJo+UWvyOnlk7pIA9tP8Q7aT6Ox9mOY 5MMrafjwADNjaTcZ6qwes08Jh0x4auP1lo8Dxo4S9Ea/hUJuuE1PGRuB7tUmgtAT0isu k9AFTo6PUFX83Mofi7YuPTJPVUEnWZkp/FrSaFqp7xFhHYxg/40WqG6qwQOkhyMUR+MB xFLJb5+7EhNdl6r3ovLYPP+3e9mvqRlJO2UGy4RIaUXSwToAAvrKXtK2Ww/+oBKSfZpL iJzg== X-Gm-Message-State: APjAAAU8Etgx5TlXoUaD6btlWeEugJUWJYv3aeAhy/VJ8plh/yUcnR3E pqgzEBxDPjPChX6yZuOFFhNyfg== X-Received: by 2002:a17:902:7682:: with SMTP id m2mr14431176pll.311.1551982810943; Thu, 07 Mar 2019 10:20:10 -0800 (PST) Received: from localhost ([2620:15c:202:1:75a:3f6e:21d:9374]) by smtp.gmail.com with ESMTPSA id s4sm7810922pfe.16.2019.03.07.10.20.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Mar 2019 10:20:10 -0800 (PST) Date: Thu, 7 Mar 2019 10:20:09 -0800 From: Matthias Kaehlcke To: Balakrishna Godavarthi Cc: Marcel Holtmann , Johan Hedberg , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Hemantg Subject: Re: [PATCH 2/2] Bluetooth: hci_qca: wcn3990: Drop baudrate change vendor event Message-ID: <20190307182009.GB138592@google.com> References: <20190307004041.38059-1-mka@chromium.org> <20190307004041.38059-3-mka@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Balakrishna, On Thu, Mar 07, 2019 at 10:35:08AM +0530, Balakrishna Godavarthi wrote: > hi Matthias, > > On 2019-03-07 06:10, Matthias Kaehlcke wrote: > > Firmware download to the WCN3990 often fails with a 'TLV response size > > mismatch' error: > > > > [ 133.064659] Bluetooth: hci0: setting up wcn3990 > > [ 133.489150] Bluetooth: hci0: QCA controller version 0x02140201 > > [ 133.495245] Bluetooth: hci0: QCA Downloading qca/crbtfw21.tlv > > [ 133.507214] Bluetooth: hci0: QCA TLV response size mismatch > > [ 133.513265] Bluetooth: hci0: QCA Failed to download patch (-84) > > > > This is caused by a vendor event that corresponds to an earlier command > > to change the baudrate. The event is not processed in the context of the > > baudrate change and later interpreted as response to the firmware > > download command (which is also a vendor command), but the driver > > detects > > that the event doesn't have the expected amount of associated data. > > > > More details: > > > > For the WCN3990 the vendor command for a baudrate change isn't sent as > > synchronous HCI command, because the controller sends the corresponding > > vendor event with the new baudrate. The event is received and decoded > > after the baudrate change of the host port. > > > > Identify the 'unused' event when it is received and don't add it to > > the queue of RX frames. > > > > Signed-off-by: Matthias Kaehlcke > > --- > > ... > > Can you test by reverting this change "94d6671473924". The issue is still reproducible. > We need at least 15ms minimum delay for the soc to change its baud rate and > respond to the with command complete event. The baudrate change has clearly been successful when the problem is observed, since the host receives the vendor event with the new baudrate. We could increase the delay to 15ms just in case, though in my stress tests with 1000s of iterations I didn't observe any problem with the baudrate change itself. However if this patch gets landed the delay could be removed completely, since we are waiting until the vendor event is received with the new baudrate. > In my previous stress test we have not observed any issues. Which patches did you use for the stress test? Did your stack include '78e8fa2972e55 Bluetooth: hci_qca: Deassert RTS while baudrate change command' (or equivalent)? It is mainly this patch which *exposes* the problem, before it (and with the long delay) the controller response was received with the old baudrate and could not be decoded ("frame reassembly errors"). Also make sure to test without 'Bluetooth: btqca: inject command complete event during fw download' (https://lore.kernel.org/patchwork/patch/1027955/), since it affects timing and injects extra events. It might seem that it fixes the problem, but it just papers over it. I have my suspicions that the mega-timeout of 300ms for ROME was introduced to 'fix' a related issue ... Cheers Matthias