mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 23:25:07 +00:00
scsi: smartpqi: add inquiry timeouts
Add timeout field in RAID IU. Link: https://lore.kernel.org/r/157048749461.11757.10013040278241807855.stgit@brunhilda Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: koshyaji <ajish.koshy@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
b969261134
commit
21432010d5
2 changed files with 33 additions and 7 deletions
|
@ -276,7 +276,9 @@ struct pqi_raid_path_request {
|
||||||
u8 reserved4 : 2;
|
u8 reserved4 : 2;
|
||||||
u8 additional_cdb_bytes_usage : 3;
|
u8 additional_cdb_bytes_usage : 3;
|
||||||
u8 reserved5 : 3;
|
u8 reserved5 : 3;
|
||||||
u8 cdb[32];
|
u8 cdb[16];
|
||||||
|
u8 reserved6[12];
|
||||||
|
__le32 timeout;
|
||||||
struct pqi_sg_descriptor
|
struct pqi_sg_descriptor
|
||||||
sg_descriptors[PQI_MAX_EMBEDDED_SG_DESCRIPTORS];
|
sg_descriptors[PQI_MAX_EMBEDDED_SG_DESCRIPTORS];
|
||||||
};
|
};
|
||||||
|
@ -761,6 +763,7 @@ struct pqi_config_table_firmware_features {
|
||||||
#define PQI_FIRMWARE_FEATURE_OFA 0
|
#define PQI_FIRMWARE_FEATURE_OFA 0
|
||||||
#define PQI_FIRMWARE_FEATURE_SMP 1
|
#define PQI_FIRMWARE_FEATURE_SMP 1
|
||||||
#define PQI_FIRMWARE_FEATURE_SOFT_RESET_HANDSHAKE 11
|
#define PQI_FIRMWARE_FEATURE_SOFT_RESET_HANDSHAKE 11
|
||||||
|
#define PQI_FIRMWARE_FEATURE_RAID_IU_TIMEOUT 13
|
||||||
|
|
||||||
struct pqi_config_table_debug {
|
struct pqi_config_table_debug {
|
||||||
struct pqi_config_table_section_header header;
|
struct pqi_config_table_section_header header;
|
||||||
|
@ -1138,6 +1141,7 @@ struct pqi_ctrl_info {
|
||||||
u8 pqi_mode_enabled : 1;
|
u8 pqi_mode_enabled : 1;
|
||||||
u8 pqi_reset_quiesce_supported : 1;
|
u8 pqi_reset_quiesce_supported : 1;
|
||||||
u8 soft_reset_handshake_supported : 1;
|
u8 soft_reset_handshake_supported : 1;
|
||||||
|
u8 raid_iu_timeout_supported: 1;
|
||||||
|
|
||||||
struct list_head scsi_device_list;
|
struct list_head scsi_device_list;
|
||||||
spinlock_t scsi_device_list_lock;
|
spinlock_t scsi_device_list_lock;
|
||||||
|
|
|
@ -6098,6 +6098,9 @@ static int pqi_passthru_ioctl(struct pqi_ctrl_info *ctrl_info, void __user *arg)
|
||||||
|
|
||||||
put_unaligned_le16(iu_length, &request.header.iu_length);
|
put_unaligned_le16(iu_length, &request.header.iu_length);
|
||||||
|
|
||||||
|
if (ctrl_info->raid_iu_timeout_supported)
|
||||||
|
put_unaligned_le32(iocommand.Request.Timeout, &request.timeout);
|
||||||
|
|
||||||
rc = pqi_submit_raid_request_synchronous(ctrl_info, &request.header,
|
rc = pqi_submit_raid_request_synchronous(ctrl_info, &request.header,
|
||||||
PQI_SYNC_FLAGS_INTERRUPTABLE, &pqi_error_info, NO_TIMEOUT);
|
PQI_SYNC_FLAGS_INTERRUPTABLE, &pqi_error_info, NO_TIMEOUT);
|
||||||
|
|
||||||
|
@ -6871,6 +6874,23 @@ static void pqi_firmware_feature_status(struct pqi_ctrl_info *ctrl_info,
|
||||||
firmware_feature->feature_name);
|
firmware_feature->feature_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void pqi_ctrl_update_feature_flags(struct pqi_ctrl_info *ctrl_info,
|
||||||
|
struct pqi_firmware_feature *firmware_feature)
|
||||||
|
{
|
||||||
|
switch (firmware_feature->feature_bit) {
|
||||||
|
case PQI_FIRMWARE_FEATURE_SOFT_RESET_HANDSHAKE:
|
||||||
|
ctrl_info->soft_reset_handshake_supported =
|
||||||
|
firmware_feature->enabled;
|
||||||
|
break;
|
||||||
|
case PQI_FIRMWARE_FEATURE_RAID_IU_TIMEOUT:
|
||||||
|
ctrl_info->raid_iu_timeout_supported =
|
||||||
|
firmware_feature->enabled;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
pqi_firmware_feature_status(ctrl_info, firmware_feature);
|
||||||
|
}
|
||||||
|
|
||||||
static inline void pqi_firmware_feature_update(struct pqi_ctrl_info *ctrl_info,
|
static inline void pqi_firmware_feature_update(struct pqi_ctrl_info *ctrl_info,
|
||||||
struct pqi_firmware_feature *firmware_feature)
|
struct pqi_firmware_feature *firmware_feature)
|
||||||
{
|
{
|
||||||
|
@ -6894,7 +6914,12 @@ static struct pqi_firmware_feature pqi_firmware_features[] = {
|
||||||
{
|
{
|
||||||
.feature_name = "New Soft Reset Handshake",
|
.feature_name = "New Soft Reset Handshake",
|
||||||
.feature_bit = PQI_FIRMWARE_FEATURE_SOFT_RESET_HANDSHAKE,
|
.feature_bit = PQI_FIRMWARE_FEATURE_SOFT_RESET_HANDSHAKE,
|
||||||
.feature_status = pqi_firmware_feature_status,
|
.feature_status = pqi_ctrl_update_feature_flags,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.feature_name = "RAID IU Timeout",
|
||||||
|
.feature_bit = PQI_FIRMWARE_FEATURE_RAID_IU_TIMEOUT,
|
||||||
|
.feature_status = pqi_ctrl_update_feature_flags,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -6948,7 +6973,6 @@ static void pqi_process_firmware_features(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctrl_info->soft_reset_handshake_supported = false;
|
|
||||||
for (i = 0; i < ARRAY_SIZE(pqi_firmware_features); i++) {
|
for (i = 0; i < ARRAY_SIZE(pqi_firmware_features); i++) {
|
||||||
if (!pqi_firmware_features[i].supported)
|
if (!pqi_firmware_features[i].supported)
|
||||||
continue;
|
continue;
|
||||||
|
@ -6956,10 +6980,6 @@ static void pqi_process_firmware_features(
|
||||||
firmware_features_iomem_addr,
|
firmware_features_iomem_addr,
|
||||||
pqi_firmware_features[i].feature_bit)) {
|
pqi_firmware_features[i].feature_bit)) {
|
||||||
pqi_firmware_features[i].enabled = true;
|
pqi_firmware_features[i].enabled = true;
|
||||||
if (pqi_firmware_features[i].feature_bit ==
|
|
||||||
PQI_FIRMWARE_FEATURE_SOFT_RESET_HANDSHAKE)
|
|
||||||
ctrl_info->soft_reset_handshake_supported =
|
|
||||||
true;
|
|
||||||
}
|
}
|
||||||
pqi_firmware_feature_update(ctrl_info,
|
pqi_firmware_feature_update(ctrl_info,
|
||||||
&pqi_firmware_features[i]);
|
&pqi_firmware_features[i]);
|
||||||
|
@ -8764,6 +8784,8 @@ static void __attribute__((unused)) verify_structures(void)
|
||||||
error_index) != 27);
|
error_index) != 27);
|
||||||
BUILD_BUG_ON(offsetof(struct pqi_raid_path_request,
|
BUILD_BUG_ON(offsetof(struct pqi_raid_path_request,
|
||||||
cdb) != 32);
|
cdb) != 32);
|
||||||
|
BUILD_BUG_ON(offsetof(struct pqi_raid_path_request,
|
||||||
|
timeout) != 60);
|
||||||
BUILD_BUG_ON(offsetof(struct pqi_raid_path_request,
|
BUILD_BUG_ON(offsetof(struct pqi_raid_path_request,
|
||||||
sg_descriptors) != 64);
|
sg_descriptors) != 64);
|
||||||
BUILD_BUG_ON(sizeof(struct pqi_raid_path_request) !=
|
BUILD_BUG_ON(sizeof(struct pqi_raid_path_request) !=
|
||||||
|
|
Loading…
Reference in a new issue