diff options
Diffstat (limited to 'drivers/ata/pata_atiixp.c')
-rw-r--r-- | drivers/ata/pata_atiixp.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/ata/pata_atiixp.c b/drivers/ata/pata_atiixp.c index ae4454d4e955..cbaf2eddac6b 100644 --- a/drivers/ata/pata_atiixp.c +++ b/drivers/ata/pata_atiixp.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * pata_atiixp.c - ATI PATA for new ATA layer | 2 | * pata_atiixp.c - ATI PATA for new ATA layer |
3 | * (C) 2005 Red Hat Inc | 3 | * (C) 2005 Red Hat Inc |
4 | * (C) 2009 Bartlomiej Zolnierkiewicz | 4 | * (C) 2009-2010 Bartlomiej Zolnierkiewicz |
5 | * | 5 | * |
6 | * Based on | 6 | * Based on |
7 | * | 7 | * |
@@ -46,6 +46,8 @@ static int atiixp_cable_detect(struct ata_port *ap) | |||
46 | return ATA_CBL_PATA40; | 46 | return ATA_CBL_PATA40; |
47 | } | 47 | } |
48 | 48 | ||
49 | static DEFINE_SPINLOCK(atiixp_lock); | ||
50 | |||
49 | /** | 51 | /** |
50 | * atiixp_set_pio_timing - set initial PIO mode data | 52 | * atiixp_set_pio_timing - set initial PIO mode data |
51 | * @ap: ATA interface | 53 | * @ap: ATA interface |
@@ -88,7 +90,10 @@ static void atiixp_set_pio_timing(struct ata_port *ap, struct ata_device *adev, | |||
88 | 90 | ||
89 | static void atiixp_set_piomode(struct ata_port *ap, struct ata_device *adev) | 91 | static void atiixp_set_piomode(struct ata_port *ap, struct ata_device *adev) |
90 | { | 92 | { |
93 | unsigned long flags; | ||
94 | spin_lock_irqsave(&atiixp_lock, flags); | ||
91 | atiixp_set_pio_timing(ap, adev, adev->pio_mode - XFER_PIO_0); | 95 | atiixp_set_pio_timing(ap, adev, adev->pio_mode - XFER_PIO_0); |
96 | spin_unlock_irqrestore(&atiixp_lock, flags); | ||
92 | } | 97 | } |
93 | 98 | ||
94 | /** | 99 | /** |
@@ -108,6 +113,9 @@ static void atiixp_set_dmamode(struct ata_port *ap, struct ata_device *adev) | |||
108 | int dma = adev->dma_mode; | 113 | int dma = adev->dma_mode; |
109 | int dn = 2 * ap->port_no + adev->devno; | 114 | int dn = 2 * ap->port_no + adev->devno; |
110 | int wanted_pio; | 115 | int wanted_pio; |
116 | unsigned long flags; | ||
117 | |||
118 | spin_lock_irqsave(&atiixp_lock, flags); | ||
111 | 119 | ||
112 | if (adev->dma_mode >= XFER_UDMA_0) { | 120 | if (adev->dma_mode >= XFER_UDMA_0) { |
113 | u16 udma_mode_data; | 121 | u16 udma_mode_data; |
@@ -145,6 +153,7 @@ static void atiixp_set_dmamode(struct ata_port *ap, struct ata_device *adev) | |||
145 | 153 | ||
146 | if (adev->pio_mode != wanted_pio) | 154 | if (adev->pio_mode != wanted_pio) |
147 | atiixp_set_pio_timing(ap, adev, wanted_pio); | 155 | atiixp_set_pio_timing(ap, adev, wanted_pio); |
156 | spin_unlock_irqrestore(&atiixp_lock, flags); | ||
148 | } | 157 | } |
149 | 158 | ||
150 | /** | 159 | /** |
@@ -237,7 +246,8 @@ static int atiixp_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
237 | if (!pci_test_config_bits(pdev, &atiixp_enable_bits[i])) | 246 | if (!pci_test_config_bits(pdev, &atiixp_enable_bits[i])) |
238 | ppi[i] = &ata_dummy_port_info; | 247 | ppi[i] = &ata_dummy_port_info; |
239 | 248 | ||
240 | return ata_pci_sff_init_one(pdev, ppi, &atiixp_sht, NULL); | 249 | return ata_pci_sff_init_one(pdev, ppi, &atiixp_sht, NULL, |
250 | ATA_HOST_PARALLEL_SCAN); | ||
241 | } | 251 | } |
242 | 252 | ||
243 | static const struct pci_device_id atiixp[] = { | 253 | static const struct pci_device_id atiixp[] = { |