Hi Tejun, Today's linux-next merge of the libata tree got a conflict in drivers/ata/ahci.c between commit 7b92b4f61ec4 ("PCI/MSI: Remove pci_enable_msi_block_auto()") from the pci tree and commit d93414513966 ("drivers: ata: Mark the function ahci_init_interrupts() as static in ahci.c") from the libata tree. I fixed it up (see below) and can carry the fix as necessary (no action is required). -- Cheers, Stephen Rothwell sfr@canb.auug.org.au diff --cc drivers/ata/ahci.c index 3cf6dad71e11,74911c2cb1dd..000000000000 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@@ -1097,40 -1148,26 +1148,40 @@@ static inline void ahci_gtf_filter_work {} #endif - int ahci_init_interrupts(struct pci_dev *pdev, unsigned int n_ports, -static int ahci_init_interrupts(struct pci_dev *pdev, struct ahci_host_priv *hpriv) ++static int ahci_init_interrupts(struct pci_dev *pdev, unsigned int n_ports, + struct ahci_host_priv *hpriv) { - int rc; - unsigned int maxvec; + int rc, nvec; - if (!(hpriv->flags & AHCI_HFLAG_NO_MSI)) { - rc = pci_enable_msi_block_auto(pdev, &maxvec); - if (rc > 0) { - if ((rc == maxvec) || (rc == 1)) - return rc; - /* - * Assume that advantage of multipe MSIs is negated, - * so fallback to single MSI mode to save resources - */ - pci_disable_msi(pdev); - if (!pci_enable_msi(pdev)) - return 1; - } - } + if (hpriv->flags & AHCI_HFLAG_NO_MSI) + goto intx; + + rc = pci_msi_vec_count(pdev); + if (rc < 0) + goto intx; + + /* + * If number of MSIs is less than number of ports then Sharing Last + * Message mode could be enforced. In this case assume that advantage + * of multipe MSIs is negated and use single MSI mode instead. + */ + if (rc < n_ports) + goto single_msi; + + nvec = rc; + rc = pci_enable_msi_block(pdev, nvec); + if (rc) + goto intx; + return nvec; + +single_msi: + rc = pci_enable_msi(pdev); + if (rc) + goto intx; + return 1; + +intx: pci_intx(pdev, 1); return 0; }