Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp246918pxx; Thu, 29 Oct 2020 01:20:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmIfANbpEjhaFG9ugAGmpqnIhvpvy6Kz+dBNzshywO1XljzAVmOxlHtHAm3ubgdRrLV/oD X-Received: by 2002:a17:906:38d9:: with SMTP id r25mr3101767ejd.8.1603959629419; Thu, 29 Oct 2020 01:20:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603959629; cv=none; d=google.com; s=arc-20160816; b=ZzdXr/olw++rDZDupo86bYGIsQitvU9PXTHZkrmiX+5lz7AHZQTZQnHQ2PyimlvEAD UCUTlg6Ilko3Mn7oZVWb1yNsIIigGBG32b0PKh8ny2z7ETfIuweBvOSSQsRKmbGHn22W 4385kfmCv5H/u/+H9UJ29YRnH+JeBg9cwxgKciaxBNKUDUwJ4GJfUwXwwjXkADIXtVVo k7rXfboJL2cfrIyrZXRqG5LR/9IgU3gHJR0b5tgnQifzuvbVSdYkVavNB7ovMhCFq8aG Vhw3xYuBMAm1qCw/mbxhVuvdMp5sdryelVA5FWui+wBwdac3aPlC7sIk62tHERbRCEYH 6K0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=L9z45DYPQUZKGWrC2dHq+OmefHbukpDU4ATI+T3ojLk=; b=k1jRiSqXtBUemsMX7HZuXlG4mwuRfn/NAh35QxM/bPmC/Ol7V4wT/yDIFcq0yJ2C4A sY0CwaH1cEahGRcc8fToNDKK2pdR6J1uV2hkgtotNu0uNLPlrDH/DF/P5qaBAsq+04f7 amXOLUtn5ktrhpmazNe6iB+XmterQpwr5y3oqUuCVVpWRf9PKASqllbpB/gr8WGRzNOl EHxdfsdacT3jmXfNSbnzwK2Jw7F1Ae6M4sTDGJWSJ4iLSUwlMsp1Ory3IyzZIGD1yHkb jk57Qy+y/1TKaMCg3k49P0gV7Wz4eqq1MMDue5jWAYcztWhFSWTt0AJ5z5hVrCsm2720 8SgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZrI8ZUHj; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j3si1453211edh.611.2020.10.29.01.20.05; Thu, 29 Oct 2020 01:20:29 -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=@gmail.com header.s=20161025 header.b=ZrI8ZUHj; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390927AbgJ2AWg (ORCPT + 99 others); Wed, 28 Oct 2020 20:22:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388922AbgJ2AWg (ORCPT ); Wed, 28 Oct 2020 20:22:36 -0400 Received: from mail-ot1-x342.google.com (mail-ot1-x342.google.com [IPv6:2607:f8b0:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E227C0613CF for ; Wed, 28 Oct 2020 17:22:34 -0700 (PDT) Received: by mail-ot1-x342.google.com with SMTP id x7so884075ota.0 for ; Wed, 28 Oct 2020 17:22:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=L9z45DYPQUZKGWrC2dHq+OmefHbukpDU4ATI+T3ojLk=; b=ZrI8ZUHj2PQOjc1mhlM3zpWI6hp3jGFO3kbmayzXrIyk+2FgXNFuR/ZErFhwvyJ9Hp Mq8GOkagFDHpCcFYBT2StNp8lPUmGdxWKR9Yybd+17f36/cUdpBfMMjPScjso1K1yodG NlcIRAw7E5lNkl0aQX1Rf9nHC47yDB5GtmtAhMxTALpbNIgeJI6dWpI6Y6mMoNA5mmEJ 1XP2lHhK7i8hPyM+Zs3awtjjQtDt0BnzVhz5pVyysGKy3lGh/xOZFZyWlZmano3ERvqb vf+9FXHBIMohsYioAcUrZP8/6Rc1NbkICgpK9TiqlJKt0O6zwV8p280hdjXzERw4K3gQ gRxg== 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=L9z45DYPQUZKGWrC2dHq+OmefHbukpDU4ATI+T3ojLk=; b=LGPQcHHwAtHK1hpuPgwmIhMw/pG/gPmPRMCB4CA83PRYD1ubk7jtStxuLcpBCOYZiR RFlADcVBFgOotbGt+UaSOcwQOMgx+bKlWJP0EhLN4Jx1CJQ81XIW9XJT0TOJQxoN2Z6a p3xHGqzqqbBbz+DkcoXyO0RFiRIfTLW4NYYWmW2xsryc7+U8H6HAh6MIctle9hg5P7xd mj1Sc30+/Vy8v97tBVcJUxiFVa4UuQwlZigulQUkn/u/tOrh5mgcgYf8QTIVmkekoatn yKbxehNkvpkCRi5TNgoR6IqyB2FrY8PtqVcNCNhAd/spAyadxAKj42CD4RIDYAJtkawL FDdA== X-Gm-Message-State: AOAM5310t0QRNqZMfViHbn0jKh0ExK0+iDNBxYsbe6EBBdVVUpIfvzkN yQqntb/O6PkUFF4jux5gniCy7k/2lYYPob6du5lI1yV2lJQ= X-Received: by 2002:a9d:6a0a:: with SMTP id g10mr1399553otn.44.1603930953831; Wed, 28 Oct 2020 17:22:33 -0700 (PDT) MIME-Version: 1.0 References: <20201022082304.31757-1-sathish.narasimman@intel.com> In-Reply-To: From: Luiz Augusto von Dentz Date: Wed, 28 Oct 2020 17:22:23 -0700 Message-ID: Subject: Re: [PATCH] Bluetooth: Fix: LL PRivacy BLE device fails to connect To: Sathish Narasimman Cc: Bluez mailing list , Chethan T N , ravishankar.srivatsa@intel.com, Kiran K , Sathish Narasimman Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Sathish, On Wed, Oct 28, 2020 at 4:46 PM Sathish Narasimman wrote: > > Hi > > On Thu, Oct 22, 2020 at 1:47 PM Sathish Narasimman wrote: > > > > When adding device to white list the device is added to resolving list > > also it has to be added only when HCI_ENABLE_LL_PRIVACY flag is set. > > HCI_ENABLE_LL_PRIVACY flag has to be tested before adding/deleting devices > > to resolving list. use_ll_privacy macro is used only to check if controller > > supports LL_Privacy. > > > > https://bugzilla.kernel.org/show_bug.cgi?id=209745 > > > > Signed-off-by: Sathish Narasimman > > --- > > net/bluetooth/hci_request.c | 12 ++++++++---- > > 1 file changed, 8 insertions(+), 4 deletions(-) > > > > diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c > > index 6f12bab4d2fa..610ed0817bd7 100644 > > --- a/net/bluetooth/hci_request.c > > +++ b/net/bluetooth/hci_request.c > > @@ -698,7 +698,8 @@ static void del_from_white_list(struct hci_request *req, bdaddr_t *bdaddr, > > cp.bdaddr_type); > > hci_req_add(req, HCI_OP_LE_DEL_FROM_WHITE_LIST, sizeof(cp), &cp); > > > > - if (use_ll_privacy(req->hdev)) { > > + if (use_ll_privacy(req->hdev) && > > + hci_dev_test_flag(req->hdev, HCI_ENABLE_LL_PRIVACY)) { > > struct smp_irk *irk; > > > > irk = hci_find_irk_by_addr(req->hdev, bdaddr, bdaddr_type); > > @@ -732,7 +733,8 @@ static int add_to_white_list(struct hci_request *req, > > return -1; > > > > /* White list can not be used with RPAs */ > > - if (!allow_rpa && !use_ll_privacy(hdev) && > > + if (!allow_rpa && > > + !hci_dev_test_flag(hdev, HCI_ENABLE_LL_PRIVACY) && > > hci_find_irk_by_addr(hdev, ¶ms->addr, params->addr_type)) { > > return -1; > > } > > @@ -750,7 +752,8 @@ static int add_to_white_list(struct hci_request *req, > > cp.bdaddr_type); > > hci_req_add(req, HCI_OP_LE_ADD_TO_WHITE_LIST, sizeof(cp), &cp); > > > > - if (use_ll_privacy(hdev)) { > > + if (use_ll_privacy(hdev) && > > + hci_dev_test_flag(hdev, HCI_ENABLE_LL_PRIVACY)) { > > struct smp_irk *irk; > > > > irk = hci_find_irk_by_addr(hdev, ¶ms->addr, > > @@ -812,7 +815,8 @@ static u8 update_white_list(struct hci_request *req) > > } > > > > /* White list can not be used with RPAs */ > > - if (!allow_rpa && !use_ll_privacy(hdev) && > > + if (!allow_rpa && > > + !hci_dev_test_flag(hdev, HCI_ENABLE_LL_PRIVACY) && > > hci_find_irk_by_addr(hdev, &b->bdaddr, b->bdaddr_type)) { > > return 0x00; > > } > > -- > > 2.17.1 > > > > > Gentle reminder. > Seems Many devices are failing to reconnect after every on 5.9 kernel > > This patch will FIX the issue Btw, you should probably mention the commit id that introduced this regression. -- Luiz Augusto von Dentz