From patchwork Tue Nov 1 16:58:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=C3=A9r=C3=B4me_de_Bretagne?= X-Patchwork-Id: 9407683 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DFE8D60722 for ; Tue, 1 Nov 2016 16:58:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0B1529A70 for ; Tue, 1 Nov 2016 16:58:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C571329A75; Tue, 1 Nov 2016 16:58:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DC9C29A71 for ; Tue, 1 Nov 2016 16:58:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753258AbcKAQ6e (ORCPT ); Tue, 1 Nov 2016 12:58:34 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33917 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752060AbcKAQ6b (ORCPT ); Tue, 1 Nov 2016 12:58:31 -0400 Received: by mail-wm0-f65.google.com with SMTP id p190so17246912wmp.1; Tue, 01 Nov 2016 09:58:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=fFvDlOsZC/9mPQl4cUDvcZhWGvhJqY/16tA1Dm/PFAw=; b=xCtzkdi3z8IyENlZr9wFqYuF+f1O3OpI0on7AgwELF6Iga9iFWpOSMVlqhhJEh3axe G6u2qyAj94AGxt5VEs9PBVtO74BPkvgD4twtXWPcdGmCCxADdt6HjnqRsfrdwAM9gUtk rJQIenN3dETkZPazO8tFI9rXz57dQDn9dKZqktA0vrJmhvlXuOwdLmfw78XxCdD3kT1L of6zT/Mcr/KOwEqZbXjWVu0WKkJ5QFou8UM5534aew7If2xjL1a+HxN3okY1o3VyQ/4y w3yJ/h1e90LWnpG8fGeg9zcw/3wiNIkRU8ejr024fNR2d/y6u1pwv49oT+cAjiKYypN8 Mp6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=fFvDlOsZC/9mPQl4cUDvcZhWGvhJqY/16tA1Dm/PFAw=; b=PotOML02BRqfVz3pYjDvsgpv/w/kYnzRnOCNgp2y7dYtdwvJlzFfcjradMmlPL65dF Gx8wzbT4QNd5vLOtl6cOKcYvoZOBpTB8K8bhUQOl/cv5tSj5O5/DLJqJFri14aN7l/UZ 5Hn1v+xAM6m4UxkAJYPcfHgWnGlwSgvmarlJ1tiWfJNGQPQSMDAiXDIoKwrR4fpTrEy7 FXW9HXH7yJT1ydat67JATu7mI4jMDOYQDtAr277i6OWa4qmu/Ztsvs/L1Tkde8hFID9+ 9wTfOib6jWphsNj0rnobHqJS87pqDCXVapmKr+5/BN2klVkK3tiAMPc+sMemziO63pNf LxCQ== X-Gm-Message-State: ABUngvdWKkK+dl0H0hGZdy3t+YIfvkQcmOMHWWgC/+8FE4EtpFJnCDzIhGKHUGkJD9IKoQ== X-Received: by 10.28.16.194 with SMTP id 185mr2276221wmq.64.1478019509902; Tue, 01 Nov 2016 09:58:29 -0700 (PDT) Received: from thinkpad8 (2a01cb04006a0a00b21041fffeb8166b.ipv6.abo.wanadoo.fr. [2a01:cb04:6a:a00:b210:41ff:feb8:166b]) by smtp.googlemail.com with ESMTPSA id 18sm31380562wmr.5.2016.11.01.09.58.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 01 Nov 2016 09:58:29 -0700 (PDT) Message-ID: <1478019507.1676.23.camel@gmail.com> Subject: Re: [PATCHv2 3/3] serial: 8250_dw: Add quirk for APM X-Gene SoC (was: BT / serial regression introduced during the recent 4.9-rc1 merge?) From: =?ISO-8859-1?Q?J=E9r=F4me?= de Bretagne To: Heikki Krogerus , Andy Shevchenko , Greg Kroah-Hartman , "Rafael J. Wysocki" Cc: Kefeng Wang , Feng Kan , linux-serial@vger.kernel.org, linux-acpi@vger.kernel.org, linux-bluetooth@vger.kernel.org Date: Tue, 01 Nov 2016 17:58:27 +0100 In-Reply-To: <1476815643.1658.3.camel@gmail.com> References: <1476815643.1658.3.camel@gmail.com> X-Mailer: Evolution 3.22.0-2 Mime-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Heikki, Andy, Greg, Rafael, I've detected a regression on my Lenovo ThinkPad 8 tablet introduced during 4.9-rc1, preventing the built-in Bluetooth Broadcom chipset from properly initializing, with many timeout messages in dmesg like these:    "serial8250_interrupt: WXYZ callbacks suppressed"    "serial8250: too much work for irq39" cf. my earlier report on linux-bluetooth at the very end for reference. After a long git bisect, I've found the commit that's triggering the issue: commit 20a875e2e86e73d13ec256781a7d55a7885868ec Author: Heikki Krogerus Date:   Tue Aug 23 11:33:28 2016 +0300     serial: 8250_dw: Add quirk for APM X-Gene SoC          The APM X-Gene SoC UART is the only board that still needs     the hard-coded values, so handle it separately in     dw8250_quirks(). The other ACPI platforms are able to     provide the values with device properties.          Signed-off-by: Heikki Krogerus     Reviewed-by: Andy Shevchenko     Acked-by: Greg Kroah-Hartman     Signed-off-by: Rafael J. Wysocki         /* Platforms with iDMA */ This is fully reproducible on my end: removing this specific patch gets rid of the issue; with the patch applied, Bluetooth simply doesn't work anymore. As opposed to the commit description, it seems that the Lenovo ThinkPad 8 still needs the original hard-coded values currently (even if it could be possible to provide them in another way in the future, if I interpret the commit message the right way). Could this patch be reverted for the moment to remove the regression, until a proper fix is found? Thanks, Jérôme > I've compiled the latest bluetooth-next branch and I'm facing what looks > like a regression to me (still on a Lenovo ThinkPad 8 tablet): btattach > doesn't properly initialize the Broadcom BCM2E55 chipset anymore.  > > I'm getting various timeout messages in dmesg: > > [   13.188057] Bluetooth: hci0 command 0xfc45 tx timeout > [   16.093068] serial8250_interrupt: 4158 callbacks suppressed > [   16.093072] serial8250: too much work for irq39 > [   16.094287] serial8250: too much work for irq39 > ... > [   16.103868] serial8250: too much work for irq39 > [   21.100041] serial8250_interrupt: 4167 callbacks suppressed > [   21.100044] serial8250: too much work for irq39 > ... > [   21.222065] Bluetooth: hci0: BCM: failed to write clock (-110) > [   23.238528] Bluetooth: hci0 command 0x0c03 tx timeout > [   26.104253] serial8250_interrupt: 4165 callbacks suppressed > [   26.104257] serial8250: too much work for irq39 > > which I never had before and Bluetooth never actually starts. > > Bluetooth doesn't init with a kernel built with the latest commit from > yesterday 526c86021e5102b8a4b5555b4196f7a19f44e2c4.  > > I've gone back in time and it doesn't work either with a kernel built at  > e6445f52d9c8b0e6557a45fa7d0e8e088d430a8c "Merge tag 'usb-4.9-rc1' of > git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb". > > It still worked at commit a2f195a73eba807006fb0cb882ecb552c06eea00 > "bluetooth: bcm203x: don't print error when allocating urb fails" though, > which was the last previous commit modifying files in drivers/bluetooth in > the bluetooth-next branch. > > I've attached the output of btmon when it used to work and one not working > (prefixed with .e6445f5) if that may be useful. > > I'll continue my investigation in my spare time, trying to bissect to find > a while. I'll focus on patches touching the serial 8250 driver to start > with, as there are only a few of them, but feel free to point me into a > different direction if you have another idea or suggestion. --- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index e199696..5c0c123 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -298,12 +298,17 @@ static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data)                         p->serial_out = dw8250_serial_out32be;                 }         } else if (has_acpi_companion(p->dev)) { -               p->iotype = UPIO_MEM32; -               p->regshift = 2; -               p->serial_in = dw8250_serial_in32; +               const struct acpi_device_id *id; + +               id = acpi_match_device(p->dev->driver->acpi_match_table, +                                      p->dev); +               if (id && !strcmp(id->id, "APMC0D08")) { +                       p->iotype = UPIO_MEM32; +                       p->regshift = 2; +                       p->serial_in = dw8250_serial_in32; +                       data->uart_16550_compatible = true; +               }                 p->set_termios = dw8250_set_termios; -               /* So far none of there implement the Busy Functionality */ -               data->uart_16550_compatible = true;         }