Commit 5f61ec34 authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by Greg Kroah-Hartman

Staging: hv: storvsc: Get rid of some unnecessary DPRINTS

Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarAbhishek Kane <v-abkane@microsoft.com>
Signed-off-by: default avatarHank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 6028210e
...@@ -113,11 +113,8 @@ static int storvsc_channel_init(struct hv_device *device) ...@@ -113,11 +113,8 @@ static int storvsc_channel_init(struct hv_device *device)
int ret, t; int ret, t;
stor_device = get_stor_device(device); stor_device = get_stor_device(device);
if (!stor_device) { if (!stor_device)
DPRINT_ERR(STORVSC, "unable to get stor device..."
"device being destroyed?");
return -1; return -1;
}
request = &stor_device->init_request; request = &stor_device->init_request;
vstor_packet = &request->vstor_packet; vstor_packet = &request->vstor_packet;
...@@ -138,11 +135,8 @@ static int storvsc_channel_init(struct hv_device *device) ...@@ -138,11 +135,8 @@ static int storvsc_channel_init(struct hv_device *device)
(unsigned long)request, (unsigned long)request,
VM_PKT_DATA_INBAND, VM_PKT_DATA_INBAND,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
if (ret != 0) { if (ret != 0)
DPRINT_ERR(STORVSC,
"unable to send BEGIN_INITIALIZATION_OPERATION");
goto cleanup; goto cleanup;
}
t = wait_for_completion_timeout(&request->wait_event, HZ); t = wait_for_completion_timeout(&request->wait_event, HZ);
if (t == 0) { if (t == 0) {
...@@ -151,12 +145,8 @@ static int storvsc_channel_init(struct hv_device *device) ...@@ -151,12 +145,8 @@ static int storvsc_channel_init(struct hv_device *device)
} }
if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO || if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
vstor_packet->status != 0) { vstor_packet->status != 0)
DPRINT_ERR(STORVSC, "BEGIN_INITIALIZATION_OPERATION failed "
"(op %d status 0x%x)",
vstor_packet->operation, vstor_packet->status);
goto cleanup; goto cleanup;
}
DPRINT_INFO(STORVSC, "QUERY_PROTOCOL_VERSION_OPERATION..."); DPRINT_INFO(STORVSC, "QUERY_PROTOCOL_VERSION_OPERATION...");
...@@ -173,11 +163,8 @@ static int storvsc_channel_init(struct hv_device *device) ...@@ -173,11 +163,8 @@ static int storvsc_channel_init(struct hv_device *device)
(unsigned long)request, (unsigned long)request,
VM_PKT_DATA_INBAND, VM_PKT_DATA_INBAND,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
if (ret != 0) { if (ret != 0)
DPRINT_ERR(STORVSC,
"unable to send BEGIN_INITIALIZATION_OPERATION");
goto cleanup; goto cleanup;
}
t = wait_for_completion_timeout(&request->wait_event, HZ); t = wait_for_completion_timeout(&request->wait_event, HZ);
if (t == 0) { if (t == 0) {
...@@ -187,12 +174,8 @@ static int storvsc_channel_init(struct hv_device *device) ...@@ -187,12 +174,8 @@ static int storvsc_channel_init(struct hv_device *device)
/* TODO: Check returned version */ /* TODO: Check returned version */
if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO || if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
vstor_packet->status != 0) { vstor_packet->status != 0)
DPRINT_ERR(STORVSC, "QUERY_PROTOCOL_VERSION_OPERATION failed "
"(op %d status 0x%x)",
vstor_packet->operation, vstor_packet->status);
goto cleanup; goto cleanup;
}
/* Query channel properties */ /* Query channel properties */
DPRINT_INFO(STORVSC, "QUERY_PROPERTIES_OPERATION..."); DPRINT_INFO(STORVSC, "QUERY_PROPERTIES_OPERATION...");
...@@ -209,11 +192,8 @@ static int storvsc_channel_init(struct hv_device *device) ...@@ -209,11 +192,8 @@ static int storvsc_channel_init(struct hv_device *device)
VM_PKT_DATA_INBAND, VM_PKT_DATA_INBAND,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
if (ret != 0) { if (ret != 0)
DPRINT_ERR(STORVSC,
"unable to send QUERY_PROPERTIES_OPERATION");
goto cleanup; goto cleanup;
}
t = wait_for_completion_timeout(&request->wait_event, HZ); t = wait_for_completion_timeout(&request->wait_event, HZ);
if (t == 0) { if (t == 0) {
...@@ -223,21 +203,13 @@ static int storvsc_channel_init(struct hv_device *device) ...@@ -223,21 +203,13 @@ static int storvsc_channel_init(struct hv_device *device)
/* TODO: Check returned version */ /* TODO: Check returned version */
if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO || if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
vstor_packet->status != 0) { vstor_packet->status != 0)
DPRINT_ERR(STORVSC, "QUERY_PROPERTIES_OPERATION failed "
"(op %d status 0x%x)",
vstor_packet->operation, vstor_packet->status);
goto cleanup; goto cleanup;
}
stor_device->path_id = vstor_packet->storage_channel_properties.path_id; stor_device->path_id = vstor_packet->storage_channel_properties.path_id;
stor_device->target_id stor_device->target_id
= vstor_packet->storage_channel_properties.target_id; = vstor_packet->storage_channel_properties.target_id;
DPRINT_DBG(STORVSC, "channel flag 0x%x, max xfer len 0x%x",
vstor_packet->storage_channel_properties.flags,
vstor_packet->storage_channel_properties.max_transfer_bytes);
DPRINT_INFO(STORVSC, "END_INITIALIZATION_OPERATION..."); DPRINT_INFO(STORVSC, "END_INITIALIZATION_OPERATION...");
memset(vstor_packet, 0, sizeof(struct vstor_packet)); memset(vstor_packet, 0, sizeof(struct vstor_packet));
...@@ -250,11 +222,8 @@ static int storvsc_channel_init(struct hv_device *device) ...@@ -250,11 +222,8 @@ static int storvsc_channel_init(struct hv_device *device)
VM_PKT_DATA_INBAND, VM_PKT_DATA_INBAND,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
if (ret != 0) { if (ret != 0)
DPRINT_ERR(STORVSC,
"unable to send END_INITIALIZATION_OPERATION");
goto cleanup; goto cleanup;
}
t = wait_for_completion_timeout(&request->wait_event, HZ); t = wait_for_completion_timeout(&request->wait_event, HZ);
if (t == 0) { if (t == 0) {
...@@ -263,12 +232,8 @@ static int storvsc_channel_init(struct hv_device *device) ...@@ -263,12 +232,8 @@ static int storvsc_channel_init(struct hv_device *device)
} }
if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO || if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
vstor_packet->status != 0) { vstor_packet->status != 0)
DPRINT_ERR(STORVSC, "END_INITIALIZATION_OPERATION failed "
"(op %d status 0x%x)",
vstor_packet->operation, vstor_packet->status);
goto cleanup; goto cleanup;
}
DPRINT_INFO(STORVSC, "**** storage channel up and running!! ****"); DPRINT_INFO(STORVSC, "**** storage channel up and running!! ****");
...@@ -285,15 +250,8 @@ static void storvsc_on_io_completion(struct hv_device *device, ...@@ -285,15 +250,8 @@ static void storvsc_on_io_completion(struct hv_device *device,
struct vstor_packet *stor_pkt; struct vstor_packet *stor_pkt;
stor_device = must_get_stor_device(device); stor_device = must_get_stor_device(device);
if (!stor_device) { if (!stor_device)
DPRINT_ERR(STORVSC, "unable to get stor device..."
"device being destroyed?");
return; return;
}
DPRINT_DBG(STORVSC, "IO_COMPLETE_OPERATION - request %p "
"completed bytes xfer %u", request,
vstor_packet->vm_srb.data_transfer_length);
stor_pkt = &request->vstor_packet; stor_pkt = &request->vstor_packet;
...@@ -305,7 +263,7 @@ static void storvsc_on_io_completion(struct hv_device *device, ...@@ -305,7 +263,7 @@ static void storvsc_on_io_completion(struct hv_device *device,
vstor_packet->vm_srb.sense_info_length; vstor_packet->vm_srb.sense_info_length;
if (vstor_packet->vm_srb.scsi_status != 0 || if (vstor_packet->vm_srb.scsi_status != 0 ||
vstor_packet->vm_srb.srb_status != 1) { vstor_packet->vm_srb.srb_status != 1){
DPRINT_WARN(STORVSC, DPRINT_WARN(STORVSC,
"cmd 0x%x scsi status 0x%x srb status 0x%x\n", "cmd 0x%x scsi status 0x%x srb status 0x%x\n",
stor_pkt->vm_srb.cdb[0], stor_pkt->vm_srb.cdb[0],
...@@ -347,7 +305,6 @@ static void storvsc_on_receive(struct hv_device *device, ...@@ -347,7 +305,6 @@ static void storvsc_on_receive(struct hv_device *device,
{ {
switch (vstor_packet->operation) { switch (vstor_packet->operation) {
case VSTOR_OPERATION_COMPLETE_IO: case VSTOR_OPERATION_COMPLETE_IO:
DPRINT_DBG(STORVSC, "IO_COMPLETE_OPERATION");
storvsc_on_io_completion(device, vstor_packet, request); storvsc_on_io_completion(device, vstor_packet, request);
break; break;
case VSTOR_OPERATION_REMOVE_DEVICE: case VSTOR_OPERATION_REMOVE_DEVICE:
...@@ -374,20 +331,14 @@ static void storvsc_on_channel_callback(void *context) ...@@ -374,20 +331,14 @@ static void storvsc_on_channel_callback(void *context)
stor_device = must_get_stor_device(device); stor_device = must_get_stor_device(device);
if (!stor_device) { if (!stor_device)
DPRINT_ERR(STORVSC, "unable to get stor device..."
"device being destroyed?");
return; return;
}
do { do {
ret = vmbus_recvpacket(device->channel, packet, ret = vmbus_recvpacket(device->channel, packet,
ALIGN(sizeof(struct vstor_packet), 8), ALIGN(sizeof(struct vstor_packet), 8),
&bytes_recvd, &request_id); &bytes_recvd, &request_id);
if (ret == 0 && bytes_recvd > 0) { if (ret == 0 && bytes_recvd > 0) {
DPRINT_DBG(STORVSC, "receive %d bytes - tid %llx",
bytes_recvd, request_id);
request = (struct hv_storvsc_request *) request = (struct hv_storvsc_request *)
(unsigned long)request_id; (unsigned long)request_id;
...@@ -429,13 +380,8 @@ static int storvsc_connect_to_vsp(struct hv_device *device) ...@@ -429,13 +380,8 @@ static int storvsc_connect_to_vsp(struct hv_device *device)
sizeof(struct vmstorage_channel_properties), sizeof(struct vmstorage_channel_properties),
storvsc_on_channel_callback, device); storvsc_on_channel_callback, device);
DPRINT_DBG(STORVSC, "storage props: path id %d, tgt id %d, max xfer %d", if (ret != 0)
props.path_id, props.target_id, props.max_transfer_bytes);
if (ret != 0) {
DPRINT_ERR(STORVSC, "unable to open channel: %d", ret);
return -1; return -1;
}
ret = storvsc_channel_init(device); ret = storvsc_channel_init(device);
...@@ -472,10 +418,6 @@ int storvsc_dev_add(struct hv_device *device, ...@@ -472,10 +418,6 @@ int storvsc_dev_add(struct hv_device *device,
device_info->path_id = stor_device->path_id; device_info->path_id = stor_device->path_id;
device_info->target_id = stor_device->target_id; device_info->target_id = stor_device->target_id;
DPRINT_DBG(STORVSC, "assigned port %u, path %u target %u\n",
stor_device->port_number, stor_device->path_id,
stor_device->target_id);
cleanup: cleanup:
return ret; return ret;
} }
...@@ -497,13 +439,8 @@ int storvsc_dev_remove(struct hv_device *device) ...@@ -497,13 +439,8 @@ int storvsc_dev_remove(struct hv_device *device)
storvsc_wait_to_drain(stor_device); storvsc_wait_to_drain(stor_device);
DPRINT_INFO(STORVSC, "removing storage device (%p)...",
device->ext);
stor_device = final_release_stor_device(device); stor_device = final_release_stor_device(device);
DPRINT_INFO(STORVSC, "storage device (%p) safe to remove", stor_device);
/* Close the channel */ /* Close the channel */
vmbus_close(device->channel); vmbus_close(device->channel);
...@@ -521,17 +458,8 @@ int storvsc_do_io(struct hv_device *device, ...@@ -521,17 +458,8 @@ int storvsc_do_io(struct hv_device *device,
vstor_packet = &request->vstor_packet; vstor_packet = &request->vstor_packet;
stor_device = get_stor_device(device); stor_device = get_stor_device(device);
DPRINT_DBG(STORVSC, "enter - Device %p, DeviceExt %p, Request %p, " if (!stor_device)
, device, stor_device, request);
DPRINT_DBG(STORVSC, "req %p len %d",
request, request->data_buffer.len);
if (!stor_device) {
DPRINT_ERR(STORVSC, "unable to get stor device..."
"device being destroyed?");
return -2; return -2;
}
request->device = device; request->device = device;
...@@ -550,16 +478,6 @@ int storvsc_do_io(struct hv_device *device, ...@@ -550,16 +478,6 @@ int storvsc_do_io(struct hv_device *device,
vstor_packet->operation = VSTOR_OPERATION_EXECUTE_SRB; vstor_packet->operation = VSTOR_OPERATION_EXECUTE_SRB;
DPRINT_DBG(STORVSC, "srb - len %d port %d, path %d, target %d, "
"lun %d senselen %d cdblen %d",
vstor_packet->vm_srb.length,
vstor_packet->vm_srb.port_number,
vstor_packet->vm_srb.path_id,
vstor_packet->vm_srb.target_id,
vstor_packet->vm_srb.lun,
vstor_packet->vm_srb.sense_info_length,
vstor_packet->vm_srb.cdb_length);
if (request->data_buffer.len) { if (request->data_buffer.len) {
ret = vmbus_sendpacket_multipagebuffer(device->channel, ret = vmbus_sendpacket_multipagebuffer(device->channel,
&request->data_buffer, &request->data_buffer,
...@@ -574,10 +492,8 @@ int storvsc_do_io(struct hv_device *device, ...@@ -574,10 +492,8 @@ int storvsc_do_io(struct hv_device *device,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
} }
if (ret != 0) { if (ret != 0)
DPRINT_DBG(STORVSC, "Unable to send packet %p ret %d", return ret;
vstor_packet, ret);
}
atomic_inc(&stor_device->num_outstanding_req); atomic_inc(&stor_device->num_outstanding_req);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment