From patchwork Fri Apr 21 18:18:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 97918 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp446724qgf; Fri, 21 Apr 2017 11:26:07 -0700 (PDT) X-Received: by 10.98.223.213 with SMTP id d82mr13597140pfl.222.1492799167702; Fri, 21 Apr 2017 11:26:07 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w124si10986093pfw.101.2017.04.21.11.26.07; Fri, 21 Apr 2017 11:26:07 -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 S1161886AbdDUS0F (ORCPT + 3 others); Fri, 21 Apr 2017 14:26:05 -0400 Received: from mail-wr0-f178.google.com ([209.85.128.178]:33516 "EHLO mail-wr0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161791AbdDUS0B (ORCPT ); Fri, 21 Apr 2017 14:26:01 -0400 Received: by mail-wr0-f178.google.com with SMTP id w50so36174657wrc.0 for ; Fri, 21 Apr 2017 11:26:01 -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=DtFkTEghC0LlHFEnNgRR762oEYnxI1Ydm+AKGjJZGR8=; b=TS+NvPK9rVN2eCObOsbbVR8WDWtai2PhPrlRH6kJfdlgc4FSU6L/RNVZUQb29tlFlX tUZuD9dGc9vDurxhxYYbH14JnS736mvKmW35q+8WgE/rzKxlyuZ+ILuuAeuojApv40dM qQfbwcGR2wx8lhI0aK2zDXfjJDa85p+9RidDk= 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=DtFkTEghC0LlHFEnNgRR762oEYnxI1Ydm+AKGjJZGR8=; b=PzfGog2YRZ92+3KVql5mrnGnVlI7tIUvEnEfb/TUhNH8rxzMBvyvpWM0xvixlQjbeR IW5xdrNTi86im0PAq9luLG6GVWbaj/KHQ+IYSv2iTjtQCmdLn60/P1NirgcxLeevev5s tmlwrytseUpOKe53zPSXaGQlQ90r4YQjpRMSreObhik8GSCiTKrcQnzwam9Zch0J6b8T lvmLRMl0iZijwpFF3wuYTRE4DXDlM2hwFEqQsTj9qEi9/unMYf946PGPT8p/4zL+sDoF S0XSY2dPcIenWbjfO+EjCusnLN4uL6SixOdgmVePAdSjMowOzARKasMwvXAqv/oj7aOb pQyA== X-Gm-Message-State: AN3rC/6zkLSygZAzxmbM7bri9QVslPL4+E+GHtXdu8SIqYK0CeYV3RrO DZnvsTvMkLtvvDxP X-Received: by 10.223.164.221 with SMTP id h29mr15193517wrb.102.1492798717161; Fri, 21 Apr 2017 11:18:37 -0700 (PDT) Received: from localhost.localdomain ([105.138.21.12]) by smtp.gmail.com with ESMTPSA id 190sm3165686wmk.17.2017.04.21.11.18.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Apr 2017 11:18:35 -0700 (PDT) From: Ard Biesheuvel To: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org Cc: arnd@arndb.de, ricardo.ribalda@gmail.com, peter@hurleysoftware.com, Ard Biesheuvel Subject: [PATCH] drivers/tty: 8250: only call fintek_8250_probe when doing port I/O Date: Fri, 21 Apr 2017 19:18:27 +0100 Message-Id: <20170421181827.7612-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 Signed-off-by: Ard Biesheuvel --- May we have a cc stable for this one please? 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 Reviewed-by: Ricardo Ribalda diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 6119516ef5fc..4c26d15ad7d9 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) {