|
19 | 19 | #include <linux/bcd.h> |
20 | 20 | #include <linux/reboot.h> |
21 | 21 | #include <linux/cciss_ioctl.h> |
| 22 | +#include <linux/crash_dump.h> |
22 | 23 | #include <scsi/scsi_host.h> |
23 | 24 | #include <scsi/scsi_cmnd.h> |
24 | 25 | #include <scsi/scsi_device.h> |
@@ -5246,7 +5247,7 @@ static void pqi_calculate_io_resources(struct pqi_ctrl_info *ctrl_info) |
5246 | 5247 | ctrl_info->error_buffer_length = |
5247 | 5248 | ctrl_info->max_io_slots * PQI_ERROR_BUFFER_ELEMENT_LENGTH; |
5248 | 5249 |
|
5249 | | - if (reset_devices) |
| 5250 | + if (is_kdump_kernel()) |
5250 | 5251 | max_transfer_size = min(ctrl_info->max_transfer_size, |
5251 | 5252 | PQI_MAX_TRANSFER_SIZE_KDUMP); |
5252 | 5253 | else |
@@ -5275,7 +5276,7 @@ static void pqi_calculate_queue_resources(struct pqi_ctrl_info *ctrl_info) |
5275 | 5276 | u16 num_elements_per_iq; |
5276 | 5277 | u16 num_elements_per_oq; |
5277 | 5278 |
|
5278 | | - if (reset_devices) { |
| 5279 | + if (is_kdump_kernel()) { |
5279 | 5280 | num_queue_groups = 1; |
5280 | 5281 | } else { |
5281 | 5282 | int num_cpus; |
@@ -8287,12 +8288,12 @@ static int pqi_ctrl_init(struct pqi_ctrl_info *ctrl_info) |
8287 | 8288 | u32 product_id; |
8288 | 8289 |
|
8289 | 8290 | if (reset_devices) { |
8290 | | - if (pqi_is_fw_triage_supported(ctrl_info)) { |
| 8291 | + if (is_kdump_kernel() && pqi_is_fw_triage_supported(ctrl_info)) { |
8291 | 8292 | rc = sis_wait_for_fw_triage_completion(ctrl_info); |
8292 | 8293 | if (rc) |
8293 | 8294 | return rc; |
8294 | 8295 | } |
8295 | | - if (sis_is_ctrl_logging_supported(ctrl_info)) { |
| 8296 | + if (is_kdump_kernel() && sis_is_ctrl_logging_supported(ctrl_info)) { |
8296 | 8297 | sis_notify_kdump(ctrl_info); |
8297 | 8298 | rc = sis_wait_for_ctrl_logging_completion(ctrl_info); |
8298 | 8299 | if (rc) |
@@ -8343,7 +8344,7 @@ static int pqi_ctrl_init(struct pqi_ctrl_info *ctrl_info) |
8343 | 8344 | ctrl_info->product_id = (u8)product_id; |
8344 | 8345 | ctrl_info->product_revision = (u8)(product_id >> 8); |
8345 | 8346 |
|
8346 | | - if (reset_devices) { |
| 8347 | + if (is_kdump_kernel()) { |
8347 | 8348 | if (ctrl_info->max_outstanding_requests > |
8348 | 8349 | PQI_MAX_OUTSTANDING_REQUESTS_KDUMP) |
8349 | 8350 | ctrl_info->max_outstanding_requests = |
@@ -8479,7 +8480,7 @@ static int pqi_ctrl_init(struct pqi_ctrl_info *ctrl_info) |
8479 | 8480 | if (rc) |
8480 | 8481 | return rc; |
8481 | 8482 |
|
8482 | | - if (ctrl_info->ctrl_logging_supported && !reset_devices) { |
| 8483 | + if (ctrl_info->ctrl_logging_supported && !is_kdump_kernel()) { |
8483 | 8484 | pqi_host_setup_buffer(ctrl_info, &ctrl_info->ctrl_log_memory, PQI_CTRL_LOG_TOTAL_SIZE, PQI_CTRL_LOG_MIN_SIZE); |
8484 | 8485 | pqi_host_memory_update(ctrl_info, &ctrl_info->ctrl_log_memory, PQI_VENDOR_GENERAL_CTRL_LOG_MEMORY_UPDATE); |
8485 | 8486 | } |
|
0 commit comments