Re: [PATCH 2/2] firmware: qcom: scm: fall back to kcalloc() for no SCM device bound
From: Bartosz Golaszewski
Date: Wed Sep 11 2024 - 07:42:20 EST
On Tue, Sep 10, 2024 at 1:06 PM Dmitry Baryshkov
<dmitry.baryshkov@xxxxxxxxxx> wrote:
>
> >
> > I'm a little concerned about this check. I didn't think making SCM calls
> > without the SCM device probed was possible until this report. We do
> > worry about that in the downstream kernel. So, I'm not sure if this
> > scenario is currently possible in the upstream kernel.
>
> MSM8960 and MSM8660 don't have SCM devices. For MSM8960 it should be
> trivial to get it, c&p from apq8064 should. For MSM8660 it might be a
> bit harder. But even if we add such nodes, we shouldn't break existing
> DT files.
>
I'm wondering about how to approach an eventual refactoring and I'm
thinking that for platforms that are known to have DTs out there
without the node, we could exceptionally instantiate the SCM device
when the module is loaded? And then modify the driver to require the
provider to have an actual struct device attached.
Bart