Bug 69311 - /sys/class/ata_link/*/sata_spd doesn't seem to reflect libata.force=1.5G
Summary: /sys/class/ata_link/*/sata_spd doesn't seem to reflect libata.force=1.5G
Status: NEW
Alias: None
Product: IO/Storage
Classification: Unclassified
Component: Serial ATA (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Tejun Heo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-23 17:30 UTC by Joe Sapp
Modified: 2016-03-19 17:00 UTC (History)
2 users (show)

See Also:
Kernel Version: 3.13.0
Subsystem:
Regression: No
Bisected commit-id:


Attachments
dmesg from kernel 3.13.0 (80.46 KB, application/octet-stream)
2014-01-23 17:30 UTC, Joe Sapp
Details

Description Joe Sapp 2014-01-23 17:30:39 UTC
Created attachment 123121 [details]
dmesg from kernel 3.13.0

According to Documentation/ABI/testing/sysfs-ata, "/sys/class/ata_link/*/sata_spd" should report the current speed of the link.  It seems to not be reporting the speed of the link, or perhaps the link speed isn't being modified like I've requested (or maybe the documentation is wrong).  I'm trying to limit the link speed to 1.5Gbps, but it only seems to be limiting the "speed limit" (I suspect a hardware incompatibility, but am having a tough time debugging it).

/sys/class/ata_link/link1/hw_sata_spd_limit:
1.5 Gbps

/sys/class/ata_link/link1/sata_spd_limit:
1.5 Gbps

/sys/class/ata_link/link1/sata_spd:
3.0 Gbps
Comment 1 Levente Kurusa 2014-02-14 21:25:46 UTC
How are you trying to limit the link speed?

Thanks,
Levente Kurusa
Comment 2 Joe Sapp 2014-02-14 23:20:36 UTC
(In reply to Levente Kurusa from comment #1)
> How are you trying to limit the link speed?

By specifying "libata.force=1:1.5G" on the kernel command line.
Comment 3 Levente Kurusa 2014-02-15 08:23:37 UTC
So from my understanding hw_sata_spd_limit should show 3Gbps since your PHY
supports that?
sata_spd_limit is correct since libata enforces that speed.
sata_spd is obviously broken, since it should show the current link speed which
was limited down to 1.5 by libata and hence should show 1.5
Right?

PS, I'll take a look at this now.
Comment 4 Joe Sapp 2014-02-15 17:36:14 UTC
(In reply to Levente Kurusa from comment #3)
> So from my understanding hw_sata_spd_limit should show 3Gbps since your PHY
> supports that?
> sata_spd_limit is correct since libata enforces that speed.
> sata_spd is obviously broken, since it should show the current link speed
> which
> was limited down to 1.5 by libata and hence should show 1.5
> Right?

I think hw_sata_spd_limit should show 3Gbps since that's what's "supported by the connected SATA device" (the hard disk in this case?).
Otherwise, yes, this is what I would've expected too based on the docs.

Thanks for taking a look!
Comment 5 Levente Kurusa 2014-02-16 09:50:50 UTC
Took a look at your dmesg,

The force gets applied before the link is up, which is correct. However, it
seems that it does not get applied when the link gets up. I will run a few qemu
tests today to debug it a bit more.

Thanks,
Levente Kurusa

Note You need to log in before you can comment on or make changes to this bug.