Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1504494pxb; Fri, 13 Nov 2020 14:45:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJwPOgm60DEbHplW7SnPBULH0a81gFrIwecKOLDpd44BKr+7TkNhd6KMIBIqOkzlahFN/xUK X-Received: by 2002:a50:b224:: with SMTP id o33mr4831637edd.21.1605307523592; Fri, 13 Nov 2020 14:45:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605307523; cv=none; d=google.com; s=arc-20160816; b=yRCTPtHUpZ78aJnAPkLXeRajW5hKK6t809BagTbQ3rYapYXGTp2gf0bzaWnNOO7wiK S7Q+c4sWcI/Z8KnYU+9Bf1yB+lArwq2VftJfiRugU4wlpOInYnhqIRbBwRP0nLL75w7Z iFRcQQ23xOVzZWh4itbrSxKKdvSStf5cWPLwS7sar+b5qh3GFiMf3HvQriHI6+uKxUsQ 2QeQ/LBy3cwpHtP4wCCaGh2FpUjqg5/Q/d4+fUwIPhsr4MqfUtvG1Y8R/7i23TsRu+2b SOYU3TGQp2ybT7q/ZeoGAHp2DnNaZOYgiAslb3JufQdDDSx8hCNjQQCq7gIPnC9EZP91 gp0g== 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=M+RKsRTfKbrIPE1hDDxEvgt0KtI4mBFpkqDt+GvcZ7M=; b=GS89B15wjIy095mgrArXyCkA0C2+m7iFX6VSPCvXLMEMp80upDrbbRgfH9/bHa6dYI 0v/Bf+V+6d7wyK0wWnRSLkbOQStfNQi8TBxFNgXGK8aLgpSfWLDLERWNnFHunN27KGFR lYxZXyuIiyOxY2CgcapwtjMM67MH2KwM5rJ1F/DBeGZCwQLRSWrYWwipqBLJUlmENIuJ rdJUAN7GMB/T+yJaWnPj7ORE8W4AWFyjo+ZJWgN+S4fTayZIQFxmaivcg+yeqzBwro9Y H3H36AJl3OHWN6BL9ENgb+16Qge665KhHAYJ4HDhYJ5zweGAoX6CkH75hx1ZowfTKj7n iLcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HkjJtPkC; 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 u17si6818639ejr.241.2020.11.13.14.44.43; Fri, 13 Nov 2020 14:45:23 -0800 (PST) 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=HkjJtPkC; 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 S1726064AbgKMWoi (ORCPT + 99 others); Fri, 13 Nov 2020 17:44:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725981AbgKMWoi (ORCPT ); Fri, 13 Nov 2020 17:44:38 -0500 Received: from mail-oo1-xc42.google.com (mail-oo1-xc42.google.com [IPv6:2607:f8b0:4864:20::c42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4DF3C0613D1; Fri, 13 Nov 2020 14:44:37 -0800 (PST) Received: by mail-oo1-xc42.google.com with SMTP id h10so974084ooi.10; Fri, 13 Nov 2020 14:44:37 -0800 (PST) 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=M+RKsRTfKbrIPE1hDDxEvgt0KtI4mBFpkqDt+GvcZ7M=; b=HkjJtPkC9ifnKgdn63sJtfwNYDRr1fgt08qo4uFQgqXO7UlsdDoKw2C+dYMqL29nPR +gjE3TvWcEA80rD0swzAznq3Tb90WsqWz4oNhyDhPjl6uxnrhdCMqwB4n0vv2P/Ywd+B IKOpH/dEsRNPYaGl69HWnH/EBPsUWTOS50r8olocR4XF3GBwF/5scK6GkxlU+u9845FA WY1XCDuXmxoygT8ldcsbA4un3Wm2zv5JLmmb8aPxcvCHPRwJDx4ceTBo465t+ApCPHHH hcckUDj9aZ/ZsnezuQ9mNpaercs9zjOK5r69j6ROWbtXK6NrZHAZHEaNkX9hVsGHFd8y WKVA== 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=M+RKsRTfKbrIPE1hDDxEvgt0KtI4mBFpkqDt+GvcZ7M=; b=mNipxGGSQWUU2hdW9IBPQ4KrkyI4oEpsvZL1m/Ad6BaSnkjI3Yi1bqQPhEQf8/Dj7T w0GLeA3nzx8Q7rtpbXDouVZrLlAlUruKm+QuaesnPLz+mXcDA6JbtECWkta4Ix7BNOSW J9r6xiZWBlLuNPsj3TTCbEUGK/xaynjpNOtQsteSetBxHQsCuTGv+gTmYiOh3bQYVL52 CGCjHtrj+vHUY3Mp6qcTNE1QxTs5r00tJaLAK8VOiyu9KtfvzZiZVYlrH56rxwf/l57B KlI7ZCI7H81rzmfwScflSHKpJbpSSh2I9pUyLnQiANqeZDNia5OxsPGf9E32YP3mq3Sb sGUw== X-Gm-Message-State: AOAM5303FWXq24VZt4GBzfPllXbnXwXowXPZA4/18kJ7Tgcor0BpoaYm VweOSJqVX3uqFl6RIgeDm3qaEDi1J/n+6WEnUao= X-Received: by 2002:a4a:a445:: with SMTP id w5mr3194142ool.63.1605307476652; Fri, 13 Nov 2020 14:44:36 -0800 (PST) MIME-Version: 1.0 References: <20200911153141.RESEND.1.Ib022565452fde0c02fbcf619950ef868715dd243@changeid> In-Reply-To: From: Luiz Augusto von Dentz Date: Fri, 13 Nov 2020 14:44:25 -0800 Message-ID: Subject: Re: [RESEND PATCH] bluetooth: Set ext scan response only when it exists To: Marcel Holtmann Cc: Abhishek Pandit-Subedi , CrosBT Upstreaming , linux-bluetooth , Daniel Winkler , "David S. Miller" , Johan Hedberg , "open list:NETWORKING [GENERAL]" , Linux Kernel Mailing List , Jakub Kicinski Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Marcel, Abhishek, On Sun, Sep 13, 2020 at 12:51 AM Marcel Holtmann wrote: > > Hi Abhishek, > > > Only set extended scan response only when it exists. Otherwise, clear > > the scan response data. > > > > Per the core spec v5.2, Vol 4, Part E, 7.8.55 > > > > If the advertising set is non-scannable and the Host uses this command > > other than to discard existing data, the Controller shall return the > > error code Invalid HCI Command Parameters (0x12). > > > > On WCN3991, the controller correctly responds with Invalid Parameters > > when this is sent. That error causes __hci_req_hci_power_on to fail > > with -EINVAL and LE devices can't connect because background scanning > > isn't configured. > > > > Here is an hci trace of where this issue occurs during power on: > > > > < HCI Command: LE Set Extended Advertising Parameters (0x08|0x0036) plen 25 > > Handle: 0x00 > > Properties: 0x0010 > > Use legacy advertising PDUs: ADV_NONCONN_IND > > Min advertising interval: 181.250 msec (0x0122) > > Max advertising interval: 181.250 msec (0x0122) > > Channel map: 37, 38, 39 (0x07) > > Own address type: Random (0x01) > > Peer address type: Public (0x00) > > Peer address: 00:00:00:00:00:00 (OUI 00-00-00) > > Filter policy: Allow Scan Request from Any, Allow Connect... > > TX power: 127 dbm (0x7f) > > Primary PHY: LE 1M (0x01) > > Secondary max skip: 0x00 > > Secondary PHY: LE 1M (0x01) > > SID: 0x00 > > Scan request notifications: Disabled (0x00) > >> HCI Event: Command Complete (0x0e) plen 5 > > LE Set Extended Advertising Parameters (0x08|0x0036) ncmd 1 > > Status: Success (0x00) > > TX power (selected): 9 dbm (0x09) > > < HCI Command: LE Set Advertising Set Random Address (0x08|0x0035) plen 7 > > Advertising handle: 0x00 > > Advertising random address: 08:FD:55:ED:22:28 (OUI 08-FD-55) > >> HCI Event: Command Complete (0x0e) plen 4 > > LE Set Advertising Set Random Address (0x08|0x0035) ncmd > > Status: Success (0x00) > > < HCI Command: LE Set Extended Scan Response Data (0x08|0x0038) plen 35 > > Handle: 0x00 > > Operation: Complete scan response data (0x03) > > Fragment preference: Minimize fragmentation (0x01) > > Data length: 0x0d > > Name (short): Chromebook > >> HCI Event: Command Complete (0x0e) plen 4 > > LE Set Extended Scan Response Data (0x08|0x0038) ncmd 1 > > Status: Invalid HCI Command Parameters (0x12) > > > > Signed-off-by: Abhishek Pandit-Subedi > > Reviewed-by: Daniel Winkler > > --- > > > > net/bluetooth/hci_request.c | 7 +++++-- > > 1 file changed, 5 insertions(+), 2 deletions(-) > > patch has been applied to bluetooth-next tree. Look like this breaks the mgmt-tester: Add Ext Advertising - Success (Complete name) Timed out 2.648 seconds Add Ext Advertising - Success (Shortened name) Timed out 1.993 seconds Add Ext Advertising - Success (Short name) Timed out 2.004 seconds These tests expect the Set Extended Scan Response Data to be send but it is not and then it times out, the problem seems to be that get_adv_instance_scan_rsp_len does check for things like include local-name on instances other than 0, also we probably need to include some logic to check if the instance is really scannable to begin with. -- Luiz Augusto von Dentz