Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetoot...
[cascardo/linux.git] / drivers / ata / ahci_sunxi.c
index e44d675..e2e0da5 100644 (file)
 #include <linux/regulator/consumer.h>
 #include "ahci.h"
 
+/* Insmod parameters */
+static bool enable_pmp;
+module_param(enable_pmp, bool, 0);
+MODULE_PARM_DESC(enable_pmp,
+       "Enable support for sata port multipliers, only use if you use a pmp!");
+
 #define AHCI_BISTAFR   0x00a0
 #define AHCI_BISTCR    0x00a4
 #define AHCI_BISTFCTR  0x00a8
@@ -184,7 +190,15 @@ static int ahci_sunxi_probe(struct platform_device *pdev)
                goto disable_resources;
 
        hpriv->flags = AHCI_HFLAG_32BIT_ONLY | AHCI_HFLAG_NO_MSI |
-                      AHCI_HFLAG_NO_PMP | AHCI_HFLAG_YES_NCQ;
+                      AHCI_HFLAG_YES_NCQ;
+
+       /*
+        * The sunxi sata controller seems to be unable to successfully do a
+        * soft reset if no pmp is attached, so disable pmp use unless
+        * requested, otherwise directly attached disks do not work.
+        */
+       if (!enable_pmp)
+               hpriv->flags |= AHCI_HFLAG_NO_PMP;
 
        rc = ahci_platform_init_host(pdev, hpriv, &ahci_sunxi_port_info);
        if (rc)
@@ -238,7 +252,6 @@ static struct platform_driver ahci_sunxi_driver = {
        .remove = ata_platform_remove_one,
        .driver = {
                .name = "ahci-sunxi",
-               .owner = THIS_MODULE,
                .of_match_table = ahci_sunxi_of_match,
                .pm = &ahci_sunxi_pm_ops,
        },