Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp833704rdg; Fri, 11 Aug 2023 00:47:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGS1tBJis80RnOvxaPq7CXCPV6DHZtWp5c8e15uXp2Cc97TQChnnSWMyISo7SWjn/ZDgCOh X-Received: by 2002:a05:6358:281e:b0:13a:22d1:9b53 with SMTP id k30-20020a056358281e00b0013a22d19b53mr1386267rwb.1.1691740070217; Fri, 11 Aug 2023 00:47:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691740070; cv=none; d=google.com; s=arc-20160816; b=CQs1ZCfBN0N7PrRGTEU302uCWygGT+NRZ9eAeBQ/lDom5Ov3ks6KJSYA3Lb1fV/2yI tc0u+xGVKdfvC++DcNHgEgODCHnRyBRerS/6WxZFaRRBatraBb0irtMo+dpBCVBOmAcy 7jwaankuWXf6iWhVkdW4e+brmt1Wkx3j0nsIh50aqemu/M0BFoF0bQd8wEsfQV4fM8mr Rb6qcon1xqfOvqa2F7WnVa1EycQnhegPRTBDhJsMzi0zD1GZ1h3Szkm4ZUHMVjadnJrZ UB4r8AB1FrvGT1TVMv2fqbBmsWBv+EupGelizTuK7kMU25t5SySiPgdZlZkb8JkVYf6M zyOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=w9vIlVNUwM8YmTuGe0szbW9yLSWZVFUS9s5WWnJwt3g=; fh=6lW95gkoK+2MkMC57kPWrwYJrKHEiiAUFbcvwp8akN8=; b=UdX09bOjhW8OMrgpKeQaiLi2NwpRWzL1kduQ36SjACoXZ+YXKmRRiJHLlpu3tgx1pq jZcrwn0H8HU4YY71JrvIw+D4oop78cTMEr4As1FJUfcpQRJu6forq1J3yeKCDocP2RLN DFRlpYqDbAWbmyTspn8N1ybKwr1QY6O/0+Jv1jPZDYEIhPBeVw8GBt/DIRKeOFeNpv5I VupnB9G0mna4a9qWA9Hm1IhgApDNMus7B+i3QJJ5ysD0u5zhszk6ElZ1+iFftgp5OdUG p7XI7ntHgLY4R94sNDGwbBWKkrFRj+u+1phhdGL9h97yUMelDtxP8/LEtKUPfA2eJKDL VWDw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z7-20020a17090a468700b0026b0f8e78dfsi2549462pjf.83.2023.08.11.00.47.27; Fri, 11 Aug 2023 00:47:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234049AbjHKHiW (ORCPT + 99 others); Fri, 11 Aug 2023 03:38:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229992AbjHKHiW (ORCPT ); Fri, 11 Aug 2023 03:38:22 -0400 X-Greylist: delayed 46964 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 11 Aug 2023 00:38:19 PDT Received: from mail11.truemail.it (mail11.truemail.it [217.194.8.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17E41E73; Fri, 11 Aug 2023 00:38:19 -0700 (PDT) Received: from francesco-nb.int.toradex.com (93-49-2-63.ip317.fastwebnet.it [93.49.2.63]) by mail11.truemail.it (Postfix) with ESMTPA id D7179206D9; Fri, 11 Aug 2023 09:38:16 +0200 (CEST) Date: Fri, 11 Aug 2023 09:38:15 +0200 From: Francesco Dolcini To: Neeraj sanjay kale Cc: Francesco Dolcini , "marcel@holtmann.org" , "johan.hedberg@gmail.com" , "luiz.dentz@gmail.com" , Amitkumar Karwar , Rohit Fule , Sherry Sun , "linux-bluetooth@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v1] Bluetooth: btnxpuart: Add support for IW624 chipset Message-ID: References: <20230810094802.832652-1-neeraj.sanjaykale@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS autolearn=ham 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-bluetooth@vger.kernel.org Hello Neeraj, On Fri, Aug 11, 2023 at 06:19:12AM +0000, Neeraj sanjay kale wrote: > > > > > --- a/drivers/bluetooth/btnxpuart.c > > > > > +++ b/drivers/bluetooth/btnxpuart.c > > > > ... > > > > > @@ -547,7 +553,7 @@ static int nxp_download_firmware(struct > > > > > hci_dev > > > > *hdev) > > > > > serdev_device_set_flow_control(nxpdev->serdev, false); > > > > > nxpdev->current_baudrate = HCI_NXP_PRI_BAUDRATE; > > > > > > > > > > - /* Wait till FW is downloaded and CTS becomes low */ > > > > > + /* Wait till FW is downloaded */ > > > > > err = wait_event_interruptible_timeout(nxpdev- > > >fw_dnld_done_wait_q, > > > > > > > > > > !test_bit(BTNXPUART_FW_DOWNLOADING, > > > > > > > > > > &nxpdev->tx_state), @@ -558,16 +564,11 @@ static int > > > > nxp_download_firmware(struct hci_dev *hdev) > > > > > } > > > > > > > > > > serdev_device_set_flow_control(nxpdev->serdev, true); > > > > > - err = serdev_device_wait_for_cts(nxpdev->serdev, 1, 60000); > > > > > - if (err < 0) { > > > > > - bt_dev_err(hdev, "CTS is still high. FW Download failed."); > > > > > - return err; > > > > > - } > > > > this seems like an unrelated change, and it's moving from a 60secs > > > > timeout polling CTS to nothing. > > > > > > > > What's the reason for this? Should be this a separate commit with a > > > > proper explanation? > > > > > > > While working on integrating IW624 in btnxpuart driver, I observed > > > that the first reset command was getting timed out, after FW download > > > was complete 2 out of 10 times. On further timing analysis, I noticed > > > that this wait for CTS code did not actually help much, since CTS is > > > already low after FW download, and becomes high after few more > > > milli-seconds, and then low again after FW is initialized. So it was > > > either adding a "wait for CTS high" followed by "wait for CTS low", or > > simply increasing the sleep delay from 1000msec to 1200msec. > > > I chose the later as it seemed more cleaner, and did the job > > > perfectly, and tested all previously supported chipsets to make sure > > > nothing is broke. But you are right, I should add an explanation for > > > this change in the commit message in the v2 patch. > > > > This should be a separate commit, and probably it should have a fixes tag, > > since this is solving a bug. I recently noted some bugs around this, I just did > > not have the time to reproduce on the latest mainline kernel to report those. > Sure I will revert this change and add the wait for CTS back. I will > remove it later in a separate fixes patch. Please do let us know if > you encounter any issues here. I would probably do the other way around, first the fix, and then the IW624 addition. You can just send a single series with both patches. BTW: your email client is somehow messing up the email, you should do something on that regards, it makes more difficult to reply to your emails. Francesco