linux.kernel - 25 new messages in 14 topics - digest
linux.kernel
http://groups.google.com/group/linux.kernel?hl=en
Today's topics:
* ahci: Factor out PCI specifics from ahci_reset_controller() - 7 messages, 2
authors
http://groups.google.com/group/linux.kernel/t/f52e7d83445abba6?hl=en
* [PATCH SERIES] enhanced PV on Xen HVM - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/595a8504fe566b9d?hl=en
* Memory management woes - order 1 allocation failures - 3 messages, 3 authors
http://groups.google.com/group/linux.kernel/t/5fdc2e7e4a505944?hl=en
* nommu: get_user_pages(): pin last page on non-page-aligned start - 1
messages, 1 author
http://groups.google.com/group/linux.kernel/t/b6c94687ec99497a?hl=en
* perf archive: Don't try to collect files without a build-id - 1 messages, 1
author
http://groups.google.com/group/linux.kernel/t/01cfbc95ce2c96aa?hl=en
* FireWire updates post 2.6.33 - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/0e859660f9c01bd1?hl=en
* hid Logitech G13 Driver 0.0.5 - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/efb80a4d82dd0b35?hl=en
* nfs: use 4*rsize readahead size - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/0ded33f7779e13c7?hl=en
* x86/mm fixes - 3 messages, 2 authors
http://groups.google.com/group/linux.kernel/t/65bf90b96de084b0?hl=en
* Add sysfs support for fbdefio delay - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/fa05f291e1c0c50c?hl=en
* single block IO revert (Was "Re: Oops while booting 2.6.34-rc0 (block pull
busted)") - 2 messages, 2 authors
http://groups.google.com/group/linux.kernel/t/f7420e106a3c28db?hl=en
* resource: Fix broken indentation - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/02c9c32f887539af?hl=en
* unable to handle kernel paging request on resume with 2.6.33-00001-gbaac35c -
1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/f6bf94c5aedebc4a?hl=en
* 'sar' issue or core dump issue? - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/7de13e8ac7c5c85d?hl=en
==============================================================================
TOPIC: ahci: Factor out PCI specifics from ahci_reset_controller()
http://groups.google.com/group/linux.kernel/t/f52e7d83445abba6?hl=en
==============================================================================
== 1 of 7 ==
Date: Tues, Mar 2 2010 10:40 am
From: Anton Vorontsov
Move PCI stuff into ahci_pci_reset_controller().
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
drivers/ata/ahci.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index acfdcb5..c46a064 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1318,7 +1318,6 @@ static int ahci_deinit_port(struct ata_port *ap, const char **emsg)
static int ahci_reset_controller(struct ata_host *host)
{
- struct pci_dev *pdev = to_pci_dev(host->dev);
struct ahci_host_priv *hpriv = host->private_data;
void __iomem *mmio = hpriv->mmio;
u32 tmp;
@@ -1362,7 +1361,17 @@ static int ahci_reset_controller(struct ata_host *host)
dev_printk(KERN_INFO, host->dev,
"skipping global host reset\n");
+ return 0;
+}
+
+static int ahci_pci_reset_controller(struct ata_host *host)
+{
+ struct pci_dev *pdev = to_pci_dev(host->dev);
+
+ ahci_reset_controller(host);
+
if (pdev->vendor == PCI_VENDOR_ID_INTEL) {
+ struct ahci_host_priv *hpriv = host->private_data;
u16 tmp16;
/* configure PCS */
@@ -2499,7 +2508,7 @@ static int ahci_pci_device_resume(struct pci_dev *pdev)
return rc;
if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND) {
- rc = ahci_reset_controller(host);
+ rc = ahci_pci_reset_controller(host);
if (rc)
return rc;
@@ -3207,7 +3216,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (rc)
return rc;
- rc = ahci_reset_controller(host);
+ rc = ahci_pci_reset_controller(host);
if (rc)
return rc;
--
1.7.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
== 2 of 7 ==
Date: Tues, Mar 2 2010 10:40 am
From: Anton Vorontsov
This can be used for AHCI-compatible interfaces implemented inside
a System-On-Chip solutions, or AHCI devices connected via localbus.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
drivers/ata/Kconfig | 9 ++
drivers/ata/Makefile | 1 +
drivers/ata/ahci_platform.c | 196 +++++++++++++++++++++++++++++++++++++++++++
drivers/ata/ahci_platform.h | 29 +++++++
4 files changed, 235 insertions(+), 0 deletions(-)
create mode 100644 drivers/ata/ahci_platform.c
create mode 100644 drivers/ata/ahci_platform.h
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 4656782..a81013d 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -61,6 +61,15 @@ config SATA_AHCI_PCI
help
This option enables support for PCI AHCI Serial ATA controllers.
+config SATA_AHCI_PLATFORM
+ tristate "Platform AHCI SATA support"
+ depends on SATA_AHCI
+ help
+ This option enables support for Platform AHCI Serial ATA
+ controllers.
+
+ If unsure, say N.
+
config SATA_SIL24
tristate "Silicon Image 3124/3132 SATA support"
depends on PCI
diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile
index a220e90..c734c75 100644
--- a/drivers/ata/Makefile
+++ b/drivers/ata/Makefile
@@ -3,6 +3,7 @@ obj-$(CONFIG_ATA) += libata.o
obj-$(CONFIG_SATA_AHCI) += ahci.o
obj-$(CONFIG_SATA_AHCI_PCI) += ahci_pci.o
+obj-$(CONFIG_SATA_AHCI_PLATFORM)+= ahci_platform.o
obj-$(CONFIG_SATA_SVW) += sata_svw.o
obj-$(CONFIG_ATA_PIIX) += ata_piix.o
obj-$(CONFIG_SATA_PROMISE) += sata_promise.o
diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
new file mode 100644
index 0000000..f3f96d6
--- /dev/null
+++ b/drivers/ata/ahci_platform.c
@@ -0,0 +1,196 @@
+/*
+ * AHCI SATA platform driver
+ *
+ * Copyright 2004-2005 Red Hat, Inc.
+ * Jeff Garzik <jgarzik@pobox.com>
+ * Copyright 2010 MontaVista Software, LLC.
+ * Anton Vorontsov <avorontsov@ru.mvista.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/device.h>
+#include <linux/libata.h>
+#include <linux/platform_device.h>
+#include "ahci.h"
+#include "ahci_platform.h"
+
+static int __devinit ahci_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct ahci_platform_data *pdata = pdev->dev.platform_data;
+ struct ata_port_info pi = {
+ .flags = AHCI_FLAG_COMMON,
+ .pio_mask = ATA_PIO4,
+ .udma_mask = ATA_UDMA6,
+ .port_ops = &ahci_ops,
+ };
+ const struct ata_port_info *ppi[] = { &pi, NULL };
+ struct ahci_host_priv *hpriv;
+ struct ata_host *host;
+ struct resource *res;
+ int n_ports;
+ int i;
+ int rc;
+
+ WARN_ON(ATA_MAX_QUEUE > AHCI_MAX_CMDS);
+
+ if (pdata && pdata->init) {
+ rc = pdata->init(dev);
+ if (rc)
+ return rc;
+ }
+
+ if (pdata && pdata->ata_port_info)
+ pi = *pdata->ata_port_info;
+
+ hpriv = devm_kzalloc(dev, sizeof(*hpriv), GFP_KERNEL);
+ if (!hpriv) {
+ rc = -ENOMEM;
+ goto err0;
+ }
+
+ hpriv->flags |= (unsigned long)pi.private_data;
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res) {
+ dev_err(dev, "no mmio space\n");
+ rc = -ENODEV;
+ goto err0;
+ }
+
+ hpriv->mmio = devm_ioremap(dev, res->start, resource_size(res));
+ if (!hpriv->mmio) {
+ dev_err(dev, "can't map %pR\n", res);
+ rc = -ENODEV;
+ goto err0;
+ }
+
+ ahci_save_initial_config(dev, hpriv,
+ pdata ? pdata->force_port_map : 0,
+ pdata ? pdata->mask_port_map : 0);
+
+ /* prepare host */
+ if (hpriv->cap & HOST_CAP_NCQ)
+ pi.flags |= ATA_FLAG_NCQ;
+
+ if (hpriv->cap & HOST_CAP_PMP)
+ pi.flags |= ATA_FLAG_PMP;
+
+ ahci_set_em_messages(hpriv, &pi);
+
+
+ /* CAP.NP sometimes indicate the index of the last enabled
+ * port, at other times, that of the last possible port, so
+ * determining the maximum port number requires looking at
+ * both CAP.NP and port_map.
+ */
+ n_ports = max(ahci_nr_ports(hpriv->cap), fls(hpriv->port_map));
+
+ host = ata_host_alloc_pinfo(dev, ppi, n_ports);
+ if (!host) {
+ rc = -ENOMEM;
+ goto err0;
+ }
+
+ host->private_data = hpriv;
+
+ if (!(hpriv->cap & HOST_CAP_SSS) || ahci_ignore_sss)
+ host->flags |= ATA_HOST_PARALLEL_SCAN;
+ else
+ printk(KERN_INFO "ahci: SSS flag set, parallel bus scan disabled\n");
+
+ if (pi.flags & ATA_FLAG_EM)
+ ahci_reset_em(host);
+
+ for (i = 0; i < host->n_ports; i++) {
+ struct ata_port *ap = host->ports[i];
+
+ ata_port_desc(ap, "mmio %pR", res);
+ ata_port_desc(ap, "port 0x%x", 0x100 + ap->port_no * 0x80);
+
+ /* set initial link pm policy */
+ ap->pm_policy = NOT_AVAILABLE;
+
+ /* set enclosure management message type */
+ if (ap->flags & ATA_FLAG_EM)
+ ap->em_message_type = ahci_em_messages;
+
+
+ /* disabled/not-implemented port */
+ if (!(hpriv->port_map & (1 << i)))
+ ap->ops = &ata_dummy_port_ops;
+ }
+
+ rc = ahci_reset_controller(host);
+ if (rc)
+ goto err0;
+
+ ahci_init_controller(host);
+ ahci_print_info(host, "platform");
+
+ res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+ if (!res) {
+ dev_err(dev, "no irq\n");
+ rc = -EINVAL;
+ goto err0;
+ }
+
+ rc = ata_host_activate(host, res->start, ahci_interrupt, IRQF_SHARED,
+ &ahci_sht);
+ if (rc)
+ goto err0;
+
+ return 0;
+err0:
+ if (pdata && pdata->exit)
+ pdata->exit(dev);
+ return rc;
+}
+
+static int __devexit ahci_remove(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct ata_host *host = dev_get_drvdata(dev);
+ struct ahci_platform_data *pdata = pdev->dev.platform_data;
+
+ ata_host_detach(host);
+
+ if (pdata && pdata->exit)
+ pdata->exit(dev);
+
+ return 0;
+}
+
+static struct platform_driver ahci_driver = {
+ .probe = ahci_probe,
+ .remove = __devexit_p(ahci_remove),
+ .driver = {
+ .name = DRV_NAME,
+ .owner = THIS_MODULE,
+ },
+};
+
+static int __init ahci_init(void)
+{
+ return platform_driver_register(&ahci_driver);
+}
+module_init(ahci_init);
+
+static void __exit ahci_exit(void)
+{
+ platform_driver_unregister(&ahci_driver);
+}
+module_exit(ahci_exit);
+
+MODULE_DESCRIPTION("AHCI SATA platform driver");
+MODULE_AUTHOR("Anton Vorontsov <avorontsov@ru.mvista.com>");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:" DRV_NAME);
diff --git a/drivers/ata/ahci_platform.h b/drivers/ata/ahci_platform.h
new file mode 100644
index 0000000..f7dd576
--- /dev/null
+++ b/drivers/ata/ahci_platform.h
@@ -0,0 +1,29 @@
+/*
+ * AHCI SATA platform driver
+ *
+ * Copyright 2004-2005 Red Hat, Inc.
+ * Jeff Garzik <jgarzik@pobox.com>
+ * Copyright 2010 MontaVista Software, LLC.
+ * Anton Vorontsov <avorontsov@ru.mvista.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ */
+
+#ifndef _AHCI_PLATFORM_H
+#define _AHCI_PLATFORM_H
+
+struct device;
+struct ata_port_info;
+
+struct ahci_platform_data {
+ int (*init)(struct device *dev);
+ void (*exit)(struct device *dev);
+ const struct ata_port_info *ata_port_info;
+ unsigned int force_port_map;
+ unsigned int mask_port_map;
+};
+
+
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home