* [PATCH] pata_ali: Lots of problems still showing up with small ATAPI DMA
@ 2007-11-19 14:37 Alan Cox
2007-11-24 0:36 ` Jeff Garzik
2007-11-28 1:36 ` Tejun Heo
0 siblings, 2 replies; 6+ messages in thread
From: Alan Cox @ 2007-11-19 14:37 UTC (permalink / raw)
To: jeff, akpm, linux-ide
Hopefully there is a better long term solution but for now lets favour
reliability.
Signed-off-by: Alan Cox <alan@redhat.com>
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.24-rc2-mm1/drivers/ata/pata_ali.c linux-2.6.24-rc2-mm1/drivers/ata/pata_ali.c
--- linux.vanilla-2.6.24-rc2-mm1/drivers/ata/pata_ali.c 2007-11-16 17:55:11.000000000 +0000
+++ linux-2.6.24-rc2-mm1/drivers/ata/pata_ali.c 2007-11-16 18:12:21.000000000 +0000
@@ -282,6 +285,21 @@
adev->max_sectors = 255;
}
+/**
+ * ali_check_atapi_dma - DMA check for most ALi controllers
+ * @adev: Device
+ *
+ * Called to decide whether commands should be sent by DMA or PIO
+ */
+
+static int ali_check_atapi_dma(struct ata_queued_cmd *qc)
+{
+ /* If its not a media command, its not worth it */
+ if (qc->nbytes < 2048)
+ return -EOPNOTSUPP;
+ return 0;
+}
+
static struct scsi_host_template ali_sht = {
.module = THIS_MODULE,
.name = DRV_NAME,
@@ -378,6 +396,7 @@
.mode_filter = ata_pci_default_filter,
.tf_load = ata_tf_load,
.tf_read = ata_tf_read,
+ .check_atapi_dma = ali_check_atapi_dma,
.check_status = ata_check_status,
.exec_command = ata_exec_command,
.dev_select = ata_std_dev_select,
@@ -415,6 +434,7 @@
.mode_filter = ata_pci_default_filter,
.tf_load = ata_tf_load,
.tf_read = ata_tf_read,
+ .check_atapi_dma = ali_check_atapi_dma,
.check_status = ata_check_status,
.exec_command = ata_exec_command,
.dev_select = ata_std_dev_select,
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] pata_ali: Lots of problems still showing up with small ATAPI DMA
2007-11-19 14:37 [PATCH] pata_ali: Lots of problems still showing up with small ATAPI DMA Alan Cox
@ 2007-11-24 0:36 ` Jeff Garzik
2007-11-28 1:36 ` Tejun Heo
1 sibling, 0 replies; 6+ messages in thread
From: Jeff Garzik @ 2007-11-24 0:36 UTC (permalink / raw)
To: Alan Cox; +Cc: akpm, linux-ide
Alan Cox wrote:
> Hopefully there is a better long term solution but for now lets favour
> reliability.
>
> Signed-off-by: Alan Cox <alan@redhat.com>
applied #upstream-fixes
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] pata_ali: Lots of problems still showing up with small ATAPI DMA
2007-11-19 14:37 [PATCH] pata_ali: Lots of problems still showing up with small ATAPI DMA Alan Cox
2007-11-24 0:36 ` Jeff Garzik
@ 2007-11-28 1:36 ` Tejun Heo
2007-11-28 9:25 ` Alan Cox
1 sibling, 1 reply; 6+ messages in thread
From: Tejun Heo @ 2007-11-28 1:36 UTC (permalink / raw)
To: Alan Cox; +Cc: jeff, akpm, linux-ide
Alan Cox wrote:
> Hopefully there is a better long term solution but for now lets favour
> reliability.
I'm getting a lot of reports on pata_ali w/ misc ATAPI commands too. Do
you know whether it's a controller problem or drive one? All the
reports I got are laptops and I can't really ask them to disassemble
their laptops. :-)
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] pata_ali: Lots of problems still showing up with small ATAPI DMA
2007-11-28 1:36 ` Tejun Heo
@ 2007-11-28 9:25 ` Alan Cox
2007-11-28 11:26 ` Tejun Heo
0 siblings, 1 reply; 6+ messages in thread
From: Alan Cox @ 2007-11-28 9:25 UTC (permalink / raw)
To: Tejun Heo; +Cc: jeff, akpm, linux-ide
On Wed, 28 Nov 2007 10:36:15 +0900
Tejun Heo <htejun@gmail.com> wrote:
> Alan Cox wrote:
> > Hopefully there is a better long term solution but for now lets favour
> > reliability.
>
> I'm getting a lot of reports on pata_ali w/ misc ATAPI commands too. Do
> you know whether it's a controller problem or drive one? All the
> reports I got are laptops and I can't really ask them to disassemble
> their laptops. :-)
ALi is one that most definitely appears to be controller related. Thats
why I sent Jeff a patch to use DMA for 2K+ transfers only. Some ALi also
required the patch to set the xfer lengths.
Its only some revs/combinations annoyingly - a lot of them (including the
ones I have direct access too) just work.
Alan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] pata_ali: Lots of problems still showing up with small ATAPI DMA
2007-11-28 9:25 ` Alan Cox
@ 2007-11-28 11:26 ` Tejun Heo
2007-11-28 13:05 ` Alan Cox
0 siblings, 1 reply; 6+ messages in thread
From: Tejun Heo @ 2007-11-28 11:26 UTC (permalink / raw)
To: Alan Cox; +Cc: jeff, akpm, linux-ide
Alan Cox wrote:
> On Wed, 28 Nov 2007 10:36:15 +0900
> Tejun Heo <htejun@gmail.com> wrote:
>
>> Alan Cox wrote:
>>> Hopefully there is a better long term solution but for now lets favour
>>> reliability.
>> I'm getting a lot of reports on pata_ali w/ misc ATAPI commands too. Do
>> you know whether it's a controller problem or drive one? All the
>> reports I got are laptops and I can't really ask them to disassemble
>> their laptops. :-)
>
> ALi is one that most definitely appears to be controller related. Thats
> why I sent Jeff a patch to use DMA for 2K+ transfers only. Some ALi also
> required the patch to set the xfer lengths.
>
> Its only some revs/combinations annoyingly - a lot of them (including the
> ones I have direct access too) just work.
Does READ_CD work fine via DMA? 2K+ filtering filters most if not all
misc commands so usually only sector (2K) aligned READ and WRITEs are
done via DMA. Interesting exceptions are READ_CD[_MSF] and
READ/WRITE_BUFFER which usually exceed 2K but aren't aligned to 2K. I
guess it's about time to write a test case program which issues a bunch
of problematic commands and see which works.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] pata_ali: Lots of problems still showing up with small ATAPI DMA
2007-11-28 11:26 ` Tejun Heo
@ 2007-11-28 13:05 ` Alan Cox
0 siblings, 0 replies; 6+ messages in thread
From: Alan Cox @ 2007-11-28 13:05 UTC (permalink / raw)
To: Tejun Heo; +Cc: jeff, akpm, linux-ide
O> Does READ_CD work fine via DMA? 2K+ filtering filters most if not all
> misc commands so usually only sector (2K) aligned READ and WRITEs are
> done via DMA. Interesting exceptions are READ_CD[_MSF] and
> READ/WRITE_BUFFER which usually exceed 2K but aren't aligned to 2K. I
> guess it's about time to write a test case program which issues a bunch
> of problematic commands and see which works.
I'm not 100% sure but the reports for both IT821x and ALi with that are
that it does and the IT821x case I'm pretty certain of.
Getting a tester to move a CD drive between the ALi and a PIIX
controller shows the behaviour is controller specific
Alan
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-11-28 13:09 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-19 14:37 [PATCH] pata_ali: Lots of problems still showing up with small ATAPI DMA Alan Cox
2007-11-24 0:36 ` Jeff Garzik
2007-11-28 1:36 ` Tejun Heo
2007-11-28 9:25 ` Alan Cox
2007-11-28 11:26 ` Tejun Heo
2007-11-28 13:05 ` Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).