From: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
To: Christoph Hellwig <hch@lst.de>
Cc: intel-linux-scu@intel.com, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] isci: switch to pci_alloc_irq_vectors
Date: Wed, 30 Nov 2016 16:04:03 +0100 [thread overview]
Message-ID: <1d0e24b6-8f11-7b12-dfac-aa828a6995de@intel.com> (raw)
In-Reply-To: <1479449432-7375-1-git-send-email-hch@lst.de>
On 11/18/2016 07:10 AM, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/scsi/isci/host.h | 1 -
> drivers/scsi/isci/init.c | 21 +++++++++------------
> 2 files changed, 9 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/scsi/isci/host.h b/drivers/scsi/isci/host.h
> index 22a9bb1..b353992 100644
> --- a/drivers/scsi/isci/host.h
> +++ b/drivers/scsi/isci/host.h
> @@ -295,7 +295,6 @@ enum sci_controller_states {
> #define SCI_MAX_MSIX_INT (SCI_NUM_MSI_X_INT*SCI_MAX_CONTROLLERS)
>
> struct isci_pci_info {
> - struct msix_entry msix_entries[SCI_MAX_MSIX_INT];
> struct isci_host *hosts[SCI_MAX_CONTROLLERS];
> struct isci_orom *orom;
> };
> diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c
> index 77128d68..7cddebb 100644
> --- a/drivers/scsi/isci/init.c
> +++ b/drivers/scsi/isci/init.c
> @@ -350,16 +350,12 @@ static int isci_setup_interrupts(struct pci_dev *pdev)
> */
> num_msix = num_controllers(pdev) * SCI_NUM_MSI_X_INT;
>
> - for (i = 0; i < num_msix; i++)
> - pci_info->msix_entries[i].entry = i;
> -
> - err = pci_enable_msix_exact(pdev, pci_info->msix_entries, num_msix);
> + err = pci_alloc_irq_vectors(pdev, num_msix, num_msix, PCI_IRQ_MSIX);
> if (err)
> goto intx;
pci_enable_msix_exact() returns 0 or -ERROR but pci_alloc_irq_vectors()
returns the number of vectors allocated if successful, so this also
should be changed:
- if (err)
+ if (err < 0)
goto intx;
The rest looks good to me.
Thanks,
Artur
prev parent reply other threads:[~2016-11-30 15:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-18 6:10 [PATCH] isci: switch to pci_alloc_irq_vectors Christoph Hellwig
2016-11-29 16:40 ` Martin K. Petersen
2016-11-30 15:04 ` Artur Paszkiewicz [this message]
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=1d0e24b6-8f11-7b12-dfac-aa828a6995de@intel.com \
--to=artur.paszkiewicz@intel.com \
--cc=hch@lst.de \
--cc=intel-linux-scu@intel.com \
--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).