Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 183180
b: refs/heads/master
c: e99846f
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz authored and Jeff Garzik committed Mar 1, 2010
1 parent 1a771b2 commit 64c95ac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 303f1a76ae792885af8a4a0e784e22e31e850e9a
refs/heads/master: e99846f18f03badd1bbd4fda79e6ec325e3b9058
11 changes: 10 additions & 1 deletion trunk/drivers/ata/pata_atiixp.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* pata_atiixp.c - ATI PATA for new ATA layer
* (C) 2005 Red Hat Inc
* (C) 2009 Bartlomiej Zolnierkiewicz
* (C) 2009-2010 Bartlomiej Zolnierkiewicz
*
* Based on
*
Expand Down Expand Up @@ -46,6 +46,8 @@ static int atiixp_cable_detect(struct ata_port *ap)
return ATA_CBL_PATA40;
}

static DEFINE_SPINLOCK(atiixp_lock);

/**
* atiixp_set_pio_timing - set initial PIO mode data
* @ap: ATA interface
Expand Down Expand Up @@ -88,7 +90,10 @@ static void atiixp_set_pio_timing(struct ata_port *ap, struct ata_device *adev,

static void atiixp_set_piomode(struct ata_port *ap, struct ata_device *adev)
{
unsigned long flags;
spin_lock_irqsave(&atiixp_lock, flags);
atiixp_set_pio_timing(ap, adev, adev->pio_mode - XFER_PIO_0);
spin_unlock_irqrestore(&atiixp_lock, flags);
}

/**
Expand All @@ -108,6 +113,9 @@ static void atiixp_set_dmamode(struct ata_port *ap, struct ata_device *adev)
int dma = adev->dma_mode;
int dn = 2 * ap->port_no + adev->devno;
int wanted_pio;
unsigned long flags;

spin_lock_irqsave(&atiixp_lock, flags);

if (adev->dma_mode >= XFER_UDMA_0) {
u16 udma_mode_data;
Expand Down Expand Up @@ -145,6 +153,7 @@ static void atiixp_set_dmamode(struct ata_port *ap, struct ata_device *adev)

if (adev->pio_mode != wanted_pio)
atiixp_set_pio_timing(ap, adev, wanted_pio);
spin_unlock_irqrestore(&atiixp_lock, flags);
}

/**
Expand Down

0 comments on commit 64c95ac

Please sign in to comment.