diff options
Diffstat (limited to 'drivers/scsi/isci/host.c')
-rw-r--r-- | drivers/scsi/isci/host.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/drivers/scsi/isci/host.c b/drivers/scsi/isci/host.c index f07f30fada1..e7fe9c4c85b 100644 --- a/drivers/scsi/isci/host.c +++ b/drivers/scsi/isci/host.c | |||
@@ -1350,7 +1350,7 @@ static void isci_user_parameters_get(struct sci_user_parameters *u) | |||
1350 | u->stp_max_occupancy_timeout = stp_max_occ_to; | 1350 | u->stp_max_occupancy_timeout = stp_max_occ_to; |
1351 | u->ssp_max_occupancy_timeout = ssp_max_occ_to; | 1351 | u->ssp_max_occupancy_timeout = ssp_max_occ_to; |
1352 | u->no_outbound_task_timeout = no_outbound_task_to; | 1352 | u->no_outbound_task_timeout = no_outbound_task_to; |
1353 | u->max_number_concurrent_device_spin_up = max_concurr_spinup; | 1353 | u->max_concurr_spinup = max_concurr_spinup; |
1354 | } | 1354 | } |
1355 | 1355 | ||
1356 | static void sci_controller_initial_state_enter(struct sci_base_state_machine *sm) | 1356 | static void sci_controller_initial_state_enter(struct sci_base_state_machine *sm) |
@@ -1661,7 +1661,7 @@ static void sci_controller_set_default_config_parameters(struct isci_host *ihost | |||
1661 | ihost->oem_parameters.controller.mode_type = SCIC_PORT_AUTOMATIC_CONFIGURATION_MODE; | 1661 | ihost->oem_parameters.controller.mode_type = SCIC_PORT_AUTOMATIC_CONFIGURATION_MODE; |
1662 | 1662 | ||
1663 | /* Default to APC mode. */ | 1663 | /* Default to APC mode. */ |
1664 | ihost->oem_parameters.controller.max_concurrent_dev_spin_up = 1; | 1664 | ihost->oem_parameters.controller.max_concurr_spin_up = 1; |
1665 | 1665 | ||
1666 | /* Default to no SSC operation. */ | 1666 | /* Default to no SSC operation. */ |
1667 | ihost->oem_parameters.controller.do_enable_ssc = false; | 1667 | ihost->oem_parameters.controller.do_enable_ssc = false; |
@@ -1787,7 +1787,8 @@ int sci_oem_parameters_validate(struct sci_oem_params *oem) | |||
1787 | } else | 1787 | } else |
1788 | return -EINVAL; | 1788 | return -EINVAL; |
1789 | 1789 | ||
1790 | if (oem->controller.max_concurrent_dev_spin_up > MAX_CONCURRENT_DEVICE_SPIN_UP_COUNT) | 1790 | if (oem->controller.max_concurr_spin_up > MAX_CONCURRENT_DEVICE_SPIN_UP_COUNT || |
1791 | oem->controller.max_concurr_spin_up < 1) | ||
1791 | return -EINVAL; | 1792 | return -EINVAL; |
1792 | 1793 | ||
1793 | return 0; | 1794 | return 0; |
@@ -1810,6 +1811,16 @@ static enum sci_status sci_oem_parameters_set(struct isci_host *ihost) | |||
1810 | return SCI_FAILURE_INVALID_STATE; | 1811 | return SCI_FAILURE_INVALID_STATE; |
1811 | } | 1812 | } |
1812 | 1813 | ||
1814 | static u8 max_spin_up(struct isci_host *ihost) | ||
1815 | { | ||
1816 | if (ihost->user_parameters.max_concurr_spinup) | ||
1817 | return min_t(u8, ihost->user_parameters.max_concurr_spinup, | ||
1818 | MAX_CONCURRENT_DEVICE_SPIN_UP_COUNT); | ||
1819 | else | ||
1820 | return min_t(u8, ihost->oem_parameters.controller.max_concurr_spin_up, | ||
1821 | MAX_CONCURRENT_DEVICE_SPIN_UP_COUNT); | ||
1822 | } | ||
1823 | |||
1813 | static void power_control_timeout(unsigned long data) | 1824 | static void power_control_timeout(unsigned long data) |
1814 | { | 1825 | { |
1815 | struct sci_timer *tmr = (struct sci_timer *)data; | 1826 | struct sci_timer *tmr = (struct sci_timer *)data; |
@@ -1839,8 +1850,7 @@ static void power_control_timeout(unsigned long data) | |||
1839 | if (iphy == NULL) | 1850 | if (iphy == NULL) |
1840 | continue; | 1851 | continue; |
1841 | 1852 | ||
1842 | if (ihost->power_control.phys_granted_power >= | 1853 | if (ihost->power_control.phys_granted_power >= max_spin_up(ihost)) |
1843 | ihost->oem_parameters.controller.max_concurrent_dev_spin_up) | ||
1844 | break; | 1854 | break; |
1845 | 1855 | ||
1846 | ihost->power_control.requesters[i] = NULL; | 1856 | ihost->power_control.requesters[i] = NULL; |
@@ -1865,8 +1875,7 @@ void sci_controller_power_control_queue_insert(struct isci_host *ihost, | |||
1865 | { | 1875 | { |
1866 | BUG_ON(iphy == NULL); | 1876 | BUG_ON(iphy == NULL); |
1867 | 1877 | ||
1868 | if (ihost->power_control.phys_granted_power < | 1878 | if (ihost->power_control.phys_granted_power < max_spin_up(ihost)) { |
1869 | ihost->oem_parameters.controller.max_concurrent_dev_spin_up) { | ||
1870 | ihost->power_control.phys_granted_power++; | 1879 | ihost->power_control.phys_granted_power++; |
1871 | sci_phy_consume_power_handler(iphy); | 1880 | sci_phy_consume_power_handler(iphy); |
1872 | 1881 | ||