if (pmc_idx != PMC_IDX_MAIN) { /* * The secondary PMC BARS (which are behind hidden PCI devices) * are read from fixed offsets in MMIO of the primary PMC BAR. * If a device is not present, the value will be 0.
*/
ssram_base = get_base(tmp_ssram, offset); if (!ssram_base) return 0;
ssram = ioremap(ssram_base, SSRAM_HDR_SIZE); if (!ssram) return -ENOMEM;
/* Find and register and PMC telemetry entries */ return pmc_ssram_telemetry_add_pmt(pcidev, ssram_base, ssram);
}
/** * pmc_ssram_telemetry_get_pmc_info() - Get a PMC devid and base_addr information * @pmc_idx: Index of the PMC * @pmc_ssram_telemetry: pmc_ssram_telemetry structure to store the PMC information * * Return: * * 0 - Success * * -EAGAIN - Probe function has not finished yet. Try again. * * -EINVAL - Invalid pmc_idx * * -ENODEV - PMC device is not available
*/ int pmc_ssram_telemetry_get_pmc_info(unsignedint pmc_idx, struct pmc_ssram_telemetry *pmc_ssram_telemetry)
{ /* * PMCs are discovered in probe function. If this function is called before * probe function complete, the result would be invalid. Use device_probed * variable to avoid this case. Return -EAGAIN to inform the consumer to call * again later.
*/ if (!device_probed) return -EAGAIN;
/* * Memory barrier is used to ensure the correct read order between * device_probed variable and PMC info.
*/
smp_rmb(); if (pmc_idx >= MAX_NUM_PMC) return -EINVAL;
if (!pmc_ssram_telems || !pmc_ssram_telems[pmc_idx].devid) return -ENODEV;
probe_finish: /* * Memory barrier is used to ensure the correct write order between PMC info * and device_probed variable.
*/
smp_wmb();
device_probed = true; return ret;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.