diff options
author | Andrzej Jakowski <andrzej.jakowski@intel.com> | 2011-10-27 18:05:42 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-10-31 05:23:18 -0400 |
commit | 7000f7c71e2457391e3249eac1ae53c91f49a8c0 (patch) | |
tree | bf2567c0d927c691932a701b45bcf17a9a7cfdcc /drivers/scsi | |
parent | 52d74634335dfc0984ed955ed3c6ad6488495f96 (diff) |
[SCSI] isci: overriding max_concurr_spinup oem parameter by max(oem, user)
Fixes bug where max_concurr_spinup oem parameter should be
overriden by max_concurr_spinup user parameter. Override should
happen only when max_concurr_spinup user parameter is specified
in command line (greater than 0). Also this fix shortens variables
representing max_conxurr_spinup for oem and user parameters.
Signed-off-by: Andrzej Jakowski <andrzej.jakowski@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')
-rw-r--r-- | drivers/scsi/isci/host.c | 23 | ||||
-rw-r--r-- | drivers/scsi/isci/init.c | 2 | ||||
-rw-r--r-- | drivers/scsi/isci/probe_roms.h | 4 |
3 files changed, 19 insertions, 10 deletions
diff --git a/drivers/scsi/isci/host.c b/drivers/scsi/isci/host.c index f07f30fada1b..e7fe9c4c85b8 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 | ||
diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c index 43fe840fbe9c..a97edabcb85a 100644 --- a/drivers/scsi/isci/init.c +++ b/drivers/scsi/isci/init.c | |||
@@ -118,7 +118,7 @@ unsigned char phy_gen = 3; | |||
118 | module_param(phy_gen, byte, 0); | 118 | module_param(phy_gen, byte, 0); |
119 | MODULE_PARM_DESC(phy_gen, "PHY generation (1: 1.5Gbps 2: 3.0Gbps 3: 6.0Gbps)"); | 119 | MODULE_PARM_DESC(phy_gen, "PHY generation (1: 1.5Gbps 2: 3.0Gbps 3: 6.0Gbps)"); |
120 | 120 | ||
121 | unsigned char max_concurr_spinup = 1; | 121 | unsigned char max_concurr_spinup; |
122 | module_param(max_concurr_spinup, byte, 0); | 122 | module_param(max_concurr_spinup, byte, 0); |
123 | MODULE_PARM_DESC(max_concurr_spinup, "Max concurrent device spinup"); | 123 | MODULE_PARM_DESC(max_concurr_spinup, "Max concurrent device spinup"); |
124 | 124 | ||
diff --git a/drivers/scsi/isci/probe_roms.h b/drivers/scsi/isci/probe_roms.h index dc007e692f4e..2c75248ca326 100644 --- a/drivers/scsi/isci/probe_roms.h +++ b/drivers/scsi/isci/probe_roms.h | |||
@@ -112,7 +112,7 @@ struct sci_user_parameters { | |||
112 | * This field specifies the maximum number of direct attached devices | 112 | * This field specifies the maximum number of direct attached devices |
113 | * that can have power supplied to them simultaneously. | 113 | * that can have power supplied to them simultaneously. |
114 | */ | 114 | */ |
115 | u8 max_number_concurrent_device_spin_up; | 115 | u8 max_concurr_spinup; |
116 | 116 | ||
117 | /** | 117 | /** |
118 | * This field specifies the number of seconds to allow a phy to consume | 118 | * This field specifies the number of seconds to allow a phy to consume |
@@ -219,7 +219,7 @@ struct sci_bios_oem_param_block_hdr { | |||
219 | struct sci_oem_params { | 219 | struct sci_oem_params { |
220 | struct { | 220 | struct { |
221 | uint8_t mode_type; | 221 | uint8_t mode_type; |
222 | uint8_t max_concurrent_dev_spin_up; | 222 | uint8_t max_concurr_spin_up; |
223 | uint8_t do_enable_ssc; | 223 | uint8_t do_enable_ssc; |
224 | uint8_t reserved; | 224 | uint8_t reserved; |
225 | } controller; | 225 | } controller; |