MCP5x conditional MSI support for sata_nv
PATCH 1/1 MCP5x conditional MSI support for sata_nv
The nVidia MCP55 controller quite happily supports MSI. This adds an option to use it. It is disabled by default and will only be honoured on MCP5x series controllers. This was suggested in 2007 back when the driver was less mature, perhaps now is a better time for it.
drivers/ata/sata_nv.c +9 -0
@@ -602,6 +602,7 @@ MODULE_VERSION(DRV_VERSION);static int adma_enabled;static int swncq_enabled =1 ; +static int msi_enabled;static void nv_adma_register_mode (struct ata_port *ap) {
@@ -2459,6 +2460,12 @@ static int nv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) }else if (type ==SWNCQ )nv_swncq_host_init (host); +/* enable MSI if requested */ +if (type >= MCP5x && msi_enabled) { +dev_printk (KERN_NOTICE , &pdev->dev,"Using MSI\n" ); +pci_enable_msi (pdev); + } +pci_set_master (pdev);return ata_host_activate (host, pdev->irq, ipriv->irq_handler,IRQF_SHARED , ipriv->sht);
@@ -2558,4 +2565,6 @@ module_param_named(adma, adma_enabled, bool, 0444);MODULE_PARM_DESC (adma,"Enable use of ADMA (Default: false)" );module_param_named (swncq, swncq_enabled, bool,0444 );MODULE_PARM_DESC (swncq,"Enable use of SWNCQ (Default: true)" ); +module_param_named (msi, msi_enabled, bool,0444 ); +MODULE_PARM_DESC (msi,"Enable use of MSI (Default: false)" );
Quoted 5 lines · On Wed, 5 Aug 2009 00:32:34 +0100 (BST) Tony Vroon <[email protected]> wrote:
The nVidia MCP55 controller quite happily supports MSI. This adds an option to use it. It is disabled by default and will only be honoured on MCP5x series controllers. This was suggested in 2007 back when the driver was less mature, perhaps now is a better time for it.
I don't use an MCP55 motherboard anymore but I ran with MSI on for multiple years to no ill effect. However, in this thread where I reported my success, another person reported failure with MCP51.
http://www.nvnews.net/vbulletin/showthread.php?t=101144&highlight=sata_nv+msi
Assuming that's true, you can't use the 'MCP5x' test as that will cover MCP51 as well.
--phil
Quoted 29 lines
Signed-off-by Tony Vroon <[email protected]>drivers/ata/sata_nv.c +7
-0@@ -602,6 +602,7 @@ MODULE_VERSION(DRV_VERSION);static int adma_enabled;static int swncq_enabled =1 ; +static int msi_enabled;static void nv_adma_register_mode (struct ata_port *ap) {@@ -2459,6 +2460,12 @@ static int nv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) } else if (type == SWNCQ)nv_swncq_host_init (host); +/* enable MSI if requested */ +if (type >= MCP5x && msi_enabled) { +dev_printk (KERN_NOTICE , &pdev->dev,"Using MSI\n" ); +pci_enable_msi (pdev); + } +pci_set_master (pdev);return ata_host_activate (host, pdev->irq, ipriv->irq_handler,IRQF_SHARED , ipriv->sht);
drivers/ata/sata_nv.c module_param_named(adma, adma_enabled, bool, · line 2570
Quoted 6 lines
drivers/ata/sata_nv.c +2
-0@@ -2558,4 +2565,6 @@ module_param_named(adma, adma_enabled, bool, 0444); MODULE_PARM_DESC(adma, "Enable use of ADMA (Default: false)");module_param_named (swncq, swncq_enabled, bool,0444 );MODULE_PARM_DESC (swncq,"Enable use of SWNCQ (Default: true)" ); +module_param_named (msi, msi_enabled, bool,0444 ); +MODULE_PARM_DESC (msi,"Enable use of MSI (Default: false)" );
--phil
Quoted 9 lines · Philip Langdale
Quoted 5 lines · On Wed, 5 Aug 2009 00:32:34 +0100 (BST) Tony Vroon<[email protected]> wrote:
The nVidia MCP55 controller quite happily supports MSI. This adds an option to use it. It is disabled by default and will only be honoured on MCP5x series controllers. This was suggested in 2007 back when the driver was less mature, perhaps now is a better time for it.
Quoted 8 lines
I don't use an MCP55 motherboard anymore but I ran with MSI on for multiple years to no ill effect. However, in this thread where I reported my success, another person reported failure with MCP51.
http://www.nvnews.net/vbulletin/showthread.php?t=101144&highlight=sata_nv+msi
Assuming that's true, you can't use the 'MCP5x' test as that will cover MCP51 as well.
I'd take that with a bit of a grain of salt as there have been a lot of HT MSI fixups included since those posts (2007). Some motherboards didn't enable HT MSI mapping capabilities by default, which would prevent MSI from working.