Commit fd35598a authored by Ben Collins's avatar Ben Collins

IEEE1394/SBP2(r1148): Fix a few bugs, and add set blk_queue_dma_alignment to 512.

parent 351d7dda
...@@ -660,7 +660,7 @@ static int sbp2_update(struct unit_directory *ud) ...@@ -660,7 +660,7 @@ static int sbp2_update(struct unit_directory *ud)
if (sbp2_login_device(scsi_id)) { if (sbp2_login_device(scsi_id)) {
/* Login failed too, just fail, and the backend /* Login failed too, just fail, and the backend
* will call our sbp2_remove for us */ * will call our sbp2_remove for us */
SBP2_ERR("sbp2_reconnect_device failed!"); SBP2_INFO("sbp2_reconnect_device failed!");
return -EBUSY; return -EBUSY;
} }
} }
...@@ -731,7 +731,7 @@ static struct scsi_id_instance_data *sbp2_alloc_device(struct unit_directory *ud ...@@ -731,7 +731,7 @@ static struct scsi_id_instance_data *sbp2_alloc_device(struct unit_directory *ud
#ifdef CONFIG_IEEE1394_SBP2_PHYS_DMA #ifdef CONFIG_IEEE1394_SBP2_PHYS_DMA
/* Handle data movement if physical dma is not /* Handle data movement if physical dma is not
* enabled/supportedon host controller */ * enabled/supportedon host controller */
hpsb_register_addrspace(&sbp2_highlevel, host, &sbp2_physdma_ops, hpsb_register_addrspace(&sbp2_highlevel, ud->ne->host, &sbp2_physdma_ops,
0x0ULL, 0xfffffffcULL); 0x0ULL, 0xfffffffcULL);
#endif #endif
} }
...@@ -1149,12 +1149,12 @@ static int sbp2_query_logins(struct scsi_id_instance_data *scsi_id) ...@@ -1149,12 +1149,12 @@ static int sbp2_query_logins(struct scsi_id_instance_data *scsi_id)
SBP2_DEBUG("sbp2_query_logins: written"); SBP2_DEBUG("sbp2_query_logins: written");
if (sbp2util_down_timeout(&scsi_id->sbp2_login_complete, 2*HZ)) { if (sbp2util_down_timeout(&scsi_id->sbp2_login_complete, 2*HZ)) {
SBP2_ERR("Error querying logins to SBP-2 device - timed out"); SBP2_INFO("Error querying logins to SBP-2 device - timed out");
return(-EIO); return(-EIO);
} }
if (scsi_id->status_block.ORB_offset_lo != scsi_id->query_logins_orb_dma) { if (scsi_id->status_block.ORB_offset_lo != scsi_id->query_logins_orb_dma) {
SBP2_ERR("Error querying logins to SBP-2 device - timed out"); SBP2_INFO("Error querying logins to SBP-2 device - timed out");
return(-EIO); return(-EIO);
} }
...@@ -1162,7 +1162,7 @@ static int sbp2_query_logins(struct scsi_id_instance_data *scsi_id) ...@@ -1162,7 +1162,7 @@ static int sbp2_query_logins(struct scsi_id_instance_data *scsi_id)
STATUS_GET_DEAD_BIT(scsi_id->status_block.ORB_offset_hi_misc) || STATUS_GET_DEAD_BIT(scsi_id->status_block.ORB_offset_hi_misc) ||
STATUS_GET_SBP_STATUS(scsi_id->status_block.ORB_offset_hi_misc)) { STATUS_GET_SBP_STATUS(scsi_id->status_block.ORB_offset_hi_misc)) {
SBP2_ERR("Error querying logins to SBP-2 device - timed out"); SBP2_INFO("Error querying logins to SBP-2 device - timed out");
return(-EIO); return(-EIO);
} }
...@@ -1171,13 +1171,13 @@ static int sbp2_query_logins(struct scsi_id_instance_data *scsi_id) ...@@ -1171,13 +1171,13 @@ static int sbp2_query_logins(struct scsi_id_instance_data *scsi_id)
SBP2_DEBUG("length_max_logins = %x", SBP2_DEBUG("length_max_logins = %x",
(unsigned int)scsi_id->query_logins_response->length_max_logins); (unsigned int)scsi_id->query_logins_response->length_max_logins);
SBP2_INFO("Query logins to SBP-2 device successful"); SBP2_DEBUG("Query logins to SBP-2 device successful");
max_logins = RESPONSE_GET_MAX_LOGINS(scsi_id->query_logins_response->length_max_logins); max_logins = RESPONSE_GET_MAX_LOGINS(scsi_id->query_logins_response->length_max_logins);
SBP2_INFO("Maximum concurrent logins supported: %d", max_logins); SBP2_DEBUG("Maximum concurrent logins supported: %d", max_logins);
active_logins = RESPONSE_GET_ACTIVE_LOGINS(scsi_id->query_logins_response->length_max_logins); active_logins = RESPONSE_GET_ACTIVE_LOGINS(scsi_id->query_logins_response->length_max_logins);
SBP2_INFO("Number of active logins: %d", active_logins); SBP2_DEBUG("Number of active logins: %d", active_logins);
if (active_logins >= max_logins) { if (active_logins >= max_logins) {
return(-EIO); return(-EIO);
...@@ -1204,7 +1204,7 @@ static int sbp2_login_device(struct scsi_id_instance_data *scsi_id) ...@@ -1204,7 +1204,7 @@ static int sbp2_login_device(struct scsi_id_instance_data *scsi_id)
if (!exclusive_login) { if (!exclusive_login) {
if (sbp2_query_logins(scsi_id)) { if (sbp2_query_logins(scsi_id)) {
SBP2_ERR("Device does not support any more concurrent logins"); SBP2_INFO("Device does not support any more concurrent logins");
return(-EIO); return(-EIO);
} }
} }
...@@ -2687,6 +2687,15 @@ static void sbp2scsi_complete_command(struct scsi_id_instance_data *scsi_id, ...@@ -2687,6 +2687,15 @@ static void sbp2scsi_complete_command(struct scsi_id_instance_data *scsi_id,
return; return;
} }
static int sbp2scsi_slave_configure (struct scsi_device *sdev)
{
blk_queue_dma_alignment(sdev->request_queue, (512 - 1));
return 0;
}
/* /*
* Called by scsi stack when something has really gone wrong. Usually * Called by scsi stack when something has really gone wrong. Usually
* called when a command has timed-out for some reason. * called when a command has timed-out for some reason.
...@@ -2802,6 +2811,7 @@ static Scsi_Host_Template scsi_driver_template = { ...@@ -2802,6 +2811,7 @@ static Scsi_Host_Template scsi_driver_template = {
.eh_device_reset_handler = sbp2scsi_reset, .eh_device_reset_handler = sbp2scsi_reset,
.eh_bus_reset_handler = sbp2scsi_reset, .eh_bus_reset_handler = sbp2scsi_reset,
.eh_host_reset_handler = sbp2scsi_reset, .eh_host_reset_handler = sbp2scsi_reset,
.slave_configure = sbp2scsi_slave_configure,
.this_id = -1, .this_id = -1,
.sg_tablesize = SG_ALL, .sg_tablesize = SG_ALL,
.use_clustering = ENABLE_CLUSTERING, .use_clustering = ENABLE_CLUSTERING,
......
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