Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp133933rwi; Tue, 18 Oct 2022 15:17:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6HaoE6ty6R9psV4e8zVmaMOA+nEakWFIGYSBmVPEbtklDbIu8MXq+6DZncxFXIMKFfOEdD X-Received: by 2002:a63:54b:0:b0:464:8e6:11e7 with SMTP id 72-20020a63054b000000b0046408e611e7mr4530623pgf.212.1666131439683; Tue, 18 Oct 2022 15:17:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666131439; cv=none; d=google.com; s=arc-20160816; b=Qi5F7cPvoqCPT6J8JICxycvtpVQq/SK5rHhZ51MazcXkNIVoB3MQbz061qqk7sERM3 y0Jr80zyJ92IiVGYZWTAnDGD9PGYKUw7nuJt2yiqF3yJ4iOhW51NxejspTaMS8LUQ/fm SpuC9lTrH8dPDYog7LWVdIIkvqN6PtBz+LV+CELq3eISyeffNkuqg+izqyrEL+4B8FmI 3O3PgcIp8fObbpv8Mo4bqwWXU3gDS/sjFJerF4gCjCcjMfwz3qC6b7PK8q5aCCyKrEde HI+G6BYx0oeU+JuTjgyigC17yMmQKgysAHZ5D2EuTKj+G3OWv1LVP4Y7s2tns14lduw3 c85A== 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:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=mJICzRHpo/InYiWtJTb9YBEZ99DH0FQgMyLbWgRHe6E=; b=O8o4HQz0p3Kad4J6eephtwWSi69XPfw6bx/MBtA7oA9d7GhZrRjcyAS79VRIJSbFUz e5NUO8U7kTfB4yqUqyE2u2WlfVt/IzOWQA0a7+Usqu/PkfIPB4SOIzPGag5mYxihxvqJ rH6lbX8U3gEjvkI/fJTBNr410gscdVAT3/HcbIwDRD5grBe5twVclLkSKYJuxZVTqkxd UrpFc9TiPZJpG+k6fStiZ1hZ1Ibi25N3IyLzp/6SlU0qPaBnKOy7PkLLLomCAq3sIiK/ aRHnFM9PD1bytSF6mCh6khWrrTWe2aiLLp+7bRUBZYJwI/e1vKEOhrM6cG9wX53Hu30J AH3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ptHyTeeT; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d9-20020a170903230900b0018532e03614si18259523plh.470.2022.10.18.15.16.24; Tue, 18 Oct 2022 15:17:19 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ptHyTeeT; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229832AbiJRWCo (ORCPT + 99 others); Tue, 18 Oct 2022 18:02:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229753AbiJRWCn (ORCPT ); Tue, 18 Oct 2022 18:02:43 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C897EBE525 for ; Tue, 18 Oct 2022 15:02:42 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id o20-20020a05600c4fd400b003b4a516c479so13332253wmq.1 for ; Tue, 18 Oct 2022 15:02:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=mJICzRHpo/InYiWtJTb9YBEZ99DH0FQgMyLbWgRHe6E=; b=ptHyTeeTr+MqF19rUyiyqHrnTwxRsIVb7e2HLXR1bjGBUcgRiS65umxizwlDHfZOLt j9/FRNF9wkfixcQ6kE9ak2ak7vvdzxTTEPDvKkJDgrF/jCMM/msDEo+OYgFoXiBPFg6x 5QYqz1ryo9qEy8rcCIndMSEZAZUDt4cxLnNVqRRsyaur2+nm8jFTEfdp0SK2duLYOXb6 UM/lvAH9e2936bLqF54VGxJq4GeRpbhPkkxMu9+Wpl7PJ4fMcGpQyR9hTXWbCB9dbCAI AuSGgLY3fADV4jR5wTKqodtByiZQ0bSiyl/EreEKllu4H2nWZxyBAPLEeFWOBJPdr1GN xOyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mJICzRHpo/InYiWtJTb9YBEZ99DH0FQgMyLbWgRHe6E=; b=04gOGCW8/KsKpUU4cgqlwh2jdSPEtQlXQfOZtaG+f6I3DRuFyVROFWqHNEzf/+u0TV qzALkRy8vjwSCXBObTCXStXSK6pwbEsZGfSs/AQBoV9FoXp6r81gA6746QxGLW5UpoDW bfLge1TOIyQMfMHO4zRGvgpWCMz82YqsVHP7n/FT9loZOS4Wdnz9cGecv+3abrI5e1GI j4/+I+5LsgE7M+v+zf6b7F0YMQb7iyfkE/fFMiEtYOMZhm2MZEAeZZxygNtkB7HHDkEt D00L2S45P1prCvxS5ILzzTL4ihxBz4bj4/OpEzBKst/xZHs6Fhk35mPMQ/rhuLBUtruv 99bQ== X-Gm-Message-State: ACrzQf2cfcCdtVJ6xb7Ybh+TjquJzz3G0WE3ZlJ5iW62rgrUo57iGlkj xcFsM7TEJZYMX89jl5vNnuU= X-Received: by 2002:a05:600c:4e8a:b0:3c6:de26:9d6e with SMTP id f10-20020a05600c4e8a00b003c6de269d6emr3503034wmq.117.1666130561220; Tue, 18 Oct 2022 15:02:41 -0700 (PDT) Received: from [192.168.1.8] (67.227.121.78.rev.sfr.net. [78.121.227.67]) by smtp.gmail.com with ESMTPSA id g5-20020a5d4885000000b0022e55f40bc7sm11892846wrq.82.2022.10.18.15.02.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 18 Oct 2022 15:02:40 -0700 (PDT) Message-ID: <28551f84-eff3-74fa-b17c-cfa16b027280@gmail.com> Date: Wed, 19 Oct 2022 00:02:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.2.2 Subject: Re: [PATCH] Bluetooth: hci_conn: Fix not restoring ISO buffer count on disconnect Content-Language: fr To: Luiz Augusto von Dentz , linux-bluetooth@vger.kernel.org References: <20221017224147.3629459-1-luiz.dentz@gmail.com> From: =?UTF-8?Q?Fr=c3=a9d=c3=a9ric_Danis?= In-Reply-To: <20221017224147.3629459-1-luiz.dentz@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 Hi Luiz, I tested this patch and I'm not able to reproduce the issue after applying it. Tested-by: Frédéric Danis Le 18/10/2022 à 00:41, Luiz Augusto von Dentz a écrit : > From: Luiz Augusto von Dentz > > When disconnecting an ISO link the controller may not generate > HCI_EV_NUM_COMP_PKTS for unacked packets which needs to be restored in > hci_conn_del otherwise the host would assume they are still in use and > would not be able to use all the buffers available. > > Fixes: 26afbd826ee3 ("Bluetooth: Add initial implementation of CIS connections") > Signed-off-by: Luiz Augusto von Dentz > --- > net/bluetooth/hci_conn.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c > index 5d6ee5075642..df914f521c9d 100644 > --- a/net/bluetooth/hci_conn.c > +++ b/net/bluetooth/hci_conn.c > @@ -1067,10 +1067,21 @@ int hci_conn_del(struct hci_conn *conn) > hdev->acl_cnt += conn->sent; > } else { > struct hci_conn *acl = conn->link; > + > if (acl) { > acl->link = NULL; > hci_conn_drop(acl); > } > + > + /* Unacked ISO frames */ > + if (conn->type == ISO_LINK) { > + if (hdev->iso_pkts) > + hdev->iso_cnt += conn->sent; > + else if (hdev->le_pkts) > + hdev->le_cnt += conn->sent; > + else > + hdev->acl_cnt += conn->sent; > + } > } > > if (conn->amp_mgr) -- Frédéric Danis Embedded Linux Consultant frederic.danis.oss@gmail.com