Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1369277pxm; Thu, 24 Feb 2022 01:34:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJwNU6fM5c52GR63yamtg/5JDzMkVEYcM9vkYn9Kv4LIX30nAz8lRcRhjTyLNPMHl8n8werr X-Received: by 2002:a17:90b:11cd:b0:1bc:4948:39c3 with SMTP id gv13-20020a17090b11cd00b001bc494839c3mr1920438pjb.41.1645695270692; Thu, 24 Feb 2022 01:34:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645695270; cv=none; d=google.com; s=arc-20160816; b=ShNzr5svPrHcCtBy4BqLvUOL8tW4dCN2V8IxJ9XtfB3QErsbxUa1BjG7+cxcG1AmgI Lpsv84nt60pecCxVQNDiuIiu1MLv+Y8Zy+yKRrCzR8vdeiaqt1qS9g1T0EmX+AN78t+f PwJ6vUVtgZs7ISNippqIJ3b8+zBrlPMai/5mihEQOmK1ZP7O5EiKEieDaOVp3ukPKdkd tD4xPSSY+rH5JeTntxi9barNOacUnFUSx4Z3iuAZNUTerZa8mOWPabCogD3/Hznk71IY 9IpW8mSaVp8YULibsNhUZovHFD2rz9ZEdgPvvsvMUSdYGExXVlZVTpERRSAaUsPaLADx LDbQ== 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:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=XqWyJi0pSAm3AXOPmlEWu4cafaZycSG89jRF8U7cukw=; b=WacNGN1QEv/GMxKmeIO62/yt1pk5tYkz9gEqem2VewYj8CcOL/fSDQMGIDPd80xdi5 GzQbMeiU+GSAkT/Ft/ANABXLmlXmenvK/SgFe/yj3m6Nwtt6Sq+Ss7nr6z5aCvz8D029 qgesiEkl62yxRPAT3p+7cG/7X9y1wG/8333jYBkNshEVJ/uRG16tCpcIPC74sxIx4UUb FF4VdG+doOAk2AUxW4FRZBn7DFDFfp+/F7Hh9yFAbdh5xbVaNOxF2qAS2SV0XKqxi+Lm q22JU0AihXLMxQYl8pcigbLHdV98HWNB0nO8/9rCC7TiyCr5DSUMg97ytpuYIlJIudwy 3f3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20210112 header.b=M2vnYrG2; 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 e16si1754161pgt.615.2022.02.24.01.33.51; Thu, 24 Feb 2022 01:34:30 -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=M2vnYrG2; 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 S229798AbiBXIYm (ORCPT + 99 others); Thu, 24 Feb 2022 03:24:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229753AbiBXIYl (ORCPT ); Thu, 24 Feb 2022 03:24:41 -0500 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D36D526F4CD for ; Thu, 24 Feb 2022 00:24:11 -0800 (PST) Received: by mail-wr1-x42b.google.com with SMTP id r10so717550wrp.3 for ; Thu, 24 Feb 2022 00:24:11 -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 :from:to:cc:references:in-reply-to:content-transfer-encoding; bh=XqWyJi0pSAm3AXOPmlEWu4cafaZycSG89jRF8U7cukw=; b=M2vnYrG29YNK+K3W7gGuzGXd4tiasxcq4Vh6jzDOG4NL0ZAAyNTNVtqZb+Fg2vuWBZ ktVxYL4PQNM8Nu1xsT1YFP5NEUbZwuep/8mg97miJCumIH7AjJ3quboNYwJ04+T8RvXv Odl8BtfZMHPPxvdV5Mc+XwxvrQp/ggRWyiH4sUeVR4m4fhDa4wua4Y+JHUylbndWPslV 4th+wWbZbnEN+sibS9ftbn47HEYh/jNiBhGcyc5acwG2Sgap5hclLXt4oA5XW5mTANg6 KgqgzkAAIRyDyDm6jMqDRvWCpShHl5+i6JTtHz/G3d0lUVdi0QCQQipp8Kob8mAwwA4z LR+A== 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:from:to:cc:references:in-reply-to :content-transfer-encoding; bh=XqWyJi0pSAm3AXOPmlEWu4cafaZycSG89jRF8U7cukw=; b=1lRxtlb1ChfY2FdrsF4Y3pJMYWKEt0IDeNqpsRJs/y/RRdJLV5mWYZwVDuFyFUpKCc 8QEgA+0fbhpteKuj6u71IecNMv3OwFyITLC9AsjepYGnsUMKw+LB4/4LGtXFn67s397X BWcZ/53fTxUb67/IxtOxN/iMW0AFVOb6ByBlpmScFFjSGs/m62eYZiDLurdJziAy9XUb AWeFnHr1xZCJf6ceoS/P0ZfgQ9M+6AnwntlaiQOeXn0mptHmXlLWJM/NI5Uy3YRdrbZw ynMk/bbqM3shrtVlD532Ny7TnAxX61+6QzknxKZcwiUA07ac/HgG8Qfck2/GyKDZDB+w GcNw== X-Gm-Message-State: AOAM532c1/ICgMZUaifu3N7xsLKP8LPuYnrMK3lXv2C8tyV/lVLgtml3 ErQmuNa1LijCy2hzOTQWngJgXN86Nag= X-Received: by 2002:a05:6000:18ab:b0:1e8:f67a:1518 with SMTP id b11-20020a05600018ab00b001e8f67a1518mr1267224wri.52.1645691050267; Thu, 24 Feb 2022 00:24:10 -0800 (PST) Received: from [192.168.1.10] (4e691f2a.skybroadband.com. [78.105.31.42]) by smtp.googlemail.com with ESMTPSA id j9sm2411037wmc.5.2022.02.24.00.24.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Feb 2022 00:24:09 -0800 (PST) Message-ID: Date: Thu, 24 Feb 2022 08:24:07 +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 From: Chris Clayton To: Luiz Augusto von Dentz Cc: Chris Murphy , Bluetooth References: <9ad505e1-7b59-7ebf-378b-23a6c0e25802@googlemail.com> <82216882-463a-8976-e6bc-4a8919107a31@googlemail.com> <2ce6175c-74ec-8469-80a5-374bd1429542@googlemail.com> In-Reply-To: <2ce6175c-74ec-8469-80a5-374bd1429542@googlemail.com> 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 Hello, On 24/02/2022 05:59, 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. >> Sorry, the FTBFS was my error - I didn't do the autotools magic properly. More haste, less speed! So I've now built and tested 5.17-rc5+ (v5.17-rc5-21-g23d04328444a) with bluetoothd built from a fresh clone of the bluez git tree taken this morning (HEAD is d89af9a). I'm sorry to say that I still get the intermittent failures when trying to connect my bluetooth devices. By intermittent I mean that if after starting the system from cold, if the first attempt to connect fails, then subsequent attempts also fail. If, however, the first attempt succeeds, I can disconnect and connect again as many times as I want. With a 5.16.10 kernel, connecting and disconnecting works reliably like it did with vanilla bluez-5.63. Chris >> 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. >> >> 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.