Skip to content
Snippets Groups Projects
Commit 2645e00e authored by c_ankurb's avatar c_ankurb
Browse files

lrdp_v2 : Fix for broken mmcdoctor.py for kernel 4.9

Adding check for kernel 4.9 where radix tree lookup by
element has changed to use shift instead of height
so now using radix_tree_lookup_element_v2 in kernel 4.9

Change-Id: I8323da2d4ccd52f3dd27a776e9640e1f0d917675
parent 6c908018
No related branches found
No related tags found
No related merge requests found
......@@ -121,8 +121,12 @@ def get_sdhci_irqs(ram_dump):
if nr_irqs > 50000:
return
for i in range(0, nr_irqs):
irq_desc = irqs.radix_tree_lookup_element(
ram_dump, irq_desc_tree, i)
if (ram_dump.kernel_version >= (4,9,0)):
irq_desc = irqs.radix_tree_lookup_element_v2(
ram_dump, irq_desc_tree, i)
else:
irq_desc = irqs.radix_tree_lookup_element(
ram_dump, irq_desc_tree, i)
if irq_desc is None:
continue
action = ram_dump.read_word(irq_desc + irq_action_offset)
......@@ -144,7 +148,12 @@ def find_sdhci_host(ramdump, irq):
irq_action_offset = ramdump.field_offset('struct irq_desc', 'action')
dev_id = ramdump.field_offset('struct irqaction', 'dev_id')
irqs = IrqParse(RamParser)
sdhci_irq_desc = irqs.radix_tree_lookup_element(ramdump, irq_desc_tree, irq)
if (ramdump.kernel_version >= (4,9,0)):
sdhci_irq_desc = irqs.radix_tree_lookup_element_v2(
ramdump, irq_desc_tree, irq)
else:
sdhci_irq_desc = irqs.radix_tree_lookup_element(
ramdump, irq_desc_tree, irq)
sdhci_irq_action = ramdump.read_word(sdhci_irq_desc + irq_action_offset)
sdhci_host = ramdump.read_word(sdhci_irq_action + dev_id)
return sdhci_host
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment