OSDN Git Service

firmware: raspberrypi: Fix firmware calls with large buffers
authorJames Hughes <james.hughes@raspberrypi.org>
Fri, 16 Nov 2018 14:39:07 +0000 (14:39 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Dec 2019 07:51:26 +0000 (08:51 +0100)
commit20148a17cd0203ab4e90730055579c04cb1436cb
tree9c1111124ca9572f2dc85507a34b917128c8008c
parentb0db2672b398f16aa982807615e20639d23e3a34
firmware: raspberrypi: Fix firmware calls with large buffers

[ Upstream commit 91c6ada69f396e663acb2b713e8acb8a9463557d ]

Commit a1547e0bca51 ("firmware: raspberrypi: Remove VLA usage")
moved away from VLA's to a fixed maximum size for mailbox data.
However, some mailbox calls use larger data buffers
than the maximum allowed in that change. This fix therefor
moves from using fixed buffers to kmalloc to ensure all sizes
are catered for.

There is some documentation, which is somewhat out of date,
on the mailbox calls here :
https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface

Fixes: a1547e0bca51 ("firmware: raspberrypi: Remove VLA usage")

Signed-off-by: James Hughes <james.hughes@raspberrypi.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/firmware/raspberrypi.c