aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mpt2sas/mpt2sas_scsih.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_scsih.c')
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_scsih.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index afd3b82f7cd6..3d1be440ed7b 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -1376,7 +1376,7 @@ _scsih_display_sata_capabilities(struct MPT2SAS_ADAPTER *ioc,
1376 } 1376 }
1377 1377
1378 flags = le16_to_cpu(sas_device_pg0.Flags); 1378 flags = le16_to_cpu(sas_device_pg0.Flags);
1379 device_info = le16_to_cpu(sas_device_pg0.DeviceInfo); 1379 device_info = le32_to_cpu(sas_device_pg0.DeviceInfo);
1380 1380
1381 sdev_printk(KERN_INFO, sdev, 1381 sdev_printk(KERN_INFO, sdev,
1382 "atapi(%s), ncq(%s), asyn_notify(%s), smart(%s), fua(%s), " 1382 "atapi(%s), ncq(%s), asyn_notify(%s), smart(%s), fua(%s), "
@@ -3210,8 +3210,8 @@ _scsih_scsi_ioc_info(struct MPT2SAS_ADAPTER *ioc, struct scsi_cmnd *scmd,
3210 struct sense_info data; 3210 struct sense_info data;
3211 _scsih_normalize_sense(scmd->sense_buffer, &data); 3211 _scsih_normalize_sense(scmd->sense_buffer, &data);
3212 printk(MPT2SAS_WARN_FMT "\t[sense_key,asc,ascq]: " 3212 printk(MPT2SAS_WARN_FMT "\t[sense_key,asc,ascq]: "
3213 "[0x%02x,0x%02x,0x%02x]\n", ioc->name, data.skey, 3213 "[0x%02x,0x%02x,0x%02x], count(%d)\n", ioc->name, data.skey,
3214 data.asc, data.ascq); 3214 data.asc, data.ascq, le32_to_cpu(mpi_reply->SenseCount));
3215 } 3215 }
3216 3216
3217 if (scsi_state & MPI2_SCSI_STATE_RESPONSE_INFO_VALID) { 3217 if (scsi_state & MPI2_SCSI_STATE_RESPONSE_INFO_VALID) {
@@ -3265,7 +3265,7 @@ _scsih_smart_predicted_fault(struct MPT2SAS_ADAPTER *ioc, u16 handle)
3265 mpi_request.Function = MPI2_FUNCTION_SCSI_ENCLOSURE_PROCESSOR; 3265 mpi_request.Function = MPI2_FUNCTION_SCSI_ENCLOSURE_PROCESSOR;
3266 mpi_request.Action = MPI2_SEP_REQ_ACTION_WRITE_STATUS; 3266 mpi_request.Action = MPI2_SEP_REQ_ACTION_WRITE_STATUS;
3267 mpi_request.SlotStatus = 3267 mpi_request.SlotStatus =
3268 MPI2_SEP_REQ_SLOTSTATUS_PREDICTED_FAULT; 3268 cpu_to_le32(MPI2_SEP_REQ_SLOTSTATUS_PREDICTED_FAULT);
3269 mpi_request.DevHandle = cpu_to_le16(handle); 3269 mpi_request.DevHandle = cpu_to_le16(handle);
3270 mpi_request.Flags = MPI2_SEP_REQ_FLAGS_DEVHANDLE_ADDRESS; 3270 mpi_request.Flags = MPI2_SEP_REQ_FLAGS_DEVHANDLE_ADDRESS;
3271 if ((mpt2sas_base_scsi_enclosure_processor(ioc, &mpi_reply, 3271 if ((mpt2sas_base_scsi_enclosure_processor(ioc, &mpi_reply,
@@ -5934,6 +5934,7 @@ mpt2sas_scsih_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 msix_index,
5934 struct fw_event_work *fw_event; 5934 struct fw_event_work *fw_event;
5935 Mpi2EventNotificationReply_t *mpi_reply; 5935 Mpi2EventNotificationReply_t *mpi_reply;
5936 u16 event; 5936 u16 event;
5937 u16 sz;
5937 5938
5938 /* events turned off due to host reset or driver unloading */ 5939 /* events turned off due to host reset or driver unloading */
5939 if (ioc->remove_host) 5940 if (ioc->remove_host)
@@ -5984,8 +5985,8 @@ mpt2sas_scsih_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 msix_index,
5984 ioc->name, __FILE__, __LINE__, __func__); 5985 ioc->name, __FILE__, __LINE__, __func__);
5985 return 1; 5986 return 1;
5986 } 5987 }
5987 fw_event->event_data = 5988 sz = le16_to_cpu(mpi_reply->EventDataLength) * 4;
5988 kzalloc(mpi_reply->EventDataLength*4, GFP_ATOMIC); 5989 fw_event->event_data = kzalloc(sz, GFP_ATOMIC);
5989 if (!fw_event->event_data) { 5990 if (!fw_event->event_data) {
5990 printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n", 5991 printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
5991 ioc->name, __FILE__, __LINE__, __func__); 5992 ioc->name, __FILE__, __LINE__, __func__);
@@ -5994,7 +5995,7 @@ mpt2sas_scsih_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 msix_index,
5994 } 5995 }
5995 5996
5996 memcpy(fw_event->event_data, mpi_reply->EventData, 5997 memcpy(fw_event->event_data, mpi_reply->EventData,
5997 mpi_reply->EventDataLength*4); 5998 sz);
5998 fw_event->ioc = ioc; 5999 fw_event->ioc = ioc;
5999 fw_event->VF_ID = mpi_reply->VF_ID; 6000 fw_event->VF_ID = mpi_reply->VF_ID;
6000 fw_event->VP_ID = mpi_reply->VP_ID; 6001 fw_event->VP_ID = mpi_reply->VP_ID;