[Letux-kernel] X1600 upstreaming efforts

Paul Boddie paul at boddie.org.uk
Sat Apr 19 16:08:17 CEST 2025


On Saturday, 19 April 2025 13:55:53 CEST H. Nikolaus Schaller wrote:
> 
> any ideas what this python error means?

[...]

>   File
> "/Users/hns/Library/Python/3.11/lib/python/site-packages/dtschema/dtb.py",
> line 289, in fdt_scan_node phandles[node_dict['phandle']] = node_dict
>     ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
> TypeError: unhashable type: 'list'

Sources for browsing are here:

https://github.com/devicetree-org/dt-schema/blob/main/dtschema/dtb.py#L289

What it literally means is that the key presented to the dictionary (map, 
hashtable) cannot be hashed because it is a list, which is mutable and thus 
unsuitable. Here, the key is node_dict['phandle'] and the dictionary is 
phandles.

Evidently, a list of phandles is produced for the phandle property of 
whichever node is involved. However, the specification indicates that it 
should be a single value:

https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#phandle

Maybe uncommenting the print function call at line 288 in the code would 
reveal which node is causing the problem and in which file. Perhaps the 
nodename could be shown, too:

    print(nodename, 'phandle', node_dict['phandle'])

Running with -v would also show the filename involved.

Paul




More information about the Letux-kernel mailing list