]> git.baikalelectronics.ru Git - kernel.git/commit
habanalabs: fix bug when mapping very large memory area
authorOmer Shpigelman <oshpigelman@habana.ai>
Thu, 7 Mar 2019 13:47:19 +0000 (15:47 +0200)
committerOded Gabbay <oded.gabbay@gmail.com>
Thu, 7 Mar 2019 13:47:19 +0000 (15:47 +0200)
commit9894bdf1e6e33fc1f85608b5b8d807e6621d88b9
tree0581e05df1e0e33c9816290f2d56f6708c972df7
parent56c2a51fe2ed48429c87522b7a277fbe48eb19b8
habanalabs: fix bug when mapping very large memory area

This patch fixes a bug of allocating a too big memory size with kmalloc,
which causes a failure.
In case of mapping a large memory block, an array of the relevant physical
page addresses is allocated. If there are many pages the array might be
too big to allocate with kmalloc, hence changing to kvmalloc.

Signed-off-by: Omer Shpigelman <oshpigelman@habana.ai>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/misc/habanalabs/memory.c