Skip to content

Commit cff06a7

Browse files
Merge patch series "smartpqi updates"
Don Brace <[email protected]> says: These patches are based on Martin Petersen's 6.12/scsi-queue tree https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git 6.12/scsi-queue There are two functional changes: smartpqi-add-fw-log-to-kdump smartpqi-add-counter-for-parity-write-stream-requests There are three minor bug fixes: smartpqi-fix-stream-detection smartpqi-fix-rare-system-hang-during-LUN-reset smartpqi-fix-volume-size-updates The other two patches add PCI-IDs for new controllers and change the driver version. This set of changes consists of: * smartpqi-add-fw-log-to-kdump During a kdump, the driver tells the controller to copy its logging information to some pre-allocated buffers that can be analyzed later. This is a "feature" driven capability and is backward compatible with existing controller FW. This patch renames some prefixes for OFA (Online-Firmware Activation ofa_*) buffers to host_memory_*. So, not a lot of actual functional changes to smartpqi_init.c, mainly determining the memory size allocation. We added a function to notify the controller to copy debug data into host memory before continuing kdump. Most of the functional changes are in smartpqi_sis.c where the actual handshaking is done. * smartpqi-fix-stream-detection Correct some false write-stream detections. The data structure used to check for write-streams was not initialized to all 0's causing some false write stream detections. The driver sends down streamed requests to the raid engine instead of using AIO bypass for some extra performance. (Potential full-stripe write verses Read Modify Write). False detections have not caused any data corruption. Found by internal testing. No known externally reported bugs. * smartpqi-add-counter-for-parity-write-stream-requests Adding some counters for raid_bypass and write streams. These two counters are related because write stream detection is only checked if an I/O request is eligible for bypass (AIO). The bypass counter (raid_bypass_cnt) was moved into a common structure (pqi_raid_io_stats) and changed to type __percpu. The write stream counter is (write_stream_cnt) has been added to this same structure. These counters are __percpu counters for performance. We added a sysfs entry to show the write stream count. The raid bypass counter sysfs entry already exists. Useful for checking streaming writes. The change in the sysfs entry write_stream_cnt can be checked during AIO eligible write operations. * smartpqi-add-new-controller-PCI-IDs Adding support for new controller HW. No functional changes. * smartpqi-fix-rare-system-hang-during-LUN-reset We found a rare race condition that can occur during a LUN reset. We were not emptying our internal queue completely. There have been some rare conditions where our internal request queue has requests for multiple LUNs and a reset comes in for one of the LUNs. The driver waits for this internal queue to empty. We were only clearing out the requests for the LUN being reset so the request queue was never empty causing a hang. The Fix: For all requests in our internal request queue: Complete requests with DID_RESET for queued requests for the device undergoing a reset. Complete requests with DID_REQUEUE for all other queued requests. Found by internal testing. No known externally reported bugs. * smartpqi-fix-volume-size-updates The current code only checks for a size change if there is also a queue depth change. We are separating the check for queue depth and the size changes. Found by internal testing. No known bugs were filed. * smartpqi-update-version-to-2.1.30-031 No functional changes. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
2 parents d5a4b0d + bda1c93 commit cff06a7

File tree

4 files changed

+322
-132
lines changed

4 files changed

+322
-132
lines changed

drivers/scsi/smartpqi/smartpqi.h

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ struct pqi_vendor_general_request {
505505
__le64 buffer_address;
506506
__le32 buffer_length;
507507
u8 reserved[40];
508-
} ofa_memory_allocation;
508+
} host_memory_allocation;
509509
} data;
510510
};
511511

@@ -517,21 +517,30 @@ struct pqi_vendor_general_response {
517517
u8 reserved[2];
518518
};
519519

520-
#define PQI_VENDOR_GENERAL_CONFIG_TABLE_UPDATE 0
521-
#define PQI_VENDOR_GENERAL_HOST_MEMORY_UPDATE 1
520+
#define PQI_VENDOR_GENERAL_CONFIG_TABLE_UPDATE 0
521+
#define PQI_VENDOR_GENERAL_OFA_MEMORY_UPDATE 1
522+
#define PQI_VENDOR_GENERAL_CTRL_LOG_MEMORY_UPDATE 2
522523

