Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp92449pxj; Fri, 7 May 2021 04:34:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzn6OhJBo9lyb1MCQSzwdg9Z21Tu+GdME1pRmfIpuiNo4jpjCG8eq1uN1+2iS41ysXfCmyU X-Received: by 2002:aa7:de8b:: with SMTP id j11mr10881296edv.363.1620387248071; Fri, 07 May 2021 04:34:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620387248; cv=none; d=google.com; s=arc-20160816; b=GAgDrxDGZlWWMJdUlqWvpTLz+NomQ0QHcNn8iS6OQb1HrPp/MRjwhKZZzliEU8xSH8 P0KdraT1+hbgPu1EDjmpECi6BH5Uc6g9ufGn2MpcYIzEVbFnuH0QeXN7kBS7/PNdy67V v/83Wo1SjBuaxKxUgawmtlRv3tUbMX2E9iOPa7C9VNL8+d3uj6aq+E+Aw5ELearIeIjE JXt950FyxfU9GInIjbHt72RzKcgbnSuzkjeWLMKBbmjIrOYlZUBASUV3JtWe9ZIaR22f iR156vPViVHRKHEHgRpsnVfxJZcYl9d8urLXrVb7eftUFvoq6TCzCbx1U5Z4bldMCoau Wi3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=EfYUpV9D8xtt6CkgdJKx/nwVmD+w8NyCBDqRbIH4UjQ=; b=rE4rsKJxq+51ClRnqNbLdgf10r6Okbdi2yRN0bKq7mPbm+iNqNQcLKc73bZj4iMGwI gEf6rEtoPAcjyLuo9SsyKvKuOuKiF4RHrkyalxYEA9zfH+m7nyB0pa4jUwX+Nb3i3XzG hQA0JwPafEULlwgT0gI/Yq287zgumy50i3rGYX5dbJzJ2aP9XLvKMs2HAsGmyJUeI6gD o/BaE3ZCJ5vWEQrqokyplysiq4Va0Jj36c5HFXX71tqAfhPM/mjhV1avfbN8AXt4PPbB t5RY3xk7JYGshJiBHDvcYUyDmfzyoFxvN0f7zpSPDqZxQkaMmg9ZUin6b47QE6c0OOr5 pnmQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gv3si5260840ejc.220.2021.05.07.04.33.43; Fri, 07 May 2021 04:34:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236272AbhEGIc5 (ORCPT + 99 others); Fri, 7 May 2021 04:32:57 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:57013 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231675AbhEGIcy (ORCPT ); Fri, 7 May 2021 04:32:54 -0400 Received: from smtpclient.apple (p4fefc624.dip0.t-ipconnect.de [79.239.198.36]) by mail.holtmann.org (Postfix) with ESMTPSA id B836FCECDB; Fri, 7 May 2021 10:39:42 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.80.0.2.43\)) Subject: Re: [PATCH v4] Bluetooth: Add ncmd=0 recovery handling From: Marcel Holtmann In-Reply-To: <20210429102415.v4.1.I14da3750a343d8d48921fffb7c6561337b6e6082@changeid> Date: Fri, 7 May 2021 10:31:51 +0200 Cc: Luiz Augusto von Dentz , CrosBT Upstreaming , Bluetooth Kernel Mailing List , Alain Michaud , Abhishek Pandit-Subedi , "David S. Miller" , Jakub Kicinski , Johan Hedberg , open list , netdev@vger.kernel.org Content-Transfer-Encoding: 7bit Message-Id: References: <20210429102415.v4.1.I14da3750a343d8d48921fffb7c6561337b6e6082@changeid> To: Manish Mandlik X-Mailer: Apple Mail (2.3654.80.0.2.43) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Manish, > During command status or command complete event, the controller may set > ncmd=0 indicating that it is not accepting any more commands. In such a > case, host holds off sending any more commands to the controller. If the > controller doesn't recover from such condition, host will wait forever, > until the user decides that the Bluetooth is broken and may power cycles > the Bluetooth. > > This patch triggers the hardware error to reset the controller and > driver when it gets into such state as there is no other wat out. > > Reviewed-by: Abhishek Pandit-Subedi > Signed-off-by: Manish Mandlik > --- > > Changes in v4: > - Update comment in hci_ncmd_timeout > - Add a new inline function to handle cmd_cnt and timers > > Changes in v3: > - Restructure ncmd_timer scheduling in hci_event.c > - Cancel delayed work in hci_dev_do_close > - Do not inject hw error during HCI_INIT > - Update comment, add log message while injecting hw error > > Changes in v2: > - Emit the hardware error when ncmd=0 occurs > > include/net/bluetooth/hci.h | 1 + > include/net/bluetooth/hci_core.h | 1 + > net/bluetooth/hci_core.c | 22 ++++++++++++++++++++++ > net/bluetooth/hci_event.c | 29 +++++++++++++++++++---------- > 4 files changed, 43 insertions(+), 10 deletions(-) patch has been applied to bluetooth-next tree. Regards Marcel