Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5041674imu; Wed, 19 Dec 2018 04:45:30 -0800 (PST) X-Google-Smtp-Source: AFSGD/XAQZWTRCExxUivam6gxP8COdVDCMO93lnL/qc/oFonhMvU52er3Qz9hqDeMu72pZO8azFj X-Received: by 2002:a63:7512:: with SMTP id q18mr16962906pgc.231.1545223530860; Wed, 19 Dec 2018 04:45:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545223530; cv=none; d=google.com; s=arc-20160816; b=yV8+vHljuguPANwLTlK06sF7aMO00ybqd8mKSgAjx8aziGeveY8yeML9/vAhiZ7HXq kOSJgEB+BnNr9Ml3ukLxFhQt13l0Dlz8RUl/Vyz4UyaxZaeVKYI2MV5cKQ6erYwZnwDm fXHdrh8DTZJpLPyjyFwQfDh0DvQFfSZ6kwCJP0SaU1mTlqvvIv8r4rF8ikG7dwXmAEzL e19LBcoZJ4NMzVDl+C9x9bVOsmvEzHQz7HZ64Z2VR2C0IpctksOPa5IckJu7UttR1SLV 8krYozbXL2TlkNGuoEt3HkuKMURfkShA60VHpp8CAoAMWMvLaCO1PB5n44LjmwOWHZox TfTw== 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=Wvv+6h2xtQTAcq6rLgBPG7RS7nGtHtlwnBYaaXULXbE=; b=KNdOzWQ/JRCo8ZJ2m4BjKY2PTnXwXLYrbD+rsSRo8C2fsJQNu5hKoEE/dK6ppRNiHh MlpRrEgQ6iCO6bKxNjeihxNb1SrEgHtZTaL+xKkSxBAcHQrHT2tf8ovKG0xLR37BVGn9 DaOC3FWuHz/3S+9F2C2uE2Lu5IWl3EAusREj1PVOk+uEQrR9d3cYXehzYKs4haDs3ZhY j0scAf99bUKo2t9d7ViEoYWHFjK01HaC5RSGzXRnSyJGQJXIq6n/Kbhm98mPNMzdvMiG KSREqgqzppjpWppHxPSws5Ns4VyrEWXt/7iQVd9hG+cStCMRIPdOb4L4Kv3Fg/ppMGjU Xhfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tszlL8CN; 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 g5si4465106plt.273.2018.12.19.04.45.14; Wed, 19 Dec 2018 04:45:30 -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=tszlL8CN; 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 S1729299AbeLSLWj (ORCPT + 99 others); Wed, 19 Dec 2018 06:22:39 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:37238 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726652AbeLSLWi (ORCPT ); Wed, 19 Dec 2018 06:22:38 -0500 Received: by mail-lj1-f193.google.com with SMTP id t18-v6so5051821ljd.4; Wed, 19 Dec 2018 03:22:37 -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=Wvv+6h2xtQTAcq6rLgBPG7RS7nGtHtlwnBYaaXULXbE=; b=tszlL8CNHq0+X/RzT8xpY3BDKwCx7nsuPmL3gBIwM0FaWQ7G4AN2GeADPO3u5M10WM i6LMfhoglti5gGuksAZHifcSOYN+w1MCIb+XxdemFunJLxWkvI5r/upujazENE53xcX8 9/YBIWMddHLOIXNH0dnO9TFoVt5xMEjHXSltV1n4gyPudG/e/0+sAuW7RYUEfoIMGH7y UCgGMERlS5ozpmNIOLIyU+Jsj7PdN+NlBtP2qzGAn75S2jedrYIINdrJyx2NwAS27pV0 3Ftv+xDBRr3/QmkgWzxV0ddTwcLHsEYjTQ9lUp79tV65VOMsHH9aN4Gyu9oQWx2oJ5d1 ZPww== 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=Wvv+6h2xtQTAcq6rLgBPG7RS7nGtHtlwnBYaaXULXbE=; b=aonNWr1XOxMKieq1f/niBe9wl5E055WRDYBTMJHOqXm2MsDLpOlVo6gbtdUpiuD5LI Ze/ZUqwizzgZHukaNt6SDUfG5HrElQqANA2fpWoGMRlQgVfzny4Bdh4QjB3mDR8pePM4 KEgwvgpm48P66YLJVHqvX8ZVXUtSLakis8u936YAPurJ4HsRIgERxYBVOLXHtu81dZNH h1fHr4TMkq+skEbUyH3OmEkkel4WLZAizw/Qvk1WQX/ZWpJGfVNGtvZ7Fw09UXW8mM48 2kdQ50P989MD5F2BIFKbb8s5uwsdIXdTJidD6PwPLnnuUbYb7d0+Q5oIu2Z4TMVsy4ZU ZPaQ== X-Gm-Message-State: AA+aEWbe4cJV5bStNBVXdbL+FwBdAPjK/ZSLc5RSNdzu9vwE9D5Iuxk+ 4/N9DTa9JwzA+lCMzXxsgPM= X-Received: by 2002:a2e:914b:: with SMTP id q11-v6mr11991322ljg.164.1545218556376; Wed, 19 Dec 2018 03:22:36 -0800 (PST) Received: from localhost.localdomain ([2a02:a315:5445:5300:e05f:a77f:eff8:4ba]) by smtp.googlemail.com with ESMTPSA id y11-v6sm3522548ljc.85.2018.12.19.03.22.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Dec 2018 03:22:35 -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 v3] Bluetooth: hci_bcm: Handle specific unknown packets after firmware loading Date: Wed, 19 Dec 2018 12:22:28 +0100 Message-Id: <20181219112228.9735-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 --- Changes from v2: - Rebased against latest bluetooth-next tree Changes from v1: - Rename UNKNOWN to TYPE49 - Rename UNKNOWN2 to TYPE52 --- drivers/bluetooth/hci_bcm.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c index a5cb580a07de..ddbe518c3e5b 100644 --- a/drivers/bluetooth/hci_bcm.c +++ b/drivers/bluetooth/hci_bcm.c @@ -52,6 +52,12 @@ #define BCM_LM_DIAG_PKT 0x07 #define BCM_LM_DIAG_SIZE 63 +#define BCM_TYPE49_PKT 0x31 +#define BCM_TYPE49_SIZE 0 + +#define BCM_TYPE52_PKT 0x34 +#define BCM_TYPE52_SIZE 0 + #define BCM_AUTOSUSPEND_DELAY 5000 /* default autosleep delay */ #define BCM_NUM_SUPPLIES 2 @@ -595,12 +601,28 @@ static int bcm_setup(struct hci_uart *hu) .lsize = 0, \ .maxlen = BCM_NULL_SIZE +#define BCM_RECV_TYPE49 \ + .type = BCM_TYPE49_PKT, \ + .hlen = BCM_TYPE49_SIZE, \ + .loff = 0, \ + .lsize = 0, \ + .maxlen = BCM_TYPE49_SIZE + +#define BCM_RECV_TYPE52 \ + .type = BCM_TYPE52_PKT, \ + .hlen = BCM_TYPE52_SIZE, \ + .loff = 0, \ + .lsize = 0, \ + .maxlen = BCM_TYPE52_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 }, + { BCM_RECV_TYPE49, .recv = hci_recv_diag }, + { BCM_RECV_TYPE52, .recv = hci_recv_diag }, }; static int bcm_recv(struct hci_uart *hu, const void *data, int count) -- 2.17.1