Re: [PATCH 4/4] mfd: Samsung: Add Samsung sysmgr driver

From: Krzysztof Kozlowski
Date: Tue Jul 26 2022 - 04:00:51 EST


On 26/07/2022 09:51, Dongjin Yang wrote:
> On 14/07/2022 04:28, Krzysztof Kozlowski wrote:
>> On 13/07/2022 06:57, Dongjin Yang wrote:
>>>  This driver is used for SoCs produced by Samsung Foundry to provide
>>>  Samsung sysmgr API. The read/write request of sysmgr is delivered to
>>>  Samsung secure monitor call.
>>>  
>>>  Signed-off-by: Dongjin Yang <dj76.yang@xxxxxxxxxxx>
>>>  ---
>>>   MAINTAINERS                        |   2 +
>>>   drivers/mfd/Kconfig                |  11 +++
>>>   drivers/mfd/Makefile               |   1 +
>>>   drivers/mfd/samsung-sysmgr.c       | 167 +++++++++++++++++++++++++++++++++++++
>>>   include/linux/mfd/samsung-sysmgr.h |  30 +++++++
>>>   5 files changed, 211 insertions(+)
>>>   create mode 100644 drivers/mfd/samsung-sysmgr.c
>>>   create mode 100644 include/linux/mfd/samsung-sysmgr.h
>>>  
>>>  diff --git a/MAINTAINERS b/MAINTAINERS
>>>  index 55cb8901ccdc..44ad4bd406a9 100644
>>>  --- a/MAINTAINERS
>>>  +++ b/MAINTAINERS
>>>  @@ -1870,9 +1870,11 @@ F:        arch/arm/mach-artpec
>>>   F:        drivers/clk/axis
>>>   F:        drivers/crypto/axis
>>>   F:        drivers/firmware/samsung-smc-svc.c
>>>  +F:        drivers/mfd/samsung-sysmgr.c
>>>   F:        drivers/mmc/host/usdhi6rol0.c
>>>   F:        drivers/pinctrl/pinctrl-artpec*
>>>   F:        include/linux/firmware/samsung-smc-svc.h
>>>  +F:        include/linux/mfd/samsung-sysmgr.h
>>
>> Not related to Axis/Artpec SoC.
>>
>
> It is Artpec8 SoC.
>
>>>   
>>>   ARM/ASPEED I2C DRIVER
>>>   M:        Brendan Higgins <brendanhiggins@xxxxxxxxxx>
>>>  diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
>>>  index 3b59456f5545..ce6ab5842bf0 100644
>>>  --- a/drivers/mfd/Kconfig
>>>  +++ b/drivers/mfd/Kconfig
>>>  @@ -51,6 +51,17 @@ config MFD_ACT8945A
>>>             linear regulators, along with a complete ActivePath battery
>>>             charger.
>>>   
>>>  +config MFD_SAMSUNG_SYSMGR
>>>  +        bool "System Manager for Samsung Foundry platforms"
>>>  +        depends on ARCH_ARTPEC && OF
>>
>> Samsung Foundry does not match ARTPEC... Artpec 6 is not Samsung Foundry
>> SoC, is it?
>>
>
> This is for Artpec8.
>
>> Missing compile test.
>>
>
> Sorry, I will run it.
>
>>>  +        select MFD_SYSCON
>>>  +        select SAMSUNG_SECURE_SERVICE
>>>  +        help
>>>  +          Select this to get System Manager support for SoCs which use
>>>  +          Samsung Foundry platforms.
>>>  +          This System Manager has depedency on Samsung Secure Service
>>>  +          for providing secure service call.
>>
>> Looking at the driver, it does literally nothing. Looks like workaround
>> for incomplete bindings and DTS. It's a no-go.
>>
>
> This driver is for providing secure smc read/write to other IP driver in Artpec8 SoC.

There are no users of it and as I said - it looks like a workaround for
incomplete bindings. You do not justify here chosen design.


(...)

>>>  +EXPORT_SYMBOL_GPL(samsung_sysmgr_regmap_lookup_by_phandle);
>>
>> This breaks layers/encapsulation and looks like a hack for incomplete
>> bindings/DTS. No, no exporting regmaps.
>>
>
> Similar with syscon (syscon_regmap_lookup_by_phandle), but needed additional secure smc call.

That's not what the code is doing.

Best regards,
Krzysztof