Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1395139pxk; Sun, 13 Sep 2020 00:49:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyb/KD4YwnWasY+G+OvByU4pKpbFoGtMOlVlJnp9p9SwedrXryNaqDno9883jPGa9qo+0er X-Received: by 2002:a17:906:f11:: with SMTP id z17mr9546198eji.88.1599983367896; Sun, 13 Sep 2020 00:49:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599983367; cv=none; d=google.com; s=arc-20160816; b=erU7G2cvfgDK/0AV2JT0NYFMbR5LS8TsyGk+F3nRL4c5nVq7rHVrp1iorinMwbkRQV BYv98Y8D4jwB3456oMzZOJDscnJu8jQuc588uD97RTYmLMn7iz0K7GESjFbaKfrc0bTU put3zUFK8e6ywMc+gLK2Ap2QElaXLfo2N1RYH7Cq/Nn8hGpteutjX0BLQndrvi/0XEFJ Bgbdp0bMZOKg6yQMFK2+ER59PAITj2D1UcSnBdIGMNQt5q+ecuvFD3n7qgXGSIDCaElL U1nf6kMComekQsje6SJQoBolqq954VclMAcYMU4mpQj275/IqeDeirmS94BakS0P6IJI 85cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=tNNVpOHv1eu5v5F6pKrvMENokLOY57F9HhR3KnfqRuA=; b=W1kKS0NhUd0A/54s3E5YbstyCMDLzjj3dD4JuPOGQ0IxbQqpj6WGUI1VSmCS9JgAMF Oo1onMDxgxbHThPf1hl7VBFmgqxd+kUGKWGfk5oiAoluJhSh42jafALzKhffBVHpYiuR MVTxVv0rKIxTnqeZ3JQEJpys6KfY25lmqtmsn56ZWucZOs7KVdFOkeFW1pUmGBxQwP4L NWcZ+PfuhAr0aa73mUtkM2t7wjaL0VcpbRMIvJd9HMnFiPPfLbKbDOSkV2+08hFP6XWj XpBGiefKJCN+en6E5jTNChKz87L5cbuNYYXLoSrN8h930VHPOL63yG+DgChnCgY7fpHP hpTw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x9si4949209edv.540.2020.09.13.00.48.48; Sun, 13 Sep 2020 00:49:27 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725913AbgIMHsb (ORCPT + 99 others); Sun, 13 Sep 2020 03:48:31 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:35942 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725899AbgIMHsa (ORCPT ); Sun, 13 Sep 2020 03:48:30 -0400 Received: from marcel-macbook.fritz.box (p4ff9f430.dip0.t-ipconnect.de [79.249.244.48]) by mail.holtmann.org (Postfix) with ESMTPSA id 9362FCECC4; Sun, 13 Sep 2020 09:55:24 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: [RESEND PATCH] bluetooth: Set ext scan response only when it exists From: Marcel Holtmann In-Reply-To: <20200911153141.RESEND.1.Ib022565452fde0c02fbcf619950ef868715dd243@changeid> Date: Sun, 13 Sep 2020 09:48:28 +0200 Cc: CrosBT Upstreaming , linux-bluetooth , Daniel Winkler , "David S. Miller" , Johan Hedberg , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jakub Kicinski Content-Transfer-Encoding: 7bit Message-Id: References: <20200911153141.RESEND.1.Ib022565452fde0c02fbcf619950ef868715dd243@changeid> To: Abhishek Pandit-Subedi X-Mailer: Apple Mail (2.3608.120.23.2.1) Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org 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. Regards Marcel