Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp233867pxm; Wed, 2 Mar 2022 14:11:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJzKd8rBc41Q975NdIwNpLhVBGNIFLmDKSGE/V5DagFDk//AvM745Laheq9ofq+/Odz4r6Gm X-Received: by 2002:a17:902:8a91:b0:14f:969b:f6be with SMTP id p17-20020a1709028a9100b0014f969bf6bemr33085099plo.161.1646259074292; Wed, 02 Mar 2022 14:11:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646259074; cv=none; d=google.com; s=arc-20160816; b=fFOFln4Ri4YGzwmP5JBDsSGJb7V9cPu3kKr6OUqrM01pdxBSrrVdu76EOSGDT/BR5N M7z/RA+QGaqGfXlTEpgJ9Gq+ZG73SV8hd5io4VhC5RFgLKgFgwhmNfP54jIZRObT5tFO u1qV0pqM6VaosBP7MEUNWcjRr/6+wX5NHxb26I9+fk3w604dA+sj0wVcI/bpVnKW16J3 qrTqOkpvz2ywWFWm7hv8zBza8YeA/XO4XlCJhqoNl8Me1QSrghYed1w1w8Yk5ybrwthS fcYm8dDUYDFo8jOCKjD2fr/DH32SxmXQV8kpLeUUWlpKsIIIoZr6+lDfwVwahXj8C1L8 YN+w== 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 :content-language:references:cc:to:subject:from:user-agent :mime-version:date:message-id:dkim-signature; bh=mGjgjuJagPpDvHFPLswTGe/gvNp6BgBi52/QqsLQeJk=; b=z6YyNCCP3MZjgpCSH8NPs0Y2cXfxJPeAmXgmu8EdjsGEAVD/tVV9a2g6+zEFwYY8Wx 7kq6FFCcoJQvb5tp41iGCFRFQr0hxOAkEVn8wacqLX5eyFYAoE/WLlJwHKA82EmMg2oo n1BSjjynlp/8lYxYh7Xn5kMSFO5+S8NuooJptn+BR5Appm+Io9votwSs1sP6d8JEiYro 83FF4l3r67nVGpn4Eua71iKD56e9zHY8fB3NbdPAhoyilKY0j1j0dKUdFfckZsH5nrT/ K0j+njmGkSyhjH0aJETxCMMlOQ4HmIIMTJIaREwm5w4aMvUPGR5earX91n1MrjDOW1yW essA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20210112 header.b=AQ+0vGNm; 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 l7-20020a635707000000b003759f06bf6bsi218907pgb.809.2022.03.02.14.10.34; Wed, 02 Mar 2022 14:11:14 -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=AQ+0vGNm; 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 S231669AbiCBKAL (ORCPT + 99 others); Wed, 2 Mar 2022 05:00:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233044AbiCBKAL (ORCPT ); Wed, 2 Mar 2022 05:00:11 -0500 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1FD85469E for ; Wed, 2 Mar 2022 01:59:26 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id p4so771633wmg.1 for ; Wed, 02 Mar 2022 01:59:26 -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:from:subject:to:cc :references:content-language:in-reply-to:content-transfer-encoding; bh=mGjgjuJagPpDvHFPLswTGe/gvNp6BgBi52/QqsLQeJk=; b=AQ+0vGNm+zvi6vFj0EvBj/kvCv9mTd2H8P9exSay8pjcA8cbqDrMbmOkTRK/hI4TYh jmVJnHEchXT7cGH0AuR70QWcXOCf7s8gNb4P7+W3B4xUswQLax6gCU8VUH3/d0HGk7Jr lEEEhu/dXxXLbxeNgxMIczy9naQT1SRTpRDY8uLDhr9NG2D0V6QJYTdjJm+OJtMXzbwz us3e02mRhd2mE3VzitNOstPUfNWrIW5QwH1GXb2aKgy4L/xXbT5IvBbxWo/jFxsarPzi FUrb5umabPCyQjZgcUthKL8twhUK74F69V8PA0cMsKzLs5bjwq6uqNcRXKW17xbKgfKQ UJZw== 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:from :subject:to:cc:references:content-language:in-reply-to :content-transfer-encoding; bh=mGjgjuJagPpDvHFPLswTGe/gvNp6BgBi52/QqsLQeJk=; b=gI6nbREQhrjPqmvsyu859ehqBm2lp0EL0mOYNArMsICqsuNSmbCil5ekBcJIGYEUAK GhXuEw33xRGuwIyMUYsXCE+bnKz7UdQsiF1/dgmFpKFYVw6b36noFaqhTUOqm7IlfW6H 0AsqMhF2hOb2DnVyXEVg6kM0vj4jWqcRSdn714HSBriJxepl1T+MU9NzCa12uFII5kzo sqRnis8AxK3s/JAHNgtO2GMQ6odi049+nCQVD/+ljd6FGw+BtTH2TBgvtcdctm+vzFA3 M5YjkL7hE/Pf69iwNaotQHa0uNoQhhHDSGxzjPfspRXBX17wteUtoIISDDblFNlODYwE L4Nw== X-Gm-Message-State: AOAM5333LRr1eUu1Il6gBB4r7/6LK1E0wGrxrpu6EAUbKpIswz0c1i0r Eh7CSWCvURDo7IxeRx/Lz9Er+airq/0= X-Received: by 2002:a05:600c:3203:b0:381:b544:7970 with SMTP id r3-20020a05600c320300b00381b5447970mr5100314wmp.144.1646215165490; Wed, 02 Mar 2022 01:59:25 -0800 (PST) Received: from [192.168.1.10] (4e691f2a.skybroadband.com. [78.105.31.42]) by smtp.googlemail.com with ESMTPSA id p6-20020a5d4586000000b001f0436cb325sm1127234wrq.52.2022.03.02.01.59.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Mar 2022 01:59:24 -0800 (PST) Message-ID: <7e8834f3-5f7d-4c14-a913-d036957bc81d@googlemail.com> Date: Wed, 2 Mar 2022 09:59:23 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 From: Chris Clayton Subject: Re: bug kernel 5.17, qualcom and intel adapters, unable to reliably connect to bluetooth devices To: Luiz Augusto von Dentz Cc: Chris Murphy , Bluetooth , regressions@lists.linux.dev References: <17f2bf7e-1d6b-e090-8926-21a408f2b496@googlemail.com> <16cac2c8-c1ca-c8d7-e3d9-5f00be511614@googlemail.com> <6b17bdb5-dddb-e7c7-86f6-2240c6523a81@googlemail.com> <032917a9-0c14-16d3-2751-945b9cd766a3@googlemail.com> Content-Language: en-GB 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, Good news... On 02/03/2022 06:55, Luiz Augusto von Dentz wrote: >> >> Looks like I was able to reproduce but I still don't know the cause, >> anyway the symptom is the following: >> >> [23412.856410] remove_uuid:2273: hci0: sock 0000000049dcd70a >> [23412.856467] mgmt_class_complete:2174: hci0: err 0 >> [23412.856470] mgmt_cmd_complete:176: sock 00000000d63e046a >> >> It looks like the cmd->sk is wrong/corrupted, what is even more >> strange is that the socket pointer does seem to match previously >> connected MGMT clients and after a few attempts with btmgmt> power on >> it does come back to life, very bizarre... >> >> Can you try to enable some kernel debugs before you start bluetoothd: >> >> echo "file net/bluetooth/mgmt.c +pfl" > /sys/kernel/debug/dynamic_debug/control >> echo "file net/bluetooth/mgmt_util.c +pfl" > >> /sys/kernel/debug/dynamic_debug/control >> >> Maybe that should give us a clue what triggers it. > > Here is an attempt to fix the problem: > > https://patchwork.kernel.org/project/bluetooth/patch/20220302064351.225212-1-luiz.dentz@gmail.com/ > > Also it probably make more sense to test with the following tree since > we are using it to push regression fixes: > > https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git/ > I've cloned bluetooth.git, applied the patch and installed the resultant kernel. I've booted into the kernel eight times and on each occasion , my bluetooth devices connected successfully. Additionally, I've the latest updates from Linus' tree into my local clone and applied your patch to that. That too has resulted in a working bluetooth service. Thanks and well done to you and your colleagues. For the patch above: Tested-by: Chris Clayton >>>>>>> >>>>>>> -- >>>>>>> Luiz Augusto von Dentz >>>>>> >>>>>> >>>>>> >>>> >>>> >>>> >>>> -- >>>> Luiz Augusto von Dentz >>> >>> >>> >>> -- >>> Luiz Augusto von Dentz >> >> >> >> -- >> Luiz Augusto von Dentz > > >