]> asedeno.scripts.mit.edu Git - linux.git/commit
habanalabs: keep track of the device's dma mask
authorOded Gabbay <oded.gabbay@gmail.com>
Thu, 7 Mar 2019 16:03:23 +0000 (18:03 +0200)
committerOded Gabbay <oded.gabbay@gmail.com>
Thu, 7 Mar 2019 16:03:23 +0000 (18:03 +0200)
commitd9973871dae1805678ac905318a5d4cecceb6524
tree5aa9e3514c19b53c7467f2d6db1c0cba976cff61
parent66542c3b9d2fe179f7392f01aaf49a5b432426a7
habanalabs: keep track of the device's dma mask

This patch refactors the code that is responsible to set the DMA mask for
the device.

Upon each change of the dma mask, the driver will save the new value that
was set. This is needed in order to make sure we don't try to increase the
mask a second time, in case we failed in the first time. This is
especially relevant for Power machines, as that may cause a change in
configuration of the TVT which will break the device.

Goya will first try to set the device's dma mask to 39 bits, so that the
memory that is allocated on the host machine for communication with the
device's cpu will be in a bus address which is lower then 39 bits. Later,
Goya will try to increase that mask to 48 bits, but only if setting the
mask to 39 bits was successful.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/misc/habanalabs/goya/goya.c
drivers/misc/habanalabs/habanalabs.h
drivers/misc/habanalabs/habanalabs_drv.c
drivers/misc/habanalabs/pci.c