mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Biao Huang <biao.huang@mediatek.com>
To: AngeloGioacchino Del Regno 
	<angelogioacchino.delregno@collabora.com>, <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Rob Herring <robh+dt@kernel.org>
Cc: Matthias Brugger <matthias.bgg@gmail.com>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	<netdev@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<srv_heupstream@mediatek.com>, <macpaul.lin@mediatek.com>,
	<dkirjanov@suse.de>
Subject: Re: [PATCH v4 1/7] net-next: stmmac: dwmac-mediatek: add platform level clocks management
Date: Tue, 7 Dec 2021 09:38:00 +0800	[thread overview]
Message-ID: <183a86f912ba28930845847c0b19b4118e3db80a.camel@mediatek.com> (raw)
In-Reply-To: <9dc0cbc3-8de0-f1ed-cfc9-852b7e69ab3c@collabora.com>

Dear Angelo,
	Thanks for your comments~

On Mon, 2021-12-06 at 16:14 +0100, AngeloGioacchino Del Regno wrote:
> Il 03/12/21 07:34, Biao Huang ha scritto:
> > This patch implements clks_config callback for dwmac-mediatek
> > platform,
> > which could support platform level clocks management.
> > 
> > Signed-off-by: Biao Huang <biao.huang@mediatek.com>
> > ---
> >   .../ethernet/stmicro/stmmac/dwmac-mediatek.c  | 24
> > ++++++++++++++-----
> >   1 file changed, 18 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> > b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> > index 58c0feaa8131..157ff655c85e 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> > @@ -359,9 +359,6 @@ static int mediatek_dwmac_init(struct
> > platform_device *pdev, void *priv)
> >   		return ret;
> >   	}
> >   
> > -	pm_runtime_enable(&pdev->dev);
> > -	pm_runtime_get_sync(&pdev->dev);
> > -
> >   	return 0;
> >   }
> >   
> > @@ -370,11 +367,25 @@ static void mediatek_dwmac_exit(struct
> > platform_device *pdev, void *priv)
> >   	struct mediatek_dwmac_plat_data *plat = priv;
> >   
> >   	clk_bulk_disable_unprepare(plat->num_clks_to_config, plat-
> > >clks);
> > -
> > -	pm_runtime_put_sync(&pdev->dev);
> > -	pm_runtime_disable(&pdev->dev);
> >   }
> >   
> > +static int mediatek_dwmac_clks_config(void *priv, bool enabled)
> > +{
> > +	struct mediatek_dwmac_plat_data *plat = priv;
> > +	int ret = 0;
> > +
> > +	if (enabled) {
> > +		ret = clk_bulk_prepare_enable(plat->num_clks_to_config, 
> > plat->clks);
> > +		if (ret) {
> > +			dev_err(plat->dev, "failed to enable clks, err
> > = %d\n", ret);
> > +			return ret;
> > +		}
> > +	} else {
> > +		clk_bulk_disable_unprepare(plat->num_clks_to_config,
> > plat->clks);
> > +	}
> > +
> > +	return ret;
> > +}
> >   static int mediatek_dwmac_probe(struct platform_device *pdev)
> >   {
> >   	struct mediatek_dwmac_plat_data *priv_plat;
> > @@ -420,6 +431,7 @@ static int mediatek_dwmac_probe(struct
> > platform_device *pdev)
> >   	plat_dat->bsp_priv = priv_plat;
> >   	plat_dat->init = mediatek_dwmac_init;
> >   	plat_dat->exit = mediatek_dwmac_exit;
> > +	plat_dat->clks_config = mediatek_dwmac_clks_config;
> >   	mediatek_dwmac_init(pdev, priv_plat);
> >   
> >   	ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
> > 
> 
> Hello Biao,
> 
> you're removing all calls to pm_runtime_* functions, so there is no
> more reason
> to include linux/pm_runtime.h in this file: please also remove the
> inclusion.
> 
> Thanks!
Yes, I'll remove the inclusion in the next send.

  reply	other threads:[~2021-12-07  1:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-03  6:34 [PATCH v4 0/7] MediaTek Ethernet Patches on MT8195 Biao Huang
2021-12-03  6:34 ` [PATCH v4 1/7] net-next: stmmac: dwmac-mediatek: add platform level clocks management Biao Huang
2021-12-06 15:14   ` AngeloGioacchino Del Regno
2021-12-07  1:38     ` Biao Huang [this message]
2021-12-03  6:34 ` [PATCH v4 2/7] net-next: stmmac: dwmac-mediatek: Reuse more common features Biao Huang
2021-12-03  6:34 ` [PATCH v4 3/7] arm64: dts: mt2712: update ethernet device node Biao Huang
2021-12-03  6:34 ` [PATCH v4 4/7] net-next: dt-bindings: dwmac: Convert mediatek-dwmac to DT schema Biao Huang
2021-12-03 23:34   ` Rob Herring
2021-12-03  6:34 ` [PATCH v4 5/7] net-next: stmmac: dwmac-mediatek: add support for mt8195 Biao Huang
2021-12-06 15:22   ` AngeloGioacchino Del Regno
2021-12-07  1:38     ` Biao Huang
2021-12-03  6:34 ` [PATCH v4 6/7] arm64: dts: mt8195: add ethernet device node Biao Huang
2021-12-03  6:34 ` [PATCH v4 7/7] net-next: dt-bindings: dwmac: add support for mt8195 Biao Huang

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=183a86f912ba28930845847c0b19b4118e3db80a.camel@mediatek.com \
    --to=biao.huang@mediatek.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=dkirjanov@suse.de \
    --cc=joabreu@synopsys.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=macpaul.lin@mediatek.com \
    --cc=matthias.bgg@gmail.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    --cc=robh+dt@kernel.org \
    --cc=srv_heupstream@mediatek.com \
    /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

all inboxes | Powered by JetHome®