aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/sbp2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ieee1394/sbp2.c')
-rw-r--r--drivers/ieee1394/sbp2.c108
1 files changed, 50 insertions, 58 deletions
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
index e68b80b7340d..4edfff46b1e6 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -51,7 +51,6 @@
51 * Grep for inline FIXME comments below. 51 * Grep for inline FIXME comments below.
52 */ 52 */
53 53
54#include <linux/blkdev.h>
55#include <linux/compiler.h> 54#include <linux/compiler.h>
56#include <linux/delay.h> 55#include <linux/delay.h>
57#include <linux/device.h> 56#include <linux/device.h>
@@ -304,10 +303,11 @@ static struct scsi_host_template sbp2_shost_template = {
304 .use_clustering = ENABLE_CLUSTERING, 303 .use_clustering = ENABLE_CLUSTERING,
305 .cmd_per_lun = SBP2_MAX_CMDS, 304 .cmd_per_lun = SBP2_MAX_CMDS,
306 .can_queue = SBP2_MAX_CMDS, 305 .can_queue = SBP2_MAX_CMDS,
307 .emulated = 1,
308 .sdev_attrs = sbp2_sysfs_sdev_attrs, 306 .sdev_attrs = sbp2_sysfs_sdev_attrs,
309}; 307};
310 308
309/* for match-all entries in sbp2_workarounds_table */
310#define SBP2_ROM_VALUE_WILDCARD 0x1000000
311 311
312/* 312/*
313 * List of devices with known bugs. 313 * List of devices with known bugs.
@@ -329,22 +329,14 @@ static const struct {
329 }, 329 },
330 /* Initio bridges, actually only needed for some older ones */ { 330 /* Initio bridges, actually only needed for some older ones */ {
331 .firmware_revision = 0x000200, 331 .firmware_revision = 0x000200,
332 .model_id = SBP2_ROM_VALUE_WILDCARD,
332 .workarounds = SBP2_WORKAROUND_INQUIRY_36, 333 .workarounds = SBP2_WORKAROUND_INQUIRY_36,
333 }, 334 },
334 /* Symbios bridge */ { 335 /* Symbios bridge */ {
335 .firmware_revision = 0xa0b800, 336 .firmware_revision = 0xa0b800,
337 .model_id = SBP2_ROM_VALUE_WILDCARD,
336 .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS, 338 .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS,
337 }, 339 },
338 /*
339 * Note about the following Apple iPod blacklist entries:
340 *
341 * There are iPods (2nd gen, 3rd gen) with model_id==0. Since our
342 * matching logic treats 0 as a wildcard, we cannot match this ID
343 * without rewriting the matching routine. Fortunately these iPods
344 * do not feature the read_capacity bug according to one report.
345 * Read_capacity behaviour as well as model_id could change due to
346 * Apple-supplied firmware updates though.
347 */
348 /* iPod 4th generation */ { 340 /* iPod 4th generation */ {
349 .firmware_revision = 0x0a2700, 341 .firmware_revision = 0x0a2700,
350 .model_id = 0x000021, 342 .model_id = 0x000021,
@@ -490,11 +482,11 @@ static int sbp2util_create_command_orb_pool(struct sbp2_lu *lu)
490 spin_unlock_irqrestore(&lu->cmd_orb_lock, flags); 482 spin_unlock_irqrestore(&lu->cmd_orb_lock, flags);
491 return -ENOMEM; 483 return -ENOMEM;
492 } 484 }
493 cmd->command_orb_dma = dma_map_single(&hi->host->device, 485 cmd->command_orb_dma = dma_map_single(hi->host->device.parent,
494 &cmd->command_orb, 486 &cmd->command_orb,
495 sizeof(struct sbp2_command_orb), 487 sizeof(struct sbp2_command_orb),
496 DMA_TO_DEVICE); 488 DMA_TO_DEVICE);
497 cmd->sge_dma = dma_map_single(&hi->host->device, 489 cmd->sge_dma = dma_map_single(hi->host->device.parent,
498 &cmd->scatter_gather_element, 490 &cmd->scatter_gather_element,
499 sizeof(cmd->scatter_gather_element), 491 sizeof(cmd->scatter_gather_element),
500 DMA_BIDIRECTIONAL); 492 DMA_BIDIRECTIONAL);
@@ -516,10 +508,11 @@ static void sbp2util_remove_command_orb_pool(struct sbp2_lu *lu)
516 if (!list_empty(&lu->cmd_orb_completed)) 508 if (!list_empty(&lu->cmd_orb_completed))
517 list_for_each_safe(lh, next, &lu->cmd_orb_completed) { 509 list_for_each_safe(lh, next, &lu->cmd_orb_completed) {
518 cmd = list_entry(lh, struct sbp2_command_info, list); 510 cmd = list_entry(lh, struct sbp2_command_info, list);
519 dma_unmap_single(&host->device, cmd->command_orb_dma, 511 dma_unmap_single(host->device.parent,
512 cmd->command_orb_dma,
520 sizeof(struct sbp2_command_orb), 513 sizeof(struct sbp2_command_orb),
521 DMA_TO_DEVICE); 514 DMA_TO_DEVICE);
522 dma_unmap_single(&host->device, cmd->sge_dma, 515 dma_unmap_single(host->device.parent, cmd->sge_dma,
523 sizeof(cmd->scatter_gather_element), 516 sizeof(cmd->scatter_gather_element),
524 DMA_BIDIRECTIONAL); 517 DMA_BIDIRECTIONAL);
525 kfree(cmd); 518 kfree(cmd);
@@ -601,17 +594,17 @@ static void sbp2util_mark_command_completed(struct sbp2_lu *lu,
601 594
602 if (cmd->cmd_dma) { 595 if (cmd->cmd_dma) {
603 if (cmd->dma_type == CMD_DMA_SINGLE) 596 if (cmd->dma_type == CMD_DMA_SINGLE)
604 dma_unmap_single(&host->device, cmd->cmd_dma, 597 dma_unmap_single(host->device.parent, cmd->cmd_dma,
605 cmd->dma_size, cmd->dma_dir); 598 cmd->dma_size, cmd->dma_dir);
606 else if (cmd->dma_type == CMD_DMA_PAGE) 599 else if (cmd->dma_type == CMD_DMA_PAGE)
607 dma_unmap_page(&host->device, cmd->cmd_dma, 600 dma_unmap_page(host->device.parent, cmd->cmd_dma,
608 cmd->dma_size, cmd->dma_dir); 601 cmd->dma_size, cmd->dma_dir);
609 /* XXX: Check for CMD_DMA_NONE bug */ 602 /* XXX: Check for CMD_DMA_NONE bug */
610 cmd->dma_type = CMD_DMA_NONE; 603 cmd->dma_type = CMD_DMA_NONE;
611 cmd->cmd_dma = 0; 604 cmd->cmd_dma = 0;
612 } 605 }
613 if (cmd->sge_buffer) { 606 if (cmd->sge_buffer) {
614 dma_unmap_sg(&host->device, cmd->sge_buffer, 607 dma_unmap_sg(host->device.parent, cmd->sge_buffer,
615 cmd->dma_size, cmd->dma_dir); 608 cmd->dma_size, cmd->dma_dir);
616 cmd->sge_buffer = NULL; 609 cmd->sge_buffer = NULL;
617 } 610 }
@@ -836,37 +829,37 @@ static int sbp2_start_device(struct sbp2_lu *lu)
836 struct sbp2_fwhost_info *hi = lu->hi; 829 struct sbp2_fwhost_info *hi = lu->hi;
837 int error; 830 int error;
838 831
839 lu->login_response = dma_alloc_coherent(&hi->host->device, 832 lu->login_response = dma_alloc_coherent(hi->host->device.parent,
840 sizeof(struct sbp2_login_response), 833 sizeof(struct sbp2_login_response),
841 &lu->login_response_dma, GFP_KERNEL); 834 &lu->login_response_dma, GFP_KERNEL);
842 if (!lu->login_response) 835 if (!lu->login_response)
843 goto alloc_fail; 836 goto alloc_fail;
844 837
845 lu->query_logins_orb = dma_alloc_coherent(&hi->host->device, 838 lu->query_logins_orb = dma_alloc_coherent(hi->host->device.parent,
846 sizeof(struct sbp2_query_logins_orb), 839 sizeof(struct sbp2_query_logins_orb),
847 &lu->query_logins_orb_dma, GFP_KERNEL); 840 &lu->query_logins_orb_dma, GFP_KERNEL);
848 if (!lu->query_logins_orb) 841 if (!lu->query_logins_orb)
849 goto alloc_fail; 842 goto alloc_fail;
850 843
851 lu->query_logins_response = dma_alloc_coherent(&hi->host->device, 844 lu->query_logins_response = dma_alloc_coherent(hi->host->device.parent,
852 sizeof(struct sbp2_query_logins_response), 845 sizeof(struct sbp2_query_logins_response),
853 &lu->query_logins_response_dma, GFP_KERNEL); 846 &lu->query_logins_response_dma, GFP_KERNEL);
854 if (!lu->query_logins_response) 847 if (!lu->query_logins_response)
855 goto alloc_fail; 848 goto alloc_fail;
856 849
857 lu->reconnect_orb = dma_alloc_coherent(&hi->host->device, 850 lu->reconnect_orb = dma_alloc_coherent(hi->host->device.parent,
858 sizeof(struct sbp2_reconnect_orb), 851 sizeof(struct sbp2_reconnect_orb),
859 &lu->reconnect_orb_dma, GFP_KERNEL); 852 &lu->reconnect_orb_dma, GFP_KERNEL);
860 if (!lu->reconnect_orb) 853 if (!lu->reconnect_orb)
861 goto alloc_fail; 854 goto alloc_fail;
862 855
863 lu->logout_orb = dma_alloc_coherent(&hi->host->device, 856 lu->logout_orb = dma_alloc_coherent(hi->host->device.parent,
864 sizeof(struct sbp2_logout_orb), 857 sizeof(struct sbp2_logout_orb),
865 &lu->logout_orb_dma, GFP_KERNEL); 858 &lu->logout_orb_dma, GFP_KERNEL);
866 if (!lu->logout_orb) 859 if (!lu->logout_orb)
867 goto alloc_fail; 860 goto alloc_fail;
868 861
869 lu->login_orb = dma_alloc_coherent(&hi->host->device, 862 lu->login_orb = dma_alloc_coherent(hi->host->device.parent,
870 sizeof(struct sbp2_login_orb), 863 sizeof(struct sbp2_login_orb),
871 &lu->login_orb_dma, GFP_KERNEL); 864 &lu->login_orb_dma, GFP_KERNEL);
872 if (!lu->login_orb) 865 if (!lu->login_orb)
@@ -929,32 +922,32 @@ static void sbp2_remove_device(struct sbp2_lu *lu)
929 list_del(&lu->lu_list); 922 list_del(&lu->lu_list);
930 923
931 if (lu->login_response) 924 if (lu->login_response)
932 dma_free_coherent(&hi->host->device, 925 dma_free_coherent(hi->host->device.parent,
933 sizeof(struct sbp2_login_response), 926 sizeof(struct sbp2_login_response),
934 lu->login_response, 927 lu->login_response,
935 lu->login_response_dma); 928 lu->login_response_dma);
936 if (lu->login_orb) 929 if (lu->login_orb)
937 dma_free_coherent(&hi->host->device, 930 dma_free_coherent(hi->host->device.parent,
938 sizeof(struct sbp2_login_orb), 931 sizeof(struct sbp2_login_orb),
939 lu->login_orb, 932 lu->login_orb,
940 lu->login_orb_dma); 933 lu->login_orb_dma);
941 if (lu->reconnect_orb) 934 if (lu->reconnect_orb)
942 dma_free_coherent(&hi->host->device, 935 dma_free_coherent(hi->host->device.parent,
943 sizeof(struct sbp2_reconnect_orb), 936 sizeof(struct sbp2_reconnect_orb),
944 lu->reconnect_orb, 937 lu->reconnect_orb,
945 lu->reconnect_orb_dma); 938 lu->reconnect_orb_dma);
946 if (lu->logout_orb) 939 if (lu->logout_orb)
947 dma_free_coherent(&hi->host->device, 940 dma_free_coherent(hi->host->device.parent,
948 sizeof(struct sbp2_logout_orb), 941 sizeof(struct sbp2_logout_orb),
949 lu->logout_orb, 942 lu->logout_orb,
950 lu->logout_orb_dma); 943 lu->logout_orb_dma);
951 if (lu->query_logins_orb) 944 if (lu->query_logins_orb)
952 dma_free_coherent(&hi->host->device, 945 dma_free_coherent(hi->host->device.parent,
953 sizeof(struct sbp2_query_logins_orb), 946 sizeof(struct sbp2_query_logins_orb),
954 lu->query_logins_orb, 947 lu->query_logins_orb,
955 lu->query_logins_orb_dma); 948 lu->query_logins_orb_dma);
956 if (lu->query_logins_response) 949 if (lu->query_logins_response)
957 dma_free_coherent(&hi->host->device, 950 dma_free_coherent(hi->host->device.parent,
958 sizeof(struct sbp2_query_logins_response), 951 sizeof(struct sbp2_query_logins_response),
959 lu->query_logins_response, 952 lu->query_logins_response,
960 lu->query_logins_response_dma); 953 lu->query_logins_response_dma);
@@ -1306,11 +1299,13 @@ static void sbp2_parse_unit_directory(struct sbp2_lu *lu,
1306 1299
1307 if (!(workarounds & SBP2_WORKAROUND_OVERRIDE)) 1300 if (!(workarounds & SBP2_WORKAROUND_OVERRIDE))
1308 for (i = 0; i < ARRAY_SIZE(sbp2_workarounds_table); i++) { 1301 for (i = 0; i < ARRAY_SIZE(sbp2_workarounds_table); i++) {
1309 if (sbp2_workarounds_table[i].firmware_revision && 1302 if (sbp2_workarounds_table[i].firmware_revision !=
1303 SBP2_ROM_VALUE_WILDCARD &&
1310 sbp2_workarounds_table[i].firmware_revision != 1304 sbp2_workarounds_table[i].firmware_revision !=
1311 (firmware_revision & 0xffff00)) 1305 (firmware_revision & 0xffff00))
1312 continue; 1306 continue;
1313 if (sbp2_workarounds_table[i].model_id && 1307 if (sbp2_workarounds_table[i].model_id !=
1308 SBP2_ROM_VALUE_WILDCARD &&
1314 sbp2_workarounds_table[i].model_id != ud->model_id) 1309 sbp2_workarounds_table[i].model_id != ud->model_id)
1315 continue; 1310 continue;
1316 workarounds |= sbp2_workarounds_table[i].workarounds; 1311 workarounds |= sbp2_workarounds_table[i].workarounds;
@@ -1445,7 +1440,7 @@ static void sbp2_prep_command_orb_sg(struct sbp2_command_orb *orb,
1445 1440
1446 cmd->dma_size = sgpnt[0].length; 1441 cmd->dma_size = sgpnt[0].length;
1447 cmd->dma_type = CMD_DMA_PAGE; 1442 cmd->dma_type = CMD_DMA_PAGE;
1448 cmd->cmd_dma = dma_map_page(&hi->host->device, 1443 cmd->cmd_dma = dma_map_page(hi->host->device.parent,
1449 sgpnt[0].page, sgpnt[0].offset, 1444 sgpnt[0].page, sgpnt[0].offset,
1450 cmd->dma_size, cmd->dma_dir); 1445 cmd->dma_size, cmd->dma_dir);
1451 1446
@@ -1457,8 +1452,8 @@ static void sbp2_prep_command_orb_sg(struct sbp2_command_orb *orb,
1457 &cmd->scatter_gather_element[0]; 1452 &cmd->scatter_gather_element[0];
1458 u32 sg_count, sg_len; 1453 u32 sg_count, sg_len;
1459 dma_addr_t sg_addr; 1454 dma_addr_t sg_addr;
1460 int i, count = dma_map_sg(&hi->host->device, sgpnt, scsi_use_sg, 1455 int i, count = dma_map_sg(hi->host->device.parent, sgpnt,
1461 dma_dir); 1456 scsi_use_sg, dma_dir);
1462 1457
1463 cmd->dma_size = scsi_use_sg; 1458 cmd->dma_size = scsi_use_sg;
1464 cmd->sge_buffer = sgpnt; 1459 cmd->sge_buffer = sgpnt;
@@ -1508,7 +1503,8 @@ static void sbp2_prep_command_orb_no_sg(struct sbp2_command_orb *orb,
1508 cmd->dma_dir = dma_dir; 1503 cmd->dma_dir = dma_dir;
1509 cmd->dma_size = scsi_request_bufflen; 1504 cmd->dma_size = scsi_request_bufflen;
1510 cmd->dma_type = CMD_DMA_SINGLE; 1505 cmd->dma_type = CMD_DMA_SINGLE;
1511 cmd->cmd_dma = dma_map_single(&hi->host->device, scsi_request_buffer, 1506 cmd->cmd_dma = dma_map_single(hi->host->device.parent,
1507 scsi_request_buffer,
1512 cmd->dma_size, cmd->dma_dir); 1508 cmd->dma_size, cmd->dma_dir);
1513 orb->data_descriptor_hi = ORB_SET_NODE_ID(hi->host->node_id); 1509 orb->data_descriptor_hi = ORB_SET_NODE_ID(hi->host->node_id);
1514 orb->misc |= ORB_SET_DIRECTION(orb_direction); 1510 orb->misc |= ORB_SET_DIRECTION(orb_direction);
@@ -1626,10 +1622,11 @@ static void sbp2_link_orb_command(struct sbp2_lu *lu,
1626 size_t length; 1622 size_t length;
1627 unsigned long flags; 1623 unsigned long flags;
1628 1624
1629 dma_sync_single_for_device(&hi->host->device, cmd->command_orb_dma, 1625 dma_sync_single_for_device(hi->host->device.parent,
1626 cmd->command_orb_dma,
1630 sizeof(struct sbp2_command_orb), 1627 sizeof(struct sbp2_command_orb),
1631 DMA_TO_DEVICE); 1628 DMA_TO_DEVICE);
1632 dma_sync_single_for_device(&hi->host->device, cmd->sge_dma, 1629 dma_sync_single_for_device(hi->host->device.parent, cmd->sge_dma,
1633 sizeof(cmd->scatter_gather_element), 1630 sizeof(cmd->scatter_gather_element),
1634 DMA_BIDIRECTIONAL); 1631 DMA_BIDIRECTIONAL);
1635 1632
@@ -1655,14 +1652,15 @@ static void sbp2_link_orb_command(struct sbp2_lu *lu,
1655 * The target's fetch agent may or may not have read this 1652 * The target's fetch agent may or may not have read this
1656 * previous ORB yet. 1653 * previous ORB yet.
1657 */ 1654 */
1658 dma_sync_single_for_cpu(&hi->host->device, last_orb_dma, 1655 dma_sync_single_for_cpu(hi->host->device.parent, last_orb_dma,
1659 sizeof(struct sbp2_command_orb), 1656 sizeof(struct sbp2_command_orb),
1660 DMA_TO_DEVICE); 1657 DMA_TO_DEVICE);
1661 last_orb->next_ORB_lo = cpu_to_be32(cmd->command_orb_dma); 1658 last_orb->next_ORB_lo = cpu_to_be32(cmd->command_orb_dma);
1662 wmb(); 1659 wmb();
1663 /* Tells hardware that this pointer is valid */ 1660 /* Tells hardware that this pointer is valid */
1664 last_orb->next_ORB_hi = 0; 1661 last_orb->next_ORB_hi = 0;
1665 dma_sync_single_for_device(&hi->host->device, last_orb_dma, 1662 dma_sync_single_for_device(hi->host->device.parent,
1663 last_orb_dma,
1666 sizeof(struct sbp2_command_orb), 1664 sizeof(struct sbp2_command_orb),
1667 DMA_TO_DEVICE); 1665 DMA_TO_DEVICE);
1668 addr += SBP2_DOORBELL_OFFSET; 1666 addr += SBP2_DOORBELL_OFFSET;
@@ -1790,10 +1788,11 @@ static int sbp2_handle_status_write(struct hpsb_host *host, int nodeid,
1790 else 1788 else
1791 cmd = sbp2util_find_command_for_orb(lu, sb->ORB_offset_lo); 1789 cmd = sbp2util_find_command_for_orb(lu, sb->ORB_offset_lo);
1792 if (cmd) { 1790 if (cmd) {
1793 dma_sync_single_for_cpu(&hi->host->device, cmd->command_orb_dma, 1791 dma_sync_single_for_cpu(hi->host->device.parent,
1792 cmd->command_orb_dma,
1794 sizeof(struct sbp2_command_orb), 1793 sizeof(struct sbp2_command_orb),
1795 DMA_TO_DEVICE); 1794 DMA_TO_DEVICE);
1796 dma_sync_single_for_cpu(&hi->host->device, cmd->sge_dma, 1795 dma_sync_single_for_cpu(hi->host->device.parent, cmd->sge_dma,
1797 sizeof(cmd->scatter_gather_element), 1796 sizeof(cmd->scatter_gather_element),
1798 DMA_BIDIRECTIONAL); 1797 DMA_BIDIRECTIONAL);
1799 /* Grab SCSI command pointers and check status. */ 1798 /* Grab SCSI command pointers and check status. */
@@ -1882,16 +1881,6 @@ static int sbp2scsi_queuecommand(struct scsi_cmnd *SCpnt,
1882 if (unlikely(SCpnt->device->lun)) 1881 if (unlikely(SCpnt->device->lun))
1883 goto done; 1882 goto done;
1884 1883
1885 /* handle the request sense command here (auto-request sense) */
1886 if (SCpnt->cmnd[0] == REQUEST_SENSE) {
1887 memcpy(SCpnt->request_buffer, SCpnt->sense_buffer,
1888 SCpnt->request_bufflen);
1889 memset(SCpnt->sense_buffer, 0, sizeof(SCpnt->sense_buffer));
1890 sbp2scsi_complete_command(lu, SBP2_SCSI_STATUS_GOOD, SCpnt,
1891 done);
1892 return 0;
1893 }
1894
1895 if (unlikely(!hpsb_node_entry_valid(lu->ne))) { 1884 if (unlikely(!hpsb_node_entry_valid(lu->ne))) {
1896 SBP2_ERR("Bus reset in progress - rejecting command"); 1885 SBP2_ERR("Bus reset in progress - rejecting command");
1897 result = DID_BUS_BUSY << 16; 1886 result = DID_BUS_BUSY << 16;
@@ -1931,10 +1920,11 @@ static void sbp2scsi_complete_all_commands(struct sbp2_lu *lu, u32 status)
1931 while (!list_empty(&lu->cmd_orb_inuse)) { 1920 while (!list_empty(&lu->cmd_orb_inuse)) {
1932 lh = lu->cmd_orb_inuse.next; 1921 lh = lu->cmd_orb_inuse.next;
1933 cmd = list_entry(lh, struct sbp2_command_info, list); 1922 cmd = list_entry(lh, struct sbp2_command_info, list);
1934 dma_sync_single_for_cpu(&hi->host->device, cmd->command_orb_dma, 1923 dma_sync_single_for_cpu(hi->host->device.parent,
1924 cmd->command_orb_dma,
1935 sizeof(struct sbp2_command_orb), 1925 sizeof(struct sbp2_command_orb),
1936 DMA_TO_DEVICE); 1926 DMA_TO_DEVICE);
1937 dma_sync_single_for_cpu(&hi->host->device, cmd->sge_dma, 1927 dma_sync_single_for_cpu(hi->host->device.parent, cmd->sge_dma,
1938 sizeof(cmd->scatter_gather_element), 1928 sizeof(cmd->scatter_gather_element),
1939 DMA_BIDIRECTIONAL); 1929 DMA_BIDIRECTIONAL);
1940 sbp2util_mark_command_completed(lu, cmd); 1930 sbp2util_mark_command_completed(lu, cmd);
@@ -2021,9 +2011,10 @@ static int sbp2scsi_slave_configure(struct scsi_device *sdev)
2021{ 2011{
2022 struct sbp2_lu *lu = (struct sbp2_lu *)sdev->host->hostdata[0]; 2012 struct sbp2_lu *lu = (struct sbp2_lu *)sdev->host->hostdata[0];
2023 2013
2024 blk_queue_dma_alignment(sdev->request_queue, (512 - 1));
2025 sdev->use_10_for_rw = 1; 2014 sdev->use_10_for_rw = 1;
2026 2015
2016 if (sdev->type == TYPE_ROM)
2017 sdev->use_10_for_ms = 1;
2027 if (sdev->type == TYPE_DISK && 2018 if (sdev->type == TYPE_DISK &&
2028 lu->workarounds & SBP2_WORKAROUND_MODE_SENSE_8) 2019 lu->workarounds & SBP2_WORKAROUND_MODE_SENSE_8)
2029 sdev->skip_ms_page_8 = 1; 2020 sdev->skip_ms_page_8 = 1;
@@ -2059,11 +2050,12 @@ static int sbp2scsi_abort(struct scsi_cmnd *SCpnt)
2059 spin_lock_irqsave(&lu->cmd_orb_lock, flags); 2050 spin_lock_irqsave(&lu->cmd_orb_lock, flags);
2060 cmd = sbp2util_find_command_for_SCpnt(lu, SCpnt); 2051 cmd = sbp2util_find_command_for_SCpnt(lu, SCpnt);
2061 if (cmd) { 2052 if (cmd) {
2062 dma_sync_single_for_cpu(&hi->host->device, 2053 dma_sync_single_for_cpu(hi->host->device.parent,
2063 cmd->command_orb_dma, 2054 cmd->command_orb_dma,
2064 sizeof(struct sbp2_command_orb), 2055 sizeof(struct sbp2_command_orb),
2065 DMA_TO_DEVICE); 2056 DMA_TO_DEVICE);
2066 dma_sync_single_for_cpu(&hi->host->device, cmd->sge_dma, 2057 dma_sync_single_for_cpu(hi->host->device.parent,
2058 cmd->sge_dma,
2067 sizeof(cmd->scatter_gather_element), 2059 sizeof(cmd->scatter_gather_element),
2068 DMA_BIDIRECTIONAL); 2060 DMA_BIDIRECTIONAL);
2069 sbp2util_mark_command_completed(lu, cmd); 2061 sbp2util_mark_command_completed(lu, cmd);