Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp135288lqp; Thu, 4 Apr 2024 08:54:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUfHrBNMGsgEv1k6kiIa3VVaKdjWrRki3iGNeotiSCiGC2weJywLu2P76FGDl0vP/j3Z/KOVMxfK4GTRRZa+V7GEkdPHDJCJ6oEhKpFmQ== X-Google-Smtp-Source: AGHT+IE4w8Vt8tfiQ45fCHNBXHbzJIGVInjasxDrUaofBRDKA4iKyFANxSzgAjXUsptiIwOSm0hi X-Received: by 2002:a17:906:f154:b0:a51:8c2f:8151 with SMTP id gw20-20020a170906f15400b00a518c2f8151mr1723424ejb.21.1712246091145; Thu, 04 Apr 2024 08:54:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712246091; cv=pass; d=google.com; s=arc-20160816; b=c5Vglm7iGfK2pWVzn4hT9A7b6hX4OOxXTDwYqdFv+x2xCpl4YeJZif1FMKZ50s/h5Z lyJqKW/4maVcQsUK1//yxPRaci6ZLIKi+00kZwmJX1LfyllzOkkhC0vNGMlTfEXxmXYa SPI0J/EZPotsdhiMmFSsaWl0UmBDXv8QWTHxer9vtaLY5xuHLowrYhUVPJvc1uV83GV6 uamU1tA0dH5lqQhPQ2TI+3qIMciJZp8gaY4u3YWsP4RiEOO9shTEKratZlxjFIiKlV6F K/bjYj9bWRGG5IBKArgkXqNftwiw0eUe6caK82l2xXmUIx2SEfd9shZ0hT4Pxpbq4bXF RCEw== 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:dkim-signature; bh=Ju0RF6fCDt1S6BXVvNREcbGXDh3w5GKGLzMzqkDRpHE=; fh=v4Z3N2Htbr8NtGqMLkQjkIE/EbeUcf6lhEWEAm07n3g=; b=QwBX0jjxB7zzIqK77HqMfqQVqcghrLMuocI1xyKLk40hLeu5u4Q1eAAZ30gulJX7lF qdiQHmNxvYy1d8fLIFURUGXwyPL9myL4CXEYqBMxThiR7gzmimncfnRgtIHBj7/jdEz0 C2SMGCRfdQVBJIP+W8MvAQwzRWqMFJTyyJyarxUAS6CnoDkBp0bSiYGL5rUyeK4aqwi4 kzbAVTryeMbvUorBOI+DfQLPWQjmeE292a1LIMwVwrysLQgiygRD+CPQ/frWaiUX/x7L ckZe4nE+UIYrHntysgMqqeF4222HR2otzp8BLoWNbxu9c4stkQ/tJ3maYJGsV5rPBSsZ Gmgw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="A5/nvNnX"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-bluetooth+bounces-3209-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3209-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id z1-20020a170906074100b00a474a4c6081si7589988ejb.173.2024.04.04.08.54.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 08:54:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-3209-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="A5/nvNnX"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-bluetooth+bounces-3209-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3209-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 7BAE21F22C09 for ; Thu, 4 Apr 2024 15:52:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5EEF012A16C; Thu, 4 Apr 2024 15:52:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="A5/nvNnX" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6790D224DE for ; Thu, 4 Apr 2024 15:52:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712245947; cv=none; b=CfNkpPBj8gRJWKAVhdO+wdOenUp/R5fg58U12Rf72/39LyS/CNhF4fbrmsGpDaKDYbi5jQrOL86ADWNsPUF3+2ZsBIdIfZjv6ZDJfteXYXFKaOl5vLp4mppE7yJnO6DunttGnBNyYaSDZF2dakhtUxnpbhWN725L7WS4kc1RdTY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712245947; c=relaxed/simple; bh=7x5KEa7CpZWISbyrkqpdO1t3M4Ne/wFNTbZ5iZlru84=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=RJ+5cMqDk5AhG+uHXFLvpHu5ayF8l4UpE82/paR77DTSeyKAbEuXhOEEEzv+S3FAkbnG9QShWmGzF7XGwsAbddM5Fv1eLrU0bL6Jbl2Wwm3Ec69Z3jP2231OWA8AFjGFvfVCWeDx3rfuwnV8JdOyDwY+8SY0yXlP7XgbW3ZQXyE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=A5/nvNnX; arc=none smtp.client-ip=209.85.210.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f194.google.com with SMTP id d2e1a72fcca58-6e46dcd8feaso580179b3a.2 for ; Thu, 04 Apr 2024 08:52:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712245945; x=1712850745; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Ju0RF6fCDt1S6BXVvNREcbGXDh3w5GKGLzMzqkDRpHE=; b=A5/nvNnXSWJ+ZAl62TLrs4ZrhXdyeQtksmLtSCejO+x81elpFwvqGeQ/eki4A0P/s5 AXREXgjHC3876dPpvX52sNw0yTHC2W0PwGpJdFxemLf1gGVHAaToOsf/8zKH0M8SL2q9 ezEHuiXafFtHCb0kUROERxNj1xYdmcsavxf/CSVeTlgWzZKwP0MLgCqnzMWKXl1kpl7y AXYdZ2sFXM6eXzZ/X/5PCUzCXOZtE1lCn564n1oLeQLgmK9uJvUfCyfI558JToGcdv25 O1QwLbe6V3IagkNRYhONVBAaSuD6NfH4wFxdWJ7T2KDUpbDzOtRYxC2XkZhl2aqgV8xB hAKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712245945; x=1712850745; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ju0RF6fCDt1S6BXVvNREcbGXDh3w5GKGLzMzqkDRpHE=; b=GJ78C5MbUI9mYRCkI9JExVU3JyEe/8Oiky8EwrdLC/1QGJ2b7XCyRHN1YQfolGfQN3 IxJCbYd2IZIKgtSrWfET+6hYSmu7zMwvdniMzcj8S23a5meBmOwGwxzYOfsvkTW1W5P/ 6RlnwJqja7QbcfBXbZS+BZC2ouSsWdEu5/egjttGBwDjCISL5wfvWZPaCgX9tDmu9NJj JRvDlrjHoBD1FwnsxzDQsMLcZEP5XKEzTxRd7sGXgz2uP3Zi3ugUDptHN2ikIDbxBRW/ +BwMW0rTD7tmfmsxZ2CUo0Xi1ksn09RniYU/tZkkBBkYv2dOQpEqxE+CzVMb5Lc4N49p 8hKA== X-Gm-Message-State: AOJu0Yza7iDs9yZN/OKWORtC+vv5hbDa6JO2DWXfWVTs7Tgv6Y4ozwql EBqF9JAW8ma6pR++VM/QeHR5ZLQZ4i2GpdPJMmjfbsIFgfEihQsVZimpfSMWRtkV8nMl X-Received: by 2002:a05:6a00:1816:b0:6e7:b3c4:43a4 with SMTP id y22-20020a056a00181600b006e7b3c443a4mr3125626pfa.25.1712245944807; Thu, 04 Apr 2024 08:52:24 -0700 (PDT) Received: from ?IPV6:2600:3c0a:e002:7f00::1001? ([2600:3c0a:e002:7f00::1001]) by smtp.gmail.com with ESMTPSA id z185-20020a6265c2000000b006ea80883ce3sm14278516pfb.133.2024.04.04.08.52.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Apr 2024 08:52:24 -0700 (PDT) Message-ID: <0f681858-fe53-4964-82f9-5f3c3ee903e3@gmail.com> Date: Thu, 4 Apr 2024 08:52:22 -0700 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 BlueZ 1/1] Refactor btd_device_is_connected To: Luiz Augusto von Dentz Cc: linux-bluetooth@vger.kernel.org References: <20240403205252.71978-1-dimitris.on.linux@gmail.com> <20240404024521.120349-1-dimitris.on.linux@gmail.com> <20240404024521.120349-2-dimitris.on.linux@gmail.com> Content-Language: en-US From: Dimitris In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/4/24 07:59, Luiz Augusto von Dentz wrote: >> diff --git a/src/adapter.c b/src/adapter.c >> index 4bcc464de..0b7aab4b5 100644 >> --- a/src/adapter.c >> +++ b/src/adapter.c >> @@ -7486,7 +7486,7 @@ static void adapter_remove_connection(struct btd_adapter *adapter, >> device_cancel_authentication(device, TRUE); >> >> /* If another bearer is still connected */ >> - if (btd_device_is_connected(device)) >> + if (btd_device_state_is_connected(device)) > > Perhaps btd_device_bearer_is_connected would be a better name. Thanks, I'll rename. > I guess the problem is that some service is indicating it is still > connected though? Newbie question for sure, but: As this is happening in the code path for "disabling bluetooth", shouldn't services already be disconnected here? D.