diff mbox

SATA link power management issues

Message ID 20150112131602.GX25319@htj.dyndns.org
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

Tejun Heo Jan. 12, 2015, 1:16 p.m. UTC
Hello,

What you're experiencing looks like the ssd behaving badly after link
state transition.  I wonder whether the right solution is plugging
PHYRDY IRQ for a while after LPM state change.  Does the following
path make any difference?

Thanks.

Comments

Gabriele Mazzotta Jan. 12, 2015, 5:03 p.m. UTC | #1
On Monday 12 January 2015 08:16:02 Tejun Heo wrote:
> Hello,
> 
> What you're experiencing looks like the ssd behaving badly after link
> state transition.  I wonder whether the right solution is plugging
> PHYRDY IRQ for a while after LPM state change.  Does the following
> path make any difference?
> 
> Thanks.
> 
> diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
> index 97683e4..684f45d 100644
> --- a/drivers/ata/libahci.c
> +++ b/drivers/ata/libahci.c
> @@ -735,8 +735,8 @@ static int ahci_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
>  		sata_link_scr_lpm(link, policy, false);
>  
>  		/* turn PHYRDY IRQ back on */
> -		pp->intr_mask |= PORT_IRQ_PHYRDY;
> -		writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK);
> +		//pp->intr_mask |= PORT_IRQ_PHYRDY;
> +		//writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK);
>  	}
>  
>  	return 0;

Hi,

I tried it and got the same result:

[  451.077463] ahci 0000:00:1f.2: port does not support device sleep
[  452.162451] ata3.00: exception Emask 0x10 SAct 0x400 SErr 0x50000 action 0xe frozen
[  452.162461] ata3.00: irq_stat 0x00400008, PHY RDY changed
[  452.162467] ata3: SError: { PHYRdyChg CommWake }
[  452.162473] ata3.00: failed command: WRITE FPDMA QUEUED
[  452.162484] ata3.00: cmd 61/58:50:98:7c:4b/00:00:17:00:00/40 tag 10 ncq 45056 out
         res 40/00:54:98:7c:4b/00:00:17:00:00/40 Emask 0x10 (ATA bus error)
[  452.162489] ata3.00: status: { DRDY }
[  452.162497] ata3: hard resetting link
[  452.886958] ata3: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[  452.890384] ata3.00: configured for UDMA/133
[  452.902976] ahci 0000:00:1f.2: port does not support device sleep
[  452.903002] ata3: EH complete

Gabriele
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tejun Heo Jan. 12, 2015, 5:07 p.m. UTC | #2
Hello, Gabriele.

On Mon, Jan 12, 2015 at 06:03:41PM +0100, Gabriele Mazzotta wrote:
> I tried it and got the same result:
> 
> [  451.077463] ahci 0000:00:1f.2: port does not support device sleep
> [  452.162451] ata3.00: exception Emask 0x10 SAct 0x400 SErr 0x50000 action 0xe frozen
> [  452.162461] ata3.00: irq_stat 0x00400008, PHY RDY changed
> [  452.162467] ata3: SError: { PHYRdyChg CommWake }
> [  452.162473] ata3.00: failed command: WRITE FPDMA QUEUED
> [  452.162484] ata3.00: cmd 61/58:50:98:7c:4b/00:00:17:00:00/40 tag 10 ncq 45056 out
>          res 40/00:54:98:7c:4b/00:00:17:00:00/40 Emask 0x10 (ATA bus error)
> [  452.162489] ata3.00: status: { DRDY }
> [  452.162497] ata3: hard resetting link
> [  452.886958] ata3: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
> [  452.890384] ata3.00: configured for UDMA/133
> [  452.902976] ahci 0000:00:1f.2: port does not support device sleep
> [  452.903002] ata3: EH complete

Hah, that's weird.  Can you please double check that you're actually
running the patched kernel by throwing in a printk around the
commented out section?  If leaving phy irqs turned off doesn't make
the problem go away, I'm not sure there's much we can do.  Hmmm... one
option could be holding off speed-down verdict after LPM state
transition, but it looks like the ssd in question is misbehaving
pretty badly.

Thanks.
Gabriele Mazzotta Jan. 12, 2015, 5:15 p.m. UTC | #3
On Monday 12 January 2015 12:07:34 Tejun Heo wrote:
> Hello, Gabriele.
> 
> On Mon, Jan 12, 2015 at 06:03:41PM +0100, Gabriele Mazzotta wrote:
> > I tried it and got the same result:
> > 
> > [  451.077463] ahci 0000:00:1f.2: port does not support device sleep
> > [  452.162451] ata3.00: exception Emask 0x10 SAct 0x400 SErr 0x50000 action 0xe frozen
> > [  452.162461] ata3.00: irq_stat 0x00400008, PHY RDY changed
> > [  452.162467] ata3: SError: { PHYRdyChg CommWake }
> > [  452.162473] ata3.00: failed command: WRITE FPDMA QUEUED
> > [  452.162484] ata3.00: cmd 61/58:50:98:7c:4b/00:00:17:00:00/40 tag 10 ncq 45056 out
> >          res 40/00:54:98:7c:4b/00:00:17:00:00/40 Emask 0x10 (ATA bus error)
> > [  452.162489] ata3.00: status: { DRDY }
> > [  452.162497] ata3: hard resetting link
> > [  452.886958] ata3: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
> > [  452.890384] ata3.00: configured for UDMA/133
> > [  452.902976] ahci 0000:00:1f.2: port does not support device sleep
> > [  452.903002] ata3: EH complete
> 
> Hah, that's weird.  Can you please double check that you're actually
> running the patched kernel by throwing in a printk around the
> commented out section?  If leaving phy irqs turned off doesn't make
> the problem go away, I'm not sure there's much we can do.  Hmmm... one
> option could be holding off speed-down verdict after LPM state
> transition, but it looks like the ssd in question is misbehaving
> pretty badly.
> 
> Thanks.

Done:

[  168.515793] ahci 0000:00:1f.2: port does not support device sleep
[  168.515800] Skip turn PHYRDY IRQ back on
[  168.515802] turn PHYRDY IRQ back on skipped
[  168.523793] ata3.00: exception Emask 0x10 SAct 0x40 SErr 0x50000 action 0xe frozen
[  168.523798] ata3.00: irq_stat 0x00400008, PHY RDY changed
[  168.523801] ata3: SError: { PHYRdyChg CommWake }
[  168.523805] ata3.00: failed command: WRITE FPDMA QUEUED
[  168.523811] ata3.00: cmd 61/28:30:68:60:4b/00:00:17:00:00/40 tag 6 ncq 20480 out
         res 40/00:34:68:60:4b/00:00:17:00:00/40 Emask 0x10 (ATA bus error)
[  168.523814] ata3.00: status: { DRDY }
[  168.523819] ata3: hard resetting link
[  169.248384] ata3: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[  169.251661] ata3.00: configured for UDMA/133
[  169.264293] ahci 0000:00:1f.2: port does not support device sleep
[  169.264299] Skip turn PHYRDY IRQ back on
[  169.264301] turn PHYRDY IRQ back on skipped
[  169.264315] ata3: EH complete
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index 97683e4..684f45d 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -735,8 +735,8 @@  static int ahci_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
 		sata_link_scr_lpm(link, policy, false);
 
 		/* turn PHYRDY IRQ back on */
-		pp->intr_mask |= PORT_IRQ_PHYRDY;
-		writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK);
+		//pp->intr_mask |= PORT_IRQ_PHYRDY;
+		//writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK);
 	}
 
 	return 0;