Re: [PATCH 2/2] firmware: qcom: scm: fall back to kcalloc() for no SCM device bound
From: Konrad Dybcio
Date: Mon Sep 09 2024 - 16:11:19 EST
On 9.09.2024 8:38 PM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
>
> Older platforms don't have an actual SCM device tied into the driver
> model and so there's no struct device which to use with the TZ Mem API.
> We need to fall-back to kcalloc() when allocating the buffer for
> additional SMC arguments on such platforms which don't even probe the SCM
> driver and never create the TZMem pool.
>
> Fixes: 449d0d84bcd8 ("firmware: qcom: scm: smc: switch to using the SCM allocator")
> Reported-by: Rudraksha Gupta <guptarud@xxxxxxxxx>
> Closes: https://lore.kernel.org/lkml/692cfe9a-8c05-4ce4-813e-82b3f310019a@xxxxxxxxx/<S-Del>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
> ---
Considering all SoCs that would be allowed on a roller coaster by age now
are supposed not to need this patch.. perhaps this isn't a hot enough
path for static branches, but I'd say some likely() hints could be used
here..
Konrad