From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
xen-devel <xen-devel@lists.xenproject.org>
Cc: Keir Fraser <keir@xen.org>
Subject: Re: [PATCH] x86/MSI: fix MSI-X case of freeing IRQ
Date: Thu, 02 Oct 2014 09:03:39 +0100 [thread overview]
Message-ID: <542D06DB.7020609@citrix.com> (raw)
In-Reply-To: <542D1561020000780003BCB8@mail.emea.novell.com>
[-- Attachment #1.1: Type: text/plain, Size: 1659 bytes --]
On 02/10/2014 08:05, Jan Beulich wrote:
> Commit d1b6d0a024 ("x86: enable multi-vector MSI") went a little too
> far with moving things around in msi_free_irqs() in order to streamline
> the code: We shouldn't drop the MSI-X control page reference before
> calling destroy_irq(), as the latter will call us back via
> desc->handler->shutdown() (effectively invoking to msi_set_mask_bit()).
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
> --- a/xen/arch/x86/msi.c
> +++ b/xen/arch/x86/msi.c
> @@ -496,15 +496,8 @@ int __setup_msi_irq(struct irq_desc *des
>
> int msi_free_irq(struct msi_desc *entry)
> {
> - unsigned int nr = entry->msi.nvec;
> -
> - if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
> - {
> - unsigned long start;
> - start = (unsigned long)entry->mask_base & ~(PAGE_SIZE - 1);
> - msix_put_fixmap(entry->dev->msix, virt_to_fix(start));
> - nr = 1;
> - }
> + unsigned int nr = entry->msi_attrib.type != PCI_CAP_ID_MSIX
> + ? entry->msi.nvec : 1;
>
> while ( nr-- )
> {
> @@ -515,6 +508,10 @@ int msi_free_irq(struct msi_desc *entry)
> iommu_update_ire_from_msi(entry + nr, NULL);
> }
>
> + if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
> + msix_put_fixmap(entry->dev->msix,
> + virt_to_fix((unsigned long)entry->mask_base));
> +
> list_del(&entry->list);
> xfree(entry);
> return 0;
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
[-- Attachment #1.2: Type: text/html, Size: 2555 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
prev parent reply other threads:[~2014-10-02 8:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-02 7:05 [PATCH] x86/MSI: fix MSI-X case of freeing IRQ Jan Beulich
2014-10-02 8:03 ` Andrew Cooper [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=542D06DB.7020609@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=keir@xen.org \
--cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.