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

Tim Yamin plasm at roo.me.uk
Fri Jul 4 01:35:27 EST 2008


On Wed, Jul 2, 2008 at 6:30 PM, Grant Likely <grant.likely at secretlab.ca> wrote:
> I know that only ATA uses this; but it is nice to have fixes to things
> that are obviously wrong in existing code to be split into their own
> patches.  That way, even if the ATA patch gets backed out, the bug fix
> will remain.

Ok, so I've split the patch up into two pieces now...

>> +static void
>> +mpc52xx_bmdma_start(struct ata_queued_cmd *qc)
>> +{
>> +     struct ata_port *ap = qc->ap;
>> +     struct mpc52xx_ata_priv *priv = ap->host->private_data;
>> +
>> +     /* LocalBus lock */
>> +     while (test_and_set_bit(0, &pata_mpc52xx_ata_dma_lock) != 0)
>> +             ;
>
> Need to be able to bail on timeout.

A deadlock can't occur within the PATA driver because you won't have
two DMA requests happening at once, so there is no point in adding a
timeout. And even if you do have a timeout, you'd have to drop the I/O
request somehow, so it's not really a good idea. If anything else
needs to touch the DMA lock, it should do so in a sensible fashion...

Thanks,

Tim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bestcomm-ata-fixes.patch
Type: text/x-patch
Size: 4211 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20080703/f5da4dea/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pata_mpc52xx-add-dma.patch
Type: text/x-patch
Size: 19523 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20080703/f5da4dea/attachment-0001.bin>


More information about the Linuxppc-dev mailing list