[PATCH v2 2/6] PCI/MSI: Factor out pci_get_msi_cap() interface

Alexander Gordeev agordeev at redhat.com
Wed Oct 2 17:26:30 EST 2013


On Tue, Oct 01, 2013 at 10:46:32PM -0400, Mark Lord wrote:
> >>> The last pattern makes most of sense to me and could be updated with a more
> >>> clear sequence - a call to (bit modified) pci_msix_table_size() followed
> >>> by a call to pci_enable_msix(). I think this pattern can effectively
> >>> supersede the currently recommended "loop" practice.
> >>
> >> The loop is still necessary, because there's a race between those two calls,
> >> so that pci_enable_msix() can still fail due to lack of MSIX slots.
> > 
> > Moreover, the existing loop pattern is racy and could fail just as easily ;)
> 
> Yes, but it then loops again to correct things.

No. If it failed it should exit the loop.

-- 
Regards,
Alexander Gordeev
agordeev at redhat.com


More information about the Linuxppc-dev mailing list