mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 09:02:06 +00:00
AHCI: Cleanup checking of multiple MSIs/SLM modes
Sharing Last Message (SLM) mode is currently checked in two functions: ahci_host_activate() and ahci_init_interrupts(). This update consolidates SLM mode check with activation of multiple MSIs mode. Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Signed-off-by: Tejun Heo <tj@kernel.org> Cc: linux-ide@vger.kernel.org
This commit is contained in:
parent
6d8ca28fa6
commit
c3ebd6a9b6
2 changed files with 8 additions and 12 deletions
|
@ -1211,6 +1211,9 @@ static int ahci_init_interrupts(struct pci_dev *pdev, unsigned int n_ports,
|
||||||
goto single_msi;
|
goto single_msi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nvec > 1)
|
||||||
|
hpriv->flags |= AHCI_HFLAG_MULTI_MSI;
|
||||||
|
|
||||||
return nvec;
|
return nvec;
|
||||||
|
|
||||||
single_msi:
|
single_msi:
|
||||||
|
@ -1227,7 +1230,6 @@ intx:
|
||||||
* ahci_host_activate - start AHCI host, request IRQs and register it
|
* ahci_host_activate - start AHCI host, request IRQs and register it
|
||||||
* @host: target ATA host
|
* @host: target ATA host
|
||||||
* @irq: base IRQ number to request
|
* @irq: base IRQ number to request
|
||||||
* @n_msis: number of MSIs allocated for this host
|
|
||||||
* @irq_handler: irq_handler used when requesting IRQs
|
* @irq_handler: irq_handler used when requesting IRQs
|
||||||
* @irq_flags: irq_flags used when requesting IRQs
|
* @irq_flags: irq_flags used when requesting IRQs
|
||||||
*
|
*
|
||||||
|
@ -1241,14 +1243,10 @@ intx:
|
||||||
* RETURNS:
|
* RETURNS:
|
||||||
* 0 on success, -errno otherwise.
|
* 0 on success, -errno otherwise.
|
||||||
*/
|
*/
|
||||||
int ahci_host_activate(struct ata_host *host, int irq, unsigned int n_msis)
|
int ahci_host_activate(struct ata_host *host, int irq)
|
||||||
{
|
{
|
||||||
int i, rc;
|
int i, rc;
|
||||||
|
|
||||||
/* Sharing Last Message among several ports is not supported */
|
|
||||||
if (n_msis < host->n_ports)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
rc = ata_host_start(host);
|
rc = ata_host_start(host);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
|
@ -1296,7 +1294,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
struct ahci_host_priv *hpriv;
|
struct ahci_host_priv *hpriv;
|
||||||
struct ata_host *host;
|
struct ata_host *host;
|
||||||
int n_ports, n_msis, i, rc;
|
int n_ports, i, rc;
|
||||||
int ahci_pci_bar = AHCI_PCI_BAR_STANDARD;
|
int ahci_pci_bar = AHCI_PCI_BAR_STANDARD;
|
||||||
|
|
||||||
VPRINTK("ENTER\n");
|
VPRINTK("ENTER\n");
|
||||||
|
@ -1437,9 +1435,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||||
*/
|
*/
|
||||||
n_ports = max(ahci_nr_ports(hpriv->cap), fls(hpriv->port_map));
|
n_ports = max(ahci_nr_ports(hpriv->cap), fls(hpriv->port_map));
|
||||||
|
|
||||||
n_msis = ahci_init_interrupts(pdev, n_ports, hpriv);
|
ahci_init_interrupts(pdev, n_ports, hpriv);
|
||||||
if (n_msis > 1)
|
|
||||||
hpriv->flags |= AHCI_HFLAG_MULTI_MSI;
|
|
||||||
|
|
||||||
host = ata_host_alloc_pinfo(&pdev->dev, ppi, n_ports);
|
host = ata_host_alloc_pinfo(&pdev->dev, ppi, n_ports);
|
||||||
if (!host)
|
if (!host)
|
||||||
|
@ -1492,7 +1488,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||||
pci_set_master(pdev);
|
pci_set_master(pdev);
|
||||||
|
|
||||||
if (hpriv->flags & AHCI_HFLAG_MULTI_MSI)
|
if (hpriv->flags & AHCI_HFLAG_MULTI_MSI)
|
||||||
return ahci_host_activate(host, pdev->irq, n_msis);
|
return ahci_host_activate(host, pdev->irq);
|
||||||
|
|
||||||
return ata_host_activate(host, pdev->irq, ahci_interrupt, IRQF_SHARED,
|
return ata_host_activate(host, pdev->irq, ahci_interrupt, IRQF_SHARED,
|
||||||
&ahci_sht);
|
&ahci_sht);
|
||||||
|
|
|
@ -392,7 +392,7 @@ irqreturn_t ahci_interrupt(int irq, void *dev_instance);
|
||||||
irqreturn_t ahci_hw_interrupt(int irq, void *dev_instance);
|
irqreturn_t ahci_hw_interrupt(int irq, void *dev_instance);
|
||||||
irqreturn_t ahci_thread_fn(int irq, void *dev_instance);
|
irqreturn_t ahci_thread_fn(int irq, void *dev_instance);
|
||||||
void ahci_print_info(struct ata_host *host, const char *scc_s);
|
void ahci_print_info(struct ata_host *host, const char *scc_s);
|
||||||
int ahci_host_activate(struct ata_host *host, int irq, unsigned int n_msis);
|
int ahci_host_activate(struct ata_host *host, int irq);
|
||||||
void ahci_error_handler(struct ata_port *ap);
|
void ahci_error_handler(struct ata_port *ap);
|
||||||
|
|
||||||
static inline void __iomem *__ahci_port_base(struct ata_host *host,
|
static inline void __iomem *__ahci_port_base(struct ata_host *host,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue