mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 22:14:03 +02:00
Merge branch 'pci/controller/host-generic'
- Fix NULL pointer dereference that caused enumeration failures on 32-bit CAM systems (Steffen Persvold) * pci/controller/host-generic: PCI: host-generic: Fix NULL pointer dereference on 32-bit CAM systems
This commit is contained in:
commit
c4afb0b2d3
|
|
@ -16,15 +16,6 @@
|
|||
|
||||
#include "pci-host-common.h"
|
||||
|
||||
static const struct pci_ecam_ops gen_pci_cfg_cam_bus_ops = {
|
||||
.bus_shift = 16,
|
||||
.pci_ops = {
|
||||
.map_bus = pci_ecam_map_bus,
|
||||
.read = pci_generic_config_read,
|
||||
.write = pci_generic_config_write,
|
||||
}
|
||||
};
|
||||
|
||||
static bool pci_dw_valid_device(struct pci_bus *bus, unsigned int devfn)
|
||||
{
|
||||
struct pci_config_window *cfg = bus->sysdata;
|
||||
|
|
@ -60,7 +51,7 @@ static const struct pci_ecam_ops pci_dw_ecam_bus_ops = {
|
|||
|
||||
static const struct of_device_id gen_pci_of_match[] = {
|
||||
{ .compatible = "pci-host-cam-generic",
|
||||
.data = &gen_pci_cfg_cam_bus_ops },
|
||||
.data = &pci_generic_cam_ops },
|
||||
|
||||
{ .compatible = "pci-host-ecam-generic",
|
||||
.data = &pci_generic_ecam_ops },
|
||||
|
|
|
|||
|
|
@ -208,6 +208,19 @@ const struct pci_ecam_ops pci_generic_ecam_ops = {
|
|||
};
|
||||
EXPORT_SYMBOL_GPL(pci_generic_ecam_ops);
|
||||
|
||||
/* CAM ops */
|
||||
const struct pci_ecam_ops pci_generic_cam_ops = {
|
||||
.bus_shift = 16,
|
||||
.pci_ops = {
|
||||
.add_bus = pci_ecam_add_bus,
|
||||
.remove_bus = pci_ecam_remove_bus,
|
||||
.map_bus = pci_ecam_map_bus,
|
||||
.read = pci_generic_config_read,
|
||||
.write = pci_generic_config_write,
|
||||
}
|
||||
};
|
||||
EXPORT_SYMBOL_GPL(pci_generic_cam_ops);
|
||||
|
||||
#if defined(CONFIG_ACPI) && defined(CONFIG_PCI_QUIRKS)
|
||||
/* ECAM ops for 32-bit access only (non-compliant) */
|
||||
const struct pci_ecam_ops pci_32b_ops = {
|
||||
|
|
|
|||
|
|
@ -81,6 +81,9 @@ void __iomem *pci_ecam_map_bus(struct pci_bus *bus, unsigned int devfn,
|
|||
/* default ECAM ops */
|
||||
extern const struct pci_ecam_ops pci_generic_ecam_ops;
|
||||
|
||||
/* default CAM ops */
|
||||
extern const struct pci_ecam_ops pci_generic_cam_ops;
|
||||
|
||||
#if defined(CONFIG_ACPI) && defined(CONFIG_PCI_QUIRKS)
|
||||
extern const struct pci_ecam_ops pci_32b_ops; /* 32-bit accesses only */
|
||||
extern const struct pci_ecam_ops pci_32b_read_ops; /* 32-bit read only */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user