33
33
#define BUILD_TIMESTAMP
34
34
#endif
35
35
36
- #define DRIVER_VERSION "2.1.26-030 "
36
+ #define DRIVER_VERSION "2.1.28-025 "
37
37
#define DRIVER_MAJOR 2
38
38
#define DRIVER_MINOR 1
39
- #define DRIVER_RELEASE 26
40
- #define DRIVER_REVISION 30
39
+ #define DRIVER_RELEASE 28
40
+ #define DRIVER_REVISION 25
41
41
42
42
#define DRIVER_NAME "Microchip SmartPQI Driver (v" \
43
43
DRIVER_VERSION BUILD_TIMESTAMP ")"
@@ -1508,6 +1508,12 @@ static int pqi_get_raid_map(struct pqi_ctrl_info *ctrl_info,
1508
1508
if (rc )
1509
1509
goto error ;
1510
1510
1511
+ device -> raid_bypass_cnt = alloc_percpu (u64 );
1512
+ if (!device -> raid_bypass_cnt ) {
1513
+ rc = - ENOMEM ;
1514
+ goto error ;
1515
+ }
1516
+
1511
1517
device -> raid_map = raid_map ;
1512
1518
1513
1519
return 0 ;
@@ -2099,6 +2105,10 @@ static void pqi_scsi_update_device(struct pqi_ctrl_info *ctrl_info,
2099
2105
/* To prevent this from being freed later. */
2100
2106
new_device -> raid_map = NULL ;
2101
2107
}
2108
+ if (new_device -> raid_bypass_enabled && existing_device -> raid_bypass_cnt == NULL ) {
2109
+ existing_device -> raid_bypass_cnt = new_device -> raid_bypass_cnt ;
2110
+ new_device -> raid_bypass_cnt = NULL ;
2111
+ }
2102
2112
existing_device -> raid_bypass_configured = new_device -> raid_bypass_configured ;
2103
2113
existing_device -> raid_bypass_enabled = new_device -> raid_bypass_enabled ;
2104
2114
}
@@ -2121,6 +2131,7 @@ static void pqi_scsi_update_device(struct pqi_ctrl_info *ctrl_info,
2121
2131
static inline void pqi_free_device (struct pqi_scsi_dev * device )
2122
2132
{
2123
2133
if (device ) {
2134
+ free_percpu (device -> raid_bypass_cnt );
2124
2135
kfree (device -> raid_map );
2125
2136
kfree (device );
2126
2137
}
@@ -2354,14 +2365,6 @@ static inline void pqi_mask_device(u8 *scsi3addr)
2354
2365
scsi3addr [3 ] |= 0xc0 ;
2355
2366
}
2356
2367
2357
- static inline bool pqi_is_multipath_device (struct pqi_scsi_dev * device )
2358
- {
2359
- if (pqi_is_logical_device (device ))
2360
- return false;
2361
-
2362
- return (device -> path_map & (device -> path_map - 1 )) != 0 ;
2363
- }
2364
-
2365
2368
static inline bool pqi_expose_device (struct pqi_scsi_dev * device )
2366
2369
{
2367
2370
return !device -> is_physical_device || !pqi_skip_device (device -> scsi3addr );
@@ -3244,6 +3247,20 @@ static void pqi_process_raid_io_error(struct pqi_io_request *io_request)
3244
3247
sense_data_length );
3245
3248
}
3246
3249
3250
+ if (pqi_cmd_priv (scmd )-> this_residual &&
3251
+ !pqi_is_logical_device (scmd -> device -> hostdata ) &&
3252
+ scsi_status == SAM_STAT_CHECK_CONDITION &&
3253
+ host_byte == DID_OK &&
3254
+ sense_data_length &&
3255
+ scsi_normalize_sense (error_info -> data , sense_data_length , & sshdr ) &&
3256
+ sshdr .sense_key == ILLEGAL_REQUEST &&
3257
+ sshdr .asc == 0x26 &&
3258
+ sshdr .ascq == 0x0 ) {
3259
+ host_byte = DID_NO_CONNECT ;
3260
+ pqi_take_device_offline (scmd -> device , "AIO" );
3261
+ scsi_build_sense_buffer (0 , scmd -> sense_buffer , HARDWARE_ERROR , 0x3e , 0x1 );
3262
+ }
3263
+
3247
3264
scmd -> result = scsi_status ;
3248
3265
set_host_byte (scmd , host_byte );
3249
3266
}
@@ -3258,14 +3275,12 @@ static void pqi_process_aio_io_error(struct pqi_io_request *io_request)
3258
3275
int residual_count ;
3259
3276
int xfer_count ;
3260
3277
bool device_offline ;
3261
- struct pqi_scsi_dev * device ;
3262
3278
3263
3279
scmd = io_request -> scmd ;
3264
3280
error_info = io_request -> error_info ;
3265
3281
host_byte = DID_OK ;
3266
3282
sense_data_length = 0 ;
3267
3283
device_offline = false;
3268
- device = scmd -> device -> hostdata ;
3269
3284
3270
3285
switch (error_info -> service_response ) {
3271
3286
case PQI_AIO_SERV_RESPONSE_COMPLETE :
@@ -3290,14 +3305,8 @@ static void pqi_process_aio_io_error(struct pqi_io_request *io_request)
3290
3305
break ;
3291
3306
case PQI_AIO_STATUS_AIO_PATH_DISABLED :
3292
3307
pqi_aio_path_disabled (io_request );
3293
- if (pqi_is_multipath_device (device )) {
3294
- pqi_device_remove_start (device );
3295
- host_byte = DID_NO_CONNECT ;
3296
- scsi_status = SAM_STAT_CHECK_CONDITION ;
3297
- } else {
3298
- scsi_status = SAM_STAT_GOOD ;
3299
- io_request -> status = - EAGAIN ;
3300
- }
3308
+ scsi_status = SAM_STAT_GOOD ;
3309
+ io_request -> status = - EAGAIN ;
3301
3310
break ;
3302
3311
case PQI_AIO_STATUS_NO_PATH_TO_DEVICE :
3303
3312
case PQI_AIO_STATUS_INVALID_DEVICE :
@@ -6007,6 +6016,7 @@ static int pqi_scsi_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scm
6007
6016
u16 hw_queue ;
6008
6017
struct pqi_queue_group * queue_group ;
6009
6018
bool raid_bypassed ;
6019
+ u64 * raid_bypass_cnt ;
6010
6020
u8 lun ;
6011
6021
6012
6022
scmd -> host_scribble = PQI_NO_COMPLETION ;
@@ -6025,7 +6035,7 @@ static int pqi_scsi_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scm
6025
6035
6026
6036
ctrl_info = shost_to_hba (shost );
6027
6037
6028
- if (pqi_ctrl_offline (ctrl_info ) || pqi_device_in_remove (device )) {
6038
+ if (pqi_ctrl_offline (ctrl_info ) || pqi_device_offline ( device ) || pqi_device_in_remove (device )) {
6029
6039
set_host_byte (scmd , DID_NO_CONNECT );
6030
6040
pqi_scsi_done (scmd );
6031
6041
return 0 ;
@@ -6053,7 +6063,8 @@ static int pqi_scsi_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scm
6053
6063
rc = pqi_raid_bypass_submit_scsi_cmd (ctrl_info , device , scmd , queue_group );
6054
6064
if (rc == 0 || rc == SCSI_MLQUEUE_HOST_BUSY ) {
6055
6065
raid_bypassed = true;
6056
- device -> raid_bypass_cnt ++ ;
6066
+ raid_bypass_cnt = per_cpu_ptr (device -> raid_bypass_cnt , smp_processor_id ());
6067
+ (* raid_bypass_cnt )++ ;
6057
6068
}
6058
6069
}
6059
6070
if (!raid_bypassed )
@@ -7350,7 +7361,9 @@ static ssize_t pqi_raid_bypass_cnt_show(struct device *dev,
7350
7361
struct scsi_device * sdev ;
7351
7362
struct pqi_scsi_dev * device ;
7352
7363
unsigned long flags ;
7353
- unsigned int raid_bypass_cnt ;
7364
+ u64 raid_bypass_cnt ;
7365
+ int cpu ;
7366
+ u64 * per_cpu_bypass_cnt_ptr ;
7354
7367
7355
7368
sdev = to_scsi_device (dev );
7356
7369
ctrl_info = shost_to_hba (sdev -> host );
@@ -7366,11 +7379,18 @@ static ssize_t pqi_raid_bypass_cnt_show(struct device *dev,
7366
7379
return - ENODEV ;
7367
7380
}
7368
7381
7369
- raid_bypass_cnt = device -> raid_bypass_cnt ;
7382
+ raid_bypass_cnt = 0 ;
7383
+
7384
+ if (device -> raid_bypass_cnt ) {
7385
+ for_each_online_cpu (cpu ) {
7386
+ per_cpu_bypass_cnt_ptr = per_cpu_ptr (device -> raid_bypass_cnt , cpu );
7387
+ raid_bypass_cnt += * per_cpu_bypass_cnt_ptr ;
7388
+ }
7389
+ }
7370
7390
7371
7391
spin_unlock_irqrestore (& ctrl_info -> scsi_device_list_lock , flags );
7372
7392
7373
- return scnprintf (buffer , PAGE_SIZE , "0x%x \n" , raid_bypass_cnt );
7393
+ return scnprintf (buffer , PAGE_SIZE , "0x%llx \n" , raid_bypass_cnt );
7374
7394
}
7375
7395
7376
7396
static ssize_t pqi_sas_ncq_prio_enable_show (struct device * dev ,
@@ -9472,6 +9492,10 @@ static const struct pci_device_id pqi_pci_id_table[] = {
9472
9492
PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
9473
9493
0x193d , 0x110b )
9474
9494
},
9495
+ {
9496
+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
9497
+ 0x193d , 0x1110 )
9498
+ },
9475
9499
{
9476
9500
PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
9477
9501
0x193d , 0x8460 )
@@ -9588,6 +9612,14 @@ static const struct pci_device_id pqi_pci_id_table[] = {
9588
9612
PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
9589
9613
0x1bd4 , 0x0089 )
9590
9614
},
9615
+ {
9616
+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
9617
+ 0x1ff9 , 0x00a1 )
9618
+ },
9619
+ {
9620
+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
9621
+ 0x1f3a , 0x0104 )
9622
+ },
9591
9623
{
9592
9624
PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
9593
9625
0x19e5 , 0xd227 )
@@ -10180,6 +10212,98 @@ static const struct pci_device_id pqi_pci_id_table[] = {
10180
10212
PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10181
10213
0x1137 , 0x02fa )
10182
10214
},
10215
+ {
10216
+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10217
+ 0x1ff9 , 0x0045 )
10218
+ },
10219
+ {
10220
+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10221
+ 0x1ff9 , 0x0046 )
10222
+ },
10223
+ {
10224
+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10225
+ 0x1ff9 , 0x0047 )
10226
+ },
10227
+ {
10228
+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10229
+ 0x1ff9 , 0x0048 )
10230
+ },
10231
+ {
10232
+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10233
+ 0x1ff9 , 0x004a )
10234
+ },
10235
+ {
10236
+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10237
+ 0x1ff9 , 0x004b )
10238
+ },
10239
+ {
10240
+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10241
+ 0x1ff9 , 0x004c )
10242
+ },
10243
+ {
10244
+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10245
+ 0x1ff9 , 0x004f )
10246
+ },
10247
+ {
10248
+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10249
+ 0x1ff9 , 0x0051 )
10250
+ },
10251
+ {
10252
+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10253
+ 0x1ff9 , 0x0052 )
10254
+ },
10255
+ {
10256
+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10257
+ 0x1ff9 , 0x0053 )
10258
+ },
10259
+ {
10260
+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10261
+ 0x1ff9 , 0x0054 )
10262
+ },
10263
+ {
10264
+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10265
+ 0x1ff9 , 0x006b )
10266
+ },
10267
+ {
10268
+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10269
+ 0x1ff9 , 0x006c )
10270
+ },
10271
+ {
10272
+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10273
+ 0x1ff9 , 0x006d )
10274
+ },
10275
+ {
10276
+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10277
+ 0x1ff9 , 0x006f )
10278
+ },
10279
+ {
10280
+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10281
+ 0x1ff9 , 0x0070 )
10282
+ },
10283
+ {
10284
+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10285
+ 0x1ff9 , 0x0071 )
10286
+ },
10287
+ {
10288
+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10289
+ 0x1ff9 , 0x0072 )
10290
+ },
10291
+ {
10292
+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10293
+ 0x1ff9 , 0x0086 )
10294
+ },
10295
+ {
10296
+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10297
+ 0x1ff9 , 0x0087 )
10298
+ },
10299
+ {
10300
+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10301
+ 0x1ff9 , 0x0088 )
10302
+ },
10303
+ {
10304
+ PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10305
+ 0x1ff9 , 0x0089 )
10306
+ },
10183
10307
{
10184
10308
PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 , 0x028f ,
10185
10309
0x1e93 , 0x1000 )
0 commit comments