Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3938497pxf; Tue, 6 Apr 2021 04:16:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8tG9GEqaOlj9Jx/SF7W5DXpNnUwEEsS0YG2kaZMww3RxBmZW+rJRUK12j4HAxxTCzpi3/ X-Received: by 2002:a17:906:1984:: with SMTP id g4mr5651836ejd.525.1617707813326; Tue, 06 Apr 2021 04:16:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617707813; cv=none; d=google.com; s=arc-20160816; b=evxjVrFUtVDqFUb19DFAB7JdecW880B0kDQ9nTsZybtyFL4uxEdXIS16e/VD6PqvVH sxdLNcQBQKfWL9mSaqGCrgJzsVedSCtc4GSkb8WzUe1A+TLAuuhZkcOYj8mY8j4bu7Ui 50m4TauPVHwPLrwLTxXQUgbxFrUnnq6hYjD4Fu31Y9XGQLbE9QOHYLCVNvOtzkMqcKWS uskTnobVmsA+a7TV96Pt3FFPqmEXim7yAtjep2Vi0S2IYi0Lc+EZuRIM4FokXmRkqrrL nKZfhWcYIDVxhCM5n1172RFpobv9jpDDmzDXdbVu/ecIoKeutW2FqQgLRO/+hsTV+4m7 sScA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=iix/v2cJC9b8/wrwd7EH/KvNJQF53WPoD5HVyQhNhJI=; b=Tbzhk6W4P+aor0+QHCb+7Y+dxHXtoaeUiQWfL3UGpQbZj7+ztvdMGlEwrJ+VvpcbMZ 7ANX1CqU1CVRyzMRLudFiXx+MJZ/vxjy44+q6EHWbJOQ7QjpI+6AN4teek3PZLCWuZZ9 YI5Mc3rGYGAYfwCjCgwI5oFQ34mHF0vuoovnCmNhzzAf9LEONrQEmRykUZqzM7ruerho dcGkp1yYmh3Qbh5FJ21AA0mshS0NF6I3leIWRcpetUPIOHaX7UzEJ5aFNNMTkLigz9p5 5fBEUab1XybrOZmjkmdYDyIUpRJjTQ75mEj/kA+sriqFoD6DicjGYS/GZymheskncj+U WjbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=PWuWgElM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 h8si3312215ejc.580.2021.04.06.04.16.28; Tue, 06 Apr 2021 04:16:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=PWuWgElM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S241595AbhDEXdd (ORCPT + 99 others); Mon, 5 Apr 2021 19:33:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237964AbhDEXdc (ORCPT ); Mon, 5 Apr 2021 19:33:32 -0400 Received: from mail-qt1-x84a.google.com (mail-qt1-x84a.google.com [IPv6:2607:f8b0:4864:20::84a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8250CC061788 for ; Mon, 5 Apr 2021 16:33:25 -0700 (PDT) Received: by mail-qt1-x84a.google.com with SMTP id d18so2151475qtn.16 for ; Mon, 05 Apr 2021 16:33:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=iix/v2cJC9b8/wrwd7EH/KvNJQF53WPoD5HVyQhNhJI=; b=PWuWgElMYtHYjSyuGEO6ucZsbDjGBg7VQEFwyAtX2nPGC8Vq0mnFEpGdifIavZomsW KtYUty/PgMrBszumWX5Pd9hQlLOcqfnC4nJ/k8VozzFM3wf46mfWNmPTIWz8RVbmz7j/ 0TIOT5d5MM+uLoK/sdcUVoK6bC99T8N66r9Gb80vAkxpLFpsa7eBWKTawWBNroI9dD3H ol/+q4GLB7tapCPX0l6i2ApVWfZ4sSLvDRba62WcQV05+Hc8/2NVGMSxl1BqzsB4aOKy JK3xNkaun8XA2gHy64xxqFfD2EhkIMLAcgv+S7TgLbhzHkvdSJEIKamhFa5bSiX9UGze 0VwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=iix/v2cJC9b8/wrwd7EH/KvNJQF53WPoD5HVyQhNhJI=; b=FxbLEWQjlBsc41G764a/c/o3OCXIEccdWVF3/MmCz3iR+8wRDZiYXoXm7AhqJqAhxS SDtpu44eqZ5Z2GQGUIRf3eqLC5bgeyHXJ8RgryU44U/l+lUi1ZcryGsZQ4TEPGvEKHfJ d0Gg0ijri54JCdTroqxRXEeNAJl4paVPYKFrROtV8VaImUc2UF2TKN8iCUppY4+ZvHOx fuldFfH/ZBeNj3KTivELV4zzpz8jQVMTsjgY20goWIM9aZEFyqGqmDpBlkm62umcR9XU CpPaoHgGpYr/MwnbYTxY4QCQlVTo41RcqtF60jWSIHswIPTOc1xOjYODmVy/AQ/Lskra 8KKw== X-Gm-Message-State: AOAM532luJfL9EDr7j8G3jwp58xdhbCah6GcTJ/yYgnJ12vxckEwThrb azU/MIIiOmR8g6ul5S+kpXgYBGTqillkqOE/CVP6 X-Received: from danielwinkler-linux.mtv.corp.google.com ([2620:15c:202:201:1cb3:ad22:2ed6:7c62]) (user=danielwinkler job=sendgmr) by 2002:ad4:5593:: with SMTP id e19mr14604643qvx.52.1617665604297; Mon, 05 Apr 2021 16:33:24 -0700 (PDT) Date: Mon, 5 Apr 2021 16:33:03 -0700 Message-Id: <20210405233305.92431-1-danielwinkler@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.31.0.208.g409f899ff0-goog Subject: [PATCH 0/2] Bluetooth: Avoid centralized adv handle tracking for extended features From: Daniel Winkler To: marcel@holtmann.org, linux-bluetooth@vger.kernel.org Cc: chromeos-bluetooth-upstreaming@chromium.org, Daniel Winkler , "David S. Miller" , Jakub Kicinski , Johan Hedberg , Luiz Augusto von Dentz , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Maintainers, This series addresses a race condition where an advertisement registration can conflict with a software rotation advertisement refresh. I found that this issue was only occurring with the new extended MGMT advertising interface. A bad use of the hdev->cur_adv_instance caused every new instance to be immediately sent to the controller rather than queued for software rotation, opening a path for the race to occur. This series improves the way new extended advertising hci callbacks track the relevant adv handle, removing the need for the cur_adv_instance use. In a separate patch, the incorrect usage of cur_adv_instance is removed, to align the extended MGMT commands to the original add_advertising usage. The series was tested on both extended and non-extended bluetooth controllers to confirm that the race condition is resolved, and that multi- and single-advertising automated test scenarios are still successful. Thanks in advance, Daniel Daniel Winkler (2): Bluetooth: Use ext adv handle from requests in CCs Bluetooth: Do not set cur_adv_instance in adv param MGMT request net/bluetooth/hci_event.c | 16 +++++++--------- net/bluetooth/mgmt.c | 1 - 2 files changed, 7 insertions(+), 10 deletions(-) -- 2.31.0.208.g409f899ff0-goog