Received: by 2002:a05:7412:bc1a:b0:d7:7d3a:4fe2 with SMTP id ki26csp556421rdb; Sat, 19 Aug 2023 12:57:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFG6YEbTHDbg6Mm7EV08wV919mTeee1D1oz9ihpWpmH8sGNt6pVIykrzGL+9brwx6dUIf+B X-Received: by 2002:a05:6a00:1348:b0:687:2f80:86d5 with SMTP id k8-20020a056a00134800b006872f8086d5mr2593090pfu.13.1692475042554; Sat, 19 Aug 2023 12:57:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692475042; cv=none; d=google.com; s=arc-20160816; b=YtmtxKdDSJ/qK9+wFoHVlK6TOvIwYxZZgrKUEhsfrcw0yknyl/Vax7R34zjGQg3A+R QjYoZIVi+/Km68p5oYkJ0Mpdbp3Gj5hNoFO0S++A9F9H6hH6hjQvOkdAH/v13YrRfEG0 myUKARUa7BVVJvREcVHLfBjMEv6RniO6mei2WJ+kYg4hBILsakjWKibubmI8NgMGjO6h r7SlecRLEmp5K77a/Zfv30ZzZuzN8zIWGet3gQ8xhwxJcN7BpdxMJHS8CwnW/fKdwQVK 0KrbQO/Cc2hy1cdWZrjpxvDz9QgivDeb/eC8jh7fUfwheXQ20Xq9K6oiJgwOwT7wZU3t H8pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=J8AkT+XbMJGmmldcsgFM4Bvk9OwSgkiuO67EBOYO4IE=; fh=V2LL5OuZUBGeSu6TXDWykcThOoazTGUpkln19rrO2KM=; b=APeTH3mdhJtPnJ+JcHq7qV8PjlUfuWwVltW/xBQ4riCfKBJGygUzcOyIBGc/4a0QjV cRr0aJOk/HhcT9HYt/jYIZbQZUiiSt6PWX5AtzMnKQccFrC675Yt6wdHcO4FFPYhTtuz 5U6sffJCsk8XUcQqYeLayVIGFOU22wuap+muGOlsvHsmaXZP0JZ+878+PgTHzAcmYrsN BiIHVc24kXEdEnN/gVB9p7+7iwYepkxU81z5aV+XgVFx6cpNtMm+i6xDrIjTJP7W2prz ED6uNFcMMsYG/ZAG2SkE7z0QXBH5R/MmSzw6xllKwzkv+kJDfuLMjiTuAKxR5edG93e+ M1EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=TWMP1DqG; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id p20-20020a056a000a1400b0068717cf7f22si4046233pfh.31.2023.08.19.12.57.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Aug 2023 12:57:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=TWMP1DqG; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 639148CA88; Sat, 19 Aug 2023 01:38:22 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355789AbjHQWli (ORCPT + 99 others); Thu, 17 Aug 2023 18:41:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355799AbjHQWlJ (ORCPT ); Thu, 17 Aug 2023 18:41:09 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA513B9 for ; Thu, 17 Aug 2023 15:41:08 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1bc73a2b0easo2862445ad.0 for ; Thu, 17 Aug 2023 15:41:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692312067; x=1692916867; 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=J8AkT+XbMJGmmldcsgFM4Bvk9OwSgkiuO67EBOYO4IE=; b=TWMP1DqGB+srh6q1mQCPqtGU+bCT6x0QqjlYsFMwo6253Sgmif2Fok9zXliO/pGyx9 2FcKAoq0BcATAuwc3IlOunNA9eVrfEge9JB56Sm2ZYAn4+7AZ7dy1CCNyN6bI30GIuTH +g2Zjum1Vf7rJQf+oR5dsoecOz6ROX6eW0Cqn0lMvw7fzdLSr2iR67JnLim+uGs8rrGQ /TeNsGIbJEYUpcgA+5eg5qqz6cqO6X/DDmxsr5CUEqxkzJQ4wV+UGRe/w+3PA6GH4+A2 uB995fI0780DXhin9kky3P8ovZn0cLDc8oGHi4L5gI+7diJYXy+lvkgdOA7QLKb8TIxJ V7TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692312067; x=1692916867; 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=J8AkT+XbMJGmmldcsgFM4Bvk9OwSgkiuO67EBOYO4IE=; b=TeH4P9sFB9boA8eIJ2Gv2xFu9j4gyMgKXOUB6lgd8RGp8z01n67SLQeriXWbLcgBh+ uAbeTjoPpBbuimJmSTvdJkE6qMs6qUhtdFL0almD8lwgQmOmz73Gg474DXggANN8V+V1 5JbfmnFuYQI0hQrA1K/scjhJ94WSz2pDL1+Xc2Kpg4x9+qX6B3Spe0va+ASqyPDDXvBD tRWCsljJsHUBxACl2bDqSAAgxVdxtGV2OCXgiYz5yWrVHkHPsK0RSMTeGPHEcNB2ppcg x1xKZyBQn41qZF57c1DEMkYVJZU8kXkTt7VHd4gGY2bT5Mc/xqLugP+9or8KMKhWQ2IZ 1mIg== X-Gm-Message-State: AOJu0YwAx/vFxUStEbx984ZEoyFi90CM80f3Jw1xpr1W94UczhbDMu7a lM5zdl5vyA/FOwmdq1Oe4y6sSi8c61Q= X-Received: by 2002:a17:902:d486:b0:1bd:bba1:be78 with SMTP id c6-20020a170902d48600b001bdbba1be78mr831561plg.23.1692312067438; Thu, 17 Aug 2023 15:41:07 -0700 (PDT) Received: from lvondent-mobl4.. (c-98-232-221-87.hsd1.or.comcast.net. [98.232.221.87]) by smtp.gmail.com with ESMTPSA id iy20-20020a170903131400b001b89b7e208fsm281877plb.88.2023.08.17.15.41.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Aug 2023 15:41:06 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ 2/2] device: Restart temporary timer while connecting Date: Thu, 17 Aug 2023 15:41:03 -0700 Message-ID: <20230817224103.3042055-2-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230817224103.3042055-1-luiz.dentz@gmail.com> References: <20230817224103.3042055-1-luiz.dentz@gmail.com> MIME-Version: 1.0 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, RCVD_IN_DNSWL_BLOCKED,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 From: Luiz Augusto von Dentz If the device is temporary restart its timer when attempt to connect to it since it can interrupt the connection attempt prematurely while it still scanning, etc. --- src/device.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/device.c b/src/device.c index f6b0167bf55b..9b58e0c4e6c5 100644 --- a/src/device.c +++ b/src/device.c @@ -5754,6 +5754,10 @@ int device_connect_le(struct btd_device *dev) /* Keep this, so we can cancel the connection */ dev->att_io = io; + /* Restart temporary timer to give it time to connect/pair, etc. */ + if (dev->temporary) + set_temporary_timer(dev, btd_opts.tmpto); + return 0; } -- 2.41.0