* [PATCH] libata: Fix display of sata speed
@ 2013-10-25 23:28 Gwendal Grignou
2013-10-25 23:28 ` Gwendal Grignou
0 siblings, 1 reply; 3+ messages in thread
From: Gwendal Grignou @ 2013-10-25 23:28 UTC (permalink / raw)
To: tj; +Cc: linux-ide, Gwendal Grignou
I already submitted this patch 2 years ago, but I did not
follow up at that time. [http://www.spinics.net/lists/linux-ide/msg41900.html]
Resend, after cleaning header and fixing a lint error.
Gwendal Grignou (1):
libata: Fix display of sata speed
drivers/ata/libata-transport.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
--
1.8.4.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] libata: Fix display of sata speed
2013-10-25 23:28 [PATCH] libata: Fix display of sata speed Gwendal Grignou
@ 2013-10-25 23:28 ` Gwendal Grignou
2013-10-27 11:44 ` Tejun Heo
0 siblings, 1 reply; 3+ messages in thread
From: Gwendal Grignou @ 2013-10-25 23:28 UTC (permalink / raw)
To: tj; +Cc: linux-ide, Gwendal Grignou
6.0 Gbps link speed was not decoded properly:
speed was reported at 3.0 Gbps only.
Tested: On a machine where libata reports 6.0 Gbps in
/var/log/messages:
ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
Before:
cat /sys/class/ata_link/link1/sata_spd
3.0 Gbps
After:
cat /sys/class/ata_link/link1/sata_spd
6.0 Gbps
Signed-off-by: Gwendal Grignou <gwendal@google.com>
---
drivers/ata/libata-transport.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c
index 150a917..e37413228 100644
--- a/drivers/ata/libata-transport.c
+++ b/drivers/ata/libata-transport.c
@@ -321,25 +321,25 @@ int ata_tport_add(struct device *parent,
/*
* ATA link attributes
*/
+static int noop(int x) { return x; }
-
-#define ata_link_show_linkspeed(field) \
+#define ata_link_show_linkspeed(field, format) \
static ssize_t \
show_ata_link_##field(struct device *dev, \
struct device_attribute *attr, char *buf) \
{ \
struct ata_link *link = transport_class_to_link(dev); \
\
- return sprintf(buf,"%s\n", sata_spd_string(fls(link->field))); \
+ return sprintf(buf, "%s\n", sata_spd_string(format(link->field))); \
}
-#define ata_link_linkspeed_attr(field) \
- ata_link_show_linkspeed(field) \
+#define ata_link_linkspeed_attr(field, format) \
+ ata_link_show_linkspeed(field, format) \
static DEVICE_ATTR(field, S_IRUGO, show_ata_link_##field, NULL)
-ata_link_linkspeed_attr(hw_sata_spd_limit);
-ata_link_linkspeed_attr(sata_spd_limit);
-ata_link_linkspeed_attr(sata_spd);
+ata_link_linkspeed_attr(hw_sata_spd_limit, fls);
+ata_link_linkspeed_attr(sata_spd_limit, fls);
+ata_link_linkspeed_attr(sata_spd, noop);
static DECLARE_TRANSPORT_CLASS(ata_link_class,
--
1.8.4.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] libata: Fix display of sata speed
2013-10-25 23:28 ` Gwendal Grignou
@ 2013-10-27 11:44 ` Tejun Heo
0 siblings, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2013-10-27 11:44 UTC (permalink / raw)
To: Gwendal Grignou; +Cc: linux-ide
On Fri, Oct 25, 2013 at 04:28:57PM -0700, Gwendal Grignou wrote:
> 6.0 Gbps link speed was not decoded properly:
> speed was reported at 3.0 Gbps only.
>
> Tested: On a machine where libata reports 6.0 Gbps in
> /var/log/messages:
> ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
>
> Before:
> cat /sys/class/ata_link/link1/sata_spd
> 3.0 Gbps
> After:
> cat /sys/class/ata_link/link1/sata_spd
> 6.0 Gbps
>
> Signed-off-by: Gwendal Grignou <gwendal@google.com>
Applied to libata/for-3.13 with stable cc'd.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-10-27 11:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-25 23:28 [PATCH] libata: Fix display of sata speed Gwendal Grignou
2013-10-25 23:28 ` Gwendal Grignou
2013-10-27 11:44 ` Tejun Heo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).