Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 30271
b: refs/heads/master
c: 4fb0f76
h: refs/heads/master
i:
  30269: 0bcf0f6
  30267: dd9edc8
  30263: e179547
  30255: 0d8b704
  30239: 980766f
  30207: 589ad07
v: v3
  • Loading branch information
Alan Cox authored and Linus Torvalds committed Jun 26, 2006
1 parent 03c7200 commit 9144775
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 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: b5cdccf841d7d29fb96e03de5a64ed395e0fde61
refs/heads/master: 4fb0f76d8cf4f7a3ffc36dd5e1bc8ca977b68824
12 changes: 10 additions & 2 deletions trunk/drivers/ide/pci/piix.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ static void piix_tune_drive (ide_drive_t *drive, u8 pio)
unsigned long flags;
u16 master_data;
u8 slave_data;
static DEFINE_SPINLOCK(tune_lock);

/* ISP RTC */
u8 timings[][2] = { { 0, 0 },
{ 0, 0 },
Expand All @@ -230,7 +232,13 @@ static void piix_tune_drive (ide_drive_t *drive, u8 pio)
{ 2, 3 }, };

pio = ide_get_best_pio_mode(drive, pio, 5, NULL);
spin_lock_irqsave(&ide_lock, flags);

/*
* Master vs slave is synchronized above us but the slave register is
* shared by the two hwifs so the corner case of two slave timeouts in
* parallel must be locked.
*/
spin_lock_irqsave(&tune_lock, flags);
pci_read_config_word(dev, master_port, &master_data);
if (is_slave) {
master_data = master_data | 0x4000;
Expand All @@ -250,7 +258,7 @@ static void piix_tune_drive (ide_drive_t *drive, u8 pio)
pci_write_config_word(dev, master_port, master_data);
if (is_slave)
pci_write_config_byte(dev, slave_port, slave_data);
spin_unlock_irqrestore(&ide_lock, flags);
spin_unlock_irqrestore(&tune_lock, flags);
}

/**
Expand Down

0 comments on commit 9144775

Please sign in to comment.