]> git.kernelconcepts.de Git - mv-sheeva.git/commitdiff
Apply Support PMP Disable Link Scanning Through Kernel Config patch
authorNils Faerber <nils.faerber@kernelconcepts.de>
Tue, 11 Jan 2011 14:53:00 +0000 (15:53 +0100)
committerNils Faerber <nils.faerber@kernelconcepts.de>
Tue, 11 Jan 2011 14:53:00 +0000 (15:53 +0100)
drivers/ata/Kconfig
drivers/ata/libata-pmp.c
include/linux/libata.h

index 36e2319264bd33d7918979105a4f641da36d3dcd..05c460fc20c409fa46d2318c74fdaaa49c800150 100644 (file)
@@ -59,6 +59,14 @@ config SATA_PMP
 
 comment "Controllers with non-SFF native interface"
 
+config SATA_PMP_DELAY_LINK_ENUMERATION
+       bool "SATA PMP Delay Link Enumeration"
+       default n
+       help
+         This option delays the enumeration of PMP links until
+         specifically requested by application or driver
+         (for use with libatardx)
+
 config SATA_AHCI
        tristate "AHCI SATA support"
        depends on PCI
index 3120596d4afc9aaba293f100f7a075ace6438f9e..a001ab8425f6450f15c976f9b91cd821c31c3273 100644 (file)
 #include "libata.h"
 #include "libata-transport.h"
 
+/**
+* Set to 1 to allow enumeration of devices behind PMP links
+*/
+unsigned int sata_pmp_allow_link_enumeration_flag = 0;
+
 const struct ata_port_operations sata_pmp_port_ops = {
        .inherits               = &sata_port_ops,
        .pmp_prereset           = ata_std_prereset,
@@ -955,6 +960,11 @@ static int sata_pmp_eh_recover(struct ata_port *ap)
        if (rc)
                goto pmp_fail;
 
+       if( sata_pmp_is_link_enumeration_allowed() == 0 ) {
+               ata_port_printk(ap, KERN_WARNING, "skipping pmp link enumeration based on kernel configuration");
+               return 0;
+       }
+
        /* PHY event notification can disturb reset and other recovery
         * operations.  Turn it off.
         */
@@ -1098,6 +1108,7 @@ void sata_pmp_error_handler(struct ata_port *ap)
        ata_eh_finish(ap);
 }
 
+EXPORT_SYMBOL_GPL(sata_pmp_allow_link_enumeration_flag);
 EXPORT_SYMBOL_GPL(sata_pmp_port_ops);
 EXPORT_SYMBOL_GPL(sata_pmp_qc_defer_cmd_switch);
 EXPORT_SYMBOL_GPL(sata_pmp_error_handler);
index d947b1231662b9f69b388d0c5e3393972285faa3..86ca277a68b87667d2f4730ef1aeca978900f4f2 100644 (file)
@@ -1739,4 +1739,24 @@ static inline u8 ata_wait_idle(struct ata_port *ap)
 }
 #endif /* CONFIG_ATA_SFF */
 
+#ifdef CONFIG_SATA_PMP_DELAY_LINK_ENUMERATION
+extern unsigned int sata_pmp_allow_link_enumeration_flag;
+static inline void sata_pmp_allow_link_enumeration( unsigned int allow ) 
+{
+       sata_pmp_allow_link_enumeration_flag = allow;
+}
+static inline unsigned int sata_pmp_is_link_enumeration_allowed( void ) 
+{
+       return sata_pmp_allow_link_enumeration_flag;
+}
+#else
+static inline void sata_pmp_allow_link_enumeration( unsigned int allow )
+{      
+       printk(KERN_WARNING "sata_pmp_allow_link_enumeration ignored - not included in kernel");
+}
+static inline unsigned int sata_pmp_is_link_enumeration_allowed( void ) 
+{
+       return 1;
+}
+#endif /* SATA_PMP_DELAY_LINK_ENUMERATION */
 #endif /* __LINUX_LIBATA_H__ */