From patchwork Thu May 18 11:29:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 100089 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp671100qge; Thu, 18 May 2017 04:30:20 -0700 (PDT) X-Received: by 10.99.152.9 with SMTP id q9mr3892013pgd.131.1495107020242; Thu, 18 May 2017 04:30:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495107020; cv=none; d=google.com; s=arc-20160816; b=S9Vvy2sf8Rvr2KPcYpbsWa6KRvVxZ20zBC62w4cyqFtp/7FtlCb3Fau/kkBRcDv9Y4 cI9Oz6tldNATP1AQu+BA76fB718Ne9MHqiLJLYs3sWdn+AP+JwDQWuf9nUO+3ELmz6tv 41VHA7GBadOhCEZ9UABEYXbT0SLEwqPVMt3FVqG2VHuHKrkC45gBjPsOlfmJumvMCXRO df+/8nVHWmxF77Gy7fPM+C8PhTmE1CEsf2UWtLzUwPpsS1lihZIzUSgpNsouJ6c9kpnm yjB79yVpTC3y2sJcrDjL+MGU030FYK0nbuvIWD0pOlvwWAqICuU/mQWAepqv6AcTNlzp V8Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=aHn08GzCuSo8fqid8U7MFNSYzlyFIYb7UNpktZdcIJA=; b=pAp3hO65c4MrSzbD+hCrujiZEwi9M7wsSVpNv9ZWNI5KP6oPiRQ/k8J+BpjIsWmpTk y7WEaheMjq+UGFgXjXcH0mtcESrlIwoWqWLA47pm9HBVx4dkl8bwBtnDLmhitRQW09vs 56y7G+okXFDwZwxjXvn3BamLZ+5VUIXw8Gs/d7+9GF/AXfT4J2azekuLb9lGQSpvLJhB dsKewu5N1l5uixZFLmARHLCs1a9CKQShXXc5d+cnY/Zw0HEiXOl3P4VZFnrRCd9/Y6aN PxPv1grcmz0tPxNB17LJP4Wcp9VytnHt6rzTi+OmqkNs82zZKRNZuwAJI/rUH79/CT2M zsqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k5si4963446pfa.417.2017.05.18.04.30.20; Thu, 18 May 2017 04:30:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933268AbdERLaS (ORCPT + 3 others); Thu, 18 May 2017 07:30:18 -0400 Received: from mail-wr0-f169.google.com ([209.85.128.169]:33921 "EHLO mail-wr0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932536AbdERLaP (ORCPT ); Thu, 18 May 2017 07:30:15 -0400 Received: by mail-wr0-f169.google.com with SMTP id l9so31606954wre.1 for ; Thu, 18 May 2017 04:30:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=eIzF9EZhYi78j+Cx29qivyNzD/LyJhJaozgCvB4Lrds=; b=O3CSvPYNNiOJKwwSZ/PQ1VoiiEGcITca9/fIoIMs42B9W+bouBt0IC+fXuTR0eRMjU IlMltzkdYHkWZeJrJ8kBdrHLP/9F0XY8EMQ1tHhaplWBzBPrIdy0TCHBb9wWSDDAvfJ3 QK2qAUsha/kOYu1Z4gdvYkYdGSnKkeyZH8+jU= 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; bh=eIzF9EZhYi78j+Cx29qivyNzD/LyJhJaozgCvB4Lrds=; b=DgJ8Zd/8oKgBUqqiyn1fBiRGmNWnC2EOiEwbHiuvLOekoJpRPlGuMqmrHgHvdt1LNh C27eIyLSbJGJNGf7Mo2r3lZF16gXjQP25sew371V/Jjxda5nA01JhVSyjxIXCOlsTz83 cXlCgljp/+jriBY0LPvcf+KfiwCv7oTX50wU8R7957jLRk70ClQdzrSWeTY9cw3dOcEF eboVQpVOfRTbKS1J0UcmebK4oFyaxV9y5kABSinerCbI1PY4AVQXrb8NUJhwzrRRkTOP 51jx4r+LlVFyBmwhtxu96wdIXdldhtWK+NBMDrW3m2mOSnSznLcgYUi5kEG3XGtmlLch btBQ== X-Gm-Message-State: AODbwcBQo91e81Qt8dV+e2X3mGT4v35CL1wya/NYzdKcFx9bXREJL+7W 4t0i0HSxzPGQVIjFMnzn6w== X-Received: by 10.223.167.76 with SMTP id e12mr2529812wrd.177.1495107008927; Thu, 18 May 2017 04:30:08 -0700 (PDT) Received: from localhost.localdomain ([105.129.238.81]) by smtp.gmail.com with ESMTPSA id 137sm5945044wmi.19.2017.05.18.04.30.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 May 2017 04:30:08 -0700 (PDT) From: Ard Biesheuvel To: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org Cc: arnd@arndb.de, peter@hurleysoftware.com, ricardo.ribalda@gmail.com, Ard Biesheuvel Subject: [PATCH resend] drivers/tty: 8250: only call fintek_8250_probe when doing port I/O Date: Thu, 18 May 2017 12:29:55 +0100 Message-Id: <20170518112955.12235-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.9.3 Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Commit fa01e2ca9f53 ("serial: 8250: Integrate Fintek into 8250_base") modified the probing logic for PNP0501 devices, to remove a collision between the generic 16550A driver and the Fintek driver, which reused the same ACPI _HID. The Fintek device probe is now incorporated into the common 8250 probe path, and gets called for all discovered 16550A compatible devices, including ones that are MMIO mapped rather than IO mapped. However, the Fintek driver assumes the port base is a I/O address, and proceeds to probe some arbitrary offsets above it. This is generally a wrong thing to do, but on ARM systems (having no native port I/O), this may result in faulting accesses of completely unrelated MMIO regions in the PCI I/O space. Given that this is at serial probe time, this results in hard to diagnose crashes at boot. So let's restrict the Fintek probe to devices that we know are using port I/O in the first place. Fixes: fa01e2ca9f53 ("serial: 8250: Integrate Fintek into 8250_base") Suggested-by: Arnd Bergmann Reviewed-by: Ricardo Ribalda Signed-off-by: Ard Biesheuvel --- Resending with Ricardo's ack added. Could we please tag this for -stable? Thanks. drivers/tty/serial/8250/8250_port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-serial" 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_port.c b/drivers/tty/serial/8250/8250_port.c index 09a65a3ec7f7..e7765f010fe8 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -1337,7 +1337,7 @@ static void autoconfig(struct uart_8250_port *up) /* * Check if the device is a Fintek F81216A */ - if (port->type == PORT_16550A) + if (port->type == PORT_16550A && port->iotype == UPIO_PORT) fintek_8250_probe(up); if (up->capabilities != old_capabilities) {