X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=drivers%2Fata%2Flibahci.c;h=7461a587b39b4e9d953e3a0063b9f1fb8cad0319;hb=0516900adfa1955f91f1c310f9a2fa857949de1c;hp=71b07198e207d2577a8e52fe736f91f54b39a226;hpb=0efacbbaee1e94e9942da0912f5b46ffd45a74bd;p=deliverable%2Flinux.git diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 71b07198e207..7461a587b39b 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -1975,7 +1975,7 @@ unsigned int ahci_qc_issue(struct ata_queued_cmd *qc) */ pp->active_link = qc->dev->link; - if (qc->tf.protocol == ATA_PROT_NCQ) + if (ata_is_ncq(qc->tf.protocol)) writel(1 << qc->tag, port_mmio + PORT_SCR_ACT); if (pp->fbs_enabled && pp->fbs_last_dev != qc->dev->link->pmp) { @@ -2392,12 +2392,20 @@ static int ahci_port_start(struct ata_port *ap) static void ahci_port_stop(struct ata_port *ap) { const char *emsg = NULL; + struct ahci_host_priv *hpriv = ap->host->private_data; + void __iomem *host_mmio = hpriv->mmio; int rc; /* de-initialize port */ rc = ahci_deinit_port(ap, &emsg); if (rc) ata_port_warn(ap, "%s (%d)\n", emsg, rc); + + /* + * Clear GHC.IS to prevent stuck INTx after disabling MSI and + * re-enabling INTx. + */ + writel(1 << ap->port_no, host_mmio + HOST_IRQ_STAT); } void ahci_print_info(struct ata_host *host, const char *scc_s)