Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=032af1ce16d496b825adde0fa03948785ee16830
Commit:     032af1ce16d496b825adde0fa03948785ee16830
Parent:     562aa1d4c6a874373f9a48ac184f662fbbb06a04
Author:     Alan <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 1 17:36:46 2007 +0000
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Fri Mar 2 17:42:48 2007 -0500

    libata-core: Fix simplex handling
    
    The initial simplex handling code is fooled if you suspend and resume.
    This also causes problems with some single channel controllers which
    claim to be simplex.
    
    The fix is fairly simple, instead of keeping a flag to remember if we
    gave away the simplex channel we remember the actual owner. As the owner
    is always part of the host_set we don't even need a refcount.
    
    Knowing the owner also means we can reassign simplex DMA channels in
    future hotplug code etc if we need to
    
    Signed-off-by: Alan Cox <[EMAIL PROTECTED]>
    (and a signed-off for the patch I sent before while I remember)
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/ata/libata-core.c |    5 ++---
 include/linux/libata.h    |    3 +--
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index ac3d120..eb59f16 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2556,12 +2556,11 @@ int ata_set_mode(struct ata_port *ap, struct ata_device 
**r_failed_dev)
         * host channels are not permitted to do so.
         */
        if (used_dma && (ap->host->flags & ATA_HOST_SIMPLEX))
-               ap->host->simplex_claimed = 1;
+               ap->host->simplex_claimed = ap;
 
        /* step5: chip specific finalisation */
        if (ap->ops->post_set_mode)
                ap->ops->post_set_mode(ap);
-
  out:
        if (rc)
                *r_failed_dev = dev;
@@ -3444,7 +3443,7 @@ static void ata_dev_xfermask(struct ata_device *dev)
                               "device is on DMA blacklist, disabling DMA\n");
        }
 
-       if ((host->flags & ATA_HOST_SIMPLEX) && host->simplex_claimed) {
+       if ((host->flags & ATA_HOST_SIMPLEX) && host->simplex_claimed != ap) {
                xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA);
                ata_dev_printk(dev, KERN_WARNING, "simplex DMA is claimed by "
                               "other device, disabling DMA\n");
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 045fb3a..3f89d13 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -403,8 +403,7 @@ struct ata_host {
        void                    *private_data;
        const struct ata_port_operations *ops;
        unsigned long           flags;
-       int                     simplex_claimed;        /* Keep seperate in 
case we
-                                                          ever need to do this 
locked */
+       struct ata_port         *simplex_claimed;       /* channel owning the 
DMA */
        struct ata_port         *ports[0];
 };
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to