]> git.baikalelectronics.ru Git - kernel.git/commit
of: restricted dma: Don't fail device probe on rmem init failure
authorWill Deacon <will@kernel.org>
Mon, 16 Aug 2021 13:26:17 +0000 (14:26 +0100)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Mon, 23 Aug 2021 10:32:04 +0000 (06:32 -0400)
commitec3200100b26631dc28b861ad6341d6befafda2a
treeae36fc12ee82720324fd473c292aea4d5ddbce4a
parent40a27350cedeef42548b244766b987cb91e456f9
of: restricted dma: Don't fail device probe on rmem init failure

If CONFIG_DMA_RESTRICTED_POOL=n then probing a device with a reference
to a "restricted-dma-pool" will fail with a reasonably cryptic error:

  | pci-host-generic: probe of 10000.pci failed with error -22

Rework of_dma_set_restricted_buffer() so that it does not cause probing
failure and instead either returns early if CONFIG_DMA_RESTRICTED_POOL=n
or emits a diagnostic if the reserved DMA pool fails to initialise.

Cc: Claire Chang <tientzu@chromium.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/of/device.c