linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: scameron@beardog.cce.hp.com
To: Alexander Gordeev <agordeev@redhat.com>
Cc: linux-kernel@vger.kernel.org, iss_storagedev@hp.com,
	linux-scsi@vger.kernel.org, linux-pci@vger.kernel.org,
	scameron@beardog.cce.hp.com
Subject: Re: [PATCH v2 RESEND 10/23] hpsa: Use pci_enable_msix_range() instead of pci_enable_msix()
Date: Wed, 13 Aug 2014 14:27:08 -0500	[thread overview]
Message-ID: <20140813192708.GD19666@beardog.cce.hp.com> (raw)
In-Reply-To: <6e17ab33b0ddbe49f72bf0d9c5fd3019acf6d6ca.1397461652.git.agordeev@redhat.com>

On Mon, Apr 14, 2014 at 10:05:34AM +0200, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range()  or pci_enable_msi_exact()
> and pci_enable_msix_range() or pci_enable_msix_exact()
> interfaces.
> 
> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> Cc: "Stephen M. Cameron" <scameron@beardog.cce.hp.com>
> Cc: iss_storagedev@hp.com
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> ---
>  drivers/scsi/hpsa.c |   29 +++++++++++++----------------
>  1 files changed, 13 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
> index 3284edb..36bb1e4 100644
> --- a/drivers/scsi/hpsa.c
> +++ b/drivers/scsi/hpsa.c
> @@ -6144,26 +6144,23 @@ static void hpsa_interrupt_mode(struct ctlr_info *h)
>  		goto default_int_mode;
>  	if (pci_find_capability(h->pdev, PCI_CAP_ID_MSIX)) {
>  		dev_info(&h->pdev->dev, "MSIX\n");
> -		h->msix_vector = MAX_REPLY_QUEUES;
> -		err = pci_enable_msix(h->pdev, hpsa_msix_entries,
> -				      h->msix_vector);
> -		if (err > 0) {
> +		err = pci_enable_msix_range(h->pdev, hpsa_msix_entries,
> +					    1, MAX_REPLY_QUEUES);
> +		if (err < 0) {
> +			dev_warn(&h->pdev->dev, "MSI-X init failed %d\n", err);
> +			h->msix_vector = 0;
> +			goto single_msi_mode;
> +		} else if (err < MAX_REPLY_QUEUES) {
>  			dev_warn(&h->pdev->dev, "only %d MSI-X vectors "
>  			       "available\n", err);
> -			h->msix_vector = err;
> -			err = pci_enable_msix(h->pdev, hpsa_msix_entries,
> -					      h->msix_vector);
> -		}
> -		if (!err) {
> -			for (i = 0; i < h->msix_vector; i++)
> -				h->intr[i] = hpsa_msix_entries[i].vector;
> -			return;
> -		} else {
> -			dev_warn(&h->pdev->dev, "MSI-X init failed %d\n",
> -			       err);
> -			h->msix_vector = 0;
>  		}
> +
> +		h->msix_vector = err;
> +		for (i = 0; i < h->msix_vector; i++)
> +			h->intr[i] = hpsa_msix_entries[i].vector;
> +		return;
>  	}
> +single_msi_mode:
>  	if (pci_find_capability(h->pdev, PCI_CAP_ID_MSI)) {
>  		dev_info(&h->pdev->dev, "MSI\n");
>  		if (!pci_enable_msi(h->pdev))
> -- 
> 1.7.7.6

Ack.

-- steve


  reply	other threads:[~2014-08-13 19:28 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-14  8:05 [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
2014-04-14  8:05 ` [PATCH v2 RESEND 01/23] be2iscsi: Use pci_enable_msix_exact() " Alexander Gordeev
2014-04-14  8:05 ` [PATCH v2 RESEND 02/23] bfa: Do not call pci_enable_msix() after it failed once Alexander Gordeev
2014-04-16  9:03   ` Anil Gurumurthy
2014-04-14  8:05 ` [PATCH v2 RESEND 03/23] bfa: Cleanup bfad_setup_intr() function Alexander Gordeev
2014-04-16  9:04   ` Anil Gurumurthy
2014-04-16  9:05   ` Anil Gurumurthy
2014-04-14  8:05 ` [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead of pci_enable_msix() Alexander Gordeev
2014-04-16  9:05   ` Anil Gurumurthy
2014-04-14  8:05 ` [PATCH v2 RESEND 05/23] csiostor: Remove superfluous call to pci_disable_msix() Alexander Gordeev
2014-04-14  8:05 ` [PATCH v2 RESEND 06/23] csiostor: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
2014-04-14  8:05 ` [PATCH v2 RESEND 07/23] fnic: Use pci_enable_msix_exact() " Alexander Gordeev
2014-04-14  8:05 ` [PATCH v2 RESEND 08/23] isci: " Alexander Gordeev
2014-04-16 12:51   ` Artur Paszkiewicz
2014-04-14  8:05 ` [PATCH v2 RESEND 09/23] hpsa: Fallback to MSI rather than to INTx if MSI-X failed Alexander Gordeev
2014-04-14  8:05 ` [PATCH v2 RESEND 10/23] hpsa: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
2014-08-13 19:27   ` scameron [this message]
2014-04-14  8:05 ` [PATCH v2 RESEND 11/23] lpfc: Remove superfluous call to pci_disable_msix() Alexander Gordeev
2014-04-14  8:05 ` [PATCH v2 RESEND 12/23] lpfc: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
2014-04-14  8:05 ` [PATCH v2 RESEND 14/23] megaraid: " Alexander Gordeev
2014-04-14  8:05 ` [PATCH v2 RESEND 15/23] mpt2sas: Use pci_enable_msix_exact() " Alexander Gordeev
2014-04-14  8:05 ` [PATCH v2 RESEND 16/23] mpt3sas: " Alexander Gordeev
2014-04-14  8:05 ` [PATCH v2 RESEND 17/23] pm8001: Fix invalid return when request_irq() failed Alexander Gordeev
2014-04-14  8:05 ` [PATCH v2 RESEND 18/23] pm8001: Use pci_enable_msix_exact() instead of pci_enable_msix() Alexander Gordeev
2014-04-14  8:05 ` [PATCH v2 RESEND 19/23] pmcraid: Get rid of a redundant assignment Alexander Gordeev
2014-04-14  8:05 ` [PATCH v2 RESEND 20/23] pmcraid: Use pci_enable_msix_range() instead of pci_enable_msix() Alexander Gordeev
2014-04-14  8:05 ` [PATCH v2 RESEND 21/23] qla2xxx: " Alexander Gordeev
2014-04-14  8:05 ` [PATCH v2 RESEND 22/23] qla4xxx: Use pci_enable_msix_exact() " Alexander Gordeev
2014-04-15 12:48   ` Vikas Chaudhary
2014-04-14  8:05 ` [PATCH v2 RESEND 23/23] vmw_pvscsi: " Alexander Gordeev
2014-04-24 17:09 ` [PATCH v2 RESEND 00/23] scsi: Use pci_enable_msix_range() " Bjorn Helgaas
2014-04-24 17:51   ` James Bottomley
2014-04-24 18:07     ` Bjorn Helgaas
2014-07-07 18:03       ` Alexander Gordeev
2014-06-16  7:35     ` Alexander Gordeev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140813192708.GD19666@beardog.cce.hp.com \
    --to=scameron@beardog.cce.hp.com \
    --cc=agordeev@redhat.com \
    --cc=iss_storagedev@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).