 
	
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [RFC PATCH 2/2] xen/device-tree: Add ability to handle nodes with interrupts-extended prop
 Hi, On 02/05/2019 15:13, Oleksandr Tyshchenko wrote: From: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx> Xen expects to see "interrupts" property when parsing host device-tree. But, there are cases when some device nodes contain "interrupts-extended" property instead. The good example here is arch timer node for R-Car Gen3/Gen2 family, which is mandatory device for Xen usage on ARM. And without ability to handle such nodes, Xen fails to operate: Per the binding documentation [1], the interrupts-extend property should only be used when a device has multiple interrupt parents. This is not the case of the arch timer, so why is it used there? Don't get me wrong, I am fine with the idea of adding "interrupts-extend". However, the commit message should give some ground why a new property has been introduced/used over the current one. + /* Try the new-style interrupts-extended first */ + intnum = dt_count_phandle_with_args(device, "interrupts-extended", + "#interrupt-cells"); + if ( intnum > 0 ) IIUC dt_count_phandle_with_args, 0 would means the property is present but doesn't contain any interrupts. I do agree this is a probably a wrong device-tree, but technically I am not sure we should try to look for "#interrupts" if intnum = 0. You are re-using the exact same debug message as for "interrupts". So it would be difficult for a developer to know exactly which path is used. Could we print message regarding whether "interrupts-extended" or "interrupts" is used? 
 I don't think the check is correct. dt_parse_phandle_with_args may return a negative value in case of an error. So we likely want "res >= 0" here. Same remark for the message here. 
 Cheers, [1] linux/Documentation/devicetree/bindings/interrupt-controller -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel 
 
 
 | 
|  | Lists.xenproject.org is hosted with RackSpace, monitoring our |