lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1489372963-9000-8-git-send-email-yuanzhichang@hisilicon.com>
Date:   Mon, 13 Mar 2017 10:42:43 +0800
From:   "zhichang.yuan" <yuanzhichang@...ilicon.com>
To:     <catalin.marinas@....com>, <will.deacon@....com>,
        <robh+dt@...nel.org>, <frowand.list@...il.com>,
        <bhelgaas@...gle.com>, <rafael@...nel.org>, <mark.rutland@....com>,
        <rjw@...ysocki.net>, <arnd@...db.de>,
        <linux-arm-kernel@...ts.infradead.org>
CC:     <linux-acpi@...r.kernel.org>, <lorenzo.pieralisi@....com>,
        <benh@...nel.crashing.org>, <linux-kernel@...r.kernel.org>,
        <linuxarm@...wei.com>, <devicetree@...r.kernel.org>,
        <linux-pci@...r.kernel.org>, <linux-serial@...r.kernel.org>,
        <minyard@....org>, <liviu.dudau@....com>, <zourongrong@...il.com>,
        <john.garry@...wei.com>, <gabriele.paoloni@...wei.com>,
        <zhichang.yuan02@...il.com>, <kantyzc@....com>,
        <xuwei5@...ilicon.com>,
        "zhichang.yuan" <yuanzhichang@...ilicon.com>
Subject: [PATCH V7 7/7] LPC: Add the ACPI LPC support

The patch update the _CRS of LPC children based on the relevant LIBIO
interfaces. Then the ACPI platform device enumeration for LPC can apply the
right I/O resource to request the system I/O space from ioport_resource and
ensure the LPC peripherals work well.

Signed-off-by: zhichang.yuan <yuanzhichang@...ilicon.com>
Signed-off-by: John Garry <john.garry@...wei.com>
---
 drivers/bus/hisi_lpc.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/drivers/bus/hisi_lpc.c b/drivers/bus/hisi_lpc.c
index 345ea12..3796b1f 100644
--- a/drivers/bus/hisi_lpc.c
+++ b/drivers/bus/hisi_lpc.c
@@ -464,6 +464,27 @@ static int hisilpc_host_io_register(struct device *dev,
 
 	lpcdev->io_host = range;
 
+	/*
+	 * For ACPI children, translate the bus-local I/O range to logical
+	 * I/O range and set it as the current resource before the children
+	 * are enumerated.
+	 */
+	if (has_acpi_companion(dev)) {
+		struct acpi_device *root, *child;
+
+		root = to_acpi_device_node(dev->fwnode);
+		/* For hisilpc, only care about the sons of host. */
+		list_for_each_entry(child, &root->children, node) {
+			int ret;
+
+			ret = acpi_set_libio_resource(child, root);
+			if (ret) {
+				dev_err(&child->dev, "set resource failed..\n");
+				return ret;
+			}
+		}
+	}
+
 	return 0;
 }
 
@@ -558,10 +579,18 @@ static int hisilpc_probe(struct platform_device *pdev)
 	{},
 };
 
+#ifdef CONFIG_ACPI
+static const struct acpi_device_id hisilpc_acpi_match[] = {
+	{"HISI0191", },
+	{},
+};
+#endif
+
 static struct platform_driver hisilpc_driver = {
 	.driver = {
 		.name           = "hisi_lpc",
 		.of_match_table = hisilpc_of_match,
+		.acpi_match_table = ACPI_PTR(hisilpc_acpi_match),
 	},
 	.probe = hisilpc_probe,
 };
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