Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2345217pxa; Mon, 24 Aug 2020 11:29:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzg0PRi9kDg/FP6/zzoUjKwDR63lbtCHraPo4qVX/bAQNujBVdDERUi9m80WmFnxQyoq7Z1 X-Received: by 2002:a17:906:2349:: with SMTP id m9mr6707836eja.425.1598293785496; Mon, 24 Aug 2020 11:29:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598293785; cv=none; d=google.com; s=arc-20160816; b=HgHcIVq6b/e0wrOD66fm6c/J+bpErmzEtsrEKhv4HNahKftBpvCE7KYaEUuetQsZR/ 3paB8jvSR8IofC9VyoO+3So9Mh+2/tdqu8fPBErD+gJMRjEKEbndRb+hKd4DAO2DETXa u7+qpi970sxn9s1+TT7dn95wM2cxr1pZdyKEJCxXDu5NEDi6xACkFuSyiydRxcNs2VoH Ic0kRfdhoCp+6vHRM4pQtGxyEXcfsJxsxdNOvXa5QtwmSJikVe3XbbP8BnmqgGHoFlMH k7r31IyxNm3KQxGCEsxUe+nMWwUAvnpWpsZPyM/ZWpCXUEnn/te1onh54eQ5Idk+TdWN Omqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=F1XFwEzoiD+SioB0C34JWH1YNNT6L1PvGIichsFvB7Q=; b=y5p5XvcAaKt119Ht7qLzYPhrhVQc+2UziJ4g6eAM4afDwPQTDdOFdRecpHNxahTS1y iuCcUyrVfBZzxMBAvTYcFkTHrqriRts+IDeYj8HyzSyFwr5sOCLVu/+CLuyEPQ9TTIQA /o1jfzr96tTndyuXhQCUC8VS4fbVc92Ys5GbkcBUS16u4NpsbComKVxIRZR/fp9ZPfmo HiWwVwbpSSXcQ+LYFSgs5KPOfAgy55Q4fzlE+syRStB3Rw36lPo4F+11YDQnNl3owhAi 5fnKZZpmxa9AR44xgZTZJWwjt8uCf+mXrf6pNvw/QV01Xc7dKi1ah7/+UZd6SfQoZCqW ox2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=GISbxeCQ; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ck20si3525757ejb.15.2020.08.24.11.29.20; Mon, 24 Aug 2020 11:29:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=GISbxeCQ; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726504AbgHXSY4 (ORCPT + 99 others); Mon, 24 Aug 2020 14:24:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725998AbgHXSYz (ORCPT ); Mon, 24 Aug 2020 14:24:55 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70FB3C061573 for ; Mon, 24 Aug 2020 11:24:54 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id d26so3051618ejr.1 for ; Mon, 24 Aug 2020 11:24:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=F1XFwEzoiD+SioB0C34JWH1YNNT6L1PvGIichsFvB7Q=; b=GISbxeCQ8sn95jeTrha8+Hwmr5DQAquFgSUijv7NmkaRKVQkWlvsSdEq4coGS386bI qk9umOqcH2bFwmBeiqb1UkqFwrQ5AcmfUp0ASytqy1XpH7nNrHVIrNielTLTO2g/O7M0 aKMkE+KKDHe2upF2G0YFSSXnuiO6Y1HkKH0QVzYPNv8jvwmI6Nl8aXWylDnAl02ptuIA 5SPUBL9r4vKXQfA2g3AjTKbaatwgSYvvDgZYtk1btTyBzrtzdvIMCh3QEu4EqVSC+EVI A5wVJ4P32P943aU3HvbUuZ0Rpc26le8wEntyKWC3h/iZQGgynfYDGIFQhL/rZW25wuSG amKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=F1XFwEzoiD+SioB0C34JWH1YNNT6L1PvGIichsFvB7Q=; b=YnSLEVcq2bePKH2vm/izF317nKlAiTNBJ1TlTzexb7Fxxbh8t0Mv8dZxHun0xGSTlP jFL6m0BJzQ3z2FIPYwQOCybpYtOfabuHjh+pdkgnc3i5/QL5M4s6lKBvOs8P+CBkHxko bsM13VNvCIOc8HB87YPVEymP8ZdfN/uyyoTc4AMINKZoVO7AhEJGKY9pz4KZB251Jtwu JJnInAuJtmYxgOp+K0bDsDjmnSQ6+IjbJXdpeiNwIXXWRzINGS7GpuQY96miyiv8nID8 /Iza0bO5DElTdrqS4WVeGEGOH3IPRPt/xCzhY7RuliORPLodtLK7SEmDJDwHEecIms8i oQgQ== X-Gm-Message-State: AOAM530sV/8Sx4gmBCzAGKvcZg8aMXodMx51insXYMwKYGi8UOt9aMBZ ce1yj0EGgdnU+mIBg5kO7Zzy+e9fiHcTbp0/P12XMA== X-Received: by 2002:a17:906:560d:: with SMTP id f13mr6613583ejq.102.1598293492732; Mon, 24 Aug 2020 11:24:52 -0700 (PDT) MIME-Version: 1.0 References: <20200817135606.Bluez.v2.1.I21d21871d85db48b07ba847742c7cb933024307c@changeid> In-Reply-To: From: Yu Liu Date: Mon, 24 Aug 2020 11:24:16 -0700 Message-ID: Subject: Re: [Bluez PATCH v2] adapter- Device needs to be in the temporary state after pairing failure To: Luiz Augusto von Dentz Cc: "linux-bluetooth@vger.kernel.org" , ChromeOS Bluetooth Upstreaming , Sonny Sasaka Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Luiz, I just sent another patch to address your comments. The issue this cl is trying to address is that when we pair a device by calling pair_device, it removes the temporary flag very early on, then it the pairing failed due to reasons such as failed to connect the temp flag won't be removed and the device will be hanging around forever. Please review again. Thanks. On Mon, Aug 17, 2020 at 4:24 PM Luiz Augusto von Dentz wrote: > > Hi Yu Liu, > > On Mon, Aug 17, 2020 at 4:04 PM Yu Liu wrote: > > > > This caused the device hanging around as a discovered device forever > > even if it is turned off or not in present. > > > > Reviewed-by: sonnysasaka@chromium.org > > > > Signed-off-by: Yu Liu > > --- > > > > Changes in v2: > > - Fix title length and format issue > > > > Changes in v1: > > - Initial change > > > > src/device.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/src/device.c b/src/device.c > > index bb8e07e8f..93e71850c 100644 > > --- a/src/device.c > > +++ b/src/device.c > > @@ -6008,6 +6008,12 @@ void device_bonding_complete(struct btd_device *device, uint8_t bdaddr_type, > > > > if (status) { > > device_cancel_authentication(device, TRUE); > > + > > + // Put the device back to the temporary state so that it will be > > + // treated as a newly discovered device. > > Use C style comments /* */ above. > > > + if (!device_is_paired(device, bdaddr_type)) > > + btd_device_set_temporary(device, true); > > Hmm, are we perhaps removing the temporary flag too early? Or this is > a result of calling Connect which clears the temporary flag? Then > perhaps we should at least if the upper layer has marked the device as > trusted as it should indicate the device object should be kept even if > not paired. > > > device_bonding_failed(device, status); > > return; > > } > > -- > > 2.28.0.220.ged08abb693-goog > > > > > -- > Luiz Augusto von Dentz