linux-stable/drivers/staging
John Stultz 54c153a084 staging: ion: Fix ion_cma_heap allocations
[ Upstream commit f292b9b280 ]

In trying to add support for drm_hwcomposer to HiKey,
I've needed to utilize the ION CMA heap, and I've noticed
problems with allocations on newer kernels failing.

It seems back with 204f672255 ("ion: Use CMA APIs directly"),
the ion_cma_heap code was modified to use the CMA API, but
kept the arguments as buffer lengths rather then number of pages.

This results in errors as we don't have enough pages in CMA to
satisfy the exaggerated requests.

This patch converts the ion_cma_heap CMA API usage to properly
request pages.

It also fixes a minor issue in the allocation where in the error
path, the cma_release is called with the buffer->size value which
hasn't yet been set.

Cc: Laura Abbott <labbott@redhat.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Cc: Archit Taneja <architt@codeaurora.org>
Cc: Greg KH <gregkh@linuxfoundation.org>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Dmitry Shmidt <dimitrysh@google.com>
Cc: Todd Kjos <tkjos@google.com>
Cc: Amit Pundir <amit.pundir@linaro.org>
Fixes: 204f672255 ("staging: android: ion: Use CMA APIs directly")
Acked-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-03 10:24:26 +01:00
..
android staging: ion: Fix ion_cma_heap allocations 2018-03-03 10:24:26 +01:00
board License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ccree staging: ccree: Uninitialized return in ssi_ahash_import() 2018-02-25 11:08:02 +01:00
clocking-wizard
comedi License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dgnc License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
emxx_udc
fbtft License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fsl-dpaa2 staging: fsl-dpaa2/eth: Account for Rx FD buffers on error path 2017-12-10 13:40:41 +01:00
fsl-mc staging: fsl-mc: fix build testing on x86 2018-02-25 11:07:52 +01:00
fwserial License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
gdm724x License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
goldfish staging: goldfish: (Coding Style) Fixed parenthesis alignment. 2017-08-31 18:21:37 +02:00
greybus staging: greybus: light: Release memory obtained by kasprintf 2017-12-25 14:26:30 +01:00
gs_fpgaboot
iio staging: iio: ad5933: switch buffer mode to software 2018-02-25 11:07:53 +01:00
irda
ks7010 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
lustre crypto: hash - annotate algorithms taking optional key 2018-02-16 20:23:00 +01:00
media License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
most License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mt29f_spinand staging: mt29f_spinand: Enable the read ECC before program the page 2017-09-18 12:25:31 +02:00
netlogic
nvec License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
octeon
octeon-usb
olpc_dcon License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pi433 staging: pi433: Move limit check to switch default to kill warning 2017-09-18 12:25:31 +02:00
rtl8188eu staging: rtl8188eu: Fix incorrect response to SIOCGIWESSID 2018-02-03 17:39:17 +01:00
rtl8192e License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rtl8192u License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rtl8712 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rtl8723bs License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rtlwifi staging: rtl8822be: Keep array subscript no lower than zero 2017-12-10 13:40:41 +01:00
rts5208 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
skein License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sm750fb staging: sm750fb: Fix parameter mistake in poke32 2017-11-21 09:49:24 +01:00
speakup License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
typec staging: typec: fusb302: make structure fusb302_psy_desc static 2017-09-01 19:06:44 +02:00
unisys License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vboxvideo staging: vboxvideo: Fix reporting invalid suggested-offset-properties 2017-11-21 09:49:24 +01:00
vc04_services License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vme License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vt6655 vt6655: Fix a possible sleep-in-atomic bug in vt6655_suspend 2017-12-20 10:10:35 +01:00
vt6656 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
wilc1000 staging: wilc1000: Fix bssid buffer offset in Txq 2017-11-21 09:49:23 +01:00
wlan-ng License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xgifb License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2017-09-06 14:45:08 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00