Patchwork [2.6.32] MCP5x conditional MSI support for sata_nv

login
register
mail settings
Submitter Tony Vroon
Date Aug. 4, 2009, 11:32 p.m.
Message ID <20090804233234.7251110075@gold.linx.net>
Download mbox | patch
Permalink /patch/30758/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Tony Vroon - Aug. 4, 2009, 11:32 p.m.
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.

Signed-off-by: Tony Vroon <tony@linx.net>

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Philip Langdale - Aug. 5, 2009, 2:35 a.m.
On Wed,  5 Aug 2009 00:32:34 +0100 (BST)
Tony Vroon <tony@linx.net> 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

> Signed-off-by: Tony Vroon <tony@linx.net>
> 
> diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
> index b2d11f3..469d4c7 100644
> --- a/drivers/ata/sata_nv.c
> +++ b/drivers/ata/sata_nv.c
> @@ -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)");
>  
> 




--phil
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Robert Hancock - Aug. 5, 2009, 11:45 p.m.
On 08/04/2009 08:35 PM, Philip Langdale wrote:
> On Wed,  5 Aug 2009 00:32:34 +0100 (BST)
> Tony Vroon<tony@linx.net>  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.

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.
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index b2d11f3..469d4c7 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -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)");