Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp384524rdb; Thu, 1 Feb 2024 11:11:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IFlCtqM6EnMR48U2yARWK/ybKKZferHV3qEvf9b9zrMATIeAq3CHR2EzrljNUAlDFheva+8 X-Received: by 2002:a37:ef05:0:b0:785:3f72:e22d with SMTP id j5-20020a37ef05000000b007853f72e22dmr4072664qkk.1.1706814670049; Thu, 01 Feb 2024 11:11:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706814670; cv=pass; d=google.com; s=arc-20160816; b=daJhO622+NeaPnkg1bZClureA52lV0BXobzvnHv1AG6FpXPPj0eFZRIUr6gvk/ocnC G3xhBPBh0jf3N6Xgd0Oy//m3CFnygBu61JcpOUQTmNfcSYIinbQ4sVhdfLCQwELBvjg8 6zUbr6TkWiQLG3UlsIBzVf9UQ9zeNTh0czqCZCl8LHtb8SyGutiLvyofrrqO+rxdO/SV WKS+q7LDBzG13ZKEfd305ASAYrp0107LmVYm8UyZ5vg5L1jK/QV08Dx3Ze+u3SjW59Xr EYgU1eW2cBb97UMluPyB4av2zUhXkjKmOQMT9aGNwDG848ynuLSJMmr2FGfCcZVLYIA2 r1OA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=+HC5SdNvCWeKEwtYq4o6Mizban1zGXB05RzkUe4htxw=; fh=deEAX4K+qlzO9BcgVTlPqJhSCWrxQb5U70vE8hCiEwE=; b=vdDJzHjQM14kQ5DlI0tTMZ+2R/j90lRkw3Rn371xKfMe8qhy2uzn8uiNydJlzR3FcK nPBn/IaqqgobI+jwJCg4gcm4oXyifndDCBKyhTg5WfXL620q8J8TpApTFjfpGGRYIQEw RfkjPe/GorlGmISt47qN5aW+krJIPpB+KkT3h/CD7bVoDhvBDnUXCNuOZS/W48Xj6VyW KqAJv13jbA+xWQ8+n1F1Ha2WcsqxkPOsDUwYxg97e+c5Jtr9LJOdw4mYYOAb9VMhJP36 6Eots9vIfhSW0VrWkto5UU9WllAxSwBrsYTAhP20Y3QVcRvz6wNnjMGTD1MP1TXeqQK7 ANRw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=azBpCr1o; 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-1542-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1542-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=1; AJvYcCXi1DJySXEJULfUIPOKfewbyPCio0Fz4DFaENlBCf7jS1eMNK4Aj2wgHFTVqIvv/7ztcfu/TIad+gTxX7rbg9b7tfU8yQ9ZPQG04ojP5Q== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id wg20-20020a05620a569400b00783f03395b2si202148qkn.31.2024.02.01.11.11.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 11:11:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-1542-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=azBpCr1o; 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-1542-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1542-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3D7FC1C24F5E for ; Thu, 1 Feb 2024 19:10:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BAC5885298; Thu, 1 Feb 2024 19:10:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="azBpCr1o" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-oi1-f181.google.com (mail-oi1-f181.google.com [209.85.167.181]) (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 C843185292 for ; Thu, 1 Feb 2024 19:10:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706814625; cv=none; b=Ak/3+HOL7+fyunPwIqYHQMFl2Zz9VaaOoO2NMNWAv9vP+etr8gw1yuFz0XkchOBN5yvyl63hIV1Bb21ll3R0NHsGajsDGaAzo4MnG87j0sMUzkRXrYY3aMek7TZPDIW+kEK1MKaPUfnJpnPSlTFOJc7nap8i4uD3FF5ryKWfvYs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706814625; c=relaxed/simple; bh=J/kS8l2g9RZhxNAzKJ52nEU68D48vn31wNKus36nRsc=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i8xYQS6JQuzG/rlKrCU+VT6T8zuqWkrZwavTKNd6qiLpD0BBAqgXDipn2GM6qo8ArBBwF1gLnCW6VyNqCp8P3izBRQ1s4rfLK9L9Z+EgMMw/hjmOmJTSSxamIXxFY5hkIcc76McRzWbOvQLo4ykjDmYwG9Zyht/GxWdicg3H+Vo= 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=azBpCr1o; arc=none smtp.client-ip=209.85.167.181 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-oi1-f181.google.com with SMTP id 5614622812f47-3bda4bd14e2so1030180b6e.2 for ; Thu, 01 Feb 2024 11:10:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706814622; x=1707419422; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=+HC5SdNvCWeKEwtYq4o6Mizban1zGXB05RzkUe4htxw=; b=azBpCr1o8HtVe+YGe0BcKXnahnhYWC5bDFUZ+Lt4BGHReI6LL7Fimxr4nP9wVowlFq HxQWSyeyNqg0914yU1FAVvvwCnsLQrdBAtZlnG/SuJAuJ2ae0tsfG2ct8C9aEj56Y0OU ydANONblHKbo56h1+EGAhW/wEerNdZjGsh9FcusCsZdKF+7G55cxdzBfwTRbzO9qlYgg BU7TcKSea7hMCN2sEmMIOLxVRwe7z6cH0Mgz8BfzzLRHkpY7YBMizTwMmguI0A8kVJKb MvbZ8gmF1I825UJD9uTusRUXsSmLMI5cyTpuURM3SiIKKE+pbPMzXfcg4uI8jEbj8nao pvOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706814622; x=1707419422; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+HC5SdNvCWeKEwtYq4o6Mizban1zGXB05RzkUe4htxw=; b=mlAJapBMZjxCJ/asEL9XOSTZeQXVdIKqzLsQdVsNOlM6Feo6yGBE+3c8rwze7ikPg0 n2A7CnRJNXgKzTBa+WqzPQefSNO5NQgJYXPnPZOkidJEwGWFFTsYLRGhzOzfaWmkWkRp F95Mf/1PLidMswxWzLeMyLalj4Ebwia0kkzA1ZOxLF4QOinM4w8MofnRfTAyxl7wnIL7 zrATbK0UsUGOsbIGL/rohi48f1CiNWvHw+B7Z/ldiVEj0B2bocC/KRAa9guAiIRwIP/d qAtizBfZ/9E9P6/D2t8yjjDbLQgLqGzbhMaDR5JAb/MNhMa/eSNdvDr0JyEbtMq1uLFP aBaQ== X-Gm-Message-State: AOJu0YwH2VSjFpGejnZLrVlh3uDalewuRgr/nUKR5tYdf7TyXWgemtZU IVUGtzHS2M1fsIelcQzHTK68DdVEAKo1pNruA5mXr24bxvEo+GclIiF5tbr/ X-Received: by 2002:a05:6808:178d:b0:3be:aed3:5d84 with SMTP id bg13-20020a056808178d00b003beaed35d84mr7102627oib.26.1706814621780; Thu, 01 Feb 2024 11:10:21 -0800 (PST) Received: from lvondent-mobl4.. (071-047-239-151.res.spectrum.com. [71.47.239.151]) by smtp.gmail.com with ESMTPSA id db16-20020a056130239000b007d2e2f14bd4sm35912uab.29.2024.02.01.11.10.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 11:10:20 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v2 3/8] device: Don't remove object if a service is connecting Date: Thu, 1 Feb 2024 14:10:11 -0500 Message-ID: <20240201191016.1122194-3-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240201191016.1122194-1-luiz.dentz@gmail.com> References: <20240201191016.1122194-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Luiz Augusto von Dentz If a service is connecting just restart the timer to give it more time to complete the connection or disconnect. --- src/device.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/device.c b/src/device.c index afd073c6c2a5..1db96d9a672c 100644 --- a/src/device.c +++ b/src/device.c @@ -3276,6 +3276,13 @@ static bool device_disappeared(gpointer user_data) { struct btd_device *dev = user_data; + /* If there are services connecting restart the timer to give more time + * for the service to either complete the connection or disconnect. + */ + if (find_service_with_state(dev->services, + BTD_SERVICE_STATE_CONNECTING)) + return TRUE; + dev->temporary_timer = 0; btd_adapter_remove_device(dev->adapter, dev); -- 2.43.0