[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAE=gft71J+5ui_FFm4D+62uSy6KHYzT7wru_NNdPsvrCDV3ekw@mail.gmail.com>
Date: Mon, 25 Feb 2019 15:54:50 -0800
From: Evan Green <evgreen@...omium.org>
To: Yong Wu <yong.wu@...iatek.com>
Cc: Joerg Roedel <joro@...tes.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Rob Herring <robh+dt@...nel.org>,
Robin Murphy <robin.murphy@....com>,
Tomasz Figa <tfiga@...gle.com>,
Will Deacon <will.deacon@....com>,
linux-mediatek@...ts.infradead.org, srv_heupstream@...iatek.com,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>,
linux-arm-kernel@...ts.infradead.org,
iommu@...ts.linux-foundation.org, Arnd Bergmann <arnd@...db.de>,
yingjoe.chen@...iatek.com, youlin.pei@...iatek.com,
Nicolas Boichat <drinkcat@...omium.org>
Subject: Re: [PATCH 05/13] memory: mtk-smi: Add device-link between smi-larb
and smi-common
On Mon, Dec 31, 2018 at 8:52 PM Yong Wu <yong.wu@...iatek.com> wrote:
>
> Normally, If the smi-larb HW need work, we should enable the smi-common
> HW power and clock firstly.
> This patch adds device-link between the smi-larb dev and the smi-common
> dev. then If pm_runtime_get_sync(smi-larb-dev), the pm_runtime_get_sync
> (smi-common-dev) will be called automatically.
>
> Since smi is built-in driver like IOMMU and never unbound,
> DL_FLAG_AUTOREMOVE_* is not needed.
>
> CC: Matthias Brugger <matthias.bgg@...il.com>
> Suggested-by: Tomasz Figa <tfiga@...omium.org>
> Signed-off-by: Yong Wu <yong.wu@...iatek.com>
> ---
> drivers/memory/mtk-smi.c | 16 +++++++---------
> 1 file changed, 7 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> index 9688341..30930e4 100644
> --- a/drivers/memory/mtk-smi.c
> +++ b/drivers/memory/mtk-smi.c
> @@ -271,6 +271,7 @@ static int mtk_smi_larb_probe(struct platform_device *pdev)
> struct device *dev = &pdev->dev;
> struct device_node *smi_node;
> struct platform_device *smi_pdev;
> + struct device_link *link;
>
> larb = devm_kzalloc(dev, sizeof(*larb), GFP_KERNEL);
> if (!larb)
> @@ -310,6 +311,12 @@ static int mtk_smi_larb_probe(struct platform_device *pdev)
> if (!platform_get_drvdata(smi_pdev))
> return -EPROBE_DEFER;
> larb->smi_common_dev = &smi_pdev->dev;
> + link = device_link_add(dev, larb->smi_common_dev,
> + DL_FLAG_PM_RUNTIME);
Doesn't this need to be torn down in remove()? You mention that it's
built-in and never removed, but it does seem to have a remove()
function that tears down everything else, so it seemed a shame to
start leaking now. Maybe the AUTOREMOVE flag would do it.
Powered by blists - more mailing lists