Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 254386
b: refs/heads/master
c: b5f18a2
h: refs/heads/master
v: v3
  • Loading branch information
Dave Jiang authored and Dan Williams committed Jul 3, 2011
1 parent 86f6d12 commit 476c438
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 38 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4711ba10b13891edf228944a9d0a21dfe7fe90f0
refs/heads/master: b5f18a201ed82ed3776c9950646689b93713ae57
73 changes: 38 additions & 35 deletions trunk/drivers/scsi/isci/core/scic_sds_controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -2548,41 +2548,46 @@ enum sci_status scic_user_parameters_set(
struct scic_sds_controller *scic,
union scic_user_parameters *scic_parms)
{
if (
(scic->parent.state_machine.current_state_id
== SCI_BASE_CONTROLLER_STATE_RESET)
|| (scic->parent.state_machine.current_state_id
== SCI_BASE_CONTROLLER_STATE_INITIALIZING)
|| (scic->parent.state_machine.current_state_id
== SCI_BASE_CONTROLLER_STATE_INITIALIZED)
) {
u32 state = scic->parent.state_machine.current_state_id;

if (state == SCI_BASE_CONTROLLER_STATE_RESET ||
state == SCI_BASE_CONTROLLER_STATE_INITIALIZING ||
state == SCI_BASE_CONTROLLER_STATE_INITIALIZED) {
u16 index;

/*
* Validate the user parameters. If they are not legal, then
* return a failure. */
* return a failure.
*/
for (index = 0; index < SCI_MAX_PHYS; index++) {
if (!(scic_parms->sds1.phys[index].max_speed_generation
<= SCIC_SDS_PARM_MAX_SPEED
&& scic_parms->sds1.phys[index].max_speed_generation
> SCIC_SDS_PARM_NO_SPEED))
struct sci_phy_user_params *user_phy;

user_phy = &scic_parms->sds1.phys[index];

if (!((user_phy->max_speed_generation <=
SCIC_SDS_PARM_MAX_SPEED) &&
(user_phy->max_speed_generation >
SCIC_SDS_PARM_NO_SPEED)))
return SCI_FAILURE_INVALID_PARAMETER_VALUE;

if (scic_parms->sds1.phys[index].in_connection_align_insertion_frequency < 3)
if (user_phy->in_connection_align_insertion_frequency <
3)
return SCI_FAILURE_INVALID_PARAMETER_VALUE;
if (
(scic_parms->sds1.phys[index].in_connection_align_insertion_frequency < 3) ||
(scic_parms->sds1.phys[index].align_insertion_frequency == 0) ||
(scic_parms->sds1.phys[index].notify_enable_spin_up_insertion_frequency == 0)
)

if ((user_phy->in_connection_align_insertion_frequency <
3) ||
(user_phy->align_insertion_frequency == 0) ||
(user_phy->
notify_enable_spin_up_insertion_frequency ==
0))
return SCI_FAILURE_INVALID_PARAMETER_VALUE;
}

if ((scic_parms->sds1.stp_inactivity_timeout == 0) ||
(scic_parms->sds1.ssp_inactivity_timeout == 0) ||
(scic_parms->sds1.stp_max_occupancy_timeout == 0) ||
(scic_parms->sds1.ssp_max_occupancy_timeout == 0) ||
(scic_parms->sds1.no_outbound_task_timeout == 0))
(scic_parms->sds1.ssp_inactivity_timeout == 0) ||
(scic_parms->sds1.stp_max_occupancy_timeout == 0) ||
(scic_parms->sds1.ssp_max_occupancy_timeout == 0) ||
(scic_parms->sds1.no_outbound_task_timeout == 0))
return SCI_FAILURE_INVALID_PARAMETER_VALUE;

memcpy(&scic->user_parameters, scic_parms, sizeof(*scic_parms));
Expand Down Expand Up @@ -2620,36 +2625,34 @@ enum sci_status scic_oem_parameters_set(
* Validate the oem parameters. If they are not legal, then
* return a failure. */
for (index = 0; index < SCI_MAX_PORTS; index++) {
if (scic_parms->sds1.ports[index].phy_mask > SCIC_SDS_PARM_PHY_MASK_MAX) {
if (scic_parms->sds1.ports[index].phy_mask > SCIC_SDS_PARM_PHY_MASK_MAX)
return SCI_FAILURE_INVALID_PARAMETER_VALUE;
}
}

for (index = 0; index < SCI_MAX_PHYS; index++) {
if (
scic_parms->sds1.phys[index].sas_address.high == 0
&& scic_parms->sds1.phys[index].sas_address.low == 0
) {
if ((scic_parms->sds1.phys[index].sas_address.high == 0) &&
(scic_parms->sds1.phys[index].sas_address.low == 0))
return SCI_FAILURE_INVALID_PARAMETER_VALUE;
}
}

if (scic_parms->sds1.controller.mode_type == SCIC_PORT_AUTOMATIC_CONFIGURATION_MODE) {
if (scic_parms->sds1.controller.mode_type ==
SCIC_PORT_AUTOMATIC_CONFIGURATION_MODE) {
for (index = 0; index < SCI_MAX_PHYS; index++) {
if (scic_parms->sds1.ports[index].phy_mask != 0)
return SCI_FAILURE_INVALID_PARAMETER_VALUE;
}
} else if (scic_parms->sds1.controller.mode_type == SCIC_PORT_MANUAL_CONFIGURATION_MODE) {
} else if (scic_parms->sds1.controller.mode_type ==
SCIC_PORT_MANUAL_CONFIGURATION_MODE) {
for (index = 0; index < SCI_MAX_PHYS; index++)
combined_phy_mask |= scic_parms->sds1.ports[index].phy_mask;

if (combined_phy_mask == 0)
return SCI_FAILURE_INVALID_PARAMETER_VALUE;
} else {
} else
return SCI_FAILURE_INVALID_PARAMETER_VALUE;
}

if (scic_parms->sds1.controller.max_concurrent_dev_spin_up > MAX_CONCURRENT_DEVICE_SPIN_UP_COUNT)
if (scic_parms->sds1.controller.max_concurrent_dev_spin_up >
MAX_CONCURRENT_DEVICE_SPIN_UP_COUNT)
return SCI_FAILURE_INVALID_PARAMETER_VALUE;

scic->oem_parameters.sds1 = scic_parms->sds1;
Expand Down
28 changes: 27 additions & 1 deletion trunk/drivers/scsi/isci/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,32 @@ static void __iomem *smu_base(struct isci_host *isci_host)
return pcim_iomap_table(pdev)[SCI_SMU_BAR * 2] + SCI_SMU_BAR_SIZE * id;
}

static void isci_user_parameters_get(
struct isci_host *isci_host,
union scic_user_parameters *scic_user_params)
{
struct scic_sds_user_parameters *u = &scic_user_params->sds1;
int i;

for (i = 0; i < SCI_MAX_PHYS; i++) {
struct sci_phy_user_params *u_phy = &u->phys[i];

u_phy->max_speed_generation = phy_gen;

/* we are not exporting these for now */
u_phy->align_insertion_frequency = 0x7f;
u_phy->in_connection_align_insertion_frequency = 0xff;
u_phy->notify_enable_spin_up_insertion_frequency = 0x33;
}

u->stp_inactivity_timeout = stp_inactive_to;
u->ssp_inactivity_timeout = ssp_inactive_to;
u->stp_max_occupancy_timeout = stp_max_occ_to;
u->ssp_max_occupancy_timeout = ssp_max_occ_to;
u->no_outbound_task_timeout = no_outbound_task_to;
u->max_number_concurrent_device_spin_up = max_concurr_spinup;
}

int isci_host_init(struct isci_host *isci_host)
{
int err = 0, i;
Expand Down Expand Up @@ -462,7 +488,7 @@ int isci_host_init(struct isci_host *isci_host)
* grab initial values stored in the controller object for OEM and USER
* parameters
*/
scic_user_parameters_get(controller, &scic_user_params);
isci_user_parameters_get(isci_host, &scic_user_params);
status = scic_user_parameters_set(isci_host->core_controller,
&scic_user_params);
if (status != SCI_SUCCESS) {
Expand Down
30 changes: 29 additions & 1 deletion trunk/drivers/scsi/isci/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,37 @@ int isci_si_rev = ISCI_SI_REVA2;
#else
int isci_si_rev = ISCI_SI_REVB0;
#endif
module_param(isci_si_rev, int, S_IRUGO | S_IWUSR);
module_param(isci_si_rev, int, 0);
MODULE_PARM_DESC(isci_si_rev, "override default si rev (0: A0 1: A2 2: B0)");

unsigned char no_outbound_task_to = 20;
module_param(no_outbound_task_to, byte, 0);
MODULE_PARM_DESC(no_outbound_task_to, "No Outbound Task Timeout (1us incr)");

u16 ssp_max_occ_to = 20;
module_param(ssp_max_occ_to, ushort, 0);
MODULE_PARM_DESC(ssp_max_occ_to, "SSP Max occupancy timeout (100us incr)");

u16 stp_max_occ_to = 5;
module_param(stp_max_occ_to, ushort, 0);
MODULE_PARM_DESC(stp_max_occ_to, "STP Max occupancy timeout (100us incr)");

u16 ssp_inactive_to = 5;
module_param(ssp_inactive_to, ushort, 0);
MODULE_PARM_DESC(ssp_inactive_to, "SSP inactivity timeout (100us incr)");

u16 stp_inactive_to = 5;
module_param(stp_inactive_to, ushort, 0);
MODULE_PARM_DESC(stp_inactive_to, "STP inactivity timeout (100us incr)");

unsigned char phy_gen = 3;
module_param(phy_gen, byte, 0);
MODULE_PARM_DESC(phy_gen, "PHY generation (1: 1.5Gbps 2: 3.0Gbps 3: 6.0Gbps)");

unsigned char max_concurr_spinup = 1;
module_param(max_concurr_spinup, byte, 0);
MODULE_PARM_DESC(max_concurr_spinup, "Max concurrent device spinup");

static struct scsi_host_template isci_sht = {

.module = THIS_MODULE,
Expand Down
8 changes: 8 additions & 0 deletions trunk/drivers/scsi/isci/isci.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@
#include "task.h"
#include "sata.h"

extern unsigned char no_outbound_task_to;
extern u16 ssp_max_occ_to;
extern u16 stp_max_occ_to;
extern u16 ssp_inactive_to;
extern u16 stp_inactive_to;
extern unsigned char phy_gen;
extern unsigned char max_concurr_spinup;

irqreturn_t isci_msix_isr(int vec, void *data);
irqreturn_t isci_intx_isr(int vec, void *data);
irqreturn_t isci_error_isr(int vec, void *data);
Expand Down

0 comments on commit 476c438

Please sign in to comment.