On 10/16/19 5:00 PM, Lorenzo Pieralisi wrote: > On Fri, Aug 09, 2019 at 07:57:40PM +0200, Marek Vasut wrote: >> From: Marek Vasut <marek.vasut+renesas@xxxxxxxxx> >> >> In case the "dma-ranges" DT property contains either too many ranges >> or the range start address is unaligned in such a way that populating >> the range into the controller requires multiple entries, a situation >> may occur where all ranges cannot be loaded into the controller. >> >> Currently, the driver refuses to probe in such a situation. Relax this >> behavior, load as many ranges as possible and warn if some ranges do >> not fit anymore. > > Patches (1) and (3) are fine but I do not think this one is. > > Firmware (DT) should provide dma-ranges according to what HW can handle, > more so given that other subsystems (eg IOMMU) rely on the dma-ranges > value to set-up eg DMA - if there is a mismatch between PCI host inbound > regions and software structures describing DMA'able ranges all bets are > off. The firmware provides all the ranges which are available and usable, that's the hardware description and that should be in the DT. The firmware cannot decide the policy for the next stage (Linux in this case) on which ranges are better to use for Linux and which are less good. Linux can then decide which ranges are best suited for it and ignore the other ones. -- Best regards, Marek Vasut