Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9875014imu; Wed, 5 Dec 2018 11:48:53 -0800 (PST) X-Google-Smtp-Source: AFSGD/WVrzJYb+zejvCzzBoXLUviGLFzX2Ch8BzYTMmfNEuU6OS5deNiUnF0NMFQoiIJtUI9L/62 X-Received: by 2002:a63:8d44:: with SMTP id z65mr21851765pgd.57.1544039332979; Wed, 05 Dec 2018 11:48:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544039332; cv=none; d=google.com; s=arc-20160816; b=WnKVAPHDgHi1cZFzvqW2cljCRus9UK8iCe8ycPLNpOblgepKL3yclMymH2X2L4+xjz qaqzf8OVjA3yqb214bbCrErvauOwq0b+20azOdKLQRYcDuM9C9OT3E6T/bY5w92SU3+f A6eYuxJ9ygX7uVHubRVuZ6FS8C5CX/cdIdzpWAl5AxkS/4brOcRb2zCG1jGiJywxGte8 2M5mxfQe2Tl5wCScQFGjacU5JCgs+xU/2/g8tyvgoXek8HnhSQsc/KN/CL3LhWg1OBu9 PryOC5ivlOs8d/OE27CgbFYYwPNqziCD6fy1HOUnbQGkbALIum+IlBQ01PymiRnpZ3KB AH8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=pECtvteeo7795cmfljqIf27awj6Ab3REDnb3qaExur0=; b=chn9VRyIaH4pGa0FZdLfguw6wQEGH4bi+kFPntLl0gKvMs5z5eQn+4UZc1qZX8OHFj YQEeu1xhv6FkjRo+y092TXYaYZ137LWBg0h0IUHSgHweLzGK5F/LwwmKTrqNEXMbYygg l1kCEfrO/iHamp6zGGxNkmI8zQpYqVNiAgwvQMxiuBAPfBDhyIcxXDlj7cnWhbXq6yG4 E/U57UvvcKkPekji5rEAUBzRFEvwoqi0hzWWexpPONJZI1XpJwt41V1OE+Zb1u/OYLEL PT3fL/BVXrhPcBhOAsIf7SSAnk9JRzkG5eEf8A+0XH5IerMCgFjXytb5roTc+X9/m+SF Gmbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WtCItKIZ; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m3si19918164plt.394.2018.12.05.11.48.37; Wed, 05 Dec 2018 11:48:52 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WtCItKIZ; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728238AbeLETqo (ORCPT + 99 others); Wed, 5 Dec 2018 14:46:44 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:35788 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727257AbeLETqn (ORCPT ); Wed, 5 Dec 2018 14:46:43 -0500 Received: by mail-lj1-f194.google.com with SMTP id x85-v6so19482131ljb.2; Wed, 05 Dec 2018 11:46:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=pECtvteeo7795cmfljqIf27awj6Ab3REDnb3qaExur0=; b=WtCItKIZNRA9n2qD05ZW0dQe18cfOtSQjZaRIqeYsV2+nRkEj8KvBeMlwP9Mdmr6FC Pgi73L/qgQcmrfJQy4u/8853siqol4I8p3m7XM+g/U1hNoYklcFAvpaTtroaBEAqOUjp aEqzdL/mkzH0Rqprj3Hr1FIWI0ySgHbS789aTiMNgwAtl0VJVQODQAx3SNWrPlrrVVOT 20yv42aY1IqaOAWhx0hnQrRf8v836feJzR3DWyAPvrYfWyjubLi/c8ByuJBUorSMnND6 YHPoYrpyIBA+buBwSe7SVZNOQuWv9Ulw4h+dJ9vXcwzl9cCR/oMBqZKyvzm2RWD+5D3E PvlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=pECtvteeo7795cmfljqIf27awj6Ab3REDnb3qaExur0=; b=SlQEgaR+lq0Paorhg41ypFk6uIR3SIOOTKdOBW/EXVcBC/YhIZb+OTDMiEK1rF3V/f dWvehCDgaofg5M7IeDZVLvRJoLE2doUlulvzcEql+bw2O4Q09K77VYj1SYk8TlVL76Mu R4UMuwRdixZDl8ZDeCsz6nBrufqyjT7jwzc3RUI3Rg+hq7BZwtcWqPQr30uE+BlCCwEq DIJH8jiBz84sSoOjMVWDZh9ShQV9Bbejreua03+xXVXWPY9I/mEMU0pOZbdRcOe8AFpf vv7njv4ZOBOYgNHBa+sCwydQQZlh7qLMLjgOSqyZMHlDmYfdgceYAzRvidDpjeKh3Gsh VIWQ== X-Gm-Message-State: AA+aEWbZ+5FTwDwUyd2rA2tyzjlL1l8bBe+eKPya9vjDDMIVPdLnpUxN g1adoUysHAlimYa+co5spokjuJNLq6E1fw== X-Received: by 2002:a2e:5654:: with SMTP id k81-v6mr16131640ljb.48.1544039201494; Wed, 05 Dec 2018 11:46:41 -0800 (PST) Received: from localhost.localdomain ([2a02:a315:5445:5300:41e8:260c:942a:b736]) by smtp.googlemail.com with ESMTPSA id u15-v6sm4284096lja.63.2018.12.05.11.46.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 11:46:40 -0800 (PST) From: =?UTF-8?q?Pawe=C5=82=20Chmiel?= To: marcel@holtmann.org, johan.hedberg@gmail.com Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Jonathan Bakker , =?UTF-8?q?Pawe=C5=82=20Chmiel?= Subject: [PATCH] Bluetooth: hci_bcm: Handle specific unknown packets after firmware loading Date: Wed, 5 Dec 2018 20:45:38 +0100 Message-Id: <20181205194538.8074-1-pawel.mikolaj.chmiel@gmail.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jonathan Bakker 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 + #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 + 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) -- 2.17.1