diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2007-11-19 09:37:58 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-11-23 19:33:27 -0500 |
commit | 498222f323ab11331dc5cfedb97752477f0fe42a (patch) | |
tree | 3d6c2b59c807e06976cdbf9bafb9a8e489d0610f /drivers/ata/pata_ali.c | |
parent | 8f59a13accd78e9759548b40aa2a053938a01ec7 (diff) |
pata_ali: Lots of problems still showing up with small ATAPI DMA
Hopefully there is a better long term solution but for now lets favour
reliability.
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/pata_ali.c')
-rw-r--r-- | drivers/ata/pata_ali.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c index d12f386c1507..62aa2f90329a 100644 --- a/drivers/ata/pata_ali.c +++ b/drivers/ata/pata_ali.c | |||
@@ -285,6 +285,21 @@ static void ali_lock_sectors(struct ata_device *adev) | |||
285 | adev->max_sectors = 255; | 285 | adev->max_sectors = 255; |
286 | } | 286 | } |
287 | 287 | ||
288 | /** | ||
289 | * ali_check_atapi_dma - DMA check for most ALi controllers | ||
290 | * @adev: Device | ||
291 | * | ||
292 | * Called to decide whether commands should be sent by DMA or PIO | ||
293 | */ | ||
294 | |||
295 | static int ali_check_atapi_dma(struct ata_queued_cmd *qc) | ||
296 | { | ||
297 | /* If its not a media command, its not worth it */ | ||
298 | if (qc->nbytes < 2048) | ||
299 | return -EOPNOTSUPP; | ||
300 | return 0; | ||
301 | } | ||
302 | |||
288 | static struct scsi_host_template ali_sht = { | 303 | static struct scsi_host_template ali_sht = { |
289 | .module = THIS_MODULE, | 304 | .module = THIS_MODULE, |
290 | .name = DRV_NAME, | 305 | .name = DRV_NAME, |
@@ -381,6 +396,7 @@ static struct ata_port_operations ali_c2_port_ops = { | |||
381 | .mode_filter = ata_pci_default_filter, | 396 | .mode_filter = ata_pci_default_filter, |
382 | .tf_load = ata_tf_load, | 397 | .tf_load = ata_tf_load, |
383 | .tf_read = ata_tf_read, | 398 | .tf_read = ata_tf_read, |
399 | .check_atapi_dma = ali_check_atapi_dma, | ||
384 | .check_status = ata_check_status, | 400 | .check_status = ata_check_status, |
385 | .exec_command = ata_exec_command, | 401 | .exec_command = ata_exec_command, |
386 | .dev_select = ata_std_dev_select, | 402 | .dev_select = ata_std_dev_select, |
@@ -418,6 +434,7 @@ static struct ata_port_operations ali_c5_port_ops = { | |||
418 | .mode_filter = ata_pci_default_filter, | 434 | .mode_filter = ata_pci_default_filter, |
419 | .tf_load = ata_tf_load, | 435 | .tf_load = ata_tf_load, |
420 | .tf_read = ata_tf_read, | 436 | .tf_read = ata_tf_read, |
437 | .check_atapi_dma = ali_check_atapi_dma, | ||
421 | .check_status = ata_check_status, | 438 | .check_status = ata_check_status, |
422 | .exec_command = ata_exec_command, | 439 | .exec_command = ata_exec_command, |
423 | .dev_select = ata_std_dev_select, | 440 | .dev_select = ata_std_dev_select, |