@@ -498,6 +498,10 @@ struct ipr_error_table_t ipr_error_table[] = {
498
498
"4061: Multipath redundancy level got better" },
499
499
{0x066B9200 , 0 , IPR_DEFAULT_LOG_LEVEL ,
500
500
"4060: Multipath redundancy level got worse" },
501
+ {0x06808100 , 0 , IPR_DEFAULT_LOG_LEVEL ,
502
+ "9083: Device raw mode enabled" },
503
+ {0x06808200 , 0 , IPR_DEFAULT_LOG_LEVEL ,
504
+ "9084: Device raw mode disabled" },
501
505
{0x07270000 , 0 , 0 ,
502
506
"Failure due to other device" },
503
507
{0x07278000 , 0 , IPR_DEFAULT_LOG_LEVEL ,
@@ -4496,11 +4500,83 @@ static struct device_attribute ipr_resource_type_attr = {
4496
4500
.show = ipr_show_resource_type
4497
4501
};
4498
4502
4503
+ /**
4504
+ * ipr_show_raw_mode - Show the adapter's raw mode
4505
+ * @dev: class device struct
4506
+ * @buf: buffer
4507
+ *
4508
+ * Return value:
4509
+ * number of bytes printed to buffer
4510
+ **/
4511
+ static ssize_t ipr_show_raw_mode (struct device * dev ,
4512
+ struct device_attribute * attr , char * buf )
4513
+ {
4514
+ struct scsi_device * sdev = to_scsi_device (dev );
4515
+ struct ipr_ioa_cfg * ioa_cfg = (struct ipr_ioa_cfg * )sdev -> host -> hostdata ;
4516
+ struct ipr_resource_entry * res ;
4517
+ unsigned long lock_flags = 0 ;
4518
+ ssize_t len ;
4519
+
4520
+ spin_lock_irqsave (ioa_cfg -> host -> host_lock , lock_flags );
4521
+ res = (struct ipr_resource_entry * )sdev -> hostdata ;
4522
+ if (res )
4523
+ len = snprintf (buf , PAGE_SIZE , "%d\n" , res -> raw_mode );
4524
+ else
4525
+ len = - ENXIO ;
4526
+ spin_unlock_irqrestore (ioa_cfg -> host -> host_lock , lock_flags );
4527
+ return len ;
4528
+ }
4529
+
4530
+ /**
4531
+ * ipr_store_raw_mode - Change the adapter's raw mode
4532
+ * @dev: class device struct
4533
+ * @buf: buffer
4534
+ *
4535
+ * Return value:
4536
+ * number of bytes printed to buffer
4537
+ **/
4538
+ static ssize_t ipr_store_raw_mode (struct device * dev ,
4539
+ struct device_attribute * attr ,
4540
+ const char * buf , size_t count )
4541
+ {
4542
+ struct scsi_device * sdev = to_scsi_device (dev );
4543
+ struct ipr_ioa_cfg * ioa_cfg = (struct ipr_ioa_cfg * )sdev -> host -> hostdata ;
4544
+ struct ipr_resource_entry * res ;
4545
+ unsigned long lock_flags = 0 ;
4546
+ ssize_t len ;
4547
+
4548
+ spin_lock_irqsave (ioa_cfg -> host -> host_lock , lock_flags );
4549
+ res = (struct ipr_resource_entry * )sdev -> hostdata ;
4550
+ if (res ) {
4551
+ if (ioa_cfg -> sis64 && ipr_is_af_dasd_device (res )) {
4552
+ res -> raw_mode = simple_strtoul (buf , NULL , 10 );
4553
+ len = strlen (buf );
4554
+ if (res -> sdev )
4555
+ sdev_printk (KERN_INFO , res -> sdev , "raw mode is %s\n" ,
4556
+ res -> raw_mode ? "enabled" : "disabled" );
4557
+ } else
4558
+ len = - EINVAL ;
4559
+ } else
4560
+ len = - ENXIO ;
4561
+ spin_unlock_irqrestore (ioa_cfg -> host -> host_lock , lock_flags );
4562
+ return len ;
4563
+ }
4564
+
4565
+ static struct device_attribute ipr_raw_mode_attr = {
4566
+ .attr = {
4567
+ .name = "raw_mode" ,
4568
+ .mode = S_IRUGO | S_IWUSR ,
4569
+ },
4570
+ .show = ipr_show_raw_mode ,
4571
+ .store = ipr_store_raw_mode
4572
+ };
4573
+
4499
4574
static struct device_attribute * ipr_dev_attrs [] = {
4500
4575
& ipr_adapter_handle_attr ,
4501
4576
& ipr_resource_path_attr ,
4502
4577
& ipr_device_id_attr ,
4503
4578
& ipr_resource_type_attr ,
4579
+ & ipr_raw_mode_attr ,
4504
4580
NULL ,
4505
4581
};
4506
4582
@@ -6152,6 +6228,13 @@ static void ipr_erp_start(struct ipr_ioa_cfg *ioa_cfg,
6152
6228
break ;
6153
6229
case IPR_IOASC_NR_INIT_CMD_REQUIRED :
6154
6230
break ;
6231
+ case IPR_IOASC_IR_NON_OPTIMIZED :
6232
+ if (res -> raw_mode ) {
6233
+ res -> raw_mode = 0 ;
6234
+ scsi_cmd -> result |= (DID_IMM_RETRY << 16 );
6235
+ } else
6236
+ scsi_cmd -> result |= (DID_ERROR << 16 );
6237
+ break ;
6155
6238
default :
6156
6239
if (IPR_IOASC_SENSE_KEY (ioasc ) > RECOVERED_ERROR )
6157
6240
scsi_cmd -> result |= (DID_ERROR << 16 );
@@ -6291,6 +6374,8 @@ static int ipr_queuecommand(struct Scsi_Host *shost,
6291
6374
(!ipr_is_gscsi (res ) || scsi_cmd -> cmnd [0 ] == IPR_QUERY_RSRC_STATE )) {
6292
6375
ioarcb -> cmd_pkt .request_type = IPR_RQTYPE_IOACMD ;
6293
6376
}
6377
+ if (res -> raw_mode && ipr_is_af_dasd_device (res ))
6378
+ ioarcb -> cmd_pkt .request_type = IPR_RQTYPE_PIPE ;
6294
6379
6295
6380
if (ioa_cfg -> sis64 )
6296
6381
rc = ipr_build_ioadl64 (ioa_cfg , ipr_cmd );
0 commit comments