From fae009847c9ea3d668bbee21ce1d76764eca5039 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Sun, 7 Aug 2005 14:53:40 +0900 Subject: [PATCH] sata: fix sata_sx4 dma_prep to not use sg->length sata_sx4 directly references sg->length to calculate total_len in pdc20621_dma_prep(). This is incorrect as dma_map_sg() could have merged multiple sg's into one and, in such case, sg->length doesn't reflect true size of the entry. This patch makes it use sg_dma_len(sg). Signed-off-by: Tejun Heo Signed-off-by: Jeff Garzik --- drivers/scsi/sata_sx4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/scsi') diff --git a/drivers/scsi/sata_sx4.c b/drivers/scsi/sata_sx4.c index 140cea05de3..efd7d7a6113 100644 --- a/drivers/scsi/sata_sx4.c +++ b/drivers/scsi/sata_sx4.c @@ -468,7 +468,7 @@ static void pdc20621_dma_prep(struct ata_queued_cmd *qc) for (i = 0; i < last; i++) { buf[idx++] = cpu_to_le32(sg_dma_address(&sg[i])); buf[idx++] = cpu_to_le32(sg_dma_len(&sg[i])); - total_len += sg[i].length; + total_len += sg_dma_len(&sg[i]); } buf[idx - 1] |= cpu_to_le32(ATA_PRD_EOT); sgt_len = idx * 4; -- cgit v1.2.3 From 42517438f9c1011a03e49a542cba32ac5a80dd8e Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Wed, 10 Aug 2005 13:38:27 -0400 Subject: libata: fix EH-related lockup by properly cleaning EH command list Yet another hack due to the fact that libata is the only user of SCSI's ->eh_strategy_handler() hook. --- drivers/scsi/libata-scsi.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/scsi') diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c index 794fb559efb..6a75ec2187f 100644 --- a/drivers/scsi/libata-scsi.c +++ b/drivers/scsi/libata-scsi.c @@ -385,6 +385,7 @@ int ata_scsi_error(struct Scsi_Host *host) * appropriate place */ host->host_failed--; + INIT_LIST_HEAD(&host->eh_cmd_q); DPRINTK("EXIT\n"); return 0; -- cgit v1.2.3