public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Export msi_remove_pci_irq_vectors
  2004-06-22  2:22 Question on using MSI in PCI driver Roland Dreier
@ 2004-06-22  4:03 ` Roland Dreier
  2004-06-22  8:45   ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Roland Dreier @ 2004-06-22  4:03 UTC (permalink / raw)
  To: tom.l.nguyen, linux-kernel; +Cc: greg

As a followup to my previous post about the request_mem_region in
msi.c, I noticed that the region is only released in
msi_remove_pci_irq_vectors().  Based on the fact that this function is
declared in linux/pci.h (and stubbed out if CONFIG_PCI_USE_VECTOR is
not defined), I'm guessing that the intent is for a device driver to
unconditionally call this when exiting.

However, a module can't call msi_remove_pci_irq_vectors unless the
symbol is exported... so if this is the way to do things, please apply
this patch.

On the other hand, MSI-HOWTO.txt seems to imply that the 0th MSI
vector should be cleaned up just by calling free_irq... so should
pci_disable_msi be calling msi_remove_pci_irq_vectors?

 - Roland

Index: linux-2.6.7/drivers/pci/msi.c
===================================================================
--- linux-2.6.7.orig/drivers/pci/msi.c	2004-06-15 22:20:03.000000000 -0700
+++ linux-2.6.7/drivers/pci/msi.c	2004-06-21 20:51:33.000000000 -0700
@@ -1011,3 +1011,4 @@
 EXPORT_SYMBOL(pci_enable_msi);
 EXPORT_SYMBOL(msi_alloc_vectors);
 EXPORT_SYMBOL(msi_free_vectors);
+EXPORT_SYMBOL(msi_remove_pci_irq_vectors);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Export msi_remove_pci_irq_vectors
  2004-06-22  4:03 ` [PATCH] Export msi_remove_pci_irq_vectors Roland Dreier
@ 2004-06-22  8:45   ` Christoph Hellwig
  0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2004-06-22  8:45 UTC (permalink / raw)
  To: Roland Dreier; +Cc: tom.l.nguyen, linux-kernel, greg

On Mon, Jun 21, 2004 at 09:03:22PM -0700, Roland Dreier wrote:
> On the other hand, MSI-HOWTO.txt seems to imply that the 0th MSI
> vector should be cleaned up just by calling free_irq... so should
> pci_disable_msi be calling msi_remove_pci_irq_vectors?

I think so.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] Export msi_remove_pci_irq_vectors
@ 2004-06-22 15:47 Nguyen, Tom L
  2004-06-22 17:51 ` Roland Dreier
  0 siblings, 1 reply; 4+ messages in thread
From: Nguyen, Tom L @ 2004-06-22 15:47 UTC (permalink / raw)
  To: Roland Dreier, linux-kernel; +Cc: greg, Nguyen, Tom L

On Monday, June 21, 2004 Roland Dreier wrote: 

>As a followup to my previous post about the request_mem_region in
>msi.c, I noticed that the region is only released in
>msi_remove_pci_irq_vectors().  Based on the fact that this function is
>declared in linux/pci.h (and stubbed out if CONFIG_PCI_USE_VECTOR is
>not defined), I'm guessing that the intent is for a device driver to
>unconditionally call this when exiting.

The intent of msi_remove_pci_irq_vectors() is to support hot-removed 
operation. This function is not for a device driver to call and
should not be exported. I acknowledged the problem of the MSI-X region 
being only released in msi_remove_pci_irq_vectors(). I'm in a progress 
of updating the existing MSI-X code.

Thanks,
Long

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Export msi_remove_pci_irq_vectors
  2004-06-22 15:47 [PATCH] Export msi_remove_pci_irq_vectors Nguyen, Tom L
@ 2004-06-22 17:51 ` Roland Dreier
  0 siblings, 0 replies; 4+ messages in thread
From: Roland Dreier @ 2004-06-22 17:51 UTC (permalink / raw)
  To: Nguyen, Tom L; +Cc: linux-kernel, greg

    Tom> The intent of msi_remove_pci_irq_vectors() is to support
    Tom> hot-removed operation. This function is not for a device
    Tom> driver to call and should not be exported. I acknowledged the
    Tom> problem of the MSI-X region being only released in
    Tom> msi_remove_pci_irq_vectors(). I'm in a progress of updating
    Tom> the existing MSI-X code.

Do you have any plans for when this should be fixed?  Right now, with
the standard kernel, if I unload and then reload my driver module,
setting up MSI-X fails the second time through because the core has
not cleaned up the memory region from the first time.

 - Roland

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-06-22 18:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-22 15:47 [PATCH] Export msi_remove_pci_irq_vectors Nguyen, Tom L
2004-06-22 17:51 ` Roland Dreier
  -- strict thread matches above, loose matches on Subject: below --
2004-06-22  2:22 Question on using MSI in PCI driver Roland Dreier
2004-06-22  4:03 ` [PATCH] Export msi_remove_pci_irq_vectors Roland Dreier
2004-06-22  8:45   ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox