summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/os/sunpm.c
diff options
context:
space:
mode:
authorJane Chu <Jane.Chu@Sun.COM>2009-07-20 10:00:36 -0700
committerJane Chu <Jane.Chu@Sun.COM>2009-07-20 10:00:36 -0700
commit2ee4dfc799525d35706ee64a901cd970a7080bb6 (patch)
tree3e498f3775dd50b9f96f965f90e405dc06ee8985 /usr/src/uts/common/os/sunpm.c
parent0ba964ea1a9461d43c8e39e5a9a3ab857e6786c7 (diff)
downloadillumos-joyent-2ee4dfc799525d35706ee64a901cd970a7080bb6.tar.gz
PSARC/2009/310 Disk IO PM Enhancement
6832245 "pm-capable" property updates 6832232 enhanced sd(7D) to support power condition field in Start-Stop Unit command 6781588 sata(7D) to support additional Mode Sense and Log Sense for PM 6832247 sata(7D) enhancement for SBC-3 power conditions and ATA power conditions translation 6827942 pm_trans_check enhancement
Diffstat (limited to 'usr/src/uts/common/os/sunpm.c')
-rw-r--r--usr/src/uts/common/os/sunpm.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/usr/src/uts/common/os/sunpm.c b/usr/src/uts/common/os/sunpm.c
index 7570cd29e6..c5850599ef 100644
--- a/usr/src/uts/common/os/sunpm.c
+++ b/usr/src/uts/common/os/sunpm.c
@@ -6590,6 +6590,7 @@ pm_trans_check(struct pm_trans_data *datap, time_t *intervalp)
char *ptr;
int lower_bound_cycles, upper_bound_cycles, cycles_allowed;
int cycles_diff, cycles_over;
+ struct pm_smart_count *smart_p;
if (datap == NULL) {
PMD(PMD_TCHECK, ("%s: NULL data pointer!\n", pmf))
@@ -6771,6 +6772,18 @@ pm_trans_check(struct pm_trans_data *datap, time_t *intervalp)
PMD(PMD_TCHECK, ("%s: no cycle is allowed in %ld secs\n", pmf,
*intervalp))
return (0);
+ } else if (datap->format == DC_SMART_FORMAT) {
+ /*
+ * power cycles of SATA disks are reported from SMART
+ * attributes.
+ */
+ smart_p = &datap->un.smart_count;
+ if (smart_p->consumed >= smart_p->allowed) {
+ *intervalp = (LONG_MAX / hz);
+ PMD(PMD_TCHECK, ("%s: exceeded lifemax cycles.\n", pmf))
+ return (0);
+ } else
+ return (1);
}
PMD(PMD_TCHECK, ("%s: unknown format!\n", pmf))