firewire: fw-sbp2: relax SCSI DMA alignment
[cascardo/linux.git] / drivers / firewire / fw-sbp2.c
index 62b4e47..ea62e82 100644 (file)
@@ -796,7 +796,7 @@ static void sbp2_release_target(struct kref *kref)
        scsi_remove_host(shost);
        fw_notify("released %s\n", tgt->bus_id);
 
-       put_device(&tgt->unit->device);
+       fw_unit_put(tgt->unit);
        scsi_host_put(shost);
        fw_device_put(device);
 }
@@ -1119,6 +1119,7 @@ static int sbp2_probe(struct device *dev)
                goto fail_shost_put;
 
        fw_device_get(device);
+       fw_unit_get(unit);
 
        /* Initialize to values that won't match anything in our table. */
        firmware_revision = 0xff000000;
@@ -1134,8 +1135,6 @@ static int sbp2_probe(struct device *dev)
 
        sbp2_init_workarounds(tgt, model, firmware_revision);
 
-       get_device(&unit->device);
-
        /* Do the login in a workqueue so we can easily reschedule retries. */
        list_for_each_entry(lu, &tgt->lu_list, link)
                sbp2_queue_work(lu, 0);
@@ -1519,11 +1518,8 @@ static int sbp2_scsi_slave_alloc(struct scsi_device *sdev)
 
        sdev->allow_restart = 1;
 
-       /*
-        * Update the dma alignment (minimum alignment requirements for
-        * start and end of DMA transfers) to be a sector
-        */
-       blk_queue_update_dma_alignment(sdev->request_queue, 511);
+       /* SBP-2 requires quadlet alignment of the data buffers. */
+       blk_queue_update_dma_alignment(sdev->request_queue, 4 - 1);
 
        if (lu->tgt->workarounds & SBP2_WORKAROUND_INQUIRY_36)
                sdev->inquiry_len = 36;