Commit 6c108f12 authored by David S. Miller's avatar David S. Miller

[SPARC64]: Move index info pci_pbm_info.

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e9870c4c
...@@ -50,8 +50,8 @@ asmlinkage int sys_pciconfig_write(unsigned long bus, unsigned long dfn, ...@@ -50,8 +50,8 @@ asmlinkage int sys_pciconfig_write(unsigned long bus, unsigned long dfn,
/* List of all PCI controllers found in the system. */ /* List of all PCI controllers found in the system. */
struct pci_pbm_info *pci_pbm_root = NULL; struct pci_pbm_info *pci_pbm_root = NULL;
/* Each PCI controller found gets a unique index. */ /* Each PBM found gets a unique index. */
int pci_num_controllers = 0; int pci_num_pbms = 0;
volatile int pci_poke_in_progress; volatile int pci_poke_in_progress;
volatile int pci_poke_cpu = -1; volatile int pci_poke_cpu = -1;
...@@ -1077,11 +1077,7 @@ int pci_domain_nr(struct pci_bus *pbus) ...@@ -1077,11 +1077,7 @@ int pci_domain_nr(struct pci_bus *pbus)
if (pbm == NULL || pbm->parent == NULL) { if (pbm == NULL || pbm->parent == NULL) {
ret = -ENXIO; ret = -ENXIO;
} else { } else {
struct pci_controller_info *p = pbm->parent; ret = pbm->index;
ret = p->index;
ret = ((ret << 1) +
((pbm == &pbm->parent->pbm_B) ? 1 : 0));
} }
return ret; return ret;
......
...@@ -163,8 +163,7 @@ void pci_determine_mem_io_space(struct pci_pbm_info *pbm) ...@@ -163,8 +163,7 @@ void pci_determine_mem_io_space(struct pci_pbm_info *pbm)
} }
/* Generic helper routines for PCI error reporting. */ /* Generic helper routines for PCI error reporting. */
void pci_scan_for_target_abort(struct pci_controller_info *p, void pci_scan_for_target_abort(struct pci_pbm_info *pbm,
struct pci_pbm_info *pbm,
struct pci_bus *pbus) struct pci_bus *pbus)
{ {
struct pci_dev *pdev; struct pci_dev *pdev;
...@@ -179,18 +178,16 @@ void pci_scan_for_target_abort(struct pci_controller_info *p, ...@@ -179,18 +178,16 @@ void pci_scan_for_target_abort(struct pci_controller_info *p,
PCI_STATUS_REC_TARGET_ABORT)); PCI_STATUS_REC_TARGET_ABORT));
if (error_bits) { if (error_bits) {
pci_write_config_word(pdev, PCI_STATUS, error_bits); pci_write_config_word(pdev, PCI_STATUS, error_bits);
printk("PCI%d(PBM%c): Device [%s] saw Target Abort [%016x]\n", printk("%s: Device %s saw Target Abort [%016x]\n",
p->index, ((pbm == &p->pbm_A) ? 'A' : 'B'), pbm->name, pci_name(pdev), status);
pci_name(pdev), status);
} }
} }
list_for_each_entry(bus, &pbus->children, node) list_for_each_entry(bus, &pbus->children, node)
pci_scan_for_target_abort(p, pbm, bus); pci_scan_for_target_abort(pbm, bus);
} }
void pci_scan_for_master_abort(struct pci_controller_info *p, void pci_scan_for_master_abort(struct pci_pbm_info *pbm,
struct pci_pbm_info *pbm,
struct pci_bus *pbus) struct pci_bus *pbus)
{ {
struct pci_dev *pdev; struct pci_dev *pdev;
...@@ -204,18 +201,16 @@ void pci_scan_for_master_abort(struct pci_controller_info *p, ...@@ -204,18 +201,16 @@ void pci_scan_for_master_abort(struct pci_controller_info *p,
(status & (PCI_STATUS_REC_MASTER_ABORT)); (status & (PCI_STATUS_REC_MASTER_ABORT));
if (error_bits) { if (error_bits) {
pci_write_config_word(pdev, PCI_STATUS, error_bits); pci_write_config_word(pdev, PCI_STATUS, error_bits);
printk("PCI%d(PBM%c): Device [%s] received Master Abort [%016x]\n", printk("%s: Device %s received Master Abort [%016x]\n",
p->index, ((pbm == &p->pbm_A) ? 'A' : 'B'), pbm->name, pci_name(pdev), status);
pci_name(pdev), status);
} }
} }
list_for_each_entry(bus, &pbus->children, node) list_for_each_entry(bus, &pbus->children, node)
pci_scan_for_master_abort(p, pbm, bus); pci_scan_for_master_abort(pbm, bus);
} }
void pci_scan_for_parity_error(struct pci_controller_info *p, void pci_scan_for_parity_error(struct pci_pbm_info *pbm,
struct pci_pbm_info *pbm,
struct pci_bus *pbus) struct pci_bus *pbus)
{ {
struct pci_dev *pdev; struct pci_dev *pdev;
...@@ -230,12 +225,11 @@ void pci_scan_for_parity_error(struct pci_controller_info *p, ...@@ -230,12 +225,11 @@ void pci_scan_for_parity_error(struct pci_controller_info *p,
PCI_STATUS_DETECTED_PARITY)); PCI_STATUS_DETECTED_PARITY));
if (error_bits) { if (error_bits) {
pci_write_config_word(pdev, PCI_STATUS, error_bits); pci_write_config_word(pdev, PCI_STATUS, error_bits);
printk("PCI%d(PBM%c): Device [%s] saw Parity Error [%016x]\n", printk("%s: Device %s saw Parity Error [%016x]\n",
p->index, ((pbm == &p->pbm_A) ? 'A' : 'B'), pbm->name, pci_name(pdev), status);
pci_name(pdev), status);
} }
} }
list_for_each_entry(bus, &pbus->children, node) list_for_each_entry(bus, &pbus->children, node)
pci_scan_for_parity_error(p, pbm, bus); pci_scan_for_parity_error(pbm, bus);
} }
...@@ -317,6 +317,8 @@ static void pci_fire_pbm_init(struct pci_controller_info *p, ...@@ -317,6 +317,8 @@ static void pci_fire_pbm_init(struct pci_controller_info *p,
pbm->scan_bus = pci_fire_scan_bus; pbm->scan_bus = pci_fire_scan_bus;
pbm->pci_ops = &pci_fire_ops; pbm->pci_ops = &pci_fire_ops;
pbm->index = pci_num_pbms++;
pbm->portid = portid; pbm->portid = portid;
pbm->parent = p; pbm->parent = p;
pbm->prom_node = dp; pbm->prom_node = dp;
...@@ -373,8 +375,6 @@ void fire_pci_init(struct device_node *dp, const char *model_name) ...@@ -373,8 +375,6 @@ void fire_pci_init(struct device_node *dp, const char *model_name)
p->pbm_B.iommu = iommu; p->pbm_B.iommu = iommu;
p->index = pci_num_controllers++;
/* XXX MSI support XXX */ /* XXX MSI support XXX */
/* Like PSYCHO and SCHIZO we have a 2GB aligned area /* Like PSYCHO and SCHIZO we have a 2GB aligned area
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
extern struct pci_pbm_info *pci_pbm_root; extern struct pci_pbm_info *pci_pbm_root;
extern unsigned long pci_memspace_mask; extern unsigned long pci_memspace_mask;
extern int pci_num_controllers; extern int pci_num_pbms;
/* PCI bus scanning and fixup support. */ /* PCI bus scanning and fixup support. */
extern void pci_get_pbm_props(struct pci_pbm_info *pbm); extern void pci_get_pbm_props(struct pci_pbm_info *pbm);
...@@ -31,9 +31,9 @@ extern int pci_host_bridge_write_pci_cfg(struct pci_bus *bus_dev, ...@@ -31,9 +31,9 @@ extern int pci_host_bridge_write_pci_cfg(struct pci_bus *bus_dev,
u32 value); u32 value);
/* Error reporting support. */ /* Error reporting support. */
extern void pci_scan_for_target_abort(struct pci_controller_info *, struct pci_pbm_info *, struct pci_bus *); extern void pci_scan_for_target_abort(struct pci_pbm_info *, struct pci_bus *);
extern void pci_scan_for_master_abort(struct pci_controller_info *, struct pci_pbm_info *, struct pci_bus *); extern void pci_scan_for_master_abort(struct pci_pbm_info *, struct pci_bus *);
extern void pci_scan_for_parity_error(struct pci_controller_info *, struct pci_pbm_info *, struct pci_bus *); extern void pci_scan_for_parity_error(struct pci_pbm_info *, struct pci_bus *);
/* Configuration space access. */ /* Configuration space access. */
extern void pci_config_read8(u8 *addr, u8 *ret); extern void pci_config_read8(u8 *addr, u8 *ret);
......
...@@ -268,7 +268,6 @@ static unsigned long stc_line_buf[16]; ...@@ -268,7 +268,6 @@ static unsigned long stc_line_buf[16];
static void __psycho_check_one_stc(struct pci_pbm_info *pbm, static void __psycho_check_one_stc(struct pci_pbm_info *pbm,
int is_pbm_a) int is_pbm_a)
{ {
struct pci_controller_info *p = pbm->parent;
struct strbuf *strbuf = &pbm->stc; struct strbuf *strbuf = &pbm->stc;
unsigned long regbase = pbm->controller_regs; unsigned long regbase = pbm->controller_regs;
unsigned long err_base, tag_base, line_base; unsigned long err_base, tag_base, line_base;
...@@ -326,9 +325,8 @@ static void __psycho_check_one_stc(struct pci_pbm_info *pbm, ...@@ -326,9 +325,8 @@ static void __psycho_check_one_stc(struct pci_pbm_info *pbm,
unsigned long errval = stc_error_buf[j]; unsigned long errval = stc_error_buf[j];
if (errval != 0) { if (errval != 0) {
saw_error++; saw_error++;
printk("PSYCHO%d(PBM%c): STC_ERR(%d)[wr(%d)rd(%d)]\n", printk("%s: STC_ERR(%d)[wr(%d)rd(%d)]\n",
p->index, pbm->name,
(is_pbm_a ? 'A' : 'B'),
j, j,
(errval & PSYCHO_STCERR_WRITE) ? 1 : 0, (errval & PSYCHO_STCERR_WRITE) ? 1 : 0,
(errval & PSYCHO_STCERR_READ) ? 1 : 0); (errval & PSYCHO_STCERR_READ) ? 1 : 0);
...@@ -337,18 +335,16 @@ static void __psycho_check_one_stc(struct pci_pbm_info *pbm, ...@@ -337,18 +335,16 @@ static void __psycho_check_one_stc(struct pci_pbm_info *pbm,
if (saw_error != 0) { if (saw_error != 0) {
unsigned long tagval = stc_tag_buf[i]; unsigned long tagval = stc_tag_buf[i];
unsigned long lineval = stc_line_buf[i]; unsigned long lineval = stc_line_buf[i];
printk("PSYCHO%d(PBM%c): STC_TAG(%d)[PA(%016lx)VA(%08lx)V(%d)W(%d)]\n", printk("%s: STC_TAG(%d)[PA(%016lx)VA(%08lx)V(%d)W(%d)]\n",
p->index, pbm->name,
(is_pbm_a ? 'A' : 'B'),
i, i,
((tagval & PSYCHO_STCTAG_PPN) >> 19UL), ((tagval & PSYCHO_STCTAG_PPN) >> 19UL),
(tagval & PSYCHO_STCTAG_VPN), (tagval & PSYCHO_STCTAG_VPN),
((tagval & PSYCHO_STCTAG_VALID) ? 1 : 0), ((tagval & PSYCHO_STCTAG_VALID) ? 1 : 0),
((tagval & PSYCHO_STCTAG_WRITE) ? 1 : 0)); ((tagval & PSYCHO_STCTAG_WRITE) ? 1 : 0));
printk("PSYCHO%d(PBM%c): STC_LINE(%d)[LIDX(%lx)SP(%lx)LADDR(%lx)EP(%lx)" printk("%s: STC_LINE(%d)[LIDX(%lx)SP(%lx)LADDR(%lx)EP(%lx)"
"V(%d)FOFN(%d)]\n", "V(%d)FOFN(%d)]\n",
p->index, pbm->name,
(is_pbm_a ? 'A' : 'B'),
i, i,
((lineval & PSYCHO_STCLINE_LINDX) >> 21UL), ((lineval & PSYCHO_STCLINE_LINDX) >> 21UL),
((lineval & PSYCHO_STCLINE_SPTR) >> 15UL), ((lineval & PSYCHO_STCLINE_SPTR) >> 15UL),
...@@ -411,7 +407,6 @@ static void psycho_check_iommu_error(struct pci_pbm_info *pbm, ...@@ -411,7 +407,6 @@ static void psycho_check_iommu_error(struct pci_pbm_info *pbm,
unsigned long afar, unsigned long afar,
enum psycho_error_type type) enum psycho_error_type type)
{ {
struct pci_controller_info *p = pbm->parent;
struct iommu *iommu = pbm->iommu; struct iommu *iommu = pbm->iommu;
unsigned long iommu_tag[16]; unsigned long iommu_tag[16];
unsigned long iommu_data[16]; unsigned long iommu_data[16];
...@@ -443,8 +438,8 @@ static void psycho_check_iommu_error(struct pci_pbm_info *pbm, ...@@ -443,8 +438,8 @@ static void psycho_check_iommu_error(struct pci_pbm_info *pbm,
type_string = "ECC Error"; type_string = "ECC Error";
break; break;
}; };
printk("PSYCHO%d: IOMMU Error, type[%s]\n", printk("%s: IOMMU Error, type[%s]\n",
p->index, type_string); pbm->name, type_string);
/* Put the IOMMU into diagnostic mode and probe /* Put the IOMMU into diagnostic mode and probe
* it's TLB for entries with error status. * it's TLB for entries with error status.
...@@ -497,14 +492,14 @@ static void psycho_check_iommu_error(struct pci_pbm_info *pbm, ...@@ -497,14 +492,14 @@ static void psycho_check_iommu_error(struct pci_pbm_info *pbm,
type_string = "ECC Error"; type_string = "ECC Error";
break; break;
}; };
printk("PSYCHO%d: IOMMU TAG(%d)[error(%s) wr(%d) str(%d) sz(%dK) vpg(%08lx)]\n", printk("%s: IOMMU TAG(%d)[error(%s) wr(%d) str(%d) sz(%dK) vpg(%08lx)]\n",
p->index, i, type_string, pbm->name, i, type_string,
((tag & PSYCHO_IOMMU_TAG_WRITE) ? 1 : 0), ((tag & PSYCHO_IOMMU_TAG_WRITE) ? 1 : 0),
((tag & PSYCHO_IOMMU_TAG_STREAM) ? 1 : 0), ((tag & PSYCHO_IOMMU_TAG_STREAM) ? 1 : 0),
((tag & PSYCHO_IOMMU_TAG_SIZE) ? 64 : 8), ((tag & PSYCHO_IOMMU_TAG_SIZE) ? 64 : 8),
(tag & PSYCHO_IOMMU_TAG_VPAGE) << IOMMU_PAGE_SHIFT); (tag & PSYCHO_IOMMU_TAG_VPAGE) << IOMMU_PAGE_SHIFT);
printk("PSYCHO%d: IOMMU DATA(%d)[valid(%d) cache(%d) ppg(%016lx)]\n", printk("%s: IOMMU DATA(%d)[valid(%d) cache(%d) ppg(%016lx)]\n",
p->index, i, pbm->name, i,
((data & PSYCHO_IOMMU_DATA_VALID) ? 1 : 0), ((data & PSYCHO_IOMMU_DATA_VALID) ? 1 : 0),
((data & PSYCHO_IOMMU_DATA_CACHE) ? 1 : 0), ((data & PSYCHO_IOMMU_DATA_CACHE) ? 1 : 0),
(data & PSYCHO_IOMMU_DATA_PPAGE) << IOMMU_PAGE_SHIFT); (data & PSYCHO_IOMMU_DATA_PPAGE) << IOMMU_PAGE_SHIFT);
...@@ -555,22 +550,22 @@ static irqreturn_t psycho_ue_intr(int irq, void *dev_id) ...@@ -555,22 +550,22 @@ static irqreturn_t psycho_ue_intr(int irq, void *dev_id)
psycho_write(afsr_reg, error_bits); psycho_write(afsr_reg, error_bits);
/* Log the error. */ /* Log the error. */
printk("PSYCHO%d: Uncorrectable Error, primary error type[%s]\n", printk("%s: Uncorrectable Error, primary error type[%s]\n",
p->index, pbm->name,
(((error_bits & PSYCHO_UEAFSR_PPIO) ? (((error_bits & PSYCHO_UEAFSR_PPIO) ?
"PIO" : "PIO" :
((error_bits & PSYCHO_UEAFSR_PDRD) ? ((error_bits & PSYCHO_UEAFSR_PDRD) ?
"DMA Read" : "DMA Read" :
((error_bits & PSYCHO_UEAFSR_PDWR) ? ((error_bits & PSYCHO_UEAFSR_PDWR) ?
"DMA Write" : "???"))))); "DMA Write" : "???")))));
printk("PSYCHO%d: bytemask[%04lx] dword_offset[%lx] UPA_MID[%02lx] was_block(%d)\n", printk("%s: bytemask[%04lx] dword_offset[%lx] UPA_MID[%02lx] was_block(%d)\n",
p->index, pbm->name,
(afsr & PSYCHO_UEAFSR_BMSK) >> 32UL, (afsr & PSYCHO_UEAFSR_BMSK) >> 32UL,
(afsr & PSYCHO_UEAFSR_DOFF) >> 29UL, (afsr & PSYCHO_UEAFSR_DOFF) >> 29UL,
(afsr & PSYCHO_UEAFSR_MID) >> 24UL, (afsr & PSYCHO_UEAFSR_MID) >> 24UL,
((afsr & PSYCHO_UEAFSR_BLK) ? 1 : 0)); ((afsr & PSYCHO_UEAFSR_BLK) ? 1 : 0));
printk("PSYCHO%d: UE AFAR [%016lx]\n", p->index, afar); printk("%s: UE AFAR [%016lx]\n", pbm->name, afar);
printk("PSYCHO%d: UE Secondary errors [", p->index); printk("%s: UE Secondary errors [", pbm->name);
reported = 0; reported = 0;
if (afsr & PSYCHO_UEAFSR_SPIO) { if (afsr & PSYCHO_UEAFSR_SPIO) {
reported++; reported++;
...@@ -615,7 +610,6 @@ static irqreturn_t psycho_ue_intr(int irq, void *dev_id) ...@@ -615,7 +610,6 @@ static irqreturn_t psycho_ue_intr(int irq, void *dev_id)
static irqreturn_t psycho_ce_intr(int irq, void *dev_id) static irqreturn_t psycho_ce_intr(int irq, void *dev_id)
{ {
struct pci_pbm_info *pbm = dev_id; struct pci_pbm_info *pbm = dev_id;
struct pci_controller_info *p = pbm->parent;
unsigned long afsr_reg = pbm->controller_regs + PSYCHO_CE_AFSR; unsigned long afsr_reg = pbm->controller_regs + PSYCHO_CE_AFSR;
unsigned long afar_reg = pbm->controller_regs + PSYCHO_CE_AFAR; unsigned long afar_reg = pbm->controller_regs + PSYCHO_CE_AFAR;
unsigned long afsr, afar, error_bits; unsigned long afsr, afar, error_bits;
...@@ -634,8 +628,8 @@ static irqreturn_t psycho_ce_intr(int irq, void *dev_id) ...@@ -634,8 +628,8 @@ static irqreturn_t psycho_ce_intr(int irq, void *dev_id)
psycho_write(afsr_reg, error_bits); psycho_write(afsr_reg, error_bits);
/* Log the error. */ /* Log the error. */
printk("PSYCHO%d: Correctable Error, primary error type[%s]\n", printk("%s: Correctable Error, primary error type[%s]\n",
p->index, pbm->name,
(((error_bits & PSYCHO_CEAFSR_PPIO) ? (((error_bits & PSYCHO_CEAFSR_PPIO) ?
"PIO" : "PIO" :
((error_bits & PSYCHO_CEAFSR_PDRD) ? ((error_bits & PSYCHO_CEAFSR_PDRD) ?
...@@ -646,16 +640,16 @@ static irqreturn_t psycho_ce_intr(int irq, void *dev_id) ...@@ -646,16 +640,16 @@ static irqreturn_t psycho_ce_intr(int irq, void *dev_id)
/* XXX Use syndrome and afar to print out module string just like /* XXX Use syndrome and afar to print out module string just like
* XXX UDB CE trap handler does... -DaveM * XXX UDB CE trap handler does... -DaveM
*/ */
printk("PSYCHO%d: syndrome[%02lx] bytemask[%04lx] dword_offset[%lx] " printk("%s: syndrome[%02lx] bytemask[%04lx] dword_offset[%lx] "
"UPA_MID[%02lx] was_block(%d)\n", "UPA_MID[%02lx] was_block(%d)\n",
p->index, pbm->name,
(afsr & PSYCHO_CEAFSR_ESYND) >> 48UL, (afsr & PSYCHO_CEAFSR_ESYND) >> 48UL,
(afsr & PSYCHO_CEAFSR_BMSK) >> 32UL, (afsr & PSYCHO_CEAFSR_BMSK) >> 32UL,
(afsr & PSYCHO_CEAFSR_DOFF) >> 29UL, (afsr & PSYCHO_CEAFSR_DOFF) >> 29UL,
(afsr & PSYCHO_CEAFSR_MID) >> 24UL, (afsr & PSYCHO_CEAFSR_MID) >> 24UL,
((afsr & PSYCHO_CEAFSR_BLK) ? 1 : 0)); ((afsr & PSYCHO_CEAFSR_BLK) ? 1 : 0));
printk("PSYCHO%d: CE AFAR [%016lx]\n", p->index, afar); printk("%s: CE AFAR [%016lx]\n", pbm->name, afar);
printk("PSYCHO%d: CE Secondary errors [", p->index); printk("%s: CE Secondary errors [", pbm->name);
reported = 0; reported = 0;
if (afsr & PSYCHO_CEAFSR_SPIO) { if (afsr & PSYCHO_CEAFSR_SPIO) {
reported++; reported++;
...@@ -770,8 +764,8 @@ static irqreturn_t psycho_pcierr_intr(int irq, void *dev_id) ...@@ -770,8 +764,8 @@ static irqreturn_t psycho_pcierr_intr(int irq, void *dev_id)
psycho_write(afsr_reg, error_bits); psycho_write(afsr_reg, error_bits);
/* Log the error. */ /* Log the error. */
printk("PSYCHO%d(PBM%c): PCI Error, primary error type[%s]\n", printk("%s: PCI Error, primary error type[%s]\n",
p->index, (is_pbm_a ? 'A' : 'B'), pbm->name,
(((error_bits & PSYCHO_PCIAFSR_PMA) ? (((error_bits & PSYCHO_PCIAFSR_PMA) ?
"Master Abort" : "Master Abort" :
((error_bits & PSYCHO_PCIAFSR_PTA) ? ((error_bits & PSYCHO_PCIAFSR_PTA) ?
...@@ -780,15 +774,13 @@ static irqreturn_t psycho_pcierr_intr(int irq, void *dev_id) ...@@ -780,15 +774,13 @@ static irqreturn_t psycho_pcierr_intr(int irq, void *dev_id)
"Excessive Retries" : "Excessive Retries" :
((error_bits & PSYCHO_PCIAFSR_PPERR) ? ((error_bits & PSYCHO_PCIAFSR_PPERR) ?
"Parity Error" : "???")))))); "Parity Error" : "???"))))));
printk("PSYCHO%d(PBM%c): bytemask[%04lx] UPA_MID[%02lx] was_block(%d)\n", printk("%s: bytemask[%04lx] UPA_MID[%02lx] was_block(%d)\n",
p->index, (is_pbm_a ? 'A' : 'B'), pbm->name,
(afsr & PSYCHO_PCIAFSR_BMSK) >> 32UL, (afsr & PSYCHO_PCIAFSR_BMSK) >> 32UL,
(afsr & PSYCHO_PCIAFSR_MID) >> 25UL, (afsr & PSYCHO_PCIAFSR_MID) >> 25UL,
(afsr & PSYCHO_PCIAFSR_BLK) ? 1 : 0); (afsr & PSYCHO_PCIAFSR_BLK) ? 1 : 0);
printk("PSYCHO%d(PBM%c): PCI AFAR [%016lx]\n", printk("%s: PCI AFAR [%016lx]\n", pbm->name, afar);
p->index, (is_pbm_a ? 'A' : 'B'), afar); printk("%s: PCI Secondary errors [", pbm->name);
printk("PSYCHO%d(PBM%c): PCI Secondary errors [",
p->index, (is_pbm_a ? 'A' : 'B'));
reported = 0; reported = 0;
if (afsr & PSYCHO_PCIAFSR_SMA) { if (afsr & PSYCHO_PCIAFSR_SMA) {
reported++; reported++;
...@@ -821,10 +813,10 @@ static irqreturn_t psycho_pcierr_intr(int irq, void *dev_id) ...@@ -821,10 +813,10 @@ static irqreturn_t psycho_pcierr_intr(int irq, void *dev_id)
*/ */
if (error_bits & (PSYCHO_PCIAFSR_PTA | PSYCHO_PCIAFSR_STA)) { if (error_bits & (PSYCHO_PCIAFSR_PTA | PSYCHO_PCIAFSR_STA)) {
psycho_check_iommu_error(pbm, afsr, afar, PCI_ERR); psycho_check_iommu_error(pbm, afsr, afar, PCI_ERR);
pci_scan_for_target_abort(pbm->parent, pbm, pbm->pci_bus); pci_scan_for_target_abort(pbm, pbm->pci_bus);
} }
if (error_bits & (PSYCHO_PCIAFSR_PMA | PSYCHO_PCIAFSR_SMA)) if (error_bits & (PSYCHO_PCIAFSR_PMA | PSYCHO_PCIAFSR_SMA))
pci_scan_for_master_abort(pbm->parent, pbm, pbm->pci_bus); pci_scan_for_master_abort(pbm, pbm->pci_bus);
/* For excessive retries, PSYCHO/PBM will abort the device /* For excessive retries, PSYCHO/PBM will abort the device
* and there is no way to specifically check for excessive * and there is no way to specifically check for excessive
...@@ -834,7 +826,7 @@ static irqreturn_t psycho_pcierr_intr(int irq, void *dev_id) ...@@ -834,7 +826,7 @@ static irqreturn_t psycho_pcierr_intr(int irq, void *dev_id)
*/ */
if (error_bits & (PSYCHO_PCIAFSR_PPERR | PSYCHO_PCIAFSR_SPERR)) if (error_bits & (PSYCHO_PCIAFSR_PPERR | PSYCHO_PCIAFSR_SPERR))
pci_scan_for_parity_error(pbm->parent, pbm, pbm->pci_bus); pci_scan_for_parity_error(pbm, pbm->pci_bus);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -1089,6 +1081,8 @@ static void psycho_pbm_init(struct pci_controller_info *p, ...@@ -1089,6 +1081,8 @@ static void psycho_pbm_init(struct pci_controller_info *p,
pbm->scan_bus = psycho_scan_bus; pbm->scan_bus = psycho_scan_bus;
pbm->pci_ops = &psycho_ops; pbm->pci_ops = &psycho_ops;
pbm->index = pci_num_pbms++;
pbm->chip_type = PBM_CHIP_TYPE_PSYCHO; pbm->chip_type = PBM_CHIP_TYPE_PSYCHO;
pbm->chip_version = 0; pbm->chip_version = 0;
prop = of_find_property(dp, "version#", NULL); prop = of_find_property(dp, "version#", NULL);
...@@ -1155,7 +1149,6 @@ void psycho_init(struct device_node *dp, char *model_name) ...@@ -1155,7 +1149,6 @@ void psycho_init(struct device_node *dp, char *model_name)
p->pbm_A.portid = upa_portid; p->pbm_A.portid = upa_portid;
p->pbm_B.portid = upa_portid; p->pbm_B.portid = upa_portid;
p->index = pci_num_controllers++;
prop = of_find_property(dp, "reg", NULL); prop = of_find_property(dp, "reg", NULL);
pr_regs = prop->value; pr_regs = prop->value;
......
This diff is collapsed.
...@@ -531,28 +531,28 @@ static irqreturn_t schizo_ue_intr(int irq, void *dev_id) ...@@ -531,28 +531,28 @@ static irqreturn_t schizo_ue_intr(int irq, void *dev_id)
schizo_write(afsr_reg, error_bits); schizo_write(afsr_reg, error_bits);
/* Log the error. */ /* Log the error. */
printk("PCI%d: Uncorrectable Error, primary error type[%s]\n", printk("%s: Uncorrectable Error, primary error type[%s]\n",
p->index, pbm->name,
(((error_bits & SCHIZO_UEAFSR_PPIO) ? (((error_bits & SCHIZO_UEAFSR_PPIO) ?
"PIO" : "PIO" :
((error_bits & SCHIZO_UEAFSR_PDRD) ? ((error_bits & SCHIZO_UEAFSR_PDRD) ?
"DMA Read" : "DMA Read" :
((error_bits & SCHIZO_UEAFSR_PDWR) ? ((error_bits & SCHIZO_UEAFSR_PDWR) ?
"DMA Write" : "???"))))); "DMA Write" : "???")))));
printk("PCI%d: bytemask[%04lx] qword_offset[%lx] SAFARI_AID[%02lx]\n", printk("%s: bytemask[%04lx] qword_offset[%lx] SAFARI_AID[%02lx]\n",
p->index, pbm->name,
(afsr & SCHIZO_UEAFSR_BMSK) >> 32UL, (afsr & SCHIZO_UEAFSR_BMSK) >> 32UL,
(afsr & SCHIZO_UEAFSR_QOFF) >> 30UL, (afsr & SCHIZO_UEAFSR_QOFF) >> 30UL,
(afsr & SCHIZO_UEAFSR_AID) >> 24UL); (afsr & SCHIZO_UEAFSR_AID) >> 24UL);
printk("PCI%d: partial[%d] owned_in[%d] mtag[%lx] mtag_synd[%lx] ecc_sync[%lx]\n", printk("%s: partial[%d] owned_in[%d] mtag[%lx] mtag_synd[%lx] ecc_sync[%lx]\n",
p->index, pbm->name,
(afsr & SCHIZO_UEAFSR_PARTIAL) ? 1 : 0, (afsr & SCHIZO_UEAFSR_PARTIAL) ? 1 : 0,
(afsr & SCHIZO_UEAFSR_OWNEDIN) ? 1 : 0, (afsr & SCHIZO_UEAFSR_OWNEDIN) ? 1 : 0,
(afsr & SCHIZO_UEAFSR_MTAG) >> 13UL, (afsr & SCHIZO_UEAFSR_MTAG) >> 13UL,
(afsr & SCHIZO_UEAFSR_MTAGSYND) >> 16UL, (afsr & SCHIZO_UEAFSR_MTAGSYND) >> 16UL,
(afsr & SCHIZO_UEAFSR_ECCSYND) >> 0UL); (afsr & SCHIZO_UEAFSR_ECCSYND) >> 0UL);
printk("PCI%d: UE AFAR [%016lx]\n", p->index, afar); printk("%s: UE AFAR [%016lx]\n", pbm->name, afar);
printk("PCI%d: UE Secondary errors [", p->index); printk("%s: UE Secondary errors [", pbm->name);
reported = 0; reported = 0;
if (afsr & SCHIZO_UEAFSR_SPIO) { if (afsr & SCHIZO_UEAFSR_SPIO) {
reported++; reported++;
...@@ -593,7 +593,6 @@ static irqreturn_t schizo_ue_intr(int irq, void *dev_id) ...@@ -593,7 +593,6 @@ static irqreturn_t schizo_ue_intr(int irq, void *dev_id)
static irqreturn_t schizo_ce_intr(int irq, void *dev_id) static irqreturn_t schizo_ce_intr(int irq, void *dev_id)
{ {
struct pci_pbm_info *pbm = dev_id; struct pci_pbm_info *pbm = dev_id;
struct pci_controller_info *p = pbm->parent;
unsigned long afsr_reg = pbm->controller_regs + SCHIZO_CE_AFSR; unsigned long afsr_reg = pbm->controller_regs + SCHIZO_CE_AFSR;
unsigned long afar_reg = pbm->controller_regs + SCHIZO_CE_AFAR; unsigned long afar_reg = pbm->controller_regs + SCHIZO_CE_AFAR;
unsigned long afsr, afar, error_bits; unsigned long afsr, afar, error_bits;
...@@ -620,8 +619,8 @@ static irqreturn_t schizo_ce_intr(int irq, void *dev_id) ...@@ -620,8 +619,8 @@ static irqreturn_t schizo_ce_intr(int irq, void *dev_id)
schizo_write(afsr_reg, error_bits); schizo_write(afsr_reg, error_bits);
/* Log the error. */ /* Log the error. */
printk("PCI%d: Correctable Error, primary error type[%s]\n", printk("%s: Correctable Error, primary error type[%s]\n",
p->index, pbm->name,
(((error_bits & SCHIZO_CEAFSR_PPIO) ? (((error_bits & SCHIZO_CEAFSR_PPIO) ?
"PIO" : "PIO" :
((error_bits & SCHIZO_CEAFSR_PDRD) ? ((error_bits & SCHIZO_CEAFSR_PDRD) ?
...@@ -632,20 +631,20 @@ static irqreturn_t schizo_ce_intr(int irq, void *dev_id) ...@@ -632,20 +631,20 @@ static irqreturn_t schizo_ce_intr(int irq, void *dev_id)
/* XXX Use syndrome and afar to print out module string just like /* XXX Use syndrome and afar to print out module string just like
* XXX UDB CE trap handler does... -DaveM * XXX UDB CE trap handler does... -DaveM
*/ */
printk("PCI%d: bytemask[%04lx] qword_offset[%lx] SAFARI_AID[%02lx]\n", printk("%s: bytemask[%04lx] qword_offset[%lx] SAFARI_AID[%02lx]\n",
p->index, pbm->name,
(afsr & SCHIZO_UEAFSR_BMSK) >> 32UL, (afsr & SCHIZO_UEAFSR_BMSK) >> 32UL,
(afsr & SCHIZO_UEAFSR_QOFF) >> 30UL, (afsr & SCHIZO_UEAFSR_QOFF) >> 30UL,
(afsr & SCHIZO_UEAFSR_AID) >> 24UL); (afsr & SCHIZO_UEAFSR_AID) >> 24UL);
printk("PCI%d: partial[%d] owned_in[%d] mtag[%lx] mtag_synd[%lx] ecc_sync[%lx]\n", printk("%s: partial[%d] owned_in[%d] mtag[%lx] mtag_synd[%lx] ecc_sync[%lx]\n",
p->index, pbm->name,
(afsr & SCHIZO_UEAFSR_PARTIAL) ? 1 : 0, (afsr & SCHIZO_UEAFSR_PARTIAL) ? 1 : 0,
(afsr & SCHIZO_UEAFSR_OWNEDIN) ? 1 : 0, (afsr & SCHIZO_UEAFSR_OWNEDIN) ? 1 : 0,
(afsr & SCHIZO_UEAFSR_MTAG) >> 13UL, (afsr & SCHIZO_UEAFSR_MTAG) >> 13UL,
(afsr & SCHIZO_UEAFSR_MTAGSYND) >> 16UL, (afsr & SCHIZO_UEAFSR_MTAGSYND) >> 16UL,
(afsr & SCHIZO_UEAFSR_ECCSYND) >> 0UL); (afsr & SCHIZO_UEAFSR_ECCSYND) >> 0UL);
printk("PCI%d: CE AFAR [%016lx]\n", p->index, afar); printk("%s: CE AFAR [%016lx]\n", pbm->name, afar);
printk("PCI%d: CE Secondary errors [", p->index); printk("%s: CE Secondary errors [", pbm->name);
reported = 0; reported = 0;
if (afsr & SCHIZO_CEAFSR_SPIO) { if (afsr & SCHIZO_CEAFSR_SPIO) {
reported++; reported++;
...@@ -864,10 +863,10 @@ static irqreturn_t schizo_pcierr_intr(int irq, void *dev_id) ...@@ -864,10 +863,10 @@ static irqreturn_t schizo_pcierr_intr(int irq, void *dev_id)
*/ */
if (error_bits & (SCHIZO_PCIAFSR_PTA | SCHIZO_PCIAFSR_STA)) { if (error_bits & (SCHIZO_PCIAFSR_PTA | SCHIZO_PCIAFSR_STA)) {
schizo_check_iommu_error(p, PCI_ERR); schizo_check_iommu_error(p, PCI_ERR);
pci_scan_for_target_abort(p, pbm, pbm->pci_bus); pci_scan_for_target_abort(pbm, pbm->pci_bus);
} }
if (error_bits & (SCHIZO_PCIAFSR_PMA | SCHIZO_PCIAFSR_SMA)) if (error_bits & (SCHIZO_PCIAFSR_PMA | SCHIZO_PCIAFSR_SMA))
pci_scan_for_master_abort(p, pbm, pbm->pci_bus); pci_scan_for_master_abort(pbm, pbm->pci_bus);
/* For excessive retries, PSYCHO/PBM will abort the device /* For excessive retries, PSYCHO/PBM will abort the device
* and there is no way to specifically check for excessive * and there is no way to specifically check for excessive
...@@ -877,7 +876,7 @@ static irqreturn_t schizo_pcierr_intr(int irq, void *dev_id) ...@@ -877,7 +876,7 @@ static irqreturn_t schizo_pcierr_intr(int irq, void *dev_id)
*/ */
if (error_bits & (SCHIZO_PCIAFSR_PPERR | SCHIZO_PCIAFSR_SPERR)) if (error_bits & (SCHIZO_PCIAFSR_PPERR | SCHIZO_PCIAFSR_SPERR))
pci_scan_for_parity_error(p, pbm, pbm->pci_bus); pci_scan_for_parity_error(pbm, pbm->pci_bus);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -932,14 +931,14 @@ static irqreturn_t schizo_safarierr_intr(int irq, void *dev_id) ...@@ -932,14 +931,14 @@ static irqreturn_t schizo_safarierr_intr(int irq, void *dev_id)
errlog & ~(SAFARI_ERRLOG_ERROUT)); errlog & ~(SAFARI_ERRLOG_ERROUT));
if (!(errlog & BUS_ERROR_UNMAP)) { if (!(errlog & BUS_ERROR_UNMAP)) {
printk("PCI%d: Unexpected Safari/JBUS error interrupt, errlog[%016lx]\n", printk("%s: Unexpected Safari/JBUS error interrupt, errlog[%016lx]\n",
p->index, errlog); pbm->name, errlog);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
printk("PCI%d: Safari/JBUS interrupt, UNMAPPED error, interrogating IOMMUs.\n", printk("%s: Safari/JBUS interrupt, UNMAPPED error, interrogating IOMMUs.\n",
p->index); pbm->name);
schizo_check_iommu_error(p, SAFARI_ERR); schizo_check_iommu_error(p, SAFARI_ERR);
return IRQ_HANDLED; return IRQ_HANDLED;
...@@ -1464,6 +1463,8 @@ static void schizo_pbm_init(struct pci_controller_info *p, ...@@ -1464,6 +1463,8 @@ static void schizo_pbm_init(struct pci_controller_info *p,
pbm->scan_bus = schizo_scan_bus; pbm->scan_bus = schizo_scan_bus;
pbm->pci_ops = &schizo_ops; pbm->pci_ops = &schizo_ops;
pbm->index = pci_num_pbms++;
pbm->portid = portid; pbm->portid = portid;
pbm->parent = p; pbm->parent = p;
pbm->prom_node = dp; pbm->prom_node = dp;
...@@ -1536,8 +1537,6 @@ static void __schizo_init(struct device_node *dp, char *model_name, int chip_typ ...@@ -1536,8 +1537,6 @@ static void __schizo_init(struct device_node *dp, char *model_name, int chip_typ
p->pbm_B.iommu = iommu; p->pbm_B.iommu = iommu;
p->index = pci_num_controllers++;
/* Like PSYCHO we have a 2GB aligned area for memory space. */ /* Like PSYCHO we have a 2GB aligned area for memory space. */
pci_memspace_mask = 0x7fffffffUL; pci_memspace_mask = 0x7fffffffUL;
......
...@@ -1241,6 +1241,8 @@ static void pci_sun4v_pbm_init(struct pci_controller_info *p, struct device_node ...@@ -1241,6 +1241,8 @@ static void pci_sun4v_pbm_init(struct pci_controller_info *p, struct device_node
pbm->scan_bus = pci_sun4v_scan_bus; pbm->scan_bus = pci_sun4v_scan_bus;
pbm->pci_ops = &pci_sun4v_ops; pbm->pci_ops = &pci_sun4v_ops;
pbm->index = pci_num_pbms++;
pbm->parent = p; pbm->parent = p;
pbm->prom_node = dp; pbm->prom_node = dp;
...@@ -1304,8 +1306,6 @@ void sun4v_pci_init(struct device_node *dp, char *model_name) ...@@ -1304,8 +1306,6 @@ void sun4v_pci_init(struct device_node *dp, char *model_name)
p->pbm_B.iommu = iommu; p->pbm_B.iommu = iommu;
p->index = pci_num_controllers++;
/* Like PSYCHO and SCHIZO we have a 2GB aligned area /* Like PSYCHO and SCHIZO we have a 2GB aligned area
* for memory space. * for memory space.
*/ */
......
...@@ -40,6 +40,7 @@ struct pci_controller_info; ...@@ -40,6 +40,7 @@ struct pci_controller_info;
struct pci_pbm_info { struct pci_pbm_info {
struct pci_pbm_info *next; struct pci_pbm_info *next;
int index;
/* PCI controller we sit under. */ /* PCI controller we sit under. */
struct pci_controller_info *parent; struct pci_controller_info *parent;
...@@ -123,11 +124,6 @@ struct pci_pbm_info { ...@@ -123,11 +124,6 @@ struct pci_pbm_info {
}; };
struct pci_controller_info { struct pci_controller_info {
/* Each controller gets a unique index, used mostly for
* error logging purposes.
*/
int index;
/* The PCI bus modules controlled by us. */ /* The PCI bus modules controlled by us. */
struct pci_pbm_info pbm_A; struct pci_pbm_info pbm_A;
struct pci_pbm_info pbm_B; struct pci_pbm_info pbm_B;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment