1919#include <linux/bcd.h>
2020#include <linux/reboot.h>
2121#include <linux/cciss_ioctl.h>
22+ #include <linux/crash_dump.h>
2223#include <scsi/scsi_host.h>
2324#include <scsi/scsi_cmnd.h>
2425#include <scsi/scsi_device.h>
3233#define BUILD_TIMESTAMP
3334#endif
3435
35- #define DRIVER_VERSION "2.1.30-031 "
36+ #define DRIVER_VERSION "2.1.34-035 "
3637#define DRIVER_MAJOR 2
3738#define DRIVER_MINOR 1
38- #define DRIVER_RELEASE 30
39- #define DRIVER_REVISION 31
39+ #define DRIVER_RELEASE 34
40+ #define DRIVER_REVISION 35
4041
4142#define DRIVER_NAME "Microchip SmartPQI Driver (v" \
4243 DRIVER_VERSION BUILD_TIMESTAMP ")"
@@ -67,6 +68,7 @@ static struct pqi_cmd_priv *pqi_cmd_priv(struct scsi_cmnd *cmd)
6768static void pqi_verify_structures (void );
6869static void pqi_take_ctrl_offline (struct pqi_ctrl_info * ctrl_info ,
6970 enum pqi_ctrl_shutdown_reason ctrl_shutdown_reason );
71+ static void pqi_take_ctrl_devices_offline (struct pqi_ctrl_info * ctrl_info );
7072static void pqi_ctrl_offline_worker (struct work_struct * work );
7173static int pqi_scan_scsi_devices (struct pqi_ctrl_info * ctrl_info );
7274static void pqi_scan_start (struct Scsi_Host * shost );
@@ -2010,18 +2012,31 @@ static void pqi_dev_info(struct pqi_ctrl_info *ctrl_info,
20102012 PQI_DEV_INFO_BUFFER_LENGTH - count ,
20112013 "-:-" );
20122014
2013- if (pqi_is_logical_device (device ))
2015+ if (pqi_is_logical_device (device )) {
20142016 count += scnprintf (buffer + count ,
20152017 PQI_DEV_INFO_BUFFER_LENGTH - count ,
20162018 " %08x%08x" ,
20172019 * ((u32 * )& device -> scsi3addr ),
20182020 * ((u32 * )& device -> scsi3addr [4 ]));
2019- else
2021+ } else if (ctrl_info -> rpl_extended_format_4_5_supported ) {
2022+ if (device -> device_type == SA_DEVICE_TYPE_NVME )
2023+ count += scnprintf (buffer + count ,
2024+ PQI_DEV_INFO_BUFFER_LENGTH - count ,
2025+ " %016llx%016llx" ,
2026+ get_unaligned_be64 (& device -> wwid [0 ]),
2027+ get_unaligned_be64 (& device -> wwid [8 ]));
2028+ else
2029+ count += scnprintf (buffer + count ,
2030+ PQI_DEV_INFO_BUFFER_LENGTH - count ,
2031+ " %016llx" ,
2032+ get_unaligned_be64 (& device -> wwid [0 ]));
2033+ } else {
20202034 count += scnprintf (buffer + count ,
20212035 PQI_DEV_INFO_BUFFER_LENGTH - count ,
2022- " %016llx%016llx" ,
2023- get_unaligned_be64 (& device -> wwid [0 ]),
2024- get_unaligned_be64 (& device -> wwid [8 ]));
2036+ " %016llx" ,
2037+ get_unaligned_be64 (& device -> wwid [0 ]));
2038+ }
2039+
20252040
20262041 count += scnprintf (buffer + count , PQI_DEV_INFO_BUFFER_LENGTH - count ,
20272042 " %s %.8s %.16s " ,
@@ -5246,7 +5261,7 @@ static void pqi_calculate_io_resources(struct pqi_ctrl_info *ctrl_info)
52465261 ctrl_info -> error_buffer_length =
52475262 ctrl_info -> max_io_slots * PQI_ERROR_BUFFER_ELEMENT_LENGTH ;
52485263
5249- if (reset_devices )
5264+ if (is_kdump_kernel () )
52505265 max_transfer_size = min (ctrl_info -> max_transfer_size ,
52515266 PQI_MAX_TRANSFER_SIZE_KDUMP );
52525267 else
@@ -5275,7 +5290,7 @@ static void pqi_calculate_queue_resources(struct pqi_ctrl_info *ctrl_info)
52755290 u16 num_elements_per_iq ;
52765291 u16 num_elements_per_oq ;
52775292
5278- if (reset_devices ) {
5293+ if (is_kdump_kernel () ) {
52795294 num_queue_groups = 1 ;
52805295 } else {
52815296 int num_cpus ;
@@ -5989,7 +6004,7 @@ static bool pqi_is_parity_write_stream(struct pqi_ctrl_info *ctrl_info,
59896004 pqi_stream_data -> next_lba = rmd .first_block +
59906005 rmd .block_cnt ;
59916006 pqi_stream_data -> last_accessed = jiffies ;
5992- per_cpu_ptr (device -> raid_io_stats , smp_processor_id ())-> write_stream_cnt ++ ;
6007+ per_cpu_ptr (device -> raid_io_stats , raw_smp_processor_id ())-> write_stream_cnt ++ ;
59936008 return true;
59946009 }
59956010
@@ -6068,7 +6083,7 @@ static int pqi_scsi_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scm
60686083 rc = pqi_raid_bypass_submit_scsi_cmd (ctrl_info , device , scmd , queue_group );
60696084 if (rc == 0 || rc == SCSI_MLQUEUE_HOST_BUSY ) {
60706085 raid_bypassed = true;
6071- per_cpu_ptr (device -> raid_io_stats , smp_processor_id ())-> raid_bypass_cnt ++ ;
6086+ per_cpu_ptr (device -> raid_io_stats , raw_smp_processor_id ())-> raid_bypass_cnt ++ ;
60726087 }
60736088 }
60746089 if (!raid_bypassed )
@@ -8288,12 +8303,12 @@ static int pqi_ctrl_init(struct pqi_ctrl_info *ctrl_info)
82888303 u32 product_id ;
82898304
82908305 if (reset_devices ) {
8291- if (pqi_is_fw_triage_supported (ctrl_info )) {
8306+ if (is_kdump_kernel () && pqi_is_fw_triage_supported (ctrl_info )) {
82928307 rc = sis_wait_for_fw_triage_completion (ctrl_info );
82938308 if (rc )
82948309 return rc ;
82958310 }
8296- if (sis_is_ctrl_logging_supported (ctrl_info )) {
8311+ if (is_kdump_kernel () && sis_is_ctrl_logging_supported (ctrl_info )) {
82978312 sis_notify_kdump (ctrl_info );
82988313 rc = sis_wait_for_ctrl_logging_completion (ctrl_info );
82998314 if (rc )
@@ -8344,7 +8359,7 @@ static int pqi_ctrl_init(struct pqi_ctrl_info *ctrl_info)
83448359 ctrl_info -> product_id = (u8 )product_id ;
83458360 ctrl_info -> product_revision = (u8 )(product_id >> 8 );
83468361
8347- if (reset_devices ) {
8362+ if (is_kdump_kernel () ) {
83488363 if (ctrl_info -> max_outstanding_requests >
83498364 PQI_MAX_OUTSTANDING_REQUESTS_KDUMP )
83508365 ctrl_info -> max_outstanding_requests =
@@ -8480,7 +8495,7 @@ static int pqi_ctrl_init(struct pqi_ctrl_info *ctrl_info)
84808495 if (rc )
84818496 return rc ;
84828497
8483- if (ctrl_info -> ctrl_logging_supported && !reset_devices ) {
8498+ if (ctrl_info -> ctrl_logging_supported && !is_kdump_kernel () ) {
84848499 pqi_host_setup_buffer (ctrl_info , & ctrl_info -> ctrl_log_memory , PQI_CTRL_LOG_TOTAL_SIZE , PQI_CTRL_LOG_MIN_SIZE );
84858500 pqi_host_memory_update (ctrl_info , & ctrl_info -> ctrl_log_memory , PQI_VENDOR_GENERAL_CTRL_LOG_MEMORY_UPDATE );
84868501 }
@@ -9128,6 +9143,7 @@ static void pqi_take_ctrl_offline_deferred(struct pqi_ctrl_info *ctrl_info)
91289143 pqi_ctrl_wait_until_quiesced (ctrl_info );
91299144 pqi_fail_all_outstanding_requests (ctrl_info );
91309145 pqi_ctrl_unblock_requests (ctrl_info );
9146+ pqi_take_ctrl_devices_offline (ctrl_info );
91319147}
91329148
91339149static void pqi_ctrl_offline_worker (struct work_struct * work )
@@ -9202,6 +9218,27 @@ static void pqi_take_ctrl_offline(struct pqi_ctrl_info *ctrl_info,
92029218 schedule_work (& ctrl_info -> ctrl_offline_work );
92039219}
92049220
9221+ static void pqi_take_ctrl_devices_offline (struct pqi_ctrl_info * ctrl_info )
9222+ {
9223+ int rc ;
9224+ unsigned long flags ;
9225+ struct pqi_scsi_dev * device ;
9226+
9227+ spin_lock_irqsave (& ctrl_info -> scsi_device_list_lock , flags );
9228+ list_for_each_entry (device , & ctrl_info -> scsi_device_list , scsi_device_list_entry ) {
9229+ rc = list_is_last (& device -> scsi_device_list_entry , & ctrl_info -> scsi_device_list );
9230+ if (rc )
9231+ continue ;
9232+
9233+ /*
9234+ * Is the sdev pointer NULL?
9235+ */
9236+ if (device -> sdev )
9237+ scsi_device_set_state (device -> sdev , SDEV_OFFLINE );
9238+ }
9239+ spin_unlock_irqrestore (& ctrl_info -> scsi_device_list_lock , flags );
9240+ }
9241+
92059242static void pqi_print_ctrl_info (struct pci_dev * pci_dev ,
92069243 const struct pci_device_id * id )
92079244{
@@ -9708,6 +9745,10 @@ static const struct pci_device_id pqi_pci_id_table[] = {
97089745 PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
97099746 0x1bd4 , 0x0089 )
97109747 },
9748+ {
9749+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
9750+ 0x1bd4 , 0x00a3 )
9751+ },
97119752 {
97129753 PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
97139754 0x1ff9 , 0x00a1 )
@@ -10044,6 +10085,30 @@ static const struct pci_device_id pqi_pci_id_table[] = {
1004410085 PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
1004510086 PCI_VENDOR_ID_ADAPTEC2 , 0x14f0 )
1004610087 },
10088+ {
10089+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10090+ 0x207d , 0x4044 )
10091+ },
10092+ {
10093+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10094+ 0x207d , 0x4054 )
10095+ },
10096+ {
10097+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10098+ 0x207d , 0x4084 )
10099+ },
10100+ {
10101+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10102+ 0x207d , 0x4094 )
10103+ },
10104+ {
10105+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10106+ 0x207d , 0x4140 )
10107+ },
10108+ {
10109+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10110+ 0x207d , 0x4240 )
10111+ },
1004710112 {
1004810113 PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
1004910114 PCI_VENDOR_ID_ADVANTECH , 0x8312 )
@@ -10260,6 +10325,14 @@ static const struct pci_device_id pqi_pci_id_table[] = {
1026010325 PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
1026110326 0x1cc4 , 0x0201 )
1026210327 },
10328+ {
10329+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10330+ 0x1018 , 0x8238 )
10331+ },
10332+ {
10333+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10334+ 0x1f3f , 0x0610 )
10335+ },
1026310336 {
1026410337 PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
1026510338 PCI_VENDOR_ID_LENOVO , 0x0220 )
@@ -10268,10 +10341,30 @@ static const struct pci_device_id pqi_pci_id_table[] = {
1026810341 PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
1026910342 PCI_VENDOR_ID_LENOVO , 0x0221 )
1027010343 },
10344+ {
10345+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10346+ PCI_VENDOR_ID_LENOVO , 0x0222 )
10347+ },
10348+ {
10349+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10350+ PCI_VENDOR_ID_LENOVO , 0x0223 )
10351+ },
10352+ {
10353+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10354+ PCI_VENDOR_ID_LENOVO , 0x0224 )
10355+ },
10356+ {
10357+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10358+ PCI_VENDOR_ID_LENOVO , 0x0225 )
10359+ },
1027110360 {
1027210361 PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
1027310362 PCI_VENDOR_ID_LENOVO , 0x0520 )
1027410363 },
10364+ {
10365+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10366+ PCI_VENDOR_ID_LENOVO , 0x0521 )
10367+ },
1027510368 {
1027610369 PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
1027710370 PCI_VENDOR_ID_LENOVO , 0x0522 )
@@ -10292,6 +10385,26 @@ static const struct pci_device_id pqi_pci_id_table[] = {
1029210385 PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
1029310386 PCI_VENDOR_ID_LENOVO , 0x0623 )
1029410387 },
10388+ {
10389+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10390+ PCI_VENDOR_ID_LENOVO , 0x0624 )
10391+ },
10392+ {
10393+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10394+ PCI_VENDOR_ID_LENOVO , 0x0625 )
10395+ },
10396+ {
10397+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10398+ PCI_VENDOR_ID_LENOVO , 0x0626 )
10399+ },
10400+ {
10401+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10402+ PCI_VENDOR_ID_LENOVO , 0x0627 )
10403+ },
10404+ {
10405+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10406+ PCI_VENDOR_ID_LENOVO , 0x0628 )
10407+ },
1029510408 {
1029610409 PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
1029710410 0x1014 , 0x0718 )
@@ -10320,6 +10433,10 @@ static const struct pci_device_id pqi_pci_id_table[] = {
1032010433 PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
1032110434 0x1137 , 0x0300 )
1032210435 },
10436+ {
10437+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10438+ 0x1ded , 0x3301 )
10439+ },
1032310440 {
1032410441 PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
1032510442 0x1ff9 , 0x0045 )
@@ -10468,6 +10585,10 @@ static const struct pci_device_id pqi_pci_id_table[] = {
1046810585 PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
1046910586 0x1f51 , 0x100a )
1047010587 },
10588+ {
10589+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10590+ 0x1f51 , 0x100b )
10591+ },
1047110592 {
1047210593 PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
1047310594 0x1f51 , 0x100e )
0 commit comments