lkml.org 
[lkml]   [2015]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC 2/4] PCI, MSI: Optionally free legacy PCI IRQ when enabling MSI/MSI-X
    On 2015/5/16 5:02, Thomas Gleixner wrote:
    > On Thu, 7 May 2015, Jiang Liu wrote:
    >
    >> Once PCI MSI/MSI-X is enabled by the device driver, PCI device won't
    >> make use of legacy PCI IRQ until PCI MSI/MSI-X is disabled again.
    >> So optionally free legacy PCI IRQ when enabling MSI/MSI-X and reallocate
    >> when disabling MSI/MSI-X.
    >
    > This is a bit odd. With your proposed change we'll have:
    >
    > alloc_legacy_irq()
    >
    > msi[x]_enable()
    > free_legacy_irq()
    >
    > msi[x]_disable()
    > alloc_legacy_irq()
    Hi Thomas,
    It's for safety. I'm not sure whether the device driver will
    make use of legacy IRQ after calling msi[x]_disable(). I have concerns
    about following pattern in PCI device drivers:
    ---------------------------------------------------
    if (enable_msi() == SUCCESS) {
    if (allocate_resource_for_msi() == SUCCESS)
    return;
    disable_msi();
    }
    use_legacy_irq()

    Thanks!
    Gerry

    >
    > And after that we shut down the device which will free the legacy irq
    > again.
    >
    > Shouldn't we allocate the legacy irq only if we really need it?
    >
    > Thanks,
    >
    > tglx
    >


    \
     
     \ /
      Last update: 2015-05-20 05:21    [W:2.455 / U:0.040 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site