]> git.baikalelectronics.ru Git - kernel.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)
commit8c8c865bb16290898e3a06a32fac6e331e5e8a22
tree5aa9e3514c19b53c7467f2d6db1c0cba976cff61
parent476687853fbf43b716c9d7a0b62ed649657e72cb
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