]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
firmware: meson-sm: Allow 0 as valid return value
authorCarlo Caione <carlo@endlessm.com>
Fri, 3 Mar 2017 15:17:59 +0000 (16:17 +0100)
committerKevin Hilman <khilman@baylibre.com>
Thu, 23 Mar 2017 19:22:40 +0000 (12:22 -0700)
commit7a9bc330df9b8fb3245d50a198b5c6d4d634b06f
tree2a0eb3dff0c28d6a29acf38baf46f49a9323dabe
parent83e007a0c6a3f4bfdf8f3f8d0fc266cda189b3d6
firmware: meson-sm: Allow 0 as valid return value

Some special SMC calls (i.e. the function used to retrieve the serial
number of the Amlogic SoCs) returns 0 in the register 0 also when the
data was successfully read instead of using the register to hold the
number of bytes returned in the bounce buffer as expected.

With the current implementation of the driver this is seen as an error
and meson_sm_call_read() returns an error even though the data was
correctly read.

To deal with this when we have no information about the amount of read
data (that is 0 is returned by the SMC call) we return to the caller
the requested amount of data and 0 as return value.

Signed-off-by: Carlo Caione <carlo@endlessm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
drivers/firmware/meson/meson_sm.c