Subject: Re: [PATCH]: [MPC5200] (v2) Add ATA DMA support

From: Grant Likely <[email-masked]>
Date: Thu, 3 Jul 2008 21:26:01 -0600

On Thu, Jul 03, 2008 at 04:35:27PM +0100, Tim Yamin wrote:
> There's also what I believe to be a hardware bug if you have high levels
> of BestComm ATA DMA activity along with heavy LocalPlus Bus activity;
> the address bus seems to sometimes get corrupted with ATA commands while
> the LocalPlus Bus operation is still active (i.e. Chip Select is asserted).
> 
> I've asked Freescale about this but have not received a reply yet -- if
> anybody from Freescale has any ideas please contact me; I can supply some
> analyzer traces if needed. Therefore, for now, do not enable DMA if you
> need reliable LocalPlus Bus unless you do a fixup in your driver as
> follows:
> 
> Locking example:
> 
>         while (test_and_set_bit(0, &pata_mpc52xx_ata_dma_lock) != 0)
>         {
>                 struct bcom_task_2 *tsk = pata_mpc52xx_ata_dma_task;
> 
>                 if(bcom_buffer_done_2(tsk))
>                         return 1;
>         }
> 
> 	return 0;
> 
> (Save the return value to `flags`)
> 
> Unlocking example:
> 
>         if(flags == 0)
>                 clear_bit(0, &pata_mpc52xx_ata_dma_lock);
> 

One more thing.  For this description to be of any use, it needs to be
documented where somebody will actually see it.  The commit message is
great for describing *why* a change is needed, but it's not seen
so much after the change is merged.

This description should probably be added to the header comment block of
the ATA driver, and it should be talked about in the Kconfig help text
too.

g.