523524
#define PQI_OFA_VERSION 1
524525
#define PQI_OFA_SIGNATURE "OFA_QRM"
525-
#define PQI_OFA_MAX_SG_DESCRIPTORS 64
526+
#define PQI_CTRL_LOG_VERSION 1
527+
#define PQI_CTRL_LOG_SIGNATURE "FW_DATA"
528+
#define PQI_HOST_MAX_SG_DESCRIPTORS 64
526529

527-
struct pqi_ofa_memory {
528-
__le64 signature; /* "OFA_QRM" */
530+
struct pqi_host_memory {
531+
__le64 signature; /* "OFA_QRM", "FW_DATA", etc. */
529532
__le16 version; /* version of this struct (1 = 1st version) */
530533
u8 reserved[62];
531534
__le32 bytes_allocated; /* total allocated memory in bytes */
532535
__le16 num_memory_descriptors;
533536
u8 reserved1[2];
534-
struct pqi_sg_descriptor sg_descriptor[PQI_OFA_MAX_SG_DESCRIPTORS];
537+
struct pqi_sg_descriptor sg_descriptor[PQI_HOST_MAX_SG_DESCRIPTORS];
538+
};
539+
540+
struct pqi_host_memory_descriptor {
541+
struct pqi_host_memory *host_memory;
542+
dma_addr_t host_memory_dma_handle;
543+
void **host_chunk_virt_address;
535544
};
536545

537546
struct pqi_aio_error_info {
@@ -867,7 +876,8 @@ struct pqi_config_table_firmware_features {
867876
#define PQI_FIRMWARE_FEATURE_FW_TRIAGE 17
868877
#define PQI_FIRMWARE_FEATURE_RPL_EXTENDED_FORMAT_4_5 18
869878
#define PQI_FIRMWARE_FEATURE_MULTI_LUN_DEVICE_SUPPORT 21
870-
#define PQI_FIRMWARE_FEATURE_MAXIMUM 21
879+
#define PQI_FIRMWARE_FEATURE_CTRL_LOGGING 22
880+
#define PQI_FIRMWARE_FEATURE_MAXIMUM 22
871881

872882
struct pqi_config_table_debug {
873883
struct pqi_config_table_section_header header;
@@ -1096,6 +1106,11 @@ struct pqi_tmf_work {
10961106
u8 scsi_opcode;
10971107
};
10981108

1109+
struct pqi_raid_io_stats {
1110+
u64 raid_bypass_cnt;
1111+
u64 write_stream_cnt;
1112+
};
1113+
10991114
struct pqi_scsi_dev {
11001115
int devtype; /* as reported by INQUIRY command */
11011116
u8 device_type; /* as reported by */
@@ -1158,7 +1173,7 @@ struct pqi_scsi_dev {
11581173

11591174
struct pqi_stream_data stream_data[NUM_STREAMS_PER_LUN];
11601175
atomic_t scsi_cmds_outstanding[PQI_MAX_LUNS_PER_DEVICE];
1161-
u64 __percpu *raid_bypass_cnt;
1176+
struct pqi_raid_io_stats __percpu *raid_io_stats;
11621177

11631178
struct pqi_tmf_work tmf_work[PQI_MAX_LUNS_PER_DEVICE];
11641179
};
@@ -1357,6 +1372,7 @@ struct pqi_ctrl_info {
13571372
u8 firmware_triage_supported : 1;
13581373
u8 rpl_extended_format_4_5_supported : 1;
13591374
u8 multi_lun_device_supported : 1;
1375+
u8 ctrl_logging_supported : 1;
13601376
u8 enable_r1_writes : 1;
13611377
u8 enable_r5_writes : 1;
13621378
u8 enable_r6_writes : 1;
@@ -1398,13 +1414,12 @@ struct pqi_ctrl_info {
13981414
wait_queue_head_t block_requests_wait;
13991415

14001416
struct mutex ofa_mutex;
1401-
struct pqi_ofa_memory *pqi_ofa_mem_virt_addr;
1402-
dma_addr_t pqi_ofa_mem_dma_handle;
1403-
void **pqi_ofa_chunk_virt_addr;
14041417
struct work_struct ofa_memory_alloc_work;
14051418
struct work_struct ofa_quiesce_work;
14061419
u32 ofa_bytes_requested;
14071420
u16 ofa_cancel_reason;
1421+
struct pqi_host_memory_descriptor ofa_memory;
1422+
struct pqi_host_memory_descriptor ctrl_log_memory;
14081423
enum pqi_ctrl_removal_state ctrl_removal_state;
14091424
};
14101425

0 commit comments

Comments
 (0)