aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/parisc/kernel/pci.c')
-rw-r--r--arch/parisc/kernel/pci.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c
index 507d0ac99f66..6936386c9861 100644
--- a/arch/parisc/kernel/pci.c
+++ b/arch/parisc/kernel/pci.c
@@ -287,23 +287,15 @@ void pcibios_align_resource(void *data, struct resource *res,
287 */ 287 */
288int pcibios_enable_device(struct pci_dev *dev, int mask) 288int pcibios_enable_device(struct pci_dev *dev, int mask)
289{ 289{
290 u16 cmd; 290 int err;
291 int idx; 291 u16 cmd, old_cmd;
292 292
293 pci_read_config_word(dev, PCI_COMMAND, &cmd); 293 err = pci_enable_resources(dev, mask);
294 294 if (err < 0)
295 for (idx = 0; idx < DEVICE_COUNT_RESOURCE; idx++) { 295 return err;
296 struct resource *r = &dev->resource[idx];
297 296
298 /* only setup requested resources */ 297 pci_read_config_word(dev, PCI_COMMAND, &cmd);
299 if (!(mask & (1<<idx))) 298 old_cmd = cmd;
300 continue;
301
302 if (r->flags & IORESOURCE_IO)
303 cmd |= PCI_COMMAND_IO;
304 if (r->flags & IORESOURCE_MEM)
305 cmd |= PCI_COMMAND_MEMORY;
306 }
307 299
308 cmd |= (PCI_COMMAND_SERR | PCI_COMMAND_PARITY); 300 cmd |= (PCI_COMMAND_SERR | PCI_COMMAND_PARITY);
309 301
@@ -312,8 +304,12 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
312 if (dev->bus->bridge_ctl & PCI_BRIDGE_CTL_FAST_BACK) 304 if (dev->bus->bridge_ctl & PCI_BRIDGE_CTL_FAST_BACK)
313 cmd |= PCI_COMMAND_FAST_BACK; 305 cmd |= PCI_COMMAND_FAST_BACK;
314#endif 306#endif
315 DBGC("PCIBIOS: Enabling device %s cmd 0x%04x\n", pci_name(dev), cmd); 307
316 pci_write_config_word(dev, PCI_COMMAND, cmd); 308 if (cmd != old_cmd) {
309 dev_info(&dev->dev, "enabling SERR and PARITY (%04x -> %04x)\n",
310 old_cmd, cmd);
311 pci_write_config_word(dev, PCI_COMMAND, cmd);
312 }
317 return 0; 313 return 0;
318} 314}
319 315