Merge tag 'iwlwifi-next-for-kalle-2014-12-30' of https://git.kernel.org/pub/scm/linux...
[cascardo/linux.git] / drivers / ata / ahci_sunxi.c
index afe5581..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)