summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/host.c
diff options
context:
space:
mode:
authorMarcin Tomczak <marcin.tomczak@intel.com>2012-01-27 20:14:50 +0100
committerJames Bottomley <JBottomley@Parallels.com>2012-02-19 15:09:00 +0100
commite5cc6aa4b6ef34c3f054af8c61a4f73c157589c3 (patch)
tree64efa1d1dbece4ce058e7cd19b205bde9ef5bdc1 /drivers/scsi/isci/host.c
parent[SCSI] libiscsi: fix cmd timeout/completion race (diff)
downloadlinux-e5cc6aa4b6ef34c3f054af8c61a4f73c157589c3.tar.xz
linux-e5cc6aa4b6ef34c3f054af8c61a4f73c157589c3.zip
[SCSI] isci: enable clock gating
Enabling clock gating for power savings on entry to controller ready state. Disable SCU clock gating for power savings on exit from the controller ready state. The gating is fully automated by silicon after setting the mode. Signed-off-by: Marcin Tomczak <marcin.tomczak@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/isci/host.c')
-rw-r--r--drivers/scsi/isci/host.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/scsi/isci/host.c b/drivers/scsi/isci/host.c
index 418391b1c361..508aa8ce25b4 100644
--- a/drivers/scsi/isci/host.c
+++ b/drivers/scsi/isci/host.c
@@ -1491,6 +1491,15 @@ sci_controller_set_interrupt_coalescence(struct isci_host *ihost,
static void sci_controller_ready_state_enter(struct sci_base_state_machine *sm)
{
struct isci_host *ihost = container_of(sm, typeof(*ihost), sm);
+ u32 val;
+
+ /* enable clock gating for power control of the scu unit */
+ val = readl(&ihost->smu_registers->clock_gating_control);
+ val &= ~(SMU_CGUCR_GEN_BIT(REGCLK_ENABLE) |
+ SMU_CGUCR_GEN_BIT(TXCLK_ENABLE) |
+ SMU_CGUCR_GEN_BIT(XCLK_ENABLE));
+ val |= SMU_CGUCR_GEN_BIT(IDLE_ENABLE);
+ writel(val, &ihost->smu_registers->clock_gating_control);
/* set the default interrupt coalescence number and timeout value. */
sci_controller_set_interrupt_coalescence(ihost, 0, 0);