Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1988322pxj; Sun, 30 May 2021 09:37:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZBWw/GTLzJ/muqdJb1FFXt1vjrVRhW0rFsCYB+CVYqoy9+fzcYpQa5+hS/xjqVk+otA9A X-Received: by 2002:a17:906:5211:: with SMTP id g17mr19041248ejm.281.1622392667422; Sun, 30 May 2021 09:37:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622392667; cv=none; d=google.com; s=arc-20160816; b=wiSoVfpOnrerT9+UQY87T2D83ltSNCy+CCCaWw6S27gbu8t5Ot6WSTIuvxPXUTKaV6 pwz4cuU+Tv34t/DAhFdYh4I7UBCTHRH5yoSUNLmMi5wWS2jkJJFrcGTNGPVqHioJ48c7 2Ji628NVj59kwMDpNvE5dl+bWo7jdbgyL0Gu7a9YzVNF5L43OhUeKb52Bq7qxaVPN5yQ gnBK0WiJyLy19BZFZu9qX0/G2pgCS9G6S3lnohN5b8dlM6J+OUGpTr/614aIVPekNuaW 0nNLThFV+9Xxl8D3X4WgSz0jURLpMSHwCZY7xoOm0mmiFUr0BYtJgh2jxaV9I7vMYqB/ BVrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:message-id:subject:cc:to:from:date; bh=+S7AbwvPZq4JQgOlMGkgFCLg7VlycgZ46+PyCxwAz0o=; b=sAHEarMtwdxXM34jWLo6ZODhwxeTr+EF6UmrXg0eN3Ga5qIVmdkJmsiVf1jdF5yB39 TF92Iyl2fIj5YTN2pSVDKQQr0kBFA0PmDHrCuuVx5qMzPuBgtR6JKG2O/InYk0896vJu 3Ifp26280m6fm1rbnWWM7F2kujXCTrKhTTzahUrifuf5tv/Pr0OqIO03u/qda6gltY0k gafNquARMYPc5V22h1Ca1f8MksUveh0kwFnxeW9baWKMz9ADnX98zMdw6ZlX9MnWIyFD ds/DCt1921JU+eoS3aiPVrqKx3ob67Rk8lTVBGbCubnorvaYxKk8FPmrCPPkFsgxKfDg ew3A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b11si10555771ejd.10.2021.05.30.09.37.07; Sun, 30 May 2021 09:37:47 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229671AbhE3QhS (ORCPT + 99 others); Sun, 30 May 2021 12:37:18 -0400 Received: from foss.arm.com ([217.140.110.172]:40524 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229599AbhE3QhR (ORCPT ); Sun, 30 May 2021 12:37:17 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 09A966D; Sun, 30 May 2021 09:35:39 -0700 (PDT) Received: from slackpad.fritz.box (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B93253F73D; Sun, 30 May 2021 09:35:36 -0700 (PDT) Date: Sun, 30 May 2021 17:34:54 +0100 From: Andre Przywara To: Ondrej Jirman , Chen-Yu Tsai , Maxime Ripard , Jernej =?UTF-8?B?xaBrcmFiZWM=?= , Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org, Linux ARM Mailing List , Linux Kernel Mailing List , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , linux-bluetooth@vger.kernel.org, linux-sunxi@lists.linux.dev Cc: Josh Triplett , tuxd3v@sapo.pt Subject: sunxi: Bluetooth broken since 5.6-rc1 Message-ID: <20210530173454.5ab1dcf5@slackpad.fritz.box> Organization: Arm Ltd. X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.31; x86_64-slackware-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi, as recently discovered via IRC discussions, Bluetooth (via UART) seems to be broken on many (if not all) Allwinner devices using recent mainline kernels. On *some* occasions it might work, but more often than not the hci_bcm driver just times out: .... [ 5.046126] Bluetooth: HIDP socket layer initialized ... [ 7.809425] Bluetooth: hci0: command 0x0c03 tx timeout [ 15.969286] Bluetooth: hci0: BCM: Reset failed (-110) After some guessing, trying, and bisecting I pinned the problem down to: commit dc56ecb81a0aa46a7e127e916df5c8fdb8364f0b Author: Josh Triplett Date: Fri Jan 10 18:25:13 2020 -0800 serial: 8250: Support disabling mdelay-filled probes of 16550A variants This seemingly innocent commit shaved off some milliseconds during the 8250 probe, which apparently lets the Bluetooth device trip. An obvious easy hack-fix is to just define CONFIG_SERIAL_8250_16550A_VARIANTS, which brings the delays back and seems to avoid the problem for me. Another hack which seems to mitigate the problem is to avoid switching the baudrate to something faster than 115200. I observed this on a BananaPi-M64 (Allwinner A64 SoC with AP6212 WiFi/BT chip), but others reported the same issue on a NanoPi Air (Allwinner H3 with 6212), but also other SoCs and devices (at least one AP6210). Obviously those workarounds are not real solutions, and I was wondering if anybody has an idea how to properly fix this? What puzzles me is that the delay is happening during the *UART* probe, so before we even start dealing with the Bluetooth device. I see that hci_bcm.c has some history with adding delays, also with RTS/CTS lines, so does anyone have an idea what's going on here, exactly, and how to properly fix this problem? Many thanks, Andre