aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/firewire')
-rw-r--r--drivers/firewire/fw-iso.c2
-rw-r--r--drivers/firewire/fw-ohci.c2
-rw-r--r--drivers/firewire/fw-sbp2.c33
3 files changed, 29 insertions, 8 deletions
diff --git a/drivers/firewire/fw-iso.c b/drivers/firewire/fw-iso.c
index bcbe794a3ea5..e14c03dc0065 100644
--- a/drivers/firewire/fw-iso.c
+++ b/drivers/firewire/fw-iso.c
@@ -50,7 +50,7 @@ fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card,
50 50
51 address = dma_map_page(card->device, buffer->pages[i], 51 address = dma_map_page(card->device, buffer->pages[i],
52 0, PAGE_SIZE, direction); 52 0, PAGE_SIZE, direction);
53 if (dma_mapping_error(address)) { 53 if (dma_mapping_error(card->device, address)) {
54 __free_page(buffer->pages[i]); 54 __free_page(buffer->pages[i]);
55 goto out_pages; 55 goto out_pages;
56 } 56 }
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index a4eff32621b5..251416f2148f 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -954,7 +954,7 @@ at_context_queue_packet(struct context *ctx, struct fw_packet *packet)
954 payload_bus = 954 payload_bus =
955 dma_map_single(ohci->card.device, packet->payload, 955 dma_map_single(ohci->card.device, packet->payload,
956 packet->payload_length, DMA_TO_DEVICE); 956 packet->payload_length, DMA_TO_DEVICE);
957 if (dma_mapping_error(payload_bus)) { 957 if (dma_mapping_error(ohci->card.device, payload_bus)) {
958 packet->ack = RCODE_SEND_ERROR; 958 packet->ack = RCODE_SEND_ERROR;
959 return -1; 959 return -1;
960 } 960 }
diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index 227d2e036cd8..aaff50ebba1d 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -86,6 +86,11 @@ MODULE_PARM_DESC(exclusive_login, "Exclusive login to sbp2 device "
86 * - delay inquiry 86 * - delay inquiry
87 * Wait extra SBP2_INQUIRY_DELAY seconds after login before SCSI inquiry. 87 * Wait extra SBP2_INQUIRY_DELAY seconds after login before SCSI inquiry.
88 * 88 *
89 * - power condition
90 * Set the power condition field in the START STOP UNIT commands sent by
91 * sd_mod on suspend, resume, and shutdown (if manage_start_stop is on).
92 * Some disks need this to spin down or to resume properly.
93 *
89 * - override internal blacklist 94 * - override internal blacklist
90 * Instead of adding to the built-in blacklist, use only the workarounds 95 * Instead of adding to the built-in blacklist, use only the workarounds
91 * specified in the module load parameter. 96 * specified in the module load parameter.
@@ -97,6 +102,7 @@ MODULE_PARM_DESC(exclusive_login, "Exclusive login to sbp2 device "
97#define SBP2_WORKAROUND_FIX_CAPACITY 0x8 102#define SBP2_WORKAROUND_FIX_CAPACITY 0x8
98#define SBP2_WORKAROUND_DELAY_INQUIRY 0x10 103#define SBP2_WORKAROUND_DELAY_INQUIRY 0x10
99#define SBP2_INQUIRY_DELAY 12 104#define SBP2_INQUIRY_DELAY 12
105#define SBP2_WORKAROUND_POWER_CONDITION 0x20
100#define SBP2_WORKAROUND_OVERRIDE 0x100 106#define SBP2_WORKAROUND_OVERRIDE 0x100
101 107
102static int sbp2_param_workarounds; 108static int sbp2_param_workarounds;
@@ -107,6 +113,8 @@ MODULE_PARM_DESC(workarounds, "Work around device bugs (default = 0"
107 ", skip mode page 8 = " __stringify(SBP2_WORKAROUND_MODE_SENSE_8) 113 ", skip mode page 8 = " __stringify(SBP2_WORKAROUND_MODE_SENSE_8)
108 ", fix capacity = " __stringify(SBP2_WORKAROUND_FIX_CAPACITY) 114 ", fix capacity = " __stringify(SBP2_WORKAROUND_FIX_CAPACITY)
109 ", delay inquiry = " __stringify(SBP2_WORKAROUND_DELAY_INQUIRY) 115 ", delay inquiry = " __stringify(SBP2_WORKAROUND_DELAY_INQUIRY)
116 ", set power condition in start stop unit = "
117 __stringify(SBP2_WORKAROUND_POWER_CONDITION)
110 ", override internal blacklist = " __stringify(SBP2_WORKAROUND_OVERRIDE) 118 ", override internal blacklist = " __stringify(SBP2_WORKAROUND_OVERRIDE)
111 ", or a combination)"); 119 ", or a combination)");
112 120
@@ -310,18 +318,25 @@ static const struct {
310 .firmware_revision = 0x002800, 318 .firmware_revision = 0x002800,
311 .model = 0x001010, 319 .model = 0x001010,
312 .workarounds = SBP2_WORKAROUND_INQUIRY_36 | 320 .workarounds = SBP2_WORKAROUND_INQUIRY_36 |
313 SBP2_WORKAROUND_MODE_SENSE_8, 321 SBP2_WORKAROUND_MODE_SENSE_8 |
322 SBP2_WORKAROUND_POWER_CONDITION,
314 }, 323 },
315 /* DViCO Momobay FX-3A with TSB42AA9A bridge */ { 324 /* DViCO Momobay FX-3A with TSB42AA9A bridge */ {
316 .firmware_revision = 0x002800, 325 .firmware_revision = 0x002800,
317 .model = 0x000000, 326 .model = 0x000000,
318 .workarounds = SBP2_WORKAROUND_DELAY_INQUIRY, 327 .workarounds = SBP2_WORKAROUND_DELAY_INQUIRY |
328 SBP2_WORKAROUND_POWER_CONDITION,
319 }, 329 },
320 /* Initio bridges, actually only needed for some older ones */ { 330 /* Initio bridges, actually only needed for some older ones */ {
321 .firmware_revision = 0x000200, 331 .firmware_revision = 0x000200,
322 .model = ~0, 332 .model = ~0,
323 .workarounds = SBP2_WORKAROUND_INQUIRY_36, 333 .workarounds = SBP2_WORKAROUND_INQUIRY_36,
324 }, 334 },
335 /* PL-3507 bridge with Prolific firmware */ {
336 .firmware_revision = 0x012800,
337 .model = ~0,
338 .workarounds = SBP2_WORKAROUND_POWER_CONDITION,
339 },
325 /* Symbios bridge */ { 340 /* Symbios bridge */ {
326 .firmware_revision = 0xa0b800, 341 .firmware_revision = 0xa0b800,
327 .model = ~0, 342 .model = ~0,
@@ -528,7 +543,7 @@ sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id,
528 orb->response_bus = 543 orb->response_bus =
529 dma_map_single(device->card->device, &orb->response, 544 dma_map_single(device->card->device, &orb->response,
530 sizeof(orb->response), DMA_FROM_DEVICE); 545 sizeof(orb->response), DMA_FROM_DEVICE);
531 if (dma_mapping_error(orb->response_bus)) 546 if (dma_mapping_error(device->card->device, orb->response_bus))
532 goto fail_mapping_response; 547 goto fail_mapping_response;
533 548
534 orb->request.response.high = 0; 549 orb->request.response.high = 0;
@@ -562,7 +577,7 @@ sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id,
562 orb->base.request_bus = 577 orb->base.request_bus =
563 dma_map_single(device->card->device, &orb->request, 578 dma_map_single(device->card->device, &orb->request,
564 sizeof(orb->request), DMA_TO_DEVICE); 579 sizeof(orb->request), DMA_TO_DEVICE);
565 if (dma_mapping_error(orb->base.request_bus)) 580 if (dma_mapping_error(device->card->device, orb->base.request_bus))
566 goto fail_mapping_request; 581 goto fail_mapping_request;
567 582
568 sbp2_send_orb(&orb->base, lu, node_id, generation, 583 sbp2_send_orb(&orb->base, lu, node_id, generation,
@@ -1409,7 +1424,7 @@ sbp2_map_scatterlist(struct sbp2_command_orb *orb, struct fw_device *device,
1409 orb->page_table_bus = 1424 orb->page_table_bus =
1410 dma_map_single(device->card->device, orb->page_table, 1425 dma_map_single(device->card->device, orb->page_table,
1411 sizeof(orb->page_table), DMA_TO_DEVICE); 1426 sizeof(orb->page_table), DMA_TO_DEVICE);
1412 if (dma_mapping_error(orb->page_table_bus)) 1427 if (dma_mapping_error(device->card->device, orb->page_table_bus))
1413 goto fail_page_table; 1428 goto fail_page_table;
1414 1429
1415 /* 1430 /*
@@ -1494,7 +1509,7 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)
1494 orb->base.request_bus = 1509 orb->base.request_bus =
1495 dma_map_single(device->card->device, &orb->request, 1510 dma_map_single(device->card->device, &orb->request,
1496 sizeof(orb->request), DMA_TO_DEVICE); 1511 sizeof(orb->request), DMA_TO_DEVICE);
1497 if (dma_mapping_error(orb->base.request_bus)) 1512 if (dma_mapping_error(device->card->device, orb->base.request_bus))
1498 goto out; 1513 goto out;
1499 1514
1500 sbp2_send_orb(&orb->base, lu, lu->tgt->node_id, lu->generation, 1515 sbp2_send_orb(&orb->base, lu, lu->tgt->node_id, lu->generation,
@@ -1530,6 +1545,9 @@ static int sbp2_scsi_slave_configure(struct scsi_device *sdev)
1530 1545
1531 sdev->use_10_for_rw = 1; 1546 sdev->use_10_for_rw = 1;
1532 1547
1548 if (sbp2_param_exclusive_login)
1549 sdev->manage_start_stop = 1;
1550
1533 if (sdev->type == TYPE_ROM) 1551 if (sdev->type == TYPE_ROM)
1534 sdev->use_10_for_ms = 1; 1552 sdev->use_10_for_ms = 1;
1535 1553
@@ -1540,6 +1558,9 @@ static int sbp2_scsi_slave_configure(struct scsi_device *sdev)
1540 if (lu->tgt->workarounds & SBP2_WORKAROUND_FIX_CAPACITY) 1558 if (lu->tgt->workarounds & SBP2_WORKAROUND_FIX_CAPACITY)
1541 sdev->fix_capacity = 1; 1559 sdev->fix_capacity = 1;
1542 1560
1561 if (lu->tgt->workarounds & SBP2_WORKAROUND_POWER_CONDITION)
1562 sdev->start_stop_pwr_cond = 1;
1563
1543 if (lu->tgt->workarounds & SBP2_WORKAROUND_128K_MAX_TRANS) 1564 if (lu->tgt->workarounds & SBP2_WORKAROUND_128K_MAX_TRANS)
1544 blk_queue_max_sectors(sdev->request_queue, 128 * 1024 / 512); 1565 blk_queue_max_sectors(sdev->request_queue, 128 * 1024 / 512);
1545 1566