FROMLIST: of: parsing of multi #{iommu,msi}-cells in maps#445
FROMLIST: of: parsing of multi #{iommu,msi}-cells in maps#445vijayanandjitta-oss wants to merge 3 commits intoqualcomm-linux:qcom-6.18.yfrom
Conversation
shashim-quic
left a comment
There was a problem hiding this comment.
Add CRs-Fixed: to your PR description.
Make sure mainline component is associate in CR with change. This is to enforce mainline first policy.
Till this is not done and qcom-6.18.y-check is failing. PR will not merge. So please take care of this. |
Done |
You didn;t associate mainline component with the change. |
|
=
Done. Have added it now . |
Since we now have quite a few users parsing "iommu-map" and "msi-map" properties, give them some wrappers to conveniently encapsulate the appropriate sets of property names. This will also make it easier to then change of_map_id() to correctly account for specifier cells. Link: https://lore.kernel.org/all/[email protected]/ Reviewed-by: Rob Herring (Arm) <[email protected]> Reviewed-by: Frank Li <[email protected]> Acked-by: Marc Zyngier <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Signed-off-by: Robin Murphy <[email protected]> [Conflict: irq-gic-its-msi-parent.c was refactored to split of_pmsi_get_msi_info() into of_pmsi_get_dev_id() and of_v5_pmsi_get_msi_info(); updated both of_map_id() calls.] Signed-off-by: Vijayanand Jitta <[email protected]>
Change of_map_id() to take a pointer to struct of_phandle_args instead of passing target device node and translated IDs separately. Update all callers accordingly. Add an explicit filter_np parameter to of_map_id() and of_map_msi_id() to separate the filter input from the output. Previously, the target parameter served dual purpose: as an input filter (if non-NULL, only match entries targeting that node) and as an output (receiving the matched node with a reference held). Now filter_np is the explicit input filter and arg->np is the pure output. Previously, of_map_id() would call of_node_put() on the matched node when a filter was provided, making reference ownership inconsistent. Remove this internal of_node_put() call so that of_map_id() now always transfers ownership of the matched node reference to the caller via arg->np. Callers are now consistently responsible for releasing this reference with of_node_put(arg->np) when done. Link: https://lore.kernel.org/all/[email protected]/ Acked-by: Frank Li <[email protected]> Suggested-by: Rob Herring (Arm) <[email protected]> Suggested-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Charan Teja Kalla <[email protected]> [Conflict: irq-gic-its-msi-parent.c was refactored to split of_pmsi_get_msi_info() into of_pmsi_get_dev_id() and of_v5_pmsi_get_msi_info(); updated both of_map_id() calls.] Signed-off-by: Vijayanand Jitta <[email protected]>
So far our parsing of {iommu,msi}-map properties has always blindly
assumed that the output specifiers will always have exactly 1 cell.
This typically does happen to be the case, but is not actually enforced
(and the PCI msi-map binding even explicitly states support for 0 or 1
cells) - as a result we've now ended up with dodgy DTs out in the field
which depend on this behaviour to map a 1-cell specifier for a 2-cell
provider, despite that being bogus per the bindings themselves.
Since there is some potential use in being able to map at least single
input IDs to multi-cell output specifiers (and properly support 0-cell
outputs as well), add support for properly parsing and using the target
nodes' #cells values, albeit with the unfortunate complication of still
having to work around expectations of the old behaviour too.
Since there are multi-cell output specifiers, the callers of of_map_id()
may need to get the exact cell output value for further processing.
Update of_map_id() to set args_count in the output to reflect the actual
number of output specifier cells.
Link: https://lore.kernel.org/all/[email protected]/
Signed-off-by: Robin Murphy <[email protected]>
Signed-off-by: Charan Teja Kalla <[email protected]>
Signed-off-by: Vijayanand Jitta <[email protected]>
b7d3a22 to
374c98d
Compare
This series adds #{iommu,msi}-cells support in maps .
So far our parsing of {iommu,msi}-map properties has always blindly
assumed that the output specifiers will always have exactly 1 cell.
This typically does happen to be the case, but is not actually enforced
(and the PCI msi-map binding even explicitly states support for 0 or 1
cells) - as a result we've now ended up with dodgy DTs out in the field
which depend on this behaviour to map a 1-cell specifier for a 2-cell
provider, despite that being bogus per the bindings themselves.
Since there is some potential use[1] in being able to map at least
single input IDs to multi-cell output specifiers (and properly support
0-cell outputs as well), add support for properly parsing and using the
target nodes' #cells values, albeit with the unfortunate complication of
still having to work around expectations of the old behaviour too.
-- Robin.
Unlike single #{}-cell, it is complex to establish a linear relation
between input 'id' and output specifier for multi-cell properties, thus
it is always expected that len never going to be > 1.
[1] https://lore.kernel.org/all/[email protected]/
[2] PR for iommu-map dtschema: devicetree-org/dt-schema#184
Link: https://lore.kernel.org/all/[email protected]/
CRs-Fixed: 4496236