diff options
author | Helge Deller <deller@gmx.de> | 2015-12-21 04:00:49 -0500 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2016-01-12 16:03:21 -0500 |
commit | 602c9c9a01a4f0ef091295ac75c74c7fe94d69a4 (patch) | |
tree | 71e93e3b04ebda62349811202f0dff522a89bc71 | |
parent | afd2ff9b7e1b367172f18ba7f693dfb62bdcb2dc (diff) |
parisc: Initialize PCI bridge cache line and default latency
PCI controllers and pci-pci bridges may have not been fully initialized
regarding cache line and defaul latency.
This partly reverts
commit 5f0e9b4 ("parisc: Remove unused pcibios_init_bus()")
Signed-off-by: Helge Deller <deller@gmx.de>
-rw-r--r-- | arch/parisc/include/asm/pci.h | 1 | ||||
-rw-r--r-- | arch/parisc/kernel/pci.c | 26 | ||||
-rw-r--r-- | drivers/parisc/dino.c | 4 | ||||
-rw-r--r-- | drivers/parisc/lba_pci.c | 4 |
4 files changed, 33 insertions, 2 deletions
diff --git a/arch/parisc/include/asm/pci.h b/arch/parisc/include/asm/pci.h index 71889ea72740..89c53bfff055 100644 --- a/arch/parisc/include/asm/pci.h +++ b/arch/parisc/include/asm/pci.h | |||
@@ -167,6 +167,7 @@ static inline void pcibios_register_hba(struct pci_hba_data *x) | |||
167 | { | 167 | { |
168 | } | 168 | } |
169 | #endif | 169 | #endif |
170 | extern void pcibios_init_bridge(struct pci_dev *); | ||
170 | 171 | ||
171 | /* | 172 | /* |
172 | * pcibios_assign_all_busses() is used in drivers/pci/pci.c:pci_do_scan_bus() | 173 | * pcibios_assign_all_busses() is used in drivers/pci/pci.c:pci_do_scan_bus() |
diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c index c99f3dde455c..0903c6abd7a4 100644 --- a/arch/parisc/kernel/pci.c +++ b/arch/parisc/kernel/pci.c | |||
@@ -170,6 +170,32 @@ void pcibios_set_master(struct pci_dev *dev) | |||
170 | (0x80 << 8) | pci_cache_line_size); | 170 | (0x80 << 8) | pci_cache_line_size); |
171 | } | 171 | } |
172 | 172 | ||
173 | /* | ||
174 | * pcibios_init_bridge() initializes cache line and default latency | ||
175 | * for pci controllers and pci-pci bridges | ||
176 | */ | ||
177 | void __init pcibios_init_bridge(struct pci_dev *dev) | ||
178 | { | ||
179 | unsigned short bridge_ctl, bridge_ctl_new; | ||
180 | |||
181 | /* We deal only with pci controllers and pci-pci bridges. */ | ||
182 | if (!dev || (dev->class >> 8) != PCI_CLASS_BRIDGE_PCI) | ||
183 | return; | ||
184 | |||
185 | /* PCI-PCI bridge - set the cache line and default latency | ||
186 | * (32) for primary and secondary buses. | ||
187 | */ | ||
188 | pci_write_config_byte(dev, PCI_SEC_LATENCY_TIMER, 32); | ||
189 | |||
190 | pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &bridge_ctl); | ||
191 | |||
192 | bridge_ctl_new = bridge_ctl | PCI_BRIDGE_CTL_PARITY | | ||
193 | PCI_BRIDGE_CTL_SERR | PCI_BRIDGE_CTL_MASTER_ABORT; | ||
194 | dev_info(&dev->dev, "Changing bridge control from 0x%08x to 0x%08x\n", | ||
195 | bridge_ctl, bridge_ctl_new); | ||
196 | |||
197 | pci_write_config_word(dev, PCI_BRIDGE_CONTROL, bridge_ctl_new); | ||
198 | } | ||
173 | 199 | ||
174 | /* | 200 | /* |
175 | * pcibios align resources() is called every time generic PCI code | 201 | * pcibios align resources() is called every time generic PCI code |
diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c index a0580afe1713..1133b5cc88ca 100644 --- a/drivers/parisc/dino.c +++ b/drivers/parisc/dino.c | |||
@@ -599,8 +599,10 @@ dino_fixup_bus(struct pci_bus *bus) | |||
599 | ** P2PB's only have 2 BARs, no IRQs. | 599 | ** P2PB's only have 2 BARs, no IRQs. |
600 | ** I'd like to just ignore them for now. | 600 | ** I'd like to just ignore them for now. |
601 | */ | 601 | */ |
602 | if ((dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) | 602 | if ((dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) { |
603 | pcibios_init_bridge(dev); | ||
603 | continue; | 604 | continue; |
605 | } | ||
604 | 606 | ||
605 | /* null out the ROM resource if there is one (we don't | 607 | /* null out the ROM resource if there is one (we don't |
606 | * care about an expansion rom on parisc, since it | 608 | * care about an expansion rom on parisc, since it |
diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c index 42844c2bc065..2ec2aef4d211 100644 --- a/drivers/parisc/lba_pci.c +++ b/drivers/parisc/lba_pci.c | |||
@@ -790,8 +790,10 @@ lba_fixup_bus(struct pci_bus *bus) | |||
790 | /* | 790 | /* |
791 | ** P2PB's have no IRQs. ignore them. | 791 | ** P2PB's have no IRQs. ignore them. |
792 | */ | 792 | */ |
793 | if ((dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) | 793 | if ((dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) { |
794 | pcibios_init_bridge(dev); | ||
794 | continue; | 795 | continue; |
796 | } | ||
795 | 797 | ||
796 | /* Adjust INTERRUPT_LINE for this dev */ | 798 | /* Adjust INTERRUPT_LINE for this dev */ |
797 | iosapic_fixup_irq(ldev->iosapic_obj, dev); | 799 | iosapic_fixup_irq(ldev->iosapic_obj, dev); |