• Mark Brown's avatar
    of/address: Return an error when no valid dma-ranges are found · f6933c01
    Mark Brown authored
    Commit 7a8b64d1 ("of/address: use range parser for of_dma_get_range")
    converted the parsing of dma-range properties to use code shared with the
    PCI range parser. The intent was to introduce no functional changes however
    in the case where we fail to translate the first resource instead of
    returning -EINVAL the new code we return 0. Restore the previous behaviour
    by returning an error if we find no valid ranges, the original code only
    handled the first range but subsequently support for parsing all supplied
    ranges was added.
    
    This avoids confusing code using the parsed ranges which doesn't expect to
    successfully parse ranges but have only a list terminator returned, this
    fixes breakage with so far as I can tell all DMA for on SoC devices on the
    Socionext Synquacer platform which has a firmware supplied DT. A bisect
    identified the original conversion as triggering the issues there.
    
    Fixes: 7a8b64d1 ("of/address: use range parser for of_dma_get_range")
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    Cc: Luca Di Stefano <luca.distefano@linaro.org>
    Cc: 993612@bugs.debian.org
    Cc: stable@kernel.org
    Link: https://lore.kernel.org/r/20230126-synquacer-boot-v2-1-cb80fd23c4e2@kernel.orgSigned-off-by: default avatarRob Herring <robh@kernel.org>
    f6933c01
address.c 27.4 KB