From: Krzysztof Kozlowski <krzk@kernel.org>
To: "Friday Yang (杨阳)" <Friday.Yang@mediatek.com>,
"robh@kernel.org" <robh@kernel.org>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
"Yong Wu (吴勇)" <Yong.Wu@mediatek.com>,
"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
"conor+dt@kernel.org" <conor+dt@kernel.org>,
"AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>
Cc: "linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Project_Global_Chrome_Upstream_Group
<Project_Global_Chrome_Upstream_Group@mediatek.com>
Subject: Re: [PATCH v2 2/2] memory: mtk-smi: mt8188: Add SMI clamp function
Date: Fri, 22 Nov 2024 10:59:27 +0100 [thread overview]
Message-ID: <34f5e893-bb52-4e48-a854-0967b39cae28@kernel.org> (raw)
In-Reply-To: <e18bf1ba05c86b26fb4f18c444a19b391df29c55.camel@mediatek.com>
On 22/11/2024 10:41, Friday Yang (杨阳) wrote:
> On Wed, 2024-11-20 at 08:49 +0100, Krzysztof Kozlowski wrote:
>> External email : Please do not click links or open attachments until
>> you have verified the sender or the content.
>>
>>
>> On 20/11/2024 07:36, Friday Yang wrote:
>>> In order to avoid handling glitch signal when MTCMOS on/off, SMI
>>> need
>>> clamp and reset operation. Parse power reset settings for LARBs
>>> which
>>> need to reset. Register genpd callback for SMI LARBs and apply
>>> reset
>>> operations in the callback.
>>>
>>> Signed-off-by: Friday Yang <friday.yang@mediatek.com>
>>> ---
>>> drivers/memory/mtk-smi.c | 175
>>> ++++++++++++++++++++++++++++++++++++++-
>>> 1 file changed, 171 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
>>> index 2bc034dff691..c7119f655350 100644
>>> --- a/drivers/memory/mtk-smi.c
>>> +++ b/drivers/memory/mtk-smi.c
>>> @@ -10,15 +10,21 @@
>>> #include <linux/err.h>
>>> #include <linux/io.h>
>>> #include <linux/iopoll.h>
>>> +#include <linux/mfd/syscon.h>
>>
>> Where do you use it?
>
> device_node_to_regmap need this header file.
Ah, indeed, but then I wonder why you parse phandle instead of using
standard syscon API: syscon_regmap_lookup_by_phandle().
>
>>
>>> #include <linux/module.h>
>>> #include <linux/of.h>
>>> #include <linux/of_platform.h>
>>> #include <linux/platform_device.h>
>>> +#include <linux/pm_domain.h>
>>
>> Where do you use it?
>
> dev_pm_genpd_add_notifier need this header file.
ack
>
>>
>>> #include <linux/pm_runtime.h>
>>> +#include <linux/regmap.h>
>>
>> Where do you use it?
>
> regmap_write need this header file.
ack
>
>>
>>> +#include <linux/reset.h>
>>> +#include <linux/reset-controller.h>
>>> #include <linux/soc/mediatek/mtk_sip_svc.h>
>>> #include <soc/mediatek/smi.h>
>>> #include <dt-bindings/memory/mt2701-larb-port.h>
>>> #include <dt-bindings/memory/mtk-memory-port.h>
>>> +#include <dt-bindings/reset/mt8188-resets.h>
>>>
>>
>> ...
>
> reset_control_reset/devm_reset_control_get need reset.h
> But reset-controller.h could be removed.
> MT8188_SMI_RST_LARB10 and other index need mt8188-resets.h
>
>>
>>>
>>> +static int mtk_smi_larb_parse_clamp_info(struct mtk_smi_larb
>>> *larb)
>>> +{
>>> + struct device *dev = larb->dev;
>>> + const struct mtk_smi_larb_gen *larb_gen = larb->larb_gen;
>>> + struct device_node *smi_node;
>>> + struct of_phandle_args args;
>>> + int ret, index;
>>> +
>>> + /* Only SMI LARBs located in camera and image subsys need to
>>
>> Use Linux coding style.
>
> Sorry for the mistake, I will fix it.
>
>>
>>> + * apply clamp and reset operation, others can be skipped.
>>> + */
>>> + ret = of_parse_phandle_with_fixed_args(dev->of_node,
>>> + "resets", 1, 0,
>>> &args);
>>
>> NAK
>>
>>> + if (ret)
>>> + return 0;
>>> +
>>> + smi_node = of_parse_phandle(dev->of_node, "mediatek,smi", 0);
>>> + if (!smi_node)
>>> + return -EINVAL;
>>> +
>>> + index = args.args[0];
>>
>> That's reset, not clamp port. NAK.
>
> I could change from 'clamp_port' to 'reset_port'.
> This index is used for getting the port id from the array
> 'mtk_smi_larb_clamp_port_mt8188 ' in SMI driver.
Index is for reset, not for port ID.
> It could also be used for getting the reset signal in
> SMI reset controller driver.
>
Look at my comments from previous version - they were not under reset
property. The argument for reset is for reset provider, not this reset
consumer.
BTW, when you link to previous versions of patchset, link to lore, not
patchwork. Or just use b4.
Best regards,
Krzysztof
next prev parent reply other threads:[~2024-11-22 9:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-20 6:36 [PATCH v2 0/2] Add SMI clamp in MediaTek SMI driver Friday Yang
2024-11-20 6:36 ` [PATCH v2 1/2] dt-bindings: memory: mediatek: Add SMI reset and clamp related property Friday Yang
2024-11-20 7:43 ` Rob Herring (Arm)
2024-11-22 9:37 ` Friday Yang (杨阳)
2024-11-20 7:45 ` Krzysztof Kozlowski
2024-11-22 9:40 ` Friday Yang (杨阳)
2024-11-20 6:36 ` [PATCH v2 2/2] memory: mtk-smi: mt8188: Add SMI clamp function Friday Yang
2024-11-20 7:49 ` Krzysztof Kozlowski
2024-11-22 9:41 ` Friday Yang (杨阳)
2024-11-22 9:59 ` Krzysztof Kozlowski [this message]
2024-11-20 11:49 ` AngeloGioacchino Del Regno
2024-11-22 9:38 ` Friday Yang (杨阳)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=34f5e893-bb52-4e48-a854-0967b39cae28@kernel.org \
--to=krzk@kernel.org \
--cc=Friday.Yang@mediatek.com \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=Yong.Wu@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox