Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp16191pxm; Tue, 1 Mar 2022 13:59:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJy89C0e3y8o83Eep1QeNcFGHcfI0kSBYBN0lnoc1lEITKyGxXDKvM07Xr4s/x+i66NJWaQn X-Received: by 2002:a62:be1a:0:b0:4f4:c50:4209 with SMTP id l26-20020a62be1a000000b004f40c504209mr13084832pff.64.1646171970020; Tue, 01 Mar 2022 13:59:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646171970; cv=none; d=google.com; s=arc-20160816; b=Qz8b2/Jq5TtvJZ+hErYxA39FjI1vuzORaRfe9mcTL049ul+fQd9wq0LJvgWdgmS42C IVxw5eyzSfy1pgpck1rKHyjPZhBbfUqWfVp+Rr18IyjKz3sRvymM5TGUEUGOWaCdL/h4 cSC7K+1Ns85p4Xl6T/5429hTdt0UuAdVMH0qXqtBudi8f7YU0p5c8R5Tb5DOXXvQVSHU 1I0HmCj4klhwjFMwH1aE2sSkrvzmf4B5UInlPUwe9SfrlE6u7DmONbzyoq3VEWQvjDXo /sL/XpT23wvpqyOXpGeRXYS5Xpa2JJ3ckjZDie0vVI/StVA3MfQClBg4YScZL4Ki+w9v 5Y4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=SWEI93yfGbpWOM+6hji8PFGV8eOLo8IDaBqB5egfY1M=; b=iP3uTqCBIJp93lB1wmrPnCE8IQ/pOlQDKu6mgjGT1xlQlOY1e5CKaeyhHEJSz8zJNr WXPPn8LyPaXfhw1anqFnV0pRoYIqsRsZLI2OcmDPdK31HM/IWkd5znF+7311aVFl+osa TPyq8bS7zMwPFbKc1VsvTuyDsb72VYU5m/8z96VvRHnQBrRBZsnKd4hp9iBIf+6aOZ1I pNuqNnOCrnsUkqdG0IOG48YHFiIPlgzkTETaLiAnGdXIe+beBXojUDCP8xkh8lCUG9YM A5UasXxwWFxHEJL6lPq7SrhvFp6bzYkGZY3FjK9QSSQrjwkEsq17KLhf6x532YbCVnPI ao/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20210112 header.b=al+EPycd; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q13-20020a17090aa00d00b001bc737bd8f5si3374738pjp.84.2022.03.01.13.58.08; Tue, 01 Mar 2022 13:59:29 -0800 (PST) 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; dkim=pass header.i=@googlemail.com header.s=20210112 header.b=al+EPycd; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237128AbiCAS5l (ORCPT + 99 others); Tue, 1 Mar 2022 13:57:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235941AbiCAS5l (ORCPT ); Tue, 1 Mar 2022 13:57:41 -0500 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 849C861A06 for ; Tue, 1 Mar 2022 10:56:57 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id o18-20020a05600c4fd200b003826701f847so1217592wmq.4 for ; Tue, 01 Mar 2022 10:56:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=SWEI93yfGbpWOM+6hji8PFGV8eOLo8IDaBqB5egfY1M=; b=al+EPycduS3zhBQDGbo7mIFyjagdz6xnOOycQjL7Rz1V9ZSxCT35QfpzWaG0Umfyow WRTMZDXlWegL0/ohxls+J1AQKAfXS9QVJMqwllMU6lrgL+h1G5o1ejHFBvOBCcc1sOXk C6PIbcD3ZFer7tmu98joRBjS+fcwxe1IwPkAUvJBVQP4nOmx5c+7rhty9eS3gX5tFtdq kGD+puoYj1v2crFvU3Z2d4ygqHwXIOtorFNOzlRUTNcK0OhEqol33NvDHpjqfr/02rZo BbUiQ5AKwiZ06AqolhJSfjqv+VbBOm/dVLyXKxmPUlFtB9sCQk6nvs7wcQHLHBViPi7w xAyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=SWEI93yfGbpWOM+6hji8PFGV8eOLo8IDaBqB5egfY1M=; b=7zAHJd7N2B+Os7mi4s9f7s0uX8nLLDB9J/S9J+lAKmMewEPjz0UVXgSrRrEpLjRh/h 6zDygopxrE8nPvR9E09vdH48B5ykOxnqvPVAUSGy/iI3KBbE4iEMiSEONJpwXbR7jhgM S0FzNuLB5R4n/LFy0ABqapEGbP8Vez9jU+Z8GlUcG2tjGxmAhXhQFrLy50CaoZYbUhRj NpSlr30xAKifOztT71rlRaoohcVQBUJi52V3swxE6Zef7Q+ImshjewYb2t8G6SQZhTSj yCDHIzGcCb2b7VoUkJyLZuHP0HC077qm3KF03JAloiYO+BdbSbCCEvzX4DVNOYhvyItB fI7w== X-Gm-Message-State: AOAM533eT/YHGuYBuk8++ICWmRF3ZDLA1AcYqHtmVFbjpSjYYMguxfin SyqP5hau+/44JbeWZvYtUsKKoC5S2No= X-Received: by 2002:a05:600c:2217:b0:381:546c:92c1 with SMTP id z23-20020a05600c221700b00381546c92c1mr10426575wml.38.1646161015897; Tue, 01 Mar 2022 10:56:55 -0800 (PST) Received: from [192.168.1.10] (4e691f2a.skybroadband.com. [78.105.31.42]) by smtp.googlemail.com with ESMTPSA id m3-20020a5d6243000000b001e33760776fsm14431768wrv.10.2022.03.01.10.56.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Mar 2022 10:56:55 -0800 (PST) Message-ID: <94c891cf-86d8-d5a6-083c-8fe9e51f2581@googlemail.com> Date: Tue, 1 Mar 2022 18:56:54 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: bug kernel 5.17, qualcom and intel adapters, unable to reliably connect to bluetooth devices Content-Language: en-GB To: Luiz Augusto von Dentz Cc: Chris Murphy , Bluetooth , regressions@lists.linux.dev References: <82216882-463a-8976-e6bc-4a8919107a31@googlemail.com> <2ce6175c-74ec-8469-80a5-374bd1429542@googlemail.com> <17f2bf7e-1d6b-e090-8926-21a408f2b496@googlemail.com> <16cac2c8-c1ca-c8d7-e3d9-5f00be511614@googlemail.com> <6b17bdb5-dddb-e7c7-86f6-2240c6523a81@googlemail.com> From: Chris Clayton In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Hi On 01/03/2022 18:34, Luiz Augusto von Dentz wrote: > Hi Chris, > > On Tue, Mar 1, 2022 at 1:26 AM Chris Clayton wrote: >> >> Hi Luiz, >> >> I guess you are hoping for PEBKAC :-) >> >> On 28/02/2022 21:20, Luiz Augusto von Dentz wrote: >>> Hi Chris, >>> >>> On Mon, Feb 28, 2022 at 1:02 PM Chris Clayton wrote: >>>> >>>> Hi Luiz, >>>> >>>> On 28/02/2022 19:34, Luiz Augusto von Dentz wrote: >>>>> Hi Chris, >>>>> >>>>> On Sat, Feb 26, 2022 at 12:04 AM Chris Clayton wrote: >>>>>> >>>>>> Hi, >>>>>> >>>>>> On 24/02/2022 15:16, Luiz Augusto von Dentz wrote: >>>>>>>> I'll try another bisection today, but limit its range to changes made in the net/bluetooth directory. >>>>>> >>>>>> That bisection has proved very difficult because the bluetooth "service" in kernels at some steps of the bisection were >>>>>> completely borked to the extent that blueman's device-manager application wouldn't start and emitted the messages: >>>>>> >>>>>> blueman-manager 12.00.37 ERROR Manager:137 on_dbus_name_appeared: Default adapter not found, trying first available. >>>>>> blueman-manager 12.00.37 ERROR Manager:141 on_dbus_name_appeared: No adapter(s) found, exiting >>>>>> >>>>>> Obviously, I don't know whether the problem I am trying to pinpoint is hiding behind this more fundamental problem with >>>>>> the bluetooth "service", so being unable to say whether that kernel was good or bad, I had to skip. There seems to be a >>>>>> batch of commits that mean that, whilst the kernel builds okay, hunting down a bluetooth-related problem is not >>>>>> possible. Eventually and I cursed and gave up. Whatever was causing this breakage has obviously been fixed. >>>>>> >>>>>>> Please record the HCI with btmon, it must be producing something since >>>>>>> it records even the mgmt commands. >>>>>>> >>>>>> >>>>>> Refreshed by a good night's sleep, I started another bisection (between 5.16 and 5.17-rc1) yesterday morning but this >>>>>> time did not limit it to net/bluetooth. That was going okay until I ran into what I assume is the same batch of borked >>>>>> kernels. I've been more persistent this time but have just had a run of 16 steps in which the bluetooth support in the >>>>>> kernel is broken so badly that testing bluetooth is not possible. I will push on today, but I've suspended that activity >>>>>> to get the hci trace that Luiz has asked for. >>>>>> >>>>>> Using information from the bisect, I built a kernel that had tested as bad (but not borked). The commit is >>>>>> f2b551fad8d8f2ac5e1f810ad595298381e0b0c5. As I've mentioned before, the problem with devices not connecting is >>>>>> intermittent - for a given kernel, sometimes a connection works and other times it doesn't. On the first boot of this >>>>>> kernel, my bluetooth devices could connect, Attached are 4 files related to this - the output from btmon, and the >>>>>> related portions of daemon.log, kern.log and sys.log from /var/log/. Each of the these files is suffixed with ".good". >>>>>> >>>>>> I then powered down the laptop and booted into the same kernel. This time the bluetooth devices could not connect. Four >>>>>> more files are attached for this boot and are suffixed with ".bad". I said in an earlier email that when connection >>>>>> fails, there is no output from btmon, so that log is empty. That's still the case, but I guess that fact itself is a >>>>>> clue to what the problem might be. What I can add, however, is that if, in that same bad kernel, I unload and then >>>>>> reload the btusb module, connections start to work. Maybe that too is a clue. The same unload/load process revives >>>>>> bluetooth on a kernel built after a pull of Linus' latest and greatest this morning. >>>>>> >>>>>> Since I now have a workround, I'm going stop the current bisection that I was doing. I've done another couple of steps >>>>>> this morning and both produced kernels on which I could not test bluetooth and had to tell git bisect to skip. If >>>>>> however, I can provide any other diagnostics, please let me know. >>>>>> >>>>>> Chris >>>>> >>>>> Can you try with the following patch: >>>>> >>>>> https://patchwork.kernel.org/project/bluetooth/patch/20220228173918.524733-1-brian.gix@intel.com/ >>>>> >>>>> >>>> Sorry, that patch has made no difference. After the first boot my headphones connected okay, but after a power-down and >>>> reboot they would not connect without an unload and reload of the btusb module. >>> >>> Can you tell us exactly what steps you are using? Are you applying on >>> top of what, rc6? >>> >> >> Until I got your patch yesterday, I was using a clone of >> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git which I update frequently and have been doing so for as >> long as I can remember. Just in case there was a hidden flaw in that tree, I took a new clone yesterday, (so yes, the >> patch was tested on top of rc6) copied over the .config file and applied the patch. Then I built and installed the >> kernel, updated grub, powered off the laptop and booted into the new kernel. Once the laptop had booted and logged in to >> my LXQt desktop, I powered on my headphones and a connection was establisehed almost straight away. I powered the >> headphones off and the disconnection worked fine. >> >> Knowing that the problem crops up intermittently, I then rebooted the laptop. When the boot was complete, I then powered >> on my bluetooth headphones an waited for them to connect to the laptop. After about 20 seconds, a connection had not >> been established. I powered off the headphones, used modprobe to unload and then reload the btusb module. When I powered >> on the headphones, a connectiin was established within 2 or 3 seconds. >> >> I've booted this laptop countless times over the last few days. Doing the bisect, I didn't mark a commit as good until I >> had done five boots and been able to connect my headphones on each boot. What I can say from that work is that two >> consecutive boots into a working kernel are very rare. I can't remeber an occasion when it took more than two boots to >> establish that a kernel was bad. > > Do commands such as bluetoothctl power on or scan on works? You're taking about systemd things here but as I said last week, I don't use systemd. I use sysvinit and an associated set of boot scripts. Try > running bluetoothd -dn from a shell (disable bluetooth.service), also > are there any settings changed in main.conf? > OK, I'll try that later, It might be tomorrow because I'm busy with other stuff at the moment. Chris >