diff options
Diffstat (limited to 'drivers/pcmcia/cardbus.c')
-rw-r--r-- | drivers/pcmcia/cardbus.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c index 4cd70d056810..a73b040ddbfb 100644 --- a/drivers/pcmcia/cardbus.c +++ b/drivers/pcmcia/cardbus.c | |||
@@ -184,26 +184,33 @@ fail: | |||
184 | 184 | ||
185 | =====================================================================*/ | 185 | =====================================================================*/ |
186 | 186 | ||
187 | /* | 187 | static void cardbus_config_irq_and_cls(struct pci_bus *bus, int irq) |
188 | * Since there is only one interrupt available to CardBus | ||
189 | * devices, all devices downstream of this device must | ||
190 | * be using this IRQ. | ||
191 | */ | ||
192 | static void cardbus_assign_irqs(struct pci_bus *bus, int irq) | ||
193 | { | 188 | { |
194 | struct pci_dev *dev; | 189 | struct pci_dev *dev; |
195 | 190 | ||
196 | list_for_each_entry(dev, &bus->devices, bus_list) { | 191 | list_for_each_entry(dev, &bus->devices, bus_list) { |
197 | u8 irq_pin; | 192 | u8 irq_pin; |
198 | 193 | ||
194 | /* | ||
195 | * Since there is only one interrupt available to | ||
196 | * CardBus devices, all devices downstream of this | ||
197 | * device must be using this IRQ. | ||
198 | */ | ||
199 | pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &irq_pin); | 199 | pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &irq_pin); |
200 | if (irq_pin) { | 200 | if (irq_pin) { |
201 | dev->irq = irq; | 201 | dev->irq = irq; |
202 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq); | 202 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq); |
203 | } | 203 | } |
204 | 204 | ||
205 | /* | ||
206 | * Some controllers transfer very slowly with 0 CLS. | ||
207 | * Configure it. This may fail as CLS configuration | ||
208 | * is mandatory only for MWI. | ||
209 | */ | ||
210 | pci_set_cacheline_size(dev); | ||
211 | |||
205 | if (dev->subordinate) | 212 | if (dev->subordinate) |
206 | cardbus_assign_irqs(dev->subordinate, irq); | 213 | cardbus_config_irq_and_cls(dev->subordinate, irq); |
207 | } | 214 | } |
208 | } | 215 | } |
209 | 216 | ||
@@ -228,7 +235,7 @@ int __ref cb_alloc(struct pcmcia_socket * s) | |||
228 | */ | 235 | */ |
229 | pci_bus_size_bridges(bus); | 236 | pci_bus_size_bridges(bus); |
230 | pci_bus_assign_resources(bus); | 237 | pci_bus_assign_resources(bus); |
231 | cardbus_assign_irqs(bus, s->pci_irq); | 238 | cardbus_config_irq_and_cls(bus, s->pci_irq); |
232 | 239 | ||
233 | /* socket specific tune function */ | 240 | /* socket specific tune function */ |
234 | if (s->tune_bridge) | 241 | if (s->tune_bridge) |