X-Received: by 2002:a17:90a:3f09:b0:1b8:e615:a261 with SMTP id l9-20020a17090a3f0900b001b8e615a261mr13987253pjc.196.1645698621575; Thu, 24 Feb 2022 02:30:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645698621; cv=none; d=google.com; s=arc-20160816; b=aozZJilSi8URD21BGLljQYAJ3lFDU/05UTas+Wj1lrkCFmEOkOJ9NfMS4RdSg/h9TE URBqFrsArOH69w1AQ254GHU3H/m5QuOA60NsHoEO2UhXRzeGfhUobKCgIGU4bFbnJokh WzQYh2FZQe4Rh/HDs9WQyKQ5ArM1YyPgf5LpFeH/11ZWXJSYZEajNa0f8xqHlvqaKdf3 vi87czxuD3vnL6QiUO9HtyPqr8d5OlKOn8hIVL0ep6nhgdslfptwosKtF2RfxDUPBcGV 0V6C2Y7qgH1Q9vWidkInL963lTEkjiQBwPM3sP9UCvDPZy12/Il42Y9va2DunEIUwLHa cxxw== 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=QE4r6AuFe3dQO6495+hzl0XpmaeVwKTjdWPNhBsedTc=; b=OdhJS0RNcNjzZUbFO2JJI/AeMd3132R4I+UY2alVkWs7aeSiQqKN9lcKUJDVQoHYyl BB+NyfcjeLdK4LhukZOp+3UZ70ePPAZ07h5yGuinEFlAc6Wz4+5Xq0dfd2KifWAx+oiK clViRqjkMK4RZvC+supXm607QJt2XnY13l8OE+Q13tonER8Ne6aZpi741x8X4mBFIVC+ R++r0881a+a+qT8e4/RKkjJJqdf+YMU5La6DcdqW1TLW4lBFrVHJg/WB3+VGPKoT/XO2 7MRCbJTkuRclnKv5+WpJRC4GfhngA6aeF58r521KXhB6f4zBnjIPmEGJp6wLcpto9Vn4 ZW5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20210112 header.b=M9u7cPCy; 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 p18-20020a17090b011200b001bc79cf32d0si4316209pjz.122.2022.02.24.02.29.47; Thu, 24 Feb 2022 02:30:21 -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=M9u7cPCy; 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 S231848AbiBXKIg (ORCPT + 99 others); Thu, 24 Feb 2022 05:08:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231363AbiBXKIf (ORCPT ); Thu, 24 Feb 2022 05:08:35 -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 8DFC6277909 for ; Thu, 24 Feb 2022 02:08:05 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id d14-20020a05600c34ce00b0037bf4d14dc7so912766wmq.3 for ; Thu, 24 Feb 2022 02:08:05 -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=QE4r6AuFe3dQO6495+hzl0XpmaeVwKTjdWPNhBsedTc=; b=M9u7cPCyL7O0+feYRb+u1mwqCaRAByRwJxx7DK8vJaCVWkWCioNcsdWCp1y7l8dV04 +JF2gRPloGWInxs2MrUk+wz4POQcUbgJqxT23p34ovsBTU7ELQLpmqjW0LjREVYkUuAj leRVT3cVtc8BWki4kto63PmbA0gwirABGE+SRg9YeRo8w2tWVRfgiZ4i48G0kwaYn/M6 tzrour0elPLSchtfRAECjvSS9a90qPQnaKzDs9w0K26tgF4mKa+nsYtTHTuxOeeaHRZz q5dJyLw+qYtRCkKz0bVDmqC0WxmQk5gjxICIip96XOY/5F0Rgyy17DYRd0/taqbyMI8R 38aA== 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=QE4r6AuFe3dQO6495+hzl0XpmaeVwKTjdWPNhBsedTc=; b=mzsB7k5zZm/IrpIsnXD7Q53EWDUUEnkf6CMTC63dcNpoqC0dvPz42d/Z4o2uegl4Mg 9ghSgZXCpBOtRtu8n49gD0upbHbyogy+/DpM4UXAJcAtKzcq/IvuTbyFJoxkPi4MQKTF tJyFiG95oU26xctNU9ZpQwBHL+3e1ctE8prxIdclk2YH9t3TNGqGsvZef3oSmf3UAhYU Ol2VvM+0QvKXebUdfa8LEFL+NRe/CVW7K8HptmPOcfbsYYN3eZohPy/3z9ArPulUlBgD bA0I+2zRNo30eIA/WgKlPwP7KCrP/wO7H97CMZBy+3cZGTSpYNeZKkihwaBEOjb+V9+j cLxQ== X-Gm-Message-State: AOAM533JuTkTu20kpEgwxWktlCNQw6samtbCHfX5UMm/osNkttJPDM5K d9vWRk9VQMp3Olx5J5QQjqgqG6m3eTg= X-Received: by 2002:a05:600c:1f16:b0:37b:c7f2:fbb4 with SMTP id bd22-20020a05600c1f1600b0037bc7f2fbb4mr10655478wmb.47.1645697283951; Thu, 24 Feb 2022 02:08:03 -0800 (PST) Received: from [192.168.1.10] (4e691f2a.skybroadband.com. [78.105.31.42]) by smtp.googlemail.com with ESMTPSA id u7sm2152961wrq.112.2022.02.24.02.08.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Feb 2022 02:08:03 -0800 (PST) Message-ID: <17f2bf7e-1d6b-e090-8926-21a408f2b496@googlemail.com> Date: Thu, 24 Feb 2022 10:08:00 +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: <9ad505e1-7b59-7ebf-378b-23a6c0e25802@googlemail.com> <82216882-463a-8976-e6bc-4a8919107a31@googlemail.com> <2ce6175c-74ec-8469-80a5-374bd1429542@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 Luiz, On 24/02/2022 08:16, Luiz Augusto von Dentz wrote: > Hi Chris, > > On Wed, Feb 23, 2022 at 9:59 PM Chris Clayton wrote: >> >> >> >> On 23/02/2022 22:42, Chris Clayton wrote: >>> Hi. >>> >>> >>> >>>> >>>> We are starting to suspect this is not a new issue, it just become >>>> easier to reproduce with newer kernels since the mgmt commands are now >>>> handled by a different work/thread which probably takes longer to >>>> respond hitting problems such as: >>>> >>>> https://github.com/bluez/bluez/issues/275#issuecomment-1020608282 >>>> >>>> This has been fixed by: >>>> >>>> https://github.com/bluez/bluez/commit/faad125c5505b941f06c54525616e192a6369208 >>>> https://github.com/bluez/bluez/commit/5f378404bff6bbfea3f20e36535c494efa5066a5 >>>> >>> >>> I cloned bluez, but that FTBFS, so I applied the two patches by hand. >>> >>> After the first boot, my bluetooth devices connected fine. But after a poweroff and boot, they didn't. Nor did they on >>> the third and fourth boots, so the patches don't seem to be the answer. (They couldn't really be anyway because changes >>> to the kernel have broken user-space which I understand is a big no no unless there is a really compelling reason.) >>> >>> I've gathered some diagnostics today and they are attached. They consist of 6 files containing the output from btmon and >>> dmesg and the log file for the system daemons, which, of course, includes bluetoothd. There are 2 sets of these files - >>> one from a boot that resulted in a system where my devices would not connect and another from a boot where they could >> >> s/would not connect and another/would connect and another/ >> >>> not connect. You'll note that the btmon log is empty for a failed connection. >>> >>> I also tried a bisection with v5.16 as good and v5.17-rc1 as bad. Unfortunately, I found several steps resulted in a >>> kernel where bluetooth seemed to be substantially borked - to the extent that blueman was non-functional and clicking on >>> the tray icon did not start up the blueman-manager application. > > Running with 5.17.0-0.rc5.102.fc37.x86_64 there doesn't seem to be any > problems, well apart from LE device with Privacy/RPA: > > https://gist.github.com/Vudentz/5792f4989198c7f2994af2e31eb973af > > Ive tried suspend/resume a couple of times just to see if there is > something odd going own, anyway I'm running with the latest userspace > so perhaps I really need some old userspace to reproduce this. There I don't have an old userspace. I built my system from source about four years ago using the methods from Linux From Scratch and Beyond Linux From Scratch. I have been updating the packages since then as and when they are released. In a way, you could equate my system to one of the rolling releases. It is very up-to-date but at the same time very stable. This morning I updated to the latest releases of the 5.15 and 5.16 stable series. I've also built and installed the latest in the 5.4 and 5.10 stable series. (All four had new releases yesterday.) Bluetooth works as expected on all 4 of those kernels. It has also worked on every kernel released by Linus and every stables series kernel in the last four years. I usually start trying out a development kernel when rc3, 4 or 5 is released, depending on time available. If I find any problems I report them and provide any diagnostics required and test patches. Bluetooth is unreliable on my system when I boot 5.17-rc kernels. There is little doubt in my mind that something that has changed in 5.17 is at the root of this. Whether it is actually a bug in userspace doesn't change the fact that there is a regression because of one or more changes in the kernel. As I said yesterday, my understanding is that such regressions are frowned upon. I'll try another bisection today, but limit its range to changes made in the net/bluetooth directory. In the meantime I've copied this email to regressions@lists.linux.dev, so they can track this. Chris > might be something with name resolving though, it appears gnome don't > show devices if they don't have a proper name (that is not their > address) so perhaps that gives the impression there is nothing going > on when in fact that all normal, well apart from the fact that names > takes way too long to be resolved. > >>> I also booted into a 5.16.10 kernel and connecting bluetooth devices worked flawlessly. (This was with the unpatched >>> bluez daemon) >>> >>> Chris >>>> So the timer doesn't start until the request is sent. but obvoiusly >>>> older versions of userspace don't have that fix so they end up >>>> cancelling the loading of LTKs, this would explain why reloading the >>>> daemon would make it work again. > > >