Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp447886lqd; Wed, 24 Apr 2024 07:13:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUUhsydVN+iv01jBSOhSh9z/DejuzGMq/Icoz7zPMw9X+J6Dli3u+vSvukPp555OSutRkCCPxBZdIsIeESLsNfWXckoVP9cAUG+eSvq3g== X-Google-Smtp-Source: AGHT+IEhS1f3IdyQGzpvdiCmvSPvNZSiIzDQOsGUpzQBotTcekro1CqEAxu61rSgtp1tUp0xhfQH X-Received: by 2002:a67:f847:0:b0:47a:22cd:9716 with SMTP id b7-20020a67f847000000b0047a22cd9716mr2441022vsp.17.1713968036009; Wed, 24 Apr 2024 07:13:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713968035; cv=pass; d=google.com; s=arc-20160816; b=RtYV9Zx7pZE94cXuFPRNKZ2PLmwdf+fGLew+zVXhwNPV15f7xMYQcvYJNaWIuly/so J5jNDsC2My6x4NiLyU70+FLGJXUgHwujbcvts/u5SrQJPy2hiWZ1D6r8ClK9w3rHuKPU egVNQpX44xNS2kHgSB5N5l+pWur8pX9f6GfjccD9aTM6Xph8ogBxOoRORuIoSkdH7t6f O8f8xvv+AeDRGbVw8xEfGlLQgDtoB89SlGxgZ0uOl2QGa/dZNGYwPAB07kb0SXPXkobk OqCJb2MscPb8oF7WlxjPbqRmNqJ5XY6AeQqM0mzl/kEASp9M6kxRwtRZLeKiypqoRLrg SQ1w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=wJBJqLj3luQtICC7HbLENL7aD8rF4I14ro+UfbritHQ=; fh=W/rI5Eyqh7rvvqw6pufF4YVdkCNXnHvs6gEFtz5Kbzc=; b=x83d43qUtYNualNHrKwBGQARZsSPM1Gai25jDWGhHXRSROx2on9TfXpt9Dfy7kCIg/ LhH0lOY/PkZXcAzKHhmtVinHmW+4BUaFfgsrw2I6Z3Ltb0YptLmkK841gt64lQSNRUo5 Bq2pUZStUsWLpXENH9w+KPJjgl6kCDbPaYLnAOpceDNuxUqtwAD4LEcr5X69BMMlRFGs +BF703IB+nPllqGa4x4VbEKWTSCVgGNo3ZbSEqrNZrIMx40FLJ4CgWRmD+kWrEtSROj4 CJ73uRW6T4o2Y9UEcl48HqvUqyQSWWvLWCyWvsorJKx8LLn9QfFeZAgjyuF7C1mt0ui/ mlvA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=molgen.mpg.de); spf=pass (google.com: domain of linux-bluetooth+bounces-4013-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4013-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id dd9-20020a056102568900b00479c45b2f53si2850408vsb.801.2024.04.24.07.13.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 07:13:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-4013-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=molgen.mpg.de); spf=pass (google.com: domain of linux-bluetooth+bounces-4013-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4013-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 375FB1C211F3 for ; Wed, 24 Apr 2024 14:13:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 04D3015E7F9; Wed, 24 Apr 2024 14:13:48 +0000 (UTC) X-Original-To: linux-bluetooth@vger.kernel.org Received: from mx3.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7601C15B0E2; Wed, 24 Apr 2024 14:13:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=141.14.17.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713968027; cv=none; b=oxsHbw/3Czyrap1sWMIonLPyWZR/MJUF3HylDo9uwNRiqTiNmPgkIZPJhJ4RxdLj2ok4jHO5BcN+QKsyorc+9Azz9BOQ2spoA+E4tA1OyTAxdRZ30Awc7cS425AaQI7LtQT5kXHCXL5Cdx/ihaEWkfGLUCeNaKdunYf7Cnx98hg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713968027; c=relaxed/simple; bh=cRbX4fFdqq6ANBfeAy8HYW0knzfPEAqtYyQ9SIFo+K0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ElQd9iPqr5p+CjNvJ7T/lSlERn3XitNIqvTMB7tP2fEbH7a8chE81qVeJZJPfmkvtNEUPop5G8EJ/pHUQPn+hNwfSqohU2Uv1jdqElXXDxaPHvG7lL5N9kU1kTj4R64PtkeyIhSzkMbzgwyBopRW/8EzJkSZi+gspKiquGvOh60= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=molgen.mpg.de; spf=pass smtp.mailfrom=molgen.mpg.de; arc=none smtp.client-ip=141.14.17.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=molgen.mpg.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=molgen.mpg.de Received: from [192.168.0.6] (ip5f5af5d1.dynamic.kabel-deutschland.de [95.90.245.209]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id AF4A061E5FE06; Wed, 24 Apr 2024 16:13:09 +0200 (CEST) Message-ID: <0391b306-1368-47ea-9602-26ff6df48921@molgen.mpg.de> Date: Wed, 24 Apr 2024 16:13:09 +0200 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Bluetooth: hci_sync: Using hci_cmd_sync_submit when removing Adv Monitor To: Chun-Yi Lee Cc: Chun-Yi Lee , Luiz Augusto von Dentz , Manish Mandlik , Archie Pusaka , Miao-chen Chou , linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org References: <20240424135903.24169-1-jlee@suse.com> Content-Language: en-US From: Paul Menzel In-Reply-To: <20240424135903.24169-1-jlee@suse.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Dear Chun-Yi, Thank you for your patch. Am 24.04.24 um 15:59 schrieb Lee, Chun-Yi: > From: Chun-Yi Lee Please use imperative mood in the commit message summary: Use hci_cmd_sync_submit() when removing Adv Monitor > Since the d883a4669a1de be introduced in v6.4, bluetooth daemon > got the following failed message of MGMT_OP_REMOVE_ADV_MONITOR > command when controller is power-off: Maybe: Since commit d883a4669a1de, present since Linux v6.4, the daemon bluetoothd logs the failure below, if the command MGMT_OP_REMOVE_ADV_MONITOR is sent when the controller is powered off. > bluetoothd[20976]: > src/adapter.c:reset_adv_monitors_complete() Failed to reset Adv > Monitors: Failed> Please make this one line and indent it with four spaces. > Normally this situation is happened when the bluetoothd deamon 1. happen*s* 2. d*ae*mon > be started manually after system booting. Which means that is started > bluetoothd received MGMT_EV_INDEX_ADDED event after kernel receive*s* > runs hci_power_off(). > > Base on doc/mgmt-api.txt, the MGMT_OP_REMOVE_ADV_MONITOR command Base*d* > can be used when the controller is not powered. This patch changes “This patch …” is redundant. Use: Change the code … > the code in remove_adv_monitor() to use hci_cmd_sync_submit() > instead of hci_cmd_sync_queue(). Please document the test setup. > Fixes: d883a4669a1de ("Bluetooth: hci_sync: Only allow hci_cmd_sync_queue if running") > Cc: Luiz Augusto von Dentz > Cc: Manish Mandlik > Cc: Archie Pusaka > Cc: Miao-chen Chou > Signed-off-by: Chun-Yi Lee > --- > net/bluetooth/mgmt.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c > index 32ed6e9245a3..21962969411d 100644 > --- a/net/bluetooth/mgmt.c > +++ b/net/bluetooth/mgmt.c > @@ -5475,7 +5475,7 @@ static int remove_adv_monitor(struct sock *sk, struct hci_dev *hdev, > goto unlock; > } > > - err = hci_cmd_sync_queue(hdev, mgmt_remove_adv_monitor_sync, cmd, > + err = hci_cmd_sync_submit(hdev, mgmt_remove_adv_monitor_sync, cmd, > mgmt_remove_adv_monitor_complete); > > if (err) { Kind regards, Paul