aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ata/libahci.c17
-rw-r--r--drivers/ata/libata-core.c2
2 files changed, 16 insertions, 3 deletions
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index 633159b5152a..d38c40fe4ddb 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -1919,7 +1919,17 @@ static void ahci_pmp_attach(struct ata_port *ap)
1919 ahci_enable_fbs(ap); 1919 ahci_enable_fbs(ap);
1920 1920
1921 pp->intr_mask |= PORT_IRQ_BAD_PMP; 1921 pp->intr_mask |= PORT_IRQ_BAD_PMP;
1922 writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK); 1922
1923 /*
1924 * We must not change the port interrupt mask register if the
1925 * port is marked frozen, the value in pp->intr_mask will be
1926 * restored later when the port is thawed.
1927 *
1928 * Note that during initialization, the port is marked as
1929 * frozen since the irq handler is not yet registered.
1930 */
1931 if (!(ap->pflags & ATA_PFLAG_FROZEN))
1932 writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK);
1923} 1933}
1924 1934
1925static void ahci_pmp_detach(struct ata_port *ap) 1935static void ahci_pmp_detach(struct ata_port *ap)
@@ -1935,7 +1945,10 @@ static void ahci_pmp_detach(struct ata_port *ap)
1935 writel(cmd, port_mmio + PORT_CMD); 1945 writel(cmd, port_mmio + PORT_CMD);
1936 1946
1937 pp->intr_mask &= ~PORT_IRQ_BAD_PMP; 1947 pp->intr_mask &= ~PORT_IRQ_BAD_PMP;
1938 writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK); 1948
1949 /* see comment above in ahci_pmp_attach() */
1950 if (!(ap->pflags & ATA_PFLAG_FROZEN))
1951 writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK);
1939} 1952}
1940 1953
1941int ahci_port_resume(struct ata_port *ap) 1954int ahci_port_resume(struct ata_port *ap)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 423c0a6952b2..5096b2a24a17 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5480,7 +5480,7 @@ struct ata_port *ata_port_alloc(struct ata_host *host)
5480 if (!ap) 5480 if (!ap)
5481 return NULL; 5481 return NULL;
5482 5482
5483 ap->pflags |= ATA_PFLAG_INITIALIZING; 5483 ap->pflags |= ATA_PFLAG_INITIALIZING | ATA_PFLAG_FROZEN;
5484 ap->lock = &host->lock; 5484 ap->lock = &host->lock;
5485 ap->print_id = -1; 5485 ap->print_id = -1;
5486 ap->host = host; 5486 ap->host = host;