summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorCristian Marussi <cristian.marussi@arm.com>2022-10-28 17:08:29 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-11-10 20:14:23 +0300
commitb743ecf29ca7323406a20b322cffc3dac1c47468 (patch)
treedb782e117101bafac0e5b2ba73748584f0319aad /drivers
parent29e8e9bfc2f2db615f3dab42e0ba1bc73941b0c2 (diff)
downloadlinux-b743ecf29ca7323406a20b322cffc3dac1c47468.tar.xz
firmware: arm_scmi: Make Rx chan_setup fail on memory errors
[ Upstream commit be9ba1f7f9e0b565b19f4294f5871da9d654bc6d ] SCMI Rx channels are optional and they can fail to be setup when not present but anyway channels setup routines must bail-out on memory errors. Make channels setup, and related probing, fail when memory errors are reported on Rx channels. Fixes: 5c8a47a5a91d ("firmware: arm_scmi: Make scmi core independent of the transport type") Signed-off-by: Cristian Marussi <cristian.marussi@arm.com> Link: https://lore.kernel.org/r/20221028140833.280091-4-cristian.marussi@arm.com Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/firmware/arm_scmi/driver.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index 4bc974ead02b..8d24082848a8 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -711,8 +711,12 @@ scmi_txrx_setup(struct scmi_info *info, struct device *dev, int prot_id)
{
int ret = scmi_chan_setup(info, dev, prot_id, true);
- if (!ret) /* Rx is optional, hence no error check */
- scmi_chan_setup(info, dev, prot_id, false);
+ if (!ret) {
+ /* Rx is optional, report only memory errors */
+ ret = scmi_chan_setup(info, dev, prot_id, false);
+ if (ret && ret != -ENOMEM)
+ ret = 0;
+ }
return ret;
}