linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sumit Saxena <sumit.saxena@broadcom.com>
To: Hannes Reinecke <hare@suse.de>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
	Christoph Hellwig <hch@lst.de>,
	James Bottomley <james.bottomley@hansenpartnership.com>,
	Linux SCSI List <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] megaraid_sas: fixup MSIx interrupt setup during resume
Date: Fri, 24 Jan 2020 18:07:46 +0530	[thread overview]
Message-ID: <CAL2rwxryXx0MkMAE2jbzGdeuvsY09g_UvuOfAC7qqFJ2k1LS=Q@mail.gmail.com> (raw)
In-Reply-To: <20200113132609.69536-1-hare@suse.de>

On Mon, Jan 13, 2020 at 6:56 PM Hannes Reinecke <hare@suse.de> wrote:
>
> Streamline resume workflow by using the same functions for enabling
> MSIx interrupts as used during initialisation.
> Without it the driver might crash during resume with:
>
> WARNING: CPU: 2 PID: 4306 at ../drivers/pci/msi.c:1303 pci_irq_get_affinity+0x3b/0x90
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Looks good, thank you.
Acked-by: Sumit Saxena <sumit.saxena@broadcom.com>

> ---
>  drivers/scsi/megaraid/megaraid_sas_base.c | 20 +++++++++-----------
>  1 file changed, 9 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
> index a4bc81479284..ec58244c680c 100644
> --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> @@ -7592,7 +7592,6 @@ megasas_resume(struct pci_dev *pdev)
>         int rval;
>         struct Scsi_Host *host;
>         struct megasas_instance *instance;
> -       int irq_flags = PCI_IRQ_LEGACY;
>
>         instance = pci_get_drvdata(pdev);
>
> @@ -7634,16 +7633,15 @@ megasas_resume(struct pci_dev *pdev)
>         atomic_set(&instance->ldio_outstanding, 0);
>
>         /* Now re-enable MSI-X */
> -       if (instance->msix_vectors) {
> -               irq_flags = PCI_IRQ_MSIX;
> -               if (instance->smp_affinity_enable)
> -                       irq_flags |= PCI_IRQ_AFFINITY;
> -       }
> -       rval = pci_alloc_irq_vectors(instance->pdev, 1,
> -                                    instance->msix_vectors ?
> -                                    instance->msix_vectors : 1, irq_flags);
> -       if (rval < 0)
> -               goto fail_reenable_msix;
> +       if (instance->msix_vectors)
> +               megasas_alloc_irq_vectors(instance);
> +
> +       if (!instance->msix_vectors) {
> +               rval = pci_alloc_irq_vectors(instance->pdev, 1, 1,
> +                                            PCI_IRQ_LEGACY);
> +               if (rval < 0)
> +                       goto fail_reenable_msix;
> +       }
>
>         megasas_setup_reply_map(instance);
>
> --
> 2.16.4
>

  parent reply	other threads:[~2020-01-24 12:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-13 13:26 [PATCH] megaraid_sas: fixup MSIx interrupt setup during resume Hannes Reinecke
2020-01-21  4:55 ` Martin K. Petersen
2020-01-24 12:37 ` Sumit Saxena [this message]
2020-01-28  3:47 ` Martin K. Petersen

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='CAL2rwxryXx0MkMAE2jbzGdeuvsY09g_UvuOfAC7qqFJ2k1LS=Q@mail.gmail.com' \
    --to=sumit.saxena@broadcom.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /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).