Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9944442imu; Wed, 5 Dec 2018 13:05:02 -0800 (PST) X-Google-Smtp-Source: AFSGD/VHk+gAHat4194oEIsLIAo5+vrvy9NhxrW0uyOUbez9JNK49adJcZnAuSFpO9FJTgIB4Qn/ X-Received: by 2002:a65:5387:: with SMTP id x7mr21951895pgq.412.1544043901534; Wed, 05 Dec 2018 13:05:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544043901; cv=none; d=google.com; s=arc-20160816; b=Q/3Y3uwHxWZyb0alPuxXq1nQ0sWuYfgQ4C19TWqCYvmwTGSx03iJ/YZPLF5CjtFHge VBOIK143nMDeOlWKzZkjawYIB++WuRv5DPyAH0iRiYCqSm+9l8ZWjEFF5ShA/6KLjhBM zkyIbTfh9COe2Ou7y0NyFcdLmvAaakUdnTbyGGFO9Jjcs4rikV4/9K0sqHrfr+Nj6UQb TxBfjtRojQk/HXgIXSGD8HK9VcSHQsLVPr7LQV+yK+wdeuXZHlsVUAdxkX7Z9HaPHtOv 3szgXYMKuvVfeaVqc0r0fAKFNNa3n3xmdWofPFOKtkXXz1eMWoyqr5xo1Lh5pEUoiRhW 49kA== 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=wwo+jIYKP7C5hWO7DECuRD6cJfAzfJY78lElOPiyfN0=; b=G88d4vG7uUQP2vu0K4w5t4SWIwmKVbfh9ESgeNuIoYh2+LogLw+yTgFUIKQjkESNgz FdSfFZnQbaLyR9auddLdfmwGmQnAXUtN4j9eyUKBrr+JWw/GCUdbEBwvsghH2Qazu5dI nTFSt8OnO/5A910mHc/22daPkytqM5WeDTxDk5u4CrBR+4sgkCKYsfeJD7ygBnv+FZMt JOidPpFrSbUTZweCfusLVZTWGZo8EU3pBnBHb18z4rsAJVy1XohqnyCeR2fWodtynLU7 BE07sqvKulShBA5f3D9Q9TWbirGHH/0wA8koLBJwtpAnkuN8knzr/zSFZ60fsESR6tpG XbSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 14si19721796pgo.511.2018.12.05.13.04.46; Wed, 05 Dec 2018 13:05:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728554AbeLEVCd convert rfc822-to-8bit (ORCPT + 99 others); Wed, 5 Dec 2018 16:02:33 -0500 Received: from coyote.holtmann.net ([212.227.132.17]:48500 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728356AbeLEVCd (ORCPT ); Wed, 5 Dec 2018 16:02:33 -0500 Received: from marcel-macbook.fritz.box (p4FF9F1DE.dip0.t-ipconnect.de [79.249.241.222]) by mail.holtmann.org (Postfix) with ESMTPSA id 2513CCF35D; Wed, 5 Dec 2018 22:10:07 +0100 (CET) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.1 \(3445.101.1\)) Subject: Re: [PATCH] Bluetooth: hci_bcm: Handle specific unknown packets after firmware loading From: Marcel Holtmann In-Reply-To: <20181205194538.8074-1-pawel.mikolaj.chmiel@gmail.com> Date: Wed, 5 Dec 2018 22:02:30 +0100 Cc: Johan Hedberg , Bluez mailing list , linux-kernel@vger.kernel.org, Jonathan Bakker Content-Transfer-Encoding: 8BIT Message-Id: References: <20181205194538.8074-1-pawel.mikolaj.chmiel@gmail.com> To: =?utf-8?Q?Pawe=C5=82_Chmiel?= X-Mailer: Apple Mail (2.3445.101.1) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Pawel, > The Broadcom controller on aries S5PV210 boards sends out a couple of > unknown packets after the firmware is loaded. This will cause > logging of errors such as: > Bluetooth: hci0: Frame reassembly failed (-84) > > This is probably also the case with other boards, as there are related > Android userspace patches for custom ROMs such as > https://review.lineageos.org/#/c/LineageOS/android_system_bt/+/142721/ > Since this appears to be intended behaviour, treated them as diagnostic > packets. > > Note that this is another variant of commit 01d5e44ace8a > ("Bluetooth: hci_bcm: Handle empty packet after firmware loading") > > Signed-off-by: Jonathan Bakker > Signed-off-by: Paweł Chmiel > --- > drivers/bluetooth/hci_bcm.c | 32 +++++++++++++++++++++++++++----- > 1 file changed, 27 insertions(+), 5 deletions(-) > > diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c > index ddbd8c6a0ceb..ae271836dc26 100644 > --- a/drivers/bluetooth/hci_bcm.c > +++ b/drivers/bluetooth/hci_bcm.c > @@ -51,6 +51,12 @@ > #define BCM_LM_DIAG_PKT 0x07 > #define BCM_LM_DIAG_SIZE 63 > > +#define BCM_UNKNOWN_PKT 0x31 > +#define BCM_UNKNOWN_SIZE 0 > + > +#define BCM_UNKNOWN2_PKT 0x34 > +#define BCM_UNKNOWN2_SIZE 0 > + lets use BCM_TYPE49_ and BCM_TYPE52_ > #define BCM_AUTOSUSPEND_DELAY 5000 /* default autosleep delay */ > > /** > @@ -561,12 +567,28 @@ static int bcm_setup(struct hci_uart *hu) > .lsize = 0, \ > .maxlen = BCM_NULL_SIZE > > +#define BCM_RECV_UNKNOWN \ > + .type = BCM_UNKNOWN_PKT, \ > + .hlen = BCM_UNKNOWN_SIZE, \ > + .loff = 0, \ > + .lsize = 0, \ > + .maxlen = BCM_UNKNOWN_SIZE > + > +#define BCM_RECV_UNKNOWN2 \ > + .type = BCM_UNKNOWN2_PKT, \ > + .hlen = BCM_UNKNOWN2_SIZE, \ > + .loff = 0, \ > + .lsize = 0, \ > + .maxlen = BCM_UNKNOWN2_SIZE Same here, BCM_RECV_TYPE49 and BCM_RECV_TYPE52. > + > static const struct h4_recv_pkt bcm_recv_pkts[] = { > - { H4_RECV_ACL, .recv = hci_recv_frame }, > - { H4_RECV_SCO, .recv = hci_recv_frame }, > - { H4_RECV_EVENT, .recv = hci_recv_frame }, > - { BCM_RECV_LM_DIAG, .recv = hci_recv_diag }, > - { BCM_RECV_NULL, .recv = hci_recv_diag }, > + { H4_RECV_ACL, .recv = hci_recv_frame }, > + { H4_RECV_SCO, .recv = hci_recv_frame }, > + { H4_RECV_EVENT, .recv = hci_recv_frame }, > + { BCM_RECV_LM_DIAG, .recv = hci_recv_diag }, > + { BCM_RECV_NULL, .recv = hci_recv_diag }, > + { BCM_RECV_UNKNOWN, .recv = hci_recv_diag }, > + { BCM_RECV_UNKNOWN2, .recv = hci_recv_diag }, > }; > > static int bcm_recv(struct hci_uart *hu, const void *data, int count) Regards Marcel