diff mbox

ACHI: Attempt to enable a single MSI if block enable fails

Message ID 20140204060139.GA16513@dhcp-26-207.brq.redhat.com
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

Alexander Gordeev Feb. 4, 2014, 6:01 a.m. UTC
On Mon, Feb 03, 2014 at 03:46:08PM -0500, Tejun Heo wrote:
> cc'ing Alexander.  Alexander, can you please reply with Reviewed-by?

[...]

> > 
> > - --- drivers/ata/ahci.c.orig	2014-02-03 20:00:04.834008843 +0000
> > +++ drivers/ata/ahci.c	2014-02-03 19:34:53.737257483 +0000
> > @@ -1171,7 +1171,7 @@ static int ahci_init_interrupts(struct p
> >  	nvec = rc;
> >  	rc = pci_enable_msi_block(pdev, nvec);
> >  	if (rc)
> > - -		goto intx;
> > +		goto single_msi;
> > 
> >  	return nvec;

Single MSI should not be tried in case pci_enable_msi_block() returned a
negative errno. The correct fix is below. Bjorn already has pulled it to
his pci.git tree, into pci/msi branch.

@Bjorn, 

Mind pushing the branch to the remote?

Thanks!

Comments

Bjorn Helgaas Feb. 4, 2014, 4:40 p.m. UTC | #1
On Mon, Feb 3, 2014 at 11:01 PM, Alexander Gordeev <agordeev@redhat.com> wrote:
> On Mon, Feb 03, 2014 at 03:46:08PM -0500, Tejun Heo wrote:
>> cc'ing Alexander.  Alexander, can you please reply with Reviewed-by?
>
> [...]
>
>> >
>> > - --- drivers/ata/ahci.c.orig       2014-02-03 20:00:04.834008843 +0000
>> > +++ drivers/ata/ahci.c      2014-02-03 19:34:53.737257483 +0000
>> > @@ -1171,7 +1171,7 @@ static int ahci_init_interrupts(struct p
>> >     nvec = rc;
>> >     rc = pci_enable_msi_block(pdev, nvec);
>> >     if (rc)
>> > - -         goto intx;
>> > +           goto single_msi;
>> >
>> >     return nvec;
>
> Single MSI should not be tried in case pci_enable_msi_block() returned a
> negative errno. The correct fix is below. Bjorn already has pulled it to
> his pci.git tree, into pci/msi branch.
>
> @Bjorn,
>
> Mind pushing the branch to the remote?

Done; it's now here:
http://git.kernel.org/cgit/linux/kernel/git/helgaas/pci.git/log/?h=pci/msi

I'll probably wait to merge it into -next until I pull in some more of
your MSI patches.

> diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
> index 8516f4d..df24eef4 100644
> --- a/drivers/ata/ahci.c
> +++ b/drivers/ata/ahci.c
> @@ -1117,8 +1117,10 @@ int ahci_init_interrupts(struct pci_dev *pdev, unsigned int n_ports,
>
>         nvec = rc;
>         rc = pci_enable_msi_block(pdev, nvec);
> -       if (rc)
> +       if (rc < 0)
>                 goto intx;
> +       else if (rc > 0)
> +               goto single_msi;
>
>         return nvec;
>
> --
> 1.7.7.6
>
> --
> Regards,
> Alexander Gordeev
> agordeev@redhat.com
--
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
diff mbox

Patch

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 8516f4d..df24eef4 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1117,8 +1117,10 @@  int ahci_init_interrupts(struct pci_dev *pdev, unsigned int n_ports,
 
 	nvec = rc;
 	rc = pci_enable_msi_block(pdev, nvec);
-	if (rc)
+	if (rc < 0)
 		goto intx;
+	else if (rc > 0)
+		goto single_msi;
 
 	return nvec;