aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/export-to-postgresql.py
diff options
context:
space:
mode:
authorBjorn Helgaas <[email protected]>2018-09-27 09:22:09 -0500
committerBorislav Petkov <[email protected]>2018-10-09 17:18:36 +0200
commit010a93bf97c72f43aac664d0a685942f83d1a103 (patch)
tree3fc4d3683d13c0bbd69f69ac461c928a54ecf6f7 /tools/perf/scripts/python/export-to-postgresql.py
parenta98959fdbda1849a01b2150bb635ed559ec06700 (diff)
resource: Fix find_next_iomem_res() iteration issue
Previously find_next_iomem_res() used "*res" as both an input parameter for the range to search and the type of resource to search for, and an output parameter for the resource we found, which makes the interface confusing. The current callers use find_next_iomem_res() incorrectly because they allocate a single struct resource and use it for repeated calls to find_next_iomem_res(). When find_next_iomem_res() returns a resource, it overwrites the start, end, flags, and desc members of the struct. If we call find_next_iomem_res() again, we must update or restore these fields. The previous code restored res.start and res.end, but not res.flags or res.desc. Since the callers did not restore res.flags, if they searched for flags IORESOURCE_MEM | IORESOURCE_BUSY and found a resource with flags IORESOURCE_MEM | IORESOURCE_BUSY | IORESOURCE_SYSRAM, the next search would incorrectly skip resources unless they were also marked as IORESOURCE_SYSRAM. Fix this by restructuring the interface so it takes explicit "start, end, flags" parameters and uses "*res" only as an output parameter. Based on a patch by Lianbo Jiang <[email protected]>. [ bp: While at it: - make comments kernel-doc style. - Originally-by: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Bjorn Helgaas <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> CC: Andrew Morton <[email protected]> CC: Brijesh Singh <[email protected]> CC: Dan Williams <[email protected]> CC: H. Peter Anvin <[email protected]> CC: Lianbo Jiang <[email protected]> CC: Takashi Iwai <[email protected]> CC: Thomas Gleixner <[email protected]> CC: Tom Lendacky <[email protected]> CC: Vivek Goyal <[email protected]> CC: Yaowei Bai <[email protected]> CC: [email protected] CC: [email protected] CC: [email protected] CC: [email protected] CC: [email protected] CC: x86-ml <[email protected]> Link: http://lkml.kernel.org/r/153805812916.1157.177580438135143788.stgit@bhelgaas-glaptop.roam.corp.google.com
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions